Print Library, Svg Library, Utils Library, XYPlots

This commit is contained in:
2026-07-24 13:36:46 -04:00
parent 06c3136566
commit f67d37801a
68 changed files with 12173 additions and 16618 deletions
+17 -39
View File
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using LBWordLibrary;
using VEPROMS.CSLA.Library;
using System.Text.RegularExpressions;
@@ -10,12 +8,12 @@ namespace Volian.Print.Library
{
public class ContinuousActionSummary : IDisposable
{
private LBApplicationClass _WordApp;
private LBDocumentClass _WordDoc;
private LBSelection _WordSel;
private readonly LBApplicationClass _WordApp;
private readonly LBDocumentClass _WordDoc;
private readonly LBSelection _WordSel;
private LBTable _WordTbl;
private const string TheQuickBrownFox = "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
private VE_Font _pkFont;
private readonly VE_Font _pkFont;
public ContinuousActionSummary()
{
_WordApp = new LBApplicationClass();
@@ -41,7 +39,6 @@ namespace Volian.Print.Library
_WordApp = new LBApplicationClass();
_WordDoc = _WordApp.Documents.Add();
_WordSel = _WordApp.Selection;
//_WordApp.Visible = true;
_pkFont = pkFont;
AddTable();
AddHeader(doingTimeCriticalSummary); // F2022-024 pass flag when creating a Time Critical Action Summary report
@@ -72,11 +69,11 @@ namespace Volian.Print.Library
if (txtPageNum == "") txtPageNum = (pghC.MyParagraph.MyItemInfo.PageNumber + 1).ToString();
AddContinuousAction(NoteCautionTab, GetContActStepText(pghC.MyParagraph.MyItemInfo), doneStr, txtPageNum, 0, 0);
}
string stpTab = pgh.MyParagraph.MyItemInfo.MyTab.CleanText.Trim() + " "; // this is either the High Level step tab or the sub-step tab
string stpTab = $"{pgh.MyParagraph.MyItemInfo.MyTab.CleanText.Trim()} "; // this is either the High Level step tab or the sub-step tab
float preTabLen = 0;
if (pgh.MyParagraph.MyItemInfo.IsNote || pgh.MyParagraph.MyItemInfo.IsCaution) // only the caution and/or note is on the CAS - high level step not selected
{
stpTab = string.Format("{0} ", hlsii.MyTab.Text.Trim()) + " " + stpTab;
stpTab = $"{hlsii.MyTab.Text.Trim()} {stpTab}";
}
else if (!pgh.MyParagraph.MyItemInfo.IsHigh) // if the high level step was not included, adjust the tab for a sub-step/RNO
{
@@ -98,13 +95,13 @@ namespace Volian.Print.Library
prevItemInfo = prevItemInfo.MyParent;
}
if (_FirstLine) // the first of a CAS on the report include the High Level Step tab
sbTabPre.Insert(0, (hlsii != null) ? hlsii.MyTab.Text.Trim() + " " : "");
sbTabPre.Insert(0, (hlsii != null) ? $"{hlsii.MyTab.Text.Trim()} " : "");
tabPre = sbTabPre.ToString();
if (!_FirstLine) // if not the first line we indent the size of high level step tab
preTabLen = GetTextWidth(hlsii.MyTab.Text.Trim() + " ") / 72f;
preTabLen = GetTextWidth($"{hlsii.MyTab.Text.Trim()} ") / 72f;
if (pgh.MyParagraph.MyItemInfo.IsInRNO)
{
stpTab = stpTab.TrimEnd() + "[R] ";
stpTab = $"{stpTab.TrimEnd()}[R] ";
}
stpTab = tabPre + stpTab;
}
@@ -135,7 +132,7 @@ namespace Volian.Print.Library
string stpTab = cpgh.MyParagraph.MyItemInfo.MyTab.CleanText.Trim() + (cpgh.MyParagraph.MyItemInfo.IsInRNO ? "[R] ": " ");
if (cpgh.MyParagraph.MyItemInfo.IsNote || cpgh.MyParagraph.MyItemInfo.IsCaution)
{
stpTab = string.Format("{0} ", cpgh.MyParagraph.MyParent.MyTab.Text.Trim()) + " " + stpTab;
stpTab = $"{string.Format("{0} ", cpgh.MyParagraph.MyParent.MyTab.Text.Trim())} {stpTab}";
}
ItemInfo prevItmInfo = cpgh.MyParagraph.MyItemInfo.MyParent;
// F2026-001 the while loop below will add the sub-step's parent tab if applicable
@@ -154,19 +151,9 @@ namespace Volian.Print.Library
}
}
private string GetContActStepText(ItemInfo myItemInfo)
{
//string conActSumText = "";
//StepConfig sc = myItemInfo.MyConfig as StepConfig;
//if (sc != null && sc.Step_AlternateContActSumText != null)
// conActSumText = sc.Step_AlternateContActSumText;
//if (conActSumText == "")
// conActSumText = myItemInfo.FormattedDisplayText;
//return conActSumText;
return myItemInfo.FormattedDisplayText;
}
private string GetContActStepText(ItemInfo myItemInfo) => myItemInfo.FormattedDisplayText;
private void AddNotesOrCautions(pkParagraph pgh, int level)
private void AddNotesOrCautions(pkParagraph pgh, int level)
{
foreach (pkParagraph cpgh in pgh.MyCautionsAndNotes)
{
@@ -305,7 +292,7 @@ namespace Volian.Print.Library
}
_FirstLine = false;
}
static Regex rgx = new Regex(@"\\(b|ul|up[1-9]|dn0|up0|dn[1-9]|b0|ulnone)( |$|(?=\\))");
static readonly Regex rgx = new Regex(@"\\(b|ul|up[1-9]|dn0|up0|dn[1-9]|b0|ulnone)( |$|(?=\\))");
private void WriteRTF(string text)
{
Match m = rgx.Match(text);
@@ -363,17 +350,8 @@ namespace Volian.Print.Library
_WordSel.ParagraphFormat.Alignment = hAlign;
_WordSel.Cells.VerticalAlignment = vAlign;
}
private void Advance(int count)
{
_WordSel.MoveRight(LBWdUnits.wdCell, count, false);
}
private void Advance()
{
Advance(1);
}
public void Dispose()
{
_WordApp.Quit(false);
}
}
private void Advance(int count) => _WordSel.MoveRight(LBWdUnits.wdCell, count, false);
private void Advance() => Advance(1);
public void Dispose() => _WordApp.Quit(false);
}
}