Compare commits

...
Author SHA1 Message Date
michal 82e37dcdd1 Enhanced Writer: Added WriteRsltsEx method with header and date formatting; updated filename generation to use consistent timestamp. 2025-07-30 23:15:01 +02:00
michal 942078430e Enhanced Writer: Updated filename handling to include dynamic date-based paths; incremented version to 3.9.2144.2 2025-07-28 12:48:12 +02:00
michal 9f458c8567 default disabled check boxes 2025-07-24 12:22:22 +02:00
michal 91db4fd213 Version 3.9.2144.1 2025-07-24 12:14:05 +02:00
michal 9fc6b192c5 Enhanced Writer: Added new setting NoSeparatorBetweenItems and updated configuration controls. 2025-07-24 12:09:20 +02:00
michal f95198e40e revision update 2024-11-13 13:36:54 +01:00
michal d2b2bbb94b Merge branch 'refs/heads/feature/fix_Swindon' into master-3
# Conflicts:
#	TBF/Properties/AssemblyInfo.cs
2024-11-12 09:56:24 +01:00
michal a4246c7ea4 user groups based PL_LANG enabled, DB update needed 2024-11-12 09:52:41 +01:00
michal 498fc21412 DIVERTER close valve end time - Mark Chenges 2024-11-11 14:18:39 +01:00
michal 3f07a506ad Added new Nummer Result - Failed_meters_countE15 2024-11-06 14:58:39 +01:00
michal fb74e2d785 fix, NullPointerExeption If Order have no name 2024-11-04 15:41:09 +01:00
michal 3a2290570d Table merged columns with +,- in mixing mode returning -, old behaviour was last test evaluation 2024-10-30 15:17:24 +01:00
michal 3b68e3f9fd Version increment 2024-10-30 15:15:34 +01:00
michal 3184b1da8e LANG_PL enabled 2024-10-30 15:14:36 +01:00
michal b70a10e697 Merge branch 'master-3' into feature/outputPrinterFix 2024-10-30 06:55:55 +01:00
michal 3433bbbebe removed unnecessary, update of behaviour - textChanged 2024-10-29 09:26:04 +01:00
michal 4c0a797e98 improvement + changed behaviour 2024-10-28 22:45:50 +01:00
michal 203c2498ac temp commit - hepl method 2024-10-25 09:27:33 +02:00
michal 2023ea5221 simulate mode fix problem with Broadcast camera connection 2024-10-21 13:28:21 +02:00
20 changed files with 898 additions and 1517 deletions
+3 -2
View File
@@ -128,10 +128,11 @@ namespace Config
case GID.Administrators:
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
case GID.TraceabilityManagement:
#elif LANG_PL
//#elif LANG_PL
#endif
case GID.MetrologicalAuthority:
case GID.WaterMeterAuthority:
#endif
admin.AddGroup(group);
session.SaveOrUpdate(group); /// Save this group
break;
+12
View File
@@ -181,6 +181,18 @@ namespace Results.Entities
return WaterMeters.Count - PassedMetersCount();
}
public virtual int PassedMetersCountE15()
{
int count = 0;
foreach (var mtr in WaterMeters) if (mtr.PassedFromTestsE15()) count++;
return count;
}
public virtual int FailedMetersCountE15()
{
return WaterMeters.Count - PassedMetersCountE15();
}
public virtual long ErrorFlags()
{
long result = 0;
+24
View File
@@ -189,6 +189,12 @@ namespace Results.Entities
{
return ErrorFlagsFromTests() | ErrorFlags;
}
public virtual long ErrorFlagsFromTestsAndWMByFlag(ErrorFlagMask errorFlagsQuestion)
{
long errorFlagsMask = (long)errorFlagsQuestion;
return ErrorFlagsFromTests() & errorFlagsMask;
}
/// <summary>
/// Convert combined errorFlags of all tests to string
@@ -270,6 +276,24 @@ namespace Results.Entities
return passed;
}
public virtual bool PassedFromTestsE15()
{
//TODO BUMI this will just let us is E15
bool passed = (ErrorFlagsFromTestsAndWMByFlag(ErrorFlagMask.E15) == 0);
//TODO BUMI Check This may be not needed ?
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && (!mtr.TestDone))
{
passed = false;
break;
}
}
return passed;
}
/// <summary>
/// Three state test results and/or water meter result (Algeria PT25 requirement).
+2
View File
@@ -349,6 +349,8 @@ namespace Results
Pulses_main, /// 295 Compound main meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
Pulses_aux, /// 296 Compound aux meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
Failed_meters_countE15, /// 297
Count,
}
}
+68 -1
View File
@@ -224,15 +224,18 @@ namespace Results.Output
/// Calculate Y-coordinate taking into account cell merging
float mergedRowPos = rowPos[rowIx];
mergedCellsCount = 1;
List<string> texts = new List<string>();
texts.Add(Cells[rowIx][colIx].Text);
for (int rowIx2 = rowIx - 1; rowIx2 >= 0 && Cells[rowIx2][colIx].BottomMerge; rowIx2--)
{
mergedRowPos += rowPos[rowIx2];
mergedCellsCount++;
texts.Add(Cells[rowIx2][colIx].Text);
}
mergedRowPos /= mergedCellsCount;
/// Print the text at the calculated position
Common.Printers.PrintersCommon.PrintAt(e, Cells[rowIx][colIx].Text,
Common.Printers.PrintersCommon.PrintAt(e, mergedCellsCount == 1 ? Cells[rowIx][colIx].Text : GetMergedCellStringAsNegativeOrPositive(texts),
Cells[rowIx][colIx].Font,
left + mergedColPos,
top + mergedRowPos,
@@ -309,6 +312,70 @@ namespace Results.Output
return table;
}
public string GetMergedCellStringAsNegativeOrPositive(List<string> texts)
{
if (texts.Count < 1)
{
return "";
}
bool firstIsHead = false;
bool hasNegativeAll = true;
bool hasPositiveAll = true;
bool hasMixed = false;
string lastRowText = null;
//check if is a header
foreach (string text in texts)
{
if (text != "-")
{
hasNegativeAll = false;
}
if (text != "+")
{
hasPositiveAll = false;
}
if (!hasMixed)
{
if (lastRowText == null)
{
lastRowText = text;
}
else
{
if (lastRowText != text)
{
hasMixed = true;
}
lastRowText = text;
}
}
}
if (hasMixed)
{
//merge as negative
return "-";
}
else if (hasPositiveAll)
{
//merge as positive
return "+";
}
else if (hasNegativeAll)
{
//merge as negative
return "-";
}
return texts[0];
}
/// <summary>
/// Create a table where tests are in columns.
/// Left column contains item (or row) captions.
+1
View File
@@ -408,6 +408,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1/w.WaterMeterData.PulsesPerLtr : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_meters_count, Strings.Passed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_count, Strings.Failed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCount())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_countE15, Strings.Failed_meters_count + "E15", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCountE15())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
/// Extra water meter data
+7 -2
View File
@@ -1,20 +1,25 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStringBuilder_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3789ee403a53437cbb6b5d9ab6311f51573620_003F35_003Ff9dfb3b8_003FStringBuilder_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:Boolean x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/ShowAdvancedOptions/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=743DF7DB_002DC7B6_002D42EB_002D986D_002D0F485E5588E4/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=8648FD92_002DCDA1_002D4C3A_002DB5F9_002DFE547CE1FA48/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestTemplateMapping/=MSTest/@EntryIndexedValue">d6790ab7-33c2-4425-b2c9-51480cd1a852</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=311ca613_002Da634_002D4e0f_002Db9fb_002D4b7af9b7abb2/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="GetCorrection" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=311ca613_002Da634_002D4e0f_002Db9fb_002D4b7af9b7abb2/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="GetCorrection" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Entities.MeasurementCorrectionTest.GetCorrection&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Modbus.Meret.AdjustableScale.AdjustableMeterTest.GetCorrection&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.RtpListener&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Output.FileWriters.Enhanced.WriterTest.GetFilenameTest&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Initialize" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="Initialize" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Output.FileWriters.Enhanced.WriterTest.GetFilenameTest&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Config_002FResources_002FStrings/@EntryIndexedValue">False</s:Boolean>
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.9.2142.20")]
[assembly: AssemblyFileVersion("3.9.2142.20")]
[assembly: AssemblyVersion("3.9.2144.2")]
[assembly: AssemblyFileVersion("3.9.2144.2")]
+9 -7
View File
@@ -29,12 +29,14 @@ namespace TBF.Rig.BuiltIn
/// Relative time in [s] from the start of the operation
int timeShift; /// Set in SetValvesOp(cb, bool open, OutputPath outPath, DateTimeBox timeStamp)
/// <summary>
/// Processes coupled valves and creates switch points.
/// </summary>
/// <param name="valvesOpen">A list of opening master valves</param>
/// <param name="valvesClose">A list of closing master valves</param>
/// <returns></returns>
int waitOnCBDelay = 2; // additional wait for the correct ControlBoard response in [s]
/// <summary>
/// Processes coupled valves and creates switch points.
/// </summary>
/// <param name="valvesOpen">A list of opening master valves</param>
/// <param name="valvesClose">A list of closing master valves</param>
/// <returns></returns>
IList<SwitchPoint> AddSwitchPoints(IList<SwitchPoint> swPoints, IList<IValve> valvesOpen, IList<IValve> valvesClose, int time)
{
int ix0 = swPoints.Count;
@@ -277,7 +279,7 @@ namespace TBF.Rig.BuiltIn
{
if (nextIx >= switchPoints.Count)
{
return (StateMachine.Time >= swStartTime + maxDelayTime) ? Event.ValvesSet : Event.ValvesBusy;
return (StateMachine.Time >= swStartTime + maxDelayTime + waitOnCBDelay) ? Event.ValvesSet : Event.ValvesBusy;
}
if (StateMachine.Time >= swStartTime + switchPoints[nextIx].TimeSec)
File diff suppressed because it is too large Load Diff
@@ -297,9 +297,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox1, "comboBox1");
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Name = "comboBox1";
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
this.comboBox1.TextChanged += new System.EventHandler(this.comboBox1_TextChanged);
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress);
//
// checkBox1
//
@@ -318,9 +315,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox2, "comboBox2");
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Name = "comboBox2";
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
this.comboBox2.TextChanged += new System.EventHandler(this.comboBox2_TextChanged);
this.comboBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox2_KeyPress);
//
// label2
//
@@ -338,9 +332,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox3, "comboBox3");
this.comboBox3.FormattingEnabled = true;
this.comboBox3.Name = "comboBox3";
this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged);
this.comboBox3.TextChanged += new System.EventHandler(this.comboBox3_TextChanged);
this.comboBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox3_KeyPress);
//
// label3
//
@@ -358,9 +349,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox4, "comboBox4");
this.comboBox4.FormattingEnabled = true;
this.comboBox4.Name = "comboBox4";
this.comboBox4.SelectedIndexChanged += new System.EventHandler(this.comboBox4_SelectedIndexChanged);
this.comboBox4.TextChanged += new System.EventHandler(this.comboBox4_TextChanged);
this.comboBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox4_KeyPress);
//
// label4
//
@@ -378,9 +366,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox5, "comboBox5");
this.comboBox5.FormattingEnabled = true;
this.comboBox5.Name = "comboBox5";
this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged);
this.comboBox5.TextChanged += new System.EventHandler(this.comboBox5_TextChanged);
this.comboBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox5_KeyPress);
//
// label5
//
@@ -398,9 +383,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox6, "comboBox6");
this.comboBox6.FormattingEnabled = true;
this.comboBox6.Name = "comboBox6";
this.comboBox6.SelectedIndexChanged += new System.EventHandler(this.comboBox6_SelectedIndexChanged);
this.comboBox6.TextChanged += new System.EventHandler(this.comboBox6_TextChanged);
this.comboBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox6_KeyPress);
//
// label6
//
@@ -418,9 +400,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox7, "comboBox7");
this.comboBox7.FormattingEnabled = true;
this.comboBox7.Name = "comboBox7";
this.comboBox7.SelectedIndexChanged += new System.EventHandler(this.comboBox7_SelectedIndexChanged);
this.comboBox7.TextChanged += new System.EventHandler(this.comboBox7_TextChanged);
this.comboBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox7_KeyPress);
//
// label7
//
@@ -438,9 +417,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox8, "comboBox8");
this.comboBox8.FormattingEnabled = true;
this.comboBox8.Name = "comboBox8";
this.comboBox8.SelectedIndexChanged += new System.EventHandler(this.comboBox8_SelectedIndexChanged);
this.comboBox8.TextChanged += new System.EventHandler(this.comboBox8_TextChanged);
this.comboBox8.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox8_KeyPress);
//
// label8
//
@@ -458,9 +434,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox9, "comboBox9");
this.comboBox9.FormattingEnabled = true;
this.comboBox9.Name = "comboBox9";
this.comboBox9.SelectedIndexChanged += new System.EventHandler(this.comboBox9_SelectedIndexChanged);
this.comboBox9.TextChanged += new System.EventHandler(this.comboBox9_TextChanged);
this.comboBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox9_KeyPress);
//
// label9
//
@@ -478,9 +451,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox10, "comboBox10");
this.comboBox10.FormattingEnabled = true;
this.comboBox10.Name = "comboBox10";
this.comboBox10.SelectedIndexChanged += new System.EventHandler(this.comboBox10_SelectedIndexChanged);
this.comboBox10.TextChanged += new System.EventHandler(this.comboBox10_TextChanged);
this.comboBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox10_KeyPress);
//
// label10
//
@@ -498,9 +468,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox11, "comboBox11");
this.comboBox11.FormattingEnabled = true;
this.comboBox11.Name = "comboBox11";
this.comboBox11.SelectedIndexChanged += new System.EventHandler(this.comboBox11_SelectedIndexChanged);
this.comboBox11.TextChanged += new System.EventHandler(this.comboBox11_TextChanged);
this.comboBox11.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox11_KeyPress);
//
// label11
//
@@ -518,9 +485,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox12, "comboBox12");
this.comboBox12.FormattingEnabled = true;
this.comboBox12.Name = "comboBox12";
this.comboBox12.SelectedIndexChanged += new System.EventHandler(this.comboBox12_SelectedIndexChanged);
this.comboBox12.TextChanged += new System.EventHandler(this.comboBox12_TextChanged);
this.comboBox12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox12_KeyPress);
//
// label12
//
@@ -538,9 +502,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox13, "comboBox13");
this.comboBox13.FormattingEnabled = true;
this.comboBox13.Name = "comboBox13";
this.comboBox13.SelectedIndexChanged += new System.EventHandler(this.comboBox13_SelectedIndexChanged);
this.comboBox13.TextChanged += new System.EventHandler(this.comboBox13_TextChanged);
this.comboBox13.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox13_KeyPress);
//
// label13
//
@@ -558,9 +519,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox14, "comboBox14");
this.comboBox14.FormattingEnabled = true;
this.comboBox14.Name = "comboBox14";
this.comboBox14.SelectedIndexChanged += new System.EventHandler(this.comboBox14_SelectedIndexChanged);
this.comboBox14.TextChanged += new System.EventHandler(this.comboBox14_TextChanged);
this.comboBox14.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox14_KeyPress);
//
// label14
//
@@ -578,9 +536,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox15, "comboBox15");
this.comboBox15.FormattingEnabled = true;
this.comboBox15.Name = "comboBox15";
this.comboBox15.SelectedIndexChanged += new System.EventHandler(this.comboBox15_SelectedIndexChanged);
this.comboBox15.TextChanged += new System.EventHandler(this.comboBox15_TextChanged);
this.comboBox15.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox15_KeyPress);
//
// label15
//
@@ -598,9 +553,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox16, "comboBox16");
this.comboBox16.FormattingEnabled = true;
this.comboBox16.Name = "comboBox16";
this.comboBox16.SelectedIndexChanged += new System.EventHandler(this.comboBox16_SelectedIndexChanged);
this.comboBox16.TextChanged += new System.EventHandler(this.comboBox16_TextChanged);
this.comboBox16.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox16_KeyPress);
//
// label16
//
@@ -618,9 +570,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox17, "comboBox17");
this.comboBox17.FormattingEnabled = true;
this.comboBox17.Name = "comboBox17";
this.comboBox17.SelectedIndexChanged += new System.EventHandler(this.comboBox17_SelectedIndexChanged);
this.comboBox17.TextChanged += new System.EventHandler(this.comboBox17_TextChanged);
this.comboBox17.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox17_KeyPress);
//
// label17
//
@@ -638,9 +587,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox18, "comboBox18");
this.comboBox18.FormattingEnabled = true;
this.comboBox18.Name = "comboBox18";
this.comboBox18.SelectedIndexChanged += new System.EventHandler(this.comboBox18_SelectedIndexChanged);
this.comboBox18.TextChanged += new System.EventHandler(this.comboBox18_TextChanged);
this.comboBox18.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox18_KeyPress);
//
// label18
//
@@ -658,9 +604,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox19, "comboBox19");
this.comboBox19.FormattingEnabled = true;
this.comboBox19.Name = "comboBox19";
this.comboBox19.SelectedIndexChanged += new System.EventHandler(this.comboBox19_SelectedIndexChanged);
this.comboBox19.TextChanged += new System.EventHandler(this.comboBox19_TextChanged);
this.comboBox19.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox19_KeyPress);
//
// label19
//
@@ -678,9 +621,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox20, "comboBox20");
this.comboBox20.FormattingEnabled = true;
this.comboBox20.Name = "comboBox20";
this.comboBox20.SelectedIndexChanged += new System.EventHandler(this.comboBox20_SelectedIndexChanged);
this.comboBox20.TextChanged += new System.EventHandler(this.comboBox20_TextChanged);
this.comboBox20.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox20_KeyPress);
//
// label20
//
@@ -698,9 +638,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox21, "comboBox21");
this.comboBox21.FormattingEnabled = true;
this.comboBox21.Name = "comboBox21";
this.comboBox21.SelectedIndexChanged += new System.EventHandler(this.comboBox21_SelectedIndexChanged);
this.comboBox21.TextChanged += new System.EventHandler(this.comboBox21_TextChanged);
this.comboBox21.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox21_KeyPress);
//
// label21
//
@@ -718,9 +655,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox22, "comboBox22");
this.comboBox22.FormattingEnabled = true;
this.comboBox22.Name = "comboBox22";
this.comboBox22.SelectedIndexChanged += new System.EventHandler(this.comboBox22_SelectedIndexChanged);
this.comboBox22.TextChanged += new System.EventHandler(this.comboBox22_TextChanged);
this.comboBox22.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox22_KeyPress);
//
// label22
//
@@ -738,9 +672,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox23, "comboBox23");
this.comboBox23.FormattingEnabled = true;
this.comboBox23.Name = "comboBox23";
this.comboBox23.SelectedIndexChanged += new System.EventHandler(this.comboBox23_SelectedIndexChanged);
this.comboBox23.TextChanged += new System.EventHandler(this.comboBox23_TextChanged);
this.comboBox23.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox23_KeyPress);
//
// label23
//
@@ -758,9 +689,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox24, "comboBox24");
this.comboBox24.FormattingEnabled = true;
this.comboBox24.Name = "comboBox24";
this.comboBox24.SelectedIndexChanged += new System.EventHandler(this.comboBox24_SelectedIndexChanged);
this.comboBox24.TextChanged += new System.EventHandler(this.comboBox24_TextChanged);
this.comboBox24.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox24_KeyPress);
//
// label24
//
@@ -778,9 +706,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox48, "comboBox48");
this.comboBox48.FormattingEnabled = true;
this.comboBox48.Name = "comboBox48";
this.comboBox48.SelectedIndexChanged += new System.EventHandler(this.comboBox48_SelectedIndexChanged);
this.comboBox48.TextChanged += new System.EventHandler(this.comboBox48_TextChanged);
this.comboBox48.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox48_KeyPress);
//
// label48
//
@@ -798,9 +723,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox47, "comboBox47");
this.comboBox47.FormattingEnabled = true;
this.comboBox47.Name = "comboBox47";
this.comboBox47.SelectedIndexChanged += new System.EventHandler(this.comboBox47_SelectedIndexChanged);
this.comboBox47.TextChanged += new System.EventHandler(this.comboBox47_TextChanged);
this.comboBox47.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox47_KeyPress);
//
// label47
//
@@ -818,9 +740,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox46, "comboBox46");
this.comboBox46.FormattingEnabled = true;
this.comboBox46.Name = "comboBox46";
this.comboBox46.SelectedIndexChanged += new System.EventHandler(this.comboBox46_SelectedIndexChanged);
this.comboBox46.TextChanged += new System.EventHandler(this.comboBox46_TextChanged);
this.comboBox46.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox46_KeyPress);
//
// label46
//
@@ -838,9 +757,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox45, "comboBox45");
this.comboBox45.FormattingEnabled = true;
this.comboBox45.Name = "comboBox45";
this.comboBox45.SelectedIndexChanged += new System.EventHandler(this.comboBox45_SelectedIndexChanged);
this.comboBox45.TextChanged += new System.EventHandler(this.comboBox45_TextChanged);
this.comboBox45.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox45_KeyPress);
//
// label45
//
@@ -858,9 +774,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox44, "comboBox44");
this.comboBox44.FormattingEnabled = true;
this.comboBox44.Name = "comboBox44";
this.comboBox44.SelectedIndexChanged += new System.EventHandler(this.comboBox44_SelectedIndexChanged);
this.comboBox44.TextChanged += new System.EventHandler(this.comboBox44_TextChanged);
this.comboBox44.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox44_KeyPress);
//
// label44
//
@@ -878,9 +791,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox43, "comboBox43");
this.comboBox43.FormattingEnabled = true;
this.comboBox43.Name = "comboBox43";
this.comboBox43.SelectedIndexChanged += new System.EventHandler(this.comboBox43_SelectedIndexChanged);
this.comboBox43.TextChanged += new System.EventHandler(this.comboBox43_TextChanged);
this.comboBox43.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox43_KeyPress);
//
// label43
//
@@ -898,9 +808,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox42, "comboBox42");
this.comboBox42.FormattingEnabled = true;
this.comboBox42.Name = "comboBox42";
this.comboBox42.SelectedIndexChanged += new System.EventHandler(this.comboBox42_SelectedIndexChanged);
this.comboBox42.TextChanged += new System.EventHandler(this.comboBox42_TextChanged);
this.comboBox42.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox42_KeyPress);
//
// label42
//
@@ -918,9 +825,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox41, "comboBox41");
this.comboBox41.FormattingEnabled = true;
this.comboBox41.Name = "comboBox41";
this.comboBox41.SelectedIndexChanged += new System.EventHandler(this.comboBox41_SelectedIndexChanged);
this.comboBox41.TextChanged += new System.EventHandler(this.comboBox41_TextChanged);
this.comboBox41.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox41_KeyPress);
//
// label41
//
@@ -938,9 +842,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox40, "comboBox40");
this.comboBox40.FormattingEnabled = true;
this.comboBox40.Name = "comboBox40";
this.comboBox40.SelectedIndexChanged += new System.EventHandler(this.comboBox40_SelectedIndexChanged);
this.comboBox40.TextChanged += new System.EventHandler(this.comboBox40_TextChanged);
this.comboBox40.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox40_KeyPress);
//
// label40
//
@@ -958,9 +859,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox39, "comboBox39");
this.comboBox39.FormattingEnabled = true;
this.comboBox39.Name = "comboBox39";
this.comboBox39.SelectedIndexChanged += new System.EventHandler(this.comboBox39_SelectedIndexChanged);
this.comboBox39.TextChanged += new System.EventHandler(this.comboBox39_TextChanged);
this.comboBox39.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox39_KeyPress);
//
// label39
//
@@ -978,9 +876,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox38, "comboBox38");
this.comboBox38.FormattingEnabled = true;
this.comboBox38.Name = "comboBox38";
this.comboBox38.SelectedIndexChanged += new System.EventHandler(this.comboBox38_SelectedIndexChanged);
this.comboBox38.TextChanged += new System.EventHandler(this.comboBox38_TextChanged);
this.comboBox38.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox38_KeyPress);
//
// label38
//
@@ -998,9 +893,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox37, "comboBox37");
this.comboBox37.FormattingEnabled = true;
this.comboBox37.Name = "comboBox37";
this.comboBox37.SelectedIndexChanged += new System.EventHandler(this.comboBox37_SelectedIndexChanged);
this.comboBox37.TextChanged += new System.EventHandler(this.comboBox37_TextChanged);
this.comboBox37.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox37_KeyPress);
//
// label37
//
@@ -1018,9 +910,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox36, "comboBox36");
this.comboBox36.FormattingEnabled = true;
this.comboBox36.Name = "comboBox36";
this.comboBox36.SelectedIndexChanged += new System.EventHandler(this.comboBox36_SelectedIndexChanged);
this.comboBox36.TextChanged += new System.EventHandler(this.comboBox36_TextChanged);
this.comboBox36.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox36_KeyPress);
//
// label36
//
@@ -1038,9 +927,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox35, "comboBox35");
this.comboBox35.FormattingEnabled = true;
this.comboBox35.Name = "comboBox35";
this.comboBox35.SelectedIndexChanged += new System.EventHandler(this.comboBox35_SelectedIndexChanged);
this.comboBox35.TextChanged += new System.EventHandler(this.comboBox35_TextChanged);
this.comboBox35.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox35_KeyPress);
//
// label35
//
@@ -1058,9 +944,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox34, "comboBox34");
this.comboBox34.FormattingEnabled = true;
this.comboBox34.Name = "comboBox34";
this.comboBox34.SelectedIndexChanged += new System.EventHandler(this.comboBox34_SelectedIndexChanged);
this.comboBox34.TextChanged += new System.EventHandler(this.comboBox34_TextChanged);
this.comboBox34.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox34_KeyPress);
//
// label34
//
@@ -1078,8 +961,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox33, "comboBox33");
this.comboBox33.FormattingEnabled = true;
this.comboBox33.Name = "comboBox33";
this.comboBox33.TextChanged += new System.EventHandler(this.comboBox33_TextChanged);
this.comboBox33.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox33_KeyPress);
//
// label33
//
@@ -1097,9 +978,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox32, "comboBox32");
this.comboBox32.FormattingEnabled = true;
this.comboBox32.Name = "comboBox32";
this.comboBox32.SelectedIndexChanged += new System.EventHandler(this.comboBox32_SelectedIndexChanged);
this.comboBox32.TextChanged += new System.EventHandler(this.comboBox32_TextChanged);
this.comboBox32.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox32_KeyPress);
//
// label32
//
@@ -1117,9 +995,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox31, "comboBox31");
this.comboBox31.FormattingEnabled = true;
this.comboBox31.Name = "comboBox31";
this.comboBox31.SelectedIndexChanged += new System.EventHandler(this.comboBox31_SelectedIndexChanged);
this.comboBox31.TextChanged += new System.EventHandler(this.comboBox31_TextChanged);
this.comboBox31.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox31_KeyPress);
//
// label31
//
@@ -1137,9 +1012,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox30, "comboBox30");
this.comboBox30.FormattingEnabled = true;
this.comboBox30.Name = "comboBox30";
this.comboBox30.SelectedIndexChanged += new System.EventHandler(this.comboBox30_SelectedIndexChanged);
this.comboBox30.TextChanged += new System.EventHandler(this.comboBox30_TextChanged);
this.comboBox30.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox30_KeyPress);
//
// label30
//
@@ -1157,9 +1029,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox29, "comboBox29");
this.comboBox29.FormattingEnabled = true;
this.comboBox29.Name = "comboBox29";
this.comboBox29.SelectedIndexChanged += new System.EventHandler(this.comboBox29_SelectedIndexChanged);
this.comboBox29.TextChanged += new System.EventHandler(this.comboBox29_TextChanged);
this.comboBox29.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox29_KeyPress);
//
// label29
//
@@ -1177,9 +1046,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox28, "comboBox28");
this.comboBox28.FormattingEnabled = true;
this.comboBox28.Name = "comboBox28";
this.comboBox28.SelectedIndexChanged += new System.EventHandler(this.comboBox28_SelectedIndexChanged);
this.comboBox28.TextChanged += new System.EventHandler(this.comboBox28_TextChanged);
this.comboBox28.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox28_KeyPress);
//
// label28
//
@@ -1197,9 +1063,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox27, "comboBox27");
this.comboBox27.FormattingEnabled = true;
this.comboBox27.Name = "comboBox27";
this.comboBox27.SelectedIndexChanged += new System.EventHandler(this.comboBox27_SelectedIndexChanged);
this.comboBox27.TextChanged += new System.EventHandler(this.comboBox27_TextChanged);
this.comboBox27.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox27_KeyPress);
//
// label27
//
@@ -1217,9 +1080,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox26, "comboBox26");
this.comboBox26.FormattingEnabled = true;
this.comboBox26.Name = "comboBox26";
this.comboBox26.SelectedIndexChanged += new System.EventHandler(this.comboBox26_SelectedIndexChanged);
this.comboBox26.TextChanged += new System.EventHandler(this.comboBox26_TextChanged);
this.comboBox26.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox26_KeyPress);
//
// label26
//
@@ -1237,9 +1097,6 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
resources.ApplyResources(this.comboBox25, "comboBox25");
this.comboBox25.FormattingEnabled = true;
this.comboBox25.Name = "comboBox25";
this.comboBox25.SelectedIndexChanged += new System.EventHandler(this.comboBox25_SelectedIndexChanged);
this.comboBox25.TextChanged += new System.EventHandler(this.comboBox25_TextChanged);
this.comboBox25.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox25_KeyPress);
//
// label25
//
+6 -1
View File
@@ -2,6 +2,7 @@
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Net;
using Common;
using log4net;
namespace TBF.Rig.Network.Adapter
@@ -37,7 +38,11 @@ namespace TBF.Rig.Network.Adapter
AdapterInfo netadapter = AdapterInfo.GetNetAdapter(netadapterCfg.Description);
ipAddress = netadapter.IPAddress;
netMask = netadapter.NetMask;
broadcastAddress = netadapter.GetBroadcastAddress();
if (this.Cfg.DebugLevel != DebugMode.Simulate)
{
broadcastAddress = netadapter.GetBroadcastAddress();
}
}
}
}
+26 -7
View File
@@ -127,11 +127,16 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
/// </summary>
/// <param name="time">Date and time</param>
/// <returns>File name</returns>
string GetFilename(string destinationPath, Results.Entities.Batch batch)
public string GetFilename(string destinationPath, Results.Entities.Batch batch, DateTime now)
{
string directory = destinationPath; /// Ends with "\\";
DateTime time = batch.EndTime;
if (writerCfg.FileNameFormat.Contains("{5:"))
{
time = now; //define path and file name now
}
switch (writerCfg.YearFolders)
{
case YearFolders.FourDigit:
@@ -195,7 +200,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
else
{
TBF.Rig.GenericDevices.IBenchInfo bi = TBF.Rig.Sequences.ProcessData.BenchInfo;
return directory + string.Format(writerCfg.FileNameFormat, batch.EndTime, batch.StartTime, batch.BatchNr, bi.TestBenchName, bi.TestBenchId);
return directory + string.Format(writerCfg.FileNameFormat, batch.EndTime, batch.StartTime, batch.BatchNr, bi.TestBenchName, bi.TestBenchId, time);
}
}
catch
@@ -248,6 +253,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
}
void WriteRslts(Results.Entities.Batch batch, string destination)
{
if (batch == null || batch.WaterMeters == null || batch.WaterMeters.Count <= 0) return;
@@ -257,8 +263,9 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
StreamWriter writer = StreamWriter.Null;
try
{
writer = File.AppendText(GetFilename(destination, batch));
WriteRsltsEx(batch, writer);
DateTime now = DateTime.Now; // Common time for '{5:' possibility of output
writer = File.AppendText(GetFilename(destination, batch, now));
WriteRsltsEx(batch, writer,now);
log.WarnFormat("Batch {0} written by {1} to file {2}", batch.BatchNr, Name, destination);
}
catch
@@ -273,7 +280,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
}
void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr)
public void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr, DateTime now)
{
///----------
/// Header
@@ -291,7 +298,15 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
if (v.Uid == 72 && writerCfg.FileNameFormat.Contains("{5:"))
{
rightColumn[cnt] = string.Format(v.Format, now);
}
else
{
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
}
cnt++;
}
@@ -308,7 +323,11 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
{
wrtr.Write(new string(' ', maxLen - leftColumn[i].Length + 3));
}
wrtr.Write(separatorStr);
if (!writerCfg.NoSeparatorBetweenItems)
{
wrtr.Write(separatorStr);
}
wrtr.WriteLine(rightColumn[i]);
}
@@ -33,6 +33,13 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
public string[] SelectedItems;
public string Footer;
[XmlIgnore]
private bool? noSeparatorBetweenItems;
public bool NoSeparatorBetweenItems {
get { return noSeparatorBetweenItems.HasValue ? noSeparatorBetweenItems.Value : false; }
set { noSeparatorBetweenItems = value;}
}
[XmlIgnore]
public MetersKind MetersKind;
@@ -61,11 +68,12 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
SaveGoodOnly = false;
Header = string.Empty;
Footer = string.Empty;
NoSeparatorBetweenItems = false;
}
public string ToString(int i)
{
return string.Format("{0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Separator={6}, NoSpaces={7}, GoodOnly={8}",
return string.Format("{0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Separator={6}, NoSpaces={7}, GoodOnly={8}, NoSeparatorBetweenItems={9}",
Name,
DestinationPath,
YearFolders,
@@ -74,7 +82,8 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
FileNameFormat,
Separator,
EliminateSpaces,
SaveGoodOnly);
SaveGoodOnly,
NoSeparatorBetweenItems);
}
}
}
@@ -69,6 +69,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
separatorLabel.Text = "Separator";
eliminateSpacesCheckBox.Text = "No spaces";
goodOnlyCheckBox.Text = "Good only";
noSeparatorCICheckBox.Text = "No separ. `Common i`";
headerButton.Text = Strings.Header;
commonItemsButton.Text = "Common items";
testItemsButton.Text = "Test items";
@@ -96,7 +97,8 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
separatorComboBox.Text = config.Separator.ToString();
eliminateSpacesCheckBox.Checked = config.EliminateSpaces;
goodOnlyCheckBox.Checked = config.SaveGoodOnly;
}
noSeparatorCICheckBox.Checked = config.NoSeparatorBetweenItems;
}
public void Unlock()
{
@@ -118,6 +120,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
commonItemsButton.Enabled = true;
testItemsButton.Enabled = true;
footerButton.Enabled = true;
noSeparatorCICheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -255,6 +258,12 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
config.SaveGoodOnly = goodOnlyCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.NoSeparatorBetweenItems != noSeparatorCICheckBox.Checked)
{
config.NoSeparatorBetweenItems = noSeparatorCICheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header)
{
+447 -397
View File
@@ -25,409 +25,459 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
this.testItemsButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
this.fileNameFmtLabel = new System.Windows.Forms.Label();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.headerButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.commonItemsButton = new System.Windows.Forms.Button();
this.upgradeWizardButton = new System.Windows.Forms.Button();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.subtitleFmtTextBox = new System.Windows.Forms.TextBox();
this.subtitleFmtLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(108, 28);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(17, 31);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(105, 6);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(108, 49);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(146, 20);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(17, 52);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(60, 13);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(269, 49);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 5;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(17, 224);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
this.separatorLabel.TabIndex = 19;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(108, 221);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
this.separatorComboBox.TabIndex = 20;
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(108, 296);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(146, 23);
this.testItemsButton.TabIndex = 25;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(17, 94);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(63, 13);
this.yearFoldersLabel.TabIndex = 9;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(17, 116);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(71, 13);
this.monthFoldersLabel.TabIndex = 11;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(17, 138);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(60, 13);
this.dayFoldersLabel.TabIndex = 13;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(108, 91);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.yearFoldersComboBox.TabIndex = 10;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(108, 113);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.monthFoldersComboBox.TabIndex = 12;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(108, 135);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.dayFoldersComboBox.TabIndex = 14;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(269, 70);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(30, 20);
this.destination2Button.TabIndex = 8;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(108, 70);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(146, 20);
this.destination2TextBox.TabIndex = 7;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(17, 73);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(69, 13);
this.destination2Label.TabIndex = 6;
this.destination2Label.Text = "Destination 2";
//
// fileNameFmtTextBox
//
this.fileNameFmtTextBox.Enabled = false;
this.fileNameFmtTextBox.Location = new System.Drawing.Point(108, 157);
this.fileNameFmtTextBox.Name = "fileNameFmtTextBox";
this.fileNameFmtTextBox.Size = new System.Drawing.Size(146, 20);
this.fileNameFmtTextBox.TabIndex = 16;
//
// fileNameFmtLabel
//
this.fileNameFmtLabel.AutoSize = true;
this.fileNameFmtLabel.Location = new System.Drawing.Point(17, 160);
this.fileNameFmtLabel.Name = "fileNameFmtLabel";
this.fileNameFmtLabel.Size = new System.Drawing.Size(84, 13);
this.fileNameFmtLabel.TabIndex = 15;
this.fileNameFmtLabel.Text = "File name format";
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(20, 262);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(77, 17);
this.eliminateSpacesCheckBox.TabIndex = 21;
this.eliminateSpacesCheckBox.Text = "No spaces";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(108, 246);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(146, 23);
this.headerButton.TabIndex = 23;
this.headerButton.Text = "Header";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(108, 321);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(146, 23);
this.footerButton.TabIndex = 26;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(108, 271);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(146, 23);
this.commonItemsButton.TabIndex = 24;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// upgradeWizardButton
//
this.upgradeWizardButton.Location = new System.Drawing.Point(269, 271);
this.upgradeWizardButton.Name = "upgradeWizardButton";
this.upgradeWizardButton.Size = new System.Drawing.Size(80, 48);
this.upgradeWizardButton.TabIndex = 27;
this.upgradeWizardButton.Text = "Upgrade wizard";
this.upgradeWizardButton.UseVisualStyleBackColor = true;
this.upgradeWizardButton.Click += new System.EventHandler(this.upgradeWizardButton_Click);
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(108, 178);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(146, 21);
this.cultureComboBox.TabIndex = 18;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(17, 181);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 17;
this.cultureLabel.Text = "Cullture";
//
// goodOnlyCheckBox
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(20, 285);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 22;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
//
// subtitleFmtTextBox
//
this.subtitleFmtTextBox.Enabled = false;
this.subtitleFmtTextBox.Location = new System.Drawing.Point(108, 200);
this.subtitleFmtTextBox.Name = "subtitleFmtTextBox";
this.subtitleFmtTextBox.Size = new System.Drawing.Size(146, 20);
this.subtitleFmtTextBox.TabIndex = 29;
//
// subtitleFmtLabel
//
this.subtitleFmtLabel.AutoSize = true;
this.subtitleFmtLabel.Location = new System.Drawing.Point(17, 203);
this.subtitleFmtLabel.Name = "subtitleFmtLabel";
this.subtitleFmtLabel.Size = new System.Drawing.Size(74, 13);
this.subtitleFmtLabel.TabIndex = 28;
this.subtitleFmtLabel.Text = "Subtitle format";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(257, 211);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(174, 13);
this.label1.TabIndex = 30;
this.label1.Text = "4:wmStr 5:s/n 6:main s/n 7:aux.s/n";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(257, 198);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(168, 13);
this.label2.TabIndex = 31;
this.label2.Text = "0:pos 1:s/n 2:aux.s/n 3:compl.s/n";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(257, 155);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(138, 13);
this.label3.TabIndex = 32;
this.label3.Text = "0:end t. 1:start t. 2:batch nr.";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(257, 168);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(128, 13);
this.label4.TabIndex = 33;
this.label4.Text = "3:bench name 4:bench id";
//
// WriterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.subtitleFmtTextBox);
this.Controls.Add(this.subtitleFmtLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.upgradeWizardButton);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.fileNameFmtTextBox);
this.Controls.Add(this.fileNameFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "WriterCfgCtrl";
this.Size = new System.Drawing.Size(440, 350);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
this.testItemsButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
this.fileNameFmtLabel = new System.Windows.Forms.Label();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.headerButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.commonItemsButton = new System.Windows.Forms.Button();
this.upgradeWizardButton = new System.Windows.Forms.Button();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.subtitleFmtTextBox = new System.Windows.Forms.TextBox();
this.subtitleFmtLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.noSeparatorCICheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(162, 43);
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(217, 26);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(26, 48);
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(51, 20);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(158, 9);
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(125, 20);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(162, 75);
this.destinationTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(217, 26);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(26, 80);
this.destinationLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(90, 20);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(404, 75);
this.destinationButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(45, 31);
this.destinationButton.TabIndex = 5;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(26, 345);
this.separatorLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(80, 20);
this.separatorLabel.TabIndex = 19;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(162, 340);
this.separatorComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(217, 28);
this.separatorComboBox.TabIndex = 20;
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(162, 455);
this.testItemsButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(219, 35);
this.testItemsButton.TabIndex = 25;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(26, 145);
this.yearFoldersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(95, 20);
this.yearFoldersLabel.TabIndex = 9;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(26, 178);
this.monthFoldersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(106, 20);
this.monthFoldersLabel.TabIndex = 11;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(26, 212);
this.dayFoldersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(89, 20);
this.dayFoldersLabel.TabIndex = 13;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(162, 140);
this.yearFoldersComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(217, 28);
this.yearFoldersComboBox.TabIndex = 10;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(162, 174);
this.monthFoldersComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(217, 28);
this.monthFoldersComboBox.TabIndex = 12;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(162, 208);
this.dayFoldersComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(217, 28);
this.dayFoldersComboBox.TabIndex = 14;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(404, 108);
this.destination2Button.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(45, 31);
this.destination2Button.TabIndex = 8;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(162, 108);
this.destination2TextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(217, 26);
this.destination2TextBox.TabIndex = 7;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(26, 112);
this.destination2Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(103, 20);
this.destination2Label.TabIndex = 6;
this.destination2Label.Text = "Destination 2";
//
// fileNameFmtTextBox
//
this.fileNameFmtTextBox.Enabled = false;
this.fileNameFmtTextBox.Location = new System.Drawing.Point(162, 242);
this.fileNameFmtTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.fileNameFmtTextBox.Name = "fileNameFmtTextBox";
this.fileNameFmtTextBox.Size = new System.Drawing.Size(217, 26);
this.fileNameFmtTextBox.TabIndex = 16;
//
// fileNameFmtLabel
//
this.fileNameFmtLabel.AutoSize = true;
this.fileNameFmtLabel.Location = new System.Drawing.Point(26, 246);
this.fileNameFmtLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.fileNameFmtLabel.Name = "fileNameFmtLabel";
this.fileNameFmtLabel.Size = new System.Drawing.Size(128, 20);
this.fileNameFmtLabel.TabIndex = 15;
this.fileNameFmtLabel.Text = "File name format";
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Enabled = false;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(30, 403);
this.eliminateSpacesCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(110, 24);
this.eliminateSpacesCheckBox.TabIndex = 21;
this.eliminateSpacesCheckBox.Text = "No spaces";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(162, 378);
this.headerButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(219, 35);
this.headerButton.TabIndex = 23;
this.headerButton.Text = "Header";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(162, 494);
this.footerButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(219, 35);
this.footerButton.TabIndex = 26;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(162, 417);
this.commonItemsButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(219, 35);
this.commonItemsButton.TabIndex = 24;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// upgradeWizardButton
//
this.upgradeWizardButton.Location = new System.Drawing.Point(404, 417);
this.upgradeWizardButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.upgradeWizardButton.Name = "upgradeWizardButton";
this.upgradeWizardButton.Size = new System.Drawing.Size(120, 74);
this.upgradeWizardButton.TabIndex = 27;
this.upgradeWizardButton.Text = "Upgrade wizard";
this.upgradeWizardButton.UseVisualStyleBackColor = true;
this.upgradeWizardButton.Click += new System.EventHandler(this.upgradeWizardButton_Click);
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(162, 274);
this.cultureComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(217, 28);
this.cultureComboBox.TabIndex = 18;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(26, 278);
this.cultureLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(63, 20);
this.cultureLabel.TabIndex = 17;
this.cultureLabel.Text = "Cullture";
//
// goodOnlyCheckBox
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(30, 438);
this.goodOnlyCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(107, 24);
this.goodOnlyCheckBox.TabIndex = 22;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = false;
//
// subtitleFmtTextBox
//
this.subtitleFmtTextBox.Enabled = false;
this.subtitleFmtTextBox.Location = new System.Drawing.Point(162, 308);
this.subtitleFmtTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.subtitleFmtTextBox.Name = "subtitleFmtTextBox";
this.subtitleFmtTextBox.Size = new System.Drawing.Size(217, 26);
this.subtitleFmtTextBox.TabIndex = 29;
//
// subtitleFmtLabel
//
this.subtitleFmtLabel.AutoSize = true;
this.subtitleFmtLabel.Location = new System.Drawing.Point(26, 312);
this.subtitleFmtLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.subtitleFmtLabel.Name = "subtitleFmtLabel";
this.subtitleFmtLabel.Size = new System.Drawing.Size(113, 20);
this.subtitleFmtLabel.TabIndex = 28;
this.subtitleFmtLabel.Text = "Subtitle format";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(386, 325);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(248, 20);
this.label1.TabIndex = 30;
this.label1.Text = "4:wmStr 5:s/n 6:main s/n 7:aux.s/n";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(386, 305);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(237, 20);
this.label2.TabIndex = 31;
this.label2.Text = "0:pos 1:s/n 2:aux.s/n 3:compl.s/n";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(386, 238);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(203, 20);
this.label3.TabIndex = 32;
this.label3.Text = "0:end t. 1:start t. 2:batch nr.";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(386, 258);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(239, 20);
this.label4.TabIndex = 33;
this.label4.Text = "3:bench name 4:bench id, 5:Now";
//
// noSeparatorCICheckBox
//
this.noSeparatorCICheckBox.Enabled = false;
this.noSeparatorCICheckBox.Location = new System.Drawing.Point(30, 470);
this.noSeparatorCICheckBox.Name = "noSeparatorCICheckBox";
this.noSeparatorCICheckBox.Size = new System.Drawing.Size(125, 59);
this.noSeparatorCICheckBox.TabIndex = 34;
this.noSeparatorCICheckBox.Text = "No separ. \"Common i.\"";
this.noSeparatorCICheckBox.UseVisualStyleBackColor = true;
//
// WriterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.noSeparatorCICheckBox);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.subtitleFmtTextBox);
this.Controls.Add(this.subtitleFmtLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.upgradeWizardButton);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.fileNameFmtTextBox);
this.Controls.Add(this.fileNameFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "WriterCfgCtrl";
this.Size = new System.Drawing.Size(660, 538);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.CheckBox noSeparatorCICheckBox;
#endregion
private System.Windows.Forms.TextBox nameTextBox;
+5 -5
View File
@@ -87,13 +87,13 @@ namespace TBF.UI.Procedures
/// SharedDlgButtons configuration
sharedButtons.ParentForm = parentForm;
#if LANG_PL
//#if LANG_PL
sharedButtons.RequiredGroupMembership = procedure.Protected ? new GID[] { GID.WaterMeterAuthority }
: new GID[] { GID.TestingSpecialists, GID.Metrologists, GID.WaterMeterAuthority };
#else
sharedButtons.RequiredGroupMembership = procedure.Protected ? new GID[] { GID.Metrologists }
: new GID[] { GID.TestingSpecialists, GID.Metrologists };
#endif
// #else
// sharedButtons.RequiredGroupMembership = procedure.Protected ? new GID[] { GID.Metrologists }
// : new GID[] { GID.TestingSpecialists, GID.Metrologists };
// #endif
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add |
SharedButtons.Buttons.Remove |
SharedButtons.Buttons.Up |
@@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Results;
using TBF.Rig.GenericDevices;
using TBF.Rig.Output.FileWriters.Enhanced;
using TBF.Rig.Sequences;
namespace TBFTests.Rig.Output.FileWriters.Enhanced
{
[TestClass]
[TestSubject(typeof(Writer))]
public class WriterTest
{
[TestInitialize]
public void Setup()
{
// Mock IBenchInfo and assign it to static field
var mockBenchInfo = new Mock<IBenchInfo>();
// Optional: Setup mock behavior if GetName or similar is used
mockBenchInfo.Setup(b => b.TestBenchName).Returns("TestBench");
mockBenchInfo.Setup(b => b.TestBenchId).Returns(1);
ProcessData.BenchInfo = mockBenchInfo.Object;
}
[TestCleanup]
public void Cleanup()
{
// Clean up the static reference
ProcessData.BenchInfo = null;
}
[TestMethod]
public void GetFilenameTest()
{
FactorySingle factory = new FactorySingle();
WriterCfg defaultConfig = factory.DefaultConfig() as WriterCfg;
string dateFormat = "yyMMdd-HHmm";
defaultConfig.FileNameFormat = $"{{5:{dateFormat}}}.txt";
Writer writer = new Writer( defaultConfig);
Results.Entities.Batch batch = new Results.Entities.Batch();
DateTime time = DateTime.Now;
batch.EndTime = time;
string filename = writer.GetFilename("C:\\TBF\\Results\\", batch, time);
// Assert
Assert.IsNotNull(filename, "Filename should not be null.");
Assert.IsTrue(filename.StartsWith("C:\\TBF\\Results\\"), "Filename should start with base path.");
//test extension
Assert.IsTrue(filename.EndsWith(".txt") , "Filename should have correct extension.");
//test path - Format path like \2025\7\28\
string path = $@"\{time.Year}\{time.Month}\{time.Day}\";
Assert.IsTrue( filename.Contains(path));
//test file name
string expected = string.Format($"{{0:{dateFormat}}}.txt", time);
Assert.IsTrue( filename.Contains(expected));
}
[TestMethod]
public void WriteRsltsExTest()
{
FactorySingle factory = new FactorySingle();
WriterCfg defaultConfig = factory.DefaultConfig() as WriterCfg;
string dateFormat = "yyMMdd-HHmm";
defaultConfig.FileNameFormat = $"{{5:{dateFormat}}}.txt";
defaultConfig.Header = "Header :)";
Writer writer = new Writer( defaultConfig);
var field = typeof(Writer).GetField("commonItems", BindingFlags.NonPublic | BindingFlags.Instance);
var fieldHeader = typeof(Writer).GetField("header", BindingFlags.NonPublic | BindingFlags.Instance);
fieldHeader?.SetValue(writer, defaultConfig.Header);
var mockList = new List<Results.WMeterRsltItemSpec>
{
new WMeterRsltItemSpec (ItemID.Batch_end_time, "End", null,Common.Quantity.DateTime, Common.ItemCategory.Other, null)
};
mockList[0].Caption = "Date and time";
string formatCommonTime = "yyyy.MM.dd HH:mm";
mockList[0].Format = $"{{0:{formatCommonTime}}}";
field?.SetValue(writer, mockList);
Results.Entities.Batch batch = new Results.Entities.Batch();
DateTime time = DateTime.Now;
batch.EndTime = time;
using (var memStream = new MemoryStream())
using (var writerStream = new StreamWriter(memStream))
{
writer.WriteRsltsEx(batch, writerStream, time);
writerStream.Flush();
// Get the actual content
memStream.Position = 0;
using (var reader = new StreamReader(memStream))
{
string content = reader.ReadToEnd();
// Assert on the actual content
Assert.IsNotNull(content);
Assert.IsTrue(content.Contains(defaultConfig.Header));
Assert.IsTrue(content.Contains("Date and time"));
string expectedCommonTime = string.Format($"{{0:{formatCommonTime}}}", time);
Assert.IsTrue(content.Contains(expectedCommonTime));
}
}
}
}
}
+9
View File
@@ -99,16 +99,25 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rig\Network\Camera\KeyenceIV3G120\CameraTest.cs" />
<Compile Include="Rig\Network\Camera\RoiForFixedStartKeyence\RoiTest.cs" />
<Compile Include="Rig\Output\FileWriters\Enhanced\WriterTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\Config\Config.csproj">
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\Results\Results.csproj">
<Project>{9d0dcc88-dc81-47eb-9fdd-4c3907871bfb}</Project>
<Name>Results</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project>
<Name>TBF</Name>
@@ -1 +1 @@
42f452de9b0393e2b8a43441d6acf2f1268eaff5eb4a5cb56624e462418cf079
68e639b7d1208407db910dc07789c52f1b741d3e7568e2b914f7e7dfab2a0520