Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0468b5a1f5 | ||
|
|
fd6f305f95 |
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BADGER_MALA_TRAT;LANG_CS</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;BADGER_MALA_TRAT;LANG_CS</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-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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@ namespace Config.Mappings
|
||||
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")]
|
||||
|
||||
+5
-11
@@ -130,19 +130,13 @@ namespace Results
|
||||
|
||||
public static BatchResults FromBatch(Batch batch)
|
||||
{
|
||||
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return null;
|
||||
int wmCount = batch.WaterMeters.Count;
|
||||
if (wmCount == 0) return null;
|
||||
|
||||
int wmPosMax = 0;
|
||||
foreach (var wm in batch.WaterMeters) if (wm.WMPosition > wmPosMax) wmPosMax = wm.WMPosition;
|
||||
|
||||
BatchResults batchResults = new BatchResults(wmPosMax);
|
||||
BatchResults batchResults = new BatchResults(wmCount);
|
||||
batchResults.Batch = batch;
|
||||
batchResults.WaterMeters = new WaterMeter[wmPosMax];
|
||||
for (int i = 0; i < batch.WaterMeters.Count; i++)
|
||||
{
|
||||
WaterMeter wm = batch.WaterMeters[i];
|
||||
batchResults.WaterMeters[wm.WMPosition - 1] = wm;
|
||||
}
|
||||
batchResults.WaterMeters = new WaterMeter[wmCount];
|
||||
for (int i = 0; i < wmCount; i++) batchResults.WaterMeters[i] = batch.WaterMeters[i];
|
||||
|
||||
return batchResults;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,6 @@ namespace Results.Entities
|
||||
public virtual double TargetTime() { return TestData.TargetTime; }
|
||||
public virtual string Method() { return TestData.Method; }
|
||||
public virtual string RefFlowmeter() { return (Components != null) ? Components.Flowmeter : string.Empty; }
|
||||
public virtual string Scale() { return (Components != null) ? Components.Scale : string.Empty; }
|
||||
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest")) : true; }
|
||||
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")) : true; }
|
||||
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
|
||||
|
||||
@@ -126,9 +126,12 @@ namespace Results.Forms
|
||||
int displayedControlsCount = 0;
|
||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||
{
|
||||
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||
if (results.WaterMeters[i] != null)
|
||||
{
|
||||
displayedControlsCount++;
|
||||
if (ShowDisabledPositions || !results.WaterMeters[i].Disabled)
|
||||
{
|
||||
displayedControlsCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,23 +170,16 @@ namespace Results.Forms
|
||||
firstEnabledControl = null;
|
||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||
{
|
||||
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||
if (results.WaterMeters[i] != null)
|
||||
{
|
||||
/// Create one water meter position / control
|
||||
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
|
||||
? new OneWMResultsRowsCtrl() as IOneWMResultsCtrl
|
||||
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
|
||||
wmRsltsCtrl[ix].Width = oneWidth;
|
||||
wmRsltsCtrl[ix].Height = oneHeight;
|
||||
|
||||
if ((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
|
||||
if (!results.WaterMeters[i].Disabled || ShowDisabledPositions)
|
||||
{
|
||||
if ((firstEnabledControl == null) && (results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
|
||||
{
|
||||
firstEnabledControl = wmRsltsCtrl[ix];
|
||||
}
|
||||
|
||||
//wmRsltsCtrl[ix].Update(results.WaterMeters[i].WMPosition);
|
||||
/// Create one water meter position / control
|
||||
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
|
||||
? new OneWMResultsRowsCtrl() as IOneWMResultsCtrl
|
||||
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
|
||||
wmRsltsCtrl[ix].Width = oneWidth;
|
||||
wmRsltsCtrl[ix].Height = oneHeight;
|
||||
wmRsltsCtrl[ix].Update(Items);
|
||||
wmRsltsCtrl[ix].WMResultsClickedHandler += delegate(object s, Results.Forms.WaterMeterEventArgs args)
|
||||
{
|
||||
@@ -196,10 +192,11 @@ namespace Results.Forms
|
||||
OnDoubleClick(s, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
|
||||
ix++;
|
||||
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
|
||||
if ((firstEnabledControl == null) && !results.WaterMeters[i].Disabled) firstEnabledControl = wmRsltsCtrl[ix];
|
||||
ix++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,16 +206,16 @@ namespace Results.Forms
|
||||
}
|
||||
|
||||
|
||||
void UpdateResults(Results.BatchResults results)
|
||||
void UpdateResults(Results.BatchResults batchResults)
|
||||
{
|
||||
if ((results != null) && (results.WaterMeters != null))
|
||||
if ((batchResults != null) && (batchResults.WaterMeters != null))
|
||||
{
|
||||
int ctrlIx = 0;
|
||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||
for (int i = 0; i < batchResults.WaterMeters.Length; i++)
|
||||
{
|
||||
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||
if (!batchResults.WaterMeters[i].Disabled || ShowDisabledPositions)
|
||||
{
|
||||
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(results.WaterMeters[i]);
|
||||
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(batchResults.WaterMeters[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,11 +90,11 @@ namespace Results.Forms
|
||||
#endif
|
||||
|
||||
/// Header
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
int col = 1;
|
||||
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
||||
{
|
||||
lView.Columns.Add(str, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||
lView.Columns.Add(str, (columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||
col++;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ namespace Results.Forms
|
||||
|
||||
/// Always draw ListView header
|
||||
lView.Columns.Clear();
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
|
||||
if (items == null || items.Count == 0) return;
|
||||
int col = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
lView.Columns.Add(item.Caption, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||
lView.Columns.Add(item.Caption, (columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||
col++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,19 +318,6 @@ namespace Results
|
||||
TimeBtwnMassMsrmnts, /// 270
|
||||
TestTimeCorrection, /// 271
|
||||
|
||||
ThreeState, /// 272
|
||||
|
||||
Conduct, /// 273
|
||||
Conduct_start, /// 274
|
||||
Conduct_end, /// 275
|
||||
Conduct_avg, /// 276
|
||||
Conduct_min, /// 277
|
||||
Conduct_max, /// 278
|
||||
|
||||
InfoFlags, /// 279
|
||||
|
||||
Scale, /// 280
|
||||
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
@@ -12,6 +12,7 @@ namespace Results.Mappings
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.CompoundMeterId);
|
||||
Map(x => x.RegReaderType);
|
||||
Map(x => x.PulsesMeter);
|
||||
Map(x => x.PulsesMaster);
|
||||
Map(x => x.PulsesPerLiter);
|
||||
|
||||
@@ -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;
|
||||
@@ -16,6 +16,7 @@ namespace Results.Mappings
|
||||
References<Components>(x => x.Components);
|
||||
Map(x => x.Part);
|
||||
Map(x => x.RepetitionNr);
|
||||
Map(x => x.MethodClass);
|
||||
|
||||
Map(x => x.TestDone);
|
||||
Map(x => x.Remark)
|
||||
@@ -24,9 +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.ConstMaster);
|
||||
Map(x => x.ConstMasterRaw);
|
||||
Map(x => x.ConstMasterCorr);
|
||||
Map(x => x.ConstMaster);
|
||||
Map(x => x.MassStartRaw);
|
||||
Map(x => x.MassStart);
|
||||
Map(x => x.MassEndRaw);
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace Results.Mappings
|
||||
Map(x => x.MetrologicalClassAux);
|
||||
Map(x => x.ApprovalInfoAux);
|
||||
|
||||
Map(x => x.Medium);
|
||||
|
||||
Map(x => x.Text1);
|
||||
Map(x => x.Text2);
|
||||
Map(x => x.Text3);
|
||||
|
||||
@@ -13,25 +13,17 @@ namespace Results.Output
|
||||
{
|
||||
public static Chart GetChart(WaterMeter wm, bool isPrinter)
|
||||
{
|
||||
return GetChart(wm, isPrinter, Config.Unit.lph);
|
||||
return GetChart(wm, isPrinter, Config.Unit.lph, false);
|
||||
}
|
||||
|
||||
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit)
|
||||
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit, bool isQ4)
|
||||
{
|
||||
double maxFlow_m3h = 0;
|
||||
IList<PointF> unsortedPoints = new List<PointF>();
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
|
||||
{
|
||||
double flow_m3h = (mtr.TestTime != 0)
|
||||
? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestTime * mtr.PulsesMaster / mtr.TestRslt.PulsesMaster)
|
||||
: (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
|
||||
|
||||
if (flow_m3h > maxFlow_m3h) maxFlow_m3h = flow_m3h;
|
||||
|
||||
double flow = Config.Units.ConvertTo(flowUnit, flow_m3h); /// Convert to specified units
|
||||
|
||||
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));
|
||||
@@ -40,8 +32,6 @@ namespace Results.Output
|
||||
}
|
||||
IEnumerable<PointF> sortedPoints = unsortedPoints.OrderBy(x => x.X);
|
||||
|
||||
bool isQ4 = (maxFlow_m3h > 1.1 * wm.WaterMeterData.Q3_Qn);
|
||||
|
||||
Chart chart = new Chart
|
||||
{
|
||||
Name = "chart",
|
||||
|
||||
@@ -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.1290.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1290.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;BADGER_MALA_TRAT;LANG_CS</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;BADGER_MALA_TRAT;LANG_CS</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -325,7 +325,6 @@ namespace Results
|
||||
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Scale, "Scale", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Scale()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
|
||||
|
||||
///
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BADGER_MALA_TRAT;LANG_CS</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;BADGER_MALA_TRAT;LANG_CS</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -471,20 +471,17 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
///
|
||||
void UpdateExclamation(int uiCtrlPos) /// uiCtrlPos = 0 .. TextBoxesCount-1
|
||||
{
|
||||
if ((mode == Tst.End) || (mode == Tst.Both))
|
||||
{
|
||||
try
|
||||
{
|
||||
double startVolumeLtr = Utils.ParseUDouble(startTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
||||
double endVolumeLtr = Utils.ParseUDouble(endTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
||||
double err = 100.0 * (endVolumeLtr - startVolumeLtr - refVolume) / refVolume;
|
||||
exclamations[uiCtrlPos].Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
catch
|
||||
{
|
||||
exclamations[uiCtrlPos].Visible = false;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
double startVolumeLtr = Utils.ParseUDouble(startTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
||||
double endVolumeLtr = Utils.ParseUDouble(endTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
||||
double err = 100.0 * (endVolumeLtr - startVolumeLtr - refVolume) / refVolume;
|
||||
exclamations[uiCtrlPos].Visible = (err < warningLimLo) || (err > warningLimHi);
|
||||
}
|
||||
catch
|
||||
{
|
||||
exclamations[uiCtrlPos].Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Text;
|
||||
@@ -43,9 +43,7 @@ namespace TBF.BenchControl.Elde
|
||||
public StatusP StatusP { get { return controlCom.StatusP; } }
|
||||
public int EtPulses(int wmNr1) { return controlCom.EtPulses(wmNr1); }
|
||||
public int EtPulsesK { get { return controlCom.EtPulsesK; } }
|
||||
public int EtPulses2 { get { return controlCom.EtPulses2; } } /// DEWA_300: pulses from I12
|
||||
public int EtPulses3 { get { return controlCom.EtPulses3; } } /// DEWA_300: pulses from I13
|
||||
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
|
||||
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
|
||||
public int WMeterReference(int wmNr0) { return controlCom.WMeterReference(wmNr0); }
|
||||
public uint RegulValveDAC(int rvNr0) { return controlCom.RegulValveDAC(rvNr0); }
|
||||
public float Pressure(int prsNr0) { return controlCom.Pressure(prsNr0); }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -28,8 +28,6 @@ namespace TBF.BenchControl.Elde
|
||||
}
|
||||
|
||||
public int EtPulsesK { get { return 1; } }
|
||||
public int EtPulses2 { get { return 0; } }
|
||||
public int EtPulses3 { get { return 0; } }
|
||||
|
||||
double[] errFactor = new double[Config.Data.WMsCount + 1]; /// Internal
|
||||
double[] wMeterPulsesF = new double[Config.Data.WMsCount + 1]; /// Internal
|
||||
|
||||
@@ -50,13 +50,6 @@ namespace TBF.BenchControl.Elde
|
||||
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
|
||||
#endif
|
||||
|
||||
#if DEWA_300
|
||||
public int EtPulses2 { get { return (int)ctrlBrdComponent.EtPulses2; } }
|
||||
public int EtPulses3 { get { return (int)ctrlBrdComponent.EtPulses3; } }
|
||||
#else
|
||||
public int EtPulses2 { get { return 0; } }
|
||||
public int EtPulses3 { get { return 0; } }
|
||||
#endif
|
||||
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
|
||||
public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; }
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
|
||||
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
||||
{
|
||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||
|
||||
/// Apply correction
|
||||
var rangeCorrections = new List<Config.Entities.MeasurementCorrection>();
|
||||
foreach (var corr in Corrections)
|
||||
|
||||
@@ -28,66 +28,22 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
|
||||
public double NominalFlow { get { return nominalFlow; } }
|
||||
public double LtrPerPulse { get { return ltrPerPulse; } }
|
||||
|
||||
double[] refFreq; /// 0..sum, 1..I11, 2..I12, 3..I13
|
||||
int[] refPulses;
|
||||
double[] refFreq;
|
||||
|
||||
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
||||
{
|
||||
log.DebugFormat("LtrPerPulseCorrected({0}, {1}) started", flow, rangeIx);
|
||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||
|
||||
refFreq[0] = controlBoard.ReferenceFreqs(0);
|
||||
refFreq[1] = controlBoard.ReferenceFreqs(1);
|
||||
refFreq[2] = controlBoard.ReferenceFreqs(2);
|
||||
refFreq[3] = controlBoard.ReferenceFreqs(3);
|
||||
log.DebugFormat("refFreq[] = ({0}, {1}, {2}, {3})", refFreq[0], refFreq[1], refFreq[2], refFreq[3]);
|
||||
|
||||
refFreq[1] = refFreq[0] - refFreq[2] - refFreq[3];
|
||||
|
||||
refPulses[0] = controlBoard.EtPulses(0);
|
||||
refPulses[2] = controlBoard.EtPulses2;
|
||||
refPulses[3] = controlBoard.EtPulses3;
|
||||
refPulses[1] = refPulses[0] - refPulses[2] - refPulses[3];
|
||||
|
||||
log.DebugFormat("refPulses[] = ({0}, {1}, {2}, {3})", refPulses[0], refPulses[1], refPulses[2], refPulses[3]);
|
||||
|
||||
double flow1, flow2, flow3;
|
||||
double contribution1, contribution2, contribution3;
|
||||
if (refFreq[0] != 0)
|
||||
{
|
||||
double ltrPerPulseCorrected = 0;
|
||||
if (flowMeter1 != null)
|
||||
{
|
||||
double ratio = (double)refPulses[flowMeter1.Idx1] / (double)refPulses[0];
|
||||
flow1 = flow * ratio;
|
||||
contribution1 = flowMeter1.LtrPerPulseCorrected(flow1, rangeIx) * ratio;
|
||||
ltrPerPulseCorrected += contribution1;
|
||||
log.DebugFormat("flowmeter1 = {0}, flow1 = {1}, contribution1 = {2}", flowMeter1.Name, flow1, contribution1);
|
||||
}
|
||||
if (flowMeter2 != null)
|
||||
{
|
||||
double ratio = (double)refPulses[flowMeter2.Idx1] / (double)refPulses[0];
|
||||
flow2 = flow * ratio;
|
||||
contribution2 = flowMeter2.LtrPerPulseCorrected(flow2, rangeIx) * ratio;
|
||||
ltrPerPulseCorrected += contribution2;
|
||||
log.DebugFormat("flowmeter2 = {0}, flow2 = {1}, contribution2 = {2}", flowMeter2.Name, flow2, contribution2);
|
||||
}
|
||||
if (flowMeter3 != null)
|
||||
{
|
||||
double ratio = (double)refPulses[flowMeter3.Idx1] / (double)refPulses[0];
|
||||
flow3 = flow * ratio;
|
||||
contribution3 = flowMeter3.LtrPerPulseCorrected(flow3, rangeIx) * ratio;
|
||||
ltrPerPulseCorrected += contribution3;
|
||||
log.DebugFormat("flowmeter3 = {0}, flow3 = {1}, contribution3 = {2}", flowMeter3.Name, flow3, contribution3);
|
||||
}
|
||||
|
||||
log.DebugFormat("LtrPerPulseCorrected() returns {0}", ltrPerPulseCorrected);
|
||||
return ltrPerPulseCorrected;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.DebugFormat("LtrPerPulseCorrected() returns 1");
|
||||
return 1;
|
||||
}
|
||||
double ltrPerPulseCorrected = 0;
|
||||
if (flowMeter1 != null) ltrPerPulseCorrected += refFreq[1] * flowMeter1.LtrPerPulseCorrected(flow * refFreq[1] / refFreq[0], rangeIx);
|
||||
if (flowMeter2 != null) ltrPerPulseCorrected += refFreq[2] * flowMeter2.LtrPerPulseCorrected(flow * refFreq[2] / refFreq[0], rangeIx);
|
||||
if (flowMeter3 != null) ltrPerPulseCorrected += refFreq[3] * flowMeter3.LtrPerPulseCorrected(flow * refFreq[3] / refFreq[0], rangeIx);
|
||||
return ltrPerPulseCorrected / refFreq[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -100,9 +56,7 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
|
||||
|
||||
public FlowMeter()
|
||||
{
|
||||
refFreq = new double[4];
|
||||
refPulses = new int[4];
|
||||
}
|
||||
}
|
||||
|
||||
public FlowMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
@@ -126,7 +80,6 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
|
||||
ltrPerPulse = nominalFlow / (flowMetersCount * 7200.0); /// Nominal freq. is flowMetersCount * 2000 Hz (2000, 4000 or 6000 Hz)
|
||||
|
||||
refFreq = new double[4];
|
||||
refPulses = new int[4];
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace TBF.BenchControl.Elde.FlowMeterTriplet
|
||||
|
||||
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
||||
{
|
||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||
|
||||
/// Apply correction
|
||||
double correctedFlow = Config.Formulas.CorrectedValue(flow, Corrections);
|
||||
return (LtrPerPulse * correctedFlow / flow);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using Dirichlet.Numerics;
|
||||
@@ -11,9 +11,7 @@ namespace TBF.BenchControl.Elde
|
||||
StatusP StatusP { get; }
|
||||
int EtPulses(int wmNr1);
|
||||
int EtPulsesK { get; }
|
||||
int EtPulses2 { get; }
|
||||
int EtPulses3 { get; }
|
||||
UInt16 WMeterPulses(int wmNr1);
|
||||
UInt16 WMeterPulses(int wmNr1);
|
||||
int WMeterReference(int wmNr0);
|
||||
uint RegulValveDAC(int rvNr0);
|
||||
float Pressure(int prsNr0);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -32,9 +32,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
this.GetType().Namespace.Substring(17),
|
||||
CameraCfg.Name,
|
||||
CameraCfg.HardwareAddress,
|
||||
CameraCfg.DebugLevel == DebugMode.Simulate ? "simulated" : ((ipAddress == null) ? "not detected" : ipAddress.ToString()),
|
||||
CameraCfg.DebugLevel == DebugMode.Simulate ? "simulated" : (string.IsNullOrEmpty(cpuSerialNr) ? "not detected" : cpuSerialNr),
|
||||
CameraCfg.DebugLevel == DebugMode.Simulate ? "simulated" : (string.IsNullOrEmpty(sdCardVer) ? "not detected" : sdCardVer));
|
||||
ipAddress == null ? "not detected" : ipAddress.ToString(),
|
||||
string.IsNullOrEmpty(cpuSerialNr) ? "not detected" : cpuSerialNr,
|
||||
string.IsNullOrEmpty(sdCardVer) ? "not detected" : sdCardVer);
|
||||
}
|
||||
|
||||
|
||||
@@ -161,16 +161,13 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
{
|
||||
cameraIdx = GetCameraIdx();
|
||||
|
||||
if (CameraCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n {1} si simulated", Name, CameraCfg.HardwareAddress));
|
||||
return;
|
||||
}
|
||||
if (CameraCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
|
||||
/// Detect a camera
|
||||
bool cameraDetected = DetectCamera(CameraCfg.HardwareAddress % 100, ref ipAddress, true,
|
||||
out cpuHardware, out cpuRevision, out cpuSerialNr, out sdCardVer);
|
||||
|
||||
|
||||
if (CameraCfg.DebugLevel == DebugMode.AutoDetect)
|
||||
{
|
||||
CameraCfg.DebugLevel = cameraDetected ? DebugMode.DetectedOn : DebugMode.DetectedOff;
|
||||
@@ -222,55 +219,46 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
|
||||
public void StopDevice()
|
||||
{
|
||||
if ((CameraCfg.DebugLevel != DebugMode.Simulate) && (CameraCfg.DebugLevel != DebugMode.DetectedOff))
|
||||
{
|
||||
running = false;
|
||||
running = false;
|
||||
|
||||
stopScpThreadFlag = true;
|
||||
stopRtpListenerFlag = true;
|
||||
stopMsrmntListenerFlag = true;
|
||||
stopScpThreadFlag = true;
|
||||
stopRtpListenerFlag = true;
|
||||
stopMsrmntListenerFlag = true;
|
||||
|
||||
if (Telnet != null)
|
||||
{
|
||||
Telnet.Dispose();
|
||||
Telnet = null;
|
||||
}
|
||||
}
|
||||
if (Telnet != null)
|
||||
{
|
||||
Telnet.Dispose();
|
||||
Telnet = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void StopDevice2()
|
||||
{
|
||||
if ((CameraCfg.DebugLevel != DebugMode.Simulate) && (CameraCfg.DebugLevel != DebugMode.DetectedOff))
|
||||
{
|
||||
if (scpThread != null) scpThread.Join(50);
|
||||
if (rtpListenerThread != null) rtpListenerThread.Join(50);
|
||||
if (msrmntListenerThread != null) msrmntListenerThread.Join(50);
|
||||
if (scpThread != null) scpThread.Join(50);
|
||||
if (rtpListenerThread != null) rtpListenerThread.Join(50);
|
||||
if (msrmntListenerThread != null) msrmntListenerThread.Join(50);
|
||||
|
||||
if (rtpUdpClient != null)
|
||||
{
|
||||
rtpUdpClient.Close();
|
||||
rtpUdpClient = null;
|
||||
}
|
||||
if (rtpUdpClient != null)
|
||||
{
|
||||
rtpUdpClient.Close();
|
||||
rtpUdpClient = null;
|
||||
}
|
||||
|
||||
if (msrmntUdpClient != null)
|
||||
{
|
||||
msrmntUdpClient.Close();
|
||||
msrmntUdpClient = null;
|
||||
}
|
||||
}
|
||||
if (msrmntUdpClient != null)
|
||||
{
|
||||
msrmntUdpClient.Close();
|
||||
msrmntUdpClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
if ((CameraCfg.DebugLevel != DebugMode.Simulate) && (CameraCfg.DebugLevel != DebugMode.DetectedOff))
|
||||
{
|
||||
if (sha1sumResponse != null && !sha1sumResponseProcessed)
|
||||
{
|
||||
scpThread = new Thread(new ThreadStart(ScpWorker));
|
||||
scpThread.Start();
|
||||
|
||||
sha1sumResponseProcessed = true;
|
||||
}
|
||||
if (sha1sumResponse != null && !sha1sumResponseProcessed)
|
||||
{
|
||||
scpThread = new Thread(new ThreadStart(ScpWorker));
|
||||
scpThread.Start();
|
||||
|
||||
sha1sumResponseProcessed = true;
|
||||
}
|
||||
}
|
||||
public void RunDeviceAfter() { }
|
||||
|
||||
@@ -50,13 +50,10 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
grabImageCommandSent = false;
|
||||
transferringGrabbedImage = false;
|
||||
|
||||
if (camera.DebugLevel == DebugMode.Normal || camera.DebugLevel == DebugMode.DetectedOn)
|
||||
{
|
||||
telnet.promptReceivedHandler += delegate(object sndr, PromptReceivedEventArgs a)
|
||||
{
|
||||
OnPromptReceived(sndr, a);
|
||||
};
|
||||
}
|
||||
telnet.promptReceivedHandler += delegate(object sndr, PromptReceivedEventArgs a)
|
||||
{
|
||||
OnPromptReceived(sndr, a);
|
||||
};
|
||||
}
|
||||
|
||||
void OnPromptReceived(object sndr, PromptReceivedEventArgs a)
|
||||
@@ -68,58 +65,33 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate) return;
|
||||
|
||||
grabImageCommandSent = false;
|
||||
transferringGrabbedImage = false;
|
||||
|
||||
if ((imgFileNames != null) && (imgFileNames.Length > 0) && File.Exists(imgFileNames[0]))
|
||||
{
|
||||
///
|
||||
/// An image specified, (1) delete previous image, (2) check if this is a simulation
|
||||
///
|
||||
File.Delete(imgFileNames[0]);
|
||||
|
||||
if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate || camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.DetectedOff)
|
||||
{
|
||||
///
|
||||
/// Camera is in simulation mode => create a simulated image
|
||||
///
|
||||
File.Copy(string.Format("{0}\\Pictures\\sample.jpg", Program.ExecutableDir), imgFileNames[0]);
|
||||
}
|
||||
}
|
||||
if (File.Exists(imgFileNames[0])) File.Delete(imgFileNames[0]);
|
||||
}
|
||||
|
||||
public Event Run()
|
||||
{
|
||||
if ((imgFileNames == null) || (imgFileNames.Length < 1) || (imgFileNames[0] == null))
|
||||
if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate) return Event.None;
|
||||
|
||||
if (imgFileNames.Length < 1 || imgFileNames[0] == null)
|
||||
{
|
||||
///
|
||||
/// No images to be grabbed => Done
|
||||
///
|
||||
return Event.GrabPassed;
|
||||
return Event.GrabPassed;
|
||||
}
|
||||
else if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate ||
|
||||
camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.DetectedOff)
|
||||
{
|
||||
///
|
||||
/// Camera is in simulation mode => create a simulated image and complete
|
||||
///
|
||||
return Event.GrabPassed;
|
||||
}
|
||||
else if (!grabImageCommandSent)
|
||||
else if (!grabImageCommandSent)
|
||||
{
|
||||
///
|
||||
/// Normal operation, no command sent yet => (1) wait until telnet state = Inactive, (2) send a command
|
||||
///
|
||||
if (camera.Running && (telnet.State == TelnetClient.TelnetState.Inactive))
|
||||
{
|
||||
///
|
||||
/// State variables
|
||||
///
|
||||
//
|
||||
// State variables
|
||||
//
|
||||
response = null;
|
||||
|
||||
///
|
||||
/// Prepare a command
|
||||
///
|
||||
//
|
||||
// Prepare command
|
||||
//
|
||||
int rotation = 0;
|
||||
if (imageRotation == ImageRotation.Deg90)
|
||||
rotation = 90;
|
||||
@@ -147,10 +119,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
}
|
||||
else if (grabPassed)
|
||||
{
|
||||
///
|
||||
/// Normal operation, grab passed => transfer/transferring the image
|
||||
///
|
||||
if (transferringGrabbedImage)
|
||||
if (transferringGrabbedImage)
|
||||
{
|
||||
/// Grab passed and image transfer is in progress
|
||||
return Event.GrabPassed;
|
||||
@@ -169,17 +138,12 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
||||
}
|
||||
else if (grabFailed)
|
||||
{
|
||||
///
|
||||
/// Normal operation, grab failed => there in no image to transfer
|
||||
///
|
||||
/// Grab failed, there in no image to transfer
|
||||
return Event.GrabFailed;
|
||||
}
|
||||
else if (response != null)
|
||||
{
|
||||
///
|
||||
/// Normal operation
|
||||
///
|
||||
if (response.Contains("completed"))
|
||||
if (response.Contains("completed"))
|
||||
{
|
||||
grabPassed = true;
|
||||
|
||||
|
||||
@@ -127,11 +127,17 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
|
||||
|
||||
public IOperation GrabImageOp(string imageFileName)
|
||||
{
|
||||
return GrabImageOp(imageFileName, roiCfg.BlackAndWhite, roiCfg.LowResolution, roiCfg.ImageRotation);
|
||||
if (NetCamera != null)
|
||||
{
|
||||
/// TODO: Implement support for sharing one camera by multiple ROI-s
|
||||
return NetCamera.GrabImagesOp(new string[] { imageFileName }, roiCfg.BlackAndWhite, roiCfg.LowResolution, roiCfg.ImageRotation);
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOperation GrabImageOp(string imageFileName,
|
||||
bool blackAndWhite, bool lowResolution, Config.Entities.ImageRotation imageRotation)
|
||||
public IOperation GrabImageOp(string imageFileName, bool blackAndWhite,
|
||||
bool lowResolution, Config.Entities.ImageRotation imageRotation)
|
||||
{
|
||||
if (NetCamera != null)
|
||||
{
|
||||
|
||||
@@ -149,11 +149,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
state = State.Idle;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateProcessData(temperature, pressure, humidity);
|
||||
|
||||
log.InfoFormat("Ambient: temperature = {0:F1} C, humidity = {1:F1} %, pressure = {2:F0} mbar", temperature, humidity, 1000 * pressure);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugLevel = DebugMode.FailureDuringOperation;
|
||||
@@ -224,13 +220,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
|
||||
|
||||
public void StopDevice2() { }
|
||||
|
||||
void UpdateProcessData(float temperature, float pressure, float humidity)
|
||||
{
|
||||
TBF.BenchControl.Sequences.ProcessData.AmbTemp.Val = temperature;
|
||||
TBF.BenchControl.Sequences.ProcessData.AmbPress.Val = pressure;
|
||||
TBF.BenchControl.Sequences.ProcessData.AmbHumi.Val = humidity;
|
||||
}
|
||||
|
||||
///
|
||||
/// Boxes for the operation result
|
||||
///
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
/// <param name="wmTypeId">Water meter type Id</param>
|
||||
/// <param name="wmTypeRevision">Water meter type revision</param>
|
||||
/// <returns>SensusTestInfos array</returns>
|
||||
public static IList<SensusTestInfo> GetOracleTestInfo(OracleConnection conn, int wmTypeId, out int wmTypeRevision, out string wzTyp, out string metrolKlasse, out string zulasszeichen, out string materialNr, out double q3, out DateTime timeStamp, out string remark)
|
||||
IList<SensusTestInfo> GetOracleTestInfo(OracleConnection conn, int wmTypeId, out int wmTypeRevision)
|
||||
{
|
||||
///
|
||||
/// Read 'incomplete' TestInfo from Oracle database containing only flowId-s ad qBezeichnung-s
|
||||
@@ -147,15 +147,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
/// For a given 'wmTypeId' find the most recent active 'wmTypeRevision'
|
||||
///
|
||||
wmTypeRevision = -1;
|
||||
wzTyp = string.Empty;
|
||||
metrolKlasse = string.Empty;
|
||||
zulasszeichen = string.Empty;
|
||||
materialNr = string.Empty;
|
||||
q3 = 0;
|
||||
timeStamp = DateTime.MinValue;
|
||||
remark = string.Empty;
|
||||
|
||||
OracleCommand cmd = new OracleCommand("select REV_WZTYP, WZTYP, METROLKLASSE, ZULASSZEICHEN, MATERIALNR, QMAX, AENDERUNGSDATUM, BEMERKUNG from VT_WZTYP_SD where ANBID=4 and ID_WZTyp=:1 and AKTIV=:2", conn);
|
||||
OracleCommand cmd = new OracleCommand("select REV_WZTYP from VT_WZTYP_SD where ANBID=4 and ID_WZTyp=:1 and AKTIV=:2", conn);
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 1 }); ///:2
|
||||
///
|
||||
@@ -163,19 +155,12 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
while (dr.Read())
|
||||
{
|
||||
wmTypeRevision = dr.GetInt32(0);
|
||||
wzTyp = dr.GetString(1);
|
||||
metrolKlasse = dr.GetString(2);
|
||||
zulasszeichen = dr.GetString(3);
|
||||
materialNr = dr.GetString(4);
|
||||
q3 = dr.GetDouble(5);
|
||||
timeStamp = dr.GetDateTime(6);
|
||||
remark = dr.GetString(7);
|
||||
}
|
||||
dr.Close();
|
||||
|
||||
if (wmTypeRevision == -1) return null; /// No 'wmTypeRevision' found
|
||||
|
||||
cmd = new OracleCommand("select PRUEFUNGSNR, Q_SOLL, PRUEFZEIT, POSFEHLERKALT, NEGFEHLERKALT, PRUEFBEREICHMIN, PRUEFBEREICHMAX, QBEZEICHNUNG from VT_PRUEFPUNKT_SOLL_SD where ANBID=4 and ID_WZTyp=:1 and Rev_WZTyp=:2", conn);
|
||||
cmd = new OracleCommand("select PruefungsNr, PosFehlerKalt, QBezeichnung from VT_PRUEFPUNKT_SOLL_SD where ANBID=4 and ID_WZTyp=:1 and Rev_WZTyp=:2", conn);
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:2
|
||||
///
|
||||
@@ -183,19 +168,9 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
while (dr.Read())
|
||||
{
|
||||
int pruefungsNr = dr.GetInt32(0);
|
||||
double flow = Config.Units.ConvertFrom(Unit.lph, dr.GetDouble(1));
|
||||
int testTime = dr.GetInt32(2);
|
||||
double errLimHi = dr.GetDouble(3);
|
||||
double errLimLo = dr.GetDouble(4);
|
||||
int flowRangeMin = dr.GetInt32(5);
|
||||
int flowRangeMax = dr.GetInt32(6);
|
||||
string qBezeichnung = dr.GetString(7);
|
||||
|
||||
Range rng = (flowRangeMin == 90 && flowRangeMax == 100) ? Range.R90_100 :
|
||||
((flowRangeMin == 95 && flowRangeMax == 105) ? Range.R95_105 :
|
||||
((flowRangeMin == 100 && flowRangeMax == 110) ? Range.R100_110 : Range.Undefined));
|
||||
|
||||
oraDbTinfos.Add(new SensusTestInfo(pruefungsNr, qBezeichnung, flow, testTime, errLimLo, errLimHi, rng));
|
||||
double errLimHi = dr.GetDouble(1);
|
||||
string qBezeichnung = dr.GetString(2);
|
||||
oraDbTinfos.Add(new SensusTestInfo(null, pruefungsNr, qBezeichnung, 0, null, 0, null, Range.Undefined));
|
||||
}
|
||||
dr.Close();
|
||||
|
||||
@@ -381,14 +356,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
/// Currnet test info. is not walid => Get a new one from Oracle and SensusTestInfo table
|
||||
///
|
||||
int wmTR;
|
||||
string wzTypStr;
|
||||
string metroKlasse;
|
||||
string zulasszeichen;
|
||||
string materialNr;
|
||||
double q3 = 0;
|
||||
DateTime timeStamp;
|
||||
string remark;
|
||||
IList<SensusTestInfo> rti = GetOracleTestInfo(conn, wm.WaterMeterData.WMTypeId, out wmTR, out wzTypStr, out metroKlasse, out zulasszeichen, out materialNr, out q3, out timeStamp, out remark);
|
||||
IList<SensusTestInfo> rti = GetOracleTestInfo(conn, wm.WaterMeterData.WMTypeId, out wmTR);
|
||||
|
||||
if (rti != null)
|
||||
{
|
||||
@@ -753,14 +721,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
if ((oracleTestInfo == null) || (wmTypeId != b.WaterMeters[0].WaterMeterData.WMTypeId) || (wmTypeRevision == 0) || (procedureSignature != procedureSignatureSB.ToString()))
|
||||
{
|
||||
int wmTR = 0;
|
||||
string wzTypStr;
|
||||
string metroKlasse;
|
||||
string zulasszeichen;
|
||||
string materialNr;
|
||||
double q3 = 0;
|
||||
DateTime timeStamp;
|
||||
string remark;
|
||||
IList<SensusTestInfo> ti = GetOracleTestInfo(conn, b.WaterMeters[0].WaterMeterData.WMTypeId, out wmTR, out wzTypStr, out metroKlasse, out zulasszeichen, out materialNr, out q3, out timeStamp, out remark);
|
||||
IList<SensusTestInfo> ti = GetOracleTestInfo(conn, b.WaterMeters[0].WaterMeterData.WMTypeId, out wmTR);
|
||||
|
||||
if (ti != null)
|
||||
{
|
||||
|
||||
@@ -49,13 +49,6 @@ namespace TBF.BenchControl.Output
|
||||
public string QBezeichnungLog; /// Flow name in Oracle database
|
||||
public Range Range; /// Range.R90_100 or Range.R100_110 (flow range in % of a target flow)
|
||||
|
||||
public double Flow;
|
||||
public int TestTime;
|
||||
public double ErrLimLoFromDB;
|
||||
public double ErrLimHiFromDB;
|
||||
public double Uncertainty;
|
||||
public string TestMethod;
|
||||
|
||||
public SensusTestInfo(string tstName, int pnDB, string qbDB, int pnOpto, string qbOpto, int pnLog, string qbLog, Range range)
|
||||
{
|
||||
TestName = tstName;
|
||||
@@ -66,30 +59,6 @@ namespace TBF.BenchControl.Output
|
||||
PruefungsNrLog = pnLog;
|
||||
QBezeichnungLog = qbLog;
|
||||
Range = range;
|
||||
Flow = 0;
|
||||
TestTime = 0;
|
||||
ErrLimLoFromDB = 0;
|
||||
ErrLimHiFromDB = 0;
|
||||
Uncertainty = 0;
|
||||
TestMethod = string.Empty;
|
||||
}
|
||||
|
||||
public SensusTestInfo(int pnDB, string qbDB, double flow, int testTime, double errLimLo, double errLimHi, Range range)
|
||||
{
|
||||
TestName = null;
|
||||
PruefungsNrDB = pnDB;
|
||||
QBezeichnungDB = qbDB;
|
||||
PruefungsNrOpto = 0;
|
||||
QBezeichnungOpto = null;
|
||||
PruefungsNrLog = 0;
|
||||
QBezeichnungLog = null;
|
||||
Range = range;
|
||||
Flow = flow;
|
||||
TestTime = testTime;
|
||||
ErrLimLoFromDB = errLimLo;
|
||||
ErrLimHiFromDB = errLimHi;
|
||||
Uncertainty = 0;
|
||||
TestMethod = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -488,10 +488,7 @@ namespace TBF.BenchControl.Sequences
|
||||
Debug.WriteLine(string.Format("Procedure {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure) ? "initialized" : "NOT initialized"));
|
||||
Debug.WriteLine(string.Format("Procedure.MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.MoreParams) ? "initialized" : "NOT initialized"));
|
||||
Debug.WriteLine(string.Format("Procedure.Tests {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests) ? "initialized" : "NOT initialized"));
|
||||
if (StateMachine.Procedure.Tests.Count > 0)
|
||||
{
|
||||
Debug.WriteLine(string.Format("Procedure.Tests[0].MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests[0].MoreParams) ? "initialized" : "NOT initialized"));
|
||||
}
|
||||
Debug.WriteLine(string.Format("Procedure.Tests[0].MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests[0].MoreParams) ? "initialized" : "NOT initialized"));
|
||||
|
||||
UiBridge.Bridge.OnError(this, string.Empty); /// Clear an error message (if any)
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace TBF.BenchControl
|
||||
Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory());
|
||||
Factories.Add(new TestMethods.Counter.Factory());
|
||||
Factories.Add(new TestMethods.DiverterTest.Factory());
|
||||
Factories.Add(new TestMethods.Dummy.Factory());
|
||||
Factories.Add(new TestMethods.Endurance.Factory());
|
||||
Factories.Add(new TestMethods.FixedStart.Single.Factory());
|
||||
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.Dummy
|
||||
{
|
||||
public class DummySeq : Sequences.SequenceBase
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(DummySeq));
|
||||
|
||||
/// <summary>
|
||||
/// Adjustment method sequence
|
||||
/// </summary>
|
||||
/// <param name="test">Test entity</param>
|
||||
/// <returns>
|
||||
/// Event.Done . . . . . . . OK
|
||||
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
||||
/// Event.OpArgumentError . Target flow is out of range
|
||||
/// Event.Error . . . . . . Unspecified error
|
||||
/// </returns>
|
||||
public IList<Event> Execute(Test test, int repetitionNr, bool isLastRepetition, DebugMode mode)
|
||||
{
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
|
||||
/// Start the test, initialize test results
|
||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, heatMetersPath, 0));
|
||||
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
TestStartTime = DateTime.Now;
|
||||
|
||||
///
|
||||
/// Show a dialog with OK button and an appropriate message
|
||||
///
|
||||
Bridge.OnAdjustmentInProgress(this, new AdjustmentInProgressEventArgs(testName));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||
Bridge.OnActivity(this, test.Method);
|
||||
State.Create(string.Format("{0}({1}) : Dummy", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchWaitingOp)
|
||||
.AddOperation(new Operations.MessageBoxOp(string.Format("Dummy test {0}", test.Name)))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Test));
|
||||
|
||||
if (e.Contains(Event.Error)) goto stopTest;
|
||||
if (TestAndLogUiCmdStop(test, e)) goto stopTest;
|
||||
}
|
||||
while (!e.Contains(Event.OK));
|
||||
|
||||
return new List<Event> { Event.Done };
|
||||
|
||||
stopTest:
|
||||
return new List<Event> { Event.UiCmdStop };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.Configs.NameOnly;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.Dummy
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new TestMethod(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new TestMethod(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig()
|
||||
{
|
||||
return new TestMethodCfg(this.GetType().Namespace.Substring(29), this);
|
||||
}
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.Dummy
|
||||
{
|
||||
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
||||
public override string ToString() { return string.Format("TestMethods.ChangeFlowDirection({0})", Cfg.ToString(1)); }
|
||||
|
||||
public bool CanTest(MetersKind meters) { return true; }
|
||||
public bool DoTransitions() { return true; }
|
||||
|
||||
public TestMethod()
|
||||
{
|
||||
}
|
||||
|
||||
public TestMethod(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||
{
|
||||
return (new DummySeq()).Execute(test, repetNr, isLastRepetition, DebugLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
+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]
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 900 KiB |
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.1823.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1823.0")]
|
||||
[assembly: AssemblyVersion("2.24.1315.0")]
|
||||
[assembly: AssemblyFileVersion("2.24.1315.0")]
|
||||
|
||||
Generated
-18
@@ -1338,15 +1338,6 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Do you want to update 'Use wizard' tests ?.
|
||||
/// </summary>
|
||||
internal static string Do_you_want_to_update_tests_QM {
|
||||
get {
|
||||
return ResourceManager.GetString("Do_you_want_to_update_tests_QM", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Down.
|
||||
/// </summary>
|
||||
@@ -5562,15 +5553,6 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update.
|
||||
/// </summary>
|
||||
internal static string Update {
|
||||
get {
|
||||
return ResourceManager.GetString("Update", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Use {0}.
|
||||
/// </summary>
|
||||
|
||||
@@ -1488,10 +1488,4 @@
|
||||
<data name="Program_must_be_closed" xml:space="preserve">
|
||||
<value>Program musí být uzavřen.</value>
|
||||
</data>
|
||||
<data name="Do_you_want_to_update_tests_QM" xml:space="preserve">
|
||||
<value>Chcete modifikovat 'Use wizard' testy ?</value>
|
||||
</data>
|
||||
<data name="Update" xml:space="preserve">
|
||||
<value>Modifikovat</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2062,10 +2062,4 @@
|
||||
<data name="No_info_available" xml:space="preserve">
|
||||
<value>No info available</value>
|
||||
</data>
|
||||
<data name="Do_you_want_to_update_tests_QM" xml:space="preserve">
|
||||
<value>Do you want to update 'Use wizard' tests ?</value>
|
||||
</data>
|
||||
<data name="Update" xml:space="preserve">
|
||||
<value>Update</value>
|
||||
</data>
|
||||
</root>
|
||||
+24
-29
@@ -39,7 +39,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BADGER_MALA_TRAT;LANG_CS</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
@@ -49,7 +49,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;BADGER_MALA_TRAT;LANG_CS</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -58,7 +58,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;BADGER_MALA_TRAT;LANG_CS</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
@@ -67,7 +67,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;BADGER_MALA_TRAT;LANG_CS</DefineConstants>
|
||||
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -97,9 +97,8 @@
|
||||
<SignManifests>false</SignManifests>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ControlComponent3U, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\ControlBoard\Badger-mala-trat\ControlComponent3U.dll</HintPath>
|
||||
<Reference Include="ControlComponent3Munich">
|
||||
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
@@ -1121,9 +1120,6 @@
|
||||
<Compile Include="BenchControl\TestMethods\DiverterTest\TestMethodCfgCtrl.designer.cs">
|
||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\TestMethods\Dummy\DummySeq.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\Dummy\Factory.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\Dummy\TestMethod.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\Endurance\Component.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\Endurance\CycleStep.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\Endurance\EnduranceSeq.cs" />
|
||||
@@ -1991,6 +1987,12 @@
|
||||
<Compile Include="UI\Bench\Components\SelectComponentClassDlg.designer.cs">
|
||||
<DependentUpon>SelectComponentClassDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Conditions\ConditionsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Conditions\ConditionsDlg.designer.cs">
|
||||
<DependentUpon>ConditionsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Metrology\IMetrologyDlgTab.cs" />
|
||||
<Compile Include="UI\Bench\Metrology\MetrologyDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -2085,6 +2087,12 @@
|
||||
<Compile Include="UI\Bench\Transitions\VirtualBenchStepsCtrl.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Uncertainties\UncertaintiesDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Uncertainties\UncertaintiesDlg.designer.cs">
|
||||
<DependentUpon>UncertaintiesDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Camera\CameraPictureCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@@ -2168,12 +2176,6 @@
|
||||
<Compile Include="UI\Procedures\TestParamsCtrl.designer.cs">
|
||||
<DependentUpon>TestParamsCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\ConfirmUpdatingTests.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\ConfirmUpdatingTests.Designer.cs">
|
||||
<DependentUpon>ConfirmUpdatingTests.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\FlowSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -2192,12 +2194,6 @@
|
||||
<Compile Include="UI\Procedures\TestWizard\MethodSelection.designer.cs">
|
||||
<DependentUpon>MethodSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\OracleWZTypSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\OracleWZTypSelection.designer.cs">
|
||||
<DependentUpon>OracleWZTypSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\PressureSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -3026,6 +3022,9 @@
|
||||
<EmbeddedResource Include="UI\Bench\Components\SelectComponentClassDlg.resx">
|
||||
<DependentUpon>SelectComponentClassDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Bench\Conditions\ConditionsDlg.resx">
|
||||
<DependentUpon>ConditionsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlg.resx">
|
||||
<DependentUpon>MetrologyDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -3062,6 +3061,9 @@
|
||||
<EmbeddedResource Include="UI\Bench\Transitions\TransitionsDlg.resx">
|
||||
<DependentUpon>TransitionsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Bench\Uncertainties\UncertaintiesDlg.resx">
|
||||
<DependentUpon>UncertaintiesDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Camera\CameraPictureCtrl.resx">
|
||||
<DependentUpon>CameraPictureCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -3119,9 +3121,6 @@
|
||||
<EmbeddedResource Include="UI\Procedures\TestParamsCtrl.resx">
|
||||
<DependentUpon>TestParamsCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Procedures\TestWizard\ConfirmUpdatingTests.resx">
|
||||
<DependentUpon>ConfirmUpdatingTests.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Procedures\TestWizard\FlowSelection.resx">
|
||||
<DependentUpon>FlowSelection.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -3131,9 +3130,6 @@
|
||||
<EmbeddedResource Include="UI\Procedures\TestWizard\MethodSelection.resx">
|
||||
<DependentUpon>MethodSelection.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Procedures\TestWizard\OracleWZTypSelection.resx">
|
||||
<DependentUpon>OracleWZTypSelection.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Procedures\TestWizard\PressureSelection.resx">
|
||||
<DependentUpon>PressureSelection.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -3318,7 +3314,6 @@
|
||||
<Content Include="Pictures\reversed_dir_right.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Pictures\sample.bmp" />
|
||||
<Content Include="Resources\empty.png" />
|
||||
<Content Include="Resources\switch-off.png" />
|
||||
<Content Include="Resources\switch-on.png" />
|
||||
|
||||
+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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<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>
|
||||
<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>
|
||||
<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="tabControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="tabControl.ItemSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>58, 30</value>
|
||||
</data>
|
||||
<data name="tabControl.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="tabControl.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>760, 366</value>
|
||||
</data>
|
||||
<data name="tabControl.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>tabControl.Name" xml:space="preserve">
|
||||
<value>tabControl</value>
|
||||
</data>
|
||||
<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=">>tabControl.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel1</value>
|
||||
</data>
|
||||
<data name=">>tabControl.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel1.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel1</value>
|
||||
</data>
|
||||
<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=">>mainSplitContainer.Panel1.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="sharedButtons.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>-1, 0</value>
|
||||
</data>
|
||||
<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>
|
||||
@@ -0,0 +1,320 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using NHibernate;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
using TBF.UI.Bench.Metrology; /// TODO: Remove
|
||||
|
||||
namespace TBF.UI.Bench.Uncertainties
|
||||
{
|
||||
public partial class UncertaintiesDlg : Form, IParentOfListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(UncertaintiesDlg));
|
||||
|
||||
public IList<Component> cmpntEntities;
|
||||
|
||||
ISession session;
|
||||
|
||||
public UncertaintiesDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
/// SharedDlgButtons configuration
|
||||
#if KEMPNO_50
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.MetrologicalAuthority };
|
||||
#else
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.Metrologists };
|
||||
#endif
|
||||
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove;
|
||||
sharedButtons.Unlocked += unlockButton_Click;
|
||||
sharedButtons.OKClicked += okButton_Click;
|
||||
sharedButtons.CancelClicked += cancelButton_Click;
|
||||
sharedButtons.AddClicked += addButton_Click;
|
||||
sharedButtons.RemoveClicked += removeButton_Click;
|
||||
}
|
||||
|
||||
private void MetrologyDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadUISettings();
|
||||
|
||||
Text = Strings.Uncertainty;
|
||||
|
||||
int fixedCount = 0;
|
||||
int balancesCount = 0;
|
||||
int levelMetersCount = 0;
|
||||
int divertersCount = 0;
|
||||
int flowMetersCount = 0;
|
||||
int pressMetersCount = 0;
|
||||
int tempMetersCount = 0;
|
||||
int platinumTempMetersCount = 0;
|
||||
int evaporationsCount = 0;
|
||||
|
||||
session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
|
||||
cmpntEntities = session.QueryOver<Component>()
|
||||
.OrderBy(x => x. ItemNr).Asc
|
||||
.List();
|
||||
|
||||
// Density tab-page
|
||||
fixedCount++;
|
||||
TabPage dstyTabPage = new TabPage(" " + Strings.Density + " ");
|
||||
MetrologyDlgDensityTab uiCtl = new MetrologyDlgDensityTab();
|
||||
uiCtl.Dock = DockStyle.Fill;
|
||||
dstyTabPage.Tag = uiCtl;
|
||||
dstyTabPage.Controls.Add(uiCtl);
|
||||
metrologyTabControl.TabPages.Add(dstyTabPage);
|
||||
|
||||
foreach (var cmpnt in cmpntEntities)
|
||||
{
|
||||
BenchControl.Generic.IComponentFactory factory = TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName);
|
||||
|
||||
/// Tab-pages for scales
|
||||
if (factory is BenchControl.MettlerToledo.Standard.BalanceFactory ||
|
||||
factory is BenchControl.MettlerToledo.Standard.BalanceOldFactory ||
|
||||
factory is BenchControl.MettlerToledo.Standard.BalanceNewFactory ||
|
||||
factory is BenchControl.MettlerToledo.Multi.BalanceFactory)
|
||||
{
|
||||
balancesCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgBalanceTab uiControl = new MetrologyDlgBalanceTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.BalanceCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.IScaleCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
/// Tab-pages for flowmeters
|
||||
if (factory is BenchControl.Elde.FlowMeter.FlowMeterFactory)
|
||||
{
|
||||
BenchControl.Elde.FlowMeter.FlowMeterCfg flowMeterCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.Elde.FlowMeter.FlowMeterCfg;
|
||||
|
||||
for (int r = 0; r <= 5; r++)
|
||||
{
|
||||
if (flowMeterCfg.RangeEnabled(r))
|
||||
{
|
||||
flowMetersCount++;
|
||||
TabPage tabPage = new TabPage(string.Format(((r == 0) ? " {0} " : " {0} r{1} "), cmpnt.Name, r));
|
||||
MetrologyDlgFlowMeterTab uiControl = new MetrologyDlgFlowMeterTab(r);
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibRangesCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Tab-pages for pressure meters
|
||||
if (factory is BenchControl.Elde.PressureMeter.PressureMeterFactory ||
|
||||
factory is BenchControl.Elde.PressureMeterInternal.PressureMeterFactory ||
|
||||
factory is BenchControl.Modbus.PressureMeter.Meret.Factory)
|
||||
{
|
||||
pressMetersCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgPressMeterTab uiControl = new MetrologyDlgPressMeterTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
/// Tab-pages for temperature meters
|
||||
if (factory is BenchControl.Elde.TempMeter.TempMeterFactory ||
|
||||
factory is BenchControl.Elde.TempMeterInternal.TempMeterFactory)
|
||||
{
|
||||
tempMetersCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgTempMeterTab uiControl = new MetrologyDlgTempMeterTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
/// Tab-pages for platinum resistance temperature meters
|
||||
if (factory is BenchControl.Keithley.TempMeter.Factory)
|
||||
{
|
||||
platinumTempMetersCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgPlatinumResistanceTMeterTab uiControl = new MetrologyDlgPlatinumResistanceTMeterTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.TempMeterCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.Keithley.TempMeter.TempMeterCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
/// Tab-pages for diverters
|
||||
if (factory is BenchControl.Elde.Diverter.DiverterFactory)
|
||||
{
|
||||
divertersCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgDiverterTab uiControl = new MetrologyDlgDiverterTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
/// Tab-pages for level meters inside water tanks
|
||||
if (factory is BenchControl.Hart.Nivotrack.Factory)
|
||||
{
|
||||
levelMetersCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgLevelMeterTab uiControl = new MetrologyDlgLevelMeterTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
/// Tab-pages for water tank evaporation rates
|
||||
if (factory is BenchControl.Various.Evaporation.Factory)
|
||||
{
|
||||
evaporationsCount++;
|
||||
TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
|
||||
MetrologyDlgEvaporationTab uiControl = new MetrologyDlgEvaporationTab();
|
||||
uiControl.MeterEntity = cmpnt;
|
||||
uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg;
|
||||
uiControl.Dock = DockStyle.Fill;
|
||||
tabPage.Tag = uiControl;
|
||||
tabPage.Controls.Add(uiControl);
|
||||
metrologyTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void unlockButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (TabPage tabPage in metrologyTabControl.TabPages)
|
||||
{
|
||||
(tabPage.Tag as IMetrologyDlgTab).Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (ITransaction transaction = session.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (TabPage tabPage in metrologyTabControl.TabPages)
|
||||
{
|
||||
IMetrologyDlgTab tab = tabPage.Tag as IMetrologyDlgTab;
|
||||
tab.OkBtnClicked();
|
||||
|
||||
if (!(tabPage.Tag is MetrologyDlgDensityTab))
|
||||
{
|
||||
session.SaveOrUpdate(tab.MeterEntity);
|
||||
foreach (var entity in tab.ToBeRemoved) session.Delete(entity);
|
||||
}
|
||||
}
|
||||
transaction.Commit();
|
||||
session.Flush();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
transaction.Rollback();
|
||||
log.ErrorFormat("Cannot save changes to DB: {0}", exc.Message);
|
||||
MessageBox.Show(Strings.Cannot_save_changes, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
SaveUISettings();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (TabPage tabPage in metrologyTabControl.TabPages)
|
||||
{
|
||||
(tabPage.Tag as IMetrologyDlgTab).CancelBtnClicked();
|
||||
}
|
||||
|
||||
SaveUISettings();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void SaveUISettings()
|
||||
{
|
||||
/// Obtain UncertaintyDlg 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.UncertaintyDlgMaximized != isMaximized ||
|
||||
ls.UncertaintyDlgLeft != left ||
|
||||
ls.UncertaintyDlgTop != top ||
|
||||
ls.UncertaintyDlgWidth != width ||
|
||||
ls.UncertaintyDlgHeight != height))
|
||||
{
|
||||
/// At least one UncertaintyDlg dimension differs => Update local settings and save them
|
||||
ls.UncertaintyDlgMaximized = isMaximized;
|
||||
ls.UncertaintyDlgLeft = left;
|
||||
ls.UncertaintyDlgTop = top;
|
||||
ls.UncertaintyDlgWidth = width;
|
||||
ls.UncertaintyDlgHeight = height;
|
||||
ls.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadUISettings()
|
||||
{
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
WindowState = (ls.UncertaintyDlgMaximized ? FormWindowState.Maximized : FormWindowState.Normal);
|
||||
Width = (ls.UncertaintyDlgWidth > 0) ? ls.UncertaintyDlgWidth : 900;
|
||||
Height = (ls.UncertaintyDlgHeight > 0) ? ls.UncertaintyDlgHeight : 500;
|
||||
Left = (ls.UncertaintyDlgLeft != 0) ? ls.UncertaintyDlgLeft : 200;
|
||||
Top = (ls.UncertaintyDlgTop != 0) ? ls.UncertaintyDlgTop : 100;
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
(metrologyTabControl.SelectedTab.Tag as IMetrologyDlgTab).AddOne();
|
||||
}
|
||||
|
||||
private void removeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
(metrologyTabControl.SelectedTab.Tag as IMetrologyDlgTab).RemoveSelected();
|
||||
}
|
||||
|
||||
public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos)
|
||||
{
|
||||
if (selectedItemPos == SharedButtons.SelectedItemPos.None)
|
||||
{
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
|
||||
}
|
||||
else
|
||||
{
|
||||
sharedButtons.EnableButtons(SharedButtons.Buttons.Remove);
|
||||
}
|
||||
}
|
||||
|
||||
private void metrologyTabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
|
||||
}
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.UI.Bench.Uncertainties
|
||||
{
|
||||
partial class UncertaintiesDlg
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.metrologyTabControl = new System.Windows.Forms.TabControl();
|
||||
this.sharedButtons = new TBF.UI.Shared.SharedButtons();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||
this.splitContainer.Panel1.SuspendLayout();
|
||||
this.splitContainer.Panel2.SuspendLayout();
|
||||
this.splitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer
|
||||
//
|
||||
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer.Name = "splitContainer";
|
||||
//
|
||||
// splitContainer.Panel1
|
||||
//
|
||||
this.splitContainer.Panel1.Controls.Add(this.metrologyTabControl);
|
||||
//
|
||||
// splitContainer.Panel2
|
||||
//
|
||||
this.splitContainer.Panel2.Controls.Add(this.sharedButtons);
|
||||
this.splitContainer.Size = new System.Drawing.Size(965, 344);
|
||||
this.splitContainer.SplitterDistance = 863;
|
||||
this.splitContainer.TabIndex = 0;
|
||||
//
|
||||
// metrologyTabControl
|
||||
//
|
||||
this.metrologyTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.metrologyTabControl.ItemSize = new System.Drawing.Size(60, 30);
|
||||
this.metrologyTabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.metrologyTabControl.Name = "metrologyTabControl";
|
||||
this.metrologyTabControl.SelectedIndex = 0;
|
||||
this.metrologyTabControl.Size = new System.Drawing.Size(863, 344);
|
||||
this.metrologyTabControl.TabIndex = 0;
|
||||
this.metrologyTabControl.SelectedIndexChanged += new System.EventHandler(this.metrologyTabControl_SelectedIndexChanged);
|
||||
//
|
||||
// sharedButtons
|
||||
//
|
||||
this.sharedButtons.Location = new System.Drawing.Point(-2, 0);
|
||||
this.sharedButtons.Name = "sharedButtons";
|
||||
this.sharedButtons.Size = new System.Drawing.Size(100, 400);
|
||||
this.sharedButtons.TabIndex = 0;
|
||||
//
|
||||
// UncertaintyDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(965, 344);
|
||||
this.Controls.Add(this.splitContainer);
|
||||
this.Name = "UncertaintyDlg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Uncertainty";
|
||||
this.Load += new System.EventHandler(this.MetrologyDlg_Load);
|
||||
this.splitContainer.Panel1.ResumeLayout(false);
|
||||
this.splitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
|
||||
this.splitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer;
|
||||
private System.Windows.Forms.TabControl metrologyTabControl;
|
||||
private TBF.UI.Shared.SharedButtons sharedButtons;
|
||||
}
|
||||
}
|
||||
Generated
+21
-6
@@ -54,7 +54,7 @@ namespace TBF.UI
|
||||
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.mainTabControl = new System.Windows.Forms.TabControl();
|
||||
this.homeTabPage = new System.Windows.Forms.TabPage();
|
||||
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
|
||||
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
|
||||
this.processTabPage = new System.Windows.Forms.TabPage();
|
||||
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl6();
|
||||
this.insertTabPage = new System.Windows.Forms.TabPage();
|
||||
@@ -79,6 +79,8 @@ namespace TBF.UI
|
||||
this.benchPathsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.benchTransitionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.benchMetrologyTSMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.benchConditionsTSMItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.benchUncertaintyTSMItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.homeTSMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -136,6 +138,7 @@ namespace TBF.UI
|
||||
((System.ComponentModel.ISupportInitialize)(this.rightHorizSplitContainer)).BeginInit();
|
||||
this.rightHorizSplitContainer.Panel1.SuspendLayout();
|
||||
this.rightHorizSplitContainer.SuspendLayout();
|
||||
this.measurementTabPage.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.mainMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -382,11 +385,6 @@ namespace TBF.UI
|
||||
this.progressFlowLayoutPanel.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.progressFlowLayoutPanel.Name = "progressFlowLayoutPanel";
|
||||
//
|
||||
// measurementTabPage
|
||||
//
|
||||
resources.ApplyResources(this.measurementTabPage, "measurementTabPage");
|
||||
this.measurementTabPage.Name = "measurementTabPage";
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@@ -425,6 +423,8 @@ namespace TBF.UI
|
||||
this.benchPathsTSMenuItem,
|
||||
this.benchTransitionsToolStripMenuItem,
|
||||
this.benchMetrologyTSMenuItem,
|
||||
this.benchConditionsTSMItem,
|
||||
this.benchUncertaintyTSMItem,
|
||||
this.toolStripSeparator1,
|
||||
this.exitToolStripMenuItem});
|
||||
this.benchTSMenuItem.Name = "benchTSMenuItem";
|
||||
@@ -454,6 +454,18 @@ namespace TBF.UI
|
||||
resources.ApplyResources(this.benchMetrologyTSMenuItem, "benchMetrologyTSMenuItem");
|
||||
this.benchMetrologyTSMenuItem.Click += new System.EventHandler(this.benchMetrologyTSMItem_Click);
|
||||
//
|
||||
// benchConditionsTSMItem
|
||||
//
|
||||
this.benchConditionsTSMItem.Name = "benchConditionsTSMItem";
|
||||
resources.ApplyResources(this.benchConditionsTSMItem, "benchConditionsTSMItem");
|
||||
this.benchConditionsTSMItem.Click += new System.EventHandler(this.benchConditionsTSMItem_Click);
|
||||
//
|
||||
// benchUncertaintyTSMItem
|
||||
//
|
||||
this.benchUncertaintyTSMItem.Name = "benchUncertaintyTSMItem";
|
||||
resources.ApplyResources(this.benchUncertaintyTSMItem, "benchUncertaintyTSMItem");
|
||||
this.benchUncertaintyTSMItem.Click += new System.EventHandler(this.benchUncertaintyTSMItem_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
@@ -660,6 +672,7 @@ namespace TBF.UI
|
||||
this.rightHorizSplitContainer.Panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.rightHorizSplitContainer)).EndInit();
|
||||
this.rightHorizSplitContainer.ResumeLayout(false);
|
||||
this.measurementTabPage.ResumeLayout(false);
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.mainMenuStrip.ResumeLayout(false);
|
||||
@@ -760,6 +773,8 @@ namespace TBF.UI
|
||||
private System.Windows.Forms.ToolStripMenuItem backUpTSMItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem backUpConfigTSMItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem backUpResultsTSMItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem benchConditionsTSMItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem benchUncertaintyTSMItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -474,6 +474,8 @@ namespace TBF.UI
|
||||
private void benchPathsTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Paths.PathsDlg().ShowDialog(); Cursor = Cursors.Default; }
|
||||
private void benchTransitionsTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Transitions.TransitionsDlg().ShowDialog(); Cursor = Cursors.Default; }
|
||||
private void benchMetrologyTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Metrology.MetrologyDlg().ShowDialog(); Cursor = Cursors.Default; }
|
||||
private void benchConditionsTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Conditions.ConditionsDlg().ShowDialog(); Cursor = Cursors.Default; }
|
||||
private void benchUncertaintyTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Uncertainties.UncertaintiesDlg().ShowDialog(); Cursor = Cursors.Default; }
|
||||
private void proceduresTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Procedures.ProceduresDlg().ShowDialog(); Cursor = Cursors.Default; }
|
||||
|
||||
private void usersTSMItem_Click(object s, EventArgs e)
|
||||
|
||||
+674
-389
File diff suppressed because it is too large
Load Diff
@@ -13,8 +13,6 @@ using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
using TBF.UI.Shared;
|
||||
using TBF.BenchControl.Output;
|
||||
using TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead;
|
||||
|
||||
namespace TBF.UI.Procedures
|
||||
{
|
||||
@@ -65,23 +63,15 @@ namespace TBF.UI.Procedures
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
/// SharedDlgButtons configuration
|
||||
#if KEMPNO_50 || KRAKOW_50
|
||||
/// SharedDlgButtons configuration
|
||||
#if KEMPNO_50
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists, Users.Grp.GID.WaterMeterAuthority };
|
||||
#else
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists, Users.Grp.GID.Metrologists };
|
||||
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists, Users.Grp.GID.Metrologists };
|
||||
#endif
|
||||
|
||||
#if TURA_SPECIAL || TURA_IPERL || TURA_IPERL_NEW
|
||||
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove |
|
||||
SharedButtons.Buttons.Up | SharedButtons.Buttons.Down |SharedButtons.Buttons.Custom1;
|
||||
sharedButtons.Custom1Caption = string.Format("Načítaj testy{0}iPerl z Oracle", Environment.NewLine);
|
||||
sharedButtons.Custom1Clicked += iPerlWizardButton_Click;
|
||||
#else
|
||||
sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove |
|
||||
SharedButtons.Buttons.Up | SharedButtons.Buttons.Down;
|
||||
#endif
|
||||
sharedButtons.Unlocked += Unlocked;
|
||||
SharedButtons.Buttons.Up | SharedButtons.Buttons.Down;
|
||||
sharedButtons.Unlocked += Unlocked;
|
||||
sharedButtons.OKClicked += okButton_Click;
|
||||
sharedButtons.CancelClicked += cancelButton_Click;
|
||||
sharedButtons.AddClicked += addButton_Click;
|
||||
@@ -118,19 +108,17 @@ namespace TBF.UI.Procedures
|
||||
this.usedNames = usedNames;
|
||||
this.openUnlocked = openUnlocked;
|
||||
|
||||
#if KEMPNO_50 || KRAKOW_50
|
||||
#if KEMPNO_50
|
||||
sharedButtons.RequiredGroupMembership = procedure.Protected ? new Users.Grp.GID[] { Users.Grp.GID.WaterMeterAuthority }
|
||||
: new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists, Users.Grp.GID.WaterMeterAuthority };
|
||||
#else
|
||||
sharedButtons.RequiredGroupMembership = procedure.Protected ? new Users.Grp.GID[] { Users.Grp.GID.Metrologists }
|
||||
: new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists, Users.Grp.GID.Metrologists };
|
||||
#endif
|
||||
/// Prepare a list of components and a list of all valves in the test bench
|
||||
using (NHibernate.ISession 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);
|
||||
TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(session);
|
||||
Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents);
|
||||
RegulValves = new List<IRegulValve>();
|
||||
TestMethods = new List<ITestMethod>();
|
||||
@@ -141,7 +129,6 @@ namespace TBF.UI.Procedures
|
||||
fileWriter2ComboBox.Items.Add("---");
|
||||
fileWriter3ComboBox.Items.Add("---");
|
||||
fileWriter4ComboBox.Items.Add("---");
|
||||
|
||||
foreach (var cmpnt in TbfComponents)
|
||||
{
|
||||
if (cmpnt is IRegulValve) RegulValves.Add(cmpnt as IRegulValve);
|
||||
@@ -160,11 +147,12 @@ namespace TBF.UI.Procedures
|
||||
fileWriter4ComboBox.Items.Add(cmpnt.Cfg.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Loads paths, this must be done before PrepareMetrology12AndProcessTabs() call
|
||||
///
|
||||
feedingPaths = session.QueryOver<FeedingPath>().List();
|
||||
/// Loads paths, this must be done before PrepareMetrology12AndProcessTabs() call
|
||||
using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config))
|
||||
{
|
||||
feedingPaths = session.QueryOver<FeedingPath>().List();
|
||||
benchPaths = session.QueryOver<BenchPath>().List();
|
||||
outputPaths = session.QueryOver<OutputPath>().List();
|
||||
metersPaths = session.QueryOver<MetersPath>().List();
|
||||
@@ -328,11 +316,11 @@ namespace TBF.UI.Procedures
|
||||
LoadUISettings();
|
||||
|
||||
/// Enable/disable/show/hide controls in General tab
|
||||
#if KEMPNO_50 || KRAKOW_50
|
||||
#if IPERL
|
||||
altProcNameLabel.Visible = true;
|
||||
altProcNameTextBox.Visible = true;
|
||||
//altProcPeriodLabel.Visible = true;
|
||||
//altProcPeriodTextBox.Visible = true;
|
||||
altProcPeriodLabel.Visible = true;
|
||||
altProcPeriodTextBox.Visible = true;
|
||||
#endif
|
||||
procNameTextBox.Enabled = false;
|
||||
descriptionTextBox.Enabled = false;
|
||||
@@ -416,7 +404,6 @@ namespace TBF.UI.Procedures
|
||||
label15.Text = Strings.Date;
|
||||
label18.Text = Strings.Notes;
|
||||
watermetersLabel.Text = Strings.Meter_types_tested;
|
||||
altProcNameLabel.Text = Strings.Conditions;
|
||||
protectedCheckBox.Text = Strings.Protected_procedure;
|
||||
mustBeCompleteCheckBox.Text = Strings.All_tests_must_be_completed;
|
||||
manualControlDisabledCheckBox.Text = Strings.Manual_control_disabled;
|
||||
@@ -1964,13 +1951,15 @@ namespace TBF.UI.Procedures
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ListViewEx listViewEx;
|
||||
|
||||
switch (selectedTab)
|
||||
{
|
||||
case ProcedureTabs.Metrology1: listViewEx = metrology1ListViewEx; break;
|
||||
case ProcedureTabs.Metrology2: listViewEx = metrology2ListViewEx; break;
|
||||
case ProcedureTabs.Process: listViewEx = processListViewEx; break;
|
||||
case ProcedureTabs.Parameters: listViewEx = parametersListViewEx; break;
|
||||
default: return;
|
||||
|
||||
default: return;
|
||||
}
|
||||
|
||||
/// Find an unused test name
|
||||
@@ -2126,13 +2115,10 @@ namespace TBF.UI.Procedures
|
||||
AddToParametersTab(test);
|
||||
foreach (var ctrl in testParamsCtrls) ctrl.AddOne(test);
|
||||
|
||||
if (listViewEx != null)
|
||||
{
|
||||
listViewEx.Focus();
|
||||
listViewEx.SelectedItems.Clear();
|
||||
listViewEx.Items[listViewEx.Items.Count - 1].Selected = true;
|
||||
listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible();
|
||||
}
|
||||
listViewEx.Focus();
|
||||
listViewEx.SelectedItems.Clear();
|
||||
listViewEx.Items[listViewEx.Items.Count - 1].Selected = true;
|
||||
listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible();
|
||||
}
|
||||
|
||||
private void removeButton_Click(object sender, EventArgs e)
|
||||
@@ -2394,196 +2380,5 @@ namespace TBF.UI.Procedures
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queries an Oracle database and loads ... array/list
|
||||
/// </summary>
|
||||
private void iPerlWizardButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ListViewEx listViewEx = null;
|
||||
switch (selectedTab)
|
||||
{
|
||||
case ProcedureTabs.General:
|
||||
UpdateFromGeneralTab();
|
||||
break;
|
||||
|
||||
case ProcedureTabs.History:
|
||||
UpdateFromHistoryTab();
|
||||
break;
|
||||
|
||||
case ProcedureTabs.Metrology1:
|
||||
listViewEx = metrology1ListViewEx;
|
||||
UpdateFromMetrology1Tab();
|
||||
break;
|
||||
|
||||
case ProcedureTabs.Metrology2:
|
||||
listViewEx = metrology2ListViewEx;
|
||||
UpdateFromMetrology2Tab();
|
||||
break;
|
||||
|
||||
case ProcedureTabs.Process:
|
||||
listViewEx = processListViewEx;
|
||||
UpdateFromProcessTab();
|
||||
break;
|
||||
|
||||
case ProcedureTabs.Parameters:
|
||||
listViewEx = parametersListViewEx;
|
||||
UpdateFromParametersTab();
|
||||
break;
|
||||
|
||||
default:
|
||||
foreach (var ctrl in testParamsCtrls) if (!ctrl.UpdateAll()) MessageBox.Show(string.Format(Strings.Error_saving_parameters_of_0, ctrl.Name));
|
||||
foreach (var ctrl in procedureParamsCtrls) if (!ctrl.UpdateAll()) MessageBox.Show(string.Format(Strings.Error_saving_parameters_of_0, ctrl.Name));
|
||||
break;
|
||||
}
|
||||
|
||||
using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config))
|
||||
{
|
||||
IList<Test> testsToBeUpdated = new List<Test>();
|
||||
|
||||
foreach (var test in LoadedProcedure.Tests)
|
||||
{
|
||||
foreach (var tetsMethod in TestMethods)
|
||||
{
|
||||
if (tetsMethod.Name == test.Method && tetsMethod.ClassName == "TestMethods.Dummy")
|
||||
{
|
||||
testsToBeUpdated.Add(test);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (testsToBeUpdated.Count == 0)
|
||||
{
|
||||
MessageBox.Show("There are no tests to be updated");
|
||||
return;
|
||||
}
|
||||
|
||||
/// Run a wizard
|
||||
TestWizard.OracleWZTypSelection oracleDlg = new TestWizard.OracleWZTypSelection(LoadedProcedure, TestMethods);
|
||||
TestWizard.ConfirmUpdatingTests confirmationDlg = new TestWizard.ConfirmUpdatingTests(LoadedProcedure, TestMethods);
|
||||
Form[] forms = new Form[] { oracleDlg, confirmationDlg };
|
||||
|
||||
int step = 0; /// 1st step
|
||||
while ((step >= 0) && (step < forms.Length))
|
||||
{
|
||||
switch (forms[step].ShowDialog())
|
||||
{
|
||||
case DialogResult.OK:
|
||||
/// Next
|
||||
step++;
|
||||
break;
|
||||
|
||||
case DialogResult.Retry:
|
||||
/// Back
|
||||
step--;
|
||||
break;
|
||||
|
||||
case DialogResult.Cancel:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (step == forms.Length)
|
||||
{
|
||||
///
|
||||
/// Update tests
|
||||
///
|
||||
foreach (var ti in oracleDlg.SelectedTestInfos)
|
||||
{
|
||||
foreach (var test in testsToBeUpdated)
|
||||
{
|
||||
if (ti.TestName == test.Name)
|
||||
{
|
||||
///
|
||||
/// Update this test with information obtained from Oracle
|
||||
///
|
||||
double qfrom, qto;
|
||||
switch (ti.Range)
|
||||
{
|
||||
case Range.R90_100:
|
||||
qfrom = 0.9 * ti.Flow;
|
||||
qto = ti.Flow;
|
||||
break;
|
||||
|
||||
case Range.R95_105:
|
||||
qfrom = 0.95 * ti.Flow;
|
||||
qto = 1.05 * ti.Flow;
|
||||
break;
|
||||
|
||||
case Range.R100_110:
|
||||
qfrom = ti.Flow;
|
||||
qto = 1.1 * ti.Flow;
|
||||
break;
|
||||
|
||||
default:
|
||||
qfrom = qto = ti.Flow;
|
||||
break;
|
||||
}
|
||||
|
||||
double volume = ti.TestTime * (qfrom + qto) / 7.2;
|
||||
|
||||
test.Qfrom = (float)qfrom;
|
||||
test.Qto = (float)qto;
|
||||
test.TstTime = (float)ti.TestTime;
|
||||
test.Volume = (float)volume;
|
||||
test.ErrLimLo = (float)(ti.ErrLimLoFromDB - ti.Uncertainty);
|
||||
test.ErrLimHi = (float)(ti.ErrLimHiFromDB + ti.Uncertainty);
|
||||
test.Uncertainty = (float)ti.Uncertainty;
|
||||
test.Method = ti.TestMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Update iPerls and water meters
|
||||
///
|
||||
foreach (var ppCtrl in procedureParamsCtrls)
|
||||
{
|
||||
foreach (var pp in ppCtrl.CmpntsParams)
|
||||
{
|
||||
var ihpp = pp as TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead.ProcParams;
|
||||
if (ihpp != null)
|
||||
{
|
||||
ihpp.WMType_ID = oracleDlg.WMTypeId;
|
||||
ihpp.MeterType = oracleDlg.MeterType;
|
||||
}
|
||||
|
||||
var wmpp = pp as TBF.BenchControl.WaterMeters.WaterMeter.ProcParams;
|
||||
if (wmpp != null)
|
||||
{
|
||||
wmpp.MetrologicalClass = oracleDlg.MetrolKlasse;
|
||||
wmpp.ApprovalInfo = oracleDlg.Zulasszeichen;
|
||||
wmpp.Qn = (float)oracleDlg.Q3;
|
||||
|
||||
switch (oracleDlg.MeterType)
|
||||
{
|
||||
case MeterType.DN15: wmpp.DN = 15.0F; break;
|
||||
case MeterType.DN20: wmpp.DN = 20.0F; break;
|
||||
case MeterType.DN25: wmpp.DN = 25.0F; break;
|
||||
case MeterType.DN26: wmpp.DN = 25.0F; break;
|
||||
case MeterType.DN32: wmpp.DN = 32.0F; break;
|
||||
case MeterType.DN40: wmpp.DN = 40.0F; break;
|
||||
default:
|
||||
case MeterType.AutoDetect: wmpp.DN = 0; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RefreshMetrology12AndProcessTabs();
|
||||
RefreshOtherTabs();
|
||||
|
||||
if (listViewEx != null)
|
||||
{
|
||||
listViewEx.Focus();
|
||||
listViewEx.SelectedItems.Clear();
|
||||
listViewEx.Items[listViewEx.Items.Count - 1].Selected = true;
|
||||
listViewEx.Items[listViewEx.Items.Count - 1].EnsureVisible();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ namespace TBF.UI.Procedures
|
||||
bool showSensorsColumn;
|
||||
int nrFixedColumns;
|
||||
IList<IComponent> selectedCmpnts;
|
||||
|
||||
public IList<IParamsProvider> CmpntsParams;
|
||||
IList<IParamsProvider> cmpntsParams;
|
||||
|
||||
int paramsCount;
|
||||
Control[] editors;
|
||||
@@ -36,7 +35,7 @@ namespace TBF.UI.Procedures
|
||||
public ProcedureParamsCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
CmpntsParams = new List<IParamsProvider>();
|
||||
cmpntsParams = new List<IParamsProvider>();
|
||||
}
|
||||
|
||||
public ProcedureParamsCtrl(ProcedureDlg parent, IList<IComponent> selectedCmpnts, bool showSensorsColumn)
|
||||
@@ -82,7 +81,7 @@ namespace TBF.UI.Procedures
|
||||
}
|
||||
}
|
||||
|
||||
CmpntsParams.Add(procedureParams);
|
||||
cmpntsParams.Add(procedureParams);
|
||||
}
|
||||
|
||||
if (sampleToCreateHeader != null)
|
||||
@@ -177,7 +176,7 @@ namespace TBF.UI.Procedures
|
||||
public void RedrawAll()
|
||||
{
|
||||
listViewEx.Items.Clear();
|
||||
foreach (var item in CmpntsParams) DrawOne(item);
|
||||
foreach (var item in cmpntsParams) DrawOne(item);
|
||||
}
|
||||
|
||||
void DrawOne(IParamsProvider item)
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
namespace TBF.UI.Procedures.TestWizard
|
||||
{
|
||||
partial class ConfirmUpdatingTests
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.nextButton = new System.Windows.Forms.Button();
|
||||
this.backButton = new System.Windows.Forms.Button();
|
||||
this.messageLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(185, 77);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.cancelButton.TabIndex = 30;
|
||||
this.cancelButton.Text = "&Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// nextButton
|
||||
//
|
||||
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.nextButton.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.nextButton.Location = new System.Drawing.Point(104, 77);
|
||||
this.nextButton.Name = "nextButton";
|
||||
this.nextButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.nextButton.TabIndex = 29;
|
||||
this.nextButton.Text = "&Next >";
|
||||
this.nextButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// backButton
|
||||
//
|
||||
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
|
||||
this.backButton.Location = new System.Drawing.Point(23, 77);
|
||||
this.backButton.Name = "backButton";
|
||||
this.backButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.backButton.TabIndex = 28;
|
||||
this.backButton.Text = "< &Back";
|
||||
this.backButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// messageLabel
|
||||
//
|
||||
this.messageLabel.AutoSize = true;
|
||||
this.messageLabel.Location = new System.Drawing.Point(20, 33);
|
||||
this.messageLabel.Name = "messageLabel";
|
||||
this.messageLabel.Size = new System.Drawing.Size(208, 13);
|
||||
this.messageLabel.TabIndex = 31;
|
||||
this.messageLabel.Text = "Do you want to update \'Use wizard\' tests ?";
|
||||
//
|
||||
// ConfirmUpdatingTests
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 136);
|
||||
this.Controls.Add(this.messageLabel);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.nextButton);
|
||||
this.Controls.Add(this.backButton);
|
||||
this.Name = "ConfirmUpdatingTests";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Confirmation";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button nextButton;
|
||||
private System.Windows.Forms.Button backButton;
|
||||
private System.Windows.Forms.Label messageLabel;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UI.Procedures.TestWizard
|
||||
{
|
||||
public partial class ConfirmUpdatingTests : Form
|
||||
{
|
||||
Procedure loadedProcedure;
|
||||
IList<ITestMethod> testMethods;
|
||||
|
||||
public ConfirmUpdatingTests(Procedure loadedProcedure, IList<ITestMethod> testMethods)
|
||||
{
|
||||
this.loadedProcedure = loadedProcedure;
|
||||
this.testMethods = testMethods;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Text = Strings.Confirmation;
|
||||
messageLabel.Text = Strings.Do_you_want_to_update_tests_QM;
|
||||
backButton.Text = Strings.BackBtnText;
|
||||
nextButton.Text = Strings.Update;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,433 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.UI.Procedures.TestWizard
|
||||
{
|
||||
partial class OracleWZTypSelection
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.horizSplitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.meterTypeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.dnLabel = new System.Windows.Forms.Label();
|
||||
this.q3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.q3Label = new System.Windows.Forms.Label();
|
||||
this.approvalTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvalLabel = new System.Windows.Forms.Label();
|
||||
this.metroClassTextBox = new System.Windows.Forms.TextBox();
|
||||
this.metroClassLabel = new System.Windows.Forms.Label();
|
||||
this.testInfoNameLabel = new System.Windows.Forms.Label();
|
||||
this.timeStampTextBox = new System.Windows.Forms.TextBox();
|
||||
this.timeStampLabel = new System.Windows.Forms.Label();
|
||||
this.remarkTextBox = new System.Windows.Forms.TextBox();
|
||||
this.remarkLabel = new System.Windows.Forms.Label();
|
||||
this.wzTypTextBox = new System.Windows.Forms.TextBox();
|
||||
this.wzTypLabel = new System.Windows.Forms.Label();
|
||||
this.revWZTypLabel = new System.Windows.Forms.Label();
|
||||
this.revWZTypTextBox = new System.Windows.Forms.TextBox();
|
||||
this.searchButton = new System.Windows.Forms.Button();
|
||||
this.materialCodeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.idWZTypTextBox = new System.Windows.Forms.TextBox();
|
||||
this.materialCodeRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.idWZTypRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.listViewEx = new TracingDB.Forms.ListViewEx();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.nextButton = new System.Windows.Forms.Button();
|
||||
this.backButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
|
||||
this.horizSplitContainer.Panel1.SuspendLayout();
|
||||
this.horizSplitContainer.Panel2.SuspendLayout();
|
||||
this.horizSplitContainer.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer2)).BeginInit();
|
||||
this.horizSplitContainer2.Panel1.SuspendLayout();
|
||||
this.horizSplitContainer2.Panel2.SuspendLayout();
|
||||
this.horizSplitContainer2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// horizSplitContainer
|
||||
//
|
||||
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.horizSplitContainer.Name = "horizSplitContainer";
|
||||
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// horizSplitContainer.Panel1
|
||||
//
|
||||
this.horizSplitContainer.Panel1.Controls.Add(this.horizSplitContainer2);
|
||||
//
|
||||
// horizSplitContainer.Panel2
|
||||
//
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
|
||||
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
|
||||
this.horizSplitContainer.Size = new System.Drawing.Size(820, 363);
|
||||
this.horizSplitContainer.SplitterDistance = 283;
|
||||
this.horizSplitContainer.TabIndex = 0;
|
||||
//
|
||||
// horizSplitContainer2
|
||||
//
|
||||
this.horizSplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.horizSplitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.horizSplitContainer2.IsSplitterFixed = true;
|
||||
this.horizSplitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.horizSplitContainer2.Name = "horizSplitContainer2";
|
||||
this.horizSplitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// horizSplitContainer2.Panel1
|
||||
//
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.meterTypeComboBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.dnLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.q3TextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.q3Label);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.approvalTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.approvalLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.metroClassTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.metroClassLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.testInfoNameLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.timeStampTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.timeStampLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.remarkTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.remarkLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.wzTypTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.wzTypLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.revWZTypLabel);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.revWZTypTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.searchButton);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.materialCodeTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.idWZTypTextBox);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.materialCodeRadioButton);
|
||||
this.horizSplitContainer2.Panel1.Controls.Add(this.idWZTypRadioButton);
|
||||
//
|
||||
// horizSplitContainer2.Panel2
|
||||
//
|
||||
this.horizSplitContainer2.Panel2.Controls.Add(this.listViewEx);
|
||||
this.horizSplitContainer2.Size = new System.Drawing.Size(820, 283);
|
||||
this.horizSplitContainer2.SplitterDistance = 115;
|
||||
this.horizSplitContainer2.TabIndex = 0;
|
||||
//
|
||||
// meterTypeComboBox
|
||||
//
|
||||
this.meterTypeComboBox.FormattingEnabled = true;
|
||||
this.meterTypeComboBox.Location = new System.Drawing.Point(73, 85);
|
||||
this.meterTypeComboBox.Name = "meterTypeComboBox";
|
||||
this.meterTypeComboBox.Size = new System.Drawing.Size(65, 21);
|
||||
this.meterTypeComboBox.TabIndex = 17;
|
||||
//
|
||||
// dnLabel
|
||||
//
|
||||
this.dnLabel.AutoSize = true;
|
||||
this.dnLabel.Location = new System.Drawing.Point(31, 88);
|
||||
this.dnLabel.Name = "dnLabel";
|
||||
this.dnLabel.Size = new System.Drawing.Size(23, 13);
|
||||
this.dnLabel.TabIndex = 16;
|
||||
this.dnLabel.Text = "DN";
|
||||
//
|
||||
// q3TextBox
|
||||
//
|
||||
this.q3TextBox.Location = new System.Drawing.Point(103, 61);
|
||||
this.q3TextBox.Name = "q3TextBox";
|
||||
this.q3TextBox.Size = new System.Drawing.Size(35, 20);
|
||||
this.q3TextBox.TabIndex = 11;
|
||||
this.q3TextBox.TextChanged += new System.EventHandler(this.q3TextBox_TextChanged);
|
||||
//
|
||||
// q3Label
|
||||
//
|
||||
this.q3Label.AutoSize = true;
|
||||
this.q3Label.Location = new System.Drawing.Point(31, 64);
|
||||
this.q3Label.Name = "q3Label";
|
||||
this.q3Label.Size = new System.Drawing.Size(46, 13);
|
||||
this.q3Label.TabIndex = 10;
|
||||
this.q3Label.Text = "Q3 / Qn";
|
||||
//
|
||||
// approvalTextBox
|
||||
//
|
||||
this.approvalTextBox.Location = new System.Drawing.Point(220, 61);
|
||||
this.approvalTextBox.Name = "approvalTextBox";
|
||||
this.approvalTextBox.Size = new System.Drawing.Size(275, 20);
|
||||
this.approvalTextBox.TabIndex = 13;
|
||||
this.approvalTextBox.TextChanged += new System.EventHandler(this.approvalTextBox_TextChanged);
|
||||
//
|
||||
// approvalLabel
|
||||
//
|
||||
this.approvalLabel.AutoSize = true;
|
||||
this.approvalLabel.Location = new System.Drawing.Point(150, 64);
|
||||
this.approvalLabel.Name = "approvalLabel";
|
||||
this.approvalLabel.Size = new System.Drawing.Size(49, 13);
|
||||
this.approvalLabel.TabIndex = 12;
|
||||
this.approvalLabel.Text = "Approval";
|
||||
//
|
||||
// metroClassTextBox
|
||||
//
|
||||
this.metroClassTextBox.Location = new System.Drawing.Point(596, 37);
|
||||
this.metroClassTextBox.Name = "metroClassTextBox";
|
||||
this.metroClassTextBox.Size = new System.Drawing.Size(104, 20);
|
||||
this.metroClassTextBox.TabIndex = 9;
|
||||
this.metroClassTextBox.TextChanged += new System.EventHandler(this.metroClassTextBox_TextChanged);
|
||||
//
|
||||
// metroClassLabel
|
||||
//
|
||||
this.metroClassLabel.AutoSize = true;
|
||||
this.metroClassLabel.Location = new System.Drawing.Point(517, 40);
|
||||
this.metroClassLabel.Name = "metroClassLabel";
|
||||
this.metroClassLabel.Size = new System.Drawing.Size(78, 13);
|
||||
this.metroClassLabel.TabIndex = 8;
|
||||
this.metroClassLabel.Text = "Metrolog. class";
|
||||
//
|
||||
// testInfoNameLabel
|
||||
//
|
||||
this.testInfoNameLabel.AutoSize = true;
|
||||
this.testInfoNameLabel.Location = new System.Drawing.Point(595, 88);
|
||||
this.testInfoNameLabel.Name = "testInfoNameLabel";
|
||||
this.testInfoNameLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.testInfoNameLabel.TabIndex = 20;
|
||||
//
|
||||
// timeStampTextBox
|
||||
//
|
||||
this.timeStampTextBox.Enabled = false;
|
||||
this.timeStampTextBox.Location = new System.Drawing.Point(596, 61);
|
||||
this.timeStampTextBox.Name = "timeStampTextBox";
|
||||
this.timeStampTextBox.Size = new System.Drawing.Size(104, 20);
|
||||
this.timeStampTextBox.TabIndex = 15;
|
||||
//
|
||||
// timeStampLabel
|
||||
//
|
||||
this.timeStampLabel.AutoSize = true;
|
||||
this.timeStampLabel.Location = new System.Drawing.Point(517, 64);
|
||||
this.timeStampLabel.Name = "timeStampLabel";
|
||||
this.timeStampLabel.Size = new System.Drawing.Size(73, 13);
|
||||
this.timeStampLabel.TabIndex = 14;
|
||||
this.timeStampLabel.Text = "Date and time";
|
||||
//
|
||||
// remarkTextBox
|
||||
//
|
||||
this.remarkTextBox.Enabled = false;
|
||||
this.remarkTextBox.Location = new System.Drawing.Point(220, 85);
|
||||
this.remarkTextBox.Name = "remarkTextBox";
|
||||
this.remarkTextBox.Size = new System.Drawing.Size(346, 20);
|
||||
this.remarkTextBox.TabIndex = 19;
|
||||
//
|
||||
// remarkLabel
|
||||
//
|
||||
this.remarkLabel.AutoSize = true;
|
||||
this.remarkLabel.Location = new System.Drawing.Point(150, 88);
|
||||
this.remarkLabel.Name = "remarkLabel";
|
||||
this.remarkLabel.Size = new System.Drawing.Size(44, 13);
|
||||
this.remarkLabel.TabIndex = 18;
|
||||
this.remarkLabel.Text = "Remark";
|
||||
//
|
||||
// wzTypTextBox
|
||||
//
|
||||
this.wzTypTextBox.Enabled = false;
|
||||
this.wzTypTextBox.Location = new System.Drawing.Point(220, 37);
|
||||
this.wzTypTextBox.Name = "wzTypTextBox";
|
||||
this.wzTypTextBox.Size = new System.Drawing.Size(275, 20);
|
||||
this.wzTypTextBox.TabIndex = 7;
|
||||
//
|
||||
// wzTypLabel
|
||||
//
|
||||
this.wzTypLabel.AutoSize = true;
|
||||
this.wzTypLabel.Location = new System.Drawing.Point(150, 40);
|
||||
this.wzTypLabel.Name = "wzTypLabel";
|
||||
this.wzTypLabel.Size = new System.Drawing.Size(65, 13);
|
||||
this.wzTypLabel.TabIndex = 6;
|
||||
this.wzTypLabel.Text = "Water meter";
|
||||
//
|
||||
// revWZTypLabel
|
||||
//
|
||||
this.revWZTypLabel.AutoSize = true;
|
||||
this.revWZTypLabel.Location = new System.Drawing.Point(31, 40);
|
||||
this.revWZTypLabel.Name = "revWZTypLabel";
|
||||
this.revWZTypLabel.Size = new System.Drawing.Size(66, 13);
|
||||
this.revWZTypLabel.TabIndex = 4;
|
||||
this.revWZTypLabel.Text = "Rev WZTyp";
|
||||
//
|
||||
// revWZTypTextBox
|
||||
//
|
||||
this.revWZTypTextBox.Enabled = false;
|
||||
this.revWZTypTextBox.Location = new System.Drawing.Point(103, 37);
|
||||
this.revWZTypTextBox.Name = "revWZTypTextBox";
|
||||
this.revWZTypTextBox.Size = new System.Drawing.Size(35, 20);
|
||||
this.revWZTypTextBox.TabIndex = 5;
|
||||
//
|
||||
// searchButton
|
||||
//
|
||||
this.searchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.searchButton.Location = new System.Drawing.Point(722, 17);
|
||||
this.searchButton.Name = "searchButton";
|
||||
this.searchButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.searchButton.TabIndex = 21;
|
||||
this.searchButton.Text = "Search";
|
||||
this.searchButton.UseVisualStyleBackColor = true;
|
||||
this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
|
||||
//
|
||||
// materialCodeTextBox
|
||||
//
|
||||
this.materialCodeTextBox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.materialCodeTextBox.Location = new System.Drawing.Point(220, 13);
|
||||
this.materialCodeTextBox.Name = "materialCodeTextBox";
|
||||
this.materialCodeTextBox.Size = new System.Drawing.Size(480, 20);
|
||||
this.materialCodeTextBox.TabIndex = 3;
|
||||
this.materialCodeTextBox.TextChanged += new System.EventHandler(this.productCodeTextBox_TextChanged);
|
||||
//
|
||||
// idWZTypTextBox
|
||||
//
|
||||
this.idWZTypTextBox.Location = new System.Drawing.Point(103, 13);
|
||||
this.idWZTypTextBox.Name = "idWZTypTextBox";
|
||||
this.idWZTypTextBox.Size = new System.Drawing.Size(35, 20);
|
||||
this.idWZTypTextBox.TabIndex = 1;
|
||||
this.idWZTypTextBox.TextChanged += new System.EventHandler(this.wzTypTextBox_TextChanged);
|
||||
//
|
||||
// materialCodeRadioButton
|
||||
//
|
||||
this.materialCodeRadioButton.AutoSize = true;
|
||||
this.materialCodeRadioButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.materialCodeRadioButton.Location = new System.Drawing.Point(153, 14);
|
||||
this.materialCodeRadioButton.Name = "materialCodeRadioButton";
|
||||
this.materialCodeRadioButton.Size = new System.Drawing.Size(62, 17);
|
||||
this.materialCodeRadioButton.TabIndex = 2;
|
||||
this.materialCodeRadioButton.TabStop = true;
|
||||
this.materialCodeRadioButton.Text = "Material";
|
||||
this.materialCodeRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// idWZTypRadioButton
|
||||
//
|
||||
this.idWZTypRadioButton.AutoSize = true;
|
||||
this.idWZTypRadioButton.Location = new System.Drawing.Point(15, 14);
|
||||
this.idWZTypRadioButton.Name = "idWZTypRadioButton";
|
||||
this.idWZTypRadioButton.Size = new System.Drawing.Size(75, 17);
|
||||
this.idWZTypRadioButton.TabIndex = 0;
|
||||
this.idWZTypRadioButton.TabStop = true;
|
||||
this.idWZTypRadioButton.Text = "ID WZTyp";
|
||||
this.idWZTypRadioButton.UseVisualStyleBackColor = true;
|
||||
this.idWZTypRadioButton.CheckedChanged += new System.EventHandler(this.idWZTypRadioButton_CheckedChanged);
|
||||
//
|
||||
// listViewEx
|
||||
//
|
||||
this.listViewEx.AllowColumnReorder = true;
|
||||
this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listViewEx.DoubleClickActivation = false;
|
||||
this.listViewEx.FullRowSelect = true;
|
||||
this.listViewEx.GridLines = true;
|
||||
this.listViewEx.Location = new System.Drawing.Point(0, 0);
|
||||
this.listViewEx.Name = "listViewEx";
|
||||
this.listViewEx.Size = new System.Drawing.Size(820, 164);
|
||||
this.listViewEx.TabIndex = 0;
|
||||
this.listViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewEx.View = System.Windows.Forms.View.Details;
|
||||
this.listViewEx.SubItemClicked += new TracingDB.Forms.SubItemEventHandler(this.listViewEx_SubItemClicked);
|
||||
this.listViewEx.SubItemEndEditing += new TracingDB.Forms.SubItemEndEditingEventHandler(this.listViewEx_SubItemEndEditing);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.Location = new System.Drawing.Point(722, 17);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.cancelButton.TabIndex = 27;
|
||||
this.cancelButton.Text = "&Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// nextButton
|
||||
//
|
||||
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.nextButton.Location = new System.Drawing.Point(641, 17);
|
||||
this.nextButton.Name = "nextButton";
|
||||
this.nextButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.nextButton.TabIndex = 26;
|
||||
this.nextButton.Text = "&Next >";
|
||||
this.nextButton.UseVisualStyleBackColor = true;
|
||||
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
|
||||
//
|
||||
// backButton
|
||||
//
|
||||
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.backButton.Location = new System.Drawing.Point(560, 17);
|
||||
this.backButton.Name = "backButton";
|
||||
this.backButton.Size = new System.Drawing.Size(75, 42);
|
||||
this.backButton.TabIndex = 25;
|
||||
this.backButton.Text = "< &Back";
|
||||
this.backButton.UseVisualStyleBackColor = true;
|
||||
this.backButton.Click += new System.EventHandler(this.backButton_Click);
|
||||
//
|
||||
// OracleWZTypSelection
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(820, 363);
|
||||
this.Controls.Add(this.horizSplitContainer);
|
||||
this.Name = "OracleWZTypSelection";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Výber typu vodomera (WZTyp alebo 25-miestny kód)";
|
||||
this.Load += new System.EventHandler(this.OracleWZTypSelection_Load);
|
||||
this.horizSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.horizSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
|
||||
this.horizSplitContainer.ResumeLayout(false);
|
||||
this.horizSplitContainer2.Panel1.ResumeLayout(false);
|
||||
this.horizSplitContainer2.Panel1.PerformLayout();
|
||||
this.horizSplitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer2)).EndInit();
|
||||
this.horizSplitContainer2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer horizSplitContainer;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button nextButton;
|
||||
private System.Windows.Forms.Button backButton;
|
||||
private System.Windows.Forms.SplitContainer horizSplitContainer2;
|
||||
private System.Windows.Forms.TextBox materialCodeTextBox;
|
||||
private System.Windows.Forms.TextBox idWZTypTextBox;
|
||||
private System.Windows.Forms.RadioButton materialCodeRadioButton;
|
||||
private System.Windows.Forms.RadioButton idWZTypRadioButton;
|
||||
private System.Windows.Forms.Button searchButton;
|
||||
private TracingDB.Forms.ListViewEx listViewEx;
|
||||
private System.Windows.Forms.Label remarkLabel;
|
||||
private System.Windows.Forms.TextBox wzTypTextBox;
|
||||
private System.Windows.Forms.Label wzTypLabel;
|
||||
private System.Windows.Forms.Label revWZTypLabel;
|
||||
private System.Windows.Forms.TextBox revWZTypTextBox;
|
||||
private System.Windows.Forms.TextBox remarkTextBox;
|
||||
private System.Windows.Forms.TextBox timeStampTextBox;
|
||||
private System.Windows.Forms.Label timeStampLabel;
|
||||
private System.Windows.Forms.Label testInfoNameLabel;
|
||||
private System.Windows.Forms.TextBox metroClassTextBox;
|
||||
private System.Windows.Forms.Label metroClassLabel;
|
||||
private System.Windows.Forms.TextBox q3TextBox;
|
||||
private System.Windows.Forms.Label q3Label;
|
||||
private System.Windows.Forms.TextBox approvalTextBox;
|
||||
private System.Windows.Forms.Label approvalLabel;
|
||||
private System.Windows.Forms.ComboBox meterTypeComboBox;
|
||||
private System.Windows.Forms.Label dnLabel;
|
||||
}
|
||||
}
|
||||
@@ -1,362 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Oracle.DataAccess.Client;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.BenchControl.Output;
|
||||
using TBF.BenchControl.Output.DB.SensusOracle;
|
||||
using TBF.Resources;
|
||||
using TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead;
|
||||
|
||||
namespace TBF.UI.Procedures.TestWizard
|
||||
{
|
||||
public partial class OracleWZTypSelection : Form
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(OracleWZTypSelection));
|
||||
|
||||
public IList<SensusTestInfo> SelectedTestInfos;
|
||||
public int WMTypeId;
|
||||
public string MetrolKlasse;
|
||||
public string Zulasszeichen;
|
||||
public double Q3;
|
||||
public MeterType MeterType;
|
||||
|
||||
|
||||
Procedure loadedProcedure;
|
||||
IList<ITestMethod> testMethods;
|
||||
|
||||
TextBox uncertaintyTB;
|
||||
ComboBox testMethodCB;
|
||||
|
||||
public OracleWZTypSelection(Procedure loadedProcedure, IList<ITestMethod> testMethods)
|
||||
{
|
||||
this.loadedProcedure = loadedProcedure;
|
||||
this.testMethods = testMethods;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Text = Strings.Method_selection;
|
||||
backButton.Text = Strings.BackBtnText;
|
||||
nextButton.Text = Strings.NextBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
|
||||
for (MeterType mt = 0; mt < MeterType.Count; mt++)
|
||||
{
|
||||
meterTypeComboBox.Items.Add(mt.ToString());
|
||||
}
|
||||
meterTypeComboBox.Text = MeterType.AutoDetect.ToString();
|
||||
|
||||
listViewEx.Columns.Add("ID", 30);
|
||||
listViewEx.Columns.Add("Test name", 70);
|
||||
listViewEx.Columns.Add("QBezeichnung", 85);
|
||||
listViewEx.Columns.Add(Strings.Q_from_m3h, 80);
|
||||
listViewEx.Columns.Add(Strings.Q_to_m3h, 70);
|
||||
listViewEx.Columns.Add(Strings.Test_time_s_chdr, 70);
|
||||
listViewEx.Columns.Add(string.Format("{0} [l]", Strings.Volume, 60));
|
||||
listViewEx.Columns.Add(Strings.Err_limit_neg_pct_chdr, 80);
|
||||
listViewEx.Columns.Add(Strings.Err_limit_pos_pct_chdr, 80);
|
||||
listViewEx.Columns.Add(Strings.Uncertainty_pct_chdr, 85);
|
||||
listViewEx.Columns.Add(Strings.Test_method, 200);
|
||||
|
||||
uncertaintyTB = new TextBox();
|
||||
Controls.Add(uncertaintyTB);
|
||||
|
||||
testMethodCB = new ComboBox();
|
||||
if (testMethods != null)
|
||||
{
|
||||
foreach (var tm in testMethods) testMethodCB.Items.Add(tm.Name);
|
||||
}
|
||||
Controls.Add(testMethodCB);
|
||||
|
||||
backButton.Visible = false;
|
||||
nextButton.Enabled = false;
|
||||
|
||||
SelectedTestInfos = null;
|
||||
}
|
||||
|
||||
private void OracleWZTypSelection_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
bool IsFormValidForSearch()
|
||||
{
|
||||
if (idWZTypRadioButton.Checked)
|
||||
{
|
||||
int idummy;
|
||||
return (int.TryParse(idWZTypTextBox.Text, out idummy) && (idummy > 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
return (materialCodeTextBox.Text.Length == 25);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsFormValid()
|
||||
{
|
||||
double dummy;
|
||||
|
||||
return IsFormValidForSearch() &&
|
||||
(listViewEx.Items.Count > 0) &&
|
||||
Utils.TryParseUDouble(q3TextBox.Text, out dummy) &&
|
||||
!string.IsNullOrEmpty(metroClassTextBox.Text) &&
|
||||
!string.IsNullOrEmpty(approvalTextBox.Text) &&
|
||||
meterTypeComboBox.Items.Contains(meterTypeComboBox.Text);
|
||||
}
|
||||
|
||||
private void idWZTypRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (idWZTypRadioButton.Checked)
|
||||
{
|
||||
idWZTypTextBox.Enabled = true;
|
||||
materialCodeTextBox.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
idWZTypTextBox.Enabled = false;
|
||||
materialCodeTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
searchButton.Enabled = IsFormValidForSearch();
|
||||
nextButton.Enabled = false;
|
||||
}
|
||||
|
||||
private void wzTypTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
searchButton.Enabled = IsFormValidForSearch();
|
||||
nextButton.Enabled = false;
|
||||
}
|
||||
|
||||
private void productCodeTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
searchButton.Enabled = IsFormValidForSearch();
|
||||
nextButton.Enabled = false;
|
||||
}
|
||||
|
||||
private void backButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Retry;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
MetrolKlasse = metroClassTextBox.Text;
|
||||
Zulasszeichen = approvalTextBox.Text;
|
||||
Q3 = Utils.ParseUDouble(q3TextBox.Text);
|
||||
for (MeterType mt = 0; mt < MeterType.Count; mt++)
|
||||
{
|
||||
if (meterTypeComboBox.Text == mt.ToString())
|
||||
{
|
||||
MeterType = mt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void searchButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsFormValidForSearch())
|
||||
{
|
||||
MessageBox.Show("Invalid data");
|
||||
nextButton.Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
bool found = ReadTestInfosFromOracle();
|
||||
if (!found)
|
||||
{
|
||||
MessageBox.Show("No water meter specification found in Oracle");
|
||||
}
|
||||
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
bool ReadTestInfosFromOracle()
|
||||
{
|
||||
IList<string> wmTestNames = new List<string>();
|
||||
StringBuilder procedureSignatureSB = new StringBuilder();
|
||||
|
||||
foreach (var t in loadedProcedure.Tests)
|
||||
{
|
||||
if (t.Publish != (byte)Config.Entities.Publish.Never)
|
||||
{
|
||||
wmTestNames.Add(global::Results.Utils.GetTestName(t.Name, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
WMTypeId = int.Parse(idWZTypTextBox.Text);
|
||||
|
||||
int wmTypeRevision;
|
||||
string wzTypStr;
|
||||
string materialNr;
|
||||
DateTime timeStamp;
|
||||
string remark;
|
||||
string testInfoName;
|
||||
|
||||
OracleConnection conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
|
||||
conn.Open();
|
||||
SelectedTestInfos = Database.GetOracleTestInfo(conn, WMTypeId, out wmTypeRevision, out wzTypStr, out MetrolKlasse, out Zulasszeichen, out materialNr, out Q3, out timeStamp, out remark);
|
||||
conn.Close();
|
||||
|
||||
SensusTestInfo[] completeTestInfos = SensusTestInfo.GetBestMatch(SelectedTestInfos, wmTestNames, out testInfoName);
|
||||
foreach (var sti in SelectedTestInfos)
|
||||
{
|
||||
foreach (var cti in completeTestInfos) if (cti.PruefungsNrDB == sti.PruefungsNrDB) sti.TestName = cti.TestName;
|
||||
}
|
||||
|
||||
materialCodeTextBox.Text = materialNr;
|
||||
revWZTypTextBox.Text = wmTypeRevision.ToString();
|
||||
wzTypTextBox.Text = wzTypStr;
|
||||
metroClassTextBox.Text = MetrolKlasse;
|
||||
approvalTextBox.Text = Zulasszeichen;
|
||||
q3TextBox.Text = Q3.ToString();
|
||||
remarkTextBox.Text = remark;
|
||||
timeStampTextBox.Text = timeStamp.ToString("dd.MM.yyyy HH:mm");
|
||||
testInfoNameLabel.Text = testInfoName;
|
||||
|
||||
listViewEx.Items.Clear();
|
||||
foreach (var ti in SelectedTestInfos)
|
||||
{
|
||||
double Qfrom, Qto;
|
||||
switch (ti.Range)
|
||||
{
|
||||
case Range.R90_100:
|
||||
Qfrom = 0.9 * ti.Flow;
|
||||
Qto = ti.Flow;
|
||||
break;
|
||||
|
||||
case Range.R95_105:
|
||||
Qfrom = 0.95 * ti.Flow;
|
||||
Qto = 1.05 * ti.Flow;
|
||||
break;
|
||||
|
||||
case Range.R100_110:
|
||||
Qfrom = ti.Flow;
|
||||
Qto = 1.1 * ti.Flow;
|
||||
break;
|
||||
|
||||
default:
|
||||
Qfrom = Qto = ti.Flow;
|
||||
break;
|
||||
}
|
||||
|
||||
double volumeLtr = ti.TestTime * (Qfrom + Qto) / 7.2;
|
||||
|
||||
ListViewItem lvi = new ListViewItem(new string[] { ti.PruefungsNrDB.ToString(),
|
||||
(string.IsNullOrEmpty(ti.TestName) ? string.Empty : ti.TestName),
|
||||
ti.QBezeichnungDB,
|
||||
Qfrom.ToString(),
|
||||
Qto.ToString(),
|
||||
ti.TestTime.ToString(),
|
||||
volumeLtr.ToString(Config.Utils.SignificantDigitsToFmt(volumeLtr, 4)),
|
||||
(ti.ErrLimLoFromDB - ti.Uncertainty).ToString(),
|
||||
(ti.ErrLimHiFromDB + ti.Uncertainty).ToString(),
|
||||
ti.Uncertainty.ToString(),
|
||||
ti.TestMethod,
|
||||
});
|
||||
lvi.Tag = ti;
|
||||
listViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
revWZTypTextBox.Text = string.Empty;
|
||||
wzTypTextBox.Text = "No info found";
|
||||
metroClassTextBox.Text = string.Empty;
|
||||
approvalTextBox.Text = string.Empty;
|
||||
q3TextBox.Text = string.Empty;
|
||||
remarkTextBox.Text = string.Empty;
|
||||
timeStampTextBox.Text = string.Empty;
|
||||
testInfoNameLabel.Text = string.Empty;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void listViewEx_SubItemClicked(object sender, TracingDB.Forms.SubItemEventArgs e)
|
||||
{
|
||||
if (e.SubItem == listViewEx.Columns.Count - 2)
|
||||
{
|
||||
/// Uncertainty column clicked (column before the last one)
|
||||
listViewEx.StartEditing(uncertaintyTB, e.Item, e.SubItem);
|
||||
}
|
||||
else if (e.SubItem == listViewEx.Columns.Count - 1)
|
||||
{
|
||||
/// Test method column clicked (the last column)
|
||||
listViewEx.StartEditing(testMethodCB, e.Item, e.SubItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void listViewEx_SubItemEndEditing(object sender, TracingDB.Forms.SubItemEndEditingEventArgs e)
|
||||
{
|
||||
if (e.SubItem == listViewEx.Columns.Count - 2)
|
||||
{
|
||||
double uncertainty;
|
||||
if (Utils.TryParseUDouble(e.DisplayText, out uncertainty))
|
||||
{
|
||||
/// Uncertainty OK
|
||||
SensusTestInfo ti = e.Item.Tag as SensusTestInfo;
|
||||
if (ti != null) ti.Uncertainty = uncertainty;
|
||||
e.Item.SubItems[listViewEx.Columns.Count - 4].Text = (ti.ErrLimLoFromDB - ti.Uncertainty).ToString();
|
||||
e.Item.SubItems[listViewEx.Columns.Count - 3].Text = (ti.ErrLimHiFromDB + ti.Uncertainty).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Uncertainty NOK -> revert changes
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (e.SubItem == listViewEx.Columns.Count - 1)
|
||||
{
|
||||
if (testMethodCB.Items.Contains(e.DisplayText))
|
||||
{
|
||||
/// TestMethod OK
|
||||
SensusTestInfo ti = e.Item.Tag as SensusTestInfo;
|
||||
if (ti != null) ti.TestMethod = e.DisplayText;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// TestMethod NOK -> revert changes
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void q3TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
private void metroClassTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
|
||||
private void approvalTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
nextButton.Enabled = IsFormValid();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -4,13 +4,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Results.Entities;
|
||||
using NHibernate;
|
||||
using log4net;
|
||||
using Oracle.DataAccess.Client;
|
||||
using Results;
|
||||
using Results.Entities;
|
||||
using TBF.Resources;
|
||||
using TBF.BenchControl.Output.DB.SensusOracle;
|
||||
|
||||
namespace TBF.UI.Results
|
||||
{
|
||||
|
||||
Generated
+1
-43
@@ -47,9 +47,6 @@ namespace TBF.UI.Shared
|
||||
this.exportButton = new System.Windows.Forms.Button();
|
||||
this.importButton = new System.Windows.Forms.Button();
|
||||
this.compareButton = new System.Windows.Forms.Button();
|
||||
this.customButton1 = new System.Windows.Forms.Button();
|
||||
this.customButton2 = new System.Windows.Forms.Button();
|
||||
this.customButton3 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// removeButton
|
||||
@@ -228,46 +225,10 @@ namespace TBF.UI.Shared
|
||||
this.compareButton.UseVisualStyleBackColor = true;
|
||||
this.compareButton.Click += new System.EventHandler(this.compareButton_Click);
|
||||
//
|
||||
// customButton1
|
||||
//
|
||||
this.customButton1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.customButton1.Location = new System.Drawing.Point(10, 755);
|
||||
this.customButton1.Name = "customButton1";
|
||||
this.customButton1.Size = new System.Drawing.Size(80, 40);
|
||||
this.customButton1.TabIndex = 16;
|
||||
this.customButton1.Text = "Custom 1";
|
||||
this.customButton1.UseVisualStyleBackColor = true;
|
||||
this.customButton1.Click += new System.EventHandler(this.customButton1_Click);
|
||||
//
|
||||
// customButton2
|
||||
//
|
||||
this.customButton2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.customButton2.Location = new System.Drawing.Point(10, 798);
|
||||
this.customButton2.Name = "customButton2";
|
||||
this.customButton2.Size = new System.Drawing.Size(80, 40);
|
||||
this.customButton2.TabIndex = 17;
|
||||
this.customButton2.Text = "Custom 2";
|
||||
this.customButton2.UseVisualStyleBackColor = true;
|
||||
this.customButton2.Click += new System.EventHandler(this.customButton2_Click);
|
||||
//
|
||||
// customButton3
|
||||
//
|
||||
this.customButton3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.customButton3.Location = new System.Drawing.Point(10, 841);
|
||||
this.customButton3.Name = "customButton3";
|
||||
this.customButton3.Size = new System.Drawing.Size(80, 40);
|
||||
this.customButton3.TabIndex = 18;
|
||||
this.customButton3.Text = "Custom 3";
|
||||
this.customButton3.UseVisualStyleBackColor = true;
|
||||
this.customButton3.Click += new System.EventHandler(this.customButton3_Click);
|
||||
//
|
||||
// SharedButtons
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.customButton3);
|
||||
this.Controls.Add(this.customButton2);
|
||||
this.Controls.Add(this.customButton1);
|
||||
this.Controls.Add(this.compareButton);
|
||||
this.Controls.Add(this.importButton);
|
||||
this.Controls.Add(this.exportButton);
|
||||
@@ -285,7 +246,7 @@ namespace TBF.UI.Shared
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Name = "SharedButtons";
|
||||
this.Size = new System.Drawing.Size(100, 908);
|
||||
this.Size = new System.Drawing.Size(100, 805);
|
||||
this.Load += new System.EventHandler(this.SharedDlgButtons_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
@@ -309,8 +270,5 @@ namespace TBF.UI.Shared
|
||||
private System.Windows.Forms.Button exportButton;
|
||||
private System.Windows.Forms.Button importButton;
|
||||
private System.Windows.Forms.Button compareButton;
|
||||
private System.Windows.Forms.Button customButton1;
|
||||
private System.Windows.Forms.Button customButton2;
|
||||
private System.Windows.Forms.Button customButton3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@ namespace TBF.UI.Shared
|
||||
RenameTab = (1 << 10), /// optional
|
||||
RemoveTab = (1 << 11), /// optional
|
||||
More = (1 << 12), /// optional
|
||||
Custom1 = (1 << 13), /// optional
|
||||
Custom2 = (1 << 14), /// optional
|
||||
Custom3 = (1 << 15), /// optional
|
||||
}
|
||||
|
||||
readonly System.Windows.Forms.Button[] buttonCtrls;
|
||||
@@ -43,10 +40,6 @@ namespace TBF.UI.Shared
|
||||
/// </summary>
|
||||
public Buttons OptionalButtons;
|
||||
|
||||
public string Custom1Caption { set { customButton1.Text = value; } }
|
||||
public string Custom2Caption { set { customButton2.Text = value; } }
|
||||
public string Custom3Caption { set { customButton3.Text = value; } }
|
||||
|
||||
public enum LockState
|
||||
{
|
||||
Locked, /// 'Unlock', 'Close' (=OK) are shown, all the othere are hidden
|
||||
@@ -91,7 +84,6 @@ namespace TBF.UI.Shared
|
||||
addButton, removeButton, upButton, downButton, editButton, copyButton,
|
||||
exportButton, importButton, compareButton,
|
||||
newTabButton, renameTabButton, removeTabButton, moreButton,
|
||||
customButton1, customButton2, customButton3,
|
||||
};
|
||||
OptionalButtons = Buttons.None;
|
||||
buttonsRepositionsed = false;
|
||||
@@ -216,13 +208,10 @@ namespace TBF.UI.Shared
|
||||
public event EventHandler NewTabClicked;
|
||||
public event EventHandler RenameTabClicked;
|
||||
public event EventHandler RemoveTabClicked;
|
||||
public event EventHandler MoreClicked;
|
||||
public event EventHandler ExportClicked;
|
||||
public event EventHandler ImportClicked;
|
||||
public event EventHandler CompareClicked;
|
||||
public event EventHandler MoreClicked;
|
||||
public event EventHandler Custom1Clicked;
|
||||
public event EventHandler Custom2Clicked;
|
||||
public event EventHandler Custom3Clicked;
|
||||
|
||||
/// <summary>
|
||||
/// 'Unlock' button handler
|
||||
@@ -299,8 +288,5 @@ namespace TBF.UI.Shared
|
||||
private void newTabButton_Click(object s, EventArgs e) { if (NewTabClicked != null) NewTabClicked(s, e); }
|
||||
private void renameTabButton_Click(object s, EventArgs e) { if (RenameTabClicked != null) RenameTabClicked(s, e); }
|
||||
private void removeTabButton_Click(object s, EventArgs e) { if (RemoveTabClicked != null) RemoveTabClicked(s, e); }
|
||||
private void customButton1_Click(object s, EventArgs e) { if (Custom1Clicked != null) Custom1Clicked(s, e); }
|
||||
private void customButton2_Click(object s, EventArgs e) { if (Custom2Clicked != null) Custom2Clicked(s, e); }
|
||||
private void customButton3_Click(object s, EventArgs e) { if (Custom3Clicked != null) Custom3Clicked(s, e); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace Users.Mappings
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user