diff --git a/.gitignore b/.gitignore index e4e7016bd..753dd6452 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ GraphLib/bin GraphLib/obj TracingDB/bin TracingDB/obj +ResetBatchNr/bin +ResetBatchNr/obj RestClient/bin RestClient/obj Results/bin/ diff --git a/ResetBatchNr/App.config b/ResetBatchNr/App.config new file mode 100644 index 000000000..56efbc7b5 --- /dev/null +++ b/ResetBatchNr/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ResetBatchNr/Program.cs b/ResetBatchNr/Program.cs new file mode 100644 index 000000000..93ab1c991 --- /dev/null +++ b/ResetBatchNr/Program.cs @@ -0,0 +1,46 @@ +using System; +using System.IO; +using TBF; + +namespace ResetBatchNr +{ + class Program + { + static LocalSettings ls; + + static void Main(string[] args) + { + if (!Directory.Exists(TBF.Program.ConfigDir)) return; + + Environment.CurrentDirectory = TBF.Program.ConfigDir; + ls = LocalSettings.Load(TBF.Program.LocalSettingsFileName); + if (ls == null || ls.TestBenches == null) + { + /// Loading local seetings from regular config file failed. Use the backup + ls = LocalSettings.Load(TBF.Program.LocalSettingsBackupName); + if (ls == null || ls.TestBenches == null) + { + /// Neither config.xml, nor config.backup.xml could be loaded + Console.WriteLine(string.Format("Could not load file {0}, nor {1}.", TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName)); + Console.ReadLine(); + return; + } + } + else + { + /// Loading local seetings from the regular config file was successful. Update the backup + File.Copy(TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName, true); + } + + /// + /// Process local settings so that windows are shifted to the 1st monitor + /// + ls.BatchNr = 1; + ls.Save(); + + Console.WriteLine("BatchNr was reset to 1"); + Console.ReadLine(); + return; + } + } +} diff --git a/ResetBatchNr/Properties/AssemblyInfo.cs b/ResetBatchNr/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..4f21e9b11 --- /dev/null +++ b/ResetBatchNr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ResetBatchNr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ResetBatchNr")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("de8130eb-2f43-46a6-9f5b-bf96432a0c7c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ResetBatchNr/ResetBatchNr.csproj b/ResetBatchNr/ResetBatchNr.csproj new file mode 100644 index 000000000..bc9826334 --- /dev/null +++ b/ResetBatchNr/ResetBatchNr.csproj @@ -0,0 +1,72 @@ + + + + + Debug + AnyCPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6} + Exe + Properties + ResetBatchNr + ResetBatchNr + v4.7.2 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {743df7db-c7b6-42eb-986d-0f485e5588e4} + Config + + + {8648fd92-cda1-4c3a-b5f9-fe547ce1fa48} + TBF + + + {6e5cb0e9-e1b6-4e5d-ac6e-b1049e180f2b} + Users + + + + + \ No newline at end of file diff --git a/TBF.sln b/TBF.sln index 8d202f8ac..86de24e4a 100644 --- a/TBF.sln +++ b/TBF.sln @@ -69,6 +69,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamInterface", "DataStreamInterface\DataStreamInterface.csproj", "{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResetBatchNr", "ResetBatchNr\ResetBatchNr.csproj", "{D7F5A111-B2DF-4761-9574-AB730DF573A6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -303,6 +305,16 @@ Global {7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.Build.0 = Release|Any CPU {7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|x86.ActiveCfg = Release|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|x86.ActiveCfg = Debug|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Any CPU.Build.0 = Release|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/clean.bat b/clean.bat index 1e408ae9a..435cc083e 100644 --- a/clean.bat +++ b/clean.bat @@ -24,6 +24,8 @@ rmdir /s /q GraphLib\bin rmdir /s /q GraphLib\obj rmdir /s /q TracingDB\bin rmdir /s /q TracingDB\obj +rmdir /s /q ResetBatchNr\bin +rmdir /s /q ResetBatchNr\obj rmdir /s /q RestClient\bin rmdir /s /q RestClient\obj rmdir /s /q Results\bin