Changes for Xylem Nanjing, ver. 3.1.1676
This commit is contained in:
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Xml.Serialization;
|
||||
using Config;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
@@ -64,7 +64,7 @@ namespace TBF.Rig.Ambient.Comet
|
||||
[XmlIgnore]
|
||||
public string MsrdFormat { get { return string.Empty; } }
|
||||
[XmlIgnore]
|
||||
public Config.Unit MsrdUnit { get { return TempUnit; } }
|
||||
public Unit MsrdUnit { get { return TempUnit; } }
|
||||
[XmlIgnore]
|
||||
public double MsrdValLimLo { get { return TempLimLo; } }
|
||||
[XmlIgnore]
|
||||
@@ -335,7 +335,7 @@ namespace TBF.Rig.Ambient.Comet
|
||||
prms.Format = this.Format;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
AmbientCfg pars = new AmbientCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Globalization;
|
||||
using System.IO.Ports;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Config;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Xml.Serialization;
|
||||
using Config;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
@@ -63,7 +63,7 @@ namespace TBF.Rig.Ambient.Greco
|
||||
[XmlIgnore]
|
||||
public string MsrdFormat { get { return string.Empty; } }
|
||||
[XmlIgnore]
|
||||
public Config.Unit MsrdUnit { get { return TempUnit; } }
|
||||
public Unit MsrdUnit { get { return TempUnit; } }
|
||||
[XmlIgnore]
|
||||
public double MsrdValLimLo { get { return TempLimLo; } }
|
||||
[XmlIgnore]
|
||||
@@ -326,7 +326,7 @@ namespace TBF.Rig.Ambient.Greco
|
||||
prms.Format = this.Format;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
AmbientCfg pars = new AmbientCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2016 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
|
||||
+20
-81
@@ -1,10 +1,11 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -12,114 +13,52 @@ namespace TBF.Rig
|
||||
{
|
||||
public class ComponentCfgBase
|
||||
{
|
||||
[XmlIgnore]
|
||||
public int Id { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
set { name = value; }
|
||||
}
|
||||
string name;
|
||||
|
||||
[XmlIgnore]
|
||||
public Generic.IComponentFactory Factory
|
||||
{
|
||||
get { return factory; }
|
||||
set { factory = value; }
|
||||
}
|
||||
Generic.IComponentFactory factory;
|
||||
|
||||
[XmlIgnore]
|
||||
public string ClassName
|
||||
{
|
||||
get { return Factory.ToString(); }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public string ParentName
|
||||
{
|
||||
get { return parentName; }
|
||||
set { parentName = value; }
|
||||
}
|
||||
string parentName;
|
||||
|
||||
[XmlIgnore]
|
||||
public int ItemNr
|
||||
{
|
||||
get { return itemNr; }
|
||||
set { itemNr = value; }
|
||||
}
|
||||
int itemNr;
|
||||
|
||||
[XmlIgnore]
|
||||
public DebugMode DebugLevel
|
||||
{
|
||||
get { return debugLevel; }
|
||||
set { debugLevel = value; }
|
||||
}
|
||||
DebugMode debugLevel;
|
||||
|
||||
[XmlIgnore]
|
||||
public LogLevel LogLevel
|
||||
{
|
||||
get { return logLevel; }
|
||||
set { logLevel = value; }
|
||||
}
|
||||
LogLevel logLevel;
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<MeasurementCorrection> Corrections
|
||||
{
|
||||
get { return corrections; }
|
||||
set { corrections = value; }
|
||||
}
|
||||
IList<MeasurementCorrection> corrections;
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<Uncertainty> Uncertainties
|
||||
{
|
||||
get { return uncertainties; }
|
||||
set { uncertainties = value; }
|
||||
}
|
||||
IList<Uncertainty> uncertainties;
|
||||
[XmlIgnore] public int Id { get; set; }
|
||||
[XmlIgnore] public Generic.IComponentFactory Factory { get; set; }
|
||||
[XmlIgnore] public string ClassName { get { return Factory.ToString(); } }
|
||||
[XmlIgnore] public string Name { get; set; }
|
||||
[XmlIgnore] public string ParentName { get; set; }
|
||||
[XmlIgnore] public int ItemNr { get; set; }
|
||||
[XmlIgnore] public DebugMode DebugLevel { get; set; }
|
||||
[XmlIgnore] public LogLevel LogLevel { get; set; }
|
||||
[XmlIgnore] public IList<MeasurementCorrection> Corrections { get; set; }
|
||||
[XmlIgnore] public IList<Uncertainty> Uncertainties { get; set; }
|
||||
|
||||
|
||||
protected ComponentCfgBase()
|
||||
{
|
||||
itemNr = 0;
|
||||
debugLevel = DebugMode.Normal;
|
||||
logLevel = LogLevel.Off;
|
||||
ItemNr = 0;
|
||||
DebugLevel = DebugMode.Normal;
|
||||
LogLevel = LogLevel.Off;
|
||||
}
|
||||
|
||||
protected ComponentCfgBase(Generic.IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.factory = factory;
|
||||
Factory = factory;
|
||||
}
|
||||
|
||||
protected ComponentCfgBase(Generic.IComponentFactory factory, string name)
|
||||
: this(factory)
|
||||
{
|
||||
this.name = name;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
protected ComponentCfgBase(Generic.IComponentFactory factory, string name, string parentName)
|
||||
: this(factory, name)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
ParentName = parentName;
|
||||
}
|
||||
|
||||
|
||||
public virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); }
|
||||
|
||||
|
||||
public Component CreateDbEntity()
|
||||
{
|
||||
using (var writer = new StringWriter())
|
||||
{
|
||||
GetSerializer().Serialize(writer, this);
|
||||
return Component.CreateFromCfg(Name, factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString());
|
||||
return Component.CreateFromCfg(Name, Factory.ClassName, ParentName, ItemNr, DebugLevel, LogLevel, writer.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using Common;
|
||||
using TBF.Rig;
|
||||
|
||||
namespace TBF.Rig.Configs
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using Dirichlet.Numerics;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Rig.Modbus;
|
||||
using TBF.Rig.Sequences;
|
||||
@@ -250,7 +249,7 @@ namespace TBF.Rig.ControlBoard.Papouch
|
||||
|
||||
private void SendOutputs(int quidoIx, UInt128 outputs, int offset)
|
||||
{
|
||||
if (cbCfg.DebugLevel == Config.Entities.DebugMode.Normal)
|
||||
if (cbCfg.DebugLevel == Common.DebugMode.Normal)
|
||||
{
|
||||
byte addr = (byte)modbusAddresses[quidoIx];
|
||||
byte cmd = (byte)Function.ForceMultipleCoils;
|
||||
@@ -330,9 +329,9 @@ namespace TBF.Rig.ControlBoard.Papouch
|
||||
///
|
||||
public int RefPulses { get { return 0; } }
|
||||
public double TestTime { get { return 1.0; } }
|
||||
public int RefPulsesWM(int wmNr1) { return (wmNr1 > 0 && wmNr1 <= Config.Data.WMsCount) ? 0 : 0; }
|
||||
public int PulsesWM(int wmNr1) { return (wmNr1 > 0 && wmNr1 <= Config.Data.WMsCount) ? 0 : 0; }
|
||||
public double TestTimeWM(int wmNr1) { return (wmNr1 > 0 && wmNr1 <= Config.Data.WMsCount) ? 1.0 : 1.0; }
|
||||
public int RefPulsesWM(int wmNr1) { return (wmNr1 > 0 && wmNr1 <= ProcessData.WMsCount) ? 0 : 0; }
|
||||
public int PulsesWM(int wmNr1) { return (wmNr1 > 0 && wmNr1 <= ProcessData.WMsCount) ? 0 : 0; }
|
||||
public double TestTimeWM(int wmNr1) { return (wmNr1 > 0 && wmNr1 <= ProcessData.WMsCount) ? 1.0 : 1.0; }
|
||||
|
||||
|
||||
public void ClearProcessValues() { }
|
||||
@@ -420,8 +419,8 @@ namespace TBF.Rig.ControlBoard.Papouch
|
||||
/// <returns>Operation</returns>
|
||||
public IOperation SetFlowOp(double reqrdFlowLo, double reqrdFlowHi, TBF.Boxes.DoubleBox measuredFlow, int timeout)
|
||||
{
|
||||
string loLimStr = reqrdFlowLo.ToString(Config.Utils.SignificantDigitsToFmt(reqrdFlowLo, 2));
|
||||
string hiLimStr = reqrdFlowHi.ToString(Config.Utils.SignificantDigitsToFmt(reqrdFlowHi, 2));
|
||||
string loLimStr = reqrdFlowLo.ToString(Common.Utils.SignificantDigitsToFmt(reqrdFlowLo, 2));
|
||||
string hiLimStr = reqrdFlowHi.ToString(Common.Utils.SignificantDigitsToFmt(reqrdFlowHi, 2));
|
||||
this.promptMsg = string.Format("Set flow measured by {0} withing {1} and {2} m3/h by regulation valve {3}",
|
||||
devices.FlowMeter.Name, loLimStr, hiLimStr, devices.RegValve.Name);
|
||||
this.backColor = System.Drawing.Color.LightSalmon;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.ControlBoard.Papouch
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -11,6 +12,7 @@ using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using Dirichlet.Numerics;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Rig.Sequences;
|
||||
using TBF.UiBridge;
|
||||
@@ -57,18 +59,19 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
///
|
||||
/// Serial communication
|
||||
///
|
||||
SerialPort serialPort; /// Seral port or null: Check serialPort.IsOpen before using the serial port
|
||||
const int BUFFER_SIZE = 4000; /// Size of input buffers
|
||||
byte[] buffer; /// Buffer for data received in one attempt in RunDeviceBefore()
|
||||
byte[] rcvdData; /// Buffer for all recevied but nut processed data. May contain data from several read attempts
|
||||
int[] cumulativeSums; /// Cumulative sums to verify checksums easily
|
||||
int rcvdBytesCount; /// Count of valid bytes in rcvdData buffer
|
||||
int age0BytesCount; /// Just received bytes count
|
||||
int age1BytesCount; /// Count of bytes received 1 second ago
|
||||
DateTime lastSentTime; /// Time stamp of the last sent command/request frame
|
||||
DateTime lastReceivedTime; /// Time stamp of the last received valid frame
|
||||
int lastRcvdStMTime; /// StateMachine.Time time stamp of the last received valid frame
|
||||
bool outputsInitialized; /// Flag indicating that outputs were sent at least once
|
||||
SerialPort serialPort; /// Seral port or null, used in DebugMode.Normal, check serialPort.IsOpen before using it
|
||||
TextReader textReader; /// Used instead of serialPort in DebugMode.Simulate
|
||||
const int BUFFER_SIZE = 4000; /// Size of input buffers
|
||||
byte[] buffer; /// Buffer for data received in one attempt in RunDeviceBefore()
|
||||
byte[] rcvdData; /// Buffer for all recevied but nut processed data. May contain data from several read attempts
|
||||
int[] cumulativeSums; /// Cumulative sums to verify checksums easily
|
||||
int rcvdBytesCount; /// Count of valid bytes in rcvdData buffer
|
||||
int age0BytesCount; /// Just received bytes count
|
||||
int age1BytesCount; /// Count of bytes received 1 second ago
|
||||
DateTime lastSentTime; /// Time stamp of the last sent command/request frame
|
||||
DateTime lastReceivedTime; /// Time stamp of the last received valid frame
|
||||
int lastRcvdStMTime; /// StateMachine.Time time stamp of the last received valid frame
|
||||
bool outputsInitialized; /// Flag indicating that outputs were sent at least once
|
||||
|
||||
///
|
||||
/// Received data
|
||||
@@ -197,9 +200,9 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
scopeAnalyzerData = null;
|
||||
switchCounterData = null;
|
||||
|
||||
routeMask = 0xFF1EFFFF00;
|
||||
for (int i = 4; i < cbCfg.RegValvesCount; i++) routeMask &= ~((UInt128)3 << 2 * i);
|
||||
for (int i = 1; i < cbCfg.DivertersCount; i++) routeMask &= ~((UInt128)1 << 24 + i);
|
||||
routeMask = 0x0FF1EFFFF00;
|
||||
for (int i = 4; i < cbCfg.RegValvesCount; i++) routeMask &= ~(((UInt128)3) << (2 * i));
|
||||
for (int i = 1; i < cbCfg.DivertersCount; i++) routeMask &= ~(((UInt128)1) << (24 + i));
|
||||
if (cbCfg.RelaysFInstalled) routeMask |= 0xFF0000000000;
|
||||
if (cbCfg.RelaysGInstalled) routeMask |= 0xFF000000000000;
|
||||
if (cbCfg.RelaysHInstalled) routeMask |= 0xFF00000000000000;
|
||||
@@ -233,12 +236,33 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
serialPort.WriteTimeout = 4000;
|
||||
serialPort.ParityReplace = 0xFF;
|
||||
serialPort.Open();
|
||||
log.FatalFormat("{0} - Device successfully initialized", Name);
|
||||
log.FatalFormat("{0} initialized, routeMask = {1}", Name, Utils.ToBin88(routeMask));
|
||||
}
|
||||
else if (cbCfg.DebugLevel == DebugMode.Replay)
|
||||
{
|
||||
buffer = new byte[BUFFER_SIZE];
|
||||
rcvdData = new byte[BUFFER_SIZE];
|
||||
cumulativeSums = new int[BUFFER_SIZE];
|
||||
rcvdBytesCount = 0;
|
||||
age0BytesCount = 0;
|
||||
age1BytesCount = 0;
|
||||
|
||||
serialPort = null;
|
||||
try
|
||||
{
|
||||
textReader = new StreamReader("C:\\TBF\\Simulate\\unicbsim.txt");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new Exception("Missing file C:\\TBF\\Simulate\\unicbsim.txt");
|
||||
}
|
||||
|
||||
log.FatalFormat("{0} in replay mode, routeMask = {1}", Name, Utils.ToBin88(routeMask));
|
||||
}
|
||||
else
|
||||
{
|
||||
serialPort = null;
|
||||
log.FatalFormat("{0} - Device simulated", Name);
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,16 +275,39 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
/// Read data from the control board
|
||||
///
|
||||
bool generalDataReceived = false;
|
||||
if (cbCfg.DebugLevel == DebugMode.Normal && serialPort != null && serialPort.IsOpen)
|
||||
if ((cbCfg.DebugLevel == DebugMode.Normal && serialPort != null && serialPort.IsOpen) ||
|
||||
cbCfg.DebugLevel == DebugMode.Replay)
|
||||
{
|
||||
int age2BytesCount = age1BytesCount;
|
||||
age1BytesCount = age0BytesCount;
|
||||
age0BytesCount = serialPort.BytesToRead;
|
||||
|
||||
/// Read new received bytes and append them to an intermediate buffer 'buffer'
|
||||
if (age0BytesCount > 0)
|
||||
if (cbCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
age0BytesCount = serialPort.Read(buffer, 0, Math.Min(age0BytesCount, BUFFER_SIZE));
|
||||
age0BytesCount = serialPort.BytesToRead;
|
||||
|
||||
/// Read new received bytes and append them to an intermediate buffer 'buffer'
|
||||
if (age0BytesCount > 0)
|
||||
{
|
||||
age0BytesCount = serialPort.Read(buffer, 0, Math.Min(age0BytesCount, BUFFER_SIZE));
|
||||
}
|
||||
}
|
||||
else if (cbCfg.DebugLevel == DebugMode.Replay)
|
||||
{
|
||||
/// Simulation
|
||||
age0BytesCount = 0;
|
||||
string hexValues = textReader.ReadLine();
|
||||
if (hexValues != null)
|
||||
{
|
||||
string[] hexValuesSplit = hexValues.Split(' ');
|
||||
foreach (var hex in hexValuesSplit)
|
||||
{
|
||||
buffer[age0BytesCount++] = Convert.ToByte(hex, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
age0BytesCount = 0; /// No data
|
||||
}
|
||||
|
||||
StringBuilder dataLog = new StringBuilder();
|
||||
@@ -392,21 +439,22 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
///
|
||||
/// Handle emergency stop signal
|
||||
///
|
||||
bool newEmergencyStop = ((State & (ulong)StatusP.EmgcyStopActive) != 0);
|
||||
if (newEmergencyStop)
|
||||
bool emergencyStop = ((State & (UInt64)StatusP.EmgcyStopActive) != 0);
|
||||
///
|
||||
if (emergencyStop)
|
||||
route |= (((UInt128)1) << (cbCfg.BitNr + 1));
|
||||
else
|
||||
route &= ~(((UInt128)1) << (cbCfg.BitNr + 1));
|
||||
///
|
||||
if (emergencyStop && !isEmergencyStop)
|
||||
{
|
||||
/// Emergency stop ... set indicator bit
|
||||
route |= ((UInt128)1) << (cbCfg.BitNr + 1);
|
||||
|
||||
if (!isEmergencyStop)
|
||||
{
|
||||
/// Stop the cycle ... the same as pressing 'STOP' button in the BenchControlPanel
|
||||
TBF.UiBridge.Bridge.Ui2Bench(TBF.UiBridge.UI2BenchCmd.Stop);
|
||||
}
|
||||
TBF.UiBridge.Bridge.Ui2Bench(TBF.UiBridge.UI2BenchCmd.Stop); /// The same as pressing 'STOP' button in BenchControlPanel
|
||||
}
|
||||
isEmergencyStop = newEmergencyStop;
|
||||
///
|
||||
isEmergencyStop = emergencyStop;
|
||||
|
||||
log.DebugFormat("Route synced with RRoute and UI changes, new route = {0}", Utils.ToBin40((ulong)route >> 8));
|
||||
|
||||
log.DebugFormat("Route synced with RRoute and UI changes, new route = {0}", Utils.ToBin88(route));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Resources;
|
||||
@@ -14,7 +15,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
/// <summary>
|
||||
/// Holds backup and security options - serializable configuration.
|
||||
/// </summary>
|
||||
public class UniCBCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, IDrawingItemWithMeasuredVal, IRouteBasedDrawingItem
|
||||
public class UniCBCfg : ComponentCfgBase, IComponentCfg, IParamsProvider, IDrawingItemWithMeasuredVal, IRouteBasedDrawingItem
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(UniCBCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -46,14 +47,15 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
public int MsrdX { get; set; }
|
||||
public int MsrdY { get; set; }
|
||||
public Orient MsrdOrient { get; set; }
|
||||
public Config.Unit MsrdUnit { get; set; }
|
||||
public Common.Unit MsrdUnit { get; set; }
|
||||
public string MsrdFormat { get; set; }
|
||||
public double MsrdValLimLo { get; set; }
|
||||
public double MsrdValLimHi { get; set; }
|
||||
|
||||
public int BitNr { get { return 80; } } /// Bit-position
|
||||
[XmlIgnore]
|
||||
public int BitNr { get { return 80; } } /// Bit-position
|
||||
[XmlIgnore]
|
||||
public bool Inverted { get { return false; } } /// When true the valve function is inverted: 0 = open, 1 = closed
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<GNode> GNodes { get; set; }
|
||||
[XmlIgnore]
|
||||
@@ -207,7 +209,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
prms.ShowState = ShowState;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
var pars = new UniCBCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
public int SetpY { get; set; }
|
||||
public Orient SetpOrient { get; set; }
|
||||
public string SetpFormat { get; set; }
|
||||
public Config.Unit SetpUnit { get; set; }
|
||||
public Common.Unit SetpUnit { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<GNode> GNodes { get; set; }
|
||||
@@ -64,7 +64,7 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
Shape = Shape.PumpFM;
|
||||
Sz = Sz.M;
|
||||
SetpFormat = "{0:F0} %";
|
||||
SetpUnit = Config.Unit.Pct;
|
||||
SetpUnit = Common.Unit.Pct;
|
||||
|
||||
Name = "Pump-Danfoss";
|
||||
Factory = factory;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.IO.Ports;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -90,9 +91,9 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
|
||||
private void AbbientCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
for (Config.Unit units = 0; units < global::Config.Unit.Count; units++)
|
||||
for (Common.Unit units = 0; units < global::Common.Unit.Count; units++)
|
||||
{
|
||||
if (global::Config.Units.IsQuantity(units, global::Config.Quantity.Error))
|
||||
if (global::Common.Units.IsQuantity(units, Quantity.Error))
|
||||
{
|
||||
unitsComboBox.Items.Add(units.ToString());
|
||||
}
|
||||
@@ -158,8 +159,8 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
config.StopBits = GetStopBits(stopBitsComboBox.SelectedItem.ToString());
|
||||
|
||||
config.SetpFormat = formatTextBox.Text;
|
||||
config.SetpUnit = global::Config.Unit.None;
|
||||
for (Config.Unit units = 0; units < global::Config.Unit.Count; units++)
|
||||
config.SetpUnit = global::Common.Unit.None;
|
||||
for (Common.Unit units = 0; units < global::Common.Unit.Count; units++)
|
||||
{
|
||||
if (unitsComboBox.Text == units.ToString())
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2019-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using Common;
|
||||
|
||||
namespace TBF.Rig.DataContainer.BackupAndSecurityOptions
|
||||
{
|
||||
@@ -31,8 +32,8 @@ namespace TBF.Rig.DataContainer.BackupAndSecurityOptions
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Users.GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
|
||||
Users.GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
|
||||
GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
|
||||
GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace TBF.Rig.DataContainer.BackupAndSecurityOptions
|
||||
/// <summary>
|
||||
/// Holds backup and security options - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -106,7 +107,7 @@ namespace TBF.Rig.DataContainer.BackupAndSecurityOptions
|
||||
prms.PasswdExpirationPeriodDays = this.PasswdExpirationPeriodDays;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
///
|
||||
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2018-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.Generic;
|
||||
@@ -21,14 +22,21 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public string TestBenchName { get { return myCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return myCfg.TestBenchId; } }
|
||||
public string Address1 { get { return myCfg.Address1; } }
|
||||
public string Address2 { get { return myCfg.Address2; } }
|
||||
public string Address3 { get { return myCfg.Address3; } }
|
||||
public string Address4 { get { return myCfg.Address4; } }
|
||||
public string Address5 { get { return myCfg.Address5; } }
|
||||
public RemoteDBUse RemoteDBUse { get { return myCfg.RemoteDBUse; } }
|
||||
public string TestBenchName { get { return myCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return myCfg.TestBenchId; } }
|
||||
public string Address1 { get { return myCfg.Address1; } }
|
||||
public string Address2 { get { return myCfg.Address2; } }
|
||||
public string Address3 { get { return myCfg.Address3; } }
|
||||
public string Address4 { get { return myCfg.Address4; } }
|
||||
public string Address5 { get { return myCfg.Address5; } }
|
||||
public int WaterMetersCount { get { return myCfg.WaterMetersCount; } }
|
||||
public int LinesCount { get { return myCfg.LinesCount; } }
|
||||
public int CompoundMetersCount { get { return myCfg.CompoundMetersCount; } }
|
||||
|
||||
public ICollection<ProcedureSelection> Source
|
||||
{
|
||||
get { return new ProcedureSelection[] { myCfg.Source1, myCfg.Source2, myCfg.Source3, myCfg.Source4 }; }
|
||||
}
|
||||
|
||||
|
||||
public Component() { }
|
||||
@@ -42,7 +50,7 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Events.DB.SetBenchName(myCfg.TestBenchName);
|
||||
SharedDatabase.EventsDB.SetBenchName(myCfg.TestBenchName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2018-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -22,17 +23,23 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string TestBenchName;
|
||||
public int TestBenchId;
|
||||
public string Address1;
|
||||
public string Address2;
|
||||
public string Address3;
|
||||
public string Address4;
|
||||
public string Address5;
|
||||
public string ApprovalId;
|
||||
public string ApprovalDate;
|
||||
public string ApprovedBy;
|
||||
public RemoteDBUse RemoteDBUse;
|
||||
public string TestBenchName; /// 0
|
||||
public int TestBenchId; /// 1
|
||||
public string Address1; /// 2
|
||||
public string Address2; /// 3
|
||||
public string Address3; /// 4
|
||||
public string Address4; /// 5
|
||||
public string Address5; /// 6
|
||||
public string ApprovalId; /// 7
|
||||
public string ApprovalDate; /// 8
|
||||
public string ApprovedBy; /// 9
|
||||
public int WaterMetersCount; /// 10
|
||||
public int LinesCount; /// 11
|
||||
public int CompoundMetersCount; /// 12
|
||||
public ProcedureSelection Source1; /// 13
|
||||
public ProcedureSelection Source2; /// 14
|
||||
public ProcedureSelection Source3; /// 15
|
||||
public ProcedureSelection Source4; /// 16
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg() {}
|
||||
@@ -52,57 +59,75 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
{
|
||||
TestBenchName = "1";
|
||||
TestBenchId = 1;
|
||||
|
||||
Address1 = string.Empty;
|
||||
Address2 = string.Empty;
|
||||
Address3 = string.Empty;
|
||||
Address4 = string.Empty;
|
||||
Address5 = string.Empty;
|
||||
|
||||
ApprovalId = string.Empty;
|
||||
ApprovalDate = string.Empty;
|
||||
ApprovedBy = string.Empty;
|
||||
|
||||
RemoteDBUse = RemoteDBUse.LocalDBOnly;
|
||||
WaterMetersCount = 20;
|
||||
LinesCount = 2;
|
||||
CompoundMetersCount = 1;
|
||||
Source1 = ProcedureSelection.FromLocalDB;
|
||||
Source2 = ProcedureSelection.None;
|
||||
Source3 = ProcedureSelection.None;
|
||||
Source4 = ProcedureSelection.None;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
"Test bench name",
|
||||
"Test bench ID",
|
||||
"Address 1",
|
||||
"Address 2",
|
||||
"Address 3",
|
||||
"Address 4",
|
||||
"Address 5",
|
||||
"Approval",
|
||||
"Approval date",
|
||||
"Approved by",
|
||||
"Remote DB use",
|
||||
"Test bench name", /// 0
|
||||
"Test bench ID", /// 1
|
||||
"Address 1", /// 2
|
||||
"Address 2", /// 3
|
||||
"Address 3", /// 4
|
||||
"Address 4", /// 5
|
||||
"Address 5", /// 6
|
||||
"Approval", /// 7
|
||||
"Approval date", /// 8
|
||||
"Approved by", /// 9
|
||||
"Water meters count", /// 10
|
||||
"Lines count", /// 11
|
||||
"Compound meters count", /// 12
|
||||
"Procedure selection source 1", /// 13
|
||||
"Procedure selection source 2", /// 14
|
||||
"Procedure selection source 3", /// 15
|
||||
"Procedure selection source 4", /// 16
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
if (i == 10)
|
||||
switch (i)
|
||||
{
|
||||
return new string[] { RemoteDBUse.LocalDBOnly.ToString(),
|
||||
RemoteDBUse.RemoteDBOnly.ToString(),
|
||||
RemoteDBUse.BothDBsLocalFirst.ToString(),
|
||||
RemoteDBUse.BothDBsRemoteFirst.ToString() };
|
||||
}
|
||||
case 10:
|
||||
return new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "10", "12", "14", "16", "18", "20" };
|
||||
case 11:
|
||||
return new string[] { "1", "2", "3", "4" };
|
||||
case 12:
|
||||
return new string[] { "0", "1", "2", "3" };
|
||||
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
IList<string> items = new List<string>();
|
||||
for (ProcedureSelection src = 0; src < ProcedureSelection.Count; src++)
|
||||
{
|
||||
items.Add(src.ToDescription());
|
||||
}
|
||||
return items;
|
||||
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
if (i == -1)
|
||||
{
|
||||
return string.Format("{0}: Bench name={1}, Bench Id={2}, Procedures={3}", Name, TestBenchName, TestBenchId, RemoteDBUse.ToDescription());
|
||||
}
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0: return TestBenchName;
|
||||
@@ -115,49 +140,71 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
case 7: return ApprovalId;
|
||||
case 8: return ApprovalDate;
|
||||
case 9: return ApprovedBy;
|
||||
case 10: return RemoteDBUse.ToDescription();
|
||||
default: return string.Empty;
|
||||
case 10: return WaterMetersCount.ToString();
|
||||
case 11: return LinesCount.ToString();
|
||||
case 12: return CompoundMetersCount.ToString();
|
||||
case 13: return Source1.ToDescription();
|
||||
case 14: return Source2.ToDescription();
|
||||
case 15: return Source3.ToDescription();
|
||||
case 16: return Source4.ToDescription();
|
||||
default:
|
||||
return string.Format("{0}: Bench={1}, ID={2}, Mtrs={3}, Lines={4}, Compund mtrs={5}, S1={6}, S2={7}, S3={8}, S4={9}",
|
||||
Name, TestBenchName, TestBenchId, WaterMetersCount, LinesCount, CompoundMetersCount, Source1, Source2, Source3, Source4);
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string strValue)
|
||||
public CfgUpdateFlags UpdateParam(int i, string str)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: TestBenchName = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: TestBenchId = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: Address1 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: Address2 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: Address3 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: Address4 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: Address5 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: ApprovalId = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 8: ApprovalDate = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 9: ApprovedBy = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 0: TestBenchName = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: TestBenchId = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: Address1 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: Address2 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: Address3 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: Address4 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: Address5 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: ApprovalId = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 8: ApprovalDate = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 9: ApprovedBy = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 10: WaterMetersCount = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 11: LinesCount = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 12: CompoundMetersCount = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
case 10:
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
|
||||
case 13:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (strValue == rdbu.ToDescription())
|
||||
{
|
||||
if (RemoteDBUse != rdbu)
|
||||
{
|
||||
RemoteDBUse = rdbu;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
if (str == source.ToDescription()) { Source1 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
break;
|
||||
|
||||
case 14:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source2 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source3 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source4 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
public bool ValidateParam(int i, string str, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
int idummy;
|
||||
@@ -175,14 +222,26 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
case 9:
|
||||
return true;
|
||||
case 1:
|
||||
if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
|
||||
if (int.TryParse(str, out idummy) && (idummy >= 0)) return true;
|
||||
break;
|
||||
case 10:
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
|
||||
if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 20) return true;
|
||||
break;
|
||||
case 11:
|
||||
if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 4) return true;
|
||||
break;
|
||||
case 12:
|
||||
if (int.TryParse(str, out idummy) && idummy >= 0 && idummy <= 3) return true;
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (strValue == rdbu.ToDescription()) return true;
|
||||
if (str == source.ToDescription()) return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
@@ -204,10 +263,16 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
prms.ApprovalId = this.ApprovalId;
|
||||
prms.ApprovalDate = this.ApprovalDate;
|
||||
prms.ApprovedBy = this.ApprovedBy;
|
||||
prms.RemoteDBUse = this.RemoteDBUse;
|
||||
prms.WaterMetersCount = this.WaterMetersCount;
|
||||
prms.LinesCount = this.LinesCount;
|
||||
prms.CompoundMetersCount = this.CompoundMetersCount;
|
||||
prms.Source1 = this.Source1;
|
||||
prms.Source2 = this.Source2;
|
||||
prms.Source3 = this.Source3;
|
||||
prms.Source4 = this.Source4;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace TBF.Rig.DataContainer.Buoyancy
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Config.Data.Buoyancy = Buoyancy; /// This is to use Buoyancy from this component in formulas
|
||||
Common.Data.Buoyancy = Buoyancy; /// This is to use Buoyancy from this component in formulas
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace TBF.Rig.DataContainer.Buoyancy
|
||||
/// <summary>
|
||||
/// Holds backup and security options - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, TBF.Rig.GenericDevices.ICalibInfoCfg
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider, TBF.Rig.GenericDevices.ICalibInfoCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -105,7 +106,7 @@ namespace TBF.Rig.DataContainer.Buoyancy
|
||||
prms.Buoyancy = this.Buoyancy;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace TBF.Rig.DataContainer.Density
|
||||
public override void Initialize()
|
||||
{
|
||||
/// This is to use sample density and temp. from this component in formulas
|
||||
Config.Data.SampleDensity = SampleDensity;
|
||||
Config.Data.SampleTemp = SampleTemp;
|
||||
Common.Data.SampleDensity = SampleDensity;
|
||||
Common.Data.SampleTemp = SampleTemp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace TBF.Rig.DataContainer.Density
|
||||
/// <summary>
|
||||
/// Holds water density - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, TBF.Rig.GenericDevices.ICalibInfoCfg
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider, TBF.Rig.GenericDevices.ICalibInfoCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -115,7 +116,7 @@ namespace TBF.Rig.DataContainer.Density
|
||||
prms.SampleTemp = this.SampleTemp;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Resources;
|
||||
@@ -22,7 +23,7 @@ namespace TBF.Rig.DataContainer.Evaporation
|
||||
/// </summary>
|
||||
public double EvaporationRate(double temperature)
|
||||
{
|
||||
return Config.Formulas.GetCorrection(temperature, Corrections) / 3600.0; /// Converted from kg/h to kg/s
|
||||
return MeasurementCorrection.GetCorrection(temperature, Corrections) / 3600.0; /// Converted from kg/h to kg/s
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.Generic;
|
||||
@@ -22,16 +23,23 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public string TestBenchName { get { return myCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return myCfg.TestBenchId; } }
|
||||
public string Address1 { get { return myCfg.Address1; } }
|
||||
public string Address2 { get { return myCfg.Address2; } }
|
||||
public string Address3 { get { return myCfg.Address3; } }
|
||||
public string Address4 { get { return myCfg.Address4; } }
|
||||
public string Address5 { get { return myCfg.Address5; } }
|
||||
public RemoteDBUse RemoteDBUse { get { return myCfg.RemoteDBUse; } }
|
||||
public Side Side { get { return myCfg.Side; } }
|
||||
public int MaxTestIndex { get { return myCfg.MaxTestIndex; } } /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
public string TestBenchName { get { return myCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return myCfg.TestBenchId; } }
|
||||
public string Address1 { get { return myCfg.Address1; } }
|
||||
public string Address2 { get { return myCfg.Address2; } }
|
||||
public string Address3 { get { return myCfg.Address3; } }
|
||||
public string Address4 { get { return myCfg.Address4; } }
|
||||
public string Address5 { get { return myCfg.Address5; } }
|
||||
public int WaterMetersCount { get { return myCfg.WaterMetersCount; } }
|
||||
public int LinesCount { get { return myCfg.LinesCount; } }
|
||||
public int CompoundMetersCount { get { return myCfg.CompoundMetersCount; } }
|
||||
public Side Side { get { return myCfg.Side; } }
|
||||
public int MaxTestIndex { get { return myCfg.MaxTestIndex; } } /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
|
||||
public ICollection<ProcedureSelection> Source
|
||||
{
|
||||
get { return new ProcedureSelection[] { myCfg.Source1, myCfg.Source2, myCfg.Source3, myCfg.Source4 }; }
|
||||
}
|
||||
|
||||
|
||||
public Component() { }
|
||||
@@ -45,7 +53,7 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Events.DB.SetBenchName(myCfg.TestBenchName);
|
||||
SharedDatabase.EventsDB.SetBenchName(myCfg.TestBenchName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2018-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
@@ -13,7 +14,7 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider, TBF.Rig.GenericDevices.ICalibInfoCfg
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider, TBF.Rig.GenericDevices.ICalibInfoCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -23,19 +24,25 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string TestBenchName;
|
||||
public int TestBenchId;
|
||||
public string Address1;
|
||||
public string Address2;
|
||||
public string Address3;
|
||||
public string Address4;
|
||||
public string Address5;
|
||||
public string ApprovalId;
|
||||
public string ApprovalDate;
|
||||
public string ApprovedBy;
|
||||
public RemoteDBUse RemoteDBUse;
|
||||
public Side Side;
|
||||
public int MaxTestIndex; /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
public string TestBenchName; /// 0
|
||||
public int TestBenchId; /// 1
|
||||
public string Address1; /// 2
|
||||
public string Address2; /// 3
|
||||
public string Address3; /// 4
|
||||
public string Address4; /// 5
|
||||
public string Address5; /// 6
|
||||
public string ApprovalId; /// 7
|
||||
public string ApprovalDate; /// 8
|
||||
public string ApprovedBy; /// 9
|
||||
public int WaterMetersCount; /// 10
|
||||
public int LinesCount; /// 11
|
||||
public int CompoundMetersCount; /// 12
|
||||
public Side Side; /// 13
|
||||
public int MaxTestIndex; /// 14 (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
public ProcedureSelection Source1; /// 15
|
||||
public ProcedureSelection Source2; /// 16
|
||||
public ProcedureSelection Source3; /// 17
|
||||
public ProcedureSelection Source4; /// 18
|
||||
|
||||
/// Calibration info serialized parameters displayed in Metrology tab page
|
||||
string calibCertificateNr;
|
||||
@@ -76,69 +83,83 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
{
|
||||
TestBenchName = "1";
|
||||
TestBenchId = 1;
|
||||
|
||||
Address1 = string.Empty;
|
||||
Address2 = string.Empty;
|
||||
Address3 = string.Empty;
|
||||
Address4 = string.Empty;
|
||||
Address5 = string.Empty;
|
||||
|
||||
ApprovalId = string.Empty;
|
||||
ApprovalDate = string.Empty;
|
||||
ApprovedBy = string.Empty;
|
||||
|
||||
RemoteDBUse = RemoteDBUse.LocalDBOnly;
|
||||
WaterMetersCount = 20;
|
||||
LinesCount = 2;
|
||||
CompoundMetersCount = 1;
|
||||
Side = Side.Left;
|
||||
MaxTestIndex = 4;
|
||||
Source1 = ProcedureSelection.FromSharedDB;
|
||||
Source2 = ProcedureSelection.FromLocalDB;
|
||||
Source3 = ProcedureSelection.None;
|
||||
Source4 = ProcedureSelection.None;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
"Test bench name",
|
||||
"Test bench ID",
|
||||
"Address 1",
|
||||
"Address 2",
|
||||
"Address 3",
|
||||
"Address 4",
|
||||
"Address 5",
|
||||
"Approval",
|
||||
"Approval date",
|
||||
"Approved by",
|
||||
"Remote DB use",
|
||||
Strings.Side,
|
||||
"Max.test index",
|
||||
"Test bench name", /// 0
|
||||
"Test bench ID", /// 1
|
||||
"Address 1", /// 2
|
||||
"Address 2", /// 3
|
||||
"Address 3", /// 4
|
||||
"Address 4", /// 5
|
||||
"Address 5", /// 6
|
||||
"Approval", /// 7
|
||||
"Approval date", /// 8
|
||||
"Approved by", /// 9
|
||||
"Water meters count", /// 10
|
||||
"Lines count", /// 11
|
||||
"Compound meters count", /// 12
|
||||
Strings.Side, /// 13
|
||||
"Max.test index", /// 14
|
||||
"Procedure selection source 1", /// 15
|
||||
"Procedure selection source 2", /// 16
|
||||
"Procedure selection source 3", /// 17
|
||||
"Procedure selection source 4", /// 18
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
if (i == 10)
|
||||
switch (i)
|
||||
{
|
||||
return new string[] { RemoteDBUse.LocalDBOnly.ToString(),
|
||||
RemoteDBUse.RemoteDBOnly.ToString(),
|
||||
RemoteDBUse.BothDBsLocalFirst.ToString(),
|
||||
RemoteDBUse.BothDBsRemoteFirst.ToString() };
|
||||
}
|
||||
else if (i == 11)
|
||||
{
|
||||
IList<string> list = new List<string>();
|
||||
for (Side side = 0; side < Side.Count; side++) list.Add(side.ToDescription());
|
||||
return list;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
case 10:
|
||||
return new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "10", "12", "14", "16", "18", "20" };
|
||||
case 11:
|
||||
return new string[] { "1", "2", "3", "4" };
|
||||
case 12:
|
||||
return new string[] { "0", "1", "2", "3" };
|
||||
case 13:
|
||||
IList<string> list = new List<string>();
|
||||
for (Side side = 0; side < Side.Count; side++) list.Add(side.ToDescription());
|
||||
return list;
|
||||
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
IList<string> items = new List<string>();
|
||||
for (ProcedureSelection src = 0; src < ProcedureSelection.Count; src++)
|
||||
{
|
||||
items.Add(src.ToDescription());
|
||||
}
|
||||
return items;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
if (i == -1)
|
||||
{
|
||||
return string.Format("{0}: Bench name={1}, Bench Id={2}, Procedures={3}", Name, TestBenchName, TestBenchId, RemoteDBUse.ToDescription());
|
||||
}
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0: return TestBenchName;
|
||||
@@ -151,50 +172,43 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
case 7: return ApprovalId;
|
||||
case 8: return ApprovalDate;
|
||||
case 9: return ApprovedBy;
|
||||
case 10: return RemoteDBUse.ToDescription();
|
||||
case 11: return Side.ToDescription();
|
||||
case 12: return MaxTestIndex.ToString();
|
||||
default: return string.Empty;
|
||||
case 10: return WaterMetersCount.ToString();
|
||||
case 11: return LinesCount.ToString();
|
||||
case 12: return CompoundMetersCount.ToString();
|
||||
case 13: return Side.ToDescription();
|
||||
case 14: return MaxTestIndex.ToString();
|
||||
case 15: return Source1.ToDescription();
|
||||
case 16: return Source2.ToDescription();
|
||||
case 17: return Source3.ToDescription();
|
||||
case 18: return Source4.ToDescription();
|
||||
default:
|
||||
return string.Format("{0}: Bench={1}, ID={2}, Mtrs={3}, Lines={4}, Compund mtrs={5}, S1={6}, S2={7}, S3={8}, S4={9}",
|
||||
Name, TestBenchName, TestBenchId, WaterMetersCount, LinesCount, CompoundMetersCount, Source1, Source2, Source3, Source4);
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string strValue)
|
||||
public CfgUpdateFlags UpdateParam(int i, string str)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: TestBenchName = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: TestBenchId = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: Address1 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: Address2 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: Address3 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: Address4 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: Address5 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: ApprovalId = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 8: ApprovalDate = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 9: ApprovedBy = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 0: TestBenchName = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: TestBenchId = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: Address1 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: Address2 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: Address3 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: Address4 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: Address5 = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: ApprovalId = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 8: ApprovalDate = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 9: ApprovedBy = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 10: WaterMetersCount = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 11: LinesCount = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 12: CompoundMetersCount = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
case 10:
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
|
||||
{
|
||||
if (strValue == rdbu.ToDescription())
|
||||
{
|
||||
if (RemoteDBUse != rdbu)
|
||||
{
|
||||
RemoteDBUse = rdbu;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
|
||||
case 11:
|
||||
case 13:
|
||||
for (Side side = 0; side < Side.Count; side++)
|
||||
{
|
||||
if (strValue == side.ToDescription())
|
||||
if (str == side.ToDescription())
|
||||
{
|
||||
if (Side != side)
|
||||
{
|
||||
@@ -209,12 +223,42 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
|
||||
case 12: MaxTestIndex = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 14: MaxTestIndex = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
case 15:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source1 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source2 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
case 17:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source3 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
case 18:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) { Source4 = source; return CfgUpdateFlags.RestartRqrd; }
|
||||
}
|
||||
break;
|
||||
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
public bool ValidateParam(int i, string str, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
int idummy;
|
||||
@@ -232,19 +276,31 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
case 9:
|
||||
return true;
|
||||
case 1:
|
||||
case 12:
|
||||
if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
|
||||
break;
|
||||
case 10:
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
|
||||
{
|
||||
if (strValue == rdbu.ToDescription()) return true;
|
||||
}
|
||||
if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 20) return true;
|
||||
break;
|
||||
case 11:
|
||||
if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 4) return true;
|
||||
break;
|
||||
case 12:
|
||||
if (int.TryParse(str, out idummy) && idummy >= 0 && idummy <= 3) return true;
|
||||
break;
|
||||
case 13:
|
||||
for (Side side = 0; side < Side.Count; side++)
|
||||
{
|
||||
if (strValue == side.ToDescription()) return true;
|
||||
if (str == side.ToDescription()) return true;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (int.TryParse(str, out idummy) && (idummy >= 0)) return true;
|
||||
break;
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
for (ProcedureSelection source = 0; source < ProcedureSelection.Count; source++)
|
||||
{
|
||||
if (str == source.ToDescription()) return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -268,12 +324,18 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
prms.ApprovalId = this.ApprovalId;
|
||||
prms.ApprovalDate = this.ApprovalDate;
|
||||
prms.ApprovedBy = this.ApprovedBy;
|
||||
prms.RemoteDBUse = this.RemoteDBUse;
|
||||
prms.WaterMetersCount = this.WaterMetersCount;
|
||||
prms.LinesCount = this.LinesCount;
|
||||
prms.CompoundMetersCount = this.CompoundMetersCount;
|
||||
prms.Side = this.Side;
|
||||
prms.MaxTestIndex = this.MaxTestIndex;
|
||||
prms.Source1 = this.Source1;
|
||||
prms.Source2 = this.Source2;
|
||||
prms.Source3 = this.Source3;
|
||||
prms.Source4 = this.Source4;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
|
||||
@@ -44,9 +44,9 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
/// Default constructor - Default number of compound water meters
|
||||
/// </summary>
|
||||
public CycleBeginningForm()
|
||||
: this (Config.Data.CompoundWMsCount, false)
|
||||
: this (Common.Data.CompoundWMsCount, false)
|
||||
{
|
||||
this.WaterMetersCount = Config.Data.CompoundWMsCount;
|
||||
this.WaterMetersCount = Common.Data.CompoundWMsCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -35,10 +35,10 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
InitializeComponent();
|
||||
ControlBox = false;
|
||||
|
||||
MainStateText = new string[Config.Data.CompoundWMsCount];
|
||||
AuxStateText = new string[Config.Data.CompoundWMsCount];
|
||||
QRise = new float[Config.Data.CompoundWMsCount];
|
||||
QFall = new float[Config.Data.CompoundWMsCount];
|
||||
MainStateText = new string[Common.Data.CompoundWMsCount];
|
||||
AuxStateText = new string[Common.Data.CompoundWMsCount];
|
||||
QRise = new float[Common.Data.CompoundWMsCount];
|
||||
QFall = new float[Common.Data.CompoundWMsCount];
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
qRise1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||
qFall1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||
|
||||
if (Config.Data.CompoundWMsCount >= 2)
|
||||
if (Common.Data.CompoundWMsCount >= 2)
|
||||
{
|
||||
qRise2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||
qFall2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||
@@ -88,7 +88,7 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
Height = 305;
|
||||
}
|
||||
|
||||
if (Config.Data.CompoundWMsCount >= 3)
|
||||
if (Common.Data.CompoundWMsCount >= 3)
|
||||
{
|
||||
qRise3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||
qFall3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||
@@ -109,7 +109,7 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
if (Utils.TryParseUFloat(qRise1TextBox.Text, out ftmp)) { QRise[0] = ftmp; } else { allOK = false; }
|
||||
if (Utils.TryParseUFloat(qFall1TextBox.Text, out ftmp)) { QFall[0] = ftmp; } else { allOK = false; }
|
||||
|
||||
if (Config.Data.CompoundWMsCount >= 2)
|
||||
if (Common.Data.CompoundWMsCount >= 2)
|
||||
{
|
||||
MainStateText[1] = mainState2TextBox.Text;
|
||||
AuxStateText[1] = auxState2TextBox.Text;
|
||||
@@ -117,7 +117,7 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
if (Utils.TryParseUFloat(qFall2TextBox.Text, out ftmp)) { QFall[1] = ftmp; } else { allOK = false; }
|
||||
}
|
||||
|
||||
if (Config.Data.CompoundWMsCount >= 3)
|
||||
if (Common.Data.CompoundWMsCount >= 3)
|
||||
{
|
||||
MainStateText[2] = mainState3TextBox.Text;
|
||||
AuxStateText[2] = auxState3TextBox.Text;
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.CompoundWMsCount];
|
||||
wmStartState = new double[Config.Data.CompoundWMsCount * 2];
|
||||
wmStartStateStr = new string[Config.Data.CompoundWMsCount * 2];
|
||||
wmEndState = new double[Config.Data.CompoundWMsCount * 2];
|
||||
wmCycleEndState = new string[Config.Data.CompoundWMsCount * 2];
|
||||
disabled = new bool[Common.Data.CompoundWMsCount];
|
||||
wmStartState = new double[Common.Data.CompoundWMsCount * 2];
|
||||
wmStartStateStr = new string[Common.Data.CompoundWMsCount * 2];
|
||||
wmEndState = new double[Common.Data.CompoundWMsCount * 2];
|
||||
wmCycleEndState = new string[Common.Data.CompoundWMsCount * 2];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
///
|
||||
void OpenBeginningDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Config.Data.CompoundWMsCount, myRef.entryFormCfg.RemarkEnabled);
|
||||
myRef.modelessDlg = new CycleBeginningForm(Common.Data.CompoundWMsCount, myRef.entryFormCfg.RemarkEnabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
@@ -139,20 +139,20 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.CompoundWMsCount, myRef.regReaders, myRef.disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.CompoundWMsCount, myRef.regReaders, myRef.disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryForm myRef)
|
||||
{
|
||||
string[] mainStartStateStr = new string[Config.Data.CompoundWMsCount];
|
||||
string[] auxStartStateStr = new string[Config.Data.CompoundWMsCount];
|
||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
||||
string[] mainStartStateStr = new string[Common.Data.CompoundWMsCount];
|
||||
string[] auxStartStateStr = new string[Common.Data.CompoundWMsCount];
|
||||
for (int i = 0; i < Common.Data.CompoundWMsCount; i++)
|
||||
{
|
||||
mainStartStateStr[i] = wmStartStateStr[2 * i];
|
||||
auxStartStateStr[i] = wmStartStateStr[2 * i + 1];
|
||||
}
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.CompoundWMsCount, myRef.regReaders, mainStartStateStr, auxStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.CompoundWMsCount, myRef.regReaders, mainStartStateStr, auxStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -136,9 +136,9 @@ namespace TBF.Rig.DataEntry.Combined
|
||||
/// </summary>
|
||||
void ShuffleTextBoxes()
|
||||
{
|
||||
if (Config.Data.CompoundWMsCount < TextBoxesCount)
|
||||
if (Common.Data.CompoundWMsCount < TextBoxesCount)
|
||||
{
|
||||
TextBoxesCount = Config.Data.CompoundWMsCount;
|
||||
TextBoxesCount = Common.Data.CompoundWMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace TBF.Rig.DataEntry.Fewa
|
||||
suffixText = new string[WMsCount];
|
||||
Disabled = new bool[WMsCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace TBF.Rig.DataEntry.Fewa
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
wmCycleEndState = new string[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -126,25 +126,25 @@ namespace TBF.Rig.DataEntry.Fewa
|
||||
///
|
||||
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleBeginningForm(Common.Data.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
myRef.modelessDlg = new CycleEndForm(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, myRef.disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, myRef.disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,18 +152,18 @@ namespace TBF.Rig.DataEntry.Fewa
|
||||
{
|
||||
if (TextBoxesCount > WMsCount)
|
||||
{
|
||||
int nrLines = WMsCount / Config.Data.LineSize;
|
||||
int nrLines = WMsCount / Common.Data.LineSize;
|
||||
int gap = (TextBoxesCount - WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
foreach (var wm in waterMeters) if (wm != null) wm.Passed = wm.PassedFromTests();
|
||||
|
||||
|
||||
@@ -83,14 +83,14 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.HeatMetersCount];
|
||||
wmStartState = new double[Config.Data.HeatMetersCount];
|
||||
wmStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
wmEndState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
energyEndState = new double[Config.Data.HeatMetersCount];
|
||||
wmCycleEndState = new string[Config.Data.HeatMetersCount];
|
||||
disabled = new bool[Common.Data.HeatMetersCount];
|
||||
wmStartState = new double[Common.Data.HeatMetersCount];
|
||||
wmStartStateStr = new string[Common.Data.HeatMetersCount];
|
||||
wmEndState = new double[Common.Data.HeatMetersCount];
|
||||
energyStartState = new double[Common.Data.HeatMetersCount];
|
||||
energyStartStateStr = new string[Common.Data.HeatMetersCount];
|
||||
energyEndState = new double[Common.Data.HeatMetersCount];
|
||||
wmCycleEndState = new string[Common.Data.HeatMetersCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = Math.Min(waterMeters.Count, Config.Data.HeatMetersCount);
|
||||
int count = Math.Min(waterMeters.Count, Common.Data.HeatMetersCount);
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
@@ -263,7 +263,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Config.Data.HeatMetersCount); i++)
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Common.Data.HeatMetersCount); i++)
|
||||
{
|
||||
wmStartState[i] = dlg.WMStartState[i];
|
||||
wmStartStateStr[i] = dlg.WMStartStateStr[i];
|
||||
@@ -278,7 +278,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Config.Data.HeatMetersCount); i++)
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Common.Data.HeatMetersCount); i++)
|
||||
{
|
||||
wmEndState[i] = dlg.WMEndState[i];
|
||||
energyEndState[i] = dlg.EnergyEndState[i];
|
||||
|
||||
@@ -17,13 +17,13 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public Config.Unit DefaultUnits;
|
||||
public Common.Unit DefaultUnits;
|
||||
public bool EnterSerialNrsAtTheEnd;
|
||||
public bool ShowCycleEndForm;
|
||||
public bool SensusExtensions;
|
||||
|
||||
[XmlIgnore]
|
||||
public Config.Unit Units;
|
||||
public Common.Unit Units;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
@@ -37,7 +37,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
|
||||
DefaultUnits = Config.Unit.kWh;
|
||||
DefaultUnits = Common.Unit.kWh;
|
||||
EnterSerialNrsAtTheEnd = false;
|
||||
ShowCycleEndForm = false;
|
||||
SensusExtensions = false;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -177,26 +177,26 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
/// </summary>
|
||||
void ShuffleTextBoxes()
|
||||
{
|
||||
if (Config.Data.HeatMetersCount < TextBoxesCount)
|
||||
if (Common.Data.HeatMetersCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Math.Max(1, Config.Data.HeatMetersCount / Config.Data.LineSize);
|
||||
int gap = (TextBoxesCount - Config.Data.HeatMetersCount) / nrLines;
|
||||
int nrLines = Math.Max(1, Common.Data.HeatMetersCount / Common.Data.LineSize);
|
||||
int gap = (TextBoxesCount - Common.Data.HeatMetersCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
energyLabels[dest] = energyLabels[l * Config.Data.LineSize + l * gap + i];
|
||||
energyStartTextBoxes[dest] = energyStartTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
energyEndTextBoxes[dest] = energyEndTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
energyLabels[dest] = energyLabels[l * Common.Data.LineSize + l * gap + i];
|
||||
energyStartTextBoxes[dest] = energyStartTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
energyEndTextBoxes[dest] = energyEndTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Config.Data.HeatMetersCount;
|
||||
TextBoxesCount = Common.Data.HeatMetersCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,9 +204,9 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
{
|
||||
Localize();
|
||||
|
||||
for (Config.Unit units = 0; units < Config.Unit.Count; units++)
|
||||
for (Common.Unit units = 0; units < Common.Unit.Count; units++)
|
||||
{
|
||||
if (Config.Units.IsEnergy(units)) unitsComboBox.Items.Add(units.ToString());
|
||||
if (Common.Units.IsEnergy(units)) unitsComboBox.Items.Add(units.ToString());
|
||||
}
|
||||
unitsComboBox.Text = entryFormCfg.Units.ToString();
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
|
||||
private void unitsComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
|
||||
for (Common.Unit u = 0; u < Common.Unit.Count; u++)
|
||||
{
|
||||
if (u.ToString() == unitsComboBox.Text)
|
||||
{
|
||||
@@ -304,7 +304,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
if (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
|
||||
{
|
||||
WMEndState[i] = Utils.ParseUDouble(endTextBoxes[i].Text);
|
||||
EnergyEndState[i] = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyEndTextBoxes[i].Text));
|
||||
EnergyEndState[i] = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyEndTextBoxes[i].Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
WMStartStateStr[i] = startTextBoxes[i].Text;
|
||||
WMStartState[i] = Utils.ParseUDouble(startTextBoxes[i].Text);
|
||||
EnergyStartStateStr[i] = energyStartTextBoxes[i].Text;
|
||||
EnergyStartState[i] = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyStartTextBoxes[i].Text));
|
||||
EnergyStartState[i] = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyStartTextBoxes[i].Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -507,8 +507,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox13.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox13.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox13.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox13.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -519,8 +519,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox14.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox14.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox14.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox14.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -531,8 +531,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox15.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox15.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox15.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox15.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -543,8 +543,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox16.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox16.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox16.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox16.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -555,8 +555,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox17.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox17.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox17.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox17.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -567,8 +567,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox18.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox18.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox18.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox18.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -579,8 +579,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox19.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox19.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox19.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox19.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -591,8 +591,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox20.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox20.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox20.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox20.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -603,8 +603,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox21.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox21.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox21.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox21.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -615,8 +615,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox22.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox22.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox22.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox22.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -627,8 +627,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox23.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox23.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox23.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox23.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -639,8 +639,8 @@ namespace TBF.Rig.DataEntry.HeatMeters12
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox24.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox24.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox24.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox24.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
foreach (var wm in waterMeters) if (wm != null) wm.Passed = wm.PassedFromTests();
|
||||
|
||||
|
||||
@@ -83,14 +83,14 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.HeatMetersCount];
|
||||
wmStartState = new double[Config.Data.HeatMetersCount];
|
||||
wmStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
wmEndState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
energyEndState = new double[Config.Data.HeatMetersCount];
|
||||
wmCycleEndState = new string[Config.Data.HeatMetersCount];
|
||||
disabled = new bool[Common.Data.HeatMetersCount];
|
||||
wmStartState = new double[Common.Data.HeatMetersCount];
|
||||
wmStartStateStr = new string[Common.Data.HeatMetersCount];
|
||||
wmEndState = new double[Common.Data.HeatMetersCount];
|
||||
energyStartState = new double[Common.Data.HeatMetersCount];
|
||||
energyStartStateStr = new string[Common.Data.HeatMetersCount];
|
||||
energyEndState = new double[Common.Data.HeatMetersCount];
|
||||
wmCycleEndState = new string[Common.Data.HeatMetersCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = Math.Min(waterMeters.Count, Config.Data.HeatMetersCount);
|
||||
int count = Math.Min(waterMeters.Count, Common.Data.HeatMetersCount);
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
@@ -262,7 +262,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Config.Data.HeatMetersCount); i++)
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Common.Data.HeatMetersCount); i++)
|
||||
{
|
||||
wmStartState[i] = dlg.WMStartState[i];
|
||||
wmStartStateStr[i] = dlg.WMStartStateStr[i];
|
||||
@@ -277,7 +277,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Config.Data.HeatMetersCount); i++)
|
||||
for (int i = 0; i < Math.Min(waterMeters.Count, Common.Data.HeatMetersCount); i++)
|
||||
{
|
||||
wmEndState[i] = dlg.WMEndState[i];
|
||||
energyEndState[i] = dlg.EnergyEndState[i];
|
||||
|
||||
@@ -17,13 +17,13 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public Config.Unit DefaultUnits;
|
||||
public Common.Unit DefaultUnits;
|
||||
public bool EnterSerialNrsAtTheEnd;
|
||||
public bool ShowCycleEndForm;
|
||||
public bool SensusExtensions;
|
||||
|
||||
[XmlIgnore]
|
||||
public Config.Unit Units;
|
||||
public Common.Unit Units;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
@@ -37,7 +37,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
|
||||
DefaultUnits = Config.Unit.kWh;
|
||||
DefaultUnits = Common.Unit.kWh;
|
||||
EnterSerialNrsAtTheEnd = false;
|
||||
ShowCycleEndForm = false;
|
||||
SensusExtensions = false;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -169,26 +169,26 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
/// </summary>
|
||||
void ShuffleTextBoxes()
|
||||
{
|
||||
if (Config.Data.HeatMetersCount < TextBoxesCount)
|
||||
if (Common.Data.HeatMetersCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Math.Max(1, Config.Data.HeatMetersCount / Config.Data.LineSize);
|
||||
int gap = (TextBoxesCount - Config.Data.HeatMetersCount) / nrLines;
|
||||
int nrLines = Math.Max(1, Common.Data.HeatMetersCount / Common.Data.LineSize);
|
||||
int gap = (TextBoxesCount - Common.Data.HeatMetersCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
energyLabels[dest] = energyLabels[l * Config.Data.LineSize + l * gap + i];
|
||||
energyStartTextBoxes[dest] = energyStartTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
energyEndTextBoxes[dest] = energyEndTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
energyLabels[dest] = energyLabels[l * Common.Data.LineSize + l * gap + i];
|
||||
energyStartTextBoxes[dest] = energyStartTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
energyEndTextBoxes[dest] = energyEndTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Config.Data.HeatMetersCount;
|
||||
TextBoxesCount = Common.Data.HeatMetersCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,9 +196,9 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
{
|
||||
Localize();
|
||||
|
||||
for (Config.Unit units = 0; units < Config.Unit.Count; units++)
|
||||
for (Common.Unit units = 0; units < Common.Unit.Count; units++)
|
||||
{
|
||||
if (Config.Units.IsEnergy(units)) unitsComboBox.Items.Add(units.ToString());
|
||||
if (Common.Units.IsEnergy(units)) unitsComboBox.Items.Add(units.ToString());
|
||||
}
|
||||
unitsComboBox.Text = entryFormCfg.Units.ToString();
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
|
||||
private void unitsComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
|
||||
for (Common.Unit u = 0; u < Common.Unit.Count; u++)
|
||||
{
|
||||
if (u.ToString() == unitsComboBox.Text)
|
||||
{
|
||||
@@ -296,7 +296,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
if (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
|
||||
{
|
||||
WMEndState[i] = Utils.ParseUDouble(endTextBoxes[i].Text);
|
||||
EnergyEndState[i] = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyEndTextBoxes[i].Text));
|
||||
EnergyEndState[i] = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyEndTextBoxes[i].Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
WMStartStateStr[i] = startTextBoxes[i].Text;
|
||||
WMStartState[i] = Utils.ParseUDouble(startTextBoxes[i].Text);
|
||||
EnergyStartStateStr[i] = energyStartTextBoxes[i].Text;
|
||||
EnergyStartState[i] = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyStartTextBoxes[i].Text));
|
||||
EnergyStartState[i] = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(energyStartTextBoxes[i].Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -426,8 +426,8 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox13.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox13.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox13.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox13.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -438,8 +438,8 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox14.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox14.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox14.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox14.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -450,8 +450,8 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox15.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox15.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox15.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox15.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -462,8 +462,8 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox16.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox16.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox16.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox16.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -474,8 +474,8 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox17.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox17.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox17.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox17.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
@@ -486,8 +486,8 @@ namespace TBF.Rig.DataEntry.HeatMeters6
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox18.Text));
|
||||
double startState = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox18.Text));
|
||||
double endState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(endTextBox18.Text));
|
||||
double startState = Common.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUDouble(startTextBox18.Text));
|
||||
err = 100.0 * (endState - startState - refEnergy) / refEnergy;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using SharedDatabase;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class BarcodeReceivedEventArgs : EventArgs
|
||||
{
|
||||
public string Barcode;
|
||||
|
||||
/// <summary>
|
||||
/// ID of a part in this workstep:
|
||||
/// 0 undefined
|
||||
/// 1 reference part
|
||||
/// 2..99 parts with unique codes
|
||||
/// 100.. parts with batch numbers
|
||||
/// </summary>
|
||||
public int IxPolozky;
|
||||
|
||||
public CodeLocation CodeLocation;
|
||||
public PartError Error;
|
||||
|
||||
public BarcodeReceivedEventArgs(string barcode, int ixPolozky, CodeLocation codeLocation)
|
||||
{
|
||||
this.Barcode = barcode;
|
||||
this.IxPolozky = ixPolozky;
|
||||
this.CodeLocation = codeLocation;
|
||||
}
|
||||
|
||||
public BarcodeReceivedEventArgs(string barcode, int ixPolozky, CodeLocation codeLocation, PartError error)
|
||||
: this(barcode, ixPolozky, codeLocation)
|
||||
{
|
||||
this.Error = error;
|
||||
}
|
||||
}
|
||||
|
||||
public enum PartError
|
||||
{
|
||||
None,
|
||||
WrongPart, /// S/N or P/N of a part is wrong
|
||||
FieldEmpty, /// A required field in UI is empty
|
||||
PrviousRecordMissing, /// Previous record in the tracing DB is missing
|
||||
BlacklistedPart, /// S/N of a part is on a black list
|
||||
ValueOutOfRange, /// Measured value is out of range
|
||||
UnspecifiedError, /// Other unspecified error
|
||||
Count
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class BodySerNrResult
|
||||
{
|
||||
public string BodyNr;
|
||||
public int SerialNr;
|
||||
public int Result;
|
||||
|
||||
public BodySerNrResult(string bodyNr, int serialNr, int result)
|
||||
{
|
||||
BodyNr = bodyNr;
|
||||
SerialNr = serialNr;
|
||||
Result = result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}-{1}-{2}", BodyNr, SerialNr, Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
namespace TBF.Rig.DataEntry.S620.CheckItems
|
||||
{
|
||||
partial class Barcode
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.kodMaterialuLabel = new System.Windows.Forms.Label();
|
||||
this.scannedCodeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.setFocusButton = new System.Windows.Forms.Button();
|
||||
this.descriptionMaterialuLabel = new System.Windows.Forms.Label();
|
||||
this.blackListLabel = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kodMaterialuLabel
|
||||
//
|
||||
this.kodMaterialuLabel.AutoSize = true;
|
||||
this.kodMaterialuLabel.Location = new System.Drawing.Point(42, -5);
|
||||
this.kodMaterialuLabel.Name = "kodMaterialuLabel";
|
||||
this.kodMaterialuLabel.Size = new System.Drawing.Size(122, 24);
|
||||
this.kodMaterialuLabel.TabIndex = 1;
|
||||
this.kodMaterialuLabel.Text = "kod materialu";
|
||||
//
|
||||
// scannedCodeTextBox
|
||||
//
|
||||
this.scannedCodeTextBox.Location = new System.Drawing.Point(239, 3);
|
||||
this.scannedCodeTextBox.Name = "scannedCodeTextBox";
|
||||
this.scannedCodeTextBox.Size = new System.Drawing.Size(240, 29);
|
||||
this.scannedCodeTextBox.TabIndex = 3;
|
||||
this.scannedCodeTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.scannedCodeTextBox_KeyPress);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = TBF.Properties.Resources.Barcode;
|
||||
this.pictureBox1.InitialImage = null;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(499, 1);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBox1.TabIndex = 2;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// setFocusButton
|
||||
//
|
||||
this.setFocusButton.Location = new System.Drawing.Point(2, 1);
|
||||
this.setFocusButton.Name = "setFocusButton";
|
||||
this.setFocusButton.Size = new System.Drawing.Size(32, 32);
|
||||
this.setFocusButton.TabIndex = 0;
|
||||
this.setFocusButton.UseVisualStyleBackColor = true;
|
||||
this.setFocusButton.Click += new System.EventHandler(this.setFocusButton_Click);
|
||||
//
|
||||
// descriptionMaterialuLabel
|
||||
//
|
||||
this.descriptionMaterialuLabel.AutoSize = true;
|
||||
this.descriptionMaterialuLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.descriptionMaterialuLabel.Location = new System.Drawing.Point(43, 25);
|
||||
this.descriptionMaterialuLabel.Name = "descriptionMaterialuLabel";
|
||||
this.descriptionMaterialuLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.descriptionMaterialuLabel.TabIndex = 2;
|
||||
this.descriptionMaterialuLabel.Text = "opis materialu";
|
||||
//
|
||||
// blackListLabel
|
||||
//
|
||||
this.blackListLabel.AutoSize = true;
|
||||
this.blackListLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.blackListLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.blackListLabel.Location = new System.Drawing.Point(480, 5);
|
||||
this.blackListLabel.Name = "blackListLabel";
|
||||
this.blackListLabel.Size = new System.Drawing.Size(19, 25);
|
||||
this.blackListLabel.TabIndex = 4;
|
||||
this.blackListLabel.Text = "!";
|
||||
this.blackListLabel.Visible = false;
|
||||
//
|
||||
// Polozka
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.blackListLabel);
|
||||
this.Controls.Add(this.descriptionMaterialuLabel);
|
||||
this.Controls.Add(this.setFocusButton);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.scannedCodeTextBox);
|
||||
this.Controls.Add(this.kodMaterialuLabel);
|
||||
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.Margin = new System.Windows.Forms.Padding(6);
|
||||
this.Name = "Polozka";
|
||||
this.Size = new System.Drawing.Size(547, 36);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label kodMaterialuLabel;
|
||||
private System.Windows.Forms.TextBox scannedCodeTextBox;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Button setFocusButton;
|
||||
private System.Windows.Forms.Label descriptionMaterialuLabel;
|
||||
private System.Windows.Forms.Label blackListLabel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
///
|
||||
/// Copyright (c) 2020-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using SharedDatabase;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620.CheckItems
|
||||
{
|
||||
public partial class Barcode : UserControl, ICheckItem
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(": {0} {1}({2})", IxPolozky, Part.Name, string.IsNullOrEmpty(Part.OraDBType) ? string.Empty : Part.OraDBType);
|
||||
}
|
||||
|
||||
FormForMechanicalMetersWithTracing parent;
|
||||
|
||||
public SharedDatabase.Entities.Part Part { get { return part; } }
|
||||
SharedDatabase.Entities.Part part;
|
||||
|
||||
public int IxPolozky
|
||||
{
|
||||
get { return ixPolozky; }
|
||||
set { ixPolozky = value; }
|
||||
}
|
||||
int ixPolozky;
|
||||
|
||||
public string ScannedCode
|
||||
{
|
||||
get { return scannedCodeTextBox.Text; }
|
||||
set { scannedCodeTextBox.Text = value; }
|
||||
}
|
||||
|
||||
Barcode()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Barcode(FormForMechanicalMetersWithTracing parent, SharedDatabase.Entities.Part part)
|
||||
: this()
|
||||
{
|
||||
this.parent = parent;
|
||||
this.part = part;
|
||||
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
|
||||
kodMaterialuLabel.Text = part.Name;
|
||||
descriptionMaterialuLabel.Text = part.Description;
|
||||
|
||||
if (part.CodeForm == CodeForm.Barcode)
|
||||
{
|
||||
try
|
||||
{
|
||||
Stream imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Pracovisko.Barcode.png");
|
||||
pictureBox1.Image = new Bitmap(imageStream);
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearCode()
|
||||
{
|
||||
if (part.CodeType != CodeType.Silicon)
|
||||
{
|
||||
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public void SubmitCode(string code)
|
||||
{
|
||||
scannedCodeTextBox.Text = code;
|
||||
scannedCodeTextBox_KeyPress(null, new KeyPressEventArgs('\r'));
|
||||
}
|
||||
|
||||
public void ResetFocus()
|
||||
{
|
||||
setFocusButton.Text = "";
|
||||
}
|
||||
|
||||
public void SetFocus()
|
||||
{
|
||||
ClearCode();
|
||||
setFocusButton.Text = ">";
|
||||
scannedCodeTextBox.Focus();
|
||||
}
|
||||
|
||||
private void setFocusButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
setFocusButton.Text = ">";
|
||||
parent.OnFocusPressed(this, new FocusPressedEventArgs(IxPolozky, Part.CodeLocation));
|
||||
}
|
||||
|
||||
private void scannedCodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar != '\r') return;
|
||||
|
||||
PartError error = PartError.None;
|
||||
if (string.IsNullOrEmpty(scannedCodeTextBox.Text))
|
||||
{
|
||||
error = PartError.FieldEmpty;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (part.CodeType)
|
||||
{
|
||||
case CodeType.FlowtubeNr:
|
||||
if ((scannedCodeTextBox.Text.Length < 3) || !scannedCodeTextBox.Text.Substring(0, 3).Equals(part.Name.Substring(part.Name.Length - 3)))
|
||||
{
|
||||
error = PartError.WrongPart;
|
||||
}
|
||||
break;
|
||||
|
||||
case CodeType.FlowtubeNrLU:
|
||||
if ((scannedCodeTextBox.Text.Length < part.Name.Length ||
|
||||
!scannedCodeTextBox.Text.Substring(0, part.Name.Length).Equals(part.Name)))
|
||||
{
|
||||
error = PartError.WrongPart;
|
||||
}
|
||||
break;
|
||||
|
||||
case CodeType.BatchNrContainingPartName:
|
||||
if (!scannedCodeTextBox.Text.Contains(part.Name))
|
||||
{
|
||||
error = PartError.WrongPart;
|
||||
}
|
||||
break;
|
||||
|
||||
case CodeType.DateMMYY:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(scannedCodeTextBox.Text, IxPolozky, Part.CodeLocation, error));
|
||||
}
|
||||
}
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
namespace TBF.Rig.DataEntry.S620.CheckItems
|
||||
{
|
||||
partial class Keyboard
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Keyboard));
|
||||
this.kodMaterialuLabel = new System.Windows.Forms.Label();
|
||||
this.scannedCodeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.setFocusButton = new System.Windows.Forms.Button();
|
||||
this.descriptionMaterialuLabel = new System.Windows.Forms.Label();
|
||||
this.blackListLabel = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kodMaterialuLabel
|
||||
//
|
||||
this.kodMaterialuLabel.AutoSize = true;
|
||||
this.kodMaterialuLabel.Location = new System.Drawing.Point(42, -5);
|
||||
this.kodMaterialuLabel.Name = "kodMaterialuLabel";
|
||||
this.kodMaterialuLabel.Size = new System.Drawing.Size(122, 24);
|
||||
this.kodMaterialuLabel.TabIndex = 1;
|
||||
this.kodMaterialuLabel.Text = "kod materialu";
|
||||
//
|
||||
// scannedCodeTextBox
|
||||
//
|
||||
this.scannedCodeTextBox.Location = new System.Drawing.Point(239, 3);
|
||||
this.scannedCodeTextBox.Name = "scannedCodeTextBox";
|
||||
this.scannedCodeTextBox.Size = new System.Drawing.Size(228, 29);
|
||||
this.scannedCodeTextBox.TabIndex = 3;
|
||||
this.scannedCodeTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.scannedCodeTextBox_KeyPress);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.InitialImage = null;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(493, -9);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(48, 48);
|
||||
this.pictureBox1.TabIndex = 2;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// setFocusButton
|
||||
//
|
||||
this.setFocusButton.Location = new System.Drawing.Point(2, 1);
|
||||
this.setFocusButton.Name = "setFocusButton";
|
||||
this.setFocusButton.Size = new System.Drawing.Size(32, 32);
|
||||
this.setFocusButton.TabIndex = 0;
|
||||
this.setFocusButton.UseVisualStyleBackColor = true;
|
||||
this.setFocusButton.Click += new System.EventHandler(this.setFocusButton_Click);
|
||||
//
|
||||
// descriptionMaterialuLabel
|
||||
//
|
||||
this.descriptionMaterialuLabel.AutoSize = true;
|
||||
this.descriptionMaterialuLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.descriptionMaterialuLabel.Location = new System.Drawing.Point(43, 25);
|
||||
this.descriptionMaterialuLabel.Name = "descriptionMaterialuLabel";
|
||||
this.descriptionMaterialuLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.descriptionMaterialuLabel.TabIndex = 2;
|
||||
this.descriptionMaterialuLabel.Text = "opis materialu";
|
||||
//
|
||||
// blackListLabel
|
||||
//
|
||||
this.blackListLabel.AutoSize = true;
|
||||
this.blackListLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.blackListLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.blackListLabel.Location = new System.Drawing.Point(470, 5);
|
||||
this.blackListLabel.Name = "blackListLabel";
|
||||
this.blackListLabel.Size = new System.Drawing.Size(19, 25);
|
||||
this.blackListLabel.TabIndex = 5;
|
||||
this.blackListLabel.Text = "!";
|
||||
this.blackListLabel.Visible = false;
|
||||
//
|
||||
// PolozkaKbd
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.blackListLabel);
|
||||
this.Controls.Add(this.descriptionMaterialuLabel);
|
||||
this.Controls.Add(this.setFocusButton);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.scannedCodeTextBox);
|
||||
this.Controls.Add(this.kodMaterialuLabel);
|
||||
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.Margin = new System.Windows.Forms.Padding(6);
|
||||
this.Name = "PolozkaKbd";
|
||||
this.Size = new System.Drawing.Size(547, 36);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label kodMaterialuLabel;
|
||||
private System.Windows.Forms.TextBox scannedCodeTextBox;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Button setFocusButton;
|
||||
private System.Windows.Forms.Label descriptionMaterialuLabel;
|
||||
private System.Windows.Forms.Label blackListLabel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using SharedDatabase;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620.CheckItems
|
||||
{
|
||||
public partial class Keyboard : UserControl, ICheckItem
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Kbd: {0} {1}({2})", IxPolozky, Part.Name, string.IsNullOrEmpty(Part.OraDBType) ? string.Empty : Part.OraDBType);
|
||||
}
|
||||
|
||||
FormForMechanicalMetersWithTracing parent;
|
||||
|
||||
public SharedDatabase.Entities.Part Part { get { return part; } }
|
||||
SharedDatabase.Entities.Part part;
|
||||
|
||||
public int IxPolozky
|
||||
{
|
||||
get { return ixPolozky; }
|
||||
set { ixPolozky = value; }
|
||||
}
|
||||
int ixPolozky;
|
||||
|
||||
public string ScannedCode
|
||||
{
|
||||
get { return scannedCodeTextBox.Text; }
|
||||
set
|
||||
{
|
||||
#if false
|
||||
if (part.CodeType == CodeType.PO && parent.ValidOrderNumbers != null)
|
||||
{
|
||||
/// Counting pieces produced for a specified PO
|
||||
|
||||
if (!parent.ValidOrderNumbers.Contains(value))
|
||||
{
|
||||
/// Code is not a valid order number
|
||||
scannedCodeTextBox.Text = string.Format("{0} !!!", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
scannedCodeTextBox.Text = value;
|
||||
int pcsCount;
|
||||
if (parent.TargetPcsCounts.TryGetValue(scannedCodeTextBox.Text, out pcsCount))
|
||||
{
|
||||
parent.UpdateTargetPiecesCount(scannedCodeTextBox.Text, pcsCount, Part.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
scannedCodeTextBox.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Keyboard()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Keyboard(FormForMechanicalMetersWithTracing parent, SharedDatabase.Entities.Part part)
|
||||
: this()
|
||||
{
|
||||
this.parent = parent;
|
||||
this.part = part;
|
||||
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
|
||||
kodMaterialuLabel.Text = part.Name;
|
||||
descriptionMaterialuLabel.Text = part.Description;
|
||||
}
|
||||
|
||||
public void ClearCode()
|
||||
{
|
||||
if (part.CodeType != CodeType.Silicon)
|
||||
{
|
||||
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public void SubmitCode(string code)
|
||||
{
|
||||
scannedCodeTextBox.Text = code;
|
||||
scannedCodeTextBox_KeyPress(null, new KeyPressEventArgs('\r'));
|
||||
}
|
||||
|
||||
public void ResetFocus()
|
||||
{
|
||||
setFocusButton.Text = "";
|
||||
}
|
||||
|
||||
public void SetFocus()
|
||||
{
|
||||
ClearCode();
|
||||
setFocusButton.Text = ">";
|
||||
scannedCodeTextBox.Focus();
|
||||
}
|
||||
|
||||
private void setFocusButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
setFocusButton.Text = ">";
|
||||
parent.OnFocusPressed(this, new FocusPressedEventArgs(IxPolozky, Part.CodeLocation));
|
||||
}
|
||||
|
||||
private void scannedCodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar != '\r') return;
|
||||
|
||||
PartError error = PartError.None;
|
||||
///
|
||||
if (string.IsNullOrEmpty(scannedCodeTextBox.Text))
|
||||
{
|
||||
error = PartError.FieldEmpty;
|
||||
}
|
||||
#if false
|
||||
else if (part.CodeType == CodeType.PO && parent.ValidOrderNumbers != null)
|
||||
{
|
||||
/// Counting pieces produced for a specified PO
|
||||
|
||||
int pcsCount;
|
||||
if (!parent.ValidOrderNumbers.Contains(scannedCodeTextBox.Text))
|
||||
{
|
||||
parent.UpdateTargetPiecesCount(string.Empty, -1, 0);
|
||||
error = PartError.WrongPart;
|
||||
}
|
||||
else if (parent.TargetPcsCounts.TryGetValue(scannedCodeTextBox.Text, out pcsCount))
|
||||
{
|
||||
parent.UpdateTargetPiecesCount(scannedCodeTextBox.Text, pcsCount, Part.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.UpdateTargetPiecesCount(string.Empty, -1, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(scannedCodeTextBox.Text, IxPolozky, Part.CodeLocation, error));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAMGSURBVGhD7Zk9axVBGIVXRURFFJRAQLESVBRBEUlhVFAsLS0DgmhlCHYWamcjWIqNFkpsxBQB
|
||||
LfUHiDYKdtqIWAbEL/DjPEPey8ly57KLCeyEPfAsM2dmZ953d2Z3c1P16rVER8VZsSvVCtRj8UdcSrUC
|
||||
9UyQwLlUK0xrxRdBAnsxShNr/6/4JEimKO0RHwUJXMfouraII2JKPBBfBUvnjdgoOqkz4pHgShMsVzv4
|
||||
LZ6K7aJz4mrPCw/6p3gr5sQ1cVB0Vk8EwS+Im+KQWC+K0HHBFWeNH8AoTfcECdxOtQL1WrB8uBMrqk3i
|
||||
iuBb5Pky8ktwB16a978QI7ESc9KYeCf8KZEre71J/yblUW2jysRM7NVDgfleXBDnOw4xEisxE3v1TfAi
|
||||
2U+lEBErMRN7yuQ7hcJEzCyl8hPg4AkcFp+NWYGuCvcvCnRfuD8h0AcRHmVEm/flXMRY7jMXYm73iS2U
|
||||
vQPHBA34wKML3RDUo21aIL5nvP8JgWICvBifNh+DcxFjxfm0MRdibveJLbR6EuAwLIHAE3C/nkBQTwA8
|
||||
Ae/rCbjvCbjf6A6sERuM+HJcJ9ynjmh3n/ORe4CWa2yUTYBXNJ+8wxgXaKdwf5tA+4T7/G0L7tEHcY77
|
||||
jImYw31n8PkgDRLg4AnUl5BzS6C7wn3ekIinjftbF3Evnkic4z5jIuZw32m0hCIB3zxRricQfj2B8CMB
|
||||
yuF7AtGPNk/AfS+vzgQ4eAKs0RcZ4uU1I9w/JRCfuu5vXsQ9+iDOcZ8xEXO478T+Qdk7UIqyCewQ/F4T
|
||||
nBaIp4D7cTW4ku63Ie4cY7nPXIi53Se20CCB+hKKPRC0fZG1YUVeZPVN7AlQj7Z6AtG/TdkT8DZPwP1G
|
||||
m7j4O7Bb3DHinw38euz+pED8ied+GzgXMZb7zIWY231iC2UTKEVLEvghSvpNnliJOSUQb8+4nSWIWIk5
|
||||
vdUvi9jlrwQbq8sQI7ESM7EnsetZU5iRzLCy13N92pZHteXKxBpPqoH46DopeAJ0GWIk1l69epWvqvoH
|
||||
eo2RB75S02kAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
namespace TBF.Rig.DataEntry.S620.CheckItems
|
||||
{
|
||||
partial class OkNok
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OkNok));
|
||||
this.kodMaterialuLabel = new System.Windows.Forms.Label();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.setFocusButton = new System.Windows.Forms.Button();
|
||||
this.descriptionMaterialuLabel = new System.Windows.Forms.Label();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// kodMaterialuLabel
|
||||
//
|
||||
this.kodMaterialuLabel.AutoSize = true;
|
||||
this.kodMaterialuLabel.Location = new System.Drawing.Point(42, -5);
|
||||
this.kodMaterialuLabel.Name = "kodMaterialuLabel";
|
||||
this.kodMaterialuLabel.Size = new System.Drawing.Size(122, 24);
|
||||
this.kodMaterialuLabel.TabIndex = 1;
|
||||
this.kodMaterialuLabel.Text = "kod materialu";
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.InitialImage = null;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(493, -8);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(48, 48);
|
||||
this.pictureBox1.TabIndex = 2;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// setFocusButton
|
||||
//
|
||||
this.setFocusButton.Location = new System.Drawing.Point(2, 1);
|
||||
this.setFocusButton.Name = "setFocusButton";
|
||||
this.setFocusButton.Size = new System.Drawing.Size(32, 32);
|
||||
this.setFocusButton.TabIndex = 0;
|
||||
this.setFocusButton.UseVisualStyleBackColor = true;
|
||||
this.setFocusButton.Click += new System.EventHandler(this.setFocusButton_Click);
|
||||
//
|
||||
// descriptionMaterialuLabel
|
||||
//
|
||||
this.descriptionMaterialuLabel.AutoSize = true;
|
||||
this.descriptionMaterialuLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.descriptionMaterialuLabel.Location = new System.Drawing.Point(43, 25);
|
||||
this.descriptionMaterialuLabel.Name = "descriptionMaterialuLabel";
|
||||
this.descriptionMaterialuLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.descriptionMaterialuLabel.TabIndex = 2;
|
||||
this.descriptionMaterialuLabel.Text = "opis materialu";
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Location = new System.Drawing.Point(239, 3);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(108, 28);
|
||||
this.checkBox1.TabIndex = 3;
|
||||
this.checkBox1.Text = "Vyhovuje";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
||||
//
|
||||
// checkBox2
|
||||
//
|
||||
this.checkBox2.AutoSize = true;
|
||||
this.checkBox2.Location = new System.Drawing.Point(353, 3);
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.Size = new System.Drawing.Size(129, 28);
|
||||
this.checkBox2.TabIndex = 4;
|
||||
this.checkBox2.Text = "Nevyhovuje";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
|
||||
//
|
||||
// PolozkaOkNok
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.checkBox2);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.descriptionMaterialuLabel);
|
||||
this.Controls.Add(this.setFocusButton);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.kodMaterialuLabel);
|
||||
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.Margin = new System.Windows.Forms.Padding(6);
|
||||
this.Name = "PolozkaOkNok";
|
||||
this.Size = new System.Drawing.Size(547, 36);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label kodMaterialuLabel;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Button setFocusButton;
|
||||
private System.Windows.Forms.Label descriptionMaterialuLabel;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using SharedDatabase;
|
||||
using SharedDatabase.Entities;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620.CheckItems
|
||||
{
|
||||
public partial class OkNok : UserControl, ICheckItem
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Ok/Nok: {0} {1}({2})", IxPolozky, Part.Name, string.IsNullOrEmpty(Part.OraDBType) ? string.Empty : Part.OraDBType);
|
||||
}
|
||||
|
||||
FormForMechanicalMetersWithTracing parent;
|
||||
|
||||
public SharedDatabase.Entities.Part Part { get { return part; } }
|
||||
SharedDatabase.Entities.Part part;
|
||||
|
||||
public int IxPolozky
|
||||
{
|
||||
get { return ixPolozky; }
|
||||
set { ixPolozky = value; }
|
||||
}
|
||||
int ixPolozky;
|
||||
|
||||
public string ScannedCode
|
||||
{
|
||||
get { return checkBox1.Checked ? "OK" : "NOK"; }
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
checkBox2.Checked = false;
|
||||
}
|
||||
else if (value.ToLower().Equals("ok"))
|
||||
{
|
||||
checkBox1.Checked = true;
|
||||
checkBox2.Checked = false;
|
||||
}
|
||||
else if (value.ToLower().Equals("nok"))
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
checkBox2.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
checkBox2.Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OkNok()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public OkNok(FormForMechanicalMetersWithTracing parent, SharedDatabase.Entities.Part part)
|
||||
: this()
|
||||
{
|
||||
this.parent = parent;
|
||||
this.part = part;
|
||||
kodMaterialuLabel.Text = part.Name;
|
||||
descriptionMaterialuLabel.Text = part.Description;
|
||||
}
|
||||
|
||||
public void ClearCode()
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
checkBox2.Checked = false;
|
||||
}
|
||||
|
||||
public void SubmitCode(string code)
|
||||
{
|
||||
ScannedCode = code;
|
||||
scannedCodeTextBox_KeyPress(null, new KeyPressEventArgs('\r'));
|
||||
}
|
||||
|
||||
public void ResetFocus()
|
||||
{
|
||||
setFocusButton.Text = "";
|
||||
}
|
||||
|
||||
public void SetFocus()
|
||||
{
|
||||
setFocusButton.Text = ">";
|
||||
checkBox1.Checked = false;
|
||||
checkBox2.Checked = false;
|
||||
checkBox1.Focus();
|
||||
}
|
||||
|
||||
private void setFocusButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
setFocusButton.Text = ">";
|
||||
parent.OnFocusPressed(this, new FocusPressedEventArgs(IxPolozky, Part.CodeLocation));
|
||||
}
|
||||
|
||||
private void scannedCodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar != '\r') return;
|
||||
|
||||
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(ScannedCode, IxPolozky, Part.CodeLocation));
|
||||
return;
|
||||
}
|
||||
|
||||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkBox1.Checked)
|
||||
{
|
||||
checkBox2.Checked = false;
|
||||
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(ScannedCode, IxPolozky, Part.CodeLocation));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void checkBox2_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (checkBox2.Checked)
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(ScannedCode, IxPolozky, Part.CodeLocation));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAQvSURBVGhD7Zl76N5THMd/zH2Yu00uLbfSxB/IJWVkkuxPl6X9g1gtyv6Y8IdI5JZWSCGzrCYl
|
||||
UlKShr8oFLnkWpQS0dxv2+v1bJ/67Ox8L8+en/2e1fOuV99zzvd8z/dzzvM5n3PO95maaKKJJvo/tCcc
|
||||
DnsMcjuJDoJb4D34DzbC3/AGXAm7wFhqFtwEP4FGh/Fl+hWwk2OlefA6aGgf3oV9YSy0AL6BPNJfw3I4
|
||||
FNR8eBJyndUw4zoHfgQNCuNWwT5Q020QHfB6MkyLdodz4XpYuQVHcCE0GXM+/AoaIn/AZdCl7Gp3WTCK
|
||||
ToKnYAPknzenf4N1cCZkfQVR52c4D/roWoh3vGDB9mg2PAb/QM3oWvpfeAYOBvU+WK7xZ1nQU1dAtPuq
|
||||
BcPqCPgAfPmwOFmPA2XkuQ6OHeT6606I9h63YBhp/MeQRziuTelfQP/W+BNgFLlWfAnxjqXQW9n4bGBT
|
||||
BzT4EtgV9oK5EHKL8ABYPoz8xfLA7A+9dRR8DqWxtQ7k0T4bnOwh9zUvgfXutqCnfL8hN95xH/TSnC1X
|
||||
ZSOfgY00kY0Pf9WFLrYA3QNR1wh1CHRpb3gL4rnv4ADoVLjNvYPcZh0N0Yk86pE+HZTG5/LXQN0MuXwF
|
||||
dGkN5GcuhU6VPp9/suxOuQPWV4a6XG5a/1VPQy5fD21yZc5t9Vq8wngfzJSdKN3pI1BXQy6PUT4NdKd8
|
||||
73fYDWq6A3Ld58Gg0CoXKeN8jFAeLa81d4o6+r+T1D27I/c93ADqFDBfa/MYKOXWOu57fRmMXp16BMoX
|
||||
lOmaO7XF+TC+qc0zIOsC8BAT9ZzA+0GnTgUftOEuyk4cvzk5kCPlxu5y0Gfzpq1G7rhRz8GIex9CL+OV
|
||||
e24fKkeoTEc+u1NI443zfdox7R4pL0i2Gfc8neWBaZWx1tWtz4tzvlxQHoWyfls6Ipdy/rm5i3vLoEn+
|
||||
KoZXw/NgoXTv7kPbQ1d0auN+CF0IUf4tNEWnw+BtiLpPwMBnayNUS+d8XNuiU1ub+VR1FcS95yyo6ET4
|
||||
BOJ5uQYGky0Ko5GmdM7n8lp0KuvkdGnkYoh7X4BuneVnlR8g6tjWrTCQGysLRqWvO7kx836WESjmoXh8
|
||||
vAiWgN+F8vN/wlZz5EaIXuUe1tI5X6vT5U5/gYbV5Eet3FYt7WbOM/VWssGuByOd8011mtzJY2jbQcSt
|
||||
wsPQ1K6Rx8+N2+hAKPcpo1J24lPoe4pyNV4Lnp3fBH9VvyG1ylO+L671PKdzvqt+dqdee5lRZK998XTj
|
||||
IWaH6UVoG9Ey31Qn0l0+P+1ygrgKNhlU5pvqmN7hxoc8eOQDdGlczjfVmTHjQ854o4ZGDYur5SKYcbnN
|
||||
fQhc9TQsRjePdi53a/wsuHiNlY6E2+Ed0DXKDrglfhA64/Q4yFjujtBjogaPzT8lE0000U6rqalN3afe
|
||||
HgkVr1gAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,24 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class ColorFlashEventArgs : EventArgs
|
||||
{
|
||||
public int FlashTime;
|
||||
public Color FlashColor;
|
||||
public int BeepTime;
|
||||
public int BeepFrequency;
|
||||
|
||||
public ColorFlashEventArgs(int flashTime, Color flashColor, int beepTime, int beepFrequency)
|
||||
{
|
||||
FlashTime = flashTime;
|
||||
FlashColor = flashColor;
|
||||
BeepTime = beepTime;
|
||||
BeepFrequency = beepFrequency;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.GenericDevices;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
readonly TBF.Rig.Output.DB.ProductionTracing.Tracing tracing;
|
||||
|
||||
IRegReader[] regReaders;
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin, End and WMStates form
|
||||
/// </summary>
|
||||
bool[] disabled; /// This array is shared between forms
|
||||
|
||||
string[] wmCycleEndState;
|
||||
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
|
||||
|
||||
double[] wmStartState;
|
||||
public double WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
|
||||
|
||||
double[] wmEndState;
|
||||
public double WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
|
||||
|
||||
string[] wmStartStateStr;
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<Results.Entities.WaterMeter> waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
ShowFormAtCycleBeginning,
|
||||
ShowFormAtCycleEnd,
|
||||
EnterTestStartStates,
|
||||
EnterTestEndStates,
|
||||
}
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
tracing = string.IsNullOrEmpty(cfg.ParentName)
|
||||
? null
|
||||
: TbfComponents.FindComponent(cfg.ParentName, components) as TBF.Rig.Output.DB.ProductionTracing.Tracing;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
wmCycleEndState = new string[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<Results.Entities.WaterMeter> waterMeters)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestStartFormOp(IRegReader[] regReaders)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestStartStates;
|
||||
this.regReaders = regReaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>null (not implemented)</returns>
|
||||
public IOperation ShowAdvancedTestStartFormOp(IRegReader[] regReaders, IList<Results.Entities.WaterMeter> waterMeters, bool isCondOp) { return null; }
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestEndFormOp(IRegReader[] regReaders, double refVolume, double errLimLo, double errLimHi)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestEndStates;
|
||||
this.regReaders = regReaders;
|
||||
this.refVolume = refVolume;
|
||||
this.errLimLo = errLimLo;
|
||||
this.errLimHi = errLimHi;
|
||||
return this;
|
||||
}
|
||||
|
||||
delegate void EntryFormDlgt(EntryForm myRef);
|
||||
///
|
||||
void OnCycleStart(EntryForm myRef)
|
||||
{
|
||||
if (entryFormCfg.ProductionTracing)
|
||||
{
|
||||
myRef.modelessDlg = new FormForMechanicalMetersWithTracing(waterMeters, entryFormCfg.MaxWMsCount, entryFormCfg.CloseButton, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
myRef.modelessDlg = new FormForMechanicalMeters(waterMeters, entryFormCfg.MaxWMsCount, entryFormCfg.CloseButton, false, false);
|
||||
}
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OnCycleEnd(EntryForm myRef)
|
||||
{
|
||||
if (entryFormCfg.ProductionTracing)
|
||||
{
|
||||
myRef.modelessDlg = new FormForMechanicalMetersWithTracing(waterMeters, entryFormCfg.MaxWMsCount, entryFormCfg.CloseButton, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
myRef.modelessDlg = new FormForMechanicalMeters(waterMeters, entryFormCfg.MaxWMsCount, entryFormCfg.CloseButton, true, false);
|
||||
}
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
resultSaved = false;
|
||||
switch (currentOp)
|
||||
{
|
||||
default:
|
||||
case CurrentOp.ShowFormAtCycleBeginning:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OnCycleStart), this);
|
||||
return;
|
||||
|
||||
case CurrentOp.ShowFormAtCycleEnd:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OnCycleEnd), this);
|
||||
break;
|
||||
|
||||
case CurrentOp.EnterTestStartStates:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestStartStatesDlg), this);
|
||||
break;
|
||||
|
||||
case CurrentOp.EnterTestEndStates:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestEndStatesDlg), this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
|
||||
{
|
||||
return Event.ModelessFormIsOpen;
|
||||
}
|
||||
|
||||
if (!resultSaved) /// This is to save the result only once
|
||||
{
|
||||
if (currentOp == CurrentOp.ShowFormAtCycleBeginning)
|
||||
{
|
||||
ICycleBeginOrEndForm dlg = (modelessDlg as ICycleBeginOrEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < waterMeters.Count; i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
waterMeters[i].Disabled = disabled[i] = dlg.Disabled[i];
|
||||
waterMeters[i].SerialNr = dlg.BodyNrText[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
ICycleBeginOrEndForm dlg = (modelessDlg as ICycleBeginOrEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < waterMeters.Count; i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
waterMeters[i].Disabled = disabled[i] = dlg.Disabled[i];
|
||||
waterMeters[i].SerialNr = dlg.BodyNrText[i];
|
||||
#if ORACLE_DB
|
||||
waterMeters[i].AssignedSerialNr = dlg.AssignedSerialNr[i];
|
||||
waterMeters[i].Prefix = dlg.Prefix;
|
||||
waterMeters[i].Suffix = dlg.Suffix;
|
||||
waterMeters[i].CompleteSerialNr = dlg.CompleteSerialNr[i];
|
||||
#endif
|
||||
if (dlg.PurchaseOrder != null) waterMeters[i].PurchaseOrder = dlg.PurchaseOrder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((modelessDlg is TestStartEndForm) && (currentOp == CurrentOp.EnterTestStartStates))
|
||||
{
|
||||
/// Fixed start test - start
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < dlg.WaterMetersCount; i++)
|
||||
{
|
||||
if (!(((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null))))
|
||||
{
|
||||
wmStartState[i] = dlg.WMStartState[i];
|
||||
wmStartStateStr[i] = dlg.WMStartStateStr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((modelessDlg is TestStartEndForm) && (currentOp == CurrentOp.EnterTestEndStates))
|
||||
{
|
||||
/// Fixed start test - end
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < dlg.WaterMetersCount; i++)
|
||||
{
|
||||
if (!(((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null))))
|
||||
{
|
||||
wmEndState[i] = dlg.WMEndState[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resultSaved = true;
|
||||
modelessDlg = null;
|
||||
}
|
||||
|
||||
return Event.ModelessFormClosed; /// Form closed
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
if (modelessDlg is IHasCompleted)
|
||||
{
|
||||
UiBridge.Bridge.OnCloseModelessForm(this, null);
|
||||
modelessDlg = null;
|
||||
}
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
///
|
||||
/// Copyright (c) 2020-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new EntryFormCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int MaxWMsCount;
|
||||
public char CloseButton;
|
||||
public bool ProductionTracing;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg() { }
|
||||
|
||||
public EntryFormCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ParentName = "ProductionMonitoring";
|
||||
Factory = factory;
|
||||
MaxWMsCount = 20;
|
||||
CloseButton = '+';
|
||||
ProductionTracing = true;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, MaxWMsCount={1}, CloseButton={2}, ProductionTracing={3}, Parent={4}",
|
||||
Name,
|
||||
MaxWMsCount,
|
||||
(CloseButton == '+') ? "+" : (CloseButton == '\t') ? "Tab" : "none",
|
||||
ProductionTracing,
|
||||
string.IsNullOrEmpty(ParentName) ? "-" : ParentName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
TBF.UI.Bench.Components.ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as EntryFormCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public EntryFormCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
parent = ParentForm as TBF.UI.Bench.Components.ComponentParametersDlg;
|
||||
if (parent == null) return;
|
||||
|
||||
parentNameComboBox.Items.Add("---");
|
||||
if (parent.CmpntEntities != null)
|
||||
{
|
||||
foreach (var cmpnt in parent.CmpntEntities)
|
||||
{
|
||||
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Output.DB.ProductionTracing.Factory)
|
||||
{
|
||||
parentNameComboBox.Items.Add(cmpnt.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closeButtonComboBox.Items.Add("<none>");
|
||||
closeButtonComboBox.Items.Add("Tab");
|
||||
closeButtonComboBox.Items.Add("+");
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
productionTracingCheckBox.Text = "Sledovanie výroby";
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
|
||||
maxWMsCountTextBox.Text = config.MaxWMsCount.ToString();
|
||||
closeButtonComboBox.Text = (config.CloseButton == '+') ? "+" : (config.CloseButton == '\t') ? "Tab" : "<none>";
|
||||
productionTracingCheckBox.Checked = config.ProductionTracing;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
parentNameComboBox.Enabled = true;
|
||||
maxWMsCountTextBox.Enabled = true;
|
||||
closeButtonComboBox.Enabled = true;
|
||||
productionTracingCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
int dummy;
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Parent Name'";
|
||||
}
|
||||
if (!int.TryParse(maxWMsCountTextBox.Text, out dummy) || dummy <= 0 || dummy > 40)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Max. water meters count'";
|
||||
}
|
||||
if (!closeButtonComboBox.Items.Contains(closeButtonComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Close button'";
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
config.Name = nameTextBox.Text;
|
||||
config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
|
||||
config.MaxWMsCount = int.Parse(maxWMsCountTextBox.Text);
|
||||
config.CloseButton = (closeButtonComboBox.Text == "+") ? '+' : (closeButtonComboBox.Text == "Tab") ? '\t' : '\0';
|
||||
config.ProductionTracing = productionTracingCheckBox.Checked;
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
partial class EntryFormCfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
this.classNameLabel = new System.Windows.Forms.Label();
|
||||
this.productionTracingCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.parentNameLabel = new System.Windows.Forms.Label();
|
||||
this.closeButtonComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.closeButtonLabel = new System.Windows.Forms.Label();
|
||||
this.maxWMsCountTextBox = new System.Windows.Forms.TextBox();
|
||||
this.maxWMsCountLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(155, 58);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(18, 61);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 1;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(152, 33);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// productionTracingCheckBox
|
||||
//
|
||||
this.productionTracingCheckBox.AutoSize = true;
|
||||
this.productionTracingCheckBox.Enabled = false;
|
||||
this.productionTracingCheckBox.Location = new System.Drawing.Point(155, 169);
|
||||
this.productionTracingCheckBox.Name = "productionTracingCheckBox";
|
||||
this.productionTracingCheckBox.Size = new System.Drawing.Size(112, 17);
|
||||
this.productionTracingCheckBox.TabIndex = 9;
|
||||
this.productionTracingCheckBox.Text = "Production tracing";
|
||||
this.productionTracingCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// parentNameComboBox
|
||||
//
|
||||
this.parentNameComboBox.Enabled = false;
|
||||
this.parentNameComboBox.FormattingEnabled = true;
|
||||
this.parentNameComboBox.Location = new System.Drawing.Point(155, 84);
|
||||
this.parentNameComboBox.Name = "parentNameComboBox";
|
||||
this.parentNameComboBox.Size = new System.Drawing.Size(130, 21);
|
||||
this.parentNameComboBox.TabIndex = 4;
|
||||
//
|
||||
// parentNameLabel
|
||||
//
|
||||
this.parentNameLabel.AutoSize = true;
|
||||
this.parentNameLabel.Location = new System.Drawing.Point(18, 87);
|
||||
this.parentNameLabel.Name = "parentNameLabel";
|
||||
this.parentNameLabel.Size = new System.Drawing.Size(67, 13);
|
||||
this.parentNameLabel.TabIndex = 3;
|
||||
this.parentNameLabel.Text = "Parent name";
|
||||
//
|
||||
// closeButtonComboBox
|
||||
//
|
||||
this.closeButtonComboBox.Enabled = false;
|
||||
this.closeButtonComboBox.FormattingEnabled = true;
|
||||
this.closeButtonComboBox.Location = new System.Drawing.Point(155, 137);
|
||||
this.closeButtonComboBox.Name = "closeButtonComboBox";
|
||||
this.closeButtonComboBox.Size = new System.Drawing.Size(130, 21);
|
||||
this.closeButtonComboBox.TabIndex = 8;
|
||||
//
|
||||
// closeButtonLabel
|
||||
//
|
||||
this.closeButtonLabel.AutoSize = true;
|
||||
this.closeButtonLabel.Location = new System.Drawing.Point(18, 140);
|
||||
this.closeButtonLabel.Name = "closeButtonLabel";
|
||||
this.closeButtonLabel.Size = new System.Drawing.Size(66, 13);
|
||||
this.closeButtonLabel.TabIndex = 7;
|
||||
this.closeButtonLabel.Text = "Close button";
|
||||
//
|
||||
// maxWMsCountTextBox
|
||||
//
|
||||
this.maxWMsCountTextBox.Enabled = false;
|
||||
this.maxWMsCountTextBox.Location = new System.Drawing.Point(155, 111);
|
||||
this.maxWMsCountTextBox.Name = "maxWMsCountTextBox";
|
||||
this.maxWMsCountTextBox.Size = new System.Drawing.Size(27, 20);
|
||||
this.maxWMsCountTextBox.TabIndex = 6;
|
||||
//
|
||||
// maxWMsCountLabel
|
||||
//
|
||||
this.maxWMsCountLabel.AutoSize = true;
|
||||
this.maxWMsCountLabel.Location = new System.Drawing.Point(18, 114);
|
||||
this.maxWMsCountLabel.Name = "maxWMsCountLabel";
|
||||
this.maxWMsCountLabel.Size = new System.Drawing.Size(123, 13);
|
||||
this.maxWMsCountLabel.TabIndex = 5;
|
||||
this.maxWMsCountLabel.Text = "Max. water meters count";
|
||||
//
|
||||
// EntryFormCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.maxWMsCountTextBox);
|
||||
this.Controls.Add(this.maxWMsCountLabel);
|
||||
this.Controls.Add(this.closeButtonComboBox);
|
||||
this.Controls.Add(this.closeButtonLabel);
|
||||
this.Controls.Add(this.parentNameComboBox);
|
||||
this.Controls.Add(this.parentNameLabel);
|
||||
this.Controls.Add(this.productionTracingCheckBox);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "EntryFormCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(333, 200);
|
||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.CheckBox productionTracingCheckBox;
|
||||
private System.Windows.Forms.ComboBox parentNameComboBox;
|
||||
private System.Windows.Forms.Label parentNameLabel;
|
||||
private System.Windows.Forms.ComboBox closeButtonComboBox;
|
||||
private System.Windows.Forms.Label closeButtonLabel;
|
||||
private System.Windows.Forms.TextBox maxWMsCountTextBox;
|
||||
private System.Windows.Forms.Label maxWMsCountLabel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,25 @@
|
||||
///
|
||||
/// Copyright (c) 2020-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8); } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg, components); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg(GetType().Namespace.Substring(8), this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public class FocusPressedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// ID of a part in this workstep:
|
||||
/// 0 undefined
|
||||
/// 1 reference part
|
||||
/// 2..99 parts with unique codes
|
||||
/// 100.. parts with batch numbers
|
||||
/// </summary>
|
||||
public int IxPolozky;
|
||||
public SharedDatabase.CodeLocation CodeLocation;
|
||||
|
||||
public FocusPressedEventArgs(int ixPolozky, SharedDatabase.CodeLocation codeLocation)
|
||||
{
|
||||
this.IxPolozky = ixPolozky;
|
||||
this.CodeLocation = codeLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1741
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public interface ICheckItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Part to be scanned / checked
|
||||
/// </summary>
|
||||
SharedDatabase.Entities.Part Part { get; }
|
||||
|
||||
/// <summary>
|
||||
/// ID of a part in this workstep:
|
||||
/// 0 undefined
|
||||
/// 1 reference part
|
||||
/// 2..99 parts with unique codes
|
||||
/// 100.. parts with batch numbers
|
||||
/// </summary>
|
||||
int IxPolozky { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Scanned or obtained code of the part
|
||||
/// </summary>
|
||||
string ScannedCode { get; set; } /// Read/Set the scanned code
|
||||
|
||||
void ClearCode(); /// Clear the code
|
||||
void SubmitCode(string code); /// Set the code and proceed like enter button is pressed
|
||||
void ResetFocus();
|
||||
void SetFocus();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public interface ICycleBeginOrEndForm
|
||||
{
|
||||
string PurchaseOrder { get; set; }
|
||||
string[] BodyNrText { get; set; }
|
||||
int[] AssignedSerialNr { get; set; }
|
||||
string[] CompleteSerialNr { get; set; }
|
||||
bool[] Disabled { get; set; }
|
||||
string Prefix { get; set; } /// S/N prefix - Loaded from Oracle DB table VT_AUFTRAG_PD
|
||||
string Suffix { get; set; } /// S/N suffix - Loaded from Oracle DB table VT_AUFTRAG_PD
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,688 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.DataEntry.S620
|
||||
{
|
||||
public partial class TestStartEndForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestStartEndForm));
|
||||
|
||||
// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
readonly IRegReader[] regReaders;
|
||||
readonly bool[] disabled;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public double[] WMStartState;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public readonly string[] WMStartStateStr;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public double[] WMEndState;
|
||||
|
||||
bool endStates; /// false=start states, true=end states
|
||||
double refVolume;
|
||||
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||
bool fixedErrorLimits; /// false in case of calculated error limits
|
||||
|
||||
int TextBoxesCount;
|
||||
///
|
||||
Label[] labels;
|
||||
TextBox[] startTextBoxes;
|
||||
TextBox[] endTextBoxes;
|
||||
Label[] exclamations;
|
||||
///
|
||||
IList<TextBox> activeTextBoxes;
|
||||
IList<int> activeWmNrs;
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializing common part for start and endstate form
|
||||
/// </summary>
|
||||
public TestStartEndForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
ControlBox = false;
|
||||
|
||||
TextBoxesCount = 48;
|
||||
|
||||
labels = new Label[]
|
||||
{
|
||||
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
|
||||
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
|
||||
label21, label22, label23, label24, label25, label26, label27, label28, label29, label30,
|
||||
label31, label32, label33, label34, label35, label36, label37, label38, label39, label40,
|
||||
label41, label42, label43, label44, label45, label46, label47, label48,
|
||||
};
|
||||
startTextBoxes = new TextBox[]
|
||||
{
|
||||
startTextBox1, startTextBox2, startTextBox3, startTextBox4, startTextBox5, startTextBox6, startTextBox7, startTextBox8, startTextBox9, startTextBox10,
|
||||
startTextBox11, startTextBox12, startTextBox13, startTextBox14, startTextBox15, startTextBox16, startTextBox17, startTextBox18, startTextBox19, startTextBox20,
|
||||
startTextBox21, startTextBox22, startTextBox23, startTextBox24, startTextBox25, startTextBox26, startTextBox27, startTextBox28, startTextBox29, startTextBox30,
|
||||
startTextBox31, startTextBox32, startTextBox33, startTextBox34, startTextBox35, startTextBox36, startTextBox37, startTextBox38, startTextBox39, startTextBox40,
|
||||
startTextBox41, startTextBox42, startTextBox43, startTextBox44, startTextBox45, startTextBox46, startTextBox47, startTextBox48,
|
||||
};
|
||||
endTextBoxes = new TextBox[]
|
||||
{
|
||||
endTextBox1, endTextBox2, endTextBox3, endTextBox4, endTextBox5, endTextBox6, endTextBox7, endTextBox8, endTextBox9, endTextBox10,
|
||||
endTextBox11, endTextBox12, endTextBox13, endTextBox14, endTextBox15, endTextBox16, endTextBox17, endTextBox18, endTextBox19, endTextBox20,
|
||||
endTextBox21, endTextBox22, endTextBox23, endTextBox24, endTextBox25, endTextBox26, endTextBox27, endTextBox28, endTextBox29, endTextBox30,
|
||||
endTextBox31, endTextBox32, endTextBox33, endTextBox34, endTextBox35, endTextBox36, endTextBox37, endTextBox38, endTextBox39, endTextBox40,
|
||||
endTextBox41, endTextBox42, endTextBox43, endTextBox44, endTextBox45, endTextBox46, endTextBox47, endTextBox48,
|
||||
};
|
||||
exclamations = new Label[]
|
||||
{
|
||||
exclamation1, exclamation2, exclamation3, exclamation4, exclamation5, exclamation6,
|
||||
exclamation7, exclamation8, exclamation9, exclamation10, exclamation11, exclamation12,
|
||||
exclamation13, exclamation14, exclamation15, exclamation16, exclamation17, exclamation18,
|
||||
exclamation19, exclamation20, exclamation21, exclamation22, exclamation23, exclamation24,
|
||||
exclamation25, exclamation26, exclamation27, exclamation28, exclamation29, exclamation30,
|
||||
exclamation31, exclamation32, exclamation33, exclamation34, exclamation35, exclamation36,
|
||||
exclamation37, exclamation38, exclamation39, exclamation40, exclamation41, exclamation42,
|
||||
exclamation43, exclamation44, exclamation45, exclamation46, exclamation47, exclamation48,
|
||||
};
|
||||
|
||||
activeTextBoxes = new List<TextBox>();
|
||||
activeWmNrs = new List<int>();
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to fill in start states
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of water meters</param>
|
||||
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
|
||||
public TestStartEndForm(int waterMetersCount, IRegReader[] regReaders, bool[] disabled)
|
||||
: this()
|
||||
{
|
||||
endStates = false;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.regReaders = regReaders;
|
||||
this.disabled = disabled;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMStartState = new double[waterMetersCount];
|
||||
WMStartStateStr = new string[waterMetersCount];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to fill in end states
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of water meters</param>
|
||||
/// <param name="wmStartStateStr">Information entered on test start</param>
|
||||
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
|
||||
/// <param name="refVolume">Reference volume, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||
public TestStartEndForm(int waterMetersCount, IRegReader[] regReaders, string[] wmStartStateStr, bool[] disabled,
|
||||
double refVolume, double errLimLo, double errLimHi)
|
||||
: this()
|
||||
{
|
||||
endStates = true;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.regReaders = regReaders;
|
||||
if (wmStartStateStr == null || wmStartStateStr.Length != waterMetersCount)
|
||||
throw (new Exception("Invalid 'wmStartStateStr' argument"));
|
||||
this.WMStartStateStr = wmStartStateStr;
|
||||
this.disabled = disabled;
|
||||
this.refVolume = refVolume;
|
||||
this.warningLimLo = 2 * errLimLo;
|
||||
this.warningLimHi = 2 * errLimHi;
|
||||
this.fixedErrorLimits = (errLimHi > errLimLo);
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMEndState = new double[waterMetersCount];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the layout of labels/text boxes on the screen
|
||||
/// corresponds to the layout of watermeters of the test bench.
|
||||
/// </summary>
|
||||
void ShuffleTextBoxes()
|
||||
{
|
||||
if (TextBoxesCount > WaterMetersCount)
|
||||
{
|
||||
int nrLines = WaterMetersCount / Common.Data.LineSize;
|
||||
int gap = (TextBoxesCount - WaterMetersCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = WaterMetersCount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CycleEndForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
//Height = 115 + 90 * WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (i < WaterMetersCount)
|
||||
{
|
||||
labels[i].Visible = startTextBoxes[i].Visible = endTextBoxes[i].Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (endStates)
|
||||
{
|
||||
/// End of test
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (WMStartStateStr != null && i < WMStartStateStr.Length)
|
||||
{
|
||||
startTextBoxes[i].Text = WMStartStateStr[i];
|
||||
}
|
||||
|
||||
if (((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null)))
|
||||
{
|
||||
endTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTextBoxes[i].Enabled = true;
|
||||
activeTextBoxes.Add(endTextBoxes[i]);
|
||||
activeWmNrs.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Start of test
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null)))
|
||||
{
|
||||
startTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTextBoxes[i].Enabled = true;
|
||||
activeTextBoxes.Add(startTextBoxes[i]);
|
||||
activeWmNrs.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((activeTextBoxes.Count > 0) && (activeWmNrs.Count > 0))
|
||||
{
|
||||
activeTextBoxes[0].Focus();
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, activeWmNrs[0] + 1, string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_Meter_States;
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = string.Format("{0} {1}", Strings.Water_Meter, i + 1);
|
||||
}
|
||||
startLabel.Text = start2Label.Text = Strings.Start;
|
||||
endLabel.Text = end2Label.Text = Strings.End;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs eArgs)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (endStates)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++)
|
||||
{
|
||||
if (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
|
||||
{
|
||||
WMEndState[i] = Utils.ParseUDouble(endTextBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++)
|
||||
{
|
||||
if (startTextBoxes[i].Visible && startTextBoxes[i].Enabled)
|
||||
{
|
||||
WMStartStateStr[i] = startTextBoxes[i].Text;
|
||||
WMStartState[i] = Utils.ParseUDouble(startTextBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
log.ErrorFormat("Exception: {0}", e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
public void StartForceCloseHandler()
|
||||
{
|
||||
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
|
||||
{
|
||||
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
|
||||
else OnForceClose(sender, args);
|
||||
};
|
||||
}
|
||||
|
||||
void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the approximate error and verify whether it is within limits.
|
||||
/// Make an exclamation mark visible if out of range.
|
||||
/// Similar event handler is implemented for all endTextBoxes (1..24).
|
||||
/// </summary>
|
||||
private void ProcEndTextChanged(object sender, EventArgs e, TextBox endTBox)
|
||||
{
|
||||
int wmIx = -1;
|
||||
for (int i = 0; i < endTextBoxes.Length; i++)
|
||||
{
|
||||
if (endTextBoxes[i] == endTBox)
|
||||
{
|
||||
wmIx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Utils.ParseUDouble(endTextBoxes[wmIx].Text);
|
||||
double startState = Utils.ParseUDouble(startTextBoxes[wmIx].Text);
|
||||
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
|
||||
bool errorOoR = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
|
||||
exclamations[wmIx].Visible = errorOoR;
|
||||
largeExclamationLabel.Visible = errorOoR;
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, wmIx + 1, endTextBoxes[wmIx].Text);
|
||||
}
|
||||
|
||||
private void endTextBox1_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox1); }
|
||||
private void endTextBox2_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox2); }
|
||||
private void endTextBox3_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox3); }
|
||||
private void endTextBox4_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox4); }
|
||||
private void endTextBox5_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox5); }
|
||||
private void endTextBox6_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox6); }
|
||||
private void endTextBox7_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox7); }
|
||||
private void endTextBox8_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox8); }
|
||||
private void endTextBox9_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox9); }
|
||||
private void endTextBox10_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox10); }
|
||||
private void endTextBox11_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox11); }
|
||||
private void endTextBox12_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox12); }
|
||||
private void endTextBox13_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox13); }
|
||||
private void endTextBox14_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox14); }
|
||||
private void endTextBox15_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox15); }
|
||||
private void endTextBox16_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox16); }
|
||||
private void endTextBox17_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox17); }
|
||||
private void endTextBox18_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox18); }
|
||||
private void endTextBox19_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox19); }
|
||||
private void endTextBox20_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox20); }
|
||||
private void endTextBox21_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox21); }
|
||||
private void endTextBox22_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox22); }
|
||||
private void endTextBox23_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox23); }
|
||||
private void endTextBox24_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox24); }
|
||||
private void endTextBox25_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox25); }
|
||||
private void endTextBox26_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox26); }
|
||||
private void endTextBox27_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox27); }
|
||||
private void endTextBox28_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox28); }
|
||||
private void endTextBox29_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox29); }
|
||||
private void endTextBox30_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox30); }
|
||||
private void endTextBox31_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox31); }
|
||||
private void endTextBox32_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox32); }
|
||||
private void endTextBox33_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox33); }
|
||||
private void endTextBox34_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox34); }
|
||||
private void endTextBox35_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox35); }
|
||||
private void endTextBox36_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox36); }
|
||||
private void endTextBox37_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox37); }
|
||||
private void endTextBox38_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox38); }
|
||||
private void endTextBox39_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox39); }
|
||||
private void endTextBox40_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox40); }
|
||||
private void endTextBox41_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox41); }
|
||||
private void endTextBox42_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox42); }
|
||||
private void endTextBox43_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox43); }
|
||||
private void endTextBox44_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox44); }
|
||||
private void endTextBox45_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox45); }
|
||||
private void endTextBox46_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox46); }
|
||||
private void endTextBox47_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox47); }
|
||||
private void endTextBox48_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox48); }
|
||||
|
||||
private void endTextBox1_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox1); }
|
||||
private void endTextBox2_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox2); }
|
||||
private void endTextBox3_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox3); }
|
||||
private void endTextBox4_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox4); }
|
||||
private void endTextBox5_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox5); }
|
||||
private void endTextBox6_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox6); }
|
||||
private void endTextBox7_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox7); }
|
||||
private void endTextBox8_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox8); }
|
||||
private void endTextBox9_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox9); }
|
||||
private void endTextBox10_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox10); }
|
||||
private void endTextBox11_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox11); }
|
||||
private void endTextBox12_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox12); }
|
||||
private void endTextBox13_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox13); }
|
||||
private void endTextBox14_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox14); }
|
||||
private void endTextBox15_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox15); }
|
||||
private void endTextBox16_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox16); }
|
||||
private void endTextBox17_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox17); }
|
||||
private void endTextBox18_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox18); }
|
||||
private void endTextBox19_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox19); }
|
||||
private void endTextBox20_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox20); }
|
||||
private void endTextBox21_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox21); }
|
||||
private void endTextBox22_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox22); }
|
||||
private void endTextBox23_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox23); }
|
||||
private void endTextBox24_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox24); }
|
||||
private void endTextBox25_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox25); }
|
||||
private void endTextBox26_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox26); }
|
||||
private void endTextBox27_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox27); }
|
||||
private void endTextBox28_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox28); }
|
||||
private void endTextBox29_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox29); }
|
||||
private void endTextBox30_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox30); }
|
||||
private void endTextBox31_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox31); }
|
||||
private void endTextBox32_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox32); }
|
||||
private void endTextBox33_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox33); }
|
||||
private void endTextBox34_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox34); }
|
||||
private void endTextBox35_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox35); }
|
||||
private void endTextBox36_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox36); }
|
||||
private void endTextBox37_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox37); }
|
||||
private void endTextBox38_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox38); }
|
||||
private void endTextBox39_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox39); }
|
||||
private void endTextBox40_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox40); }
|
||||
private void endTextBox41_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox41); }
|
||||
private void endTextBox42_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox42); }
|
||||
private void endTextBox43_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox43); }
|
||||
private void endTextBox44_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox44); }
|
||||
private void endTextBox45_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox45); }
|
||||
private void endTextBox46_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox46); }
|
||||
private void endTextBox47_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox47); }
|
||||
private void endTextBox48_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox48); }
|
||||
|
||||
/// <summary>
|
||||
/// Process a key press within any enabled text boxe
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <param name="currentFocusOwner">TextBox control which received the event</param>
|
||||
private void ProcKeyPress(object sender, KeyPressEventArgs e, TextBox currentFocusOwner)
|
||||
{
|
||||
if (e.KeyChar == '+')
|
||||
{
|
||||
/// Process '+' key ..... Form completed
|
||||
okButton_Click(sender, e);
|
||||
}
|
||||
|
||||
if (e.KeyChar == '\r')
|
||||
{
|
||||
/// Process <enter> key ..... Next text field
|
||||
if (activeTextBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < activeTextBoxes.Count; i++)
|
||||
{
|
||||
if (activeTextBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Index of the next active text box
|
||||
int newTBIdx = (i + 1) % activeTextBoxes.Count;
|
||||
|
||||
/// Change focus to the next active text box
|
||||
activeTextBoxes[newTBIdx].Focus();
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, activeWmNrs[newTBIdx] + 1, activeTextBoxes[newTBIdx].Text);
|
||||
largeExclamationLabel.Visible = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox1); }
|
||||
private void startTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox2); }
|
||||
private void startTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox3); }
|
||||
private void startTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox4); }
|
||||
private void startTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox5); }
|
||||
private void startTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox6); }
|
||||
private void startTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox7); }
|
||||
private void startTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox8); }
|
||||
private void startTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox9); }
|
||||
private void startTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox10); }
|
||||
private void startTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox11); }
|
||||
private void startTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox12); }
|
||||
private void startTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox13); }
|
||||
private void startTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox14); }
|
||||
private void startTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox15); }
|
||||
private void startTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox16); }
|
||||
private void startTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox17); }
|
||||
private void startTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox18); }
|
||||
private void startTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox19); }
|
||||
private void startTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox20); }
|
||||
private void startTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox21); }
|
||||
private void startTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox22); }
|
||||
private void startTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox23); }
|
||||
private void startTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox24); }
|
||||
private void startTextBox25_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox25); }
|
||||
private void startTextBox26_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox26); }
|
||||
private void startTextBox27_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox27); }
|
||||
private void startTextBox28_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox28); }
|
||||
private void startTextBox29_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox29); }
|
||||
private void startTextBox30_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox30); }
|
||||
private void startTextBox31_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox31); }
|
||||
private void startTextBox32_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox32); }
|
||||
private void startTextBox33_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox33); }
|
||||
private void startTextBox34_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox34); }
|
||||
private void startTextBox35_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox35); }
|
||||
private void startTextBox36_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox36); }
|
||||
private void startTextBox37_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox37); }
|
||||
private void startTextBox38_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox38); }
|
||||
private void startTextBox39_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox39); }
|
||||
private void startTextBox40_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox40); }
|
||||
private void startTextBox41_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox41); }
|
||||
private void startTextBox42_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox42); }
|
||||
private void startTextBox43_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox43); }
|
||||
private void startTextBox44_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox44); }
|
||||
private void startTextBox45_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox45); }
|
||||
private void startTextBox46_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox46); }
|
||||
private void startTextBox47_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox47); }
|
||||
private void startTextBox48_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox48); }
|
||||
|
||||
private void endTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox1); }
|
||||
private void endTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox2); }
|
||||
private void endTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox3); }
|
||||
private void endTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox4); }
|
||||
private void endTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox5); }
|
||||
private void endTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox6); }
|
||||
private void endTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox7); }
|
||||
private void endTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox8); }
|
||||
private void endTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox9); }
|
||||
private void endTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox10); }
|
||||
private void endTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox11); }
|
||||
private void endTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox12); }
|
||||
private void endTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox13); }
|
||||
private void endTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox14); }
|
||||
private void endTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox15); }
|
||||
private void endTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox16); }
|
||||
private void endTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox17); }
|
||||
private void endTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox18); }
|
||||
private void endTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox19); }
|
||||
private void endTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox20); }
|
||||
private void endTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox21); }
|
||||
private void endTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox22); }
|
||||
private void endTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox23); }
|
||||
private void endTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox24); }
|
||||
private void endTextBox25_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox25); }
|
||||
private void endTextBox26_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox26); }
|
||||
private void endTextBox27_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox27); }
|
||||
private void endTextBox28_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox28); }
|
||||
private void endTextBox29_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox29); }
|
||||
private void endTextBox30_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox30); }
|
||||
private void endTextBox31_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox31); }
|
||||
private void endTextBox32_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox32); }
|
||||
private void endTextBox33_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox33); }
|
||||
private void endTextBox34_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox34); }
|
||||
private void endTextBox35_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox35); }
|
||||
private void endTextBox36_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox36); }
|
||||
private void endTextBox37_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox37); }
|
||||
private void endTextBox38_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox38); }
|
||||
private void endTextBox39_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox39); }
|
||||
private void endTextBox40_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox40); }
|
||||
private void endTextBox41_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox41); }
|
||||
private void endTextBox42_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox42); }
|
||||
private void endTextBox43_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox43); }
|
||||
private void endTextBox44_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox44); }
|
||||
private void endTextBox45_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox45); }
|
||||
private void endTextBox46_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox46); }
|
||||
private void endTextBox47_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox47); }
|
||||
private void endTextBox48_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox48); }
|
||||
|
||||
|
||||
private void ProcStartTextChanged(object sender, EventArgs e, TextBox startTBox)
|
||||
{
|
||||
for (int i = 0; i < startTextBoxes.Length; i++)
|
||||
{
|
||||
if (startTextBoxes[i] == startTBox)
|
||||
{
|
||||
/// wmIx == i
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, i + 1, startTextBoxes[i].Text);
|
||||
largeExclamationLabel.Visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startTextBox1_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox1); }
|
||||
private void startTextBox2_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox2); }
|
||||
private void startTextBox3_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox3); }
|
||||
private void startTextBox4_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox4); }
|
||||
private void startTextBox5_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox5); }
|
||||
private void startTextBox6_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox6); }
|
||||
private void startTextBox7_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox7); }
|
||||
private void startTextBox8_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox8); }
|
||||
private void startTextBox9_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox9); }
|
||||
private void startTextBox10_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox10); }
|
||||
private void startTextBox11_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox11); }
|
||||
private void startTextBox12_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox12); }
|
||||
private void startTextBox13_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox13); }
|
||||
private void startTextBox14_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox14); }
|
||||
private void startTextBox15_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox15); }
|
||||
private void startTextBox16_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox16); }
|
||||
private void startTextBox17_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox17); }
|
||||
private void startTextBox18_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox18); }
|
||||
private void startTextBox19_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox19); }
|
||||
private void startTextBox20_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox20); }
|
||||
private void startTextBox21_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox21); }
|
||||
private void startTextBox22_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox22); }
|
||||
private void startTextBox23_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox23); }
|
||||
private void startTextBox24_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox24); }
|
||||
private void startTextBox25_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox25); }
|
||||
private void startTextBox26_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox26); }
|
||||
private void startTextBox27_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox27); }
|
||||
private void startTextBox28_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox28); }
|
||||
private void startTextBox29_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox29); }
|
||||
private void startTextBox30_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox30); }
|
||||
private void startTextBox31_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox31); }
|
||||
private void startTextBox32_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox32); }
|
||||
private void startTextBox33_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox33); }
|
||||
private void startTextBox34_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox34); }
|
||||
private void startTextBox35_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox35); }
|
||||
private void startTextBox36_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox36); }
|
||||
private void startTextBox37_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox37); }
|
||||
private void startTextBox38_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox38); }
|
||||
private void startTextBox39_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox39); }
|
||||
private void startTextBox40_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox40); }
|
||||
private void startTextBox41_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox41); }
|
||||
private void startTextBox42_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox42); }
|
||||
private void startTextBox43_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox43); }
|
||||
private void startTextBox44_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox44); }
|
||||
private void startTextBox45_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox45); }
|
||||
private void startTextBox46_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox46); }
|
||||
private void startTextBox47_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox47); }
|
||||
private void startTextBox48_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox48); }
|
||||
|
||||
private void startTextBox1_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox1); }
|
||||
private void startTextBox2_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox2); }
|
||||
private void startTextBox3_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox3); }
|
||||
private void startTextBox4_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox4); }
|
||||
private void startTextBox5_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox5); }
|
||||
private void startTextBox6_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox6); }
|
||||
private void startTextBox7_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox7); }
|
||||
private void startTextBox8_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox8); }
|
||||
private void startTextBox9_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox9); }
|
||||
private void startTextBox10_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox10); }
|
||||
private void startTextBox11_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox11); }
|
||||
private void startTextBox12_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox12); }
|
||||
private void startTextBox13_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox13); }
|
||||
private void startTextBox14_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox14); }
|
||||
private void startTextBox15_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox15); }
|
||||
private void startTextBox16_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox16); }
|
||||
private void startTextBox17_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox17); }
|
||||
private void startTextBox18_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox18); }
|
||||
private void startTextBox19_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox19); }
|
||||
private void startTextBox20_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox20); }
|
||||
private void startTextBox21_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox21); }
|
||||
private void startTextBox22_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox22); }
|
||||
private void startTextBox23_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox23); }
|
||||
private void startTextBox24_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox24); }
|
||||
private void startTextBox25_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox25); }
|
||||
private void startTextBox26_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox26); }
|
||||
private void startTextBox27_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox27); }
|
||||
private void startTextBox28_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox28); }
|
||||
private void startTextBox29_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox29); }
|
||||
private void startTextBox30_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox30); }
|
||||
private void startTextBox31_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox31); }
|
||||
private void startTextBox32_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox32); }
|
||||
private void startTextBox33_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox33); }
|
||||
private void startTextBox34_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox34); }
|
||||
private void startTextBox35_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox35); }
|
||||
private void startTextBox36_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox36); }
|
||||
private void startTextBox37_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox37); }
|
||||
private void startTextBox38_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox38); }
|
||||
private void startTextBox39_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox39); }
|
||||
private void startTextBox40_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox40); }
|
||||
private void startTextBox41_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox41); }
|
||||
private void startTextBox42_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox42); }
|
||||
private void startTextBox43_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox43); }
|
||||
private void startTextBox44_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox44); }
|
||||
private void startTextBox45_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox45); }
|
||||
private void startTextBox46_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox46); }
|
||||
private void startTextBox47_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox47); }
|
||||
private void startTextBox48_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox48); }
|
||||
}
|
||||
}
|
||||
+3079
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
@@ -77,7 +77,7 @@ namespace TBF.Rig.DataEntry.Single
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace TBF.Rig.DataEntry.Single
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
wmCycleEndState = new string[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -126,25 +126,25 @@ namespace TBF.Rig.DataEntry.Single
|
||||
///
|
||||
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleBeginningForm(Common.Data.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
myRef.modelessDlg = new CycleEndForm(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, Config.Data.LineSize, myRef.regReaders, myRef.disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, Common.Data.LineSize, myRef.regReaders, myRef.disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, Config.Data.LineSize, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, Common.Data.LineSize, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace TBF.Rig.DataEntry.Standard12
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
foreach (var wm in waterMeters) if (wm != null) wm.Passed = wm.PassedFromTests();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace TBF.Rig.DataEntry.Standard12
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
wmCycleEndState = new string[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -132,19 +132,19 @@ namespace TBF.Rig.DataEntry.Standard12
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleEndForm(Common.Data.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -135,17 +135,17 @@ namespace TBF.Rig.DataEntry.Standard12
|
||||
{
|
||||
if (TextBoxesCount > WaterMetersCount)
|
||||
{
|
||||
int nrLines = WaterMetersCount / Config.Data.LineSize;
|
||||
int nrLines = WaterMetersCount / Common.Data.LineSize;
|
||||
int gap = (TextBoxesCount - WaterMetersCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,25 +149,25 @@ namespace TBF.Rig.DataEntry.Standard24
|
||||
/// </summary>
|
||||
void ShuffleTextBoxes()
|
||||
{
|
||||
if (Config.Data.WMsCount < TextBoxesCount)
|
||||
if (Common.Data.WMsCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Config.Data.WMsCount / Config.Data.LineSize;
|
||||
int gap = (TextBoxesCount - Config.Data.WMsCount) / nrLines;
|
||||
int nrLines = Common.Data.WMsCount / Common.Data.LineSize;
|
||||
int gap = (TextBoxesCount - Common.Data.WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
mid1TextBoxes[dest] = mid1TextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
mid2TextBoxes[dest] = mid2TextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
mid1TextBoxes[dest] = mid1TextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
mid2TextBoxes[dest] = mid2TextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Config.Data.WMsCount;
|
||||
TextBoxesCount = Common.Data.WMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace TBF.Rig.DataEntry.Standard24
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace TBF.Rig.DataEntry.Standard24
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmEndStateStr = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
wmEndStateStr = new string[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -138,19 +138,19 @@ namespace TBF.Rig.DataEntry.Standard24
|
||||
///
|
||||
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleBeginningForm(Common.Data.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
myRef.modelessDlg = new CycleEndForm(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, myRef.disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, myRef.disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
@@ -160,13 +160,13 @@ namespace TBF.Rig.DataEntry.Standard24
|
||||
{
|
||||
for (int i = 0; i < waterMeters.Count; i++) wmEndStateStr[i] = waterMeters[i].EndState;
|
||||
}
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, wmEndStateStr, myRef.disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, wmEndStateStr, myRef.disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -188,18 +188,18 @@ namespace TBF.Rig.DataEntry.Standard24
|
||||
{
|
||||
if (TextBoxesCount > WaterMetersCount)
|
||||
{
|
||||
int nrLines = WaterMetersCount / Config.Data.LineSize;
|
||||
int nrLines = WaterMetersCount / Common.Data.LineSize;
|
||||
int gap = (TextBoxesCount - WaterMetersCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace TBF.Rig.DataEntry.Standard48
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize);
|
||||
ShuffleTextBoxes(Common.Data.WMsCount, Common.Data.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace TBF.Rig.DataEntry.Standard48
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
wmCycleEndState = new string[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
@@ -126,25 +126,25 @@ namespace TBF.Rig.DataEntry.Standard48
|
||||
///
|
||||
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleBeginningForm(Common.Data.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Config.Data.WMsCount);
|
||||
myRef.modelessDlg = new CycleEndForm(Common.Data.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, disabled);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Common.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -160,18 +160,18 @@ namespace TBF.Rig.DataEntry.Standard48
|
||||
{
|
||||
if (TextBoxesCount > WaterMetersCount)
|
||||
{
|
||||
int nrLines = WaterMetersCount / Config.Data.LineSize;
|
||||
int nrLines = WaterMetersCount / Common.Data.LineSize;
|
||||
int gap = (TextBoxesCount - WaterMetersCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.LineSize; i++)
|
||||
for (int i = 0; i < Common.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Config.Data.LineSize + l * gap + i];
|
||||
labels[dest] = labels[l * Common.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Common.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * Common.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace TBF.Rig.DataEntry.Standard6
|
||||
|
||||
/// <summary> Parameterless constructor for all watermeters </summary>
|
||||
public CycleBeginningForm()
|
||||
: this(Config.Data.WMsCount, false)
|
||||
: this(Common.Data.WMsCount, false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -68,10 +68,10 @@ namespace TBF.Rig.DataEntry.Standard6
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
disabled = new bool[Common.Data.WMsCount];
|
||||
wmStartState = new double[Common.Data.WMsCount];
|
||||
wmStartStateStr = new string[Common.Data.WMsCount];
|
||||
wmEndState = new double[Common.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace TBF.Rig.DataEntry.Standard6
|
||||
|
||||
/// <summary> Parameterless constructor for all watermeters </summary>
|
||||
public TestStartEndForm()
|
||||
: this(Config.Data.WMsCount, null, null)
|
||||
: this(Common.Data.WMsCount, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user