Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0468b5a1f5 | ||
|
|
fd6f305f95 | ||
|
|
2ca9c104d2 | ||
|
|
994568799d | ||
|
|
7f8a5c83ed | ||
|
|
99b68f1dd6 | ||
|
|
604c59723f | ||
|
|
886d87c03d | ||
|
|
d4eb52d70e | ||
|
|
e2650736cd | ||
|
|
77b71d5a7d | ||
|
|
bd65ff5420 |
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;PETERSBURG_200;LANG_RU</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -28,7 +28,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;PETERSBURG_200;LANG_RU</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -87,6 +87,7 @@
|
||||
<Compile Include="Entities\Test.cs" />
|
||||
<Compile Include="Entities\TransitionSequence.cs" />
|
||||
<Compile Include="Entities\TransitionStep.cs" />
|
||||
<Compile Include="Entities\Uncertainty.cs" />
|
||||
<Compile Include="Entities\User.cs" />
|
||||
<Compile Include="Entities\VirtualBenchSequence.cs" />
|
||||
<Compile Include="Entities\VirtualBenchStep.cs" />
|
||||
@@ -108,6 +109,7 @@
|
||||
<Compile Include="Mappings\TestMap.cs" />
|
||||
<Compile Include="Mappings\TransitionSequenceMap.cs" />
|
||||
<Compile Include="Mappings\TransitionStepMap.cs" />
|
||||
<Compile Include="Mappings\UncertaintyMap.cs" />
|
||||
<Compile Include="Mappings\UserMap.cs" />
|
||||
<Compile Include="Mappings\VirtualBenchSequenceMap.cs" />
|
||||
<Compile Include="Mappings\VirtualBenchStepMap.cs" />
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
@@ -19,6 +18,7 @@ namespace Config.Entities
|
||||
public virtual LogLevel Logging { get; set; }
|
||||
public virtual string Parameters { get; set; }
|
||||
public virtual IList<MeasurementCorrection> Corrections { get; set; }
|
||||
public virtual IList<Uncertainty> Uncertainties { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Config.Entities
|
||||
Name = string.Empty;
|
||||
ClassName = string.Empty;
|
||||
Corrections = new List<MeasurementCorrection>();
|
||||
Uncertainties = new List<Uncertainty>();
|
||||
}
|
||||
|
||||
public static Component CreateFromCfg(string name, string className, string parentName, int itemNr,
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class Uncertainty
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual float Measurement { get; set; }
|
||||
public virtual float MainUncertainty { get; set; }
|
||||
public virtual float Resolution { get; set; }
|
||||
public virtual float DriftPerYr { get; set; }
|
||||
public virtual float Conditions { get; set; }
|
||||
public virtual float UncertaintyOfCorrection { get; set; }
|
||||
|
||||
public Uncertainty() { }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,8 +11,11 @@ namespace Config.Entities
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string UserName { get; set; } /// = name, alias, abbreviation
|
||||
public virtual string FullName { get; set; } /// = description
|
||||
public virtual int Number { get; set; }
|
||||
public virtual string Tag { get; set; }
|
||||
public virtual int Number { get; set; }
|
||||
public virtual string Password { get; set; }
|
||||
public virtual string Password2 { get; set; }
|
||||
public virtual string Password3 { get; set; }
|
||||
public virtual DateTime LastPwChange { get; set; }
|
||||
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Config.Entities;
|
||||
@@ -23,6 +23,9 @@ namespace Config.Mappings
|
||||
HasMany(x => x.Corrections)
|
||||
.OrderBy("Measurement")
|
||||
.Cascade.All();
|
||||
}
|
||||
HasMany(x => x.Uncertainties)
|
||||
.OrderBy("Measurement")
|
||||
.Cascade.All();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class UncertaintyMap : ClassMap<Uncertainty>
|
||||
{
|
||||
public UncertaintyMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.Measurement);
|
||||
Map(x => x.MainUncertainty);
|
||||
Map(x => x.Resolution);
|
||||
Map(x => x.DriftPerYr);
|
||||
Map(x => x.Conditions);
|
||||
Map(x => x.UncertaintyOfCorrection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
@@ -12,7 +12,12 @@ namespace Config.Mappings
|
||||
Id(x => x.Id);
|
||||
Map(x => x.UserName).Column("Name");
|
||||
Map(x => x.Number);
|
||||
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
|
||||
Map(x => x.Tag);
|
||||
#endif
|
||||
Map(x => x.Password);
|
||||
Map(x => x.Password2);
|
||||
Map(x => x.Password3);
|
||||
Map(x => x.FullName).Column("Description");
|
||||
Map(x => x.LastPwChange);
|
||||
HasMany(x => x.Groups)
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.1273.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1273.0")]
|
||||
[assembly: AssemblyVersion("2.24.1315.0")]
|
||||
[assembly: AssemblyFileVersion("2.24.1315.0")]
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
@@ -27,11 +26,11 @@ namespace DeviceTest
|
||||
IComponentCfg component2Cfg;
|
||||
IComponentCfg component3Cfg;
|
||||
|
||||
static IList<TBF.BenchControl.Generic.IDevice> tbfDevices;
|
||||
static IList<TBF.BenchControl.Generic.IComponent> tbfComponents;
|
||||
static TBF.BenchControl.Generic.IComponent tbfComponent1forOp;
|
||||
static TBF.BenchControl.Generic.IComponent tbfComponent2forOp;
|
||||
static TBF.BenchControl.Generic.IComponent tbfComponent3forOp;
|
||||
static IList<IDevice> tbfDevices;
|
||||
static IList<IComponent> tbfComponents;
|
||||
static IComponent tbfComponent1forOp;
|
||||
static IComponent tbfComponent2forOp;
|
||||
static IComponent tbfComponent3forOp;
|
||||
|
||||
static Thread workerThread;
|
||||
static bool workerThreadRunning;
|
||||
@@ -426,7 +425,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = parentCfg;
|
||||
cfgControl.Config.ItemNr = 0;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
cfgForm.TbfComponents = new List<Config.Entities.Component>();
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
@@ -455,7 +454,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = component1Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
@@ -489,7 +488,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = component2Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
@@ -524,7 +523,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = component3Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Results.Forms
|
||||
if (refRecords == null)
|
||||
{
|
||||
tabControl1.SelectTab(1);
|
||||
tabControl1.TabPages[2].Hide();
|
||||
tabControl1.TabPages.RemoveAt(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
@@ -26,6 +26,16 @@ namespace Results.Mappings
|
||||
.Column("Custom1"); ;
|
||||
Map(x => x.Custom2);
|
||||
Map(x => x.Custom3);
|
||||
Map(x => x.Counter1);
|
||||
Map(x => x.Counter2);
|
||||
Map(x => x.Counter3);
|
||||
Map(x => x.Counter4);
|
||||
Map(x => x.Counter5);
|
||||
Map(x => x.Counter6);
|
||||
Map(x => x.Counter7);
|
||||
Map(x => x.Counter8);
|
||||
Map(x => x.Counter9);
|
||||
Map(x => x.Counter10);
|
||||
Map(x => x.StartTime);
|
||||
Map(x => x.EndTime);
|
||||
Map(x => x.Dirty);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Results.Mappings
|
||||
Id(x => x.Id);
|
||||
Map(x => x.CompoundMeterId);
|
||||
Map(x => x.RegReaderType);
|
||||
Map(x => x.PulsesMeter);
|
||||
Map(x => x.PulsesMeter);
|
||||
Map(x => x.PulsesMaster);
|
||||
Map(x => x.PulsesPerLiter);
|
||||
Map(x => x.VolumeStart);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
@@ -25,11 +25,13 @@ namespace Results.Mappings
|
||||
Map(x => x.StartTime);
|
||||
Map(x => x.EndTime);
|
||||
Map(x => x.FlowSetTime);
|
||||
Map(x => x.TimeBtwnMassMsrmnts);
|
||||
Map(x => x.TestTime);
|
||||
Map(x => x.TestTimeCorrection);
|
||||
Map(x => x.PulsesMaster);
|
||||
Map(x => x.ConstMasterRaw);
|
||||
Map(x => x.ConstMasterCorr);
|
||||
Map(x => x.ConstMaster);
|
||||
Map(x => x.ConstMaster);
|
||||
Map(x => x.MassStartRaw);
|
||||
Map(x => x.MassStart);
|
||||
Map(x => x.MassEndRaw);
|
||||
|
||||
+33
-10
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
using Config.Entities;
|
||||
using Results.Entities;
|
||||
@@ -22,9 +21,9 @@ namespace Results.Output
|
||||
IList<PointF> unsortedPoints = new List<PointF>();
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
|
||||
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
|
||||
{
|
||||
double flow = Config.Units.ConvertTo(flowUnit, mtr.TestRslt.VolumeCTV / mtr.TestTime * 3.6 * mtr.PulsesMaster / mtr.TestRslt.PulsesMaster);
|
||||
double flow = Config.Units.ConvertTo(flowUnit, 3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
|
||||
if (flow > 0)
|
||||
{
|
||||
unsortedPoints.Add(new PointF((float)flow, (float)mtr.Error));
|
||||
@@ -47,7 +46,7 @@ namespace Results.Output
|
||||
chArea.AxisX.Title = Strings.Flow;
|
||||
chArea.AxisX.IsLogarithmic = true;
|
||||
chArea.AxisX.LogarithmBase = 10;
|
||||
chArea.AxisX.IsLabelAutoFit = false;
|
||||
chArea.AxisX.IsLabelAutoFit = true;
|
||||
|
||||
List<double> xs = new List<double>() { 0.0001, 0.0002, 0.0005,
|
||||
0.001, 0.002, 0.005,
|
||||
@@ -59,19 +58,43 @@ namespace Results.Output
|
||||
1000, 2000, 5000,
|
||||
10000, 20000, 50000,
|
||||
100000, 200000, 500000,
|
||||
1000000, 2000000, 5000000 };
|
||||
1000000, 2000000, 5000000,
|
||||
10000000 };
|
||||
double spacer = 0.8;
|
||||
double from = Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q1_Qmin);
|
||||
double to = Config.Units.ConvertTo(flowUnit, isQ4 ? wm.WaterMeterData.Q4_Qmax : wm.WaterMeterData.Q3_Qn);
|
||||
for (int i = 1; i < xs.Count - 1; i++)
|
||||
bool inRange = false;
|
||||
for (int i = 0; i < xs.Count - 3; i += 3)
|
||||
{
|
||||
if ((xs[i + 1] > from) && (xs[i - 1] < to))
|
||||
if (xs[i] <= from && from < xs[i + 3])
|
||||
{
|
||||
chArea.AxisX.Minimum = xs[i];
|
||||
inRange = true;
|
||||
}
|
||||
|
||||
if (inRange)
|
||||
{
|
||||
for (int j = i; j < i + 3; j++)
|
||||
{
|
||||
CustomLabel cl = new CustomLabel();
|
||||
cl.Text = string.Format("{0} {1}", xs[j], flowUnit.ToDescription());
|
||||
cl.FromPosition = Math.Log10(xs[j] * spacer);
|
||||
cl.ToPosition = Math.Log10(xs[j] / spacer);
|
||||
chArea.AxisX.CustomLabels.Add(cl);
|
||||
}
|
||||
}
|
||||
|
||||
if (xs[i] < to && to <= xs[i + 3])
|
||||
{
|
||||
chArea.AxisX.Maximum = xs[i + 3];
|
||||
|
||||
CustomLabel cl = new CustomLabel();
|
||||
cl.Text = string.Format("{0} {1}", xs[i], flowUnit.ToDescription());
|
||||
cl.FromPosition = Math.Log10(xs[i] * spacer);
|
||||
cl.ToPosition = Math.Log10(xs[i] / spacer);
|
||||
cl.Text = string.Format("{0} {1}", xs[i + 3], flowUnit.ToDescription());
|
||||
cl.FromPosition = Math.Log10(xs[i + 3] * spacer);
|
||||
cl.ToPosition = Math.Log10(xs[i + 3] / spacer);
|
||||
chArea.AxisX.CustomLabels.Add(cl);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.20.1306.0")]
|
||||
[assembly: AssemblyFileVersion("2.20.1306.0")]
|
||||
[assembly: AssemblyVersion("2.24.1315.0")]
|
||||
[assembly: AssemblyFileVersion("2.24.1315.0")]
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;PETERSBURG_200;LANG_RU</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -27,7 +27,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;PETERSBURG_200;LANG_RU</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using ResultsBrowser.Resources;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace ResultsBrowser.Forms
|
||||
cfgControl.Config = printerCfg;
|
||||
cfgControl.Config.ItemNr = 0;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
TBF.BenchControl.ComponentParametersDlg cfgForm = new TBF.BenchControl.ComponentParametersDlg();
|
||||
cfgForm.TbfComponents = new List<Component>();
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;PETERSBURG_200;LANG_RU</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -31,7 +31,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;PETERSBURG_200;LANG_RU</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TBF
|
||||
{
|
||||
/// <summary>
|
||||
/// Data types and orientation of the table layout panel attached data.
|
||||
/// </summary>
|
||||
public enum Arrangement
|
||||
{
|
||||
RowOfIntegers,
|
||||
RowOfDoubles,
|
||||
RowOfStrings,
|
||||
ColumnOfIntegers,
|
||||
ColumnOfDoubles,
|
||||
ColumnOfStrings,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents TextBox controls and data modified by them
|
||||
/// that are attached to (=displayed inside) a TableLayoutPanel control.
|
||||
/// </summary>
|
||||
public class AttachedTextBoxes
|
||||
{
|
||||
///
|
||||
/// Private fields
|
||||
///
|
||||
int count; /// Number of attached TextBoxes / cells
|
||||
Arrangement arngmnt; /// Type of attachemnt (see above)
|
||||
bool isRow; /// true if it is a row
|
||||
TextBox[] textBoxes; /// TextBox controls to be aded to TableLayoutPanel
|
||||
int[] intData; /// integer data |
|
||||
double[] doubleData; /// double data |-> one of these three arrays is used
|
||||
string[] stringData; /// string data |
|
||||
|
||||
/// <summary>
|
||||
/// Constructor, which creates TextBox controls and adds them to the table layout panel.
|
||||
/// </summary>
|
||||
public AttachedTextBoxes(TableLayoutPanel tblLtPnl, Arrangement arngmnt, int firstColumn, int firstRow, int size)
|
||||
{
|
||||
this.count = size;
|
||||
this.arngmnt = arngmnt;
|
||||
isRow = (arngmnt == Arrangement.RowOfIntegers || arngmnt == Arrangement.RowOfDoubles || arngmnt == Arrangement.RowOfStrings);
|
||||
|
||||
textBoxes = new TextBox[count];
|
||||
intData = new int[count];
|
||||
doubleData = new double[count];
|
||||
stringData = new string[count];
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
textBoxes[i] = new TextBox(); /// Crete a new TextBox control
|
||||
|
||||
if (isRow)
|
||||
{
|
||||
tblLtPnl.Controls.Add(textBoxes[i], firstColumn + i, firstRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
tblLtPnl.Controls.Add(textBoxes[i], firstColumn, firstRow + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attached data array size
|
||||
/// </summary>
|
||||
public int Count { get { return count; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indexer returning a TextBox
|
||||
/// </summary>
|
||||
/// <param name="index">Index</param>
|
||||
/// <returns>TextBox object reference</returns>
|
||||
public TextBox this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (index < 0 || index >= count)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return textBoxes[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves data from the controls or detects a format error.
|
||||
/// Wrong format in a cell interrupts data retrieving, so when the first control
|
||||
/// contains data with wrong format, no data are retrieved at all.
|
||||
/// </summary>
|
||||
/// <returns>true if all data have correct format</returns>
|
||||
public bool ValidateData()
|
||||
{
|
||||
switch (arngmnt)
|
||||
{
|
||||
case Arrangement.RowOfIntegers:
|
||||
case Arrangement.ColumnOfIntegers:
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!Int32.TryParse(textBoxes[i].Text, out intData[i])) return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
case Arrangement.RowOfDoubles:
|
||||
case Arrangement.ColumnOfDoubles:
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!Double.TryParse(textBoxes[i].Text, out doubleData[i])) return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
case Arrangement.RowOfStrings:
|
||||
case Arrangement.ColumnOfStrings:
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The following three methods provide initialization of controls with original data.
|
||||
/// </summary>
|
||||
|
||||
public void SetData(int index, int value)
|
||||
{
|
||||
if (index < 0 || index >= count) return;
|
||||
intData[index] = value;
|
||||
textBoxes[index].Text = value.ToString();
|
||||
}
|
||||
|
||||
public void SetData(int index, double value)
|
||||
{
|
||||
if (index < 0 || index >= count) return;
|
||||
doubleData[index] = value;
|
||||
textBoxes[index].Text = value.ToString();
|
||||
}
|
||||
|
||||
public void SetData(int index, string value)
|
||||
{
|
||||
if (index < 0 || index >= count) return;
|
||||
stringData[index] = value;
|
||||
textBoxes[index].Text = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The following three methods provide retrieving data from controls.
|
||||
/// ValidateData() must be called first. The return value must be true.
|
||||
/// </summary>
|
||||
|
||||
public int GetIntData(int index)
|
||||
{
|
||||
if (index < 0 || index >= count) return 0;
|
||||
return intData[index];
|
||||
}
|
||||
|
||||
public double GetDoubleData(int index)
|
||||
{
|
||||
if (index < 0 || index >= count) return 0;
|
||||
return doubleData[index];
|
||||
}
|
||||
|
||||
public string GetStringData(int index)
|
||||
{
|
||||
if (index < 0 || index >= count) return null;
|
||||
return textBoxes[index].Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TBF
|
||||
{
|
||||
public class BarGraph
|
||||
{
|
||||
int originX; /// Left coordinate of the bar
|
||||
int originY; /// Top coordinate of the bar
|
||||
int barWidth; /// Bar width, the bar is actualy 1 pixel wider
|
||||
int barHeight; /// Bar height the bat is actualy 1 pixel higher
|
||||
Color barColor; /// Bar color
|
||||
Color backColor; /// Background color (above the bar)
|
||||
/// Bar border is always black, 1 pixel wide
|
||||
int barValue; /// The actual bar size (the bar is drawn from bottom)
|
||||
|
||||
System.Windows.Forms.Control control;
|
||||
Rectangle rect;
|
||||
|
||||
|
||||
/// Use this setter to update the bar size
|
||||
public float FValue
|
||||
{
|
||||
get { return (float)barValue/(float)barHeight; }
|
||||
set
|
||||
{
|
||||
Value = (int)(value * (float)barHeight);
|
||||
control.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/// Use this setter to update the bar size
|
||||
public int Value
|
||||
{
|
||||
get { return barValue; }
|
||||
set
|
||||
{
|
||||
if (value < 0) barValue = 0;
|
||||
else if (value >= barHeight) barValue = barHeight;
|
||||
else barValue = value;
|
||||
control.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public BarGraph(System.Windows.Forms.Control control, int originX, int originY, int barWidth, int barHeight, Color barColor, Color backColor)
|
||||
{
|
||||
this.control = control;
|
||||
this.originX = originX;
|
||||
this.originY = originY;
|
||||
this.barWidth = barWidth;
|
||||
this.barHeight = barHeight;
|
||||
this.barColor = barColor;
|
||||
this.backColor = backColor;
|
||||
rect = new Rectangle(originX, originY, barWidth + 1, barHeight + 1);
|
||||
barValue = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this function in Form1_Paint(..), pass the arguments without any modifications
|
||||
/// </summary>
|
||||
public void Paint(Graphics g)
|
||||
{
|
||||
g.FillRectangle(new SolidBrush(backColor), originX + 1, originY + 1, barWidth, barHeight - barValue);
|
||||
g.FillRectangle(new SolidBrush(barColor), originX + 1, originY + barHeight + 1 - barValue, barWidth, barValue);
|
||||
g.DrawRectangle(new Pen(Color.Black, 2.0F), originX, originY, barWidth + 1, barHeight + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using Users;
|
||||
using log4net;
|
||||
|
||||
namespace TBF.BenchControl.BackupAndSecurity.Default
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds backup and security options.
|
||||
/// </summary>
|
||||
public class Component : ComponentBase, GenericDevices.IBackupAndSecurity
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("BackupAndSecurity.Default({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public int MinPasswdLength { get { return myCfg.MinPasswdLength; } }
|
||||
public int PasswdExpirationPeriodDays { get { return myCfg.PasswdExpirationPeriodDays; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as ComponentCfg;
|
||||
|
||||
GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
|
||||
GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BackupAndSecurity.Default
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds backup and security options - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int MinPasswdLength;
|
||||
public int PasswdExpirationPeriodDays; /// 0 = validity is not limited
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg() {}
|
||||
|
||||
public ComponentCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Factory = factory;
|
||||
Name = "BackupAndSecurity";
|
||||
ParentName = string.Empty;
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
MinPasswdLength = 6;
|
||||
PasswdExpirationPeriodDays = 0;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
"Minimum password length (characters)",
|
||||
"Password expiration period (days)",
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
if (i == -1)
|
||||
{
|
||||
return string.Format("{0}: Min. password length = {1} characters, Password expiration period = {2} days", Name, MinPasswdLength, PasswdExpirationPeriodDays);
|
||||
}
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0: return MinPasswdLength.ToString();
|
||||
case 1: return PasswdExpirationPeriodDays.ToString();;
|
||||
default: return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string strValue)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: MinPasswdLength = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: PasswdExpirationPeriodDays = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
int idummy;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
/// Positive integers and zero are allowed
|
||||
if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
|
||||
break;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = ParamName(i) + " is invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(ComponentCfg prms)
|
||||
{
|
||||
prms.MinPasswdLength = this.MinPasswdLength;
|
||||
prms.PasswdExpirationPeriodDays = this.PasswdExpirationPeriodDays;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BackupAndSecurity.Default
|
||||
{
|
||||
public class ComponentFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new ComponentCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,12 +20,19 @@ namespace TBF.BenchControl
|
||||
public int ItemNr { get { return cfg.ItemNr; } }
|
||||
public DebugMode DebugLevel { get { return cfg.DebugLevel; } set { cfg.DebugLevel = value; } }
|
||||
public LogLevel LogLevel { get { return cfg.LogLevel; } }
|
||||
|
||||
public IList<MeasurementCorrection> Corrections
|
||||
{
|
||||
get { return cfg.Corrections; }
|
||||
set { cfg.Corrections = value; }
|
||||
}
|
||||
|
||||
public IList<Uncertainty> Uncertainties
|
||||
{
|
||||
get { return cfg.Uncertainties; }
|
||||
set { cfg.Uncertainties = value; }
|
||||
}
|
||||
|
||||
|
||||
/// Constructor, components created in this way is used by
|
||||
/// IComponentFactory.DummyComponent() function. Such dummy component should be used
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -68,6 +68,15 @@ namespace TBF.BenchControl
|
||||
}
|
||||
IList<MeasurementCorrection> corrections;
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<Uncertainty> Uncertainties
|
||||
{
|
||||
get { return uncertainties; }
|
||||
set { uncertainties = value; }
|
||||
}
|
||||
IList<Uncertainty> uncertainties;
|
||||
|
||||
|
||||
protected ComponentCfgBase()
|
||||
{
|
||||
itemNr = 0;
|
||||
@@ -118,7 +127,8 @@ namespace TBF.BenchControl
|
||||
config.DebugLevel = cmpntEntity.Mode;
|
||||
config.LogLevel = cmpntEntity.Logging;
|
||||
config.Corrections = cmpntEntity.Corrections;
|
||||
config.Factory = factory;
|
||||
config.Uncertainties = cmpntEntity.Uncertainties;
|
||||
config.Factory = factory;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
Generated
+4
-4
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF
|
||||
namespace TBF.BenchControl
|
||||
{
|
||||
partial class ComponentParametersDlg
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace TBF
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.sharedButtons = new TBF.UiControls.SharedButtons();
|
||||
this.sharedButtons = new TBF.UI.Shared.SharedButtons();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||
this.splitContainer.Panel2.SuspendLayout();
|
||||
this.splitContainer.SuspendLayout();
|
||||
@@ -84,6 +84,6 @@ namespace TBF
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer;
|
||||
private UiControls.SharedButtons sharedButtons;
|
||||
private TBF.UI.Shared.SharedButtons sharedButtons;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -7,10 +7,10 @@ using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.UiControls;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
|
||||
namespace TBF
|
||||
namespace TBF.BenchControl
|
||||
{
|
||||
public partial class ComponentParametersDlg : Form
|
||||
{
|
||||
@@ -134,7 +134,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
|
||||
private void batchRemarkButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TBF.Forms.RemarkDlg dlg = new TBF.Forms.RemarkDlg() { Remark = ((BatchRemark == null) ? string.Empty : BatchRemark) };
|
||||
TBF.UI.Shared.RemarkDlg dlg = new TBF.UI.Shared.RemarkDlg() { Remark = ((BatchRemark == null) ? string.Empty : BatchRemark) };
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
BatchRemark = dlg.Remark;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2017 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -40,19 +40,19 @@ namespace TBF.BenchControl.Dummy.Balance
|
||||
public float BuoyancyPress { get { return 1.013f; } }
|
||||
public float BuoyancyHumi { get { return 50.0f; } }
|
||||
|
||||
public IOperation TaringOp(ref TBF.Boxes.DoubleBox tara)
|
||||
public IOperation TaringOp(ref Boxes.DoubleBox tara)
|
||||
{
|
||||
tara.Val = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IOperation ReadMassOp(ref TBF.Boxes.DoubleBox mass)
|
||||
public IOperation ReadMassOp(ref Boxes.DoubleBox mass)
|
||||
{
|
||||
mass.Val = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IOperation ReadStableMassOp(ref TBF.Boxes.DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
public IOperation ReadStableMassOp(ref Boxes.DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
|
||||
{
|
||||
mass.Val = 0;
|
||||
return this;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
|
||||
namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
{
|
||||
public partial class FlowMeterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
|
||||
@@ -501,7 +501,7 @@ namespace TBF.BenchControl.Elde
|
||||
///
|
||||
void ShowEmergencyStopForm()
|
||||
{
|
||||
(new TBF.Forms.EmergencyStopForm()).Show();
|
||||
(new TBF.UI.Shared.EmergencyStopForm()).Show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Configs;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Configs;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FlowMeterTwins
|
||||
@@ -15,8 +16,8 @@ namespace TBF.BenchControl.Elde.FlowMeterTwins
|
||||
|
||||
readonly FlowMeterCfg flowMeterCfg;
|
||||
readonly ControlBoardDev controlBoard;
|
||||
public readonly TBF.BenchControl.Elde.FlowMeter.FlowMeter FlowMeter1;
|
||||
public readonly TBF.BenchControl.Elde.FlowMeter.FlowMeter FlowMeter2;
|
||||
public readonly Elde.FlowMeter.FlowMeter FlowMeter1;
|
||||
public readonly Elde.FlowMeter.FlowMeter FlowMeter2;
|
||||
|
||||
public int Idx1 { get { return 0; } }
|
||||
public double NominalFlow { get { return flowMeterCfg.NominalFlow; } }
|
||||
@@ -44,10 +45,10 @@ namespace TBF.BenchControl.Elde.FlowMeterTwins
|
||||
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
FlowMeter1 = (TBF.BenchControl.Elde.FlowMeter.FlowMeter)TbfComponents.FindComponent(flowMeterCfg.FlowMeter1, components);
|
||||
FlowMeter1 = TbfComponents.FindComponent(flowMeterCfg.FlowMeter1, components) as Elde.FlowMeter.FlowMeter;
|
||||
if (FlowMeter1 == null) throw new Exception("Cannot find FlowMeter1 component");
|
||||
|
||||
FlowMeter2 = (TBF.BenchControl.Elde.FlowMeter.FlowMeter)TbfComponents.FindComponent(flowMeterCfg.FlowMeter2, components);
|
||||
FlowMeter2 = TbfComponents.FindComponent(flowMeterCfg.FlowMeter2, components) as Elde.FlowMeter.FlowMeter;
|
||||
if (FlowMeter2 == null) throw new Exception("Cannot find FlowMeter2 component");
|
||||
|
||||
controlBoard.EtCalib[Idx1] = (float)flowMeterCfg.NominalFlow; /// Idx1==0 for FlowMeterTwins
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -385,20 +385,24 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
}
|
||||
else if (opState == OpState.SettingFlow)
|
||||
{
|
||||
///
|
||||
/// Repeated untill the required flow is reached
|
||||
///
|
||||
if ((currentReqFlowLo <= flow) && (flow <= currentReqFlowHi))
|
||||
/// Regulation valve is setting flow to the required value
|
||||
|
||||
if ((currentReqFlowLo <= flow) && (flow <= currentReqFlowHi))
|
||||
{
|
||||
if (flowWithinBoundsTime++ >= regulValve.FlowStableSec)
|
||||
/// Flow is within range
|
||||
|
||||
if (flowWithinBoundsTime++ >= regulValve.FlowStableSec)
|
||||
{
|
||||
if (regulValve.RegulValveCfg.StoredPositionReuse)
|
||||
/// Flow is within range for sufficiently long time
|
||||
|
||||
if (regulValve.RegulValveCfg.StoredPositionReuse)
|
||||
{
|
||||
float storedPosition;
|
||||
if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition))
|
||||
{
|
||||
/// update the stored valve position
|
||||
StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f);
|
||||
|
||||
StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f);
|
||||
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position",
|
||||
regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/// Copyright (c) 2015 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace TBF.BenchControl.Generic
|
||||
|
||||
IList<Config.Entities.MeasurementCorrection> Corrections { get; set; }
|
||||
|
||||
IList<Config.Entities.Uncertainty> Uncertainties { get; set; }
|
||||
|
||||
void StartChangeHandler();
|
||||
|
||||
void StopChangeHandler();
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace TBF.BenchControl.Generic
|
||||
/// </summary>
|
||||
IList<Config.Entities.MeasurementCorrection> Corrections { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Measurement correction values
|
||||
/// </summary>
|
||||
IList<Config.Entities.Uncertainty> Uncertainties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new database entity 'Component' from the parameters
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
/// <summary>
|
||||
/// Backup and security options
|
||||
/// </summary>
|
||||
public interface IBackupAndSecurity : IComponent
|
||||
{
|
||||
int MinPasswdLength { get; }
|
||||
int PasswdExpirationPeriodDays { get; }
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace TBF.BenchControl.Network.Camera
|
||||
/// </summary>
|
||||
public class JpegFrame : RtpFrame
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(MainWnd));
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(TBF.UI.MainWnd));
|
||||
|
||||
#region Statics
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
public class ProcessData
|
||||
{
|
||||
public static IBenchInfo BenchInfo;
|
||||
public static IBackupAndSecurity BackupAndSecurity;
|
||||
public static IBenchInfo BenchInfo;
|
||||
public static IErrorFlags ErrorFlagsComp;
|
||||
public static Output.DB.SensusOracle.Database OracleDB;
|
||||
public static IList<Output.SensusTestInfo> RawTestInfos; /// Incomplete raw test infos from Oracle DB
|
||||
|
||||
@@ -228,7 +228,8 @@ namespace TBF.BenchControl
|
||||
foreach (var cmpnt in components)
|
||||
{
|
||||
if (cmpnt is Elde.ControlBoardDev) ControlBoard = cmpnt as Elde.ControlBoardDev;
|
||||
if (cmpnt is IBenchInfo) ProcessData.BenchInfo = cmpnt as IBenchInfo;
|
||||
if (cmpnt is IBackupAndSecurity) ProcessData.BackupAndSecurity = cmpnt as IBackupAndSecurity;
|
||||
if (cmpnt is IBenchInfo) ProcessData.BenchInfo = cmpnt as IBenchInfo;
|
||||
if (cmpnt is IErrorFlags) ProcessData.ErrorFlagsComp = cmpnt as IErrorFlags;
|
||||
if ((cmpnt is Output.DB.SensusOracle.Database) && (ProcessData.OracleDB == null))
|
||||
{
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace TBF.BenchControl
|
||||
{
|
||||
Factories = new List<IComponentFactory>();
|
||||
|
||||
Factories.Add(new BenchInfo.Munich.ComponentFactory());
|
||||
Factories.Add(new BackupAndSecurity.Default.ComponentFactory());
|
||||
Factories.Add(new BenchInfo.Munich.ComponentFactory());
|
||||
Factories.Add(new BenchInfo.Extended.ComponentFactory());
|
||||
Factories.Add(new BenchInfo.iPerl.ComponentFactory());
|
||||
Factories.Add(new Elde.ControlBoardFactory());
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace TBF
|
||||
namespace TBF.BenchControl
|
||||
{
|
||||
public class Telegram
|
||||
{
|
||||
@@ -7,10 +7,11 @@ using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.Endurance
|
||||
{
|
||||
public partial class CycleDlg : Form, TBF.UiControls.IParentOfListViewEx
|
||||
public partial class CycleDlg : Form, IParentOfListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(CycleDlg));
|
||||
|
||||
@@ -30,7 +31,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
public IList<IValve> Valves;
|
||||
|
||||
|
||||
TBF.UiControls.ITabWithListViewEx seqStepsCtrl;
|
||||
ITabWithListViewEx seqStepsCtrl;
|
||||
|
||||
|
||||
public CycleDlg()
|
||||
@@ -47,10 +48,10 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
|
||||
/// SharedDlgButtons configuration
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.Metrologists };
|
||||
sharedButtons.OptionalButtons = TBF.UiControls.SharedButtons.Buttons.Add |
|
||||
TBF.UiControls.SharedButtons.Buttons.Remove |
|
||||
TBF.UiControls.SharedButtons.Buttons.Up |
|
||||
TBF.UiControls.SharedButtons.Buttons.Down;
|
||||
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add |
|
||||
SharedButtons.Buttons.Remove |
|
||||
SharedButtons.Buttons.Up |
|
||||
SharedButtons.Buttons.Down;
|
||||
sharedButtons.Unlocked += Unlocked;
|
||||
sharedButtons.OKClicked += okButton_Click;
|
||||
sharedButtons.CancelClicked += cancelButton_Click;
|
||||
@@ -59,7 +60,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
sharedButtons.UpClicked += upButton_Click;
|
||||
sharedButtons.DownClicked += downButton_Click;
|
||||
|
||||
seqStepsCtrl = new CycleStepsCtrl();
|
||||
seqStepsCtrl = new CycleStepsCtrl() as ITabWithListViewEx;
|
||||
|
||||
/// Prepare a list of valves for the endurance test
|
||||
TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config));
|
||||
@@ -98,7 +99,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
{
|
||||
Localize();
|
||||
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
LocalSettings ls = Program.LocalSettings;
|
||||
Width = (ls.EnduranceDlgWidth > 0) ? ls.EnduranceDlgWidth : 1050;
|
||||
Height = (ls.EnduranceDlgHeight > 0) ? ls.EnduranceDlgHeight : 360;
|
||||
Left = (ls.EnduranceDlgLeft != 0) ? ls.EnduranceDlgLeft : 150;
|
||||
@@ -177,8 +178,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
seqStepsCtrl.OkBtnClicked();
|
||||
}
|
||||
slctdTab = tabControl.SelectedIndex;
|
||||
sharedButtons.EnableButtons(TBF.UiControls.SharedButtons.Buttons.Add);
|
||||
sharedButtons.DisableButtons(TBF.UiControls.SharedButtons.Buttons.Remove);
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Add);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
|
||||
RefreshAllTabs();
|
||||
}
|
||||
|
||||
@@ -202,32 +203,32 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
if (seqStepsCtrl != null) seqStepsCtrl.MoveDownSelected();
|
||||
}
|
||||
|
||||
public void UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos selectedItemPos)
|
||||
public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos)
|
||||
{
|
||||
if (selectedItemPos == TBF.UiControls.SharedButtons.SelectedItemPos.None)
|
||||
if (selectedItemPos == SharedButtons.SelectedItemPos.None)
|
||||
{
|
||||
sharedButtons.DisableButtons(TBF.UiControls.SharedButtons.Buttons.Up |
|
||||
TBF.UiControls.SharedButtons.Buttons.Down);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Up |
|
||||
SharedButtons.Buttons.Down);
|
||||
}
|
||||
else if (selectedItemPos == TBF.UiControls.SharedButtons.SelectedItemPos.First)
|
||||
else if (selectedItemPos == SharedButtons.SelectedItemPos.First)
|
||||
{
|
||||
sharedButtons.EnableButtons(TBF.UiControls.SharedButtons.Buttons.Down);
|
||||
sharedButtons.DisableButtons(TBF.UiControls.SharedButtons.Buttons.Up);
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Down);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Up);
|
||||
}
|
||||
else if (selectedItemPos == TBF.UiControls.SharedButtons.SelectedItemPos.Last)
|
||||
else if (selectedItemPos == SharedButtons.SelectedItemPos.Last)
|
||||
{
|
||||
sharedButtons.EnableButtons(TBF.UiControls.SharedButtons.Buttons.Up);
|
||||
sharedButtons.DisableButtons(TBF.UiControls.SharedButtons.Buttons.Down);
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Up);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Down);
|
||||
}
|
||||
else if (selectedItemPos == TBF.UiControls.SharedButtons.SelectedItemPos.FirstAndLast)
|
||||
else if (selectedItemPos == SharedButtons.SelectedItemPos.FirstAndLast)
|
||||
{
|
||||
sharedButtons.DisableButtons(TBF.UiControls.SharedButtons.Buttons.Up |
|
||||
TBF.UiControls.SharedButtons.Buttons.Down);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Up |
|
||||
SharedButtons.Buttons.Down);
|
||||
}
|
||||
else
|
||||
{
|
||||
sharedButtons.EnableButtons(TBF.UiControls.SharedButtons.Buttons.Up |
|
||||
TBF.UiControls.SharedButtons.Buttons.Down);
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Up |
|
||||
SharedButtons.Buttons.Down);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,23 +241,23 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
Results.Forms.ListViewEx listViewEx = sender as Results.Forms.ListViewEx;
|
||||
if (listViewEx.SelectedItems.Count != 1)
|
||||
{
|
||||
UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.None);
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.None);
|
||||
}
|
||||
else if (listViewEx.Items.Count == 1)
|
||||
{
|
||||
UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.FirstAndLast);
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast);
|
||||
}
|
||||
else if (listViewEx.SelectedIndices[0] == 0)
|
||||
{
|
||||
UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.First);
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.First);
|
||||
}
|
||||
else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1))
|
||||
{
|
||||
UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.Last);
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.Last);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.Middle);
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.Middle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleDlg));
|
||||
this.mainSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.tabControl = new System.Windows.Forms.TabControl();
|
||||
this.sharedButtons = new TBF.UiControls.SharedButtons();
|
||||
this.sharedButtons = new TBF.UI.Shared.SharedButtons();
|
||||
((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).BeginInit();
|
||||
this.mainSplitContainer.Panel1.SuspendLayout();
|
||||
this.mainSplitContainer.Panel2.SuspendLayout();
|
||||
@@ -86,6 +86,6 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
|
||||
private System.Windows.Forms.SplitContainer mainSplitContainer;
|
||||
private System.Windows.Forms.TabControl tabControl;
|
||||
private UiControls.SharedButtons sharedButtons;
|
||||
private TBF.UI.Shared.SharedButtons sharedButtons;
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,11 @@ using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.Endurance
|
||||
{
|
||||
public partial class CycleStepsCtrl : TBF.UiControls.BaseWithListViewEx<CycleStep>, TBF.UiControls.ITabWithListViewEx
|
||||
public partial class CycleStepsCtrl : BaseWithListViewEx<CycleStep>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(CycleStepsCtrl));
|
||||
|
||||
@@ -54,13 +55,13 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
///
|
||||
/// ListViewEx columns
|
||||
///
|
||||
Columns.Add(Strings.Duration_ms, 100 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
//Columns.Add(Strings.Message, 100 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Duration_ms, 100 * parent.Dpi / UI.Constants.Dpi100pct);
|
||||
//Columns.Add(Strings.Message, 100 * parent.Dpi / UI.Constants.Dpi100pct);
|
||||
///
|
||||
vCount = 0;
|
||||
foreach (var vlv in parent.Valves)
|
||||
{
|
||||
Columns.Add(vlv.Cfg.Name, 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(vlv.Cfg.Name, 50 * parent.Dpi / UI.Constants.Dpi100pct);
|
||||
vCount++;
|
||||
}
|
||||
|
||||
@@ -256,7 +257,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
bool lastItemRemoved = base.RemoveSelected();
|
||||
if (lastItemRemoved && parent != null)
|
||||
{
|
||||
parent.UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.None);
|
||||
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,13 +174,46 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <param name="threadID">0..3</param>
|
||||
/// <param name="iperlHead">Water meter (iPerlHead) object</param>
|
||||
/// <returns>Value returned by readRequestPort(...)</returns>
|
||||
public static unsafe int ReadRequestPort(int threadID, IperlHead iperlHead, MessageID messageID, int offset, int lenght, out byte[] buffer, int timeout)
|
||||
public static unsafe int ReadRequestPort(int threadID, IperlHead iperlHead, MessageID messageID, int offset, int length, out byte[] buffer, int timeout)
|
||||
{
|
||||
buffer = new byte[lenght];
|
||||
|
||||
if (iperlHead.DebugLevel != DebugMode.Normal) return iperlHead.Name.Equals("iPerl13") ? 2 : 0; /// Simulates an error on position 13
|
||||
if (iperlHead.DebugLevel != DebugMode.Normal)
|
||||
{
|
||||
///
|
||||
/// Simulation
|
||||
///
|
||||
if ((messageID == MessageID.Configuration) && (offset == 0) && (length == ConfigStruct.Length))
|
||||
{
|
||||
buffer = new byte[ConfigStruct.Length] { 3, 3, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0, 1,2,3,4,5, 160, 0,0,0,0, 0,0, 0,0, 0,0 };
|
||||
}
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (length == CalibrationStruct.Length))
|
||||
{
|
||||
buffer = new byte[CalibrationStruct.Length] { 3, 0, 150,10, 0, 0, 0,0, 0,0,0,0,0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,0,0, 1,2,3,4,5, 0, 0 };
|
||||
}
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (length == CalibrationStructV4.Length))
|
||||
{
|
||||
buffer = new byte[CalibrationStructV4.Length] { 3, 0, 150,10, 0, 0, 0,0, 0,0,0,0,0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,0,0, 1,2,3,4,5, 0, 0, 150,10 };
|
||||
}
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 2) && (length == 2))
|
||||
{
|
||||
buffer = new byte[2] { 150,10 };
|
||||
}
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 34) && (length == 2))
|
||||
{
|
||||
buffer = new byte[2] { 150,10 };
|
||||
}
|
||||
else if ((messageID == MessageID.MetrologyMemory) && (offset == Q2CorrFactorsAddr) && (length == 2))
|
||||
{
|
||||
buffer = new byte[2] { 0, 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = new byte[length];
|
||||
}
|
||||
|
||||
return iperlHead.Name.Equals("iPerl13") ? 2 : 0; /// Simulates an error on position 13
|
||||
}
|
||||
|
||||
buffer = new byte[length];
|
||||
byte[] buf = new byte[200];
|
||||
///
|
||||
fixed (byte* pBuf = buf)
|
||||
@@ -190,32 +223,32 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
switch (threadID)
|
||||
{
|
||||
default:
|
||||
case 0: retv = readRequestPort1(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 1: retv = readRequestPort2(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 2: retv = readRequestPort3(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 3: retv = readRequestPort4(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 0: retv = readRequestPort1(messageID, offset, length, pBuf, timeout); break;
|
||||
case 1: retv = readRequestPort2(messageID, offset, length, pBuf, timeout); break;
|
||||
case 2: retv = readRequestPort3(messageID, offset, length, pBuf, timeout); break;
|
||||
case 3: retv = readRequestPort4(messageID, offset, length, pBuf, timeout); break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < lenght; i++) buffer[i] = buf[i];
|
||||
for (int i = 0; i < length; i++) buffer[i] = buf[i];
|
||||
|
||||
///
|
||||
/// Logging
|
||||
///
|
||||
string name = string.Format("{0}({1})", iperlHead.Name, iperlHead.SerialNr);
|
||||
if ((messageID == MessageID.Configuration) && (offset == 0) && (lenght == ConfigStruct.Length))
|
||||
if ((messageID == MessageID.Configuration) && (offset == 0) && (length == ConfigStruct.Length))
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1},...) returned {2} {3}", name, messageID, retv, (retv != 0) ? "!" : ConfigStruct.FromByteArray(buffer).ToString());
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (lenght == CalibrationStruct.Length))
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (length == CalibrationStruct.Length))
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1},...) returned {2} {3}", name, messageID, retv, (retv != 0) ? "!" : CalibrationStruct.FromByteArray(buffer).ToString());
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (lenght == CalibrationStructV4.Length))
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (length == CalibrationStructV4.Length))
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1},...) returned {2} {3}", name, messageID, retv, (retv != 0) ? "!" : CalibrationStructV4.FromByteArray(buffer).ToString());
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 2) && (lenght == 2))
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 2) && (length == 2))
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1},2,2,...) returned {2} {3}", name, messageID, retv, (retv != 0) ? "!" : string.Format("Cal={0}", buf[0] + 256 * buf[1]));
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 34) && (lenght == 2))
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 34) && (length == 2))
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1},34,2,...) returned {2} {3}", name, messageID, retv, (retv != 0) ? "!" : string.Format("CalLNA={0}", buf[0] + 256 * buf[1]));
|
||||
else if ((messageID == MessageID.MetrologyMemory) && (offset == Q2CorrFactorsAddr) && (lenght == 2))
|
||||
else if ((messageID == MessageID.MetrologyMemory) && (offset == Q2CorrFactorsAddr) && (length == 2))
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1},6264,2,...) returned {2} {3}", name, messageID, retv, (retv != 0) ? "!" : string.Format("LR={0} RL={1}", (int)buf[0], (int)buf[1]));
|
||||
else
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1}, {2}, {3}, ...) returned {4} {5}", name, messageID, offset, lenght, retv, (retv != 0) ? "!" : "");
|
||||
rfidDataLogger.InfoFormat("{0}: ReadRequestPort({1}, {2}, {3}, ...) returned {4} {5}", name, messageID, offset, length, retv, (retv != 0) ? "!" : "");
|
||||
|
||||
return retv;
|
||||
}
|
||||
@@ -227,7 +260,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <param name="threadID">0..3</param>
|
||||
/// <param name="iperlHead">Water meter (iPerlHead) object</param>
|
||||
/// <returns>Value returned by writeRequestPort(...)</returns>
|
||||
public static unsafe int WriteRequestPort(int threadID, IperlHead iperlHead, MessageID messageID, int offset, int lenght, byte[] buffer, int timeout)
|
||||
public static unsafe int WriteRequestPort(int threadID, IperlHead iperlHead, MessageID messageID, int offset, int length, byte[] buffer, int timeout)
|
||||
{
|
||||
if (iperlHead.DebugLevel != DebugMode.Normal) return 0;
|
||||
|
||||
@@ -238,10 +271,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
switch (threadID)
|
||||
{
|
||||
default:
|
||||
case 0: retv = writeRequestPort1(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 1: retv = writeRequestPort2(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 2: retv = writeRequestPort3(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 3: retv = writeRequestPort4(messageID, offset, lenght, pBuf, timeout); break;
|
||||
case 0: retv = writeRequestPort1(messageID, offset, length, pBuf, timeout); break;
|
||||
case 1: retv = writeRequestPort2(messageID, offset, length, pBuf, timeout); break;
|
||||
case 2: retv = writeRequestPort3(messageID, offset, length, pBuf, timeout); break;
|
||||
case 3: retv = writeRequestPort4(messageID, offset, length, pBuf, timeout); break;
|
||||
}
|
||||
|
||||
Thread.Sleep(250);
|
||||
@@ -250,9 +283,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// Logging
|
||||
///
|
||||
string name = string.Format("{0}({1})", iperlHead.Name, iperlHead.SerialNr);
|
||||
if (lenght == 1)
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5}) returned {1} {6}", name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
else if (lenght == 2)
|
||||
if (length == 1)
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5}) returned {1} {6}", name, retv, messageID, offset, length, pBuf[0].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
else if (length == 2)
|
||||
{
|
||||
if (messageID == MessageID.Calibration && offset == 2)
|
||||
{
|
||||
@@ -265,10 +298,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort(CalLNA={1}) returned {2} {3}", name, calibFactor, retv, (retv != 0) ? "!" : "");
|
||||
}
|
||||
else
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", name, retv, messageID, offset, length, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
}
|
||||
else
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5} {6} ...) returned {1} {7}", name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
rfidDataLogger.InfoFormat("{0}: WriteRequestPort({2}, {3}, {4}, {5} {6} ...) returned {1} {7}", name, retv, messageID, offset, length, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
|
||||
return retv;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
{
|
||||
public class CalibrationStruct
|
||||
{
|
||||
public static readonly int Length = 35;
|
||||
public const int Length = 35;
|
||||
|
||||
public Byte Version;
|
||||
public MeterType MeterType;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
{
|
||||
public class CalibrationStructV4
|
||||
{
|
||||
public static readonly int Length = 37;
|
||||
public const int Length = 37;
|
||||
|
||||
public Byte Version;
|
||||
public MeterType MeterType;
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TBF
|
||||
{
|
||||
/// <summary>
|
||||
/// This static class maintains a set of text box styles at one place, it is then sufficient
|
||||
/// to use the static method CustomStyle.Apply(id, textBox(es)) to apply this style to text box(es).
|
||||
/// </summary>
|
||||
public static class CustomStyle
|
||||
{
|
||||
const int setsCount = 20; /// Number of styles / attribute sets
|
||||
|
||||
static DockStyle[] dockStyles; /// Docking style
|
||||
static System.Drawing.Color[] backColors; /// Background color
|
||||
static BorderStyle[] borderStyles; /// Border style
|
||||
static bool[] readOnly; /// Read only
|
||||
static System.Drawing.Font[] fonts; /// Font
|
||||
|
||||
static CustomStyle()
|
||||
{
|
||||
dockStyles = new DockStyle[setsCount];
|
||||
backColors = new System.Drawing.Color[setsCount];
|
||||
borderStyles = new BorderStyle[setsCount];
|
||||
readOnly = new bool[setsCount];
|
||||
fonts = new System.Drawing.Font[setsCount];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set attributes of the set selected by 'set' parameter
|
||||
/// </summary>
|
||||
/// <param name="id">Attribute set ID</param>
|
||||
/// <param name="dockStyle">Docking style</param>
|
||||
/// <param name="backColor">Background color</param>
|
||||
/// <param name="readOnly">true for read only (aka label)</param>
|
||||
/// <param name="borderStyle">Border style</param>
|
||||
public static void Set(int id, DockStyle dockStyle, System.Drawing.Color backColor, BorderStyle borderStyle, bool readOnly, System.Drawing.Font font)
|
||||
{
|
||||
if (id < 0 || id >= setsCount) return;
|
||||
|
||||
CustomStyle.dockStyles[id] = dockStyle;
|
||||
CustomStyle.backColors[id] = backColor;
|
||||
CustomStyle.borderStyles[id] = borderStyle;
|
||||
CustomStyle.readOnly[id] = readOnly;
|
||||
CustomStyle.fonts[id] = font;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply one of the attribute sets to a TextBox instance
|
||||
/// </summary>
|
||||
public static void Apply(int id, TextBox textBox)
|
||||
{
|
||||
if (id < 0 || id >= setsCount) return;
|
||||
|
||||
textBox.Dock = dockStyles[id];
|
||||
textBox.BackColor = backColors[id];
|
||||
textBox.BorderStyle = borderStyles[id];
|
||||
textBox.ReadOnly = readOnly[id];
|
||||
textBox.Font = fonts[id];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply one of the attribute sets to a AttachedTextBoxes text boxes
|
||||
/// </summary>
|
||||
public static void Apply(int id, AttachedTextBoxes textBoxes)
|
||||
{
|
||||
if (id < 0 || id >= setsCount) return;
|
||||
|
||||
for (int i = 0; i < textBoxes.Count; i++)
|
||||
{
|
||||
textBoxes[i].Dock = dockStyles[id];
|
||||
textBoxes[i].BackColor = backColors[id];
|
||||
textBoxes[i].BorderStyle = borderStyles[id];
|
||||
textBoxes[i].ReadOnly = readOnly[id];
|
||||
textBoxes[i].Font = fonts[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using TBF.Forms;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.ErrorHandler {
|
||||
|
||||
public static class ErrorHandler
|
||||
{
|
||||
public static DialogResult HandleError(Exception e, string Message, string Origin)
|
||||
{
|
||||
|
||||
//catch (FluentNHibernate.Cfg.FluentConfigurationException fe)
|
||||
// {
|
||||
// string message;
|
||||
// if (fe.InnerException != null)
|
||||
// {
|
||||
// message = fe.InnerException.Message;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// message = fe.Message;
|
||||
// }
|
||||
// MessageBox.Show( message, "RetVal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
|
||||
ErrorDlg dlg = new ErrorDlg(Strings.Unhandled_error_occured_in_ + Origin + Environment.NewLine + Message + Environment.NewLine + e.ToString() + Environment.NewLine + e.InnerException.ToString());
|
||||
dlg.ShowDialog();
|
||||
return dlg.returnvalue;
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-5
@@ -107,11 +107,6 @@ namespace TBF
|
||||
public int PathsDlgWidth;
|
||||
public int PathsDlgHeight;
|
||||
|
||||
/// iPerlCommunicationsForm
|
||||
public int iPerlCommunicationsFormLeft;
|
||||
public int iPerlCommunicationsFormTop;
|
||||
public long iPerlCommunicationsFormCheckboxes;
|
||||
|
||||
[XmlArrayAttribute("FeedingColumnWidths")]
|
||||
public int[] FeedingColumnWidths;
|
||||
[XmlIgnore]
|
||||
@@ -156,6 +151,20 @@ namespace TBF
|
||||
public int MetrologyDlgWidth;
|
||||
public int MetrologyDlgHeight;
|
||||
|
||||
/// Conditions
|
||||
public bool ConditionsDlgMaximized;
|
||||
public int ConditionsDlgLeft;
|
||||
public int ConditionsDlgTop;
|
||||
public int ConditionsDlgWidth;
|
||||
public int ConditionsDlgHeight;
|
||||
|
||||
/// Uncertainty
|
||||
public bool UncertaintyDlgMaximized;
|
||||
public int UncertaintyDlgLeft;
|
||||
public int UncertaintyDlgTop;
|
||||
public int UncertaintyDlgWidth;
|
||||
public int UncertaintyDlgHeight;
|
||||
|
||||
|
||||
/// Procedures
|
||||
public bool ProceduresDlgMaximized;
|
||||
@@ -190,6 +199,11 @@ namespace TBF
|
||||
public int EnduranceDlgWidth;
|
||||
public int EnduranceDlgHeight;
|
||||
|
||||
/// iPerlCommunicationsForm
|
||||
public int iPerlCommunicationsFormLeft;
|
||||
public int iPerlCommunicationsFormTop;
|
||||
public long iPerlCommunicationsFormCheckboxes;
|
||||
|
||||
/// Serial numbers
|
||||
public string[] LastSNTexts;
|
||||
[XmlIgnore]
|
||||
|
||||
+8
-8
@@ -9,7 +9,7 @@ using log4net;
|
||||
using Config.Entities;
|
||||
using Users;
|
||||
using TBF.Resources;
|
||||
using TBF.Forms;
|
||||
using TBF.UI.Shared;
|
||||
|
||||
namespace TBF
|
||||
{
|
||||
@@ -54,7 +54,7 @@ namespace TBF
|
||||
/// <summary>
|
||||
/// Main window object.
|
||||
/// </summary>
|
||||
public static MainWnd MainWnd;
|
||||
public static UI.MainWnd MainWnd;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -207,9 +207,9 @@ namespace TBF
|
||||
log.Warn("No test benches in the local configuration -> display an appropriate dialog.");
|
||||
|
||||
/// Ask what to do, ask for the password, open 'DatabaseSetingsDlg' and continue on OK
|
||||
if ((new Forms.NoBenchOrDatabaseDlg { Message = Strings.NoBenchMsg }.ShowDialog() != DialogResult.OK) ||
|
||||
if ((new NoBenchOrDatabaseDlg { Message = Strings.NoBenchMsg }.ShowDialog() != DialogResult.OK) ||
|
||||
(new Users.Forms.LoginDlg(true).ShowDialog() == DialogResult.Cancel) ||
|
||||
(new BenchesDlg().ShowDialog() == DialogResult.Cancel))
|
||||
(new TBF.UI.Settings.BenchesDlg().ShowDialog() == DialogResult.Cancel))
|
||||
{
|
||||
return; /// Exit program
|
||||
}
|
||||
@@ -391,7 +391,7 @@ namespace TBF
|
||||
}
|
||||
|
||||
/// Ask what to do
|
||||
switch ((new Forms.NoBenchOrDatabaseDlg { Message = Strings.NoDatabaseMsg, ShowRetry = true }).ShowDialog())
|
||||
switch ((new NoBenchOrDatabaseDlg { Message = Strings.NoDatabaseMsg, ShowRetry = true }).ShowDialog())
|
||||
{
|
||||
case DialogResult.Abort:
|
||||
return; /// Exit program
|
||||
@@ -400,13 +400,13 @@ namespace TBF
|
||||
break; /// Retry connection to the database, stay inside the loop
|
||||
|
||||
case DialogResult.Yes:
|
||||
new UpgradeSelectionDlg().ShowDialog();
|
||||
new TBF.UI.Settings.UpgradeSelectionDlg().ShowDialog();
|
||||
break; /// Stay inside the loop
|
||||
|
||||
default:
|
||||
/// Open 'DatabaseSetingsDlg' and retry DB connect on OK
|
||||
if (new Users.Forms.LoginDlg(true).ShowDialog() == DialogResult.Cancel ||
|
||||
new BenchesDlg().ShowDialog() == DialogResult.Cancel)
|
||||
new TBF.UI.Settings.BenchesDlg().ShowDialog() == DialogResult.Cancel)
|
||||
{
|
||||
return; /// Exit program
|
||||
}
|
||||
@@ -444,7 +444,7 @@ namespace TBF
|
||||
{
|
||||
/// Open the main application window
|
||||
log.Info("Creating the main window");
|
||||
MainWnd = new MainWnd();
|
||||
MainWnd = new UI.MainWnd();
|
||||
log.Info("Opening the main window");
|
||||
Application.Run(MainWnd);
|
||||
log.Info("The main window was closed");
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.20.1306.0")]
|
||||
[assembly: AssemblyFileVersion("2.20.1306.0")]
|
||||
[assembly: AssemblyVersion("2.24.1315.0")]
|
||||
[assembly: AssemblyFileVersion("2.24.1315.0")]
|
||||
|
||||
Generated
+27
@@ -879,6 +879,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Conditions.
|
||||
/// </summary>
|
||||
internal static string Conditions {
|
||||
get {
|
||||
return ResourceManager.GetString("Conditions", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Configuration.
|
||||
/// </summary>
|
||||
@@ -2832,6 +2841,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No info available.
|
||||
/// </summary>
|
||||
internal static string No_info_available {
|
||||
get {
|
||||
return ResourceManager.GetString("No_info_available", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No results to print.
|
||||
/// </summary>
|
||||
@@ -5481,6 +5499,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Uncertainty.
|
||||
/// </summary>
|
||||
internal static string Uncertainty {
|
||||
get {
|
||||
return ResourceManager.GetString("Uncertainty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Uncertainty [%].
|
||||
/// </summary>
|
||||
|
||||
@@ -2053,4 +2053,13 @@
|
||||
<data name="Program_must_be_closed" xml:space="preserve">
|
||||
<value>Program must be closed.</value>
|
||||
</data>
|
||||
<data name="Conditions" xml:space="preserve">
|
||||
<value>Conditions</value>
|
||||
</data>
|
||||
<data name="Uncertainty" xml:space="preserve">
|
||||
<value>Uncertainty</value>
|
||||
</data>
|
||||
<data name="No_info_available" xml:space="preserve">
|
||||
<value>No info available</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,60 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TestBenchFramework xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Language>ru</Language>
|
||||
<Language>en</Language>
|
||||
<TestBenches>
|
||||
<DatabaseSettings>
|
||||
<BenchName>Санкт-Петербург PT50</BenchName>
|
||||
<BenchName>Test Bench</BenchName>
|
||||
<IsRealBench>true</IsRealBench>
|
||||
<ProceduresDBSettings>
|
||||
<DbType>MySql</DbType>
|
||||
<ConnectionString>SERVER=localhost; DATABASE=petersburg50; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
|
||||
<ConnectionString>SERVER=localhost; DATABASE=testbench; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
|
||||
</ProceduresDBSettings>
|
||||
<WaterMetersDBSettings>
|
||||
<DbType>MySql</DbType>
|
||||
<ConnectionString>SERVER=localhost; DATABASE=petersburg50-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
|
||||
<ConnectionString>SERVER=localhost; DATABASE=testbench-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
|
||||
</WaterMetersDBSettings>
|
||||
<UsersDBSettings>
|
||||
<DbType>MySql</DbType>
|
||||
<ConnectionString />
|
||||
</UsersDBSettings>
|
||||
</DatabaseSettings>
|
||||
<DatabaseSettings>
|
||||
<BenchName>Санкт-Петербург PT200</BenchName>
|
||||
<IsRealBench>true</IsRealBench>
|
||||
<ProceduresDBSettings>
|
||||
<DbType>MySql</DbType>
|
||||
<ConnectionString>SERVER=localhost; DATABASE=petersburg200; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
|
||||
</ProceduresDBSettings>
|
||||
<WaterMetersDBSettings>
|
||||
<DbType>MySql</DbType>
|
||||
<ConnectionString>SERVER=localhost; DATABASE=petersburg200-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
|
||||
</WaterMetersDBSettings>
|
||||
<UsersDBSettings>
|
||||
<DbType>MySql</DbType>
|
||||
<ConnectionString />
|
||||
</UsersDBSettings>
|
||||
</DatabaseSettings>
|
||||
</TestBenches>
|
||||
<LoginMethod>UserName</LoginMethod>
|
||||
<LastBench>Санкт-Петербург PT200</LastBench>
|
||||
<BatchNr>21</BatchNr>
|
||||
<LastBench>Test Bench</LastBench>
|
||||
<BatchNr>1</BatchNr>
|
||||
<RealDensity>998.2008</RealDensity>
|
||||
<AtTemperature>20</AtTemperature>
|
||||
<RightPaneHorizSplitterDistance>25</RightPaneHorizSplitterDistance>
|
||||
<TopPaneVerticalSplitterDistance>596</TopPaneVerticalSplitterDistance>
|
||||
<MainWndLeft>76</MainWndLeft>
|
||||
<MainWndTop>21</MainWndTop>
|
||||
<MainWndLeft>75</MainWndLeft>
|
||||
<MainWndTop>5</MainWndTop>
|
||||
<MainWndWidth>1250</MainWndWidth>
|
||||
<MainWndHeight>750</MainWndHeight>
|
||||
<ManiWndMaximized>true</ManiWndMaximized>
|
||||
<ManiWndMaximized>false</ManiWndMaximized>
|
||||
<ComponentsDlgLeft>200</ComponentsDlgLeft>
|
||||
<ComponentsDlgTop>100</ComponentsDlgTop>
|
||||
<ComponentsDlgWidth>850</ComponentsDlgWidth>
|
||||
<ComponentsDlgHeight>500</ComponentsDlgHeight>
|
||||
<PopupResultsLeft>0</PopupResultsLeft>
|
||||
<PopupResultsTop>0</PopupResultsTop>
|
||||
<PopupResultsWidth>0</PopupResultsWidth>
|
||||
<PopupResultsHeight>0</PopupResultsHeight>
|
||||
<PathsDlgLeft>0</PathsDlgLeft>
|
||||
<PathsDlgTop>0</PathsDlgTop>
|
||||
<PathsDlgWidth>0</PathsDlgWidth>
|
||||
@@ -79,10 +53,6 @@
|
||||
<OneProcedureDlgHeight>0</OneProcedureDlgHeight>
|
||||
<PrintOrderLeft>0</PrintOrderLeft>
|
||||
<PrintOrderTop>0</PrintOrderTop>
|
||||
<EnduranceDlgLeft>0</EnduranceDlgLeft>
|
||||
<EnduranceDlgTop>0</EnduranceDlgTop>
|
||||
<EnduranceDlgWidth>0</EnduranceDlgWidth>
|
||||
<EnduranceDlgHeight>0</EnduranceDlgHeight>
|
||||
<PrintOrderOnlyGoodResult>false</PrintOrderOnlyGoodResult>
|
||||
<PrintOrderOnlyLastResult>false</PrintOrderOnlyLastResult>
|
||||
<ResultsConfigMeters>Vertically</ResultsConfigMeters>
|
||||
|
||||
@@ -60,11 +60,10 @@
|
||||
<logger name="NHibernate"> <level value="ERROR" /> </logger>
|
||||
<logger name="TBF.BenchControl.StateMachine"> <level value="INFO" /> </logger>
|
||||
<logger name="TBF.BenchControl.State"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.Elde.ControlComWrap"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.Elde.ControlComdWrap"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.Elde.Pump"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.Elde.PumpWithFM"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.MettlerToledo"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.Fomulas"> <level value="FATAL" /> </logger>
|
||||
<logger name="TBF.BenchControl.Elde.StartMeasurementOp"> <level value="WARN" /> </logger>
|
||||
<logger name="TBF.BenchControl.Modbus"> <level value="DEBUG" /> </logger>
|
||||
</log4net>
|
||||
|
||||
-208
@@ -1,208 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.Screens
|
||||
{
|
||||
partial class MeasurementTabPageCtrl
|
||||
{
|
||||
/// <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.measurementLabel5 = new System.Windows.Forms.Label();
|
||||
this.measurementLabel4 = new System.Windows.Forms.Label();
|
||||
this.measurementLabel3 = new System.Windows.Forms.Label();
|
||||
this.measurementLabel2 = new System.Windows.Forms.Label();
|
||||
this.measurementLabel = new System.Windows.Forms.Label();
|
||||
this.measurementTableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.measurementTableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.measurementTableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.measurementTableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// measurementLabel5
|
||||
//
|
||||
this.measurementLabel5.AutoSize = true;
|
||||
this.measurementLabel5.Font = new System.Drawing.Font("Verdana", 11.25F);
|
||||
this.measurementLabel5.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.measurementLabel5.Location = new System.Drawing.Point(471, 136);
|
||||
this.measurementLabel5.Name = "measurementLabel5";
|
||||
this.measurementLabel5.Size = new System.Drawing.Size(74, 18);
|
||||
this.measurementLabel5.TabIndex = 17;
|
||||
this.measurementLabel5.Text = "Time Bar";
|
||||
//
|
||||
// measurementLabel4
|
||||
//
|
||||
this.measurementLabel4.AutoSize = true;
|
||||
this.measurementLabel4.Font = new System.Drawing.Font("Verdana", 11.25F);
|
||||
this.measurementLabel4.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.measurementLabel4.Location = new System.Drawing.Point(328, 136);
|
||||
this.measurementLabel4.Name = "measurementLabel4";
|
||||
this.measurementLabel4.Size = new System.Drawing.Size(74, 18);
|
||||
this.measurementLabel4.TabIndex = 16;
|
||||
this.measurementLabel4.Text = "Time Bar";
|
||||
//
|
||||
// measurementLabel3
|
||||
//
|
||||
this.measurementLabel3.AutoSize = true;
|
||||
this.measurementLabel3.Font = new System.Drawing.Font("Verdana", 11.25F);
|
||||
this.measurementLabel3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.measurementLabel3.Location = new System.Drawing.Point(484, 164);
|
||||
this.measurementLabel3.Name = "measurementLabel3";
|
||||
this.measurementLabel3.Size = new System.Drawing.Size(45, 18);
|
||||
this.measurementLabel3.TabIndex = 15;
|
||||
this.measurementLabel3.Text = "Total";
|
||||
//
|
||||
// measurementLabel2
|
||||
//
|
||||
this.measurementLabel2.AutoSize = true;
|
||||
this.measurementLabel2.Font = new System.Drawing.Font("Verdana", 11.25F);
|
||||
this.measurementLabel2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.measurementLabel2.Location = new System.Drawing.Point(323, 164);
|
||||
this.measurementLabel2.Name = "measurementLabel2";
|
||||
this.measurementLabel2.Size = new System.Drawing.Size(87, 18);
|
||||
this.measurementLabel2.TabIndex = 14;
|
||||
this.measurementLabel2.Text = "Actual test";
|
||||
//
|
||||
// measurementLabel
|
||||
//
|
||||
this.measurementLabel.AutoSize = true;
|
||||
this.measurementLabel.Font = new System.Drawing.Font("Verdana", 11.25F);
|
||||
this.measurementLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.measurementLabel.Location = new System.Drawing.Point(639, 514);
|
||||
this.measurementLabel.Name = "measurementLabel";
|
||||
this.measurementLabel.Size = new System.Drawing.Size(108, 18);
|
||||
this.measurementLabel.TabIndex = 13;
|
||||
this.measurementLabel.Text = "Target values";
|
||||
//
|
||||
// measurementTableLayoutPanel4
|
||||
//
|
||||
this.measurementTableLayoutPanel4.ColumnCount = 3;
|
||||
this.measurementTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.measurementTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
|
||||
this.measurementTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.measurementTableLayoutPanel4.Location = new System.Drawing.Point(642, 544);
|
||||
this.measurementTableLayoutPanel4.Name = "measurementTableLayoutPanel4";
|
||||
this.measurementTableLayoutPanel4.RowCount = 4;
|
||||
this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.measurementTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
this.measurementTableLayoutPanel4.Size = new System.Drawing.Size(216, 101);
|
||||
this.measurementTableLayoutPanel4.TabIndex = 12;
|
||||
//
|
||||
// measurementTableLayoutPanel3
|
||||
//
|
||||
this.measurementTableLayoutPanel3.ColumnCount = 3;
|
||||
this.measurementTableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
|
||||
this.measurementTableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
|
||||
this.measurementTableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34F));
|
||||
this.measurementTableLayoutPanel3.Location = new System.Drawing.Point(521, 11);
|
||||
this.measurementTableLayoutPanel3.Name = "measurementTableLayoutPanel3";
|
||||
this.measurementTableLayoutPanel3.RowCount = 2;
|
||||
this.measurementTableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.measurementTableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.measurementTableLayoutPanel3.Size = new System.Drawing.Size(348, 55);
|
||||
this.measurementTableLayoutPanel3.TabIndex = 11;
|
||||
//
|
||||
// measurementTableLayoutPanel2
|
||||
//
|
||||
this.measurementTableLayoutPanel2.ColumnCount = 2;
|
||||
this.measurementTableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.measurementTableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.measurementTableLayoutPanel2.Location = new System.Drawing.Point(11, 245);
|
||||
this.measurementTableLayoutPanel2.Name = "measurementTableLayoutPanel2";
|
||||
this.measurementTableLayoutPanel2.RowCount = 12;
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel2.Size = new System.Drawing.Size(177, 303);
|
||||
this.measurementTableLayoutPanel2.TabIndex = 10;
|
||||
//
|
||||
// measurementTableLayoutPanel1
|
||||
//
|
||||
this.measurementTableLayoutPanel1.ColumnCount = 3;
|
||||
this.measurementTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
|
||||
this.measurementTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35F));
|
||||
this.measurementTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35F));
|
||||
this.measurementTableLayoutPanel1.Location = new System.Drawing.Point(11, 21);
|
||||
this.measurementTableLayoutPanel1.Name = "measurementTableLayoutPanel1";
|
||||
this.measurementTableLayoutPanel1.RowCount = 7;
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.measurementTableLayoutPanel1.Size = new System.Drawing.Size(283, 183);
|
||||
this.measurementTableLayoutPanel1.TabIndex = 9;
|
||||
//
|
||||
// MeasurementTabPageCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(180)))), ((int)(((byte)(200)))));
|
||||
this.Controls.Add(this.measurementLabel5);
|
||||
this.Controls.Add(this.measurementLabel4);
|
||||
this.Controls.Add(this.measurementLabel3);
|
||||
this.Controls.Add(this.measurementLabel2);
|
||||
this.Controls.Add(this.measurementLabel);
|
||||
this.Controls.Add(this.measurementTableLayoutPanel4);
|
||||
this.Controls.Add(this.measurementTableLayoutPanel3);
|
||||
this.Controls.Add(this.measurementTableLayoutPanel2);
|
||||
this.Controls.Add(this.measurementTableLayoutPanel1);
|
||||
this.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "MeasurementTabPageCtrl";
|
||||
this.Size = new System.Drawing.Size(900, 689);
|
||||
this.Paint += new System.Windows.Forms.PaintEventHandler(this.measurement_Paint);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label measurementLabel5;
|
||||
private System.Windows.Forms.Label measurementLabel4;
|
||||
private System.Windows.Forms.Label measurementLabel3;
|
||||
private System.Windows.Forms.Label measurementLabel2;
|
||||
private System.Windows.Forms.Label measurementLabel;
|
||||
private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel4;
|
||||
private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel3;
|
||||
private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel2;
|
||||
private System.Windows.Forms.TableLayoutPanel measurementTableLayoutPanel1;
|
||||
}
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.Screens
|
||||
{
|
||||
public partial class MeasurementTabPageCtrl : UserControl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(MeasurementTabPageCtrl));
|
||||
|
||||
AttachedTextBoxes measurementTbl1Row1; /// Table 1
|
||||
AttachedTextBoxes measurementTbl1Col1;
|
||||
AttachedTextBoxes measurementTbl1Col2;
|
||||
AttachedTextBoxes measurementTbl1Col3;
|
||||
AttachedTextBoxes measurementTbl2Row1; /// Table 2
|
||||
AttachedTextBoxes measurementTbl2Col1;
|
||||
AttachedTextBoxes measurementTbl2Col2;
|
||||
AttachedTextBoxes measurementTbl3Row1; /// Table 3
|
||||
AttachedTextBoxes measurementTbl3Row2;
|
||||
AttachedTextBoxes measurementTbl4Col1;
|
||||
AttachedTextBoxes measurementTbl4Col2;
|
||||
AttachedTextBoxes measurementTbl4Col3;
|
||||
|
||||
BarGraph measurementBar1;
|
||||
BarGraph measurementBar2;
|
||||
|
||||
public MeasurementTabPageCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args)
|
||||
//{
|
||||
// if (InvokeRequired)
|
||||
// {
|
||||
// Invoke(new EventHandler<TestSelectedEventArgs>(OnTestSelected), sender, args);
|
||||
// }
|
||||
// else OnTestSelected(sender, args);
|
||||
//};
|
||||
//Bridge.TestProgressHandler += delegate(object sender, TestProgressEventArgs args)
|
||||
//{
|
||||
// if (InvokeRequired)
|
||||
// {
|
||||
// Invoke(new EventHandler<TestProgressEventArgs>(OnTestProgress), sender, args);
|
||||
// }
|
||||
// else OnTestProgress(sender, args);
|
||||
//};
|
||||
//Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args)
|
||||
//{
|
||||
// if (InvokeRequired)
|
||||
// {
|
||||
// Invoke(new EventHandler<TestCompletedEventArgs>(OnTestCompleted), sender, args);
|
||||
// }
|
||||
// else OnTestCompleted(sender, args);
|
||||
//};
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
measurementTbl1Row1 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.RowOfStrings, 1, 0, 2);
|
||||
measurementTbl1Col1 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.ColumnOfStrings, 0, 1, 6);
|
||||
measurementTbl1Col2 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.ColumnOfDoubles, 1, 1, 6);
|
||||
measurementTbl1Col3 = new AttachedTextBoxes(measurementTableLayoutPanel1, Arrangement.ColumnOfDoubles, 2, 1, 6);
|
||||
measurementTbl2Row1 = new AttachedTextBoxes(measurementTableLayoutPanel2, Arrangement.RowOfStrings, 1, 0, 1);
|
||||
measurementTbl2Col1 = new AttachedTextBoxes(measurementTableLayoutPanel2, Arrangement.ColumnOfStrings, 0, 1, 11);
|
||||
measurementTbl2Col2 = new AttachedTextBoxes(measurementTableLayoutPanel2, Arrangement.ColumnOfDoubles, 1, 1, 11);
|
||||
measurementTbl3Row1 = new AttachedTextBoxes(measurementTableLayoutPanel3, Arrangement.RowOfStrings, 0, 0, 3);
|
||||
measurementTbl3Row2 = new AttachedTextBoxes(measurementTableLayoutPanel3, Arrangement.RowOfDoubles, 0, 1, 3);
|
||||
measurementTbl4Col1 = new AttachedTextBoxes(measurementTableLayoutPanel4, Arrangement.ColumnOfStrings, 0, 0, 4);
|
||||
measurementTbl4Col2 = new AttachedTextBoxes(measurementTableLayoutPanel4, Arrangement.ColumnOfDoubles, 1, 0, 4);
|
||||
measurementTbl4Col3 = new AttachedTextBoxes(measurementTableLayoutPanel4, Arrangement.ColumnOfStrings, 2, 0, 4);
|
||||
|
||||
CustomStyle.Apply(1, measurementTbl1Row1);
|
||||
CustomStyle.Apply(1, measurementTbl1Col1);
|
||||
CustomStyle.Apply(1, measurementTbl1Col2);
|
||||
CustomStyle.Apply(1, measurementTbl1Col3);
|
||||
CustomStyle.Apply(1, measurementTbl2Row1);
|
||||
CustomStyle.Apply(1, measurementTbl2Col1);
|
||||
CustomStyle.Apply(1, measurementTbl2Col2);
|
||||
CustomStyle.Apply(1, measurementTbl3Row1);
|
||||
CustomStyle.Apply(1, measurementTbl3Row2);
|
||||
CustomStyle.Apply(1, measurementTbl4Col1);
|
||||
CustomStyle.Apply(1, measurementTbl4Col2);
|
||||
CustomStyle.Apply(1, measurementTbl4Col3);
|
||||
|
||||
measurementTbl1Row1.SetData(0, "Vmer");
|
||||
measurementTbl1Row1.SetData(1, "Emer");
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++) measurementTbl1Col1.SetData(i, "Meter" + (i + 1).ToString());
|
||||
|
||||
measurementTbl2Row1.SetData(0, "Ergebnise");
|
||||
measurementTbl2Col1.SetData(0, "IMP");
|
||||
measurementTbl2Col1.SetData(1, "Zeit");
|
||||
measurementTbl2Col1.SetData(2, "V_etn");
|
||||
measurementTbl2Col1.SetData(3, "Temp up");
|
||||
measurementTbl2Col1.SetData(4, "Temp dn");
|
||||
measurementTbl2Col1.SetData(5, "T Kl");
|
||||
measurementTbl2Col1.SetData(6, "Druck up");
|
||||
measurementTbl2Col1.SetData(7, "Druck dn");
|
||||
measurementTbl2Col1.SetData(8, "Durchfl. act");
|
||||
measurementTbl2Col1.SetData(9, "Zeit Kl in");
|
||||
measurementTbl2Col1.SetData(10, "Zeit Kl out");
|
||||
|
||||
measurementTbl3Row1.SetData(0, "Temp. Luft");
|
||||
measurementTbl3Row1.SetData(1, "Druck Luft");
|
||||
measurementTbl3Row1.SetData(2, "Humi. Luft");
|
||||
|
||||
measurementTbl4Col1.SetData(0, "Durchfl. Tar Min");
|
||||
measurementTbl4Col1.SetData(1, "Durchfl. Tar Max");
|
||||
measurementTbl4Col1.SetData(2, "Volumen Tar");
|
||||
measurementTbl4Col1.SetData(3, "Dauer");
|
||||
|
||||
//measurementTbl4Col2.SetData(0, 1.5);
|
||||
//measurementTbl4Col2.SetData(1, 1.65);
|
||||
//measurementTbl4Col2.SetData(2, 50);
|
||||
//measurementTbl4Col2.SetData(3, 114.29);
|
||||
|
||||
measurementTbl4Col3.SetData(0, "m3/h");
|
||||
measurementTbl4Col3.SetData(1, "m3/h");
|
||||
measurementTbl4Col3.SetData(2, "l");
|
||||
measurementTbl4Col3.SetData(3, "s");
|
||||
|
||||
measurementBar1 = new BarGraph(this, 320, 200, 100, 400, Color.DarkBlue, Color.WhiteSmoke);
|
||||
measurementBar2 = new BarGraph(this, 470, 200, 100, 400, Color.DarkBlue, Color.WhiteSmoke);
|
||||
}
|
||||
|
||||
private void measurement_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
if (measurementBar1 != null) measurementBar1.Paint(g);
|
||||
if (measurementBar2 != null) measurementBar2.Paint(g);
|
||||
g.DrawRectangle(new Pen(Color.Black, 2.0F), 500, -2, 402, 80);
|
||||
g.DrawRectangle(new Pen(Color.Black, 2.0F), 620, 500, 282, 250);
|
||||
}
|
||||
|
||||
|
||||
public void OnTestSelected(object sender, TestSelectedEventArgs data)
|
||||
{
|
||||
measurementTbl4Col2.SetData(0, data.Test.Qfrom.ToString("F2"));
|
||||
measurementTbl4Col2.SetData(1, data.Test.Qto.ToString("F2"));
|
||||
measurementTbl4Col2.SetData(2, data.Test.Volume.ToString("F1"));
|
||||
measurementTbl4Col2.SetData(3, data.Test.TstTime.ToString("F1"));
|
||||
}
|
||||
|
||||
public void OnTestProgress(object sender, TestProgressEventArgs data)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//if (data.TestResult != null)
|
||||
//{
|
||||
// int count = Math.Min(Config.Data.WMsCount, data.TestResult.Meters.Count);
|
||||
// for (int i = 0; i < count; i++)
|
||||
// {
|
||||
// measurementTbl1Col2.SetData(i, data.TestResult.Meters[i].VolumeMeter.ToString("F1"));
|
||||
// measurementTbl1Col3.SetData(i, data.TestResult.Meters[i].VolumeErrorPct.ToString("F1"));
|
||||
// }
|
||||
//}
|
||||
//measurementTbl2Col2.SetData(0, data.RefPulses);
|
||||
//measurementTbl2Col2.SetData(1, data.Time.ToString("F1"));
|
||||
|
||||
//measurementTbl2Col2.SetData(3, data.Tin.ToString());
|
||||
//measurementTbl2Col2.SetData(4, data.Tout.ToString());
|
||||
//measurementTbl2Col2.SetData(5, data.Tdiv.ToString());
|
||||
//measurementTbl2Col2.SetData(6, data.Pin.ToString());
|
||||
//measurementTbl2Col2.SetData(7, data.Pout.ToString());
|
||||
//measurementTbl2Col2.SetData(8, data.Flow.ToString());
|
||||
|
||||
//measurementTbl3Row2.SetData(0, data.AmbientTemp.ToString());
|
||||
//measurementTbl3Row2.SetData(1, data.AmbientPressure.ToString());
|
||||
//measurementTbl3Row2.SetData(2, data.AmbientHumidity.ToString());
|
||||
|
||||
//measurementBar1.FValue = data.Progress;
|
||||
}
|
||||
|
||||
public void OnTestCompleted(object sender, TestCompletedEventArgs data)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+571
-621
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Generated
+6
-6
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF
|
||||
namespace TBF.UI.Bench.Components
|
||||
{
|
||||
partial class ComponentsManagerDlg
|
||||
{
|
||||
@@ -33,8 +33,8 @@ namespace TBF
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ComponentsManagerDlg));
|
||||
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.listViewEx = new Results.Forms.ListViewEx();
|
||||
this.sharedButtons = new TBF.UiControls.SharedButtons();
|
||||
this.listViewEx = new global::Results.Forms.ListViewEx();
|
||||
this.sharedButtons = new TBF.UI.Shared.SharedButtons();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||
this.splitContainer.Panel1.SuspendLayout();
|
||||
this.splitContainer.Panel2.SuspendLayout();
|
||||
@@ -68,7 +68,7 @@ namespace TBF
|
||||
this.listViewEx.Name = "listViewEx";
|
||||
this.listViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewEx.View = System.Windows.Forms.View.Details;
|
||||
this.listViewEx.SubItemRightClicked += new Results.Forms.SubItemEventHandler(this.listViewEx_SubItemRightClicked);
|
||||
this.listViewEx.SubItemRightClicked += new global::Results.Forms.SubItemEventHandler(this.listViewEx_SubItemRightClicked);
|
||||
this.listViewEx.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewEx_ColumnClick);
|
||||
this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.componentsListView_SelectedIndexChanged);
|
||||
this.listViewEx.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listViewEx_MouseDoubleClick);
|
||||
@@ -96,8 +96,8 @@ namespace TBF
|
||||
|
||||
#endregion
|
||||
|
||||
private Results.Forms.ListViewEx listViewEx;
|
||||
private global::Results.Forms.ListViewEx listViewEx;
|
||||
private System.Windows.Forms.SplitContainer splitContainer;
|
||||
private UiControls.SharedButtons sharedButtons;
|
||||
private TBF.UI.Shared.SharedButtons sharedButtons;
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,9 @@ using Results.Forms;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
using TBF.UiControls;
|
||||
using TBF.UI.Shared;
|
||||
|
||||
namespace TBF
|
||||
namespace TBF.UI.Bench.Components
|
||||
{
|
||||
public partial class ComponentsManagerDlg : Form, IParentOfListViewEx
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace TBF
|
||||
LoadFormPosition();
|
||||
|
||||
Text = Strings.Test_Bench_Components_Configuration;
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
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);
|
||||
@@ -115,10 +115,10 @@ namespace TBF
|
||||
for (LogLevel level = 0; level < LogLevel.Count; level++) logCB.Items.Add(level.ToDescription());
|
||||
splitContainer.Panel1.Controls.Add(logCB);
|
||||
|
||||
listViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemClicked);
|
||||
listViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
|
||||
listViewEx.SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
|
||||
listViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
|
||||
|
||||
sharedButtons.DisableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Edit);
|
||||
|
||||
session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
|
||||
cmpntEntities = session.QueryOver<Component>()
|
||||
@@ -128,7 +128,7 @@ namespace TBF
|
||||
RedrawAll();
|
||||
}
|
||||
|
||||
void listViewEx_SubItemClicked(object sender, Results.Forms.SubItemEventArgs e)
|
||||
void listViewEx_SubItemClicked(object sender, SubItemEventArgs e)
|
||||
{
|
||||
if (unlocked && e.SubItem == (int)Column.DebugMode)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ namespace TBF
|
||||
}
|
||||
}
|
||||
|
||||
void listViewEx_SubItemEndEditing(object sender, Results.Forms.SubItemEndEditingEventArgs e)
|
||||
void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
|
||||
{
|
||||
Component cmpnt = (Component)e.Item.Tag;
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace TBF
|
||||
|
||||
private void LoadFormPosition()
|
||||
{
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
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;
|
||||
@@ -639,11 +639,11 @@ namespace TBF
|
||||
{
|
||||
if (listViewEx.SelectedIndices.Count == 1)
|
||||
{
|
||||
sharedButtons.EnableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit);
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Edit);
|
||||
}
|
||||
else
|
||||
{
|
||||
sharedButtons.DisableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Edit);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF
|
||||
namespace TBF.UI.Bench.Components
|
||||
{
|
||||
partial class SelectComponentClassDlg
|
||||
{
|
||||
@@ -1,12 +1,12 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF
|
||||
namespace TBF.UI.Bench.Components
|
||||
{
|
||||
public partial class SelectComponentClassDlg : Form
|
||||
{
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.UI.Bench.Conditions
|
||||
{
|
||||
partial class ConditionsDlg
|
||||
{
|
||||
/// <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 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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConditionsDlg));
|
||||
this.mainSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.tabControl = new System.Windows.Forms.TabControl();
|
||||
this.sharedButtons = new TBF.UI.Shared.SharedButtons();
|
||||
((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).BeginInit();
|
||||
this.mainSplitContainer.Panel1.SuspendLayout();
|
||||
this.mainSplitContainer.Panel2.SuspendLayout();
|
||||
this.mainSplitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// mainSplitContainer
|
||||
//
|
||||
resources.ApplyResources(this.mainSplitContainer, "mainSplitContainer");
|
||||
this.mainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.mainSplitContainer.Name = "mainSplitContainer";
|
||||
//
|
||||
// mainSplitContainer.Panel1
|
||||
//
|
||||
this.mainSplitContainer.Panel1.Controls.Add(this.tabControl);
|
||||
//
|
||||
// mainSplitContainer.Panel2
|
||||
//
|
||||
this.mainSplitContainer.Panel2.Controls.Add(this.sharedButtons);
|
||||
//
|
||||
// tabControl
|
||||
//
|
||||
resources.ApplyResources(this.tabControl, "tabControl");
|
||||
this.tabControl.Name = "tabControl";
|
||||
this.tabControl.SelectedIndex = 0;
|
||||
this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
|
||||
//
|
||||
// sharedButtons
|
||||
//
|
||||
resources.ApplyResources(this.sharedButtons, "sharedButtons");
|
||||
this.sharedButtons.Name = "sharedButtons";
|
||||
//
|
||||
// ConditionsDlg
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.mainSplitContainer);
|
||||
this.Name = "ConditionsDlg";
|
||||
this.Load += new System.EventHandler(this.TransitionsDlg_Load);
|
||||
this.mainSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.mainSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).EndInit();
|
||||
this.mainSplitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer mainSplitContainer;
|
||||
private System.Windows.Forms.TabControl tabControl;
|
||||
private TBF.UI.Shared.SharedButtons sharedButtons;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,707 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using Config.Entities;
|
||||
using Results.Forms;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
using TBF.UI.Bench.Transitions; /// TODO: Remove
|
||||
|
||||
namespace TBF.UI.Bench.Conditions
|
||||
{
|
||||
public partial class ConditionsDlg : Form, IParentOfListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ConditionsDlg));
|
||||
|
||||
/// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi
|
||||
public readonly int Dpi;
|
||||
public const int Dpi100pct = 96;
|
||||
|
||||
/// <summary>
|
||||
/// Fluent-NHibernate database session
|
||||
/// </summary>
|
||||
public ISession Session;
|
||||
|
||||
IList<Procedure> procedures;
|
||||
IList<Test> tests;
|
||||
|
||||
Dictionary<string, string> renameInfo; /// Pairs original name / new name
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Transition sequences to be updated by this dialog.
|
||||
/// Set by the constructor or updated by the parent after creation and before loading.
|
||||
/// </summary>
|
||||
public IList<TransitionSequence> TransitionSequences;
|
||||
public IList<TransitionSequence> RemovedTransitionSequences;
|
||||
|
||||
/// <summary>
|
||||
/// Virtual bench sequences to be updated by this dialog.
|
||||
/// Set by the constructor or updated by the parent after creation and before loading.
|
||||
/// </summary>
|
||||
public IList<VirtualBenchSequence> VirtualBenchSequences;
|
||||
public IList<VirtualBenchSequence> RemovedVirtualBenchSequences;
|
||||
|
||||
|
||||
/// Auxiliary public lists used also by user controls in tab pages
|
||||
public IList<BenchControl.Generic.IComponent> TbfComponents;
|
||||
public IList<IValve> Valves;
|
||||
public IList<IRegulValve> RegulValves;
|
||||
|
||||
|
||||
IList<ITabWithListViewEx> seqStepsCtrls;
|
||||
|
||||
|
||||
public ConditionsDlg()
|
||||
{
|
||||
/// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi.
|
||||
Dpi = (int)this.CreateGraphics().DpiX;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
/// SharedDlgButtons configuration
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.Metrologists };
|
||||
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove |
|
||||
SharedButtons.Buttons.Up | SharedButtons.Buttons.Down |
|
||||
SharedButtons.Buttons.Export | SharedButtons.Buttons.Import |
|
||||
SharedButtons.Buttons.Compare | SharedButtons.Buttons.NewTab |
|
||||
SharedButtons.Buttons.RenameTab | SharedButtons.Buttons.RemoveTab;
|
||||
sharedButtons.Unlocked += Unlocked;
|
||||
sharedButtons.OKClicked += okButton_Click;
|
||||
sharedButtons.CancelClicked += cancelButton_Click;
|
||||
sharedButtons.AddClicked += addButton_Click;
|
||||
sharedButtons.RemoveClicked += removeButton_Click;
|
||||
sharedButtons.UpClicked += upButton_Click;
|
||||
sharedButtons.DownClicked += downButton_Click;
|
||||
sharedButtons.ExportClicked += exportButton_Click;
|
||||
sharedButtons.ImportClicked += importButton_Click;
|
||||
sharedButtons.CompareClicked += compareButton_Click;
|
||||
sharedButtons.NewTabClicked += newTabButton_Click;
|
||||
sharedButtons.RenameTabClicked += renameTabButton_Click;
|
||||
sharedButtons.RemoveTabClicked += removeTabButton_Click;
|
||||
|
||||
seqStepsCtrls = new List<ITabWithListViewEx>();
|
||||
|
||||
/// Open the database
|
||||
Session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
|
||||
|
||||
/// Prepare a list of components and a list of all valves in the test bench
|
||||
TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Session);
|
||||
Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents);
|
||||
RegulValves = new List<IRegulValve>();
|
||||
foreach (var cmpnt in TbfComponents)
|
||||
{
|
||||
if ((cmpnt is IRegulValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem))
|
||||
{
|
||||
RegulValves.Add(cmpnt as IRegulValve);
|
||||
}
|
||||
}
|
||||
|
||||
/// Load the sequences
|
||||
/// Note: Each sequence (in both sequences together) has a unique ItemNr (0 .. N-1)
|
||||
TransitionSequences = Session.QueryOver<TransitionSequence>().OrderBy(x => x.ItemNr).Asc.List();
|
||||
VirtualBenchSequences = Session.QueryOver<VirtualBenchSequence>().OrderBy(x => x.ItemNr).Asc.List();
|
||||
procedures = Session.QueryOver<Procedure>().List();
|
||||
tests = Session.QueryOver<Test>().List();
|
||||
|
||||
RemovedTransitionSequences = new List<TransitionSequence>();
|
||||
RemovedVirtualBenchSequences = new List<VirtualBenchSequence>();
|
||||
|
||||
/// Create a tab with sequence steps for each sequence ordered by ItemNr.
|
||||
foreach (var transSeq in TransitionSequences)
|
||||
{
|
||||
transSeq.OriName = transSeq.Name;
|
||||
AddTransitionSeqTab(transSeq);
|
||||
}
|
||||
|
||||
foreach (var vBenchSeq in VirtualBenchSequences)
|
||||
{
|
||||
vBenchSeq.OriName = vBenchSeq.Name;
|
||||
AddVirtualBenchSeqTab(vBenchSeq);
|
||||
}
|
||||
}
|
||||
|
||||
void AddTransitionSeqTab(TransitionSequence sequence)
|
||||
{
|
||||
//TabPage nwTab = new TabPage(sequence.Name);
|
||||
//nwTab.Tag = sequence;
|
||||
//TransitionStepsCtrl newCtrl = new TransitionStepsCtrl();
|
||||
//seqStepsCtrls.Add(newCtrl);
|
||||
//nwTab.Controls.Add(newCtrl);
|
||||
//tabControl.TabPages.Add(nwTab);
|
||||
//newCtrl.Initialize(sequence, this, tabControl.TabPages[tabControl.TabPages.Count - 1]);
|
||||
//newCtrl.SelectedIndexChanged += new System.EventHandler(SelectedIndexChanged);
|
||||
}
|
||||
|
||||
void AddVirtualBenchSeqTab(VirtualBenchSequence sequence)
|
||||
{
|
||||
//TabPage nwTab = new TabPage(sequence.Name);
|
||||
//nwTab.Tag = sequence;
|
||||
//VirtualBenchStepsCtrl newCtrl = new VirtualBenchStepsCtrl();
|
||||
//seqStepsCtrls.Add(newCtrl);
|
||||
//nwTab.Controls.Add(newCtrl);
|
||||
//tabControl.TabPages.Add(nwTab);
|
||||
//newCtrl.Initialize(sequence, this, tabControl.TabPages[tabControl.TabPages.Count - 1]);
|
||||
//newCtrl.SelectedIndexChanged += new System.EventHandler(SelectedIndexChanged);
|
||||
}
|
||||
|
||||
private void TransitionsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
LoadUISettings();
|
||||
|
||||
/// Now refresh the content of the dialog
|
||||
RefreshAllTabs();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Conditions;
|
||||
}
|
||||
|
||||
void RefreshAllTabs()
|
||||
{
|
||||
foreach (var ctrl in seqStepsCtrls) (ctrl as ListViewEx).Refresh();
|
||||
}
|
||||
|
||||
private void Unlocked(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var ctrl in seqStepsCtrls) ctrl.Unlock();
|
||||
}
|
||||
|
||||
|
||||
private void newTabButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TabNameDlg dlg;
|
||||
bool nameUsed;
|
||||
int tabId = TransitionSequences.Count + VirtualBenchSequences.Count;
|
||||
|
||||
do
|
||||
{
|
||||
/// Find an unused procedure name
|
||||
string newName;
|
||||
for (int nameId = 1; true; nameId++)
|
||||
{
|
||||
newName = "Tr" + nameId.ToString();
|
||||
nameUsed = false;
|
||||
foreach (var seq in TransitionSequences) if (seq.Name.Equals(newName)) nameUsed = true;
|
||||
if (!nameUsed) break;
|
||||
}
|
||||
|
||||
dlg = new TabNameDlg();
|
||||
dlg.TabNameLabel = Strings.New_transition_name;
|
||||
dlg.TabName = newName;
|
||||
|
||||
if (DialogResult.OK != dlg.ShowDialog()) return;
|
||||
|
||||
foreach (var seq in TransitionSequences) if (seq.Name.Equals(dlg.TabName)) nameUsed = true;
|
||||
if (nameUsed) MessageBox.Show(Strings.Please_choose_another_transition_sequence_name,
|
||||
Strings.Warning,
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
}
|
||||
while (nameUsed);
|
||||
|
||||
if (dlg.IsVirtualBenchSeq)
|
||||
{
|
||||
VirtualBenchSequence sequence = new VirtualBenchSequence(dlg.TabName, tabId);
|
||||
VirtualBenchSequences.Add(sequence);
|
||||
AddVirtualBenchSeqTab(sequence);
|
||||
seqStepsCtrls[tabId].Unlock();
|
||||
}
|
||||
else
|
||||
{
|
||||
TransitionSequence sequence = new TransitionSequence(dlg.TabName, tabId);
|
||||
TransitionSequences.Add(sequence);
|
||||
AddTransitionSeqTab(sequence);
|
||||
seqStepsCtrls[tabId].Unlock();
|
||||
}
|
||||
tabControl.SelectTab(tabId);
|
||||
}
|
||||
|
||||
private void renameTabButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TabPage tabPage = tabControl.SelectedTab;
|
||||
TransitionSequence transitionSeq = tabPage.Tag as TransitionSequence;
|
||||
VirtualBenchSequence virtualBenchSeq = tabPage.Tag as VirtualBenchSequence;
|
||||
|
||||
TabNameDlg dlg = new TabNameDlg(true);
|
||||
dlg.TabNameLabel = Strings.New_transition_name;
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
bool nameUsed = false;
|
||||
foreach (var seq in TransitionSequences) if (seq != transitionSeq && seq.Name == dlg.TabName) nameUsed = true;
|
||||
foreach (var seq in VirtualBenchSequences) if (seq != virtualBenchSeq && seq.Name == dlg.TabName) nameUsed = true;
|
||||
|
||||
if (nameUsed)
|
||||
{
|
||||
MessageBox.Show(Strings.Please_choose_another_transition_sequence_name,
|
||||
Strings.Warning,
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (transitionSeq != null)
|
||||
{
|
||||
transitionSeq.Name = dlg.TabName;
|
||||
tabPage.Text = dlg.TabName;
|
||||
}
|
||||
else if (virtualBenchSeq != null)
|
||||
{
|
||||
virtualBenchSeq.Name = dlg.TabName;
|
||||
tabPage.Text = dlg.TabName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeTabButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TabPage tabPage = tabControl.SelectedTab;
|
||||
TransitionSequence transitionSeq = tabPage.Tag as TransitionSequence;
|
||||
VirtualBenchSequence virtualBenchSeq = tabPage.Tag as VirtualBenchSequence;
|
||||
|
||||
if (DialogResult.Yes == MessageBox.Show(string.Format(Strings.Do_you_really_want_to_delete_sequence_0, tabPage.Text),
|
||||
Strings.Warning,
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Question))
|
||||
{
|
||||
if (transitionSeq != null)
|
||||
{
|
||||
RemovedTransitionSequences.Add(transitionSeq);
|
||||
TransitionSequences.Remove(transitionSeq);
|
||||
tabControl.TabPages.Remove(tabPage);
|
||||
}
|
||||
else if (virtualBenchSeq != null)
|
||||
{
|
||||
RemovedVirtualBenchSequences.Add(virtualBenchSeq);
|
||||
VirtualBenchSequences.Remove(virtualBenchSeq);
|
||||
tabControl.TabPages.Remove(tabPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RetrieveData()
|
||||
{
|
||||
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].OkBtnClicked();
|
||||
}
|
||||
|
||||
string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
|
||||
{
|
||||
string warnings = string.Empty;
|
||||
renmInfo = new Dictionary<string, string>();
|
||||
|
||||
foreach (var seq in RemovedTransitionSequences)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(seq.OriName))
|
||||
{
|
||||
int occurances = 0;
|
||||
foreach (var test in tests)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
|
||||
}
|
||||
foreach (var proc in procedures)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
|
||||
}
|
||||
if (occurances > 0)
|
||||
{
|
||||
warnings += string.Format("Deleting transition sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
|
||||
renmInfo.Add(seq.OriName, string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var seq in RemovedVirtualBenchSequences)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(seq.OriName))
|
||||
{
|
||||
int occurances = 0;
|
||||
foreach (var test in tests)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
|
||||
}
|
||||
foreach (var proc in procedures)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
|
||||
}
|
||||
if (occurances > 0)
|
||||
{
|
||||
warnings += string.Format("Deleting virtual bench sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
|
||||
renmInfo.Add(seq.OriName, string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var seq in TransitionSequences)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(seq.OriName) && seq.OriName != seq.Name)
|
||||
{
|
||||
int occurances = 0;
|
||||
foreach (var test in tests)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
|
||||
}
|
||||
foreach (var proc in procedures)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
|
||||
}
|
||||
if (occurances > 0)
|
||||
{
|
||||
warnings += string.Format("Renaming transition sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
|
||||
renmInfo.Add(seq.OriName, seq.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var seq in VirtualBenchSequences)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(seq.OriName) && seq.OriName != seq.Name)
|
||||
{
|
||||
int occurances = 0;
|
||||
foreach (var test in tests)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
|
||||
}
|
||||
foreach (var proc in procedures)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
|
||||
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
|
||||
}
|
||||
if (occurances > 0)
|
||||
{
|
||||
warnings += string.Format("Renaming virtual bench sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
|
||||
renmInfo.Add(seq.OriName, seq.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return warnings;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
RetrieveData();
|
||||
|
||||
string warnings = GetWarningsBeforeSaving(ref renameInfo);
|
||||
|
||||
bool updateRelatedItems = false;
|
||||
if (!string.IsNullOrEmpty(warnings))
|
||||
{
|
||||
string message = string.Format("{0}{1}{2}", warnings, Environment.NewLine,
|
||||
Strings.Do_you_want_to_update_related_tests_and_procedures);
|
||||
DialogResult dr = MessageBox.Show(message, Strings.Warning, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
|
||||
if (dr == DialogResult.Cancel)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
return;
|
||||
}
|
||||
else if (dr == DialogResult.Yes)
|
||||
{
|
||||
updateRelatedItems = true;
|
||||
}
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
||||
using (var transaction = Session.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (updateRelatedItems)
|
||||
{
|
||||
foreach (var ri in renameInfo)
|
||||
{
|
||||
var tests = Session.QueryOver<Config.Entities.Test>()
|
||||
.Where(x => (x.RelTransBefore == ri.Key))
|
||||
.List();
|
||||
foreach (var t in tests)
|
||||
{
|
||||
t.RelTransBefore = ri.Value;
|
||||
Session.Update(t);
|
||||
}
|
||||
|
||||
tests = Session.QueryOver<Config.Entities.Test>()
|
||||
.Where(x => (x.TransitionAfter == ri.Key))
|
||||
.List();
|
||||
foreach (var t in tests)
|
||||
{
|
||||
t.TransitionAfter = ri.Value;
|
||||
Session.Update(t);
|
||||
}
|
||||
|
||||
var procedures = Session.QueryOver<Config.Entities.Procedure>()
|
||||
.Where(x => (x.TransitionStart == ri.Key))
|
||||
.List();
|
||||
foreach (var p in procedures)
|
||||
{
|
||||
p.TransitionStart = ri.Value;
|
||||
Session.Update(p);
|
||||
}
|
||||
|
||||
procedures = Session.QueryOver<Config.Entities.Procedure>()
|
||||
.Where(x => (x.TransitionEnd == ri.Key))
|
||||
.List();
|
||||
foreach (var p in procedures)
|
||||
{
|
||||
p.TransitionEnd = ri.Value;
|
||||
Session.Update(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var transSeq in RemovedTransitionSequences)
|
||||
{
|
||||
foreach (var step in transSeq.TransitionSteps) Session.Delete(step);
|
||||
Session.Delete(transSeq);
|
||||
}
|
||||
foreach (var vBnchSeq in RemovedVirtualBenchSequences)
|
||||
{
|
||||
foreach (var step in vBnchSeq.VirtualBenchSteps) Session.Delete(step);
|
||||
Session.Delete(vBnchSeq);
|
||||
}
|
||||
|
||||
int itemNr = 0;
|
||||
foreach (var transSeq in TransitionSequences)
|
||||
{
|
||||
transSeq.ItemNr = itemNr++;
|
||||
Session.SaveOrUpdate(transSeq);
|
||||
}
|
||||
itemNr = 0;
|
||||
foreach (var vBnchSeq in VirtualBenchSequences)
|
||||
{
|
||||
vBnchSeq.ItemNr = itemNr++;
|
||||
Session.SaveOrUpdate(vBnchSeq);
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception e2)
|
||||
{
|
||||
transaction.Rollback();
|
||||
Cursor.Current = Cursors.Default;
|
||||
|
||||
MessageBox.Show(Strings.Cannot_save_changes, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
log.ErrorFormat("Update of sequences in the database failed: {0}", e2.Message);
|
||||
}
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
|
||||
SaveUISettings();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveUISettings();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
private void SaveUISettings()
|
||||
{
|
||||
/// Obtain ConditionsDlg 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;
|
||||
|
||||
if (ls != null && (ls.ConditionsDlgMaximized != isMaximized ||
|
||||
ls.ConditionsDlgLeft != left ||
|
||||
ls.ConditionsDlgTop != top ||
|
||||
ls.ConditionsDlgWidth != width ||
|
||||
ls.ConditionsDlgHeight != height))
|
||||
{
|
||||
/// At least one ConditionsDlg dimension differs => Update local settings and save them
|
||||
ls.ConditionsDlgMaximized = isMaximized;
|
||||
ls.ConditionsDlgLeft = left;
|
||||
ls.ConditionsDlgTop = top;
|
||||
ls.ConditionsDlgWidth = width;
|
||||
ls.ConditionsDlgHeight = height;
|
||||
ls.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadUISettings()
|
||||
{
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
WindowState = (ls.ConditionsDlgMaximized ? FormWindowState.Maximized : FormWindowState.Normal);
|
||||
Width = (ls.ConditionsDlgWidth > 0) ? ls.ConditionsDlgWidth : 1050;
|
||||
Height = (ls.ConditionsDlgHeight > 0) ? ls.ConditionsDlgHeight : 650;
|
||||
Left = (ls.ConditionsDlgLeft != 0) ? ls.ConditionsDlgLeft : 100;
|
||||
Top = (ls.ConditionsDlgTop != 0) ? ls.ConditionsDlgTop : 100;
|
||||
}
|
||||
|
||||
|
||||
int slctdTab;
|
||||
|
||||
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (seqStepsCtrls.Count > slctdTab)
|
||||
{
|
||||
seqStepsCtrls[slctdTab].OkBtnClicked();
|
||||
}
|
||||
slctdTab = tabControl.SelectedIndex;
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Add);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
|
||||
RefreshAllTabs();
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].AddOne();
|
||||
}
|
||||
|
||||
private void removeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].RemoveSelected();
|
||||
}
|
||||
|
||||
private void upButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].MoveUpSelected();
|
||||
}
|
||||
|
||||
private void downButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].MoveDownSelected();
|
||||
}
|
||||
|
||||
public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos)
|
||||
{
|
||||
if (selectedItemPos == SharedButtons.SelectedItemPos.None)
|
||||
{
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down);
|
||||
}
|
||||
else if (selectedItemPos == SharedButtons.SelectedItemPos.First)
|
||||
{
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Up);
|
||||
}
|
||||
else if (selectedItemPos == SharedButtons.SelectedItemPos.Last)
|
||||
{
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Down);
|
||||
}
|
||||
else if (selectedItemPos == SharedButtons.SelectedItemPos.FirstAndLast)
|
||||
{
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Remove);
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down);
|
||||
}
|
||||
else
|
||||
{
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Common part for three xxxListViewEx_SelectedIndexChanged event handlers
|
||||
/// </summary>
|
||||
/// <param name="listViewEx"></param>
|
||||
void SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
ListViewEx listViewEx = sender as ListViewEx;
|
||||
if (listViewEx.SelectedItems.Count != 1)
|
||||
{
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.None);
|
||||
}
|
||||
else if (listViewEx.Items.Count == 1)
|
||||
{
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast);
|
||||
}
|
||||
else if (listViewEx.SelectedIndices[0] == 0)
|
||||
{
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.First);
|
||||
}
|
||||
else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1))
|
||||
{
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.Last);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateButtonStates(SharedButtons.SelectedItemPos.Middle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void exportButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TabPage tabPage = tabControl.SelectedTab;
|
||||
TransitionSequence transitionSeq = tabPage.Tag as TransitionSequence;
|
||||
VirtualBenchSequence virtualBenchSeq = tabPage.Tag as VirtualBenchSequence;
|
||||
|
||||
SaveFileDialog dlg = new SaveFileDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (transitionSeq != null)
|
||||
{
|
||||
/// export transition sequence
|
||||
transitionSeq.Export(new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8));
|
||||
}
|
||||
else if (virtualBenchSeq != null)
|
||||
{
|
||||
/// export virtual sequence
|
||||
virtualBenchSeq.Export(new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void importButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
|
||||
if (dlg.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
/// Import a procedure from a file
|
||||
int tabId = TransitionSequences.Count + VirtualBenchSequences.Count;
|
||||
TransitionSequence newSequence = TransitionSequence.Import(new StreamReader(dlg.FileName, System.Text.Encoding.UTF8));
|
||||
newSequence.ItemNr = tabId;
|
||||
|
||||
/// Find an unused procedure name
|
||||
string newName;
|
||||
bool nameUsed;
|
||||
for (int nameId = 1; true; nameId++)
|
||||
{
|
||||
newName = string.Format("{0} imported{1}", newSequence.Name, (nameId == 1) ? string.Empty : string.Format("({0})", nameId));
|
||||
nameUsed = false;
|
||||
foreach (var seq in TransitionSequences) if (seq.Name.Equals(newName)) nameUsed = true;
|
||||
if (!nameUsed) break;
|
||||
}
|
||||
newSequence.Name = newName;
|
||||
|
||||
TransitionSequences.Add(newSequence);
|
||||
AddTransitionSeqTab(newSequence);
|
||||
seqStepsCtrls[tabId].Unlock();
|
||||
tabControl.SelectTab(tabId);
|
||||
}
|
||||
|
||||
private void compareButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Comparing sequences in not implemented yet");
|
||||
}
|
||||
}
|
||||
}
|
||||
+108
-36
@@ -117,58 +117,130 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="stopBtn.Text" xml:space="preserve">
|
||||
<value>停止</value>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="mainSplitContainer.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="startTestBtn.Text" xml:space="preserve">
|
||||
<value>开始测试</value>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="mainSplitContainer.IsSplitterFixed" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="startCycleBtn.Text" xml:space="preserve">
|
||||
<value>启动循环</value>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="mainSplitContainer.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="purgeBeginBtn.Text" xml:space="preserve">
|
||||
<value>开始</value>
|
||||
<data name="tabControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="purgeEndBtn.Text" xml:space="preserve">
|
||||
<value>结束</value>
|
||||
<data name="tabControl.ItemSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>58, 30</value>
|
||||
</data>
|
||||
<data name="breakBtn.Text" xml:space="preserve">
|
||||
<value>断开</value>
|
||||
<data name="tabControl.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="resetResultsBtn.Text" xml:space="preserve">
|
||||
<value>重置</value>
|
||||
<data name="tabControl.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>760, 366</value>
|
||||
</data>
|
||||
<data name="cameraTestBtn.Text" xml:space="preserve">
|
||||
<value>相机测试</value>
|
||||
<data name="tabControl.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="emptyTank1Btn.Text" xml:space="preserve">
|
||||
<value>水箱 1</value>
|
||||
<data name=">>tabControl.Name" xml:space="preserve">
|
||||
<value>tabControl</value>
|
||||
</data>
|
||||
<data name="sensitivityTestBtn.Text" xml:space="preserve">
|
||||
<value>灵敏度</value>
|
||||
<data name=">>tabControl.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="emptyTank2Btn.Text" xml:space="preserve">
|
||||
<value>水箱 2</value>
|
||||
<data name=">>tabControl.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel1</value>
|
||||
</data>
|
||||
<data name="testGroupBox.Text" xml:space="preserve">
|
||||
<value>测试</value>
|
||||
<data name=">>tabControl.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="purgeGroupBox.Text" xml:space="preserve">
|
||||
<value>清除</value>
|
||||
<data name=">>mainSplitContainer.Panel1.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel1</value>
|
||||
</data>
|
||||
<data name="emptyGroupBox.Text" xml:space="preserve">
|
||||
<value>清空</value>
|
||||
<data name=">>mainSplitContainer.Panel1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="nextButton.Text" xml:space="preserve">
|
||||
<value>下一个</value>
|
||||
<data name=">>mainSplitContainer.Panel1.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name="otherGroupBox.Text" xml:space="preserve">
|
||||
<value>辅助的</value>
|
||||
<data name=">>mainSplitContainer.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="acceptResultsBtn.Text" xml:space="preserve">
|
||||
<value>接受</value>
|
||||
<data name="sharedButtons.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>-1, 0</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>结果</value>
|
||||
<data name="sharedButtons.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 636</value>
|
||||
</data>
|
||||
<data name="sharedButtons.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.Name" xml:space="preserve">
|
||||
<value>sharedButtons</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.Type" xml:space="preserve">
|
||||
<value>TBF.UiControls.SharedButtons, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel2</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel2</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="mainSplitContainer.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>863, 366</value>
|
||||
</data>
|
||||
<data name="mainSplitContainer.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<value>760</value>
|
||||
</data>
|
||||
<data name="mainSplitContainer.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>863, 366</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterParent</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Conditions</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>ConditionsDlg</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,21 +1,22 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2015 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.UiControls
|
||||
namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
interface IMetrologyDlgTab : ITabWithListViewEx
|
||||
interface IMetrologyDlgTab : TBF.UI.Shared.ITabWithListViewEx
|
||||
{
|
||||
/// <summary>
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
Config.Entities.Component MeterEntity { get; set; }
|
||||
Component MeterEntity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
IList<Config.Entities.MeasurementCorrection> ToBeRemoved { get; set; }
|
||||
IList<MeasurementCorrection> ToBeRemoved { get; set; }
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF
|
||||
namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
partial class MetrologyDlg
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace TBF
|
||||
{
|
||||
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.metrologyTabControl = new System.Windows.Forms.TabControl();
|
||||
this.sharedButtons = new TBF.UiControls.SharedButtons();
|
||||
this.sharedButtons = new TBF.UI.Shared.SharedButtons();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||
this.splitContainer.Panel1.SuspendLayout();
|
||||
this.splitContainer.Panel2.SuspendLayout();
|
||||
@@ -98,6 +98,6 @@ namespace TBF
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer;
|
||||
private System.Windows.Forms.TabControl metrologyTabControl;
|
||||
private UiControls.SharedButtons sharedButtons;
|
||||
private TBF.UI.Shared.SharedButtons sharedButtons;
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ using System.Windows.Forms;
|
||||
using NHibernate;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.UiControls;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
|
||||
namespace TBF
|
||||
namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
public partial class MetrologyDlg : Form, IParentOfListViewEx
|
||||
{
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2015 Senus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.UiControls
|
||||
namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
partial class MetrologyDlgBalanceTab
|
||||
{
|
||||
@@ -57,7 +57,7 @@ namespace TBF.UiControls
|
||||
this.measuredTextBox = new System.Windows.Forms.TextBox();
|
||||
this.correctedLabel = new System.Windows.Forms.Label();
|
||||
this.measuredLabel = new System.Windows.Forms.Label();
|
||||
this.listViewEx = new Results.Forms.ListViewEx();
|
||||
this.listViewEx = new global::Results.Forms.ListViewEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -369,7 +369,7 @@ namespace TBF.UiControls
|
||||
|
||||
private System.Windows.Forms.Label cmpntNameLabel;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private Results.Forms.ListViewEx listViewEx;
|
||||
private global::Results.Forms.ListViewEx listViewEx;
|
||||
private System.Windows.Forms.Label measuredLabel;
|
||||
private System.Windows.Forms.GroupBox testGroupBox;
|
||||
private System.Windows.Forms.TextBox correctedTextBox;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user