Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3c21a5ba0 |
@@ -30,8 +30,8 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
+1
-43
@@ -105,14 +105,6 @@ namespace Common
|
||||
///
|
||||
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
|
||||
[Description("kWh/pulse")] kWhpp, /// 1 kWh/pulse
|
||||
|
||||
///
|
||||
[Description("A")] A, /// *1 A
|
||||
[Description("mA")] mA, /// 1 mA = 0.001 A
|
||||
///
|
||||
[Description("V")] V, /// *1 V
|
||||
[Description("mV")] mV, /// 1 mV = 0.001 V
|
||||
|
||||
|
||||
Count
|
||||
}
|
||||
@@ -143,8 +135,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Datum und Uhrzeit")] DateTime,
|
||||
[Description("Aufgezählt")] Enumerated,
|
||||
[Description("Strom")] Current,
|
||||
[Description("Spannung")] Voltage,
|
||||
#elif LANG_PL
|
||||
[Description("Objętość")] Volume,
|
||||
[Description("Przepływ")] Flow,
|
||||
@@ -168,8 +158,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Data i czas")] DateTime,
|
||||
[Description("Wyliczone")] Enumerated,
|
||||
[Description("Prąd")] Current,
|
||||
[Description("Napięcie")] Voltage,
|
||||
#elif LANG_CS
|
||||
[Description("Objem")] Volume,
|
||||
[Description("Průtok")] Flow,
|
||||
@@ -193,8 +181,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Datum a čas")] DateTime,
|
||||
[Description("Vyjmenované")] Enumerated,
|
||||
[Description("Proud")] Current,
|
||||
[Description("Napětí")] Voltage,
|
||||
#elif LANG_IT
|
||||
[Description("Volume")] Volume,
|
||||
[Description("Flusso")] Flow,
|
||||
@@ -218,8 +204,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Data e ora")] DateTime,
|
||||
[Description("Enumerato")] Enumerated,
|
||||
[Description("Corrente")] Current,
|
||||
[Description("Voltaggio")] Voltage,
|
||||
#else
|
||||
[Description("Volume")] Volume,
|
||||
[Description("Flow")] Flow,
|
||||
@@ -243,8 +227,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Date and time")] DateTime,
|
||||
[Description("Enumerated")] Enumerated,
|
||||
[Description("Current")] Current,
|
||||
[Description("Voltage")] Voltage,
|
||||
#endif
|
||||
Count,
|
||||
}
|
||||
@@ -260,8 +242,7 @@ namespace Common
|
||||
{
|
||||
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
|
||||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
|
||||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.A ||
|
||||
unit == Unit.V;
|
||||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
|
||||
}
|
||||
|
||||
public static bool IsQuantity(Unit unit, Quantity quantity)
|
||||
@@ -370,14 +351,6 @@ namespace Common
|
||||
case Unit.ppkWh:
|
||||
case Unit.kWhpp:
|
||||
return Quantity.PulsePerKWh;
|
||||
|
||||
case Unit.A:
|
||||
case Unit.mA:
|
||||
return Quantity.Current;
|
||||
|
||||
case Unit.V:
|
||||
case Unit.mV:
|
||||
return Quantity.Voltage;
|
||||
|
||||
default:
|
||||
return Quantity.Number;
|
||||
@@ -399,8 +372,6 @@ namespace Common
|
||||
public static bool IsPulsePerLtr(Unit unit) { return IsQuantity(unit, Quantity.PulsePerLtr); }
|
||||
public static bool IsPulsePerKWh(Unit unit) { return IsQuantity(unit, Quantity.PulsePerKWh); }
|
||||
public static bool IsConductivity(Unit unit) { return IsQuantity(unit, Quantity.Conductivity); }
|
||||
public static bool IsCurrent(Unit unit) { return IsQuantity(unit, Quantity.Current); }
|
||||
public static bool IsVoltage(Unit unit) { return IsQuantity(unit, Quantity.Voltage); }
|
||||
|
||||
|
||||
|
||||
@@ -484,13 +455,6 @@ namespace Common
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
|
||||
|
||||
/// Current: internal representation in A
|
||||
case Unit.mA: return 1000 * v; /// 1000 mA = 1 A
|
||||
|
||||
/// Voltage: internal representation in V
|
||||
case Unit.mV: return 1000 * v; /// 1000 mV = 1 V
|
||||
|
||||
|
||||
default: return v; /// Do not convert
|
||||
}
|
||||
@@ -570,12 +534,6 @@ namespace Common
|
||||
|
||||
/// Electrical conductivity
|
||||
case Unit.mSpm: return 10 * v;
|
||||
|
||||
/// Current: internal representation in A
|
||||
case Unit.mA: return 0.001 * v; /// 1 mA = 0.001 A
|
||||
|
||||
/// Voltage: internal representation in V
|
||||
case Unit.mV: return 0.001 * v; /// 1 mV = 0.001 V
|
||||
|
||||
/// Invert
|
||||
case Unit.kWhpp:
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -43,7 +43,7 @@
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -22,9 +22,6 @@ namespace Config.Entities
|
||||
public virtual string PressMtrUp { get; set; }
|
||||
public virtual string PressMtrDown { get; set; }
|
||||
public virtual string PressMtrDelta { get; set; }
|
||||
public virtual string ElectricMtrUp { get; set; }
|
||||
public virtual string ElectricMtrDown { get; set; }
|
||||
public virtual string ElectricMtrDelta { get; set; }
|
||||
public virtual string StopBFValve { get; set; }
|
||||
|
||||
/// Valves
|
||||
@@ -62,9 +59,6 @@ namespace Config.Entities
|
||||
result.PressMtrUp = PressMtrUp;
|
||||
result.PressMtrDown = PressMtrDown;
|
||||
result.PressMtrDelta = PressMtrDelta;
|
||||
result.ElectricMtrUp = ElectricMtrUp;
|
||||
result.ElectricMtrDown = ElectricMtrDown;
|
||||
result.ElectricMtrDelta = ElectricMtrDelta;
|
||||
result.StopBFValve = StopBFValve;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace Config.Entities
|
||||
public virtual Unit TempUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
public virtual Unit PressUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
public virtual Unit LengthUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
public virtual Unit ElectricUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
|
||||
/// Wrappers
|
||||
public virtual double QfromM3ph()
|
||||
@@ -210,7 +209,6 @@ namespace Config.Entities
|
||||
result.TempUnit = TempUnit;
|
||||
result.PressUnit = PressUnit;
|
||||
result.LengthUnit = LengthUnit;
|
||||
result.ElectricUnit = ElectricUnit;
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
|
||||
|
||||
return result;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
22fa51b09dbd9afa4c5d73fd5d4267426f09bc510527f701d437b89d74765cc0
|
||||
@@ -0,0 +1,18 @@
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\bin\Debug\Doc\Software interface for datastream water meters.docx
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\bin\Debug\DataStreamInterfaceTest.exe.config
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\bin\Debug\DataStreamInterfaceTest.exe
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\bin\Debug\DataStreamInterfaceTest.pdb
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\bin\Debug\DataStreamInterface.dll
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\bin\Debug\DataStreamInterface.pdb
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.csproj.AssemblyReference.cache
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.DemoMainWnd.resources
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.GetDblValueDlg.resources
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.GetFrameBoundariesDlg.resources
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.GetIntegerNumberDlg.resources
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.GetStateDlg.resources
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.Properties.Resources.resources
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.csproj.GenerateResource.cache
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.csproj.CoreCompileInputs.cache
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStre.F4216CC0.Up2Date
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.exe
|
||||
C:\VSProjects\proj9\tbf\DataStreamInterfaceTest\obj\Debug\DataStreamInterfaceTest.pdb
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -40,8 +40,9 @@
|
||||
<StartupObject>DeviceTest.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
Binary file not shown.
@@ -49,7 +49,7 @@
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -38,8 +38,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
@@ -62,7 +62,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -48,8 +48,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -49,8 +49,8 @@
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -3,5 +3,4 @@
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net40" />
|
||||
<package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40" />
|
||||
<package id="NHibernate" version="4.0.4.4000" targetFramework="net40" />
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -34,8 +34,8 @@
|
||||
<Reference Include="Gma.QrCodeNet.Encoding">
|
||||
<HintPath>..\packages\QrCode.Net.0.4.0.0\net40\Gma.QrCodeNet.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
+19
-17
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;LANG_PL</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -29,7 +29,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;LANG_PL</DefineConstants>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
@@ -44,8 +44,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
@@ -75,12 +75,6 @@
|
||||
<Compile Include="Entities\WaterMeterData.cs" />
|
||||
<Compile Include="Entities\WaterMeter.cs" />
|
||||
<Compile Include="DB.cs" />
|
||||
<Compile Include="Forms\BatchResultsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\BatchResultsDlg.Designer.cs">
|
||||
<DependentUpon>BatchResultsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\IOneWMResultsCtrl.cs" />
|
||||
<Compile Include="Forms\ManualEntryConfigCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
@@ -124,6 +118,10 @@
|
||||
<Compile Include="Forms\ResultsConfigDlg.designer.cs">
|
||||
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\TracingResultsDlg.cs" />
|
||||
<Compile Include="Forms\TracingResultsDlg.Designer.cs">
|
||||
<DependentUpon>TracingResultsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\WaterMeterEventArgs.cs" />
|
||||
<Compile Include="ItemID.cs" />
|
||||
<Compile Include="ManualEntryItemSpec.cs" />
|
||||
@@ -134,7 +132,6 @@
|
||||
<Compile Include="Mappings\TestRsltMap.cs" />
|
||||
<Compile Include="Mappings\WaterMeterDataMap.cs" />
|
||||
<Compile Include="Mappings\WaterMeterMap.cs" />
|
||||
<Compile Include="Output\Cell.cs" />
|
||||
<Compile Include="Output\Printers\Enhanced\EnhancedPrintDocument.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -152,6 +149,7 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\OnePerBatch\OnePerBatchPrinterCfg.cs" />
|
||||
<Compile Include="Output\Printers\Munich\MunichPrintDocument.cs" />
|
||||
<Compile Include="Output\Printers\OnePerMeter\OnePerMeterPrintDocument.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -190,9 +188,13 @@
|
||||
<Project>{32817bf9-e380-4467-9c7f-936f4b122bc7}</Project>
|
||||
<Name>GenCode128</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SharedDatabase\SharedDatabase.csproj">
|
||||
<Project>{211b5e3f-9996-48a7-abde-c878dd2d71c2}</Project>
|
||||
<Name>SharedDatabase</Name>
|
||||
<ProjectReference Include="..\TracingDB\TracingDB.csproj">
|
||||
<Project>{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}</Project>
|
||||
<Name>TracingDB</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Users\Users.csproj">
|
||||
<Project>{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}</Project>
|
||||
<Name>Users</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -201,9 +203,6 @@
|
||||
<Folder Include="Output\FileWriters\OneFilePerMeter\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Forms\BatchResultsDlg.resx">
|
||||
<DependentUpon>BatchResultsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ManualEntryConfigCtrl.resx">
|
||||
<DependentUpon>ManualEntryConfigCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -225,6 +224,9 @@
|
||||
<EmbeddedResource Include="Forms\ResultsConfigDlg.resx">
|
||||
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\TracingResultsDlg.resx">
|
||||
<DependentUpon>TracingResultsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -47,8 +47,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
@@ -65,9 +65,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Oracle.ManagedDataAccess" version="19.11.0" targetFramework="net472" />
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -332,12 +332,6 @@ namespace SchematicDrawing
|
||||
Shapes[DrShIx(Shape.PressM, Sz.M)] = new DrawingShape(Shape.PressM, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.L)] = new DrawingShape(Shape.PressM, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.XL)] = new DrawingShape(Shape.PressM, Sz.XL, 0, 0);
|
||||
|
||||
/// Electric meter
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.S)] = new DrawingShape(Shape.ElectricM, Sz.S, 0, 0);
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.M)] = new DrawingShape(Shape.ElectricM, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.L)] = new DrawingShape(Shape.ElectricM, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.XL)] = new DrawingShape(Shape.ElectricM, Sz.XL, 0, 0);
|
||||
|
||||
/// Parallel flow meters
|
||||
Shapes[DrShIx(Shape.ParallelFlowM, Sz.S)] = new DrawingShape(Shape.ParallelFlowM, Sz.S, 0, 0);
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace SchematicDrawing
|
||||
Vacuum,
|
||||
Valve,
|
||||
WaterM,
|
||||
ElectricM,
|
||||
|
||||
Count,
|
||||
Custom,
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34330.188
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TBF\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28} = {7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}
|
||||
@@ -102,8 +100,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S640TestApp", "S640TestApp\
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LabelPrinting", "LabelPrinting\LabelPrinting.csproj", "{E4531D13-317C-4D9F-809F-5533B5C3C8BF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBFTests", "TBFTests\TBFTests.csproj", "{77EB589F-C670-4489-AAD6-2A3C02061FD1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -450,18 +446,6 @@ Global
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|x86.Build.0 = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.9.2141.1")]
|
||||
[assembly: AssemblyFileVersion("3.9.2141.1")]
|
||||
[assembly: AssemblyVersion("3.9.2139.0")]
|
||||
[assembly: AssemblyFileVersion("3.9.2139.0")]
|
||||
|
||||
Generated
+3
-20
@@ -1,6 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -1256,21 +1257,12 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Current.
|
||||
/// </summary>
|
||||
internal static string Current {
|
||||
get {
|
||||
return ResourceManager.GetString("Current", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to current.
|
||||
/// </summary>
|
||||
internal static string current_ {
|
||||
internal static string current {
|
||||
get {
|
||||
return ResourceManager.GetString("current_", resourceCulture);
|
||||
return ResourceManager.GetString("current", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6821,15 +6813,6 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Voltage.
|
||||
/// </summary>
|
||||
internal static string Voltage {
|
||||
get {
|
||||
return ResourceManager.GetString("Voltage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Volume.
|
||||
/// </summary>
|
||||
|
||||
@@ -1746,10 +1746,4 @@
|
||||
<data name="Print" xml:space="preserve">
|
||||
<value>Tisknout</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Proud</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Napětí</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2211,10 +2211,4 @@
|
||||
<data name="Calibration_certificate_validity_expired" xml:space="preserve">
|
||||
<value>Kalibrierschein gültigkeit abgelaufen</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Strom</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Spannung</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2010,10 +2010,4 @@
|
||||
<data name="Fill" xml:space="preserve">
|
||||
<value>Inonder</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Curren</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Tension</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1779,10 +1779,4 @@
|
||||
<data name="Start_cycle" xml:space="preserve">
|
||||
<value>Avviare il ciclo</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Corrente</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltaggio</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1686,10 +1686,4 @@
|
||||
<data name="Uncertainty" xml:space="preserve">
|
||||
<value>Nepevność</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Prąd</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Napięcie</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1813,7 +1813,7 @@
|
||||
<data name="Refresh" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
<data name="current_" xml:space="preserve">
|
||||
<data name="current" xml:space="preserve">
|
||||
<value>current</value>
|
||||
</data>
|
||||
<data name="Flow" xml:space="preserve">
|
||||
@@ -2449,10 +2449,4 @@
|
||||
<data name="Test_Bench_Framework" xml:space="preserve">
|
||||
<value>Test Bench Framework</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -831,10 +831,4 @@
|
||||
<data name="Evaporation" xml:space="preserve">
|
||||
<value>Evaporare</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1599,10 +1599,4 @@
|
||||
<data name="Evaporation" xml:space="preserve">
|
||||
<value>испарение</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
Generated
-3302
File diff suppressed because it is too large
Load Diff
@@ -1191,10 +1191,4 @@
|
||||
<data name="Evaporation" xml:space="preserve">
|
||||
<value>蒸发</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -18,9 +18,6 @@ namespace TBF.Rig
|
||||
public IPressureMeter PressMtrUp;
|
||||
public IPressureMeter PressMtrDown;
|
||||
public IPressureMeter PressMtrDelta;
|
||||
public IAdjustableMeter ElectricMtrUp;
|
||||
public IAdjustableMeter ElectricMtrDown;
|
||||
public IAdjustableMeter ElectricMtrDelta;
|
||||
public IValve StopBFValve;
|
||||
public IList<IValve> ValvesOpen;
|
||||
public IList<IValve> ValvesClose;
|
||||
@@ -46,9 +43,6 @@ namespace TBF.Rig
|
||||
PressMtrUp = TbfComponents.FindComponent(entity.PressMtrUp, components) as IPressureMeter;
|
||||
PressMtrDown = TbfComponents.FindComponent(entity.PressMtrDown, components) as IPressureMeter;
|
||||
PressMtrDelta = TbfComponents.FindComponent(entity.PressMtrDelta, components) as IPressureMeter;
|
||||
ElectricMtrUp = TbfComponents.FindComponent(entity.ElectricMtrUp, components) as IAdjustableMeter;
|
||||
ElectricMtrDown = TbfComponents.FindComponent(entity.ElectricMtrDown, components) as IAdjustableMeter;
|
||||
ElectricMtrDelta = TbfComponents.FindComponent(entity.ElectricMtrDelta, components) as IAdjustableMeter;
|
||||
StopBFValve = TbfComponents.FindComponent(entity.StopBFValve, components) as IValve;
|
||||
|
||||
string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' });
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
int bitNr; /// 0 .. 127
|
||||
public UInt128 Mask; /// derived from bitPosition in the constructor
|
||||
|
||||
public bool State { get { return (TBF.Rig.StateMachine.ControlBoardMain.Route & Mask) != 0; } }
|
||||
public bool State { get { return (TBF.Rig.StateMachine.ControlBoard.Route & Mask) != 0; } }
|
||||
|
||||
/// Private fields
|
||||
SerialPort serialPort;
|
||||
@@ -148,7 +148,7 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
if (TBF.Rig.StateMachine.ControlBoardMain == null) throw new Exception("Control board is missing");
|
||||
if (TBF.Rig.StateMachine.ControlBoard == null) throw new Exception("Control board is missing");
|
||||
|
||||
bitNr = pumpCfg.BitNr;
|
||||
Mask = (((UInt128)1) << bitNr);
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
public Unit TempUnit { get { return myCfg.TempUnit; } }
|
||||
public Unit PressUnit { get { return myCfg.PressUnit; } }
|
||||
public Unit LengthUnit { get { return myCfg.LenghtUnit; } }
|
||||
public Unit ElectricUnit { get { return myCfg.ElectricUnit; } }
|
||||
|
||||
public ICollection<ProcedureSelection> Sources
|
||||
{
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
public ProcedureSelection Source2; /// 21
|
||||
public ProcedureSelection Source3; /// 22
|
||||
public ProcedureSelection Source4; /// 23
|
||||
public Unit ElectricUnit; /// 24
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg() {}
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
public Unit TempUnit { get { return myCfg.TempUnit; } }
|
||||
public Unit PressUnit { get { return myCfg.PressUnit; } }
|
||||
public Unit LengthUnit { get { return myCfg.LenghtUnit; } }
|
||||
public Unit ElectricUnit { get { return myCfg.ElectricUnit; } }
|
||||
public Side Side { get { return myCfg.Side; } }
|
||||
public int MaxTestIndex { get { return myCfg.MaxTestIndex; } } /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
public ProcedureSelection Source2; /// 23
|
||||
public ProcedureSelection Source3; /// 24
|
||||
public ProcedureSelection Source4; /// 25
|
||||
public Unit ElectricUnit; /// 26
|
||||
|
||||
/// Calibration info serialized parameters displayed in Metrology tab page
|
||||
public string CalibCertificateNr { get; set; }
|
||||
@@ -100,7 +99,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
Source2 = ProcedureSelection.FromLocalDB;
|
||||
Source3 = ProcedureSelection.None;
|
||||
Source4 = ProcedureSelection.None;
|
||||
ElectricUnit = Unit.A;
|
||||
|
||||
CalibCertificateNr = string.Empty;
|
||||
CalibDate = TBF.UI.Constants.MinDate;
|
||||
@@ -135,7 +133,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
"Procedure selection source 2", /// 23
|
||||
"Procedure selection source 3", /// 24
|
||||
"Procedure selection source 4", /// 25
|
||||
"Preffered electric unit", /// 26
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
@@ -196,13 +193,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
for (ProcedureSelection src = 0; src < ProcedureSelection.Count; src++)
|
||||
list.Add(src.ToDescription());
|
||||
return list;
|
||||
|
||||
case 26:
|
||||
for (Unit unit = 0; unit < Unit.Count; unit++)
|
||||
if (Units.IsQuantity(unit, Quantity.Current) ||
|
||||
Units.IsQuantity(unit, Quantity.Voltage))
|
||||
list.Add(unit.ToDescription());
|
||||
return list;
|
||||
|
||||
default:
|
||||
return null;
|
||||
@@ -239,7 +229,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
case 23: return Source2.ToDescription();
|
||||
case 24: return Source3.ToDescription();
|
||||
case 25: return Source4.ToDescription();
|
||||
case 26: return ElectricUnit.ToDescription();
|
||||
default:
|
||||
return string.Format("{0}: Bench={1}, ID={2}, Mtrs={3}, Lines={4}, Compund mtrs={5}, S1={6}, S2={7}, S3={8}, S4={9}",
|
||||
Name, TestBenchName, TestBenchId, WaterMetersCount, LinesCount, CompoundMetersCount, Source1, Source2, Source3, Source4);
|
||||
@@ -340,10 +329,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
}
|
||||
break;
|
||||
|
||||
case 26:
|
||||
ElectricUnit = Units.FromDescription(str);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
@@ -403,10 +388,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
if (str == source.ToDescription()) return true;
|
||||
}
|
||||
break;
|
||||
case 26:
|
||||
if (ParamValues(i).Contains(str)) return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
@@ -444,7 +425,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
prms.Source2 = Source2;
|
||||
prms.Source3 = Source3;
|
||||
prms.Source4 = Source4;
|
||||
prms.ElectricUnit = ElectricUnit;
|
||||
|
||||
prms.CalibCertificateNr = this.CalibCertificateNr;
|
||||
prms.CertPath = this.CertPath;
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
using TBF.Boxes;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.GenericDevices
|
||||
{
|
||||
public interface IAdjustableMeter : IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Events: PressureDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressure">Reference to a variable for the measured pressure in bar</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
IOperation ReadAdjustableOp(ref DoubleBox value);
|
||||
|
||||
/// <summary>
|
||||
/// Events: pressureDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressure">Reference to a variable for the measured pressure in bar</param>
|
||||
/// <param name="pressureDone">Event returned when measurement done</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
IOperation ReadAdjustableOp(ref DoubleBox value, Event valueDone);
|
||||
|
||||
bool MsrmntAvailable { get; }
|
||||
double MeasuredVal { get; }
|
||||
double MsrdValLimLo { get; }
|
||||
double MsrdValLimHi { get; }
|
||||
string MsrdFormat { get; }
|
||||
Common.Unit MsrdUnit { get; }
|
||||
string AltString { get; }
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,5 @@ namespace TBF.Rig.GenericDevices
|
||||
Unit TempUnit { get; }
|
||||
Unit PressUnit { get; }
|
||||
Unit LengthUnit { get; }
|
||||
Unit ElectricUnit { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ namespace TBF.Rig.MettlerToledo
|
||||
|
||||
if (drainValve == null) throw new Exception(string.Format("{0} is missing a drain valve", Name));
|
||||
|
||||
openTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoardMain, drainValve, null);
|
||||
closeTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoardMain, null, drainValve);
|
||||
openTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoard, drainValve, null);
|
||||
closeTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoard, null, drainValve);
|
||||
waitTankIsEmptyOp = new WaitTankEmptyOp(this);
|
||||
|
||||
Various.TankWithLevelMsrmnt.TankCfg tankCfg = tankDrainingCfg as Various.TankWithLevelMsrmnt.TankCfg;
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.GenericDevices;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class AdjustableMeter : ComponentBase, IAdjustableMeter, IDevice, ISequenceCondition, IDrawingItCmpntWithMeasuredVal
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(AdjustableMeter));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly AdjustableMeterCfg _adjustableMtrCfg;
|
||||
public IDrawingItem DrawingItem { get { return _adjustableMtrCfg as IDrawingItem; } }
|
||||
|
||||
Common.Modbus modbus;
|
||||
|
||||
double receivedValue;
|
||||
double receivedAmpers;
|
||||
|
||||
public bool MsrmntAvailable { get { return true; } }
|
||||
public double MeasuredVal { get { return receivedValue; } }
|
||||
public double MsrdValLimLo { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.MsrdValLimLo); } }
|
||||
public double MsrdValLimHi { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.MsrdValLimHi); } }
|
||||
public Unit MsrdUnit { get { return _adjustableMtrCfg.MsrdUnit; } }
|
||||
public string MsrdFormat { get { return _adjustableMtrCfg.MsrdFormat; } }
|
||||
public string AltString { get { return string.Empty; } }
|
||||
|
||||
int ticketNumber; /// 0 .. number of devices registered for regular polling - 1
|
||||
|
||||
public double CorrectionValLo { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.CorrectionValLo); } }
|
||||
public double CorrectionValHi { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.CorrectionValHi); } }
|
||||
|
||||
IList<MeasurementCorrection> CorrectionsLocal;
|
||||
|
||||
|
||||
public AdjustableMeter() { }
|
||||
|
||||
public AdjustableMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
_adjustableMtrCfg = cfg as AdjustableMeterCfg;
|
||||
CreateConditions();
|
||||
}
|
||||
|
||||
///
|
||||
/// IDevice interface
|
||||
///
|
||||
public override void Initialize()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
InitModbus();
|
||||
|
||||
if (CorrectionValLo != 0 || CorrectionValHi != 0 ) {
|
||||
CorrectionsLocal = new List<MeasurementCorrection>();
|
||||
MeasurementCorrection Lo, Hi;
|
||||
Lo = new MeasurementCorrection(1);
|
||||
Lo.Measurement = CorrectionValLo;
|
||||
Lo.Correction = MsrdValLimLo;
|
||||
CorrectionsLocal.Add(Lo);
|
||||
Hi = new MeasurementCorrection(2);
|
||||
Hi.Measurement = CorrectionValHi;
|
||||
Hi.Correction = MsrdValLimHi;
|
||||
CorrectionsLocal.Add(Hi);
|
||||
|
||||
log.FatalFormat("{0} Correction initialised - CorrectionValLo: {1} CorrectionValHi: {2}", Name, CorrectionValLo, CorrectionValHi);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitModbus()
|
||||
{
|
||||
modbus = TbfComponents.FindComponent(_adjustableMtrCfg.ParentName) as Common.Modbus;
|
||||
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
modbus.ComponentNames[_adjustableMtrCfg.ModbusAddress] = Name;
|
||||
ticketNumber = modbus.RegisterForPolling();
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal && modbus.ReceivedTelegrams[_adjustableMtrCfg.ModbusAddress].Count > 0)
|
||||
{
|
||||
byte[] telegram = modbus.ReceivedTelegrams[_adjustableMtrCfg.ModbusAddress].Dequeue();
|
||||
if (telegram.Length == 9 && telegram[1] == 4 && telegram[2] == 4)
|
||||
{
|
||||
/// Swap byte order
|
||||
byte t1 = telegram[3];
|
||||
byte t2 = telegram[4];
|
||||
byte t3 = telegram[5];
|
||||
byte t4 = telegram[6];
|
||||
telegram[3] = t4;
|
||||
telegram[4] = t3;
|
||||
telegram[5] = t2;
|
||||
telegram[6] = t1;
|
||||
|
||||
receivedAmpers = Units.ConvertFrom(Unit.A, System.BitConverter.ToSingle(telegram, 3));
|
||||
if (CorrectionsLocal != null)
|
||||
{
|
||||
receivedValue = GetCorrectionLimitLessHi(receivedAmpers, CorrectionsLocal);
|
||||
}
|
||||
else
|
||||
{
|
||||
receivedValue = receivedAmpers;
|
||||
}
|
||||
|
||||
log.WarnFormat("Adjustable meter: {0}={1} Unit interpolated from Ampers: {2}", Name, receivedValue.ToString("F3"), receivedAmpers.ToString("F3"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a correction from a list of corrections by interpolation.
|
||||
/// It is assumed that values in the list 'corrections' are sorted.
|
||||
/// </summary>
|
||||
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||
/// <returns>Corrected value</returns>
|
||||
public static double GetCorrectionLimitLessHi(double rawValue, IList<MeasurementCorrection> corrections)
|
||||
{
|
||||
if ((corrections == null) || (corrections.Count == 0)) return 0; /// No correction
|
||||
|
||||
if (rawValue < corrections[0].Measurement)
|
||||
{
|
||||
/// rawValue is below the lowest value in the correction table
|
||||
return corrections[0].Correction;
|
||||
}
|
||||
|
||||
for (int i = 1; i < corrections.Count; i++)
|
||||
{
|
||||
if (rawValue < corrections[i].Measurement)
|
||||
{
|
||||
double d1 = rawValue - corrections[i - 1].Measurement;
|
||||
double d2 = corrections[i].Measurement - rawValue;
|
||||
|
||||
if (d1 + d2 <= float.Epsilon)
|
||||
{
|
||||
/// Neigboring values in the corection table are close to each other -> calculate the average
|
||||
return (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Interpolate the correction from neigboring values in the corection table
|
||||
return (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int lastCorrection = corrections.Count - 1;
|
||||
if (lastCorrection > 0)
|
||||
{
|
||||
double d1 = rawValue - corrections[lastCorrection - 1].Measurement;
|
||||
double d2 = corrections[lastCorrection].Measurement - rawValue;
|
||||
return (corrections[lastCorrection - 1].Correction * d2 + corrections[lastCorrection].Correction * d1) /
|
||||
(d1 + d2);
|
||||
}
|
||||
|
||||
/// rawValue is above the highest value in the correction table
|
||||
return corrections[corrections.Count - 1].Correction;
|
||||
}
|
||||
|
||||
|
||||
public void RunDeviceAfter()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal && modbus.IsMyTurn(ticketNumber))
|
||||
{
|
||||
const byte Function = 4; /// Read input registers
|
||||
const ushort Address = 0; /// Pressure
|
||||
modbus.SendMessage((byte)_adjustableMtrCfg.ModbusAddress, Function, Address, 2, Name);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopDevice() { }
|
||||
public void StopDevice2() { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the water pressure
|
||||
/// </summary>
|
||||
/// <returns>Pressure in mBar</returns>
|
||||
public double ReadPressure()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
return MeasurementCorrection.CorrectedValue(receivedValue, Corrections);
|
||||
}
|
||||
else if (DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressureBox">Reference to a variable for the pressure in Bar</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadAdjustableOp(ref DoubleBox value)
|
||||
{
|
||||
return new ReadValueOp(this, ref value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: valueDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressureBox">Reference to a variable for the pressure in Bar</param>
|
||||
/// <param name="pressureDone">Event returned when measurement done</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadAdjustableOp(ref DoubleBox value, Event valueDone)
|
||||
{
|
||||
return new ReadValueOp(this, ref value, valueDone);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// ISequenceCondition interface implementation (conditions in transition sequences)
|
||||
///
|
||||
IList<string> sequenceConditionNames;
|
||||
IList<IOperation> sequenceConditions;
|
||||
|
||||
public int ConditionsCount { get { return sequenceConditions != null ? sequenceConditions.Count : 0; } }
|
||||
|
||||
/// Strings are added to the combo-box for transition sequence condition selection
|
||||
public string ConditionName(int i)
|
||||
{
|
||||
if (sequenceConditionNames != null && i < sequenceConditionNames.Count && i >= 0)
|
||||
return sequenceConditionNames[i];
|
||||
else
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// Operations are executed as a part of a transition sequence
|
||||
public IOperation ConditionOp(int i)
|
||||
{
|
||||
if (sequenceConditions != null && i < sequenceConditions.Count && i >= 0)
|
||||
return sequenceConditions[i];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
void ClearConditions()
|
||||
{
|
||||
sequenceConditionNames = new List<string>();
|
||||
sequenceConditions = new List<IOperation>();
|
||||
}
|
||||
|
||||
void AddCondition(string conditionName, IOperation conditionOperation)
|
||||
{
|
||||
sequenceConditionNames.Add(conditionName);
|
||||
sequenceConditions.Add(conditionOperation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a list of conditions
|
||||
/// </summary>
|
||||
void CreateConditions()
|
||||
{
|
||||
ClearConditions();
|
||||
foreach (var pressLimit in new double[] { 2.18, 2.2, 2.22, 2.24, 2.26, 2.27 })
|
||||
{
|
||||
AddCondition(string.Format("{0} {1} > {2} bar", Strings.Wait_until, Name, pressLimit), new WaitUntilValueIsOp(this, Pr.IsGT, pressLimit));
|
||||
AddCondition(string.Format("{0} {1} < {2} bar", Strings.Wait_until, Name, pressLimit), new WaitUntilValueIsOp(this, Pr.IsLT, pressLimit));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class AdjustableMeterCfg : ComponentCfgBase, IChildComponentCfg, GenericDevices.ICalibInfoCfg, IParamsProvider,
|
||||
IDrawingItemWithMeasuredVal
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AdjustableMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int ModbusAddress; /// 0 (1..254)
|
||||
public double DefaultPressure; /// 1
|
||||
public string MsrdFormat { get; set; } /// 2
|
||||
public Unit MsrdUnit { get; set; } /// 3
|
||||
public double MsrdValLimLo { get; set; } /// 4
|
||||
public double MsrdValLimHi { get; set; } /// 5
|
||||
public double CorrectionValLo { get ; set; } /// 6
|
||||
public double CorrectionValHi { get ; set; } /// 7
|
||||
|
||||
|
||||
|
||||
/// Calibration info serialized parameters displayed in Metrology tab page
|
||||
public string CalibCertificateNr { get; set; }
|
||||
public string CertPath { get; set; }
|
||||
public DateTime CalibDate { get; set; }
|
||||
public DateTime CalibValidDate { get; set; }
|
||||
|
||||
/// Schematic drawing info
|
||||
public Shape Shape { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public Sz Sz { get; set; }
|
||||
public Orient Orient { get; set; }
|
||||
public bool Flip { get; set; }
|
||||
public int LblX { get; set; }
|
||||
public int LblY { get; set; }
|
||||
public Orient LblOrient { get; set; }
|
||||
public int MsrdX { get; set; }
|
||||
public int MsrdY { get; set; }
|
||||
public Orient MsrdOrient { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<GNode> GNodes { get; set; }
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
AdjustableMeterCfg()
|
||||
{
|
||||
GNodes = new List<GNode>();
|
||||
}
|
||||
|
||||
public AdjustableMeterCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Shape = Shape.ElectricM;
|
||||
Sz = Sz.M;
|
||||
Factory = factory;
|
||||
Name = "Ad";
|
||||
ParentName = "Modbus";
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
ModbusAddress = 49;
|
||||
DefaultPressure = 2.34;
|
||||
MsrdFormat = "{0:F2} A";
|
||||
MsrdUnit = Unit.A;
|
||||
MsrdValLimLo = -0.1;
|
||||
MsrdValLimHi = 25.0;
|
||||
|
||||
CorrectionValLo = 0.0;
|
||||
CorrectionValHi = 0.0;
|
||||
|
||||
MsrdY = 22;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
"Modbus address", /// 0
|
||||
"Default value", /// 1
|
||||
"Display format", /// 2
|
||||
"Unit", /// 3
|
||||
"Limit Lo", /// 4
|
||||
"Limit Hi", /// 5
|
||||
"Correction limit Lo", /// 6
|
||||
"Correction limit Hi", /// 7
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 3:
|
||||
return new string[] { "A", "mA", "V", "mV", "Pa", "hPa", "mbar", "kPa", "inHg", "psi", "bar", "MPa" };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: return ModbusAddress.ToString();
|
||||
case 1: return DefaultPressure.ToString();
|
||||
case 2: return MsrdFormat;
|
||||
case 3: return MsrdUnit.ToDescription();
|
||||
case 4: return MsrdValLimLo.ToString();
|
||||
case 5: return MsrdValLimHi.ToString();
|
||||
case 6: return CorrectionValLo.ToString();
|
||||
case 7: return CorrectionValHi.ToString();
|
||||
default:
|
||||
return string.Format("{0}({1}) address={2}", Name, string.IsNullOrEmpty(ParentName) ? "-" : ParentName, ModbusAddress);
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string str)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: ModbusAddress = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: DefaultPressure = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: MsrdFormat = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3:
|
||||
foreach (var u in new Unit[] { Unit.A, Unit.mA, Unit.V, Unit.mV, Unit.Pa, Unit.hPa, Unit.mbar, Unit.kPa, Unit.inHg, Unit.psi, Unit.bar, Unit.MPa })
|
||||
{
|
||||
if (str == u.ToDescription())
|
||||
{
|
||||
MsrdUnit = u;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
}
|
||||
return CfgUpdateFlags.None;
|
||||
case 4: MsrdValLimLo = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: MsrdValLimHi = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: CorrectionValLo = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: CorrectionValHi = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string str, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
int idummy;
|
||||
double dummy;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 254) return true;
|
||||
break;
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if (TBF.Utils.TryParseSDouble(str, out dummy)) return true;
|
||||
break;
|
||||
case 2:
|
||||
return true;
|
||||
case 3:
|
||||
if (ParamValues(i).Contains(str)) return true;
|
||||
break;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = ParamName(i) + " is invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(AdjustableMeterCfg prms)
|
||||
{
|
||||
prms.ParentName = this.ParentName;
|
||||
|
||||
prms.CalibCertificateNr = this.CalibCertificateNr;
|
||||
prms.CertPath = this.CertPath;
|
||||
prms.CalibDate = this.CalibDate;
|
||||
prms.CalibValidDate = this.CalibValidDate;
|
||||
prms.Shape = this.Shape;
|
||||
prms.Sz = this.Sz;
|
||||
prms.Orient = this.Orient;
|
||||
prms.Flip = this.Flip;
|
||||
prms.LblX = this.LblX;
|
||||
prms.LblY = this.LblY;
|
||||
prms.LblOrient = this.LblOrient;
|
||||
prms.MsrdX = this.MsrdX;
|
||||
prms.MsrdY = this.MsrdY;
|
||||
prms.MsrdOrient = this.MsrdOrient;
|
||||
|
||||
prms.ModbusAddress = this.ModbusAddress;
|
||||
prms.DefaultPressure = this.DefaultPressure;
|
||||
prms.MsrdFormat = this.MsrdFormat;
|
||||
prms.MsrdUnit = this.MsrdUnit;
|
||||
prms.MsrdValLimLo = this.MsrdValLimLo;
|
||||
prms.MsrdValLimHi = this.MsrdValLimHi;
|
||||
|
||||
prms.CorrectionValLo = this.CorrectionValLo;
|
||||
prms.CorrectionValHi = this.CorrectionValHi;
|
||||
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
AdjustableMeterCfg pars = new AdjustableMeterCfg();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8); } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new AdjustableMeter(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new AdjustableMeter(cfg, components); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new AdjustableMeterCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(AdjustableMeterCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class ReadValueOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadValueOp));
|
||||
public override string ToString() { return string.Format("ReadPressureOp(.,{0},.)", eventDone); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly AdjustableMeter _adjustableMeter;
|
||||
readonly DoubleBox value; /// Box for the measured value
|
||||
readonly Event eventDone;
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureDone or Error
|
||||
/// </summary>
|
||||
/// <param name="adjustableMeter">Pressure meter reference</param>
|
||||
/// <param name="value">Reference to the measured pressure variable, value is in bar</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public ReadValueOp(AdjustableMeter adjustableMeter, ref DoubleBox value, Event eventDone)
|
||||
{
|
||||
if (adjustableMeter == null) throw new ArgumentNullException("adjustableMeter");
|
||||
this._adjustableMeter = adjustableMeter;
|
||||
this.value = value;
|
||||
this.eventDone = eventDone;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
public ReadValueOp(AdjustableMeter adjustableMeter, ref DoubleBox value)
|
||||
: this(adjustableMeter, ref value, Event.PressureDone)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
if (value != null) value.Val = _adjustableMeter.ReadPressure();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>
|
||||
/// Event.PressureInDone or Event.PressureOutDone
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (value != null) value.Val = _adjustableMeter.ReadPressure();
|
||||
return eventDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop() { }
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public enum Pr
|
||||
{
|
||||
IsGT,
|
||||
IsLT,
|
||||
}
|
||||
|
||||
public class WaitUntilValueIsOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(WaitUntilValueIsOp));
|
||||
public override string ToString() { return string.Format("WaitUntilPressureIsOp({0}, {1}, {2:F1}bar)", meter.Name, condition, valueLimit); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly AdjustableMeter meter;
|
||||
readonly double valueLimit;
|
||||
readonly Pr condition;
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureInDone, PressureOutDone or Error
|
||||
/// </summary>
|
||||
/// <param name="meter">Temp. controller reference</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public WaitUntilValueIsOp(AdjustableMeter meter, Pr condition, double valueLimit)
|
||||
{
|
||||
if (meter == null) throw new ArgumentNullException("tempControl");
|
||||
this.meter = meter;
|
||||
this.valueLimit = valueLimit;
|
||||
this.condition = condition;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start() { }
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
public Event Run()
|
||||
{
|
||||
if (condition == Pr.IsGT && meter.ReadPressure() > valueLimit)
|
||||
{
|
||||
return Event.ConditionMet;
|
||||
}
|
||||
else if (condition == Pr.IsLT && meter.ReadPressure() < valueLimit)
|
||||
{
|
||||
return Event.ConditionMet;
|
||||
}
|
||||
|
||||
return Event.ConditionNotMet;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop() { }
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ namespace TBF.Rig.Modbus.TankSelector
|
||||
/// </summary>
|
||||
void RecoverState()
|
||||
{
|
||||
latchedDigitalInputs = StateMachine.ControlBoardMain.DigitalInputs;
|
||||
latchedDigitalInputs = StateMachine.ControlBoard.DigitalInputs;
|
||||
if ((latchedDigitalInputs & (ulong)DigitalInputs.ColdTankSelected) != 0)
|
||||
{
|
||||
if ((latchedDigitalInputs & (ulong)DigitalInputs.Pumping_WaitingLevel) == 0)
|
||||
@@ -228,7 +228,7 @@ namespace TBF.Rig.Modbus.TankSelector
|
||||
/// </summary>
|
||||
void DetectNoTankSelected()
|
||||
{
|
||||
ulong digiIn = StateMachine.ControlBoardMain.DigitalInputs;
|
||||
ulong digiIn = StateMachine.ControlBoard.DigitalInputs;
|
||||
|
||||
if (digiIn == latchedDigitalInputs)
|
||||
{
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace TBF.Rig.Network.Camera.Roi
|
||||
cameraPulses = NetCamera.GetResult(roiHandle, out cameraTime);
|
||||
}
|
||||
|
||||
wmRefPulses = StateMachine.ControlBoardMain.RefPulses;
|
||||
wmRefPulses = StateMachine.ControlBoard.RefPulses;
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace TBF.Rig.Network.Camera.RoiForFixedStart
|
||||
|
||||
public int WMPulses { get { return (int)(WMVolume / LtrsPerPulse); } }
|
||||
|
||||
public int WMRefPulses { get { return StateMachine.ControlBoardMain.RefPulses; ; } }
|
||||
public int WMRefPulses { get { return StateMachine.ControlBoard.RefPulses; ; } }
|
||||
|
||||
|
||||
public Roi() { }
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(8); } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new Printer(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg(this.GetType().Namespace.Substring(15), this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(PrinterCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using Config.Resources;
|
||||
using NHibernate;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class GroupPrinterUtils
|
||||
{
|
||||
public static ISession GetCorrespondedEntities(in IList<Component> cmpntEntities, in List<string> itemsToPrint)
|
||||
{
|
||||
ISession session = TBF.DB.CreateSession(DBKind.Config);
|
||||
IList<Component> cmpntEntitiesAll = session.QueryOver<Component>()
|
||||
.OrderBy(x => x.ItemNr).Asc
|
||||
.List<Component>();
|
||||
|
||||
cmpntEntities?.Clear();
|
||||
|
||||
List<PrinterDef> printerDefs = new List<PrinterDef>();
|
||||
if (itemsToPrint != null && itemsToPrint.Count > 0)
|
||||
{
|
||||
foreach (string printer in itemsToPrint)
|
||||
{
|
||||
printerDefs.Add(PrinterDef.fromString(printer));
|
||||
}
|
||||
}
|
||||
|
||||
if (printerDefs.Count > 0)
|
||||
{
|
||||
foreach (PrinterDef printerDef in printerDefs)
|
||||
{
|
||||
foreach (var component in cmpntEntitiesAll)
|
||||
{
|
||||
if (printerDef.Equals(PrinterDef.fromComponent(component)))
|
||||
{
|
||||
cmpntEntities.Add(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
public static string[] GetExpandedGroupPrinters(string[] printers)
|
||||
{
|
||||
List<string> allPrinters = new List<string>();
|
||||
|
||||
ISession session = TBF.DB.CreateSession(DBKind.Config);
|
||||
IList<Component> cmpntEntitiesAll = session.QueryOver<Component>()
|
||||
.OrderBy(x => x.ItemNr).Asc
|
||||
.List<Component>();
|
||||
|
||||
string groupPrinterClassName = new Factory().ClassName;
|
||||
|
||||
foreach (string printer in printers)
|
||||
{
|
||||
foreach (var component in cmpntEntitiesAll)
|
||||
{
|
||||
if (printer.Equals(component.Name))
|
||||
{
|
||||
if (component.ClassName.Equals(groupPrinterClassName))
|
||||
{
|
||||
List<PrinterDef> printersDef = PrinterDef.fromParametersString(component.Parameters);
|
||||
foreach (PrinterDef printerDef in printersDef)
|
||||
{
|
||||
allPrinters.Add(printerDef.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allPrinters.Add(printer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allPrinters.ToArray();
|
||||
}
|
||||
|
||||
public static void UpdateParametersInEntitys(ISession session, IList<Component> cmpntEntities,string definedPrinter)
|
||||
{
|
||||
|
||||
{
|
||||
using (var transaction = session.BeginTransaction())
|
||||
{
|
||||
foreach (Component printerItem in cmpntEntities)
|
||||
{
|
||||
XmlDocument xmlDocument = new XmlDocument();
|
||||
xmlDocument.LoadXml(printerItem.Parameters);
|
||||
XmlNodeList printerCfg = xmlDocument.GetElementsByTagName("PrinterName");
|
||||
|
||||
foreach (XmlNode itemNode in printerCfg)
|
||||
{
|
||||
itemNode.InnerText = definedPrinter;
|
||||
}
|
||||
|
||||
printerItem.Parameters = xmlDocument.OuterXml;
|
||||
|
||||
|
||||
session.SaveOrUpdate(printerItem); /// Save user 'admin'
|
||||
|
||||
}
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using Common;
|
||||
using Common.Forms;
|
||||
using Results.Output.Printers.Label;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly PrinterCfg printerCfg;
|
||||
|
||||
public bool SupressPrinting { get { return (printerCfg.NrOfCopies == 0); } }
|
||||
|
||||
Results.Entities.Batch batch; /// Data to print
|
||||
IList<Results.WMeterRsltItemSpec> commonItems; /// Items to print
|
||||
bool printingCompleted = false;
|
||||
bool statusDlgShown = false;
|
||||
ModelessForm modelessForm;
|
||||
|
||||
public Printer() { }
|
||||
|
||||
public Printer(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
printerCfg = cfg as PrinterCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
ApplyConfig();
|
||||
if (printerCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
string message;
|
||||
if (!PrinterStatus.IsOnline(printerCfg.PrinterName, out message)) throw new ApplicationException(message);
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyConfig()
|
||||
{
|
||||
commonItems = Results.WMeterRsltItemSpec.FromStrArray(printerCfg.ItemsToPrint);
|
||||
}
|
||||
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCfgChange(object sender, CfgChangeArgs args)
|
||||
{
|
||||
if (CfgChangeHandler == null) return;
|
||||
try { CfgChangeHandler(sender, args); }
|
||||
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
|
||||
}
|
||||
|
||||
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
|
||||
|
||||
public override void StartChangeHandler()
|
||||
{
|
||||
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
|
||||
{
|
||||
PrinterCfg newCfg = args.Cfg as PrinterCfg;
|
||||
if (newCfg != null && newCfg.Name.Equals(Name))
|
||||
{
|
||||
if (args.Command == CfgChangeCmd.CfgChange)
|
||||
{
|
||||
printerCfg.Template = newCfg.Template;
|
||||
printerCfg.PageOrientation = newCfg.PageOrientation;
|
||||
printerCfg.PaperWidth = newCfg.PaperWidth;
|
||||
printerCfg.PaperHeight = newCfg.PaperHeight;
|
||||
printerCfg.ItemsToPrint = newCfg.ItemsToPrint;
|
||||
printerCfg.FontFamily = newCfg.FontFamily;
|
||||
printerCfg.FontSize = newCfg.FontSize;
|
||||
printerCfg.FontStyle = newCfg.FontStyle;
|
||||
printerCfg.Culture = newCfg.Culture;
|
||||
printerCfg.NrOfCopies = newCfg.NrOfCopies;
|
||||
printerCfg.GoodOnly = newCfg.GoodOnly;
|
||||
printerCfg.BarcodeType = newCfg.BarcodeType;
|
||||
printerCfg.BarcodeLeft = newCfg.BarcodeLeft;
|
||||
printerCfg.BarcodeTop = newCfg.BarcodeTop;
|
||||
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
|
||||
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
|
||||
|
||||
ApplyConfig();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Prints the test cycle results, Events: Event.ResultsPrinted
|
||||
/// </summary>
|
||||
/// <param name="batch">Batch results to print</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ProcessResultsOp(Results.Entities.Batch batch)
|
||||
{
|
||||
this.batch = batch;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
printingCompleted = false;
|
||||
statusDlgShown = false;
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
string message;
|
||||
if (printingCompleted || printerCfg.DebugLevel != DebugMode.Normal)
|
||||
{
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
else if (PrinterStatus.IsOnline(printerCfg.PrinterName, out message))
|
||||
{
|
||||
if (statusDlgShown)
|
||||
{
|
||||
statusDlgShown = false;
|
||||
if (modelessForm != null) modelessForm.Close();
|
||||
}
|
||||
|
||||
/// Printer is online => Print results now
|
||||
CultureInfo oriCulture = Thread.CurrentThread.CurrentCulture;
|
||||
if (printerCfg.Culture != Culture.system)
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
|
||||
}
|
||||
|
||||
foreach (var wm in batch.WaterMeters)
|
||||
{
|
||||
if (wm != null && !wm.Disabled && wm.PrintLabel && (!printerCfg.GoodOnly || wm.Passed))
|
||||
{
|
||||
PrintResults(wm, string.Format("{0}-{1}", batch.BatchNr, wm.WMPosition));
|
||||
}
|
||||
}
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = oriCulture;
|
||||
|
||||
printingCompleted = true;
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!statusDlgShown)
|
||||
{
|
||||
statusDlgShown = true;
|
||||
modelessForm = new ModelessForm(message);
|
||||
new Thread(() => System.Windows.Forms.Application.Run(modelessForm)).Start();
|
||||
}
|
||||
|
||||
return Event.Busy;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void PrintResults(Results.Entities.WaterMeter wm, string documentName)
|
||||
{
|
||||
LabelPrinterCfg cfg = new LabelPrinterCfg
|
||||
{
|
||||
Template = printerCfg.Template,
|
||||
PageOrientation = printerCfg.PageOrientation,
|
||||
PaperWidth = printerCfg.PaperWidth,
|
||||
PaperHeight = printerCfg.PaperHeight,
|
||||
ItemsToPrint = printerCfg.ItemsToPrint,
|
||||
FontFamily = printerCfg.FontFamily,
|
||||
FontSize = printerCfg.FontSize,
|
||||
FontStyle = printerCfg.FontStyle,
|
||||
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
|
||||
GoodOnly = printerCfg.GoodOnly,
|
||||
BarcodeType = printerCfg.BarcodeType,
|
||||
BarcodeLeft = printerCfg.BarcodeLeft,
|
||||
BarcodeTop = printerCfg.BarcodeTop,
|
||||
BarcodeWidth = printerCfg.BarcodeWidth,
|
||||
BarcodeHeight = printerCfg.BarcodeHeight,
|
||||
};
|
||||
|
||||
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
|
||||
{
|
||||
string docNameEx = string.Format((printerCfg.NrOfCopies == 1) ? "{0}" : "{0}_{1}", documentName, i);
|
||||
var pd = new LabelPrintDocument(cfg, wm, docNameEx);
|
||||
if (!string.IsNullOrEmpty(printerCfg.PrinterName)) pd.PrinterSettings.PrinterName = printerCfg.PrinterName;
|
||||
pd.Print();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PrinterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new PrinterCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string PrinterName;
|
||||
public string Template; /// Full path to a 'png' file
|
||||
public PageOrientation PageOrientation;
|
||||
public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count
|
||||
public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count
|
||||
public string[] ItemsToPrint;
|
||||
public string FontFamily;
|
||||
public int FontSize;
|
||||
public int FontStyle;
|
||||
public Culture Culture;
|
||||
public int NrOfCopies;
|
||||
public bool GoodOnly;
|
||||
|
||||
public Results.Output.Printers.BarcodeType BarcodeType;
|
||||
public int BarcodeLeft;
|
||||
public int BarcodeTop;
|
||||
public int BarcodeWidth;
|
||||
public int BarcodeHeight;
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
PrinterCfg()
|
||||
{
|
||||
}
|
||||
|
||||
public PrinterCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Name = name;
|
||||
this.Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
|
||||
Template = string.Empty;
|
||||
PageOrientation = PageOrientation.Portrait;
|
||||
PaperWidth = 827; /// A4 width
|
||||
PaperHeight = 1169; /// A4 height
|
||||
FontFamily = "Arial";
|
||||
FontSize = 10;
|
||||
FontStyle = 0;
|
||||
NrOfCopies = 1;
|
||||
GoodOnly = false;
|
||||
BarcodeType = Results.Output.Printers.BarcodeType.None;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Orientation={1}, PaperWidth={2}, PaperHeight={3}, TemplateFile={4}, GoodOnly={5}, Barcode={6}",
|
||||
Name,
|
||||
PageOrientation,
|
||||
PaperWidth,
|
||||
PaperHeight,
|
||||
Template,
|
||||
GoodOnly ? "yes" : "no",
|
||||
BarcodeType.ToString()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,292 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Printing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using FluentNHibernate.Conventions;
|
||||
using log4net.Repository.Hierarchy;
|
||||
using NHibernate;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.Configs;
|
||||
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public partial class PrinterCfgCtrl : ConfigCtrlUtils, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
|
||||
|
||||
public bool ShowMore
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
IList<Component> cmpntEntities;
|
||||
private ISession session;
|
||||
|
||||
PrinterCfg config;
|
||||
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as PrinterCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
List<string> itemsToPrint;
|
||||
|
||||
public PrinterCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
Localize();
|
||||
}
|
||||
|
||||
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
printerComboBox.Items.Add(Strings.default_printer);
|
||||
foreach (var p in PrinterSettings.InstalledPrinters) printerComboBox.Items.Add(p);
|
||||
|
||||
EnableEdit(false);
|
||||
|
||||
InintComponents();
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
// if (printerComboBox.Enabled && !printerComboBox.Text.IsEmpty())
|
||||
// {
|
||||
// GroupPrinterUtils.UpdateParametersInEntitys(session, cmpntEntities, printerComboBox.Text);
|
||||
// }
|
||||
}
|
||||
|
||||
void InintComponents()
|
||||
{
|
||||
cmpntEntities = cmpntEntities == null ? new List<Component>() : cmpntEntities;
|
||||
itemsToPrint = config.ItemsToPrint?.ToList();
|
||||
session = GroupPrinterUtils.GetCorrespondedEntities(in cmpntEntities, in itemsToPrint);
|
||||
|
||||
RedrawAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
printerComboBox.Text =
|
||||
string.IsNullOrEmpty(config.PrinterName) ? Strings.default_printer : config.PrinterName;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
EnableEdit(true);
|
||||
}
|
||||
|
||||
private void EnableEdit(bool bEnable)
|
||||
{
|
||||
nameTextBox.Enabled = bEnable;
|
||||
printerComboBox.Enabled = bEnable;
|
||||
selectPrinterButton.Enabled = bEnable;
|
||||
btListAdd.Enabled = bEnable;
|
||||
btListRemove.Enabled = bEnable;
|
||||
btMoveUp.Enabled = bEnable;
|
||||
btMoveDown.Enabled = bEnable;
|
||||
listViewEx.Enabled = bEnable;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
string newPrinter = (printerComboBox.Text == Strings.default_printer) ? string.Empty : printerComboBox.Text;
|
||||
if (config.PrinterName != newPrinter)
|
||||
{
|
||||
config.PrinterName = newPrinter;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
|
||||
List<string> itemsComponent = new List<string>();
|
||||
foreach (Component entity in cmpntEntities)
|
||||
{
|
||||
itemsComponent.Add(PrinterDef.fromComponent(entity).ToString());
|
||||
}
|
||||
|
||||
config.ItemsToPrint = itemsComponent.ToArray();
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCmdResponse(object sender, CmdResponseArgs args)
|
||||
{
|
||||
if (CmdResponseHandler == null) return;
|
||||
try
|
||||
{
|
||||
CmdResponseHandler(sender, args);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error("CmdResponseHandler(...) failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
|
||||
|
||||
public void StartResponseHandler()
|
||||
{
|
||||
}
|
||||
|
||||
public void StopResponseHandler()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
|
||||
private void selectPrinterButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrintDialog dlg = new PrintDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
printerComboBox.Text = dlg.PrinterSettings.PrinterName;
|
||||
}
|
||||
}
|
||||
|
||||
private void btListAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterTestBenchComponentSelectorDlg dlg = new PrinterTestBenchComponentSelectorDlg();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (cmpntEntities == null)
|
||||
{
|
||||
cmpntEntities = new List<Component>();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cmpntEntities.Any(com => com.ItemNr == dlg.SelectedComponent.ItemNr))
|
||||
{
|
||||
MessageBox.Show("Item is in list included already!", "Warning", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cmpntEntities.Add(dlg.SelectedComponent);
|
||||
RedrawAll();
|
||||
}
|
||||
}
|
||||
|
||||
void RedrawAll()
|
||||
{
|
||||
listViewEx.Items.Clear();
|
||||
foreach (var cmpnt in cmpntEntities) DrawOne(cmpnt);
|
||||
}
|
||||
|
||||
void DrawOne(Component cmpnt)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(cmpnt.ItemNr.ToString());
|
||||
lvi.Tag = cmpnt;
|
||||
lvi.SubItems.Add(cmpnt.Name);
|
||||
listViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
|
||||
private void btListRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
int selectedIndex = listViewEx.SelectedIndices[0];
|
||||
Component cmpntEntity = cmpntEntities[selectedIndex];
|
||||
if (MessageBox.Show($"Do you want remove {cmpntEntity.Name} from list?", "Remove Action",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
{
|
||||
cmpntEntities.Remove(cmpntEntity);
|
||||
listViewEx.Items.RemoveAt(selectedIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btMoveUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
int selectedIndex = listViewEx.SelectedIndices[0];
|
||||
if (selectedIndex > 0)
|
||||
{
|
||||
int newItemIndex = (selectedIndex - 1);
|
||||
Component cmpntEntity = cmpntEntities[selectedIndex];
|
||||
|
||||
cmpntEntities.Insert(newItemIndex, cmpntEntity);
|
||||
cmpntEntities.RemoveAt(selectedIndex + 1);
|
||||
|
||||
RedrawAll();
|
||||
listViewEx.Items[newItemIndex].Selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btMoveDown_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
int selectedIndex = listViewEx.SelectedIndices[0];
|
||||
if (selectedIndex < listViewEx.Items.Count - 1)
|
||||
{
|
||||
Component cmpntEntity = cmpntEntities[selectedIndex];
|
||||
|
||||
int newItemIndex = selectedIndex + 2;
|
||||
cmpntEntities.Insert(newItemIndex, cmpntEntity);
|
||||
cmpntEntities.RemoveAt(selectedIndex);
|
||||
|
||||
RedrawAll();
|
||||
listViewEx.Items[newItemIndex - 1].Selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
partial class PrinterCfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <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.printerComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.selectPrinterButton = new System.Windows.Forms.Button();
|
||||
this.printerLabel = new System.Windows.Forms.Label();
|
||||
this.listViewEx = new Common.Forms.ListViewEx();
|
||||
this.columnItem = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnName = new System.Windows.Forms.ColumnHeader();
|
||||
this.btListAdd = new System.Windows.Forms.Button();
|
||||
this.btListRemove = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.btMoveUp = new System.Windows.Forms.Button();
|
||||
this.btMoveDown = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(183, 63);
|
||||
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(340, 26);
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(12, 68);
|
||||
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(178, 26);
|
||||
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(92, 20);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "Class name";
|
||||
//
|
||||
// printerComboBox
|
||||
//
|
||||
this.printerComboBox.Enabled = false;
|
||||
this.printerComboBox.FormattingEnabled = true;
|
||||
this.printerComboBox.Location = new System.Drawing.Point(183, 98);
|
||||
this.printerComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.printerComboBox.Name = "printerComboBox";
|
||||
this.printerComboBox.Size = new System.Drawing.Size(340, 28);
|
||||
this.printerComboBox.TabIndex = 59;
|
||||
//
|
||||
// selectPrinterButton
|
||||
//
|
||||
this.selectPrinterButton.Enabled = false;
|
||||
this.selectPrinterButton.Location = new System.Drawing.Point(105, 97);
|
||||
this.selectPrinterButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.selectPrinterButton.Name = "selectPrinterButton";
|
||||
this.selectPrinterButton.Size = new System.Drawing.Size(75, 34);
|
||||
this.selectPrinterButton.TabIndex = 58;
|
||||
this.selectPrinterButton.Text = "Select";
|
||||
this.selectPrinterButton.UseVisualStyleBackColor = true;
|
||||
this.selectPrinterButton.Click += new System.EventHandler(this.selectPrinterButton_Click);
|
||||
//
|
||||
// printerLabel
|
||||
//
|
||||
this.printerLabel.AutoSize = true;
|
||||
this.printerLabel.Location = new System.Drawing.Point(12, 103);
|
||||
this.printerLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.printerLabel.Name = "printerLabel";
|
||||
this.printerLabel.Size = new System.Drawing.Size(55, 20);
|
||||
this.printerLabel.TabIndex = 57;
|
||||
this.printerLabel.Text = "Printer";
|
||||
//
|
||||
// listViewEx
|
||||
//
|
||||
this.listViewEx.AllowColumnReorder = true;
|
||||
this.listViewEx.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnItem, this.columnName });
|
||||
this.listViewEx.DoubleClickActivation = false;
|
||||
this.listViewEx.FullRowSelect = true;
|
||||
this.listViewEx.HideSelection = false;
|
||||
this.listViewEx.Location = new System.Drawing.Point(183, 136);
|
||||
this.listViewEx.Name = "listViewEx";
|
||||
this.listViewEx.Size = new System.Drawing.Size(340, 344);
|
||||
this.listViewEx.TabIndex = 60;
|
||||
this.listViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewEx.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// columnItem
|
||||
//
|
||||
this.columnItem.Text = "No";
|
||||
this.columnItem.Width = 40;
|
||||
//
|
||||
// columnName
|
||||
//
|
||||
this.columnName.Text = "Name";
|
||||
this.columnName.Width = 321;
|
||||
//
|
||||
// btListAdd
|
||||
//
|
||||
this.btListAdd.Location = new System.Drawing.Point(24, 165);
|
||||
this.btListAdd.Name = "btListAdd";
|
||||
this.btListAdd.Size = new System.Drawing.Size(115, 30);
|
||||
this.btListAdd.TabIndex = 61;
|
||||
this.btListAdd.Text = "Add";
|
||||
this.btListAdd.UseVisualStyleBackColor = true;
|
||||
this.btListAdd.Click += new System.EventHandler(this.btListAdd_Click);
|
||||
//
|
||||
// btListRemove
|
||||
//
|
||||
this.btListRemove.Location = new System.Drawing.Point(24, 201);
|
||||
this.btListRemove.Name = "btListRemove";
|
||||
this.btListRemove.Size = new System.Drawing.Size(115, 30);
|
||||
this.btListRemove.TabIndex = 62;
|
||||
this.btListRemove.Text = "Remove";
|
||||
this.btListRemove.UseVisualStyleBackColor = true;
|
||||
this.btListRemove.Click += new System.EventHandler(this.btListRemove_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(12, 136);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(166, 26);
|
||||
this.label3.TabIndex = 63;
|
||||
this.label3.Text = "List of Print Assembly";
|
||||
//
|
||||
// btMoveUp
|
||||
//
|
||||
this.btMoveUp.Location = new System.Drawing.Point(24, 237);
|
||||
this.btMoveUp.Name = "btMoveUp";
|
||||
this.btMoveUp.Size = new System.Drawing.Size(115, 30);
|
||||
this.btMoveUp.TabIndex = 64;
|
||||
this.btMoveUp.Text = "Move Up";
|
||||
this.btMoveUp.UseVisualStyleBackColor = true;
|
||||
this.btMoveUp.Click += new System.EventHandler(this.btMoveUp_Click);
|
||||
//
|
||||
// btMoveDown
|
||||
//
|
||||
this.btMoveDown.Location = new System.Drawing.Point(24, 273);
|
||||
this.btMoveDown.Name = "btMoveDown";
|
||||
this.btMoveDown.Size = new System.Drawing.Size(115, 30);
|
||||
this.btMoveDown.TabIndex = 65;
|
||||
this.btMoveDown.Text = "Move Down";
|
||||
this.btMoveDown.UseVisualStyleBackColor = true;
|
||||
this.btMoveDown.Click += new System.EventHandler(this.btMoveDown_Click);
|
||||
//
|
||||
// PrinterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btMoveDown);
|
||||
this.Controls.Add(this.btMoveUp);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.btListRemove);
|
||||
this.Controls.Add(this.btListAdd);
|
||||
this.Controls.Add(this.listViewEx);
|
||||
this.Controls.Add(this.printerComboBox);
|
||||
this.Controls.Add(this.selectPrinterButton);
|
||||
this.Controls.Add(this.printerLabel);
|
||||
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 = "PrinterCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(558, 593);
|
||||
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
private System.Windows.Forms.Button btMoveUp;
|
||||
private System.Windows.Forms.Button btMoveDown;
|
||||
|
||||
private System.Windows.Forms.ColumnHeader columnItem;
|
||||
private System.Windows.Forms.ColumnHeader columnName;
|
||||
|
||||
private System.Windows.Forms.Label label3;
|
||||
|
||||
private Common.Forms.ListViewEx listViewEx;
|
||||
private System.Windows.Forms.Button btListAdd;
|
||||
private System.Windows.Forms.Button btListRemove;
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.ComboBox printerComboBox;
|
||||
private System.Windows.Forms.Button selectPrinterButton;
|
||||
private System.Windows.Forms.Label printerLabel;
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,95 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using Config.Entities;
|
||||
using log4net;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class PrinterDef
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
|
||||
public String Name { get; set; }
|
||||
public String ObjName { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || !(obj is PrinterDef))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Name.Equals(((PrinterDef)obj).Name) &&
|
||||
ObjName.Equals(((PrinterDef)obj).ObjName);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Name}:{ObjName}";
|
||||
}
|
||||
|
||||
public Component toComponent(IList<Component> components)
|
||||
{
|
||||
foreach (Component component in components)
|
||||
{
|
||||
if (component.Name.Equals(Name) && component.ClassName.Equals(ObjName))
|
||||
{
|
||||
return component;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static PrinterDef fromString(string formated)
|
||||
{
|
||||
try
|
||||
{
|
||||
PrinterDef printerDef = new PrinterDef();
|
||||
string[] spliteStrings = formated.Split(':');
|
||||
printerDef.Name = spliteStrings[0];
|
||||
printerDef.ObjName = spliteStrings[1];
|
||||
return printerDef;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error(e.StackTrace);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<PrinterDef> fromParametersString(string parameters)
|
||||
{
|
||||
List<PrinterDef> printerDefs = new List<PrinterDef>();
|
||||
// we have group printer
|
||||
XmlDocument xmlDocument = new XmlDocument();
|
||||
xmlDocument.LoadXml(parameters);
|
||||
XmlNodeList printerCfg = xmlDocument.GetElementsByTagName("ItemsToPrint");
|
||||
// Extract the text content of each <string> element within ItemsToPrint
|
||||
List<string> itemsToPrint = new List<string>();
|
||||
|
||||
foreach (XmlNode itemNode in printerCfg)
|
||||
{
|
||||
// Process each "ItemsToPrint" element here
|
||||
foreach (XmlNode itemToPrint in itemNode.ChildNodes)
|
||||
{
|
||||
if (itemToPrint.NodeType == XmlNodeType.Element && itemToPrint.Name == "string")
|
||||
{
|
||||
printerDefs.Add(PrinterDef.fromString(itemToPrint.InnerText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return printerDefs;
|
||||
}
|
||||
|
||||
public static PrinterDef fromComponent(Component component)
|
||||
{
|
||||
PrinterDef printerDef = new PrinterDef();
|
||||
printerDef.Name = component.Name;
|
||||
printerDef.ObjName = component.ClassName;
|
||||
return printerDef;
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-125
@@ -1,125 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
partial class PrinterTestBenchComponentSelectorDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.listViewEx = new Common.Forms.ListViewEx();
|
||||
this.btSelect = new System.Windows.Forms.Button();
|
||||
this.btCancel = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.listViewEx);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.btCancel);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.btSelect);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(926, 471);
|
||||
this.splitContainer1.SplitterDistance = 732;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// listViewEx
|
||||
//
|
||||
this.listViewEx.AllowColumnReorder = true;
|
||||
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listViewEx.DoubleClickActivation = false;
|
||||
this.listViewEx.FullRowSelect = true;
|
||||
this.listViewEx.HideSelection = false;
|
||||
this.listViewEx.Location = new System.Drawing.Point(0, 0);
|
||||
this.listViewEx.Name = "listViewEx";
|
||||
this.listViewEx.Size = new System.Drawing.Size(732, 471);
|
||||
this.listViewEx.TabIndex = 0;
|
||||
this.listViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewEx.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// btSelect
|
||||
//
|
||||
this.btSelect.Location = new System.Drawing.Point(30, 12);
|
||||
this.btSelect.Name = "btSelect";
|
||||
this.btSelect.Size = new System.Drawing.Size(135, 60);
|
||||
this.btSelect.TabIndex = 0;
|
||||
this.btSelect.Text = "Select";
|
||||
this.btSelect.UseVisualStyleBackColor = true;
|
||||
this.btSelect.Click += new System.EventHandler(this.btSelect_Click);
|
||||
//
|
||||
// btCancel
|
||||
//
|
||||
this.btCancel.Location = new System.Drawing.Point(32, 89);
|
||||
this.btCancel.Name = "btCancel";
|
||||
this.btCancel.Size = new System.Drawing.Size(132, 53);
|
||||
this.btCancel.TabIndex = 1;
|
||||
this.btCancel.Text = "Cancel";
|
||||
this.btCancel.UseVisualStyleBackColor = true;
|
||||
this.btCancel.Click += new System.EventHandler(this.btCancel_Click);
|
||||
//
|
||||
// PrinterTestBenchComponentSelectorDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.ClientSize = new System.Drawing.Size(926, 471);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Location = new System.Drawing.Point(15, 15);
|
||||
this.Name = "PrinterTestBenchComponentSelectorDlg";
|
||||
this.Load += new System.EventHandler(this.PrinterTestBenchComponentSelectorDlg_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
private System.Windows.Forms.Button btCancel;
|
||||
|
||||
private System.Windows.Forms.Button btSelect;
|
||||
|
||||
private Common.Forms.ListViewEx listViewEx;
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public partial class PrinterTestBenchComponentSelectorDlg : Form
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PrinterTestBenchComponentSelectorDlg));
|
||||
|
||||
/// <summary>
|
||||
/// List of components (=component configuration instances)
|
||||
/// </summary>
|
||||
IList<Component> cmpntEntities;
|
||||
|
||||
public Component SelectedComponent { get; set; }
|
||||
|
||||
ISession session;
|
||||
|
||||
MySortOrder sortOrder = MySortOrder.Ascending;
|
||||
int sortColumn = -1; /// 0-based index of column to be used for sorting
|
||||
|
||||
|
||||
public PrinterTestBenchComponentSelectorDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void LoadFormPosition()
|
||||
{
|
||||
LocalSettings ls = Program.LocalSettings;
|
||||
Width = (ls.ComponentsDlgWidth > 0) ? ls.ComponentsDlgWidth : 850;
|
||||
Height = (ls.ComponentsDlgHeight > 0) ? ls.ComponentsDlgHeight : 500;
|
||||
Left = (ls.ComponentsDlgLeft != 0) ? ls.ComponentsDlgLeft : 200;
|
||||
Top = (ls.ComponentsDlgTop != 0) ? ls.ComponentsDlgTop : 100;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save the dialog position and ListViewEx column widths
|
||||
/// </summary>
|
||||
void SaveUISettings()
|
||||
{
|
||||
/// Obtain ComponentsmanagerDlg dimensions, etc.
|
||||
bool isMaximized = (WindowState == FormWindowState.Maximized);
|
||||
int left = (WindowState == FormWindowState.Normal) ? Location.X : RestoreBounds.Left;
|
||||
int top = (WindowState == FormWindowState.Normal) ? Location.Y : RestoreBounds.Top;
|
||||
int width = (WindowState == FormWindowState.Normal) ? Size.Width : RestoreBounds.Width;
|
||||
int height = (WindowState == FormWindowState.Normal) ? Size.Height : RestoreBounds.Height;
|
||||
|
||||
LocalSettings ls = Program.LocalSettings;
|
||||
|
||||
/// Compare list view column widths with the saved ones
|
||||
bool anyColumnDiffers = false;
|
||||
// if ((int)Column.ColumnsCount != ls.ComponentsColumnCount)
|
||||
// {
|
||||
// anyColumnDiffers = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// for (int i = 0; i < (int)Column.ColumnsCount; i++)
|
||||
// {
|
||||
// if (listViewEx.Columns[i].Width != ls.ComponentsColumnWidths[i]) { anyColumnDiffers = true; break; }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
if (ls != null && (ls.ComponentsDlgMaximized != isMaximized ||
|
||||
ls.ComponentsDlgLeft != left ||
|
||||
ls.ComponentsDlgTop != top ||
|
||||
ls.ComponentsDlgWidth != width ||
|
||||
ls.ComponentsDlgHeight != height ||
|
||||
anyColumnDiffers))
|
||||
{
|
||||
/// At least one ComponentsManagerDlg dimension differs => Update local settings and save them
|
||||
///
|
||||
ls.ComponentsDlgMaximized = isMaximized;
|
||||
ls.ComponentsDlgLeft = left;
|
||||
ls.ComponentsDlgTop = top;
|
||||
ls.ComponentsDlgWidth = width;
|
||||
ls.ComponentsDlgHeight = height;
|
||||
|
||||
/// List view column widths
|
||||
// ls.ComponentsColumnWidths = new int[(int)Column.ColumnsCount];
|
||||
// for (int i = 0; i < (int)Column.ColumnsCount; i++)
|
||||
// {
|
||||
// ls.ComponentsColumnWidths[i] = listViewEx.Columns[i].Width;
|
||||
// }
|
||||
|
||||
ls.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void btSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
SelectedComponent = cmpntEntities[listViewEx.SelectedIndices[0]];
|
||||
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("No Selection", "Selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void PrinterTestBenchComponentSelectorDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadFormPosition();
|
||||
|
||||
LocalSettings ls = Program.LocalSettings;
|
||||
listViewEx.Columns.Add(Strings.Nr, (ls.ComponentsColumnCount > 0) ? ls.ComponentsColumnWidths[0] : 40);
|
||||
listViewEx.Columns.Add(Strings.Name, (ls.ComponentsColumnCount > 1) ? ls.ComponentsColumnWidths[1] : 80);
|
||||
listViewEx.Columns.Add(Strings.Type, (ls.ComponentsColumnCount > 2) ? ls.ComponentsColumnWidths[2] : 120);
|
||||
listViewEx.Columns.Add(Strings.Parent, (ls.ComponentsColumnCount > 3) ? ls.ComponentsColumnWidths[3] : 55);
|
||||
listViewEx.Columns.Add(Strings.Parameters, (ls.ComponentsColumnCount > 6) ? ls.ComponentsColumnWidths[6] : 600);
|
||||
listViewEx.HeaderStyle = ColumnHeaderStyle.Clickable;
|
||||
|
||||
GetEntities();
|
||||
|
||||
RedrawAll();
|
||||
}
|
||||
|
||||
private void GetEntities()
|
||||
{
|
||||
session = TBF.DB.CreateSession(DBKind.Config);
|
||||
IList<Component> cmpntEntitiesAll = session.QueryOver<Component>()
|
||||
.OrderBy(x => x.ItemNr).Asc
|
||||
.List<Component>();
|
||||
|
||||
if (cmpntEntities == null)
|
||||
{
|
||||
cmpntEntities = new List<Component>();
|
||||
}
|
||||
else
|
||||
{
|
||||
cmpntEntities.Clear();
|
||||
}
|
||||
|
||||
foreach (var component in cmpntEntitiesAll)
|
||||
{
|
||||
if (component.ClassName.StartsWith("Output.Printers.OnePerMeter"))
|
||||
{
|
||||
cmpntEntities.Add(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RedrawAll()
|
||||
{
|
||||
listViewEx.Items.Clear();
|
||||
foreach (var cmpnt in cmpntEntities) DrawOne(cmpnt);
|
||||
}
|
||||
|
||||
void DrawOne(Component cmpnt)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(cmpnt.ItemNr.ToString());
|
||||
lvi.Tag = cmpnt;
|
||||
lvi.SubItems.Add(cmpnt.Name);
|
||||
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ClassName) ? string.Empty : cmpnt.ClassName);
|
||||
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.Parent) ? string.Empty : cmpnt.Parent);
|
||||
|
||||
IComponentCfg cmpCfg = TbfComponents.CmpntCfgFromCmpntEntity(cmpnt);
|
||||
if (cmpCfg != null)
|
||||
{
|
||||
lvi.SubItems.Add(cmpCfg.ToString(-1));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.SubItems.Add("Not a component");
|
||||
}
|
||||
|
||||
listViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
private void btCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveUISettings();
|
||||
SelectedComponent = null;
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -182,7 +182,7 @@ namespace TBF.Rig.RegisterReaders.DataStream.Reader
|
||||
endWMState = VolumeLtrEnd;
|
||||
wmVolume = Math.Abs(VolumeLtrEnd - VolumeLtrStart);
|
||||
wmPulses = (int)Math.Round(wmVolume * PulsesPerLtr);
|
||||
wmRefPulses = StateMachine.ControlBoardMain.RefPulses;
|
||||
wmRefPulses = StateMachine.ControlBoard.RefPulses;
|
||||
log.DebugFormat("Stop() ... Position={0}, wmVolume={1}, wmPulses={2}, wmRefPulses={3}", Position, wmVolume, wmPulses, wmRefPulses);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace TBF.Rig.RegisterReaders.KPackE.RegisterReader
|
||||
radio = (Radio.Radio)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (radio == null) throw new Exception(string.Format("Cannot find a parent of {0}", Name));
|
||||
|
||||
uniCB = StateMachine.ControlBoardMain as TBF.Rig.ControlBoard.Uni.UniCB;
|
||||
uniCB = StateMachine.ControlBoard as TBF.Rig.ControlBoard.Uni.UniCB;
|
||||
if (uniCB == null) throw new Exception("Missing ELDE control board");
|
||||
|
||||
log.Warn(this.ToString());
|
||||
|
||||
@@ -495,7 +495,7 @@ namespace TBF.Rig.RegisterReaders.S640Stream
|
||||
endWMState = volumeLtr;
|
||||
wmVolume = Math.Abs(endWMState - beginWMState);
|
||||
wmPulses = Convert.ToInt32(Math.Round(wmVolume * PulsesPerLtr));
|
||||
wmRefPulses = StateMachine.ControlBoardMain.RefPulses;
|
||||
wmRefPulses = StateMachine.ControlBoard.RefPulses;
|
||||
wmTestTime = timestampSec - timestampSec0;
|
||||
}
|
||||
|
||||
|
||||
@@ -453,7 +453,7 @@ namespace TBF.Rig.RegisterReaders.SerialStream
|
||||
endWMState = volumeLtr;
|
||||
wmVolume = Math.Abs(endWMState - beginWMState);
|
||||
wmPulses = Convert.ToInt32(Math.Round(wmVolume * PulsesPerLtr));
|
||||
wmRefPulses = StateMachine.ControlBoardMain.RefPulses;
|
||||
wmRefPulses = StateMachine.ControlBoard.RefPulses;
|
||||
wmTestTime = timestampSec - timestampSec0;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ namespace TBF.Rig.Scales
|
||||
|
||||
if (drainValve == null) throw new Exception(string.Format("{0} is missing a drain valve", Name));
|
||||
|
||||
openTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoardMain, drainValve, null);
|
||||
closeTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoardMain, null, drainValve);
|
||||
openTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoard, drainValve, null);
|
||||
closeTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoard, null, drainValve);
|
||||
waitTankIsEmptyOp = new WaitTankEmptyOp(this);
|
||||
|
||||
Various.TankWithLevelMsrmnt.TankCfg tankCfg = tankDrainingCfg as Various.TankWithLevelMsrmnt.TankCfg;
|
||||
|
||||
@@ -12,7 +12,6 @@ using Config.Entities;
|
||||
using TBF.Rig.Operations;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Output.Printers.GroupPrinting.Single;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.Rig.Sequences
|
||||
@@ -150,11 +149,6 @@ namespace TBF.Rig.Sequences
|
||||
}
|
||||
|
||||
|
||||
private string[] ImplementActiveGroupPrinters(string[] printers)
|
||||
{
|
||||
return GroupPrinterUtils.GetExpandedGroupPrinters(printers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Main sequence execution
|
||||
/// </summary>
|
||||
@@ -415,9 +409,9 @@ namespace TBF.Rig.Sequences
|
||||
/// Procedure selected at this point, a new batch was started
|
||||
///
|
||||
int newBatchNr = Program.LocalSettings.BatchNr;
|
||||
if (StateMachine.ControlBoardMain is ControlBoard.Uni.UniCB)
|
||||
if (StateMachine.ControlBoard is ControlBoard.Uni.UniCB)
|
||||
{
|
||||
(StateMachine.ControlBoardMain as ControlBoard.Uni.UniCB).IsUIBlocked = StateMachine.Procedure.ManualCtrlDisabled;
|
||||
(StateMachine.ControlBoard as ControlBoard.Uni.UniCB).IsUIBlocked = StateMachine.Procedure.ManualCtrlDisabled;
|
||||
}
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// A new cycle started : Enable STOP button
|
||||
log.FatalFormat("New measurement session started: batch = {0}, procedure = {1}", newBatchNr, StateMachine.Procedure.Name);
|
||||
@@ -764,9 +758,9 @@ namespace TBF.Rig.Sequences
|
||||
}
|
||||
if (selection == Selection.Break)
|
||||
{
|
||||
if (StateMachine.ControlBoardMain is ControlBoard.Uni.UniCB)
|
||||
if (StateMachine.ControlBoard is ControlBoard.Uni.UniCB)
|
||||
{
|
||||
(StateMachine.ControlBoardMain as ControlBoard.Uni.UniCB).IsUIBlocked = false;
|
||||
(StateMachine.ControlBoard as ControlBoard.Uni.UniCB).IsUIBlocked = false;
|
||||
}
|
||||
Bridge.Bench2UI(ButtonsEtc.ShowBenchEmpty);
|
||||
Bridge.OnProcedureCompleted(this, new ProcedureCompletedEventArgs(StateMachine.Procedure));
|
||||
@@ -955,7 +949,7 @@ namespace TBF.Rig.Sequences
|
||||
Bridge.OnError(this, errMsg);
|
||||
goto select_cycle_or_test;
|
||||
}
|
||||
StateMachine.ControlBoardMain.Devices = outPath;
|
||||
StateMachine.ControlBoard.Devices = outPath;
|
||||
ProcessData.RegisterReaders = (sensPath != null && sensPath.RegisterReaders != null) ? sensPath.RegisterReaders : null;
|
||||
|
||||
/// Set temperature control setpoint
|
||||
@@ -1079,7 +1073,7 @@ namespace TBF.Rig.Sequences
|
||||
{
|
||||
StateMachine.LoadTestParams(dfrrdData.Test);
|
||||
|
||||
StateMachine.ControlBoardMain.Devices = outPath;
|
||||
StateMachine.ControlBoard.Devices = outPath;
|
||||
ProcessData.RegisterReaders = (sensPath != null && sensPath.RegisterReaders != null) ? sensPath.RegisterReaders : null;
|
||||
|
||||
e = testMethod.Execute2ndPass(dfrrdData.Test, dfrrdData.RepetNr, dfrrdData.IntermediateData);
|
||||
@@ -1148,7 +1142,7 @@ namespace TBF.Rig.Sequences
|
||||
Bridge.OnError(this, errMsg);
|
||||
goto select_cycle_or_test;
|
||||
}
|
||||
StateMachine.ControlBoardMain.Devices = outPath;
|
||||
StateMachine.ControlBoard.Devices = outPath;
|
||||
ProcessData.RegisterReaders = (sensPath != null && sensPath.RegisterReaders != null) ? sensPath.RegisterReaders : null;
|
||||
|
||||
/// Set temperature control setpoint
|
||||
@@ -1321,10 +1315,6 @@ namespace TBF.Rig.Sequences
|
||||
string[] writers = (StateMachine.Procedure.ResultsWriter != null) ? StateMachine.Procedure.ResultsWriter.Split(new char[] { '~' }) : new string[0];
|
||||
string[] printers = (StateMachine.Procedure.ResultsPrinter != null) ? StateMachine.Procedure.ResultsPrinter.Split(new char[] { '~' }) : new string[0];
|
||||
string[] eventTriggers = (StateMachine.Procedure.EventTriggers != null) ? StateMachine.Procedure.EventTriggers.Split(new char[] { '~' }) : new string[0];
|
||||
|
||||
/// we have poassibility print GROUP printing - we just check if exist some like this
|
||||
printers = ImplementActiveGroupPrinters(printers);
|
||||
|
||||
///
|
||||
string[] rsltProcessors = new string[writers.Length + printers.Length + eventTriggers.Length];
|
||||
writers.CopyTo(rsltProcessors, 0);
|
||||
@@ -1409,9 +1399,9 @@ namespace TBF.Rig.Sequences
|
||||
ProcessData.BatchRslts.Batch.ProcedureName,
|
||||
Program.LocalSettings.BatchNr);
|
||||
|
||||
if (StateMachine.ControlBoardMain is ControlBoard.Uni.UniCB)
|
||||
if (StateMachine.ControlBoard is ControlBoard.Uni.UniCB)
|
||||
{
|
||||
(StateMachine.ControlBoardMain as ControlBoard.Uni.UniCB).IsUIBlocked = false;
|
||||
(StateMachine.ControlBoard as ControlBoard.Uni.UniCB).IsUIBlocked = false;
|
||||
}
|
||||
Event evacRetv = DoEvacuation(purgeEnd);
|
||||
|
||||
@@ -1449,7 +1439,7 @@ namespace TBF.Rig.Sequences
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : Turning IDLE -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
@@ -1465,7 +1455,7 @@ namespace TBF.Rig.Sequences
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : Turning IDLE -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
@@ -1497,7 +1487,7 @@ namespace TBF.Rig.Sequences
|
||||
State.Create("MainSeq : ERROR -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchErrorOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace TBF.Rig.Sequences
|
||||
void SetValvesToDefaultState()
|
||||
{
|
||||
State.Create("MainSeq : Setting valves to default positions")
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
|
||||
while (StateMachine.WaitRunDevsRunOps().Contains(Event.ValvesBusy)) { }
|
||||
@@ -210,7 +210,7 @@ namespace TBF.Rig.Sequences
|
||||
State.Create(areTwoDrainPhases ? "MainSeq : Drain tanks - phase 1" : "MainSeq : Drain tanks")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(new TimerOp(areTwoDrainPhases ? firstPhaseTime : totalDrainTime, timerTime))
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(fullDrainValves, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(fullDrainValves, null))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -229,7 +229,7 @@ namespace TBF.Rig.Sequences
|
||||
State.Create("MainSeq : Drain tanks - phase 2")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(new TimerOp(totalDrainTime - firstPhaseTime, timerTime))
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(secondHalfDrainValves, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(secondHalfDrainValves, null))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -248,7 +248,7 @@ namespace TBF.Rig.Sequences
|
||||
|
||||
State stopDraining = State.Create("MainSeq : Stop draining water tanks")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(null, allDrainValves))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, allDrainValves))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -441,7 +441,7 @@ namespace TBF.Rig.Sequences
|
||||
((StateMachine.DrainValve3 == null) ? 0 : (draining3 ? ButtonsEtc.DrainTankBtn3Hi : ButtonsEtc.DrainTankBtn3En)));
|
||||
|
||||
State.Create(stateText)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(openValves, closeValves))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(openValves, closeValves))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -479,7 +479,7 @@ namespace TBF.Rig.Sequences
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank); /// Activity message
|
||||
|
||||
State.Create("Open all drain valves")
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(drainValves, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(drainValves, null))
|
||||
.EnterState();
|
||||
while (StateMachine.WaitRunDevsRunOps().Contains(Event.ValvesBusy)) { }
|
||||
}
|
||||
@@ -512,7 +512,7 @@ namespace TBF.Rig.Sequences
|
||||
if (drainValves.Count > 0)
|
||||
{
|
||||
State.Create("Close all drain valves")
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(null, drainValves))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, drainValves))
|
||||
.EnterState();
|
||||
while (StateMachine.WaitRunDevsRunOps().Contains(Event.ValvesBusy)) { }
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace TBF.Rig.Sequences
|
||||
public static Unit TempUnit { get { return BenchInfo != null ? BenchInfo.TempUnit : Unit.C; } }
|
||||
public static Unit PressUnit { get { return BenchInfo != null ? BenchInfo.PressUnit : Unit.bar; } }
|
||||
public static Unit LengthUnit { get { return BenchInfo != null ? BenchInfo.LengthUnit : Unit.mm; } }
|
||||
public static Unit ElectricUnit { get { return BenchInfo != null ? BenchInfo.ElectricUnit : Unit.A; } }
|
||||
|
||||
///
|
||||
/// Procedure related state variables
|
||||
@@ -276,12 +275,9 @@ namespace TBF.Rig.Sequences
|
||||
public static DoubleBox PressUp = new DoubleBox() { Name = "Pressure Up", Format = "F2" }; /// [bar]
|
||||
public static DoubleBox PressDown = new DoubleBox() { Name = "Pressure Dn", Format = "F2" }; /// [bar]
|
||||
public static DoubleBox PressDelta = new DoubleBox() { Name = "Pressure Delta", Format = "F2" }; /// [bar]
|
||||
public static DoubleBox ElectricUp = new DoubleBox() { Name = "Electric Up", Format = "F2" }; /// [A]
|
||||
public static DoubleBox ElectricDown = new DoubleBox() { Name = "Electric Dn", Format = "F2" }; /// [A]
|
||||
public static DoubleBox ElectricDelta = new DoubleBox() { Name = "Electric Delta", Format = "F2" }; /// [A]
|
||||
public static FloatBox Conductivity = new FloatBox(750) { Name = "Conductivity", Format = "F0" }; /// [uS/cm], default is 750
|
||||
|
||||
public static int RefPulses { get { return StateMachine.ControlBoardMain.RefPulses; } }
|
||||
public static int RefPulses { get { return StateMachine.ControlBoard.RefPulses; } }
|
||||
public static int RefPulsesDelta;
|
||||
public static DoubleBox RefFrequency = new DoubleBox() { Name = "RefFreq", Format = "F2" };
|
||||
public static DoubleBox RefFlow = new DoubleBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h]
|
||||
@@ -311,7 +307,7 @@ namespace TBF.Rig.Sequences
|
||||
/// </summary>
|
||||
public static void ClearProcessValues()
|
||||
{
|
||||
if (StateMachine.ControlBoardMain != null) StateMachine.ControlBoardMain.ClearProcessValues();
|
||||
if (StateMachine.ControlBoard != null) StateMachine.ControlBoard.ClearProcessValues();
|
||||
|
||||
RefFrequency.Clear();
|
||||
RefFlow.Clear();
|
||||
@@ -525,9 +521,9 @@ namespace TBF.Rig.Sequences
|
||||
logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16}",
|
||||
DateTime.Now.ToLongTimeString(),
|
||||
Utils.DoubleToStr(RefFlow.Val, 4), /// flow measured by the reference flow meter in m3/h
|
||||
StateMachine.ControlBoardMain.TestTime.ToString("F3"),/// test time in s
|
||||
StateMachine.ControlBoardMain.RefPulses, /// reference flow meter pulses count
|
||||
outPath.FlowMeter != null ? Formulas.VolumeFromPulses(StateMachine.ControlBoardMain.RefPulses, 1 / outPath.FlowMeter.LtrPerPulse).ToString("F3") : "0.000", /// volume in l
|
||||
StateMachine.ControlBoard.TestTime.ToString("F3"),/// test time in s
|
||||
StateMachine.ControlBoard.RefPulses, /// reference flow meter pulses count
|
||||
outPath.FlowMeter != null ? Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1 / outPath.FlowMeter.LtrPerPulse).ToString("F3") : "0.000", /// volume in l
|
||||
benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C
|
||||
benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of line in degree C
|
||||
outPath.TempMtrDiv != null ? outPath.TempMtrDiv.ReadTemperature() : 0, /// temp. at the diverter in degree C
|
||||
@@ -555,9 +551,9 @@ namespace TBF.Rig.Sequences
|
||||
logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19} {20}",
|
||||
DateTime.Now.ToLongTimeString(),
|
||||
Utils.DoubleToStr(RefFlow.Val, 4),
|
||||
StateMachine.ControlBoardMain.TestTime.ToString("F3"),
|
||||
StateMachine.ControlBoardMain.RefPulses,
|
||||
outPath.FlowMeter != null ? Formulas.VolumeFromPulses(StateMachine.ControlBoardMain.RefPulses, 1 / outPath.FlowMeter.LtrPerPulse).ToString("F3") : "0.000",
|
||||
StateMachine.ControlBoard.TestTime.ToString("F3"),
|
||||
StateMachine.ControlBoard.RefPulses,
|
||||
outPath.FlowMeter != null ? Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1 / outPath.FlowMeter.LtrPerPulse).ToString("F3") : "0.000",
|
||||
benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C
|
||||
benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of test in degree C
|
||||
outPath.TempMtrDiv != null ? outPath.TempMtrDiv.ReadTemperature() : 0, /// temp. at the diverter in degree C
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace TBF.Rig.Sequences
|
||||
///
|
||||
State.Create("SequenceBase : Open the drain valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(tank.DrainValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(tank.DrainValve, null))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -160,7 +160,7 @@ namespace TBF.Rig.Sequences
|
||||
///
|
||||
State.Create("SequenceBase : Open the drain valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(tank.DrainValve2, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(tank.DrainValve2, null))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -204,7 +204,7 @@ namespace TBF.Rig.Sequences
|
||||
{
|
||||
State.Create("SequenceBase : Open the 2nd drain valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(tank.DrainValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(tank.DrainValve, null))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -247,7 +247,7 @@ namespace TBF.Rig.Sequences
|
||||
//
|
||||
State.Create("SequenceBase : Closing the drain valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(null, tank.DrainValve))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, tank.DrainValve))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -262,7 +262,7 @@ namespace TBF.Rig.Sequences
|
||||
{
|
||||
State.Create("SequenceBase : Closing the 2nd drain valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(null, tank.DrainValve2))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, tank.DrainValve2))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -404,7 +404,7 @@ namespace TBF.Rig.Sequences
|
||||
|
||||
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@@ -444,7 +444,7 @@ namespace TBF.Rig.Sequences
|
||||
//------------------------------------------------
|
||||
|
||||
/// Prepare operation to switch valves
|
||||
IOperation setValvesOp = StateMachine.ControlBoardMain.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step));
|
||||
IOperation setValvesOp = StateMachine.ControlBoard.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step));
|
||||
|
||||
/// Fetch the condition operation, null value is allowed if there is no condition
|
||||
IOperation conditionOperation = null;
|
||||
@@ -597,7 +597,7 @@ namespace TBF.Rig.Sequences
|
||||
///
|
||||
State.Create("SequenceBase.Transition() : Test stopped -> Stopping the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@@ -639,10 +639,10 @@ namespace TBF.Rig.Sequences
|
||||
if (evnt == Event.Error || evnt == Event.UiCmdStop) return evnt;
|
||||
|
||||
/// Set PID coefficient, etc.
|
||||
if (StateMachine.ControlBoardMain is ControlBoard.Uni.UniCB)
|
||||
if (StateMachine.ControlBoard is ControlBoard.Uni.UniCB)
|
||||
{
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
(StateMachine.ControlBoardMain as ControlBoard.Uni.UniCB).SetFiltersPidShortPulses(filters, nextPidCoef, (nextShortPulses == 0) ? 0 : 1);
|
||||
(StateMachine.ControlBoard as ControlBoard.Uni.UniCB).SetFiltersPidShortPulses(filters, nextPidCoef, (nextShortPulses == 0) ? 0 : 1);
|
||||
}
|
||||
|
||||
/// Set pump power
|
||||
@@ -689,7 +689,7 @@ namespace TBF.Rig.Sequences
|
||||
bool errorFlag = false;
|
||||
IList<Event> e;
|
||||
|
||||
IOperation setValvesOp = StateMachine.ControlBoardMain.SetValvesOp(valvesToOpen, valvesToClose);
|
||||
IOperation setValvesOp = StateMachine.ControlBoard.SetValvesOp(valvesToOpen, valvesToClose);
|
||||
|
||||
int lastStartedRV = -1;
|
||||
for (int i = 0; i < rvPosOps.Count; i++)
|
||||
@@ -863,7 +863,7 @@ namespace TBF.Rig.Sequences
|
||||
State.Create(string.Format("{0}({1}) : Starting the pump", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(extraOperations)
|
||||
.AddOperation(pump != null ? StateMachine.ControlBoardMain.SetValvesOp(pump, null) : null)
|
||||
.AddOperation(pump != null ? StateMachine.ControlBoard.SetValvesOp(pump, null) : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@@ -900,7 +900,7 @@ namespace TBF.Rig.Sequences
|
||||
{
|
||||
State.Create(string.Format("{0}({1}) : Opening the stop backflow valve", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.ControlBoardMain.SetValvesOp(stopBFValve, null))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(stopBFValve, null))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
@@ -937,7 +937,7 @@ namespace TBF.Rig.Sequences
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(doNotWait ? regulValve.SetFlowAndMeasureOp(flowMeter, test.QfromM3ph(), test.QtoM3ph(), RefFlow, FlowSettingTimeoutSec, 0)
|
||||
: StateMachine.ControlBoardMain.SetFlowOp(test.QfromM3ph(), test.QtoM3ph(), RefFlow, FlowSettingTimeoutSec))
|
||||
: StateMachine.ControlBoard.SetFlowOp(test.QfromM3ph(), test.QtoM3ph(), RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperations(extraOperations)
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user