C2026-041-invisible-position-changes-as-differences #807

Merged
jjenko merged 14 commits from C2026-041-invisible-position-changes-as-differences into Development 2026-09-03 08:56:33 -04:00
3 changed files with 61 additions and 50 deletions
Showing only changes of commit 0137ccc5b3 - Show all commits

No files matched your search

+20 -2
View File
8
@@ -712,7 +712,16 @@ namespace Baseline
// Perform code to find DebugMeta files with diffences
if (cbUseTruncatedData.Checked)
{
fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta_Truncate.txt", MyIgnore);
string filename;
mschill marked this conversation as resolved Outdated
Outdated
Review

Not sure this works as intended. If not checked is fine but if checked should use "DebugMeta_Truncate.txt" if found - if not found should use "DebugMeta.txt"

Not sure this works as intended. If not checked is fine but if checked should use "DebugMeta_Truncate.txt" if found - if not found should use "DebugMeta.txt"
Outdated
Review

May need further changes --- what if (for example):

cbFile1.Text was ran the old way so it only has a DebugMeta.txt
but cbFile2.Text has a "DebugMeta_Truncate.txt"?

May need further changes --- what if (for example): cbFile1.Text was ran the old way so it only has a DebugMeta.txt but cbFile2.Text has a "DebugMeta_Truncate.txt"?
Outdated
Review

This is still an open item as of 8/26

This is still an open item as of 8/26
if (File.Exists(cbFile1.Text + "\\VEPROMS_BGE\\DebugMeta_Truncate.txt"))
{
filename = "DebugMeta_Truncate.txt";
}
else
{
filename = "DebugMeta.txt";
}
fnd = new FindFiles(cbFile1.Text, cbFile2.Text, filename, MyIgnore);
}
else
{
@@ -743,7 +752,16 @@ namespace Baseline
//Perform Search
if (cbUseTruncatedData.Checked)
{
fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta_Truncate.txt", tbSearch.Text, SearchType.Contains, cbCaseSensitive.Checked);
string filename;
if (File.Exists(cbFile1.Text + "\\VEPROMS_BGE\\DebugMeta_Truncate.txt"))
{
filename = "DebugMeta_Truncate.txt";
}
else
{
filename = "DebugMeta.txt";
}
fnd = new FindFiles(cbFile1.Text, cbFile2.Text, filename, tbSearch.Text, SearchType.Contains, cbCaseSensitive.Checked);
}
else
{
11
+40 -47
View File
@@ -1,8 +1,8 @@
using DevComponents.DotNetBar;
using System;
using System.Collections.Generic;
mschill marked this conversation as resolved Outdated
Outdated
Review

Looks like Visual Studio was trying to be "helpful". I don't think BouncyCastle is needed.

Looks like Visual Studio was trying to be "helpful". I don't think BouncyCastle is needed.
using System.IO;
using System.Text;
using System.Windows.Forms;
mschill marked this conversation as resolved Outdated
Outdated
Review

is System.Net.NetworkInformation needed?

is System.Net.NetworkInformation needed?
Outdated
Review

Agreed should be removing unnecessary usings.

Agreed should be removing unnecessary usings.
Outdated
Review

What is DevComponents.DotNetBar needed for?

What is DevComponents.DotNetBar needed for?
Outdated
Review

This was removed but it looks like another unneeded using was added. This is still an open item as of 8/26

This was removed but it looks like another unneeded using was added. This is still an open item as of 8/26
Outdated
Review

Which using are you referring to?

Which using are you referring to?
Outdated
Review

From the above - it looks like you added:
using System.Windows.Forms;
to
[PROMS/Volian.Base.Library/DebugPrint.cs]

that being said, in VIsual Studio, should be clicking on the side item and selecting remove unnecessary usings. I will forward the emails related to this / the Technical Debt cleanup

From the above - it looks like you added: using System.Windows.Forms; to [PROMS/Volian.Base.Library/DebugPrint.cs] that being said, in VIsual Studio, should be clicking on the side item and selecting remove unnecessary usings. I will forward the emails related to this / the Technical Debt cleanup
namespace Volian.Base.Library
{
@@ -155,65 +155,58 @@ namespace Volian.Base.Library
_MyDebugPrint_Truncated.Open(fileName.Replace(".txt", "_Truncated.txt"));
}
public static void Close()
{ _MyDebugPrint.Close();
_MyDebugPrint_Truncated.Close(); }
{
_MyDebugPrint.Close();
_MyDebugPrint_Truncated.Close();
}
public static void Write(string format, params object[] args)
mschill marked this conversation as resolved
Review

Write should be removed - it is not called from anywhere.

Write should be removed - it is not called from anywhere.
{
if (args[args.GetUpperBound(0)] == "truncate_false" || args[args.GetUpperBound(0)] == "truncate_true") // if there is a 9th element test the value for truncated data.
{
// test and save untruncated and truncated version of the data.
if (args[args.GetUpperBound(0)] == "truncate_false")// when untruncated data is being saved
{
_MyDebugPrint.Write(format, args);
}
else // when truncated data is being saved
{
_MyDebugPrint_Truncated.Write(format, args);
}
}
else
{
_MyDebugPrint_Truncated.Write(format, args);
_MyDebugPrint.Write(format, args); // there is a 9th element, but not for truncated data
}
}
public static void WriteLine(string format, params object[] args)
{
if (args.GetUpperBound(0) != -1) // are there arguments?
{
if(args.Length > 8)
if (args[args.GetUpperBound(0)] == "truncate_false") // if there is a 9th element test the value for truncated data.
{
if (args[8] == "truncate_false" || args[8] == "truncate_true") // if there is a 9th element test the value for truncated data.
{
// test and save untruncated and truncated version of the data.
if (args[8] == "truncate_false")// when untruncated data is being saved
{
_MyDebugPrint.WriteLine(format, args);
}
else // when truncated data is being saved
{
_MyDebugPrint_Truncated.WriteLine(format, args);
}
}
else
{
_MyDebugPrint.WriteLine(format, args); // there is a 9th element, but not for truncated data
_MyDebugPrint_Truncated.WriteLine(format, args);
}
_MyDebugPrint.Write(format, args); // only save to DebugMeta.txt if there is different truncate data.
}
else // test if asgs does not have a 9th element save data (no truncate data is available)
else
{
_MyDebugPrint.WriteLine(format, args);
_MyDebugPrint_Truncated.WriteLine(format, args);
_MyDebugPrint_Truncated.Write(format, args); // Save to both files if there is no special truncate data.
_MyDebugPrint.Write(format, args);
}
}
else
{
_MyDebugPrint_Truncated.Write(format, args);
_MyDebugPrint.Write(format, args);
}
}
public static void WriteLine(string format, params object[] args)
{
if (args.GetUpperBound(0) != -1) // are there arguments?
{
if (args[args.GetUpperBound(0)] == "truncate_false") // if there is a 9th element test the value for truncated data.
{
_MyDebugPrint.WriteLine(format, args); // only save to DebugMeta.txt if there is different truncate data.
}
else
{
_MyDebugPrint_Truncated.WriteLine(format, args); // Save to both files if there is no special truncate data.
_MyDebugPrint.WriteLine(format, args);
}
}
mschill marked this conversation as resolved Outdated
Outdated
Review

There could be additional args added so, would not go by this ---- My recommendation as below is 3 WriteLine functions. If have to use additional arguments would use boolean not strings and named arguments.

There could be additional args added so, would not go by this ---- My recommendation as below is 3 WriteLine functions. If have to use additional arguments would use boolean not strings and named arguments.
Outdated
Review

This is still an open item as of 8/26

This is still an open item as of 8/26
Outdated
Review

My concern is to know which argument will tell PROMS that there is a truncated version being saved. So I chose that it will be the last one in any arg list. I chose a name arg instead of a Boolean because it is possible that another writeline statement to DebugMeta.txt may have a boolean as the last arg which will be a mistake. I could change the flag to a single letter which might simplify things.

My concern is to know which argument will tell PROMS that there is a truncated version being saved. So I chose that it will be the last one in any arg list. I chose a name arg instead of a Boolean because it is possible that another writeline statement to DebugMeta.txt may have a boolean as the last arg which will be a mistake. I could change the flag to a single letter which might simplify things.
Outdated
Review

My recommendation is still:

              I would recommend that there be 3 WriteLine functions and not use an argument for it -
              
              A regular WriteLine that writes to both files.
              A WriteLineTruncated that writes to Only the Truncated file
              A WriteLineFullOnly that write to only the full file

when truncated text is the same would call WriteLine
when would have different would call both WriteLineTruncated & WriteLineFullOnly - each with their respected text.

Write should not be needed - it does not appear to be called in PROMS and thus should be removed / would be as part of tech debt clean-up.

If it needs to be an argument, it should be a boolean -- that being said as mentioned above better to do the 3 separate functions.
public static void WriteLine(string format, params object[] args) //writes both
public static void WriteLine_Individual(string format, params object[] args, bool isTruncated)

My recommendation is still: I would recommend that there be 3 WriteLine functions and not use an argument for it - A regular WriteLine that writes to both files. A WriteLineTruncated that writes to Only the Truncated file A WriteLineFullOnly that write to only the full file when truncated text is the same would call WriteLine when would have different would call both WriteLineTruncated & WriteLineFullOnly - each with their respected text. Write should not be needed - it does not appear to be called in PROMS and thus should be removed / would be as part of tech debt clean-up. If it needs to be an argument, it should be a boolean -- that being said as mentioned above better to do the 3 separate functions. public static void WriteLine(string format, params object[] args) //writes both public static void WriteLine_Individual(string format, params object[] args, bool isTruncated)
else
{
_MyDebugPrint_Truncated.WriteLine(format, args);
_MyDebugPrint.WriteLine(format, args);
}
}
public static void TruncateWriteLine(string format, params object[] args)
{
_MyDebugPrint_Truncated.WriteLine(format, args);
}
public static void TruncateWrite(string format, params object[] args)
{
_MyDebugPrint_Truncated.Write(format, args);
_MyDebugPrint_Truncated.Write(format, args); // SaveFileDialog special truncate data
}
public static void Show()
{ _MyDebugPrint.Show();
+1 -1
View File
@@ -1421,7 +1421,7 @@ namespace Volian.Print.Library
mschill marked this conversation as resolved
Review
  1. Per John's email:

Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta.

That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file.

Otherwise comparing the new DebugMeta would generate even more false - differences.

Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.

1. Per John's email: Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta. That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file. Otherwise comparing the new DebugMeta would generate even more false - differences. Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.
Review

For the program switch are you referring to the new checkbox in the baseline program or a PROMS switch? I added the new checkbox to baseline.

For the program switch are you referring to the new checkbox in the baseline program or a PROMS switch? I added the new checkbox to baseline.
Review

this is an old item from a week or two ago.

outstanding items include:

1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine
1 cleanup unnecessary usings
1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings

this is an old item from a week or two ago. outstanding items include: 1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine 1 cleanup unnecessary usings 1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings
Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber, "truncate_false");
mschill marked this conversation as resolved Outdated
Outdated
Review

2, just to check --- Do we want to truncate or round or use ceiling or floor?

Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as:
7.9999999999 would truncate to 7.99 and not match 8.00

2, just to check --- Do we want to truncate or round or use ceiling or floor? Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as: 7.9999999999 would truncate to 7.99 and not match 8.00
Volian.Base.Library.BaselineMetaFile.TruncateWriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, Truncate(locEndOfWordDoc, 2), Truncate(pdfSize, 2), (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber, "truncate_true");
Volian.Base.Library.BaselineMetaFile.TruncateWriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, Truncate(locEndOfWordDoc, 2), Truncate(pdfSize, 2), (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
mschill marked this conversation as resolved Outdated
Outdated
Review

For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example.

I would recommend that there be 3 WriteLine functions -

  1. A regular WriteLine that writes to both files.
  2. A WriteLineTruncated that writes to Only the Truncated file
  3. A WriteLineFullOnly that write to only the full file
For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example. I would recommend that there be 3 WriteLine functions - 1. A regular WriteLine that writes to both files. 2. A WriteLineTruncated that writes to Only the Truncated file 3. A WriteLineFullOnly that write to only the full file
Outdated
Review

This is still an open item as of 8/26. Also, it looks like you made changes to the Write function - but it is not used in PROMS - only WriteLine is.

This is still an open item as of 8/26. Also, it looks like you made changes to the Write function - but it is not used in PROMS - only WriteLine is.
AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0) + yoff);
// B2019-102 Handle PDF Destinations for Word Sections