Compare commits
155
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb4bc67760 | ||
|
|
a209916748 | ||
|
|
aefbcdb2a0 | ||
|
|
c1bdb53a4d | ||
|
|
38dc09af7f | ||
|
|
d83b497fa0 | ||
|
|
5b31a94b74 | ||
|
|
ee1afaa78b | ||
|
|
910d5d58dc | ||
|
|
6dfba78dbf | ||
|
|
cd98f30ad2 | ||
|
|
893b7af55a | ||
|
|
3bb8cb2ab7 | ||
|
|
22b1fbca90 | ||
|
|
ddcfa71273 | ||
|
|
8d123d306f | ||
|
|
a380a68855 | ||
|
|
39d0a73e39 | ||
|
|
a01f99fa7e | ||
|
|
8a0411bd92 | ||
|
|
8cd4f12de3 | ||
|
|
4a528dafb8 | ||
|
|
b3a9302f53 | ||
|
|
575b17a919 | ||
|
|
41433329da | ||
|
|
e52f9ea9e7 | ||
|
|
1892f9de9f | ||
|
|
db0c850d70 | ||
|
|
060aba08a9 | ||
|
|
5ac7572a3d | ||
|
|
c9e2742745 | ||
|
|
5a77c5f660 | ||
|
|
1301db3af4 | ||
|
|
2cd877fb17 | ||
|
|
9dc3759f99 | ||
|
|
66f1bfa14b | ||
|
|
d7c262c87a | ||
|
|
02da6ae134 | ||
|
|
3336454719 | ||
|
|
5967db86a1 | ||
|
|
2acd67707e | ||
|
|
70f38e9352 | ||
|
|
687e843e5f | ||
|
|
43eaa61007 | ||
|
|
518d87afe1 | ||
|
|
f2676993b1 | ||
|
|
786485f566 | ||
|
|
e3df943946 | ||
|
|
bdd2f5f89d | ||
|
|
6318ce7700 | ||
|
|
5e9f9e7425 | ||
|
|
7ca07d78c6 | ||
|
|
69a51908c2 | ||
|
|
656ef27a3b | ||
|
|
72754ebe10 | ||
|
|
d7e6a69ca9 | ||
|
|
2985338d7e | ||
|
|
120c1cc39d | ||
|
|
f203c56e8b | ||
|
|
b3dc49e8b7 | ||
|
|
8c796eaeee | ||
|
|
c45f8298ac | ||
|
|
4a35215be9 | ||
|
|
62cd81b5f7 | ||
|
|
7afb780d5b | ||
|
|
cdb8304287 | ||
|
|
ebda3f5127 | ||
|
|
06c46785f6 | ||
|
|
e230ce02bf | ||
|
|
2a0fbca1e0 | ||
|
|
2845cf20f5 | ||
|
|
e9440411bc | ||
|
|
d041cd1d20 | ||
|
|
264830a36b | ||
|
|
558f000198 | ||
|
|
cb4833664c | ||
|
|
d5cb6ca71b | ||
|
|
7827fa4e5b | ||
|
|
d1944753b3 | ||
|
|
c6007d3b6a | ||
|
|
91a4ca3760 | ||
|
|
36e0c177c7 | ||
|
|
e13b553ab5 | ||
|
|
2799522a22 | ||
|
|
3e86aa99cb | ||
|
|
ebbc0528c6 | ||
|
|
1d8156e4d7 | ||
|
|
fcf4f6bdcf | ||
|
|
08aed03cef | ||
|
|
da01b1fe61 | ||
|
|
d4399c23ca | ||
|
|
31fc49485a | ||
|
|
217ceffa67 | ||
|
|
6b10e67c17 | ||
|
|
76b9f64029 | ||
|
|
cabee1f06e | ||
|
|
421474b990 | ||
|
|
6a7e1e5052 | ||
|
|
f24cd89928 | ||
|
|
2b8f5ebec3 | ||
|
|
f3dabcbcc1 | ||
|
|
d390705df8 | ||
|
|
f75138eced | ||
|
|
46b17fddc8 | ||
|
|
5d00bcf456 | ||
|
|
db8598579d | ||
|
|
be1344034e | ||
|
|
a0c3ffd01a | ||
|
|
4faf6b5d69 | ||
|
|
2e04076b30 | ||
|
|
20762b7fde | ||
|
|
440199b3bc | ||
|
|
3647740d4a | ||
|
|
b8d9e1aa12 | ||
|
|
3ebeb4a0dc | ||
|
|
33963ec8cf | ||
|
|
fa6b99b980 | ||
|
|
22c652ad24 | ||
|
|
c376e67eab | ||
|
|
e349d6811d | ||
|
|
7b134f7ba5 | ||
|
|
7f46e64a0d | ||
|
|
ed4afff0b2 | ||
|
|
713fd9d0ae | ||
|
|
5db53ca6e3 | ||
|
|
752bfd98b1 | ||
|
|
e302cb9335 | ||
|
|
a6aa6739ad | ||
|
|
ee044e3dd7 | ||
|
|
68a038d321 | ||
|
|
a0cf76112d | ||
|
|
5f5ac87f42 | ||
|
|
f85fbd0b55 | ||
|
|
90cfda893c | ||
|
|
1bf987a6cd | ||
|
|
4166bf8d87 | ||
|
|
bf376b4ff0 | ||
|
|
7e28381df5 | ||
|
|
289e06ce65 | ||
|
|
faeb940134 | ||
|
|
343c04061e | ||
|
|
6440a8950c | ||
|
|
e569a80ec2 | ||
|
|
40a43e46b4 | ||
|
|
7c1b713780 | ||
|
|
52c5679c00 | ||
|
|
5997a494bd | ||
|
|
3665f4d5d0 | ||
|
|
f2da177517 | ||
|
|
6ecae88518 | ||
|
|
769bb5a9bc | ||
|
|
083cfd0efd | ||
|
|
064de08d4b | ||
|
|
f924e72088 | ||
|
|
81e6feded3 |
+2
-1
@@ -2,6 +2,7 @@ TestBenchFramework/bin/
|
||||
TestBenchFramework/obj/
|
||||
ResultsBrowser/bin/
|
||||
ResultsBrowser/obj/
|
||||
TBFSetup/
|
||||
TBFSetup/Debug/
|
||||
TBFSetup/Release/
|
||||
Doc/
|
||||
*.suo
|
||||
@@ -31,13 +31,31 @@ namespace ResultsBrowser
|
||||
/// Database related: This object reference is set after a successful user login
|
||||
public static DatabaseSettings CurrentBench;
|
||||
const string SQLiteDbFName = "SQLite.db";
|
||||
|
||||
#if (DN100 || MUNICH)
|
||||
|
||||
#if MUNICH
|
||||
public const int WMsCount = 3;
|
||||
#elif FUZHOU300 || FUZHOU150 || PT200IL || TORINO50 || BADGER_MALA_TRAT
|
||||
public const int LineSize = 1;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif DN100 || BADGER_VELKA_TRAT
|
||||
public const int WMsCount = 3;
|
||||
public const int LineSize = 3;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif FUZHOU300 || FUZHOU150 || PT200IL
|
||||
public const int WMsCount = 6;
|
||||
#elif TORUN_PT50_2015
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 3;
|
||||
#elif TORINO50 || BADGER_MALA_TRAT
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
|
||||
public const int WMsCount = 20;
|
||||
public const int LineSize = 10;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif IPERLST
|
||||
public const int WMsCount = 40;
|
||||
public const int LineSize = 20;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
@@ -232,7 +250,7 @@ namespace ResultsBrowser
|
||||
if (LocalSettings.LastProcedureName != null)
|
||||
{
|
||||
IList<Entities.Procedure> listOfProcedures = FluentCommon.CreateSession(Database.Procedures)
|
||||
.CreateQuery("FROM Procedure WHERE Name = :procName")
|
||||
.CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' AND Name = :procName")
|
||||
.SetParameter("procName", LocalSettings.LastProcedureName)
|
||||
.List<Entities.Procedure>();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,22 @@
|
||||
iPerl:
|
||||
- menej logovania vah MettlerToledo
|
||||
- naukaldat process data pre UnknownPcbNr... vodomery
|
||||
- vyuzit sirku obrazovky na Activity, Progress bar, Drop down menu
|
||||
|
||||
- log pre pevny start, podobne (zarazky) ako pre letmy
|
||||
- 'Q2 corrected from ...' Evaluate a Publish parametre
|
||||
- STOP nefunguje vzdy (alebo pomaly) - zlepsit uzivatelsky dojem
|
||||
|
||||
- v iPerlCommunication ponukat stringy v drop-down menu
|
||||
- na Process obrazovke posunut stupacku a rezervoar uplne doprava
|
||||
|
||||
- ked su Q3 part 1 a Q3 part 2 neda sa vybrat cez UI Q3 part 2
|
||||
|
||||
- export the DB (=make a backup of configuration) from TBF program
|
||||
|
||||
|
||||
|
||||
|
||||
- ak sa skusa s pevnym startom treba merat priemerny prietok az po uplynuti
|
||||
urcitej doby inak bude vzdy nizsi ako ma byt - rozbeh
|
||||
- bude potrebne doregulovavat pocas merania, Jano poslal moznosti - inak nam
|
||||
@@ -118,3 +137,8 @@ Process screen:
|
||||
---
|
||||
Zobrazit Sim -> prec (ako?)
|
||||
|
||||
-------------------------------------------
|
||||
Ked sa bude upgradovat DB
|
||||
-------------------------------------------
|
||||
- oddelit vysledky od konfiguracie
|
||||
- zaviest ProcedureResult: (TestBenchID, ProgramVersion, ProcedureName, WM_ID, PurchaseNr, BatchNr, TimestampStart, TimestampEnd, Purging parameters, Evacuation parameters)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
{
|
||||
/// <summary>
|
||||
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
|
||||
/// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware.
|
||||
/// Connection settings: 9600 Bd 8-bits No-parity 2-stop-bits Flow control: none.
|
||||
/// </summary>
|
||||
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient
|
||||
{
|
||||
@@ -80,63 +80,96 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate)
|
||||
if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate ||
|
||||
ambientCfg.DebugLevel == Entities.DebugMode.FailureDuringOperation)
|
||||
{
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
return;
|
||||
}
|
||||
|
||||
int receivedBytes = serialPort.BytesToRead;
|
||||
|
||||
if (receivedBytes >= 13)
|
||||
try
|
||||
{
|
||||
byte[] byteArr = new byte[receivedBytes];
|
||||
for (int i = 0; i < receivedBytes; i++) byteArr[i] = (byte)serialPort.ReadByte();
|
||||
log.Debug( Telegram.LogTelegram("Received ", byteArr));
|
||||
int receivedBytes = serialPort.BytesToRead;
|
||||
|
||||
if ((receivedBytes == 13) && (byteArr[0] == 1) && (byteArr[1] == 3) && (byteArr[2] == 8) && Telegram.VerifyTelegramCRC(byteArr))
|
||||
{
|
||||
int value = (int)byteArr[3] * 256 + (int)byteArr[4];
|
||||
temperature = (float)value / 10.0f;
|
||||
if (receivedBytes >= 13)
|
||||
{
|
||||
byte[] byteArr = new byte[receivedBytes];
|
||||
for (int i = 0; i < receivedBytes; i++) byteArr[i] = (byte)serialPort.ReadByte();
|
||||
log.Debug(Telegram.LogTelegram("Received ", byteArr));
|
||||
|
||||
value = (int)byteArr[5] * 256 + (int)byteArr[6];
|
||||
humidity = (float)value / 10.0f;
|
||||
if ((receivedBytes == 13) && (byteArr[0] == 1) && (byteArr[1] == 3) && (byteArr[2] == 8) && Telegram.VerifyTelegramCRC(byteArr))
|
||||
{
|
||||
int value = (int)byteArr[3] * 256 + (int)byteArr[4];
|
||||
temperature = (float)value / 10.0f;
|
||||
|
||||
value = (int)byteArr[9] * 256 + (int)byteArr[10];
|
||||
pressure = (float)value / 10.0f;
|
||||
value = (int)byteArr[5] * 256 + (int)byteArr[6];
|
||||
humidity = (float)value / 10.0f;
|
||||
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
log.InfoFormat("Ambient: temperature = {0} C, humidity = {1} %, pressure = {2} hPa", temperature.ToString("F1"), humidity.ToString("F1"), pressure.ToString("F0"));
|
||||
}
|
||||
value = (int)byteArr[9] * 256 + (int)byteArr[10];
|
||||
pressure = (float)value / 10.0f;
|
||||
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
log.InfoFormat("Ambient: temperature = {0} C, humidity = {1} %, pressure = {2} hPa", temperature.ToString("F1"), humidity.ToString("F1"), pressure.ToString("F0"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugLevel = Entities.DebugMode.FailureDuringOperation;
|
||||
serialPort = null;
|
||||
|
||||
log.FatalFormat("Ambient: Serail port read failure : {0}", e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceAfter()
|
||||
{
|
||||
if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate) return;
|
||||
|
||||
/// Each 10 seconds
|
||||
if ((StateMachine.Time % 10) == 0)
|
||||
{
|
||||
/// Read four registers: 0x31, 0x32, 0x33, 0x34
|
||||
UInt16 regAddr = 0x0030; /// register addr. = 0x31 (Modbus!)
|
||||
UInt16 count = 4;
|
||||
if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate ||
|
||||
ambientCfg.DebugLevel == Entities.DebugMode.FailureDuringOperation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/// Prepare data to be sent
|
||||
byte[] msg = new byte[8];
|
||||
msg[0] = 1; /// (byte)ambientCfg.BusAddress;
|
||||
msg[1] = 3; /// CMD = Read registers
|
||||
msg[2] = (byte)(regAddr >> 8); /// Control Word Hi
|
||||
msg[3] = (byte)(regAddr & 0xFF); /// Control Word Lo
|
||||
msg[4] = (byte)(count >> 8); /// Serial Com Reference Hi
|
||||
msg[5] = (byte)(count & 0xFF); /// Serial Com Reference Lo
|
||||
Telegram.UpdateTelegramCRC(msg);
|
||||
try
|
||||
{
|
||||
/// Each 10 seconds
|
||||
if ((StateMachine.Time % 10) == 0)
|
||||
{
|
||||
/// Read four registers: 0x31, 0x32, 0x33, 0x34
|
||||
UInt16 regAddr = 0x0030; /// register addr. = 0x31 (Modbus!)
|
||||
UInt16 count = 4;
|
||||
|
||||
log.Debug(Telegram.LogTelegram("Sending ", msg));
|
||||
serialPort.Write(msg, 0, msg.Length);
|
||||
}
|
||||
/// Prepare data to be sent
|
||||
byte[] msg = new byte[8];
|
||||
msg[0] = 1; /// (byte)ambientCfg.BusAddress;
|
||||
msg[1] = 3; /// CMD = Read registers
|
||||
msg[2] = (byte)(regAddr >> 8); /// Control Word Hi
|
||||
msg[3] = (byte)(regAddr & 0xFF); /// Control Word Lo
|
||||
msg[4] = (byte)(count >> 8); /// Serial Com Reference Hi
|
||||
msg[5] = (byte)(count & 0xFF); /// Serial Com Reference Lo
|
||||
Telegram.UpdateTelegramCRC(msg);
|
||||
|
||||
log.Debug(Telegram.LogTelegram("Sending ", msg));
|
||||
serialPort.Write(msg, 0, msg.Length);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugLevel = Entities.DebugMode.FailureDuringOperation;
|
||||
serialPort = null;
|
||||
|
||||
log.FatalFormat("Ambient: Serail port read failure : {0}", e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this device</summary>
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
Name = "Ambient";
|
||||
ParentName = string.Empty;
|
||||
ComPortNr = 6;
|
||||
BaudRate = 19200;
|
||||
BaudRate = 9600;
|
||||
Parity = System.IO.Ports.Parity.None;
|
||||
DataBits = 8;
|
||||
StopBits = System.IO.Ports.StopBits.One;
|
||||
StopBits = System.IO.Ports.StopBits.Two;
|
||||
Handshake = System.IO.Ports.Handshake.None;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,58 +82,73 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate)
|
||||
if (ambientCfg.DebugLevel == Entities.DebugMode.Simulate ||
|
||||
ambientCfg.DebugLevel == Entities.DebugMode.FailureDuringOperation)
|
||||
{
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
return;
|
||||
}
|
||||
|
||||
measurementBuilder.Append(serialPort.ReadExisting());
|
||||
int len = measurementBuilder.Length;
|
||||
|
||||
///
|
||||
/// Device sends each 20 sec one line of ASCII text with data in the following format:
|
||||
/// (temp) 6 characters, two decimal digits, with leading spaces
|
||||
/// TAB 1 character
|
||||
/// (humi) 6 characters, two decimal digits, with leading spaces
|
||||
/// TAB 1 character
|
||||
/// (pressure) 6 characters, one decimal digits, with leading spaces is LT 1000
|
||||
/// CR + LF 2 characters
|
||||
/// Example:
|
||||
/// 23.42 38.08 1061.1
|
||||
/// 23.39 38.04 1060.8
|
||||
/// 23.39 38.08 1061.4
|
||||
///
|
||||
if (len >= 22)
|
||||
try
|
||||
{
|
||||
string measurement = measurementBuilder.ToString();
|
||||
measurementBuilder.Clear();
|
||||
measurementBuilder.Append(serialPort.ReadExisting());
|
||||
int len = measurementBuilder.Length;
|
||||
|
||||
float t = 0;
|
||||
float h = 0;
|
||||
float p = 0;
|
||||
if (float.TryParse(measurement.Substring(len - 22, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite,
|
||||
CultureInfo.InvariantCulture, out t) &&
|
||||
measurement[len - 16] == '\t' &&
|
||||
float.TryParse(measurement.Substring(len - 15, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite,
|
||||
CultureInfo.InvariantCulture, out h) &&
|
||||
measurement[len - 9] == '\t' &&
|
||||
float.TryParse(measurement.Substring(len - 8, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite,
|
||||
CultureInfo.InvariantCulture, out p) &&
|
||||
measurement[len - 2] == '\r' &&
|
||||
measurement[len - 1] == '\n')
|
||||
///
|
||||
/// Device sends each 20 sec one line of ASCII text with data in the following format:
|
||||
/// (temp) 6 characters, two decimal digits, with leading spaces
|
||||
/// TAB 1 character
|
||||
/// (humi) 6 characters, two decimal digits, with leading spaces
|
||||
/// TAB 1 character
|
||||
/// (pressure) 6 characters, one decimal digits, with leading spaces is LT 1000
|
||||
/// CR + LF 2 characters
|
||||
/// Example:
|
||||
/// 23.42 38.08 1061.1
|
||||
/// 23.39 38.04 1060.8
|
||||
/// 23.39 38.08 1061.4
|
||||
///
|
||||
if (len >= 22)
|
||||
{
|
||||
temperature = t;
|
||||
humidity = h;
|
||||
pressure = p;
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
string measurement = measurementBuilder.ToString();
|
||||
measurementBuilder.Clear();
|
||||
|
||||
log.InfoFormat("Ambient: temperature = {0} C, humidity = {1} %, pressure = {2} hPa", temperature.ToString("F1"), humidity.ToString("F1"), pressure.ToString("F0"));
|
||||
}
|
||||
else
|
||||
float t = 0;
|
||||
float h = 0;
|
||||
float p = 0;
|
||||
if (float.TryParse(measurement.Substring(len - 22, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite,
|
||||
CultureInfo.InvariantCulture, out t) &&
|
||||
measurement[len - 16] == '\t' &&
|
||||
float.TryParse(measurement.Substring(len - 15, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite,
|
||||
CultureInfo.InvariantCulture, out h) &&
|
||||
measurement[len - 9] == '\t' &&
|
||||
float.TryParse(measurement.Substring(len - 8, 6), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite,
|
||||
CultureInfo.InvariantCulture, out p) &&
|
||||
measurement[len - 2] == '\r' &&
|
||||
measurement[len - 1] == '\n')
|
||||
{
|
||||
temperature = t;
|
||||
humidity = h;
|
||||
pressure = p;
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
|
||||
log.InfoFormat("Ambient: temperature = {0} C, humidity = {1} %, pressure = {2} hPa", temperature.ToString("F1"), humidity.ToString("F1"), pressure.ToString("F0"));
|
||||
}
|
||||
else
|
||||
{
|
||||
log.Warn("Invalid string received: " + measurement);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugLevel = Entities.DebugMode.FailureDuringOperation;
|
||||
serialPort = null;
|
||||
|
||||
log.FatalFormat("Ambient: Serail port read failure : {0}", e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
log.Warn("Invalid string received: " + measurement);
|
||||
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -1,5 +1,6 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,19 +10,19 @@ using TBF.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchId
|
||||
namespace TBF.BenchControl.BenchInfo.Munich
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench.
|
||||
/// </summary>
|
||||
public class Component : ComponentBase
|
||||
public class Component : ComponentBase, GenericDevices.IBenchInfo
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("BenchId({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("BenchInfo({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly ComponentCfg benchIdCfg;
|
||||
readonly ComponentCfg benchInfoCfg;
|
||||
|
||||
public int TestBenchNr { get { return benchIdCfg.TestBenchNr; } }
|
||||
public string TestBenchId { get { return benchInfoCfg.TestBenchId; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace TBF.BenchControl.BenchId
|
||||
public Component(ComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
benchIdCfg = cfg;
|
||||
benchInfoCfg = cfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,12 +1,13 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchId
|
||||
namespace TBF.BenchControl.BenchInfo.Munich
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench - serializable configuration.
|
||||
@@ -19,14 +20,14 @@ namespace TBF.BenchControl.BenchId
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int TestBenchNr;
|
||||
public string TestBenchId;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg()
|
||||
{
|
||||
Name = "Bench-ID";
|
||||
Name = "BenchInfo";
|
||||
ParentName = string.Empty;
|
||||
TestBenchNr = 1;
|
||||
TestBenchId = "1";
|
||||
}
|
||||
|
||||
public ComponentCfg(IComponentFactory factory)
|
||||
@@ -37,9 +38,7 @@ namespace TBF.BenchControl.BenchId
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, TestBenchNr={1}",
|
||||
Name,
|
||||
TestBenchNr);
|
||||
return string.Format("Name={0}, TestBenchId={1}", Name, TestBenchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,5 +1,6 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
@@ -7,7 +8,7 @@ using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.BenchId
|
||||
namespace TBF.BenchControl.BenchInfo.Munich
|
||||
{
|
||||
public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
@@ -47,7 +48,7 @@ namespace TBF.BenchControl.BenchId
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
numberTextBox.Text = config.TestBenchNr.ToString();
|
||||
numberTextBox.Text = config.TestBenchId;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
@@ -69,9 +70,7 @@ namespace TBF.BenchControl.BenchId
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
///
|
||||
config.Name = nameTextBox.Text;
|
||||
|
||||
try { config.TestBenchNr = int.Parse(numberTextBox.Text); }
|
||||
catch { config.TestBenchNr = 1; }
|
||||
config.TestBenchId = numberTextBox.Text;
|
||||
|
||||
return flags;
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.BenchId
|
||||
namespace TBF.BenchControl.BenchInfo.Munich
|
||||
{
|
||||
partial class ComponentCfgCtrl
|
||||
{
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchId
|
||||
namespace TBF.BenchControl.BenchInfo.Munich
|
||||
{
|
||||
public class ComponentFactory : IComponentFactory
|
||||
{
|
||||
@@ -0,0 +1,38 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using TBF.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench.
|
||||
/// </summary>
|
||||
public class Component : ComponentBase, GenericDevices.IBenchInfo
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("BenchInfoPL({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly ComponentCfg benchInfoCfg;
|
||||
|
||||
public string TestBenchId { get { return benchInfoCfg.TestBenchId; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component(ComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
benchInfoCfg = cfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public IComponent GetComponent(IList<IComponent> components) { return new Component(this); }
|
||||
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string 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;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg()
|
||||
{
|
||||
Name = "BenchInfo";
|
||||
ParentName = string.Empty;
|
||||
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;
|
||||
}
|
||||
|
||||
public ComponentCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, TestBenchId={1}", Name, TestBenchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ComponentCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
ComponentCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as ComponentCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public ComponentCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
nameLabel.Text = Strings.Name;
|
||||
benchIdLabel.Text = Strings.Test_bench_number;
|
||||
|
||||
address1Label.Text = Strings.Address + " 1";
|
||||
address2Label.Text = Strings.Address + " 2";
|
||||
address3Label.Text = Strings.Address + " 3";
|
||||
address4Label.Text = Strings.Address + " 4";
|
||||
address5Label.Text = Strings.Address + " 5";
|
||||
|
||||
approvalIdLabel.Text = Strings.Approval_ID;
|
||||
approvalDateLabel.Text = Strings.Approval_date;
|
||||
approvedByLabel.Text = Strings.Approved_by;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
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;
|
||||
benchIdTextBox.Text = config.TestBenchId;
|
||||
|
||||
address1TextBox.Text = config.Address1;
|
||||
address2TextBox.Text = config.Address2;
|
||||
address3TextBox.Text = config.Address3;
|
||||
address4TextBox.Text = config.Address4;
|
||||
address5TextBox.Text = config.Address5;
|
||||
|
||||
approvalIdTextBox.Text = config.ApprovalId;
|
||||
approvalDateTextBox.Text = config.ApprovalDate;
|
||||
approvedByTextBox.Text = config.ApprovedBy;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
benchIdTextBox.Enabled = true;
|
||||
|
||||
address1TextBox.Enabled = true;
|
||||
address2TextBox.Enabled = true;
|
||||
address3TextBox.Enabled = true;
|
||||
address4TextBox.Enabled = true;
|
||||
address5TextBox.Enabled = true;
|
||||
|
||||
approvalIdTextBox.Enabled = true;
|
||||
approvalDateTextBox.Enabled = true;
|
||||
approvedByTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
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.TestBenchId = benchIdTextBox.Text;
|
||||
|
||||
config.Address1 = address1TextBox.Text;
|
||||
config.Address2 = address2TextBox.Text;
|
||||
config.Address3 = address3TextBox.Text;
|
||||
config.Address4 = address4TextBox.Text;
|
||||
config.Address5 = address5TextBox.Text;
|
||||
|
||||
config.ApprovalId = approvalIdTextBox.Text;
|
||||
config.ApprovalDate = approvalDateTextBox.Text;
|
||||
config.ApprovedBy = approvedByTextBox.Text;
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
partial class ComponentCfgCtrl
|
||||
{
|
||||
/// <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.benchIdLabel = new System.Windows.Forms.Label();
|
||||
this.benchIdTextBox = new System.Windows.Forms.TextBox();
|
||||
this.address1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address1Label = new System.Windows.Forms.Label();
|
||||
this.address2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address2Label = new System.Windows.Forms.Label();
|
||||
this.address3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address3Label = new System.Windows.Forms.Label();
|
||||
this.address4TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address4Label = new System.Windows.Forms.Label();
|
||||
this.address5TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address5Label = new System.Windows.Forms.Label();
|
||||
this.approvedByTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvedByLabel = new System.Windows.Forms.Label();
|
||||
this.approvalDateTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvalDateLabel = new System.Windows.Forms.Label();
|
||||
this.approvalIdTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvalIdLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(113, 26);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(88, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(6, 29);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(110, 6);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(60, 13);
|
||||
this.classNameLabel.TabIndex = 3;
|
||||
this.classNameLabel.Text = "ClassName";
|
||||
//
|
||||
// benchIdLabel
|
||||
//
|
||||
this.benchIdLabel.AutoSize = true;
|
||||
this.benchIdLabel.Location = new System.Drawing.Point(6, 50);
|
||||
this.benchIdLabel.Name = "benchIdLabel";
|
||||
this.benchIdLabel.Size = new System.Drawing.Size(52, 13);
|
||||
this.benchIdLabel.TabIndex = 6;
|
||||
this.benchIdLabel.Text = "Bench ID";
|
||||
//
|
||||
// benchIdTextBox
|
||||
//
|
||||
this.benchIdTextBox.Enabled = false;
|
||||
this.benchIdTextBox.Location = new System.Drawing.Point(113, 47);
|
||||
this.benchIdTextBox.Name = "benchIdTextBox";
|
||||
this.benchIdTextBox.Size = new System.Drawing.Size(57, 20);
|
||||
this.benchIdTextBox.TabIndex = 7;
|
||||
//
|
||||
// address1TextBox
|
||||
//
|
||||
this.address1TextBox.Enabled = false;
|
||||
this.address1TextBox.Location = new System.Drawing.Point(73, 75);
|
||||
this.address1TextBox.Name = "address1TextBox";
|
||||
this.address1TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address1TextBox.TabIndex = 9;
|
||||
//
|
||||
// address1Label
|
||||
//
|
||||
this.address1Label.AutoSize = true;
|
||||
this.address1Label.Location = new System.Drawing.Point(6, 78);
|
||||
this.address1Label.Name = "address1Label";
|
||||
this.address1Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address1Label.TabIndex = 8;
|
||||
this.address1Label.Text = "Address 1";
|
||||
//
|
||||
// address2TextBox
|
||||
//
|
||||
this.address2TextBox.Enabled = false;
|
||||
this.address2TextBox.Location = new System.Drawing.Point(73, 95);
|
||||
this.address2TextBox.Name = "address2TextBox";
|
||||
this.address2TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address2TextBox.TabIndex = 11;
|
||||
//
|
||||
// address2Label
|
||||
//
|
||||
this.address2Label.AutoSize = true;
|
||||
this.address2Label.Location = new System.Drawing.Point(6, 98);
|
||||
this.address2Label.Name = "address2Label";
|
||||
this.address2Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address2Label.TabIndex = 10;
|
||||
this.address2Label.Text = "Address 2";
|
||||
//
|
||||
// address3TextBox
|
||||
//
|
||||
this.address3TextBox.Enabled = false;
|
||||
this.address3TextBox.Location = new System.Drawing.Point(73, 115);
|
||||
this.address3TextBox.Name = "address3TextBox";
|
||||
this.address3TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address3TextBox.TabIndex = 13;
|
||||
//
|
||||
// address3Label
|
||||
//
|
||||
this.address3Label.AutoSize = true;
|
||||
this.address3Label.Location = new System.Drawing.Point(6, 118);
|
||||
this.address3Label.Name = "address3Label";
|
||||
this.address3Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address3Label.TabIndex = 12;
|
||||
this.address3Label.Text = "Address 3";
|
||||
//
|
||||
// address4TextBox
|
||||
//
|
||||
this.address4TextBox.Enabled = false;
|
||||
this.address4TextBox.Location = new System.Drawing.Point(73, 136);
|
||||
this.address4TextBox.Name = "address4TextBox";
|
||||
this.address4TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address4TextBox.TabIndex = 15;
|
||||
//
|
||||
// address4Label
|
||||
//
|
||||
this.address4Label.AutoSize = true;
|
||||
this.address4Label.Location = new System.Drawing.Point(6, 139);
|
||||
this.address4Label.Name = "address4Label";
|
||||
this.address4Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address4Label.TabIndex = 14;
|
||||
this.address4Label.Text = "Address 4";
|
||||
//
|
||||
// address5TextBox
|
||||
//
|
||||
this.address5TextBox.Enabled = false;
|
||||
this.address5TextBox.Location = new System.Drawing.Point(73, 157);
|
||||
this.address5TextBox.Name = "address5TextBox";
|
||||
this.address5TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address5TextBox.TabIndex = 17;
|
||||
//
|
||||
// address5Label
|
||||
//
|
||||
this.address5Label.AutoSize = true;
|
||||
this.address5Label.Location = new System.Drawing.Point(6, 160);
|
||||
this.address5Label.Name = "address5Label";
|
||||
this.address5Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address5Label.TabIndex = 16;
|
||||
this.address5Label.Text = "Address 5";
|
||||
//
|
||||
// approvedByTextBox
|
||||
//
|
||||
this.approvedByTextBox.Enabled = false;
|
||||
this.approvedByTextBox.Location = new System.Drawing.Point(113, 227);
|
||||
this.approvedByTextBox.Name = "approvedByTextBox";
|
||||
this.approvedByTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.approvedByTextBox.TabIndex = 23;
|
||||
//
|
||||
// approvedByLabel
|
||||
//
|
||||
this.approvedByLabel.AutoSize = true;
|
||||
this.approvedByLabel.Location = new System.Drawing.Point(6, 230);
|
||||
this.approvedByLabel.Name = "approvedByLabel";
|
||||
this.approvedByLabel.Size = new System.Drawing.Size(67, 13);
|
||||
this.approvedByLabel.TabIndex = 22;
|
||||
this.approvedByLabel.Text = "Approved by";
|
||||
//
|
||||
// approvalDateTextBox
|
||||
//
|
||||
this.approvalDateTextBox.Enabled = false;
|
||||
this.approvalDateTextBox.Location = new System.Drawing.Point(113, 206);
|
||||
this.approvalDateTextBox.Name = "approvalDateTextBox";
|
||||
this.approvalDateTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.approvalDateTextBox.TabIndex = 21;
|
||||
//
|
||||
// approvalDateLabel
|
||||
//
|
||||
this.approvalDateLabel.AutoSize = true;
|
||||
this.approvalDateLabel.Location = new System.Drawing.Point(6, 209);
|
||||
this.approvalDateLabel.Name = "approvalDateLabel";
|
||||
this.approvalDateLabel.Size = new System.Drawing.Size(73, 13);
|
||||
this.approvalDateLabel.TabIndex = 20;
|
||||
this.approvalDateLabel.Text = "Approval date";
|
||||
//
|
||||
// approvalIdTextBox
|
||||
//
|
||||
this.approvalIdTextBox.Enabled = false;
|
||||
this.approvalIdTextBox.Location = new System.Drawing.Point(113, 185);
|
||||
this.approvalIdTextBox.Name = "approvalIdTextBox";
|
||||
this.approvalIdTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.approvalIdTextBox.TabIndex = 19;
|
||||
//
|
||||
// approvalIdLabel
|
||||
//
|
||||
this.approvalIdLabel.AutoSize = true;
|
||||
this.approvalIdLabel.Location = new System.Drawing.Point(6, 188);
|
||||
this.approvalIdLabel.Name = "approvalIdLabel";
|
||||
this.approvalIdLabel.Size = new System.Drawing.Size(61, 13);
|
||||
this.approvalIdLabel.TabIndex = 18;
|
||||
this.approvalIdLabel.Text = "Approval Id";
|
||||
//
|
||||
// ComponentCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.approvedByTextBox);
|
||||
this.Controls.Add(this.approvedByLabel);
|
||||
this.Controls.Add(this.approvalDateTextBox);
|
||||
this.Controls.Add(this.approvalDateLabel);
|
||||
this.Controls.Add(this.approvalIdTextBox);
|
||||
this.Controls.Add(this.approvalIdLabel);
|
||||
this.Controls.Add(this.address5TextBox);
|
||||
this.Controls.Add(this.address5Label);
|
||||
this.Controls.Add(this.address4TextBox);
|
||||
this.Controls.Add(this.address4Label);
|
||||
this.Controls.Add(this.address3TextBox);
|
||||
this.Controls.Add(this.address3Label);
|
||||
this.Controls.Add(this.address2TextBox);
|
||||
this.Controls.Add(this.address2Label);
|
||||
this.Controls.Add(this.address1TextBox);
|
||||
this.Controls.Add(this.address1Label);
|
||||
this.Controls.Add(this.benchIdTextBox);
|
||||
this.Controls.Add(this.benchIdLabel);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "ComponentCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 250);
|
||||
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.Label benchIdLabel;
|
||||
private System.Windows.Forms.TextBox benchIdTextBox;
|
||||
private System.Windows.Forms.TextBox address1TextBox;
|
||||
private System.Windows.Forms.Label address1Label;
|
||||
private System.Windows.Forms.TextBox address2TextBox;
|
||||
private System.Windows.Forms.Label address2Label;
|
||||
private System.Windows.Forms.TextBox address3TextBox;
|
||||
private System.Windows.Forms.Label address3Label;
|
||||
private System.Windows.Forms.TextBox address4TextBox;
|
||||
private System.Windows.Forms.Label address4Label;
|
||||
private System.Windows.Forms.TextBox address5TextBox;
|
||||
private System.Windows.Forms.Label address5Label;
|
||||
private System.Windows.Forms.TextBox approvedByTextBox;
|
||||
private System.Windows.Forms.Label approvedByLabel;
|
||||
private System.Windows.Forms.TextBox approvalDateTextBox;
|
||||
private System.Windows.Forms.Label approvalDateLabel;
|
||||
private System.Windows.Forms.TextBox approvalIdTextBox;
|
||||
private System.Windows.Forms.Label approvalIdLabel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
public class ComponentFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "BenchInfoPL"; } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new ComponentCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(ComponentCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,6 +224,42 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(RoiProcedureParams prms)
|
||||
{
|
||||
prms.IRoiX = this.IRoiX;
|
||||
prms.IRoiY = this.IRoiY;
|
||||
prms.IRoiW = this.IRoiW;
|
||||
prms.IRoiH = this.IRoiH;
|
||||
|
||||
prms.GradPerLtr = this.GradPerLtr;
|
||||
prms.CCW = this.CCW;
|
||||
prms.ORoiW = this.ORoiW;
|
||||
prms.ORoiH = this.ORoiH;
|
||||
prms.CX = this.CX;
|
||||
prms.CY = this.CY;
|
||||
|
||||
prms.R1 = this.R1;
|
||||
prms.R2 = this.R2;
|
||||
prms.R3 = this.R3;
|
||||
prms.Ang1 = this.Ang1;
|
||||
prms.Ang2 = this.Ang2;
|
||||
prms.AngStep = this.AngStep;
|
||||
prms.MinMvmt = this.MinMvmt;
|
||||
prms.MaxMvmt = this.MaxMvmt;
|
||||
|
||||
prms.SequenceLen = this.SequenceLen;
|
||||
prms.SequenceTiming = this.SequenceTiming;
|
||||
prms.BackgroundCorr = this.BackgroundCorr;
|
||||
prms.BrightnessRoi = this.BrightnessRoi;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
RoiProcedureParams pars = new RoiProcedureParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -236,31 +272,7 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
IRoiX = tmp.IRoiX;
|
||||
IRoiY = tmp.IRoiY;
|
||||
IRoiW = tmp.IRoiW;
|
||||
IRoiH = tmp.IRoiH;
|
||||
|
||||
GradPerLtr = tmp.GradPerLtr;
|
||||
CCW = tmp.CCW;
|
||||
ORoiW = tmp.ORoiW;
|
||||
ORoiH = tmp.ORoiH;
|
||||
CX = tmp.CX;
|
||||
CY = tmp.CY;
|
||||
|
||||
R1 = tmp.R1;
|
||||
R2 = tmp.R2;
|
||||
R3 = tmp.R3;
|
||||
Ang1 = tmp.Ang1;
|
||||
Ang2 = tmp.Ang2;
|
||||
AngStep = tmp.AngStep;
|
||||
MinMvmt = tmp.MinMvmt;
|
||||
MaxMvmt = tmp.MaxMvmt;
|
||||
|
||||
SequenceLen = tmp.SequenceLen;
|
||||
SequenceTiming = tmp.SequenceTiming;
|
||||
BackgroundCorr = tmp.BackgroundCorr;
|
||||
BrightnessRoi = tmp.BrightnessRoi;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace TBF.BenchControl
|
||||
public string ParentName { get { return cfg.ParentName; } }
|
||||
public Generic.IComponentFactory Factory { get { return cfg.Factory; } }
|
||||
public int ItemNr { get { return cfg.ItemNr; } }
|
||||
public Entities.DebugMode DebugLevel { get { return cfg.DebugLevel; } }
|
||||
public Entities.DebugMode DebugLevel { get { return cfg.DebugLevel; } set { cfg.DebugLevel = value; } }
|
||||
public Entities.LogLevel LogLevel { get { return cfg.LogLevel; } }
|
||||
public IList<MeasurementCorrection> Corrections { get { return cfg.Corrections; } }
|
||||
|
||||
|
||||
@@ -0,0 +1,803 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using Oracle.DataAccess.Client; // ODP.NET Oracle managed provider
|
||||
using Oracle.DataAccess.Types;
|
||||
using TBF.BenchControl;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DB.SensusOracle
|
||||
{
|
||||
public class Database : ComponentBase, IOperation, GenericDevices.IResultsWriter, Generic.IDevice
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Database));
|
||||
public override string ToString() { return string.Format("ResultsWriters.Basic({0})", Cfg.ToString(1)); }
|
||||
|
||||
const int Anbid_StaraTura = 4;
|
||||
|
||||
readonly DatabaseCfg dbCfg;
|
||||
OracleConnection conn; /// Oracle database connection
|
||||
|
||||
/// <summary>
|
||||
/// Result items to print
|
||||
/// </summary>
|
||||
IList<TBF.Forms.ResultItemSpec> resultItems;
|
||||
bool combined;
|
||||
|
||||
/// <summary>
|
||||
/// Results to print
|
||||
/// </summary>
|
||||
Entities.Procedure procedure;
|
||||
IList<GenericDevices.IWaterMeter> waterMeters;
|
||||
IList<Entities.TestResult> unsortedResults;
|
||||
DateTime dateTime;
|
||||
StreamWriter writer;
|
||||
|
||||
bool batchDataSaved; /// This is to save batch data (VT_PRUEFREIHE_PD) only once
|
||||
|
||||
string separatorStr;
|
||||
|
||||
public Database()
|
||||
{
|
||||
}
|
||||
|
||||
public Database(DatabaseCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
dbCfg = cfg;
|
||||
|
||||
switch (cfg.Separator)
|
||||
{
|
||||
default:
|
||||
case Separator.None:
|
||||
separatorStr = string.Empty;
|
||||
break;
|
||||
case Separator.Space:
|
||||
separatorStr = " ";
|
||||
break;
|
||||
case Separator.Tabulator:
|
||||
separatorStr = "\t";
|
||||
break;
|
||||
case Separator.Comma:
|
||||
separatorStr = ",";
|
||||
break;
|
||||
case Separator.Semicolon:
|
||||
separatorStr = ";";
|
||||
break;
|
||||
}
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
if (dbCfg.DBUsed == DBUsed.Test)
|
||||
{
|
||||
conn = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
|
||||
}
|
||||
else if (dbCfg.DBUsed == DBUsed.Production)
|
||||
{
|
||||
conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
|
||||
}
|
||||
else if (dbCfg.DBUsed == DBUsed.Quality)
|
||||
{
|
||||
/// Temporarily use test database
|
||||
conn = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
|
||||
}
|
||||
|
||||
///
|
||||
/// Do something with the database to see if the connection works well
|
||||
///
|
||||
conn.Open();
|
||||
|
||||
string rslt = "none";
|
||||
OracleCommand cmd = new OracleCommand("select Standort from ANBIETER_SD where ANBID = 4", conn);
|
||||
OracleDataReader dr = cmd.ExecuteReader();
|
||||
if (dr.Read()) rslt = dr.GetString(0);
|
||||
|
||||
conn.Close();
|
||||
}
|
||||
|
||||
public void RunDeviceBefore() {}
|
||||
public void RunDeviceAfter() {}
|
||||
|
||||
public void StopDevice()
|
||||
{
|
||||
if (conn != null) conn.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminate spaces conditionally, depesing on bool WriterCfg.EliminateSpaces
|
||||
/// </summary>
|
||||
/// <param name="item">Input string</param>
|
||||
/// <returns>Output string</returns>
|
||||
string ElSpaces(string item)
|
||||
{
|
||||
if (dbCfg.EliminateSpaces)
|
||||
return item.Replace(" ", string.Empty);
|
||||
else
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a file name derived from a DateTime structure.
|
||||
/// Creates directories on this path as a side effect.
|
||||
/// </summary>
|
||||
/// <param name="time">Date and time</param>
|
||||
/// <returns>File name</returns>
|
||||
string GetFilename(DateTime time)
|
||||
{
|
||||
string directory = dbCfg.DestinationPath; /// Ends with "\\";
|
||||
Directory.CreateDirectory(directory);
|
||||
|
||||
if (dbCfg.YearFolders)
|
||||
{
|
||||
directory = string.Format("{0}{1}\\", directory, time.Year.ToString());
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
|
||||
if (dbCfg.MonthFolders)
|
||||
{
|
||||
string monthStr /* = now.Month.ToString("D2")*/;
|
||||
switch (time.Month)
|
||||
{
|
||||
default:
|
||||
case 1: monthStr = "January"; break;
|
||||
case 2: monthStr = "February"; break;
|
||||
case 3: monthStr = "March"; break;
|
||||
case 4: monthStr = "April"; break;
|
||||
case 5: monthStr = "May"; break;
|
||||
case 6: monthStr = "June"; break;
|
||||
case 7: monthStr = "July"; break;
|
||||
case 8: monthStr = "August"; break;
|
||||
case 9: monthStr = "September"; break;
|
||||
case 10: monthStr = "October"; break;
|
||||
case 11: monthStr = "November"; break;
|
||||
case 12: monthStr = "December"; break;
|
||||
}
|
||||
directory = string.Format("{0}{1}\\", directory, monthStr);
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
|
||||
if (dbCfg.DayFolders)
|
||||
{
|
||||
directory = string.Format("{0}{1}\\", directory, time.Day.ToString("D2"));
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
|
||||
return string.Format("{0}{1}{2}{3}-{4}{5}.txt", directory, (time.Year % 100).ToString("D2"),
|
||||
time.Month.ToString("D2"), time.Day.ToString("D2"), time.Hour.ToString("D2"), time.Minute.ToString("D2"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the test cycle results into a file, Events: Event.ResultsWritten
|
||||
/// </summary>
|
||||
/// <param name="procedure">Procedure to print the results of</param>
|
||||
/// <param name="unsortedResults">Results to write into the file</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation WriteResultsOp(Entities.Procedure procedure, IList<GenericDevices.IWaterMeter> waterMeters, IList<Entities.TestResult> unsortedResults)
|
||||
{
|
||||
if ((procedure == null) || (unsortedResults == null) || (unsortedResults.Count < 1))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
this.procedure = procedure;
|
||||
this.waterMeters = waterMeters;
|
||||
this.unsortedResults = unsortedResults;
|
||||
|
||||
combined = (procedure.MetersKind == Entities.MetersKind.Combined);
|
||||
if (combined)
|
||||
{
|
||||
resultItems = Forms.ResultItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Disk_CombinedWM);
|
||||
}
|
||||
else
|
||||
{
|
||||
resultItems = Forms.ResultItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Disk_SingleWM);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
dateTime = DateTime.Now;
|
||||
writer = new StreamWriter(System.IO.File.Create(GetFilename(dateTime)));
|
||||
}
|
||||
catch
|
||||
{
|
||||
writer = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
batchDataSaved = false;
|
||||
|
||||
if (writer == null) return;
|
||||
|
||||
///----------
|
||||
/// Header
|
||||
///----------
|
||||
writer.WriteLine(unsortedResults[0].ProtocolTitle);
|
||||
writer.WriteLine(string.Empty);
|
||||
|
||||
string[] leftColumn = new string[]
|
||||
{
|
||||
"Batch number: ",
|
||||
"Date and time: ",
|
||||
"Procedure:",
|
||||
Strings.User_,
|
||||
"Ambient temperature: ",
|
||||
"Ambient pressure: ",
|
||||
"Ambient humidity: ",
|
||||
};
|
||||
|
||||
string[] rightColumn = new string[]
|
||||
{
|
||||
unsortedResults[0].BatchNr.ToString(),
|
||||
//dateTime.ToShortDateString() + " " + dateTime.ToShortTimeString(),
|
||||
string.Format("{0}.{1}.{2} {3}:{4}", dateTime.Year.ToString("D4"),
|
||||
dateTime.Month.ToString("D2"),
|
||||
dateTime.Day.ToString("D2"),
|
||||
dateTime.Hour.ToString("D2"),
|
||||
dateTime.Minute.ToString("D2")),
|
||||
procedure.Name,
|
||||
Entities.User.CurrentUser.Name,
|
||||
unsortedResults[0].AmbientTempAve.ToString("F1") + " °C",
|
||||
unsortedResults[0].AmbientPressAve.ToString("F0") + " mbar",
|
||||
unsortedResults[0].AmbientHumiAve.ToString("F0") + " %",
|
||||
};
|
||||
|
||||
/// Determine max. left column width in characters
|
||||
int maxLen = 0;
|
||||
foreach (var s in leftColumn) if (s.Length > maxLen) maxLen = s.Length;
|
||||
|
||||
/// Write aligned columns
|
||||
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
|
||||
{
|
||||
writer.Write(leftColumn[i]);
|
||||
writer.Write(new string(' ', maxLen - leftColumn[i].Length + 3));
|
||||
writer.WriteLine(rightColumn[i]);
|
||||
}
|
||||
writer.WriteLine(string.Empty);
|
||||
|
||||
/// Write text body to a disk file
|
||||
if (combined)
|
||||
{
|
||||
for (int wmNr = 0; wmNr < Program.CompoundWMsCount; wmNr++) WriteCombinedWM(wmNr + 1); /// wmNr is 0-based
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int wmNr = 0; wmNr < Program.WMsCount; wmNr++) /// wmNr is 0-based
|
||||
{
|
||||
if (!unsortedResults[0].Meters[wmNr].Disabled)
|
||||
{
|
||||
IList<Entities.TestResult> results = Utils.GetSortedTestResults(procedure, unsortedResults, Utils.PartNr(wmNr + 1, combined));
|
||||
WriteSingleWM(wmNr, wmNr + 1, results);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Close the file
|
||||
writer.Close();
|
||||
writer = null;
|
||||
|
||||
|
||||
///---------------------------------
|
||||
/// Write results to the database
|
||||
///--------------------------------
|
||||
if (!combined)
|
||||
{
|
||||
/// Open the Oracle database
|
||||
conn.Open();
|
||||
|
||||
for (int wmNr = 0; wmNr < Program.WMsCount; wmNr++) /// wmNr is 0-based
|
||||
{
|
||||
WaterMeters.iPerl.WaterMeter wMtr = (waterMeters != null && waterMeters.Count > wmNr) ? waterMeters[wmNr] as WaterMeters.iPerl.WaterMeter : null;
|
||||
if (!unsortedResults[0].Meters[wmNr].Disabled && wMtr != null)
|
||||
{
|
||||
IList<Entities.TestResult> results = Utils.GetSortedTestResults(procedure, unsortedResults, Utils.PartNr(wmNr + 1, combined));
|
||||
SaveSingleWM2DB(wmNr, wMtr, results);
|
||||
}
|
||||
}
|
||||
|
||||
/// Close the Oracle database
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Write one meter results into the database
|
||||
/// </summary>
|
||||
/// <param name="wmNr">0-based water meter number</param>
|
||||
/// <param name="results">Sorted list of results to save</param>
|
||||
void SaveSingleWM2DB(int wmNr, WaterMeters.iPerl.WaterMeter wMtr, IList<Entities.TestResult> results)
|
||||
{
|
||||
if (string.IsNullOrEmpty(unsortedResults[0].Meters[wmNr].SerialNr)) return; /// No database activity possible w/o PCB number
|
||||
|
||||
|
||||
string pcbNr = unsortedResults[0].Meters[wmNr].SerialNr;
|
||||
|
||||
///
|
||||
/// Read a list of all prufindexes for a given PCB Number
|
||||
///
|
||||
IList<int> pruefindexes = new List<int>();
|
||||
{
|
||||
OracleParameter parm = new OracleParameter();
|
||||
parm.OracleDbType = OracleDbType.Varchar2;
|
||||
parm.Value = pcbNr;
|
||||
|
||||
OracleCommand cmd1 = new OracleCommand("SELECT MAX_Pruefindex FROM VT_ZAEHLER_PD WHERE VT_Fernum = :1 AND ANBID = 4", conn);
|
||||
cmd1.Parameters.Add(parm);
|
||||
|
||||
OracleDataReader dr = cmd1.ExecuteReader();
|
||||
|
||||
while (dr.Read())
|
||||
{
|
||||
pruefindexes.Add(dr.GetInt32(0));
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Determine MAX_Pruefindex
|
||||
///
|
||||
int maxpruefindexLowPart = 0;
|
||||
foreach (var v in pruefindexes)
|
||||
{
|
||||
if ((v % 100) > maxpruefindexLowPart) maxpruefindexLowPart = (v % 100);
|
||||
}
|
||||
int MAX_Pruefindex = 100 * dbCfg.TestBenchId + maxpruefindexLowPart + 1;
|
||||
|
||||
|
||||
bool passed = true;
|
||||
int Sekundaere_Adr;
|
||||
int Hydr_Pruefung;
|
||||
|
||||
foreach (var r in results)
|
||||
{
|
||||
if (!r.DoNotEvaluate && !r.Meters[wmNr].Passed) passed = false;
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
/// Failed
|
||||
Sekundaere_Adr = 0;
|
||||
Hydr_Pruefung = 97; /// Hydr. test failed, Pressure test passed
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Passed
|
||||
Sekundaere_Adr = 1;
|
||||
if (maxpruefindexLowPart == 0)
|
||||
Hydr_Pruefung = 96;
|
||||
else
|
||||
Hydr_Pruefung = 224;
|
||||
}
|
||||
|
||||
string pOrder = string.IsNullOrEmpty(unsortedResults[0].PurchaseOrder) ? string.Empty : unsortedResults[0].PurchaseOrder;
|
||||
|
||||
if (MAX_Pruefindex % 100 == 1)
|
||||
{
|
||||
OracleCommand cmd = new OracleCommand("INSERT INTO VT_ZAEHLER_PD(Auftragsnummer, VT_Identnummer, VT_Fernum, Max_Pruefindex, Zaehlernummer, Sekundaere_Adr, Hydr_Pruefung, ID_Benutzer, ANBID, Baujahr) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10)", conn);
|
||||
|
||||
OracleParameter parm;
|
||||
parm = new OracleParameter("Auftragsnummer", OracleDbType.Varchar2); parm.Value = pOrder; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("VT_Identnummer", OracleDbType.Varchar2); parm.Value = "IPBATMXX"; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("VT_Fernum", OracleDbType.Varchar2); parm.Value = pcbNr; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Max_Pruefindex", OracleDbType.Int32); parm.Value = MAX_Pruefindex; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Zaehlernummer", OracleDbType.Int32); parm.Value = -1; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Sekundaere_Adr", OracleDbType.Int32); parm.Value = Sekundaere_Adr; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Hydr_Pruefung", OracleDbType.Int32); parm.Value = Hydr_Pruefung; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ID_Benutzer", OracleDbType.Int32); parm.Value = 6; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Baujahr", OracleDbType.Int32); parm.Value = dbCfg.Baujahr; cmd.Parameters.Add(parm);
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
}
|
||||
else
|
||||
{
|
||||
OracleCommand cmd = new OracleCommand("UPDATE VT_ZAEHLER_PD SET Auftragsnummer = :1, VT_Identnummer = :2, Max_Pruefindex = :3, Hydr_Pruefung= :4, ID_Benutzer= :5, Baujahr= :6 WHERE VT_Fernum = :7 and ANBID = :8", conn);
|
||||
|
||||
OracleParameter parm;
|
||||
parm = new OracleParameter("Auftragsnummer", OracleDbType.Varchar2); parm.Value = pOrder; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("VT_Identnummer", OracleDbType.Varchar2); parm.Value = "IPBATMXX"; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Max_Pruefindex", OracleDbType.Int32); parm.Value = MAX_Pruefindex; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Hydr_Pruefung", OracleDbType.Int32); parm.Value = Hydr_Pruefung; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ID_Benutzer", OracleDbType.Int32); parm.Value = 6; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Baujahr", OracleDbType.Int32); parm.Value = dbCfg.Baujahr; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("VT_Fernum", OracleDbType.Varchar2); parm.Value = pcbNr; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm);
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
OracleTransaction transaction = conn.BeginTransaction();
|
||||
try
|
||||
{
|
||||
if (!batchDataSaved)
|
||||
{
|
||||
///
|
||||
/// Batch data
|
||||
///
|
||||
DateTime start = results[0].TimeStart;
|
||||
DateTime end = results[0].TimeEnd;
|
||||
foreach (var rslt in results)
|
||||
{
|
||||
if (rslt.TimeStart < start) start = rslt.TimeStart;
|
||||
if (rslt.TimeEnd > end) end = rslt.TimeEnd;
|
||||
}
|
||||
|
||||
OracleCommand cmd = new OracleCommand("INSERT INTO VT_PRUEFREIHE_PD(" +
|
||||
"ANBID, ID_Pruefstand, ID_WzPruefreihe, ID_WZTyp, Rev_WZTyp, Rev_Pruefstand_WZTyp, " +
|
||||
"StartDatumZeit, EndDatumZeit, Betriebsart, QVzKontakt, " +
|
||||
"FuellenBegDruck, DruckEvakVorne, DruckEvakHinten, DruckBeiAbpressen, " +
|
||||
"Druckentwaessern, SpuelDurchflussIst, ProgrammVersion)" +
|
||||
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17)", conn);
|
||||
OracleParameter parm;
|
||||
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm); ///:1
|
||||
parm = new OracleParameter("ID_Pruefstand", OracleDbType.Int32); parm.Value = 18000 + dbCfg.TestBenchId; cmd.Parameters.Add(parm); ///:2
|
||||
parm = new OracleParameter("ID_WzPruefreihe", OracleDbType.Int32); parm.Value = results[0].BatchNr; cmd.Parameters.Add(parm); ///:3
|
||||
parm = new OracleParameter("ID_WZTyp", OracleDbType.Int32); parm.Value = wMtr.WMType_ID; cmd.Parameters.Add(parm); ///:4
|
||||
parm = new OracleParameter("Rev_WZTyp", OracleDbType.Int32); parm.Value = wMtr.WMType_Rev; cmd.Parameters.Add(parm); ///:5
|
||||
parm = new OracleParameter("Rev_Pruefstand_WZTyp", OracleDbType.Int32); parm.Value = 1; cmd.Parameters.Add(parm); ///:6
|
||||
parm = new OracleParameter("StartDatumZeit", OracleDbType.TimeStamp); parm.Value = start; cmd.Parameters.Add(parm); ///:7
|
||||
parm = new OracleParameter("EndDatumZeit", OracleDbType.TimeStamp); parm.Value = end; cmd.Parameters.Add(parm); ///:8
|
||||
parm = new OracleParameter("Betriebsart", OracleDbType.Varchar2); parm.Value = ""; cmd.Parameters.Add(parm); ///:9
|
||||
parm = new OracleParameter("QVzKontakt", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:10
|
||||
parm = new OracleParameter("FuellenBegDruck", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:11
|
||||
parm = new OracleParameter("DruckEvakVorne", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:12
|
||||
parm = new OracleParameter("DruckEvakHinten", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:13
|
||||
parm = new OracleParameter("DruckBeiAbpressen", OracleDbType.Double); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm); ///:14
|
||||
parm = new OracleParameter("Druckentwaessern", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:15
|
||||
parm = new OracleParameter("SpuelDurchflussIst", OracleDbType.Double); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm); ///:16
|
||||
parm = new OracleParameter("ProgrammVersion", OracleDbType.Varchar2); parm.Value = Program.Version; cmd.Parameters.Add(parm); ///:17
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
|
||||
batchDataSaved = true;
|
||||
}
|
||||
|
||||
{
|
||||
OracleCommand cmd = new OracleCommand("INSERT INTO VT_ZAEHLER_PINDEX_PD(" +
|
||||
"VT_Fernum, Pruefindex, ANBID, ID_Pruefstand, ID_WzPruefreihe, Hydr_Pruefung, " +
|
||||
"ReedKontakt, ReedKontaktOK, ReedKontaktZeit, KorrImprate, FestWertWZ, PtestOK, " +
|
||||
"Zaehlerstand, WT_Platz_NR, WZgut, ID_Benutzer, AnzahlPruefungen)" +
|
||||
" VALUES (:1, :2, :3, :4, :5, :6, 0, 0, 0, :7, 0, :8, 0, :9, :10, :11, :12)", conn);
|
||||
OracleParameter parm;
|
||||
parm = new OracleParameter("VT_Fernum", OracleDbType.Varchar2); parm.Value = pcbNr; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Pruefindex", OracleDbType.Int32); parm.Value = MAX_Pruefindex % 100; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ID_Pruefstand", OracleDbType.Int32); parm.Value = 18000 + dbCfg.TestBenchId; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ID_WzPruefreihe", OracleDbType.Int32); parm.Value = results[0].BatchNr; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("Hydr_Pruefung", OracleDbType.Int32); parm.Value = Hydr_Pruefung; cmd.Parameters.Add(parm);
|
||||
// ReedKontakt
|
||||
// ReedKontaktOK
|
||||
// ReedKontaktZeit
|
||||
parm = new OracleParameter("KorrImprate", OracleDbType.Double); parm.Value = wMtr.OriginalCalibFactor; cmd.Parameters.Add(parm);
|
||||
// FestWertWZ
|
||||
parm = new OracleParameter("PtestOK", OracleDbType.Int32); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm);
|
||||
// Zaehlerstand
|
||||
parm = new OracleParameter("WT_Platz_NR", OracleDbType.Int32); parm.Value = wmNr + 1; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("WZgut", OracleDbType.Int32); parm.Value = passed ? 1 : 0; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("ID_Benutzer", OracleDbType.Int32); parm.Value = 6; cmd.Parameters.Add(parm);
|
||||
parm = new OracleParameter("AnzahlPruefungen", OracleDbType.Int32); parm.Value = 3; cmd.Parameters.Add(parm);
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
for (int q = 1; q <= 3; q++)
|
||||
{
|
||||
string testName = string.Format("Q{0}", q);
|
||||
double Q_wm = 0;
|
||||
double Err_wm = 0;
|
||||
double testTime = 0;
|
||||
bool wm_Passed = true;
|
||||
///
|
||||
foreach (var rslt in results)
|
||||
{
|
||||
if (rslt.TestName.Equals(testName))
|
||||
{
|
||||
testTime = rslt.Meters[wmNr].Time;
|
||||
if (testTime > 1E-10) Q_wm = 3600.0 * rslt.Meters[wmNr].VolumeMeter / testTime;
|
||||
Err_wm = rslt.Meters[wmNr].VolumeErrorPct;
|
||||
wm_Passed = rslt.Meters[wmNr].Passed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int qq = (q == 0) ? -1 : ((q == 3 && dbCfg.DBUsed == DBUsed.Test) ? 5 : q);
|
||||
|
||||
OracleCommand cmd = new OracleCommand("INSERT INTO VT_PRUEFREIHE_IST_PD(" +
|
||||
"VT_Fernum, Pruefindex, PruefungsNr, ANBID, ID_WZTyp, Rev_WZTyp, Rev_WZPruefpunkt, " +
|
||||
"Q_WZ, Q_Fehler, Q_Best, NIZ, AnfangZStand, EndZStand, " +
|
||||
"KorrErrQok, KorrErrQ, KorrQWz, TIZ, Vol_WZ_US, TempMittel_US)" +
|
||||
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, 0, 0, 0, :14, 0, 0)", conn);
|
||||
OracleParameter parm;
|
||||
parm = new OracleParameter("VT_Fernum", OracleDbType.Varchar2); parm.Value = pcbNr; cmd.Parameters.Add(parm); ///:1
|
||||
parm = new OracleParameter("Pruefindex", OracleDbType.Int32); parm.Value = MAX_Pruefindex % 100; cmd.Parameters.Add(parm); ///:2
|
||||
parm = new OracleParameter("PruefungsNr", OracleDbType.Int32); parm.Value = qq; cmd.Parameters.Add(parm); ///:3
|
||||
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm); ///:4
|
||||
parm = new OracleParameter("ID_WZTyp", OracleDbType.Int32); parm.Value = wMtr.WMType_ID; cmd.Parameters.Add(parm); ///:5
|
||||
parm = new OracleParameter("Rev_WZTyp", OracleDbType.Int32); parm.Value = wMtr.WMType_Rev; cmd.Parameters.Add(parm); ///:6
|
||||
parm = new OracleParameter("Rev_WZPruefpunkt", OracleDbType.Int32); parm.Value = 1; cmd.Parameters.Add(parm); ///:7
|
||||
parm = new OracleParameter("Q_WZ", OracleDbType.Double); parm.Value = Q_wm; cmd.Parameters.Add(parm); ///:8
|
||||
parm = new OracleParameter("Q_Fehler", OracleDbType.Double); parm.Value = Err_wm; cmd.Parameters.Add(parm); ///:9
|
||||
parm = new OracleParameter("Q_Best", OracleDbType.Int32); parm.Value = wm_Passed ? 1 : 0; cmd.Parameters.Add(parm); ///:10
|
||||
parm = new OracleParameter("NIZ", OracleDbType.Int32); parm.Value = 0; cmd.Parameters.Add(parm); ///:11
|
||||
parm = new OracleParameter("AnfangZStand", OracleDbType.Double); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm); ///:12
|
||||
parm = new OracleParameter("EndZStand", OracleDbType.Double); parm.Value = 0;/*TODO*/ cmd.Parameters.Add(parm); ///:13
|
||||
/// KorrErrQok
|
||||
/// KorrErrQ
|
||||
/// KorrQWz
|
||||
parm = new OracleParameter("TIZ", OracleDbType.Double); parm.Value = testTime; cmd.Parameters.Add(parm);
|
||||
/// Vol_WZ_US
|
||||
/// TempMittel_US
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
{
|
||||
int Q2CorrFlowRight;
|
||||
if (wMtr.CalibrationStruct.FlowArrow == WaterMeters.iPerl.FlowArrow.Left)
|
||||
{
|
||||
Q2CorrFlowRight = wMtr.PositiveCounting ? 1 : 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
Q2CorrFlowRight = wMtr.PositiveCounting ? 2 : 1;
|
||||
}
|
||||
|
||||
OracleCommand cmd = new OracleCommand("INSERT INTO VT_IP_ZAEHLER_PINDEX_PD(" +
|
||||
"VT_Fernum, Pruefindex, ANBID, WITHCORRECTION2HZ, CORRECTION2HZ, DIFF2HZ8HZ, " +
|
||||
"WITHQ2CORRECTION, ERRQ2, Q2CORRECTIONFLOWRIGHT, Q2CORRECTIONLEFT, Q2CORRECTIONRIGHT)" +
|
||||
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11)", conn);
|
||||
OracleParameter parm;
|
||||
parm = new OracleParameter("VT_Fernum", OracleDbType.Varchar2); parm.Value = pcbNr; cmd.Parameters.Add(parm); ///:1
|
||||
parm = new OracleParameter("Pruefindex", OracleDbType.Int32); parm.Value = MAX_Pruefindex % 100; cmd.Parameters.Add(parm); ///:2
|
||||
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd.Parameters.Add(parm); ///:3
|
||||
parm = new OracleParameter("WITHCORRECTION2HZ", OracleDbType.Int32); parm.Value = 0; cmd.Parameters.Add(parm); ///:4
|
||||
parm = new OracleParameter("CORRECTION2HZ", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:5
|
||||
parm = new OracleParameter("DIFF2HZ8HZ", OracleDbType.Double); parm.Value = 0; cmd.Parameters.Add(parm); ///:6
|
||||
parm = new OracleParameter("WITHQ2CORRECTION", OracleDbType.Int32); parm.Value = wMtr.Q2CorrectionDone ? 1 : 0; cmd.Parameters.Add(parm); ///:7
|
||||
parm = new OracleParameter("ERRQ2", OracleDbType.Double); parm.Value = wMtr.Q2ErrorWOCorrection; cmd.Parameters.Add(parm); ///:8
|
||||
parm = new OracleParameter("Q2CORRECTIONFLOWRIGHT", OracleDbType.Int32); parm.Value = Q2CorrFlowRight;/*1=right to left*/ cmd.Parameters.Add(parm); ///:9
|
||||
parm = new OracleParameter("Q2CORRECTIONLEFT", OracleDbType.Int32); parm.Value = (int)Math.Round(wMtr.CurrentQ2Correction); cmd.Parameters.Add(parm); ///:10
|
||||
parm = new OracleParameter("Q2CORRECTIONRIGHT", OracleDbType.Int32); parm.Value = (int)Math.Round(wMtr.CurrentQ2Correction / 2); cmd.Parameters.Add(parm); ///:11
|
||||
|
||||
int rowsUpdated = cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Exception in SaveSingleWM2DB(), data not saved!, pcbNr={0}, msg={1}", pcbNr, exc.Message);
|
||||
transaction.Rollback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Write one water meter results into a file
|
||||
/// </summary>
|
||||
/// <param name="wmNr">Water meter number (0-based)</param>
|
||||
void WriteSingleWM(int wmNr, int printedWMNr, IList<Entities.TestResult> results)
|
||||
{
|
||||
/// Determine column widths
|
||||
int[] columnWidths = new int[resultItems.Count];
|
||||
int totalWidth = 0;
|
||||
for (int i = 0; i < resultItems.Count; i++)
|
||||
{
|
||||
columnWidths[i] = ElSpaces(resultItems[i].ClmnHeaderText).Length;
|
||||
foreach (var tr in results)
|
||||
{
|
||||
if (tr != null)
|
||||
{
|
||||
string text = resultItems[i].Print(tr.Meters[wmNr]);
|
||||
|
||||
/// Get rid of the color information
|
||||
string[] texts = text.Split(new char[] { '|' });
|
||||
if (texts.Length == 2) { text = texts[0]; }
|
||||
|
||||
int len = ElSpaces(text).Length;
|
||||
if (len > columnWidths[i]) columnWidths[i] = len;
|
||||
}
|
||||
}
|
||||
totalWidth += columnWidths[i];
|
||||
}
|
||||
totalWidth += 3 * (resultItems.Count - 1);
|
||||
|
||||
|
||||
/// Write water meter number and s/n
|
||||
writer.Write(string.Format("Water meter {0}", printedWMNr));
|
||||
if (!string.IsNullOrEmpty(unsortedResults[0].Meters[wmNr].SerialNr))
|
||||
{
|
||||
writer.Write(string.Format(" s/n: {0}", unsortedResults[0].Meters[wmNr].SerialNr));
|
||||
}
|
||||
writer.WriteLine(string.Empty);
|
||||
|
||||
|
||||
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line above the header
|
||||
|
||||
|
||||
/// Write column headers
|
||||
for (int i = 0; i < resultItems.Count; i++)
|
||||
{
|
||||
writer.Write(ElSpaces(resultItems[i].ClmnHeaderText));
|
||||
|
||||
if (i < resultItems.Count - 1)
|
||||
{
|
||||
if (!dbCfg.EliminateSpaces)
|
||||
{
|
||||
writer.Write(new string(' ', columnWidths[i] - resultItems[i].ClmnHeaderText.Length + 3));
|
||||
}
|
||||
writer.Write(separatorStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line between the header and the body
|
||||
|
||||
|
||||
/// Write table data
|
||||
foreach (var tr in results)
|
||||
{
|
||||
if (tr != null)
|
||||
{
|
||||
for (int i = 0; i < resultItems.Count; i++)
|
||||
{
|
||||
string text = resultItems[i].Print(tr.Meters[wmNr]);
|
||||
|
||||
/// Get rid of the color information
|
||||
string[] texts = text.Split(new char[] { '|' });
|
||||
if (texts.Length == 2) { text = texts[0]; }
|
||||
|
||||
writer.Write(ElSpaces(text));
|
||||
|
||||
if (i < resultItems.Count - 1)
|
||||
{
|
||||
if (!dbCfg.EliminateSpaces)
|
||||
{
|
||||
writer.Write(new string(' ', columnWidths[i] - text.Length + 3));
|
||||
}
|
||||
writer.Write(separatorStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line below the body
|
||||
|
||||
writer.WriteLine(string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write one combined water meter results
|
||||
/// </summary>
|
||||
/// <param name="wmNr1">Combined water meter number (1-based)</param>
|
||||
void WriteCombinedWM(int wmNr1)
|
||||
{
|
||||
IList<Entities.TestResult> results = Utils.GetSortedTestResults(procedure, unsortedResults, Utils.PartNr(wmNr1, combined));
|
||||
|
||||
/// Determin column widths
|
||||
int[] columnWidths = new int[resultItems.Count];
|
||||
int totalWidth = 0;
|
||||
for (int i = 0; i < resultItems.Count; i++)
|
||||
{
|
||||
columnWidths[i] = ElSpaces(resultItems[i].ClmnHeaderText).Length;
|
||||
foreach (var tr in results)
|
||||
{
|
||||
if (tr != null)
|
||||
{
|
||||
string text = resultItems[i].PrintCombined(tr.Meters[2 * wmNr1 - 2], tr.Meters[2 * wmNr1 - 1], tr.CombinedMeters[wmNr1 - 1]);
|
||||
int len = ElSpaces(text).Length;
|
||||
if (len > columnWidths[i]) columnWidths[i] = len;
|
||||
}
|
||||
}
|
||||
totalWidth += columnWidths[i];
|
||||
}
|
||||
totalWidth += 3 * (resultItems.Count - 1);
|
||||
|
||||
|
||||
/// Write water meter number and two s/n-s
|
||||
writer.Write(string.Format("Water meter {0}", wmNr1));
|
||||
if (!string.IsNullOrEmpty(unsortedResults[0].Meters[2 * wmNr1 - 2].SerialNr))
|
||||
{
|
||||
writer.Write(string.Format(", Main s/n: {0}", unsortedResults[0].Meters[2 * wmNr1 - 2].SerialNr));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unsortedResults[0].Meters[2 * wmNr1 - 1].SerialNr))
|
||||
{
|
||||
writer.Write(string.Format(", Aux. s/n:{0}", unsortedResults[0].Meters[2 * wmNr1 - 1].SerialNr));
|
||||
}
|
||||
writer.WriteLine(string.Empty);
|
||||
|
||||
|
||||
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line above the header
|
||||
|
||||
|
||||
for (int i = 0; i < resultItems.Count; i++)
|
||||
{
|
||||
writer.Write(ElSpaces(resultItems[i].ClmnHeaderText));
|
||||
|
||||
if (i < resultItems.Count - 1)
|
||||
{
|
||||
if (!dbCfg.EliminateSpaces)
|
||||
{
|
||||
writer.Write(new string(' ', columnWidths[i] - resultItems[i].ClmnHeaderText.Length + 3));
|
||||
}
|
||||
writer.Write(separatorStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line between the header and the body
|
||||
|
||||
|
||||
foreach (var tr in results)
|
||||
{
|
||||
if (tr != null)
|
||||
{
|
||||
for (int i = 0; i < resultItems.Count; i++)
|
||||
{
|
||||
string text = resultItems[i].PrintCombined(tr.Meters[2 * wmNr1 - 2], tr.Meters[2 * wmNr1 - 1], tr.CombinedMeters[wmNr1 - 1]);
|
||||
|
||||
/// Get rid of the color information
|
||||
string[] texts = text.Split(new char[] { '|' });
|
||||
if (texts.Length == 2) { text = texts[0]; }
|
||||
|
||||
writer.Write(ElSpaces(text));
|
||||
|
||||
if (i < resultItems.Count - 1)
|
||||
{
|
||||
if (!dbCfg.EliminateSpaces)
|
||||
{
|
||||
writer.Write(new string(' ', columnWidths[i] - text.Length + 3));
|
||||
}
|
||||
writer.Write(separatorStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line below the body
|
||||
|
||||
writer.WriteLine(string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsWritten</returns>
|
||||
public Event Run()
|
||||
{
|
||||
return Event.ResultsWritten;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DB.SensusOracle
|
||||
{
|
||||
public enum DBUsed
|
||||
{
|
||||
Production,
|
||||
Test,
|
||||
Quality,
|
||||
Count
|
||||
}
|
||||
|
||||
public enum Separator
|
||||
{
|
||||
None,
|
||||
Space,
|
||||
Tabulator,
|
||||
Comma,
|
||||
Semicolon,
|
||||
Count
|
||||
}
|
||||
|
||||
public class DatabaseCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public IComponent GetComponent(IList<IComponent> components) { return new Database(this); }
|
||||
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
|
||||
|
||||
|
||||
public int TestBenchId;
|
||||
public DBUsed DBUsed;
|
||||
public int Baujahr; /// Written to the database
|
||||
public string DestinationPath; /// Directory path into which the results will be saved
|
||||
public bool YearFolders;
|
||||
public bool MonthFolders;
|
||||
public bool DayFolders;
|
||||
public Separator Separator;
|
||||
public bool EliminateSpaces;
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
DatabaseCfg()
|
||||
{
|
||||
Name = "Sensus-Oracle-DB";
|
||||
ParentName = string.Empty;
|
||||
TestBenchId = 1;
|
||||
DBUsed = DBUsed.Test;
|
||||
Baujahr = 2015;
|
||||
DestinationPath = Program.HomeDir + "Results\\";
|
||||
YearFolders = true;
|
||||
MonthFolders = true;
|
||||
DayFolders = false;
|
||||
Separator = Separator.None;
|
||||
EliminateSpaces = false;
|
||||
}
|
||||
|
||||
public DatabaseCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, BenchId={1}, DBUsed={2}, Baujahr={3}, Path={4}, Y={5}, M={6}, D={7}, Elim.Spaces={8}, Separator={9}",
|
||||
Name,
|
||||
TestBenchId,
|
||||
DBUsed,
|
||||
Baujahr,
|
||||
DestinationPath,
|
||||
YearFolders,
|
||||
MonthFolders,
|
||||
DayFolders,
|
||||
EliminateSpaces,
|
||||
Separator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DB.SensusOracle
|
||||
{
|
||||
public partial class DatabaseCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(DatabaseCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
DatabaseCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as DatabaseCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public DatabaseCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void WriterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < (int)DBUsed.Count; i++)
|
||||
{
|
||||
dbUsedComboBox.Items.Add(((DBUsed)i).ToString());
|
||||
}
|
||||
for (int i = 0; i < (int)Separator.Count; i++)
|
||||
{
|
||||
separatorComboBox.Items.Add(((Separator)i).ToString());
|
||||
}
|
||||
Redraw();
|
||||
}
|
||||
|
||||
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;
|
||||
benchIdTextBox.Text = config.TestBenchId.ToString();
|
||||
dbUsedComboBox.Text = config.DBUsed.ToString();
|
||||
baujahrTextBox.Text = config.Baujahr.ToString();
|
||||
destinationTextBox.Text = config.DestinationPath;
|
||||
yearFoldersCheckBox.Checked = config.YearFolders;
|
||||
monthFoldersCheckBox.Checked = config.MonthFolders;
|
||||
dayFoldersCheckBox.Checked = config.DayFolders;
|
||||
separatorComboBox.Text = config.Separator.ToString();
|
||||
eliminateSpacesCheckBox.Checked = config.EliminateSpaces;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
benchIdTextBox.Enabled = true;
|
||||
dbUsedComboBox.Enabled = true;
|
||||
baujahrTextBox.Enabled = true;
|
||||
destinationTextBox.Enabled = true;
|
||||
destinationButton.Enabled = true;
|
||||
yearFoldersCheckBox.Enabled = true;
|
||||
monthFoldersCheckBox.Enabled = true;
|
||||
dayFoldersCheckBox.Enabled = true;
|
||||
separatorComboBox.Enabled = true;
|
||||
eliminateSpacesCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
int tmp;
|
||||
if (!int.TryParse(benchIdTextBox.Text, out tmp) || tmp <= 0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Test bench ID'";
|
||||
}
|
||||
|
||||
if (!int.TryParse(baujahrTextBox.Text, out tmp) || tmp < 2015 || tmp > 2099)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Bujahr'";
|
||||
}
|
||||
|
||||
if (!dbUsedComboBox.Items.Contains(dbUsedComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Database used' item";
|
||||
}
|
||||
|
||||
if (!separatorComboBox.Items.Contains(separatorComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid separator";
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None; /// <------------------- !!!
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
int benchId = int.Parse(benchIdTextBox.Text);
|
||||
if (config.TestBenchId != benchId)
|
||||
{
|
||||
config.TestBenchId = benchId;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
int baujahr = int.Parse(baujahrTextBox.Text);
|
||||
if (config.Baujahr != baujahr)
|
||||
{
|
||||
config.Baujahr = baujahr;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)DBUsed.Count; i++)
|
||||
{
|
||||
if (((DBUsed)i).ToString().Equals(dbUsedComboBox.Text) && (config.DBUsed != (DBUsed)i))
|
||||
{
|
||||
config.DBUsed = (DBUsed)i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (config.DestinationPath != destinationTextBox.Text)
|
||||
{
|
||||
config.DestinationPath = destinationTextBox.Text;
|
||||
if (!config.DestinationPath.EndsWith("\\")) config.DestinationPath += "\\";
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
if (yearFoldersCheckBox.Checked != config.YearFolders)
|
||||
{
|
||||
config.YearFolders = yearFoldersCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
if (monthFoldersCheckBox.Checked != config.MonthFolders)
|
||||
{
|
||||
config.MonthFolders = monthFoldersCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
if (dayFoldersCheckBox.Checked != config.DayFolders)
|
||||
{
|
||||
config.DayFolders = dayFoldersCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)Separator.Count; i++)
|
||||
{
|
||||
if (((Separator)i).ToString().Equals(separatorComboBox.Text) && (config.Separator != (Separator)i))
|
||||
{
|
||||
config.Separator = (Separator)i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eliminateSpacesCheckBox.Checked != config.EliminateSpaces)
|
||||
{
|
||||
config.EliminateSpaces = eliminateSpacesCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
namespace TBF.BenchControl.DB.SensusOracle
|
||||
{
|
||||
partial class DatabaseCfgCtrl
|
||||
{
|
||||
/// <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.destinationTextBox = new System.Windows.Forms.TextBox();
|
||||
this.destinationLabel = new System.Windows.Forms.Label();
|
||||
this.dayFoldersCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.destinationButton = new System.Windows.Forms.Button();
|
||||
this.yearFoldersCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.monthFoldersCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.separatorLabel = new System.Windows.Forms.Label();
|
||||
this.separatorComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.benchIdTextBox = new System.Windows.Forms.TextBox();
|
||||
this.benchIdLabel = new System.Windows.Forms.Label();
|
||||
this.dbUsedComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.dbUsedLabel = new System.Windows.Forms.Label();
|
||||
this.baujahrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.baujahrLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(110, 33);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(19, 36);
|
||||
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(107, 8);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// destinationTextBox
|
||||
//
|
||||
this.destinationTextBox.Enabled = false;
|
||||
this.destinationTextBox.Location = new System.Drawing.Point(110, 131);
|
||||
this.destinationTextBox.Name = "destinationTextBox";
|
||||
this.destinationTextBox.Size = new System.Drawing.Size(145, 20);
|
||||
this.destinationTextBox.TabIndex = 10;
|
||||
//
|
||||
// destinationLabel
|
||||
//
|
||||
this.destinationLabel.AutoSize = true;
|
||||
this.destinationLabel.Location = new System.Drawing.Point(19, 134);
|
||||
this.destinationLabel.Name = "destinationLabel";
|
||||
this.destinationLabel.Size = new System.Drawing.Size(60, 13);
|
||||
this.destinationLabel.TabIndex = 9;
|
||||
this.destinationLabel.Text = "Destination";
|
||||
//
|
||||
// dayFoldersCheckBox
|
||||
//
|
||||
this.dayFoldersCheckBox.AutoSize = true;
|
||||
this.dayFoldersCheckBox.Enabled = false;
|
||||
this.dayFoldersCheckBox.Location = new System.Drawing.Point(207, 157);
|
||||
this.dayFoldersCheckBox.Name = "dayFoldersCheckBox";
|
||||
this.dayFoldersCheckBox.Size = new System.Drawing.Size(79, 17);
|
||||
this.dayFoldersCheckBox.TabIndex = 14;
|
||||
this.dayFoldersCheckBox.Text = "Day folders";
|
||||
this.dayFoldersCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// destinationButton
|
||||
//
|
||||
this.destinationButton.Enabled = false;
|
||||
this.destinationButton.Location = new System.Drawing.Point(261, 131);
|
||||
this.destinationButton.Name = "destinationButton";
|
||||
this.destinationButton.Size = new System.Drawing.Size(30, 20);
|
||||
this.destinationButton.TabIndex = 11;
|
||||
this.destinationButton.Text = "...";
|
||||
this.destinationButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// yearFoldersCheckBox
|
||||
//
|
||||
this.yearFoldersCheckBox.AutoSize = true;
|
||||
this.yearFoldersCheckBox.Enabled = false;
|
||||
this.yearFoldersCheckBox.Location = new System.Drawing.Point(23, 157);
|
||||
this.yearFoldersCheckBox.Name = "yearFoldersCheckBox";
|
||||
this.yearFoldersCheckBox.Size = new System.Drawing.Size(82, 17);
|
||||
this.yearFoldersCheckBox.TabIndex = 12;
|
||||
this.yearFoldersCheckBox.Text = "Year folders";
|
||||
this.yearFoldersCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// monthFoldersCheckBox
|
||||
//
|
||||
this.monthFoldersCheckBox.AutoSize = true;
|
||||
this.monthFoldersCheckBox.Enabled = false;
|
||||
this.monthFoldersCheckBox.Location = new System.Drawing.Point(111, 157);
|
||||
this.monthFoldersCheckBox.Name = "monthFoldersCheckBox";
|
||||
this.monthFoldersCheckBox.Size = new System.Drawing.Size(90, 17);
|
||||
this.monthFoldersCheckBox.TabIndex = 13;
|
||||
this.monthFoldersCheckBox.Text = "Month folders";
|
||||
this.monthFoldersCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// eliminateSpacesCheckBox
|
||||
//
|
||||
this.eliminateSpacesCheckBox.AutoSize = true;
|
||||
this.eliminateSpacesCheckBox.Enabled = false;
|
||||
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(111, 205);
|
||||
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
|
||||
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(165, 17);
|
||||
this.eliminateSpacesCheckBox.TabIndex = 17;
|
||||
this.eliminateSpacesCheckBox.Text = "Eliminate spaces in each field";
|
||||
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// separatorLabel
|
||||
//
|
||||
this.separatorLabel.AutoSize = true;
|
||||
this.separatorLabel.Location = new System.Drawing.Point(19, 182);
|
||||
this.separatorLabel.Name = "separatorLabel";
|
||||
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
|
||||
this.separatorLabel.TabIndex = 15;
|
||||
this.separatorLabel.Text = "Separator";
|
||||
//
|
||||
// separatorComboBox
|
||||
//
|
||||
this.separatorComboBox.Enabled = false;
|
||||
this.separatorComboBox.FormattingEnabled = true;
|
||||
this.separatorComboBox.Location = new System.Drawing.Point(110, 179);
|
||||
this.separatorComboBox.Name = "separatorComboBox";
|
||||
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
|
||||
this.separatorComboBox.TabIndex = 16;
|
||||
//
|
||||
// benchIdTextBox
|
||||
//
|
||||
this.benchIdTextBox.Enabled = false;
|
||||
this.benchIdTextBox.Location = new System.Drawing.Point(110, 57);
|
||||
this.benchIdTextBox.Name = "benchIdTextBox";
|
||||
this.benchIdTextBox.Size = new System.Drawing.Size(57, 20);
|
||||
this.benchIdTextBox.TabIndex = 4;
|
||||
//
|
||||
// benchIdLabel
|
||||
//
|
||||
this.benchIdLabel.AutoSize = true;
|
||||
this.benchIdLabel.Location = new System.Drawing.Point(19, 60);
|
||||
this.benchIdLabel.Name = "benchIdLabel";
|
||||
this.benchIdLabel.Size = new System.Drawing.Size(76, 13);
|
||||
this.benchIdLabel.TabIndex = 3;
|
||||
this.benchIdLabel.Text = "Test Bench ID";
|
||||
//
|
||||
// dbUsedComboBox
|
||||
//
|
||||
this.dbUsedComboBox.Enabled = false;
|
||||
this.dbUsedComboBox.FormattingEnabled = true;
|
||||
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 81);
|
||||
this.dbUsedComboBox.Name = "dbUsedComboBox";
|
||||
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
|
||||
this.dbUsedComboBox.TabIndex = 6;
|
||||
//
|
||||
// dbUsedLabel
|
||||
//
|
||||
this.dbUsedLabel.AutoSize = true;
|
||||
this.dbUsedLabel.Location = new System.Drawing.Point(19, 84);
|
||||
this.dbUsedLabel.Name = "dbUsedLabel";
|
||||
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
|
||||
this.dbUsedLabel.TabIndex = 5;
|
||||
this.dbUsedLabel.Text = "Database used";
|
||||
//
|
||||
// baujahrTextBox
|
||||
//
|
||||
this.baujahrTextBox.Enabled = false;
|
||||
this.baujahrTextBox.Location = new System.Drawing.Point(110, 106);
|
||||
this.baujahrTextBox.Name = "baujahrTextBox";
|
||||
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
|
||||
this.baujahrTextBox.TabIndex = 8;
|
||||
//
|
||||
// baujahrLabel
|
||||
//
|
||||
this.baujahrLabel.AutoSize = true;
|
||||
this.baujahrLabel.Location = new System.Drawing.Point(19, 109);
|
||||
this.baujahrLabel.Name = "baujahrLabel";
|
||||
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
|
||||
this.baujahrLabel.TabIndex = 7;
|
||||
this.baujahrLabel.Text = "Baujahr";
|
||||
//
|
||||
// DatabaseCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.baujahrTextBox);
|
||||
this.Controls.Add(this.baujahrLabel);
|
||||
this.Controls.Add(this.dbUsedComboBox);
|
||||
this.Controls.Add(this.dbUsedLabel);
|
||||
this.Controls.Add(this.benchIdTextBox);
|
||||
this.Controls.Add(this.benchIdLabel);
|
||||
this.Controls.Add(this.separatorComboBox);
|
||||
this.Controls.Add(this.separatorLabel);
|
||||
this.Controls.Add(this.eliminateSpacesCheckBox);
|
||||
this.Controls.Add(this.monthFoldersCheckBox);
|
||||
this.Controls.Add(this.yearFoldersCheckBox);
|
||||
this.Controls.Add(this.destinationButton);
|
||||
this.Controls.Add(this.dayFoldersCheckBox);
|
||||
this.Controls.Add(this.destinationTextBox);
|
||||
this.Controls.Add(this.destinationLabel);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "DatabaseCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 230);
|
||||
this.Load += new System.EventHandler(this.WriterCfgCtrl_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.TextBox destinationTextBox;
|
||||
private System.Windows.Forms.Label destinationLabel;
|
||||
private System.Windows.Forms.CheckBox dayFoldersCheckBox;
|
||||
private System.Windows.Forms.Button destinationButton;
|
||||
private System.Windows.Forms.CheckBox yearFoldersCheckBox;
|
||||
private System.Windows.Forms.CheckBox monthFoldersCheckBox;
|
||||
private System.Windows.Forms.CheckBox eliminateSpacesCheckBox;
|
||||
private System.Windows.Forms.Label separatorLabel;
|
||||
private System.Windows.Forms.ComboBox separatorComboBox;
|
||||
private System.Windows.Forms.TextBox benchIdTextBox;
|
||||
private System.Windows.Forms.Label benchIdLabel;
|
||||
private System.Windows.Forms.ComboBox dbUsedComboBox;
|
||||
private System.Windows.Forms.Label dbUsedLabel;
|
||||
private System.Windows.Forms.TextBox baujahrTextBox;
|
||||
private System.Windows.Forms.Label baujahrLabel;
|
||||
}
|
||||
}
|
||||
-6
@@ -117,10 +117,4 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnCancel.Text" xml:space="preserve">
|
||||
<value>&Abbrechen</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Ein unbehandelter Fehler ist aufgetreten!</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,24 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DB.SensusOracle
|
||||
{
|
||||
public class DatabaseFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "Sensus-Oracle-Database"; } }
|
||||
|
||||
public void ResetStaticProperties() { Database.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Database(); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new DatabaseCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(DatabaseCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
+197
-197
@@ -31,203 +31,203 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.auxSN1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.auxSN1Label = new System.Windows.Forms.Label();
|
||||
this.mainSN1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.mainSN1Label = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.auxSN2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.auxSN2Label = new System.Windows.Forms.Label();
|
||||
this.mainSN2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.mainSN2Label = new System.Windows.Forms.Label();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.auxSN3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.auxSN3Label = new System.Windows.Forms.Label();
|
||||
this.mainSN3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.mainSN3Label = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(527, 43);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 0;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.auxSN1TextBox);
|
||||
this.groupBox1.Controls.Add(this.auxSN1Label);
|
||||
this.groupBox1.Controls.Add(this.mainSN1TextBox);
|
||||
this.groupBox1.Controls.Add(this.mainSN1Label);
|
||||
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox1.Location = new System.Drawing.Point(28, 18);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(464, 137);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Water Meter 1";
|
||||
//
|
||||
// auxSN1TextBox
|
||||
//
|
||||
this.auxSN1TextBox.Location = new System.Drawing.Point(262, 83);
|
||||
this.auxSN1TextBox.Name = "auxSN1TextBox";
|
||||
this.auxSN1TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.auxSN1TextBox.TabIndex = 3;
|
||||
//
|
||||
// auxSN1Label
|
||||
//
|
||||
this.auxSN1Label.AutoSize = true;
|
||||
this.auxSN1Label.Location = new System.Drawing.Point(21, 86);
|
||||
this.auxSN1Label.Name = "auxSN1Label";
|
||||
this.auxSN1Label.Size = new System.Drawing.Size(193, 23);
|
||||
this.auxSN1Label.TabIndex = 2;
|
||||
this.auxSN1Label.Text = "Aux. WM Serial Nr.";
|
||||
//
|
||||
// mainSN1TextBox
|
||||
//
|
||||
this.mainSN1TextBox.Location = new System.Drawing.Point(262, 37);
|
||||
this.mainSN1TextBox.Name = "mainSN1TextBox";
|
||||
this.mainSN1TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.mainSN1TextBox.TabIndex = 1;
|
||||
//
|
||||
// mainSN1Label
|
||||
//
|
||||
this.mainSN1Label.AutoSize = true;
|
||||
this.mainSN1Label.Location = new System.Drawing.Point(21, 40);
|
||||
this.mainSN1Label.Name = "mainSN1Label";
|
||||
this.mainSN1Label.Size = new System.Drawing.Size(195, 23);
|
||||
this.mainSN1Label.TabIndex = 0;
|
||||
this.mainSN1Label.Text = "Main WM Serial Nr.";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.auxSN2TextBox);
|
||||
this.groupBox2.Controls.Add(this.auxSN2Label);
|
||||
this.groupBox2.Controls.Add(this.mainSN2TextBox);
|
||||
this.groupBox2.Controls.Add(this.mainSN2Label);
|
||||
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox2.Location = new System.Drawing.Point(28, 175);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(464, 137);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Water Meter 2";
|
||||
//
|
||||
// auxSN2TextBox
|
||||
//
|
||||
this.auxSN2TextBox.Location = new System.Drawing.Point(262, 83);
|
||||
this.auxSN2TextBox.Name = "auxSN2TextBox";
|
||||
this.auxSN2TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.auxSN2TextBox.TabIndex = 3;
|
||||
//
|
||||
// auxSN2Label
|
||||
//
|
||||
this.auxSN2Label.AutoSize = true;
|
||||
this.auxSN2Label.Location = new System.Drawing.Point(21, 86);
|
||||
this.auxSN2Label.Name = "auxSN2Label";
|
||||
this.auxSN2Label.Size = new System.Drawing.Size(193, 23);
|
||||
this.auxSN2Label.TabIndex = 2;
|
||||
this.auxSN2Label.Text = "Aux. WM Serial Nr.";
|
||||
//
|
||||
// mainSN2TextBox
|
||||
//
|
||||
this.mainSN2TextBox.Location = new System.Drawing.Point(262, 37);
|
||||
this.mainSN2TextBox.Name = "mainSN2TextBox";
|
||||
this.mainSN2TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.mainSN2TextBox.TabIndex = 1;
|
||||
//
|
||||
// mainSN2Label
|
||||
//
|
||||
this.mainSN2Label.AutoSize = true;
|
||||
this.mainSN2Label.Location = new System.Drawing.Point(21, 40);
|
||||
this.mainSN2Label.Name = "mainSN2Label";
|
||||
this.mainSN2Label.Size = new System.Drawing.Size(195, 23);
|
||||
this.mainSN2Label.TabIndex = 0;
|
||||
this.mainSN2Label.Text = "Main WM Serial Nr.";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.auxSN3TextBox);
|
||||
this.groupBox3.Controls.Add(this.auxSN3Label);
|
||||
this.groupBox3.Controls.Add(this.mainSN3TextBox);
|
||||
this.groupBox3.Controls.Add(this.mainSN3Label);
|
||||
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox3.Location = new System.Drawing.Point(28, 330);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(464, 137);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Water Meter 3";
|
||||
//
|
||||
// auxSN3TextBox
|
||||
//
|
||||
this.auxSN3TextBox.Location = new System.Drawing.Point(262, 83);
|
||||
this.auxSN3TextBox.Name = "auxSN3TextBox";
|
||||
this.auxSN3TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.auxSN3TextBox.TabIndex = 3;
|
||||
//
|
||||
// auxSN3Label
|
||||
//
|
||||
this.auxSN3Label.AutoSize = true;
|
||||
this.auxSN3Label.Location = new System.Drawing.Point(21, 86);
|
||||
this.auxSN3Label.Name = "auxSN3Label";
|
||||
this.auxSN3Label.Size = new System.Drawing.Size(193, 23);
|
||||
this.auxSN3Label.TabIndex = 2;
|
||||
this.auxSN3Label.Text = "Aux. WM Serial Nr.";
|
||||
//
|
||||
// mainSN3TextBox
|
||||
//
|
||||
this.mainSN3TextBox.Location = new System.Drawing.Point(262, 37);
|
||||
this.mainSN3TextBox.Name = "mainSN3TextBox";
|
||||
this.mainSN3TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.mainSN3TextBox.TabIndex = 1;
|
||||
//
|
||||
// mainSN3Label
|
||||
//
|
||||
this.mainSN3Label.AutoSize = true;
|
||||
this.mainSN3Label.Location = new System.Drawing.Point(21, 40);
|
||||
this.mainSN3Label.Name = "mainSN3Label";
|
||||
this.mainSN3Label.Size = new System.Drawing.Size(195, 23);
|
||||
this.mainSN3Label.TabIndex = 0;
|
||||
this.mainSN3Label.Text = "Main WM Serial Nr.";
|
||||
//
|
||||
// CycleBeginningForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(653, 492);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleBeginningForm";
|
||||
this.Text = "Daten";
|
||||
this.TopMost = true;
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.auxSN1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.auxSN1Label = new System.Windows.Forms.Label();
|
||||
this.mainSN1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.mainSN1Label = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.auxSN2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.auxSN2Label = new System.Windows.Forms.Label();
|
||||
this.mainSN2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.mainSN2Label = new System.Windows.Forms.Label();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.auxSN3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.auxSN3Label = new System.Windows.Forms.Label();
|
||||
this.mainSN3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.mainSN3Label = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(557, 43);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 0;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.auxSN1TextBox);
|
||||
this.groupBox1.Controls.Add(this.auxSN1Label);
|
||||
this.groupBox1.Controls.Add(this.mainSN1TextBox);
|
||||
this.groupBox1.Controls.Add(this.mainSN1Label);
|
||||
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox1.Location = new System.Drawing.Point(28, 18);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(494, 137);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Water Meter 1";
|
||||
//
|
||||
// auxSN1TextBox
|
||||
//
|
||||
this.auxSN1TextBox.Location = new System.Drawing.Point(300, 83);
|
||||
this.auxSN1TextBox.Name = "auxSN1TextBox";
|
||||
this.auxSN1TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.auxSN1TextBox.TabIndex = 3;
|
||||
//
|
||||
// auxSN1Label
|
||||
//
|
||||
this.auxSN1Label.AutoSize = true;
|
||||
this.auxSN1Label.Location = new System.Drawing.Point(21, 86);
|
||||
this.auxSN1Label.Name = "auxSN1Label";
|
||||
this.auxSN1Label.Size = new System.Drawing.Size(193, 23);
|
||||
this.auxSN1Label.TabIndex = 2;
|
||||
this.auxSN1Label.Text = "Aux. WM Serial Nr.";
|
||||
//
|
||||
// mainSN1TextBox
|
||||
//
|
||||
this.mainSN1TextBox.Location = new System.Drawing.Point(300, 37);
|
||||
this.mainSN1TextBox.Name = "mainSN1TextBox";
|
||||
this.mainSN1TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.mainSN1TextBox.TabIndex = 1;
|
||||
//
|
||||
// mainSN1Label
|
||||
//
|
||||
this.mainSN1Label.AutoSize = true;
|
||||
this.mainSN1Label.Location = new System.Drawing.Point(21, 40);
|
||||
this.mainSN1Label.Name = "mainSN1Label";
|
||||
this.mainSN1Label.Size = new System.Drawing.Size(195, 23);
|
||||
this.mainSN1Label.TabIndex = 0;
|
||||
this.mainSN1Label.Text = "Main WM Serial Nr.";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.auxSN2TextBox);
|
||||
this.groupBox2.Controls.Add(this.auxSN2Label);
|
||||
this.groupBox2.Controls.Add(this.mainSN2TextBox);
|
||||
this.groupBox2.Controls.Add(this.mainSN2Label);
|
||||
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox2.Location = new System.Drawing.Point(28, 175);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(494, 137);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Water Meter 2";
|
||||
//
|
||||
// auxSN2TextBox
|
||||
//
|
||||
this.auxSN2TextBox.Location = new System.Drawing.Point(300, 83);
|
||||
this.auxSN2TextBox.Name = "auxSN2TextBox";
|
||||
this.auxSN2TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.auxSN2TextBox.TabIndex = 3;
|
||||
//
|
||||
// auxSN2Label
|
||||
//
|
||||
this.auxSN2Label.AutoSize = true;
|
||||
this.auxSN2Label.Location = new System.Drawing.Point(21, 86);
|
||||
this.auxSN2Label.Name = "auxSN2Label";
|
||||
this.auxSN2Label.Size = new System.Drawing.Size(193, 23);
|
||||
this.auxSN2Label.TabIndex = 2;
|
||||
this.auxSN2Label.Text = "Aux. WM Serial Nr.";
|
||||
//
|
||||
// mainSN2TextBox
|
||||
//
|
||||
this.mainSN2TextBox.Location = new System.Drawing.Point(300, 37);
|
||||
this.mainSN2TextBox.Name = "mainSN2TextBox";
|
||||
this.mainSN2TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.mainSN2TextBox.TabIndex = 1;
|
||||
//
|
||||
// mainSN2Label
|
||||
//
|
||||
this.mainSN2Label.AutoSize = true;
|
||||
this.mainSN2Label.Location = new System.Drawing.Point(21, 40);
|
||||
this.mainSN2Label.Name = "mainSN2Label";
|
||||
this.mainSN2Label.Size = new System.Drawing.Size(195, 23);
|
||||
this.mainSN2Label.TabIndex = 0;
|
||||
this.mainSN2Label.Text = "Main WM Serial Nr.";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.auxSN3TextBox);
|
||||
this.groupBox3.Controls.Add(this.auxSN3Label);
|
||||
this.groupBox3.Controls.Add(this.mainSN3TextBox);
|
||||
this.groupBox3.Controls.Add(this.mainSN3Label);
|
||||
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox3.Location = new System.Drawing.Point(28, 330);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(494, 137);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Water Meter 3";
|
||||
//
|
||||
// auxSN3TextBox
|
||||
//
|
||||
this.auxSN3TextBox.Location = new System.Drawing.Point(300, 83);
|
||||
this.auxSN3TextBox.Name = "auxSN3TextBox";
|
||||
this.auxSN3TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.auxSN3TextBox.TabIndex = 3;
|
||||
//
|
||||
// auxSN3Label
|
||||
//
|
||||
this.auxSN3Label.AutoSize = true;
|
||||
this.auxSN3Label.Location = new System.Drawing.Point(21, 86);
|
||||
this.auxSN3Label.Name = "auxSN3Label";
|
||||
this.auxSN3Label.Size = new System.Drawing.Size(193, 23);
|
||||
this.auxSN3Label.TabIndex = 2;
|
||||
this.auxSN3Label.Text = "Aux. WM Serial Nr.";
|
||||
//
|
||||
// mainSN3TextBox
|
||||
//
|
||||
this.mainSN3TextBox.Location = new System.Drawing.Point(300, 37);
|
||||
this.mainSN3TextBox.Name = "mainSN3TextBox";
|
||||
this.mainSN3TextBox.Size = new System.Drawing.Size(163, 31);
|
||||
this.mainSN3TextBox.TabIndex = 1;
|
||||
//
|
||||
// mainSN3Label
|
||||
//
|
||||
this.mainSN3Label.AutoSize = true;
|
||||
this.mainSN3Label.Location = new System.Drawing.Point(21, 40);
|
||||
this.mainSN3Label.Name = "mainSN3Label";
|
||||
this.mainSN3Label.Size = new System.Drawing.Size(195, 23);
|
||||
this.mainSN3Label.TabIndex = 0;
|
||||
this.mainSN3Label.Text = "Main WM Serial Nr.";
|
||||
//
|
||||
// CycleBeginningForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(687, 492);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleBeginningForm";
|
||||
this.Text = "Daten";
|
||||
this.TopMost = true;
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -117,9 +117,6 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="okButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
+446
@@ -0,0 +1,446 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
partial class CycleBeginningForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.orderGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.orderComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.clearButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.checkBox3 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.checkBox4 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox4 = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.checkBox5 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox5 = new System.Windows.Forms.ComboBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.checkBox6 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox6 = new System.Windows.Forms.ComboBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.checkBox7 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox7 = new System.Windows.Forms.ComboBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.checkBox8 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox8 = new System.Windows.Forms.ComboBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.checkBox9 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox9 = new System.Windows.Forms.ComboBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.checkBox10 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox10 = new System.Windows.Forms.ComboBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.checkBox11 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox11 = new System.Windows.Forms.ComboBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.checkBox12 = new System.Windows.Forms.CheckBox();
|
||||
this.comboBox12 = new System.Windows.Forms.ComboBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.orderGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
resources.ApplyResources(this.okButton, "okButton");
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// orderGroupBox
|
||||
//
|
||||
this.orderGroupBox.Controls.Add(this.orderComboBox);
|
||||
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
|
||||
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
|
||||
this.orderGroupBox.Name = "orderGroupBox";
|
||||
this.orderGroupBox.TabStop = false;
|
||||
//
|
||||
// orderComboBox
|
||||
//
|
||||
this.orderComboBox.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.orderComboBox, "orderComboBox");
|
||||
this.orderComboBox.Name = "orderComboBox";
|
||||
//
|
||||
// clearButton
|
||||
//
|
||||
resources.ApplyResources(this.clearButton, "clearButton");
|
||||
this.clearButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.clearButton.Name = "clearButton";
|
||||
this.clearButton.UseVisualStyleBackColor = true;
|
||||
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.Name = "label1";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
resources.ApplyResources(this.comboBox1, "comboBox1");
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
|
||||
this.comboBox1.TextChanged += new System.EventHandler(this.comboBox1_TextChanged);
|
||||
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress);
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
resources.ApplyResources(this.checkBox1, "checkBox1");
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBox2
|
||||
//
|
||||
resources.ApplyResources(this.checkBox2, "checkBox2");
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
resources.ApplyResources(this.comboBox2, "comboBox2");
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
|
||||
this.comboBox2.TextChanged += new System.EventHandler(this.comboBox2_TextChanged);
|
||||
this.comboBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox2_KeyPress);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.Name = "label2";
|
||||
//
|
||||
// checkBox3
|
||||
//
|
||||
resources.ApplyResources(this.checkBox3, "checkBox3");
|
||||
this.checkBox3.Name = "checkBox3";
|
||||
this.checkBox3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
resources.ApplyResources(this.comboBox3, "comboBox3");
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged);
|
||||
this.comboBox3.TextChanged += new System.EventHandler(this.comboBox3_TextChanged);
|
||||
this.comboBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox3_KeyPress);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.Name = "label3";
|
||||
//
|
||||
// checkBox4
|
||||
//
|
||||
resources.ApplyResources(this.checkBox4, "checkBox4");
|
||||
this.checkBox4.Name = "checkBox4";
|
||||
this.checkBox4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
resources.ApplyResources(this.comboBox4, "comboBox4");
|
||||
this.comboBox4.FormattingEnabled = true;
|
||||
this.comboBox4.Name = "comboBox4";
|
||||
this.comboBox4.SelectedIndexChanged += new System.EventHandler(this.comboBox4_SelectedIndexChanged);
|
||||
this.comboBox4.TextChanged += new System.EventHandler(this.comboBox4_TextChanged);
|
||||
this.comboBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox4_KeyPress);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// checkBox5
|
||||
//
|
||||
resources.ApplyResources(this.checkBox5, "checkBox5");
|
||||
this.checkBox5.Name = "checkBox5";
|
||||
this.checkBox5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox5
|
||||
//
|
||||
resources.ApplyResources(this.comboBox5, "comboBox5");
|
||||
this.comboBox5.FormattingEnabled = true;
|
||||
this.comboBox5.Name = "comboBox5";
|
||||
this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged);
|
||||
this.comboBox5.TextChanged += new System.EventHandler(this.comboBox5_TextChanged);
|
||||
this.comboBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox5_KeyPress);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
resources.ApplyResources(this.label5, "label5");
|
||||
this.label5.Name = "label5";
|
||||
//
|
||||
// checkBox6
|
||||
//
|
||||
resources.ApplyResources(this.checkBox6, "checkBox6");
|
||||
this.checkBox6.Name = "checkBox6";
|
||||
this.checkBox6.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox6
|
||||
//
|
||||
resources.ApplyResources(this.comboBox6, "comboBox6");
|
||||
this.comboBox6.FormattingEnabled = true;
|
||||
this.comboBox6.Name = "comboBox6";
|
||||
this.comboBox6.SelectedIndexChanged += new System.EventHandler(this.comboBox6_SelectedIndexChanged);
|
||||
this.comboBox6.TextChanged += new System.EventHandler(this.comboBox6_TextChanged);
|
||||
this.comboBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox6_KeyPress);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
resources.ApplyResources(this.label6, "label6");
|
||||
this.label6.Name = "label6";
|
||||
//
|
||||
// checkBox7
|
||||
//
|
||||
resources.ApplyResources(this.checkBox7, "checkBox7");
|
||||
this.checkBox7.Name = "checkBox7";
|
||||
this.checkBox7.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox7
|
||||
//
|
||||
resources.ApplyResources(this.comboBox7, "comboBox7");
|
||||
this.comboBox7.FormattingEnabled = true;
|
||||
this.comboBox7.Name = "comboBox7";
|
||||
this.comboBox7.SelectedIndexChanged += new System.EventHandler(this.comboBox7_SelectedIndexChanged);
|
||||
this.comboBox7.TextChanged += new System.EventHandler(this.comboBox7_TextChanged);
|
||||
this.comboBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox7_KeyPress);
|
||||
//
|
||||
// label7
|
||||
//
|
||||
resources.ApplyResources(this.label7, "label7");
|
||||
this.label7.Name = "label7";
|
||||
//
|
||||
// checkBox8
|
||||
//
|
||||
resources.ApplyResources(this.checkBox8, "checkBox8");
|
||||
this.checkBox8.Name = "checkBox8";
|
||||
this.checkBox8.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox8
|
||||
//
|
||||
resources.ApplyResources(this.comboBox8, "comboBox8");
|
||||
this.comboBox8.FormattingEnabled = true;
|
||||
this.comboBox8.Name = "comboBox8";
|
||||
this.comboBox8.SelectedIndexChanged += new System.EventHandler(this.comboBox8_SelectedIndexChanged);
|
||||
this.comboBox8.TextChanged += new System.EventHandler(this.comboBox8_TextChanged);
|
||||
this.comboBox8.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox8_KeyPress);
|
||||
//
|
||||
// label8
|
||||
//
|
||||
resources.ApplyResources(this.label8, "label8");
|
||||
this.label8.Name = "label8";
|
||||
//
|
||||
// checkBox9
|
||||
//
|
||||
resources.ApplyResources(this.checkBox9, "checkBox9");
|
||||
this.checkBox9.Name = "checkBox9";
|
||||
this.checkBox9.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox9
|
||||
//
|
||||
resources.ApplyResources(this.comboBox9, "comboBox9");
|
||||
this.comboBox9.FormattingEnabled = true;
|
||||
this.comboBox9.Name = "comboBox9";
|
||||
this.comboBox9.SelectedIndexChanged += new System.EventHandler(this.comboBox9_SelectedIndexChanged);
|
||||
this.comboBox9.TextChanged += new System.EventHandler(this.comboBox9_TextChanged);
|
||||
this.comboBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox9_KeyPress);
|
||||
//
|
||||
// label9
|
||||
//
|
||||
resources.ApplyResources(this.label9, "label9");
|
||||
this.label9.Name = "label9";
|
||||
//
|
||||
// checkBox10
|
||||
//
|
||||
resources.ApplyResources(this.checkBox10, "checkBox10");
|
||||
this.checkBox10.Name = "checkBox10";
|
||||
this.checkBox10.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox10
|
||||
//
|
||||
resources.ApplyResources(this.comboBox10, "comboBox10");
|
||||
this.comboBox10.FormattingEnabled = true;
|
||||
this.comboBox10.Name = "comboBox10";
|
||||
this.comboBox10.SelectedIndexChanged += new System.EventHandler(this.comboBox10_SelectedIndexChanged);
|
||||
this.comboBox10.TextChanged += new System.EventHandler(this.comboBox10_TextChanged);
|
||||
this.comboBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox10_KeyPress);
|
||||
//
|
||||
// label10
|
||||
//
|
||||
resources.ApplyResources(this.label10, "label10");
|
||||
this.label10.Name = "label10";
|
||||
//
|
||||
// checkBox11
|
||||
//
|
||||
resources.ApplyResources(this.checkBox11, "checkBox11");
|
||||
this.checkBox11.Name = "checkBox11";
|
||||
this.checkBox11.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox11
|
||||
//
|
||||
resources.ApplyResources(this.comboBox11, "comboBox11");
|
||||
this.comboBox11.FormattingEnabled = true;
|
||||
this.comboBox11.Name = "comboBox11";
|
||||
this.comboBox11.SelectedIndexChanged += new System.EventHandler(this.comboBox11_SelectedIndexChanged);
|
||||
this.comboBox11.TextChanged += new System.EventHandler(this.comboBox11_TextChanged);
|
||||
this.comboBox11.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox11_KeyPress);
|
||||
//
|
||||
// label11
|
||||
//
|
||||
resources.ApplyResources(this.label11, "label11");
|
||||
this.label11.Name = "label11";
|
||||
//
|
||||
// checkBox12
|
||||
//
|
||||
resources.ApplyResources(this.checkBox12, "checkBox12");
|
||||
this.checkBox12.Name = "checkBox12";
|
||||
this.checkBox12.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboBox12
|
||||
//
|
||||
resources.ApplyResources(this.comboBox12, "comboBox12");
|
||||
this.comboBox12.FormattingEnabled = true;
|
||||
this.comboBox12.Name = "comboBox12";
|
||||
this.comboBox12.SelectedIndexChanged += new System.EventHandler(this.comboBox12_SelectedIndexChanged);
|
||||
this.comboBox12.TextChanged += new System.EventHandler(this.comboBox12_TextChanged);
|
||||
this.comboBox12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox12_KeyPress);
|
||||
//
|
||||
// label12
|
||||
//
|
||||
resources.ApplyResources(this.label12, "label12");
|
||||
this.label12.Name = "label12";
|
||||
//
|
||||
// CycleBeginningForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.Controls.Add(this.checkBox12);
|
||||
this.Controls.Add(this.comboBox12);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.checkBox11);
|
||||
this.Controls.Add(this.comboBox11);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.checkBox10);
|
||||
this.Controls.Add(this.comboBox10);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.checkBox9);
|
||||
this.Controls.Add(this.comboBox9);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.checkBox8);
|
||||
this.Controls.Add(this.comboBox8);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.checkBox7);
|
||||
this.Controls.Add(this.comboBox7);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.checkBox6);
|
||||
this.Controls.Add(this.comboBox6);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.checkBox5);
|
||||
this.Controls.Add(this.comboBox5);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.checkBox4);
|
||||
this.Controls.Add(this.comboBox4);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.checkBox3);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.checkBox2);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.clearButton);
|
||||
this.Controls.Add(this.orderGroupBox);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleBeginningForm";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
|
||||
this.orderGroupBox.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox orderGroupBox;
|
||||
private System.Windows.Forms.ComboBox orderComboBox;
|
||||
private System.Windows.Forms.Button clearButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.CheckBox checkBox3;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.CheckBox checkBox4;
|
||||
private System.Windows.Forms.ComboBox comboBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.CheckBox checkBox5;
|
||||
private System.Windows.Forms.ComboBox comboBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.CheckBox checkBox6;
|
||||
private System.Windows.Forms.ComboBox comboBox6;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.CheckBox checkBox7;
|
||||
private System.Windows.Forms.ComboBox comboBox7;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.CheckBox checkBox8;
|
||||
private System.Windows.Forms.ComboBox comboBox8;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.CheckBox checkBox9;
|
||||
private System.Windows.Forms.ComboBox comboBox9;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.CheckBox checkBox10;
|
||||
private System.Windows.Forms.ComboBox comboBox10;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.CheckBox checkBox11;
|
||||
private System.Windows.Forms.ComboBox comboBox11;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.CheckBox checkBox12;
|
||||
private System.Windows.Forms.ComboBox comboBox12;
|
||||
private System.Windows.Forms.Label label12;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
|
||||
|
||||
/// <summary> Number of water meters </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
/// To be retrieved after the form is closed
|
||||
public string PurchaseOrder;
|
||||
public string[] SNText;
|
||||
public bool[] Disabled;
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
int textBoxesCount;
|
||||
Label[] labels;
|
||||
ComboBox[] comboBoxes;
|
||||
CheckBox[] checkBoxes;
|
||||
IList<ComboBox> enabledComboBoxes;
|
||||
|
||||
|
||||
/// <summary> Parameterless constructor for common functionality </summary>
|
||||
public CycleBeginningForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
textBoxesCount = 12;
|
||||
labels = new Label[]
|
||||
{
|
||||
label1, label2, label3, label4, label5, label6,
|
||||
label7, label8, label9, label10, label11, label12,
|
||||
};
|
||||
comboBoxes = new ComboBox[]
|
||||
{
|
||||
comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6,
|
||||
comboBox7, comboBox8, comboBox9, comboBox10, comboBox11, comboBox12,
|
||||
};
|
||||
checkBoxes = new CheckBox[]
|
||||
{
|
||||
checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6,
|
||||
checkBox7, checkBox8, checkBox9, checkBox10, checkBox11, checkBox12,
|
||||
};
|
||||
enabledComboBoxes = new List<ComboBox>();
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleBeginningForm(int waterMetersCount)
|
||||
: this()
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Program.WMsCount, Program.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the layout of labels/text boxes on the screen
|
||||
/// corresponds to the layout of watermeters of the test bench.
|
||||
/// </summary>
|
||||
/// <param name="wmsCount">Number of watermeters</param>
|
||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
||||
{
|
||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
||||
{
|
||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < lineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * lineSize + l * gap + i];
|
||||
comboBoxes[dest] = comboBoxes[l * lineSize + l * gap + i];
|
||||
checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
textBoxesCount = wmsCount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CycleBeginningForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
PrepareOrderCombo(orderComboBox);
|
||||
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == textBoxesCount)
|
||||
{
|
||||
comboBoxes[i].Items.Add(Program.LocalSettings.LastSNTexts[i]);
|
||||
}
|
||||
labels[i].Visible = comboBoxes[i].Visible = checkBoxes[i].Visible = true;
|
||||
enabledComboBoxes.Add(comboBoxes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
orderGroupBox.Text = Strings.Purchase_Order;
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = Strings.Serial_Number + " " + (i + 1).ToString();
|
||||
}
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
clearButton.Text = Strings.ClearBtnText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Puchase order ComboBox</param>
|
||||
void PrepareOrderCombo(ComboBox orderComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
|
||||
{
|
||||
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
|
||||
}
|
||||
|
||||
if (orderComboBox.Items.Count > 0)
|
||||
{
|
||||
orderComboBox.Text = orderComboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PurchaseOrder = orderComboBox.Text;
|
||||
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
|
||||
ref Program.LocalSettings.PurchaseOrderHistory
|
||||
#if FUZHOU150 || FUZHOU300
|
||||
, 20
|
||||
#endif
|
||||
);
|
||||
|
||||
Program.LocalSettings.LastSNTexts = SNText;
|
||||
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, textBoxesCount); i++)
|
||||
{
|
||||
SNText[i] = comboBoxes[i].Text;
|
||||
Disabled[i] = !checkBoxes[i].Checked;
|
||||
}
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When one combo box is updated using drop-down menu, all combo boxes
|
||||
/// are updated by this function.
|
||||
/// </summary>
|
||||
private void UpdateAllCombos()
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, textBoxesCount); i++)
|
||||
{
|
||||
comboBoxes[i].Text = Program.LocalSettings.LastSNTexts[i];
|
||||
checkBoxes[i].Checked = !string.IsNullOrEmpty(comboBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, textBoxesCount); i++)
|
||||
{
|
||||
comboBoxes[i].Text = string.Empty;
|
||||
checkBoxes[i].Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void comboBox1_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox1.Text.Equals(comboBox1.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox2_TextChanged(object sender, EventArgs e) { checkBox2.Checked = true; }
|
||||
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox2.Text.Equals(comboBox2.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox3_TextChanged(object sender, EventArgs e) { checkBox3.Checked = true; }
|
||||
private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox3.Text.Equals(comboBox3.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox4_TextChanged(object sender, EventArgs e) { checkBox4.Checked = true; }
|
||||
private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox4.Text.Equals(comboBox4.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox5_TextChanged(object sender, EventArgs e) { checkBox5.Checked = true; }
|
||||
private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox5.Text.Equals(comboBox5.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox6_TextChanged(object sender, EventArgs e) { checkBox6.Checked = true; }
|
||||
private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox6.Text.Equals(comboBox6.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox7_TextChanged(object sender, EventArgs e) { checkBox7.Checked = true; }
|
||||
private void comboBox7_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox7.Text.Equals(comboBox7.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox8_TextChanged(object sender, EventArgs e) { checkBox8.Checked = true; }
|
||||
private void comboBox8_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox8.Text.Equals(comboBox8.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox9_TextChanged(object sender, EventArgs e) { checkBox9.Checked = true; }
|
||||
private void comboBox9_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox9.Text.Equals(comboBox9.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox10_TextChanged(object sender, EventArgs e) { checkBox10.Checked = true; }
|
||||
private void comboBox10_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox10.Text.Equals(comboBox10.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox11_TextChanged(object sender, EventArgs e) { checkBox11.Checked = true; }
|
||||
private void comboBox11_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox11.Text.Equals(comboBox11.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox12_TextChanged(object sender, EventArgs e) { checkBox12.Checked = true; }
|
||||
private void comboBox12_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox12.Text.Equals(comboBox12.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
#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);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <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, ComboBox currentFocusOwner)
|
||||
{
|
||||
if (e.KeyChar == '+')
|
||||
{
|
||||
/// Process '+' key ..... Form completed
|
||||
okButton_Click(sender, e);
|
||||
}
|
||||
if (e.KeyChar == '\r')
|
||||
{
|
||||
/// Process <enter> key ..... Next text field
|
||||
if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledComboBoxes.Count; i++)
|
||||
{
|
||||
if (enabledComboBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledComboBoxes[(i + 1) % enabledComboBoxes.Count].Focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox1); }
|
||||
private void comboBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox2); }
|
||||
private void comboBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox3); }
|
||||
private void comboBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox4); }
|
||||
private void comboBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox5); }
|
||||
private void comboBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox6); }
|
||||
private void comboBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox7); }
|
||||
private void comboBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox8); }
|
||||
private void comboBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox9); }
|
||||
private void comboBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox10); }
|
||||
private void comboBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox11); }
|
||||
private void comboBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox12); }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+305
@@ -0,0 +1,305 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
partial class CycleEndForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.groupBox6.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.textBox2);
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox2.Location = new System.Drawing.Point(25, 104);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Wasserzähler 2";
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(18, 34);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(74, 23);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Stand:";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.textBox1);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox1.Location = new System.Drawing.Point(25, 14);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Wasserzähler 1";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox1.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(18, 34);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(74, 23);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Stand:";
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(425, 23);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 7;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox3.Location = new System.Drawing.Point(25, 194);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Wasserzähler 3";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox3.TabIndex = 1;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(18, 34);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(74, 23);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "Stand:";
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.textBox4);
|
||||
this.groupBox4.Controls.Add(this.label4);
|
||||
this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox4.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox4.Location = new System.Drawing.Point(25, 284);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox4.TabIndex = 4;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Wasserzähler 4";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox4.TabIndex = 1;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(18, 34);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(74, 23);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Stand:";
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.textBox5);
|
||||
this.groupBox5.Controls.Add(this.label5);
|
||||
this.groupBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox5.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox5.Location = new System.Drawing.Point(25, 374);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox5.TabIndex = 5;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Wasserzähler 5";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(18, 34);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(74, 23);
|
||||
this.label5.TabIndex = 0;
|
||||
this.label5.Text = "Stand:";
|
||||
//
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Controls.Add(this.textBox6);
|
||||
this.groupBox6.Controls.Add(this.label6);
|
||||
this.groupBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox6.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox6.Location = new System.Drawing.Point(25, 464);
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox6.TabIndex = 6;
|
||||
this.groupBox6.TabStop = false;
|
||||
this.groupBox6.Text = "Wasserzähler 6";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox6.TabIndex = 1;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(18, 34);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(74, 23);
|
||||
this.label6.TabIndex = 0;
|
||||
this.label6.Text = "Stand:";
|
||||
//
|
||||
// CycleEndForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(559, 566);
|
||||
this.Controls.Add(this.groupBox6);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleEndForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Daten";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleEndForm_Load);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.groupBox6.ResumeLayout(false);
|
||||
this.groupBox6.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.Label label6;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleEndForm));
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public string[] EndStateText;
|
||||
|
||||
// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleEndForm(int waterMetersCount)
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
InitializeComponent();
|
||||
EndStateText = new string[WaterMetersCount];
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary> Parameterless constructor for 3 watermeters </summary>
|
||||
public CycleEndForm()
|
||||
: this(3)
|
||||
{
|
||||
}
|
||||
|
||||
private void CycleEndForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
Height = 50 + 90 * WaterMetersCount;
|
||||
|
||||
if (WaterMetersCount < 1) groupBox1.Visible = false;
|
||||
if (WaterMetersCount < 2) groupBox2.Visible = false;
|
||||
if (WaterMetersCount < 3) groupBox3.Visible = false;
|
||||
if (WaterMetersCount < 4) groupBox4.Visible = false;
|
||||
if (WaterMetersCount < 5) groupBox5.Visible = false;
|
||||
if (WaterMetersCount < 6) groupBox6.Visible = false;
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
groupBox1.Text = Strings.Water_Meter + " 1";
|
||||
groupBox2.Text = Strings.Water_Meter + " 2";
|
||||
groupBox3.Text = Strings.Water_Meter + " 3";
|
||||
groupBox4.Text = Strings.Water_Meter + " 4";
|
||||
groupBox5.Text = Strings.Water_Meter + " 5";
|
||||
groupBox6.Text = Strings.Water_Meter + " 6";
|
||||
label1.Text = Strings.State;
|
||||
label2.Text = Strings.State;
|
||||
label3.Text = Strings.State;
|
||||
label4.Text = Strings.State;
|
||||
label5.Text = Strings.State;
|
||||
label6.Text = Strings.State;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (WaterMetersCount >= 1) EndStateText[0] = textBox1.Text;
|
||||
if (WaterMetersCount >= 2) EndStateText[1] = textBox3.Text;
|
||||
if (WaterMetersCount >= 3) EndStateText[2] = textBox4.Text;
|
||||
if (WaterMetersCount >= 4) EndStateText[3] = textBox5.Text;
|
||||
if (WaterMetersCount >= 5) EndStateText[4] = textBox6.Text;
|
||||
if (WaterMetersCount >= 6) EndStateText[5] = textBox6.Text;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
-10
@@ -117,14 +117,4 @@
|
||||
<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="flowLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>357, 243</value>
|
||||
</data>
|
||||
<data name="okButton.Text" xml:space="preserve">
|
||||
<value>&OK</value>
|
||||
</data>
|
||||
<data name="cancelButton.Text" xml:space="preserve">
|
||||
<value>&Abbrechen</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,276 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
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("DataEntry.Standard12({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin, End and WMStates form
|
||||
/// </summary>
|
||||
string purchaseOrder;
|
||||
public string PurchaseOrder { get { return purchaseOrder; } }
|
||||
|
||||
string[] serialNr;
|
||||
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
|
||||
|
||||
bool[] disabled;
|
||||
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
|
||||
|
||||
string[] wmCycleEndState;
|
||||
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
|
||||
|
||||
float[] wmStartState;
|
||||
public float WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
|
||||
|
||||
float[] wmEndState;
|
||||
public float WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
|
||||
|
||||
string[] wmStartStateStr;
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
|
||||
float refVolume;
|
||||
float errLimLo;
|
||||
float errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
ShowFormAtCycleBeginning,
|
||||
ShowFormAtCycleEnd,
|
||||
EnterTestStartStates,
|
||||
EnterTestEndStates,
|
||||
}
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
serialNr = new string[Program.WMsCount];
|
||||
disabled = new bool[Program.WMsCount];
|
||||
wmStartState = new float[Program.WMsCount];
|
||||
wmStartStateStr = new string[Program.WMsCount];
|
||||
wmEndState = new float[Program.WMsCount];
|
||||
wmCycleEndState = new string[Program.WMsCount];
|
||||
|
||||
entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> 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()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestStartStates;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestEndStates;
|
||||
this.refVolume = refVolume;
|
||||
this.errLimLo = errLimLo;
|
||||
this.errLimHi = errLimHi;
|
||||
return this;
|
||||
}
|
||||
|
||||
delegate void EntryFormDlgt(EntryForm myRef);
|
||||
///
|
||||
void OpenBeginningDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Program.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Program.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
resultSaved = false;
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.ShowFormAtCycleBeginning:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
break;
|
||||
case CurrentOp.ShowFormAtCycleEnd:
|
||||
if (entryFormCfg.ShowCycleEndForm)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), 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)
|
||||
{
|
||||
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
|
||||
|
||||
if (dlg != null)
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
|
||||
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = waterMeters.Count;
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty
|
||||
wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
|
||||
{
|
||||
/// Fixed start test - start
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
|
||||
for (int i = 0; i < dlg.WaterMetersCount; i++)
|
||||
{
|
||||
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);
|
||||
|
||||
for (int i = 0; i < dlg.WaterMetersCount; i++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates test results with the information collected in watermeters.
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<Entities.TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != Entities.MetersKind.Single) continue;
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public bool ShowCycleEndForm;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
Name = "DataEntry-Standard-12";
|
||||
ParentName = string.Empty;
|
||||
ShowCycleEndForm = false;
|
||||
}
|
||||
|
||||
public EntryFormCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
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();
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form;
|
||||
}
|
||||
|
||||
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;
|
||||
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
showCycleEndFormCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
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.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
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.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(131, 57);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(32, 60);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(128, 32);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 3;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// showCycleEndFormCheckBox
|
||||
//
|
||||
this.showCycleEndFormCheckBox.AutoSize = true;
|
||||
this.showCycleEndFormCheckBox.Enabled = false;
|
||||
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
|
||||
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
|
||||
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
|
||||
this.showCycleEndFormCheckBox.TabIndex = 13;
|
||||
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
|
||||
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// EntryFormCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.showCycleEndFormCheckBox);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "EntryFormCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 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 showCycleEndFormCheckBox;
|
||||
}
|
||||
}
|
||||
-13
@@ -117,17 +117,4 @@
|
||||
<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="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>128, 13</value>
|
||||
</data>
|
||||
<data name="label1.Text" xml:space="preserve">
|
||||
<value>Verfügbare Komponenten</value>
|
||||
</data>
|
||||
<data name="cancelButton.Text" xml:space="preserve">
|
||||
<value>&Abbrechen</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Komponenten Auswahl</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,23 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public class EntryFormFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-12"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,476 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
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 bool[] disabled;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMStartState;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public readonly string[] WMStartStateStr;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMEndState;
|
||||
|
||||
bool endStates; /// false=start states, true=end states
|
||||
float refVolume;
|
||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||
|
||||
int TextBoxesCount;
|
||||
///
|
||||
Label[] labels;
|
||||
TextBox[] startTextBoxes;
|
||||
TextBox[] endTextBoxes;
|
||||
IList<TextBox> enabledTextBoxes;
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializing common part for start and endstate form
|
||||
/// </summary>
|
||||
public TestStartEndForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TextBoxesCount = 12;
|
||||
|
||||
labels = new Label[]
|
||||
{
|
||||
label1, label2, label3, label4, label5, label6,
|
||||
label7, label8, label9, label10, label11, label12,
|
||||
};
|
||||
startTextBoxes = new TextBox[]
|
||||
{
|
||||
startTextBox1, startTextBox2, startTextBox3, startTextBox4, startTextBox5, startTextBox6,
|
||||
startTextBox7, startTextBox8, startTextBox9, startTextBox10, startTextBox11, startTextBox12,
|
||||
};
|
||||
endTextBoxes = new TextBox[]
|
||||
{
|
||||
endTextBox1, endTextBox2, endTextBox3, endTextBox4, endTextBox5, endTextBox6,
|
||||
endTextBox7, endTextBox8, endTextBox9, endTextBox10, endTextBox11, endTextBox12,
|
||||
};
|
||||
enabledTextBoxes = new List<TextBox>();
|
||||
|
||||
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, bool[] disabled)
|
||||
: this()
|
||||
{
|
||||
endStates = false;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.disabled = disabled;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMStartState = new float[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, string[] wmStartStateStr, bool[] disabled,
|
||||
float refVolume, float errLimLo, float errLimHi)
|
||||
: this()
|
||||
{
|
||||
endStates = true;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
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;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMEndState = new float[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 (Program.WMsCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Program.WMsCount / Program.LineSize;
|
||||
int gap = (TextBoxesCount - Program.WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Program.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Program.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Program.WMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (WMStartStateStr != null && i < WMStartStateStr.Length)
|
||||
{
|
||||
startTextBoxes[i].Text = WMStartStateStr[i];
|
||||
}
|
||||
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
endTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(endTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
startTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(startTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_Meter_States;
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = Strings.Water_Meter + " " + (i + 1).ToString();
|
||||
}
|
||||
startLabel.Text = Strings.Start;
|
||||
endLabel.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.ParseUFloat(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.ParseUFloat(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 endTextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { };
|
||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
/// <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 (enabledTextBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledTextBoxes.Count; i++)
|
||||
{
|
||||
if (enabledTextBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus();
|
||||
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 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); }
|
||||
}
|
||||
}
|
||||
+794
@@ -0,0 +1,794 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
partial class TestStartEndForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.exclamation1 = new System.Windows.Forms.Label();
|
||||
this.startTextBox1 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.exclamation3 = new System.Windows.Forms.Label();
|
||||
this.startTextBox3 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.exclamation4 = new System.Windows.Forms.Label();
|
||||
this.startTextBox4 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.exclamation5 = new System.Windows.Forms.Label();
|
||||
this.startTextBox5 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.exclamation6 = new System.Windows.Forms.Label();
|
||||
this.startTextBox6 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox6 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.startLabel = new System.Windows.Forms.Label();
|
||||
this.endLabel = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.endTextBox2 = new System.Windows.Forms.TextBox();
|
||||
this.startTextBox2 = new System.Windows.Forms.TextBox();
|
||||
this.exclamation2 = new System.Windows.Forms.Label();
|
||||
this.exclamation7 = new System.Windows.Forms.Label();
|
||||
this.startTextBox7 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox7 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.exclamation8 = new System.Windows.Forms.Label();
|
||||
this.startTextBox8 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox8 = new System.Windows.Forms.TextBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.exclamation9 = new System.Windows.Forms.Label();
|
||||
this.startTextBox9 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox9 = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.exclamation10 = new System.Windows.Forms.Label();
|
||||
this.startTextBox10 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox10 = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.exclamation11 = new System.Windows.Forms.Label();
|
||||
this.startTextBox11 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox11 = new System.Windows.Forms.TextBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.exclamation12 = new System.Windows.Forms.Label();
|
||||
this.startTextBox12 = new System.Windows.Forms.TextBox();
|
||||
this.endTextBox12 = new System.Windows.Forms.TextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// exclamation1
|
||||
//
|
||||
this.exclamation1.AutoSize = true;
|
||||
this.exclamation1.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation1.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation1.Location = new System.Drawing.Point(532, 56);
|
||||
this.exclamation1.Name = "exclamation1";
|
||||
this.exclamation1.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation1.TabIndex = 5;
|
||||
this.exclamation1.Text = "!";
|
||||
this.exclamation1.Visible = false;
|
||||
//
|
||||
// startTextBox1
|
||||
//
|
||||
this.startTextBox1.Enabled = false;
|
||||
this.startTextBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox1.Location = new System.Drawing.Point(185, 60);
|
||||
this.startTextBox1.Name = "startTextBox1";
|
||||
this.startTextBox1.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox1.TabIndex = 3;
|
||||
this.startTextBox1.Visible = false;
|
||||
this.startTextBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox1_KeyPress);
|
||||
//
|
||||
// endTextBox1
|
||||
//
|
||||
this.endTextBox1.Enabled = false;
|
||||
this.endTextBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox1.Location = new System.Drawing.Point(367, 60);
|
||||
this.endTextBox1.Name = "endTextBox1";
|
||||
this.endTextBox1.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox1.TabIndex = 4;
|
||||
this.endTextBox1.Visible = false;
|
||||
this.endTextBox1.TextChanged += new System.EventHandler(this.endTextBox1_TextChanged);
|
||||
this.endTextBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox1_KeyPress);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label1.Location = new System.Drawing.Point(23, 63);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(145, 23);
|
||||
this.label1.TabIndex = 2;
|
||||
this.label1.Text = "Water Meter 1";
|
||||
this.label1.Visible = false;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(603, 60);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 100;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// exclamation3
|
||||
//
|
||||
this.exclamation3.AutoSize = true;
|
||||
this.exclamation3.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation3.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation3.Location = new System.Drawing.Point(532, 144);
|
||||
this.exclamation3.Name = "exclamation3";
|
||||
this.exclamation3.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation3.TabIndex = 13;
|
||||
this.exclamation3.Text = "!";
|
||||
this.exclamation3.Visible = false;
|
||||
//
|
||||
// startTextBox3
|
||||
//
|
||||
this.startTextBox3.Enabled = false;
|
||||
this.startTextBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox3.Location = new System.Drawing.Point(185, 148);
|
||||
this.startTextBox3.Name = "startTextBox3";
|
||||
this.startTextBox3.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox3.TabIndex = 11;
|
||||
this.startTextBox3.Visible = false;
|
||||
this.startTextBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox3_KeyPress);
|
||||
//
|
||||
// endTextBox3
|
||||
//
|
||||
this.endTextBox3.Enabled = false;
|
||||
this.endTextBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox3.Location = new System.Drawing.Point(367, 148);
|
||||
this.endTextBox3.Name = "endTextBox3";
|
||||
this.endTextBox3.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox3.TabIndex = 12;
|
||||
this.endTextBox3.Visible = false;
|
||||
this.endTextBox3.TextChanged += new System.EventHandler(this.endTextBox3_TextChanged);
|
||||
this.endTextBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox3_KeyPress);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label3.Location = new System.Drawing.Point(23, 151);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(145, 23);
|
||||
this.label3.TabIndex = 10;
|
||||
this.label3.Text = "Water Meter 3";
|
||||
this.label3.Visible = false;
|
||||
//
|
||||
// exclamation4
|
||||
//
|
||||
this.exclamation4.AutoSize = true;
|
||||
this.exclamation4.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation4.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation4.Location = new System.Drawing.Point(532, 188);
|
||||
this.exclamation4.Name = "exclamation4";
|
||||
this.exclamation4.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation4.TabIndex = 17;
|
||||
this.exclamation4.Text = "!";
|
||||
this.exclamation4.Visible = false;
|
||||
//
|
||||
// startTextBox4
|
||||
//
|
||||
this.startTextBox4.Enabled = false;
|
||||
this.startTextBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox4.Location = new System.Drawing.Point(185, 192);
|
||||
this.startTextBox4.Name = "startTextBox4";
|
||||
this.startTextBox4.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox4.TabIndex = 15;
|
||||
this.startTextBox4.Visible = false;
|
||||
this.startTextBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox4_KeyPress);
|
||||
//
|
||||
// endTextBox4
|
||||
//
|
||||
this.endTextBox4.Enabled = false;
|
||||
this.endTextBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox4.Location = new System.Drawing.Point(367, 192);
|
||||
this.endTextBox4.Name = "endTextBox4";
|
||||
this.endTextBox4.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox4.TabIndex = 16;
|
||||
this.endTextBox4.Visible = false;
|
||||
this.endTextBox4.TextChanged += new System.EventHandler(this.endTextBox4_TextChanged);
|
||||
this.endTextBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox4_KeyPress);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label4.Location = new System.Drawing.Point(23, 195);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(145, 23);
|
||||
this.label4.TabIndex = 14;
|
||||
this.label4.Text = "Water Meter 4";
|
||||
this.label4.Visible = false;
|
||||
//
|
||||
// exclamation5
|
||||
//
|
||||
this.exclamation5.AutoSize = true;
|
||||
this.exclamation5.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation5.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation5.Location = new System.Drawing.Point(532, 232);
|
||||
this.exclamation5.Name = "exclamation5";
|
||||
this.exclamation5.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation5.TabIndex = 21;
|
||||
this.exclamation5.Text = "!";
|
||||
this.exclamation5.Visible = false;
|
||||
//
|
||||
// startTextBox5
|
||||
//
|
||||
this.startTextBox5.Enabled = false;
|
||||
this.startTextBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox5.Location = new System.Drawing.Point(185, 236);
|
||||
this.startTextBox5.Name = "startTextBox5";
|
||||
this.startTextBox5.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox5.TabIndex = 19;
|
||||
this.startTextBox5.Visible = false;
|
||||
this.startTextBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox5_KeyPress);
|
||||
//
|
||||
// endTextBox5
|
||||
//
|
||||
this.endTextBox5.Enabled = false;
|
||||
this.endTextBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox5.Location = new System.Drawing.Point(367, 236);
|
||||
this.endTextBox5.Name = "endTextBox5";
|
||||
this.endTextBox5.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox5.TabIndex = 20;
|
||||
this.endTextBox5.Visible = false;
|
||||
this.endTextBox5.TextChanged += new System.EventHandler(this.endTextBox5_TextChanged);
|
||||
this.endTextBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox5_KeyPress);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label5.Location = new System.Drawing.Point(23, 239);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(145, 23);
|
||||
this.label5.TabIndex = 18;
|
||||
this.label5.Text = "Water Meter 5";
|
||||
this.label5.Visible = false;
|
||||
//
|
||||
// exclamation6
|
||||
//
|
||||
this.exclamation6.AutoSize = true;
|
||||
this.exclamation6.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation6.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation6.Location = new System.Drawing.Point(532, 276);
|
||||
this.exclamation6.Name = "exclamation6";
|
||||
this.exclamation6.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation6.TabIndex = 25;
|
||||
this.exclamation6.Text = "!";
|
||||
this.exclamation6.Visible = false;
|
||||
//
|
||||
// startTextBox6
|
||||
//
|
||||
this.startTextBox6.Enabled = false;
|
||||
this.startTextBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox6.Location = new System.Drawing.Point(185, 280);
|
||||
this.startTextBox6.Name = "startTextBox6";
|
||||
this.startTextBox6.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox6.TabIndex = 23;
|
||||
this.startTextBox6.Visible = false;
|
||||
this.startTextBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox6_KeyPress);
|
||||
//
|
||||
// endTextBox6
|
||||
//
|
||||
this.endTextBox6.Enabled = false;
|
||||
this.endTextBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox6.Location = new System.Drawing.Point(367, 280);
|
||||
this.endTextBox6.Name = "endTextBox6";
|
||||
this.endTextBox6.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox6.TabIndex = 24;
|
||||
this.endTextBox6.Visible = false;
|
||||
this.endTextBox6.TextChanged += new System.EventHandler(this.endTextBox6_TextChanged);
|
||||
this.endTextBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox6_KeyPress);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label6.Location = new System.Drawing.Point(23, 283);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(145, 23);
|
||||
this.label6.TabIndex = 22;
|
||||
this.label6.Text = "Water Meter 6";
|
||||
this.label6.Visible = false;
|
||||
//
|
||||
// startLabel
|
||||
//
|
||||
this.startLabel.AutoSize = true;
|
||||
this.startLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startLabel.Location = new System.Drawing.Point(237, 21);
|
||||
this.startLabel.Name = "startLabel";
|
||||
this.startLabel.Size = new System.Drawing.Size(56, 23);
|
||||
this.startLabel.TabIndex = 0;
|
||||
this.startLabel.Text = "Start";
|
||||
//
|
||||
// endLabel
|
||||
//
|
||||
this.endLabel.AutoSize = true;
|
||||
this.endLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endLabel.Location = new System.Drawing.Point(423, 21);
|
||||
this.endLabel.Name = "endLabel";
|
||||
this.endLabel.Size = new System.Drawing.Size(46, 23);
|
||||
this.endLabel.TabIndex = 1;
|
||||
this.endLabel.Text = "End";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label2.Location = new System.Drawing.Point(23, 107);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(145, 23);
|
||||
this.label2.TabIndex = 6;
|
||||
this.label2.Text = "Water Meter 2";
|
||||
this.label2.Visible = false;
|
||||
//
|
||||
// endTextBox2
|
||||
//
|
||||
this.endTextBox2.Enabled = false;
|
||||
this.endTextBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox2.Location = new System.Drawing.Point(367, 104);
|
||||
this.endTextBox2.Name = "endTextBox2";
|
||||
this.endTextBox2.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox2.TabIndex = 8;
|
||||
this.endTextBox2.Visible = false;
|
||||
this.endTextBox2.TextChanged += new System.EventHandler(this.endTextBox2_TextChanged);
|
||||
this.endTextBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox2_KeyPress);
|
||||
//
|
||||
// startTextBox2
|
||||
//
|
||||
this.startTextBox2.Enabled = false;
|
||||
this.startTextBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox2.Location = new System.Drawing.Point(185, 104);
|
||||
this.startTextBox2.Name = "startTextBox2";
|
||||
this.startTextBox2.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox2.TabIndex = 7;
|
||||
this.startTextBox2.Visible = false;
|
||||
this.startTextBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox2_KeyPress);
|
||||
//
|
||||
// exclamation2
|
||||
//
|
||||
this.exclamation2.AutoSize = true;
|
||||
this.exclamation2.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation2.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation2.Location = new System.Drawing.Point(532, 100);
|
||||
this.exclamation2.Name = "exclamation2";
|
||||
this.exclamation2.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation2.TabIndex = 9;
|
||||
this.exclamation2.Text = "!";
|
||||
this.exclamation2.Visible = false;
|
||||
//
|
||||
// exclamation7
|
||||
//
|
||||
this.exclamation7.AutoSize = true;
|
||||
this.exclamation7.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation7.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation7.Location = new System.Drawing.Point(532, 320);
|
||||
this.exclamation7.Name = "exclamation7";
|
||||
this.exclamation7.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation7.TabIndex = 29;
|
||||
this.exclamation7.Text = "!";
|
||||
this.exclamation7.Visible = false;
|
||||
//
|
||||
// startTextBox7
|
||||
//
|
||||
this.startTextBox7.Enabled = false;
|
||||
this.startTextBox7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox7.Location = new System.Drawing.Point(185, 324);
|
||||
this.startTextBox7.Name = "startTextBox7";
|
||||
this.startTextBox7.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox7.TabIndex = 27;
|
||||
this.startTextBox7.Visible = false;
|
||||
this.startTextBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox7_KeyPress);
|
||||
//
|
||||
// endTextBox7
|
||||
//
|
||||
this.endTextBox7.Enabled = false;
|
||||
this.endTextBox7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox7.Location = new System.Drawing.Point(367, 324);
|
||||
this.endTextBox7.Name = "endTextBox7";
|
||||
this.endTextBox7.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox7.TabIndex = 28;
|
||||
this.endTextBox7.Visible = false;
|
||||
this.endTextBox7.TextChanged += new System.EventHandler(this.endTextBox7_TextChanged);
|
||||
this.endTextBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox7_KeyPress);
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label7.Location = new System.Drawing.Point(23, 327);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(145, 23);
|
||||
this.label7.TabIndex = 26;
|
||||
this.label7.Text = "Water Meter 7";
|
||||
this.label7.Visible = false;
|
||||
//
|
||||
// exclamation8
|
||||
//
|
||||
this.exclamation8.AutoSize = true;
|
||||
this.exclamation8.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation8.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation8.Location = new System.Drawing.Point(532, 364);
|
||||
this.exclamation8.Name = "exclamation8";
|
||||
this.exclamation8.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation8.TabIndex = 33;
|
||||
this.exclamation8.Text = "!";
|
||||
this.exclamation8.Visible = false;
|
||||
//
|
||||
// startTextBox8
|
||||
//
|
||||
this.startTextBox8.Enabled = false;
|
||||
this.startTextBox8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox8.Location = new System.Drawing.Point(185, 368);
|
||||
this.startTextBox8.Name = "startTextBox8";
|
||||
this.startTextBox8.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox8.TabIndex = 31;
|
||||
this.startTextBox8.Visible = false;
|
||||
this.startTextBox8.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox8_KeyPress);
|
||||
//
|
||||
// endTextBox8
|
||||
//
|
||||
this.endTextBox8.Enabled = false;
|
||||
this.endTextBox8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox8.Location = new System.Drawing.Point(367, 368);
|
||||
this.endTextBox8.Name = "endTextBox8";
|
||||
this.endTextBox8.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox8.TabIndex = 32;
|
||||
this.endTextBox8.Visible = false;
|
||||
this.endTextBox8.TextChanged += new System.EventHandler(this.endTextBox8_TextChanged);
|
||||
this.endTextBox8.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox8_KeyPress);
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label8.Location = new System.Drawing.Point(23, 371);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(145, 23);
|
||||
this.label8.TabIndex = 30;
|
||||
this.label8.Text = "Water Meter 8";
|
||||
this.label8.Visible = false;
|
||||
//
|
||||
// exclamation9
|
||||
//
|
||||
this.exclamation9.AutoSize = true;
|
||||
this.exclamation9.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation9.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation9.Location = new System.Drawing.Point(532, 408);
|
||||
this.exclamation9.Name = "exclamation9";
|
||||
this.exclamation9.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation9.TabIndex = 37;
|
||||
this.exclamation9.Text = "!";
|
||||
this.exclamation9.Visible = false;
|
||||
//
|
||||
// startTextBox9
|
||||
//
|
||||
this.startTextBox9.Enabled = false;
|
||||
this.startTextBox9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox9.Location = new System.Drawing.Point(185, 412);
|
||||
this.startTextBox9.Name = "startTextBox9";
|
||||
this.startTextBox9.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox9.TabIndex = 35;
|
||||
this.startTextBox9.Visible = false;
|
||||
this.startTextBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox9_KeyPress);
|
||||
//
|
||||
// endTextBox9
|
||||
//
|
||||
this.endTextBox9.Enabled = false;
|
||||
this.endTextBox9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox9.Location = new System.Drawing.Point(367, 412);
|
||||
this.endTextBox9.Name = "endTextBox9";
|
||||
this.endTextBox9.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox9.TabIndex = 36;
|
||||
this.endTextBox9.Visible = false;
|
||||
this.endTextBox9.TextChanged += new System.EventHandler(this.endTextBox9_TextChanged);
|
||||
this.endTextBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox9_KeyPress);
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label9.Location = new System.Drawing.Point(23, 415);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(145, 23);
|
||||
this.label9.TabIndex = 34;
|
||||
this.label9.Text = "Water Meter 9";
|
||||
this.label9.Visible = false;
|
||||
//
|
||||
// exclamation10
|
||||
//
|
||||
this.exclamation10.AutoSize = true;
|
||||
this.exclamation10.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation10.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation10.Location = new System.Drawing.Point(532, 452);
|
||||
this.exclamation10.Name = "exclamation10";
|
||||
this.exclamation10.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation10.TabIndex = 41;
|
||||
this.exclamation10.Text = "!";
|
||||
this.exclamation10.Visible = false;
|
||||
//
|
||||
// startTextBox10
|
||||
//
|
||||
this.startTextBox10.Enabled = false;
|
||||
this.startTextBox10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox10.Location = new System.Drawing.Point(185, 456);
|
||||
this.startTextBox10.Name = "startTextBox10";
|
||||
this.startTextBox10.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox10.TabIndex = 39;
|
||||
this.startTextBox10.Visible = false;
|
||||
this.startTextBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox10_KeyPress);
|
||||
//
|
||||
// endTextBox10
|
||||
//
|
||||
this.endTextBox10.Enabled = false;
|
||||
this.endTextBox10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox10.Location = new System.Drawing.Point(367, 456);
|
||||
this.endTextBox10.Name = "endTextBox10";
|
||||
this.endTextBox10.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox10.TabIndex = 40;
|
||||
this.endTextBox10.Visible = false;
|
||||
this.endTextBox10.TextChanged += new System.EventHandler(this.endTextBox10_TextChanged);
|
||||
this.endTextBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox10_KeyPress);
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label10.Location = new System.Drawing.Point(23, 459);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(157, 23);
|
||||
this.label10.TabIndex = 38;
|
||||
this.label10.Text = "Water Meter 10";
|
||||
this.label10.Visible = false;
|
||||
//
|
||||
// exclamation11
|
||||
//
|
||||
this.exclamation11.AutoSize = true;
|
||||
this.exclamation11.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation11.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation11.Location = new System.Drawing.Point(532, 496);
|
||||
this.exclamation11.Name = "exclamation11";
|
||||
this.exclamation11.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation11.TabIndex = 45;
|
||||
this.exclamation11.Text = "!";
|
||||
this.exclamation11.Visible = false;
|
||||
//
|
||||
// startTextBox11
|
||||
//
|
||||
this.startTextBox11.Enabled = false;
|
||||
this.startTextBox11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox11.Location = new System.Drawing.Point(185, 500);
|
||||
this.startTextBox11.Name = "startTextBox11";
|
||||
this.startTextBox11.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox11.TabIndex = 43;
|
||||
this.startTextBox11.Visible = false;
|
||||
this.startTextBox11.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox11_KeyPress);
|
||||
//
|
||||
// endTextBox11
|
||||
//
|
||||
this.endTextBox11.Enabled = false;
|
||||
this.endTextBox11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox11.Location = new System.Drawing.Point(367, 500);
|
||||
this.endTextBox11.Name = "endTextBox11";
|
||||
this.endTextBox11.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox11.TabIndex = 44;
|
||||
this.endTextBox11.Visible = false;
|
||||
this.endTextBox11.TextChanged += new System.EventHandler(this.endTextBox11_TextChanged);
|
||||
this.endTextBox11.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox11_KeyPress);
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label11.Location = new System.Drawing.Point(23, 503);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(157, 23);
|
||||
this.label11.TabIndex = 42;
|
||||
this.label11.Text = "Water Meter 11";
|
||||
this.label11.Visible = false;
|
||||
//
|
||||
// exclamation12
|
||||
//
|
||||
this.exclamation12.AutoSize = true;
|
||||
this.exclamation12.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.exclamation12.ForeColor = System.Drawing.Color.Red;
|
||||
this.exclamation12.Location = new System.Drawing.Point(532, 540);
|
||||
this.exclamation12.Name = "exclamation12";
|
||||
this.exclamation12.Size = new System.Drawing.Size(30, 38);
|
||||
this.exclamation12.TabIndex = 49;
|
||||
this.exclamation12.Text = "!";
|
||||
this.exclamation12.Visible = false;
|
||||
//
|
||||
// startTextBox12
|
||||
//
|
||||
this.startTextBox12.Enabled = false;
|
||||
this.startTextBox12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.startTextBox12.Location = new System.Drawing.Point(185, 544);
|
||||
this.startTextBox12.Name = "startTextBox12";
|
||||
this.startTextBox12.Size = new System.Drawing.Size(163, 31);
|
||||
this.startTextBox12.TabIndex = 47;
|
||||
this.startTextBox12.Visible = false;
|
||||
this.startTextBox12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.startTextBox12_KeyPress);
|
||||
//
|
||||
// endTextBox12
|
||||
//
|
||||
this.endTextBox12.Enabled = false;
|
||||
this.endTextBox12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.endTextBox12.Location = new System.Drawing.Point(367, 544);
|
||||
this.endTextBox12.Name = "endTextBox12";
|
||||
this.endTextBox12.Size = new System.Drawing.Size(163, 31);
|
||||
this.endTextBox12.TabIndex = 48;
|
||||
this.endTextBox12.Visible = false;
|
||||
this.endTextBox12.TextChanged += new System.EventHandler(this.endTextBox12_TextChanged);
|
||||
this.endTextBox12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.endTextBox12_KeyPress);
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.label12.Location = new System.Drawing.Point(23, 547);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(157, 23);
|
||||
this.label12.TabIndex = 46;
|
||||
this.label12.Text = "Water Meter 12";
|
||||
this.label12.Visible = false;
|
||||
//
|
||||
// TestStartEndForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(753, 613);
|
||||
this.Controls.Add(this.exclamation12);
|
||||
this.Controls.Add(this.startTextBox12);
|
||||
this.Controls.Add(this.endTextBox12);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.exclamation11);
|
||||
this.Controls.Add(this.startTextBox11);
|
||||
this.Controls.Add(this.endTextBox11);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.exclamation10);
|
||||
this.Controls.Add(this.startTextBox10);
|
||||
this.Controls.Add(this.endTextBox10);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.exclamation9);
|
||||
this.Controls.Add(this.startTextBox9);
|
||||
this.Controls.Add(this.endTextBox9);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.exclamation8);
|
||||
this.Controls.Add(this.startTextBox8);
|
||||
this.Controls.Add(this.endTextBox8);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.exclamation7);
|
||||
this.Controls.Add(this.startTextBox7);
|
||||
this.Controls.Add(this.endTextBox7);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.exclamation6);
|
||||
this.Controls.Add(this.exclamation5);
|
||||
this.Controls.Add(this.startTextBox6);
|
||||
this.Controls.Add(this.exclamation4);
|
||||
this.Controls.Add(this.endTextBox6);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.startTextBox5);
|
||||
this.Controls.Add(this.exclamation3);
|
||||
this.Controls.Add(this.endTextBox5);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.startTextBox4);
|
||||
this.Controls.Add(this.exclamation2);
|
||||
this.Controls.Add(this.endTextBox4);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.startTextBox3);
|
||||
this.Controls.Add(this.exclamation1);
|
||||
this.Controls.Add(this.endTextBox3);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.startTextBox2);
|
||||
this.Controls.Add(this.endLabel);
|
||||
this.Controls.Add(this.endTextBox2);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.startTextBox1);
|
||||
this.Controls.Add(this.startLabel);
|
||||
this.Controls.Add(this.endTextBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "TestStartEndForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "End States";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleEndForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox endTextBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.TextBox endTextBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox endTextBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox endTextBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox endTextBox6;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox startTextBox1;
|
||||
private System.Windows.Forms.TextBox startTextBox3;
|
||||
private System.Windows.Forms.TextBox startTextBox4;
|
||||
private System.Windows.Forms.TextBox startTextBox5;
|
||||
private System.Windows.Forms.TextBox startTextBox6;
|
||||
private System.Windows.Forms.Label startLabel;
|
||||
private System.Windows.Forms.Label endLabel;
|
||||
private System.Windows.Forms.Label exclamation1;
|
||||
private System.Windows.Forms.Label exclamation3;
|
||||
private System.Windows.Forms.Label exclamation4;
|
||||
private System.Windows.Forms.Label exclamation5;
|
||||
private System.Windows.Forms.Label exclamation6;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox endTextBox2;
|
||||
private System.Windows.Forms.TextBox startTextBox2;
|
||||
private System.Windows.Forms.Label exclamation2;
|
||||
private System.Windows.Forms.Label exclamation7;
|
||||
private System.Windows.Forms.TextBox startTextBox7;
|
||||
private System.Windows.Forms.TextBox endTextBox7;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label exclamation8;
|
||||
private System.Windows.Forms.TextBox startTextBox8;
|
||||
private System.Windows.Forms.TextBox endTextBox8;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label exclamation9;
|
||||
private System.Windows.Forms.TextBox startTextBox9;
|
||||
private System.Windows.Forms.TextBox endTextBox9;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label exclamation10;
|
||||
private System.Windows.Forms.TextBox startTextBox10;
|
||||
private System.Windows.Forms.TextBox endTextBox10;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.Label exclamation11;
|
||||
private System.Windows.Forms.TextBox startTextBox11;
|
||||
private System.Windows.Forms.TextBox endTextBox11;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.Label exclamation12;
|
||||
private System.Windows.Forms.TextBox startTextBox12;
|
||||
private System.Windows.Forms.TextBox endTextBox12;
|
||||
private System.Windows.Forms.Label label12;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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,667 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard24
|
||||
{
|
||||
public partial class AdvancedFixedStartTestForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(AdvancedFixedStartTestForm));
|
||||
|
||||
// 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 bool[] disabled;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMStartState;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public readonly string[] WMStartStateStr;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMEndState;
|
||||
|
||||
bool endStates; /// false=start states, true=end states
|
||||
float refVolume;
|
||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||
|
||||
int TextBoxesCount;
|
||||
///
|
||||
Label[] labels;
|
||||
TextBox[] startTextBoxes;
|
||||
TextBox[] mid1TextBoxes;
|
||||
TextBox[] mid2TextBoxes;
|
||||
TextBox[] endTextBoxes;
|
||||
IList<TextBox> enabledTextBoxes;
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializing common part for start and endstate form
|
||||
/// </summary>
|
||||
public AdvancedFixedStartTestForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TextBoxesCount = 24;
|
||||
|
||||
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,
|
||||
};
|
||||
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,
|
||||
};
|
||||
mid1TextBoxes = new TextBox[]
|
||||
{
|
||||
mid1TextBox1, mid1TextBox2, mid1TextBox3, mid1TextBox4, mid1TextBox5, mid1TextBox6,
|
||||
mid1TextBox7, mid1TextBox8, mid1TextBox9, mid1TextBox10, mid1TextBox11, mid1TextBox12,
|
||||
mid1TextBox13, mid1TextBox14, mid1TextBox15, mid1TextBox16, mid1TextBox17, mid1TextBox18,
|
||||
mid1TextBox19, mid1TextBox20, mid1TextBox21, mid1TextBox22, mid1TextBox23, mid1TextBox24,
|
||||
};
|
||||
mid2TextBoxes = new TextBox[]
|
||||
{
|
||||
mid2TextBox1, mid2TextBox2, mid2TextBox3, mid2TextBox4, mid2TextBox5, mid2TextBox6,
|
||||
mid2TextBox7, mid2TextBox8, mid2TextBox9, mid2TextBox10, mid2TextBox11, mid2TextBox12,
|
||||
mid2TextBox13, mid2TextBox14, mid2TextBox15, mid2TextBox16, mid2TextBox17, mid2TextBox18,
|
||||
mid2TextBox19, mid2TextBox20, mid2TextBox21, mid2TextBox22, mid2TextBox23, mid2TextBox24,
|
||||
};
|
||||
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,
|
||||
};
|
||||
enabledTextBoxes = new List<TextBox>();
|
||||
|
||||
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 AdvancedFixedStartTestForm(int waterMetersCount, bool[] disabled)
|
||||
: this()
|
||||
{
|
||||
endStates = false;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.disabled = disabled;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMStartState = new float[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 AdvancedFixedStartTestForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||
float refVolume, float errLimLo, float errLimHi)
|
||||
: this()
|
||||
{
|
||||
endStates = true;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
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;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMEndState = new float[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 (Program.WMsCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Program.WMsCount / Program.LineSize;
|
||||
int gap = (TextBoxesCount - Program.WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Program.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Program.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
mid1TextBoxes[dest] = mid1TextBoxes[l * Program.LineSize + l * gap + i];
|
||||
mid2TextBoxes[dest] = mid2TextBoxes[l * Program.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Program.WMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
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 = mid1TextBoxes[i].Visible = mid2TextBoxes[i].Visible = endTextBoxes[i].Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (endStates)
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (WMStartStateStr != null && i < WMStartStateStr.Length)
|
||||
{
|
||||
startTextBoxes[i].Text = WMStartStateStr[i];
|
||||
}
|
||||
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
endTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(endTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
startTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(startTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_Meter_States;
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = Strings.Water_Meter + " " + (i + 1).ToString();
|
||||
}
|
||||
startLabel.Text = Strings.Start;
|
||||
endLabel.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.ParseUFloat(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.ParseUFloat(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 endTextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { };
|
||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
/// <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 (enabledTextBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledTextBoxes.Count; i++)
|
||||
{
|
||||
if (enabledTextBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus();
|
||||
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 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); }
|
||||
}
|
||||
}
|
||||
Generated
+2140
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>
|
||||
+1489
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,738 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
|
||||
|
||||
/// <summary> Number of water meters </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
/// To be retrieved after the form is closed
|
||||
public string PurchaseOrder;
|
||||
public string[] SNText;
|
||||
public bool[] Disabled;
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
int textBoxesCount;
|
||||
Label[] labels;
|
||||
ComboBox[] comboBoxes;
|
||||
CheckBox[] checkBoxes;
|
||||
IList<ComboBox> enabledComboBoxes;
|
||||
|
||||
|
||||
/// <summary> Parameterless constructor for common functionality </summary>
|
||||
public CycleBeginningForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
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,
|
||||
};
|
||||
comboBoxes = new ComboBox[]
|
||||
{
|
||||
comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6, comboBox7, comboBox8, comboBox9, comboBox10,
|
||||
comboBox11, comboBox12, comboBox13, comboBox14, comboBox15, comboBox16, comboBox17, comboBox18, comboBox19, comboBox20,
|
||||
comboBox21, comboBox22, comboBox23, comboBox24, comboBox25, comboBox26, comboBox27, comboBox28, comboBox29, comboBox30,
|
||||
comboBox31, comboBox32, comboBox33, comboBox34, comboBox35, comboBox36, comboBox37, comboBox38, comboBox39, comboBox40,
|
||||
comboBox41, comboBox42, comboBox43, comboBox44, comboBox45, comboBox46, comboBox47, comboBox48,
|
||||
};
|
||||
checkBoxes = new CheckBox[]
|
||||
{
|
||||
checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6, checkBox7, checkBox8, checkBox9, checkBox10,
|
||||
checkBox11, checkBox12, checkBox13, checkBox14, checkBox15, checkBox16, checkBox17, checkBox18, checkBox19, checkBox20,
|
||||
checkBox21, checkBox22, checkBox23, checkBox24, checkBox25, checkBox26, checkBox27, checkBox28, checkBox29, checkBox30,
|
||||
checkBox31, checkBox32, checkBox33, checkBox34, checkBox35, checkBox36, checkBox37, checkBox38, checkBox39, checkBox40,
|
||||
checkBox41, checkBox42, checkBox43, checkBox44, checkBox45, checkBox46, checkBox47, checkBox48,
|
||||
};
|
||||
enabledComboBoxes = new List<ComboBox>();
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleBeginningForm(int waterMetersCount)
|
||||
: this()
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
SNText = new string[WaterMetersCount];
|
||||
Disabled = new bool[WaterMetersCount];
|
||||
|
||||
ShuffleTextBoxes(Program.WMsCount, Program.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the layout of labels/text boxes on the screen
|
||||
/// corresponds to the layout of watermeters of the test bench.
|
||||
/// </summary>
|
||||
/// <param name="wmsCount">Number of watermeters</param>
|
||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
||||
{
|
||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
||||
{
|
||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < lineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * lineSize + l * gap + i];
|
||||
comboBoxes[dest] = comboBoxes[l * lineSize + l * gap + i];
|
||||
checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
textBoxesCount = wmsCount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CycleBeginningForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
PrepareOrderCombo(orderComboBox);
|
||||
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == textBoxesCount)
|
||||
{
|
||||
comboBoxes[i].Items.Add(Program.LocalSettings.LastSNTexts[i]);
|
||||
}
|
||||
labels[i].Visible = comboBoxes[i].Visible = checkBoxes[i].Visible = true;
|
||||
enabledComboBoxes.Add(comboBoxes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
orderGroupBox.Text = Strings.Purchase_Order;
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = Strings.Serial_Number + " " + (i + 1).ToString();
|
||||
}
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
clearButton.Text = Strings.ClearBtnText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Puchase order ComboBox</param>
|
||||
void PrepareOrderCombo(ComboBox orderComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
|
||||
{
|
||||
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
|
||||
}
|
||||
|
||||
if (orderComboBox.Items.Count > 0)
|
||||
{
|
||||
orderComboBox.Text = orderComboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PurchaseOrder = orderComboBox.Text;
|
||||
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
|
||||
ref Program.LocalSettings.PurchaseOrderHistory
|
||||
#if FUZHOU150 || FUZHOU300
|
||||
, 20
|
||||
#endif
|
||||
);
|
||||
|
||||
Program.LocalSettings.LastSNTexts = SNText;
|
||||
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, textBoxesCount); i++)
|
||||
{
|
||||
SNText[i] = comboBoxes[i].Text;
|
||||
Disabled[i] = !checkBoxes[i].Checked;
|
||||
}
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When one combo box is updated using drop-down menu, all combo boxes
|
||||
/// are updated by this function.
|
||||
/// </summary>
|
||||
private void UpdateAllCombos()
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, textBoxesCount); i++)
|
||||
{
|
||||
comboBoxes[i].Text = Program.LocalSettings.LastSNTexts[i];
|
||||
checkBoxes[i].Checked = !string.IsNullOrEmpty(comboBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WaterMetersCount, textBoxesCount); i++)
|
||||
{
|
||||
comboBoxes[i].Text = string.Empty;
|
||||
checkBoxes[i].Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void comboBox1_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
|
||||
private void comboBox2_TextChanged(object sender, EventArgs e) { checkBox2.Checked = true; }
|
||||
private void comboBox3_TextChanged(object sender, EventArgs e) { checkBox3.Checked = true; }
|
||||
private void comboBox4_TextChanged(object sender, EventArgs e) { checkBox4.Checked = true; }
|
||||
private void comboBox5_TextChanged(object sender, EventArgs e) { checkBox5.Checked = true; }
|
||||
private void comboBox6_TextChanged(object sender, EventArgs e) { checkBox6.Checked = true; }
|
||||
private void comboBox7_TextChanged(object sender, EventArgs e) { checkBox7.Checked = true; }
|
||||
private void comboBox8_TextChanged(object sender, EventArgs e) { checkBox8.Checked = true; }
|
||||
private void comboBox9_TextChanged(object sender, EventArgs e) { checkBox9.Checked = true; }
|
||||
private void comboBox10_TextChanged(object sender, EventArgs e) { checkBox10.Checked = true; }
|
||||
private void comboBox11_TextChanged(object sender, EventArgs e) { checkBox11.Checked = true; }
|
||||
private void comboBox12_TextChanged(object sender, EventArgs e) { checkBox12.Checked = true; }
|
||||
private void comboBox13_TextChanged(object sender, EventArgs e) { checkBox13.Checked = true; }
|
||||
private void comboBox14_TextChanged(object sender, EventArgs e) { checkBox14.Checked = true; }
|
||||
private void comboBox15_TextChanged(object sender, EventArgs e) { checkBox15.Checked = true; }
|
||||
private void comboBox16_TextChanged(object sender, EventArgs e) { checkBox16.Checked = true; }
|
||||
private void comboBox17_TextChanged(object sender, EventArgs e) { checkBox17.Checked = true; }
|
||||
private void comboBox18_TextChanged(object sender, EventArgs e) { checkBox18.Checked = true; }
|
||||
private void comboBox19_TextChanged(object sender, EventArgs e) { checkBox19.Checked = true; }
|
||||
private void comboBox20_TextChanged(object sender, EventArgs e) { checkBox20.Checked = true; }
|
||||
private void comboBox21_TextChanged(object sender, EventArgs e) { checkBox21.Checked = true; }
|
||||
private void comboBox22_TextChanged(object sender, EventArgs e) { checkBox22.Checked = true; }
|
||||
private void comboBox23_TextChanged(object sender, EventArgs e) { checkBox23.Checked = true; }
|
||||
private void comboBox24_TextChanged(object sender, EventArgs e) { checkBox24.Checked = true; }
|
||||
private void comboBox25_TextChanged(object sender, EventArgs e) { checkBox25.Checked = true; }
|
||||
private void comboBox26_TextChanged(object sender, EventArgs e) { checkBox26.Checked = true; }
|
||||
private void comboBox27_TextChanged(object sender, EventArgs e) { checkBox27.Checked = true; }
|
||||
private void comboBox28_TextChanged(object sender, EventArgs e) { checkBox28.Checked = true; }
|
||||
private void comboBox29_TextChanged(object sender, EventArgs e) { checkBox29.Checked = true; }
|
||||
private void comboBox30_TextChanged(object sender, EventArgs e) { checkBox30.Checked = true; }
|
||||
private void comboBox31_TextChanged(object sender, EventArgs e) { checkBox31.Checked = true; }
|
||||
private void comboBox32_TextChanged(object sender, EventArgs e) { checkBox32.Checked = true; }
|
||||
private void comboBox33_TextChanged(object sender, EventArgs e) { checkBox33.Checked = true; }
|
||||
private void comboBox34_TextChanged(object sender, EventArgs e) { checkBox34.Checked = true; }
|
||||
private void comboBox35_TextChanged(object sender, EventArgs e) { checkBox35.Checked = true; }
|
||||
private void comboBox36_TextChanged(object sender, EventArgs e) { checkBox36.Checked = true; }
|
||||
private void comboBox37_TextChanged(object sender, EventArgs e) { checkBox37.Checked = true; }
|
||||
private void comboBox38_TextChanged(object sender, EventArgs e) { checkBox38.Checked = true; }
|
||||
private void comboBox39_TextChanged(object sender, EventArgs e) { checkBox39.Checked = true; }
|
||||
private void comboBox40_TextChanged(object sender, EventArgs e) { checkBox40.Checked = true; }
|
||||
private void comboBox41_TextChanged(object sender, EventArgs e) { checkBox41.Checked = true; }
|
||||
private void comboBox42_TextChanged(object sender, EventArgs e) { checkBox42.Checked = true; }
|
||||
private void comboBox43_TextChanged(object sender, EventArgs e) { checkBox43.Checked = true; }
|
||||
private void comboBox44_TextChanged(object sender, EventArgs e) { checkBox44.Checked = true; }
|
||||
private void comboBox45_TextChanged(object sender, EventArgs e) { checkBox45.Checked = true; }
|
||||
private void comboBox46_TextChanged(object sender, EventArgs e) { checkBox46.Checked = true; }
|
||||
private void comboBox47_TextChanged(object sender, EventArgs e) { checkBox47.Checked = true; }
|
||||
private void comboBox48_TextChanged(object sender, EventArgs e) { checkBox48.Checked = true; }
|
||||
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox1.Text.Equals(comboBox1.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox2.Text.Equals(comboBox2.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox3.Text.Equals(comboBox3.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox4.Text.Equals(comboBox4.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox5.Text.Equals(comboBox5.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox6.Text.Equals(comboBox6.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox7_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox7.Text.Equals(comboBox7.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox8_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox8.Text.Equals(comboBox8.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox9_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox9.Text.Equals(comboBox9.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox10_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox10.Text.Equals(comboBox10.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox11_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox11.Text.Equals(comboBox11.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox12_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox12.Text.Equals(comboBox12.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox13_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox13.Text.Equals(comboBox13.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox14_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox14.Text.Equals(comboBox14.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox15_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox15.Text.Equals(comboBox15.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox16_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox16.Text.Equals(comboBox16.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox17_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox17.Text.Equals(comboBox17.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox18_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox18.Text.Equals(comboBox18.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox19_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox19.Text.Equals(comboBox19.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox20_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox20.Text.Equals(comboBox20.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox21_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox21.Text.Equals(comboBox21.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox22_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox22.Text.Equals(comboBox22.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox23_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox23.Text.Equals(comboBox23.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox24_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox24.Text.Equals(comboBox24.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox25_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox25.Text.Equals(comboBox25.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox26_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox26.Text.Equals(comboBox26.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox27_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox27.Text.Equals(comboBox27.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox28_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox28.Text.Equals(comboBox28.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox29_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox29.Text.Equals(comboBox29.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox30_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox30.Text.Equals(comboBox30.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox31_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox31.Text.Equals(comboBox31.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox32_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox32.Text.Equals(comboBox32.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox33_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox33.Text.Equals(comboBox33.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox34_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox34.Text.Equals(comboBox34.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox35_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox35.Text.Equals(comboBox35.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox36_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox36.Text.Equals(comboBox36.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox37_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox37.Text.Equals(comboBox37.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox38_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox38.Text.Equals(comboBox38.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox39_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox39.Text.Equals(comboBox39.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox40_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox40.Text.Equals(comboBox40.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox41_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox41.Text.Equals(comboBox41.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox42_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox42.Text.Equals(comboBox42.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox43_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox43.Text.Equals(comboBox43.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox44_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox44.Text.Equals(comboBox44.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox45_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox45.Text.Equals(comboBox45.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox46_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox46.Text.Equals(comboBox46.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox47_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox47.Text.Equals(comboBox47.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox48_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox48.Text.Equals(comboBox48.Items[0])) UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
|
||||
#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);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <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, ComboBox currentFocusOwner)
|
||||
{
|
||||
if (e.KeyChar == '+')
|
||||
{
|
||||
/// Process '+' key ..... Form completed
|
||||
okButton_Click(sender, e);
|
||||
}
|
||||
if (e.KeyChar == '\r')
|
||||
{
|
||||
/// Process <enter> key ..... Next text field
|
||||
if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledComboBoxes.Count; i++)
|
||||
{
|
||||
if (enabledComboBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledComboBoxes[(i + 1) % enabledComboBoxes.Count].Focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox1); }
|
||||
private void comboBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox2); }
|
||||
private void comboBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox3); }
|
||||
private void comboBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox4); }
|
||||
private void comboBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox5); }
|
||||
private void comboBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox6); }
|
||||
private void comboBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox7); }
|
||||
private void comboBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox8); }
|
||||
private void comboBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox9); }
|
||||
private void comboBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox10); }
|
||||
private void comboBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox11); }
|
||||
private void comboBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox12); }
|
||||
private void comboBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox13); }
|
||||
private void comboBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox14); }
|
||||
private void comboBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox15); }
|
||||
private void comboBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox16); }
|
||||
private void comboBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox17); }
|
||||
private void comboBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox18); }
|
||||
private void comboBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox19); }
|
||||
private void comboBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox20); }
|
||||
private void comboBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox21); }
|
||||
private void comboBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox22); }
|
||||
private void comboBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox23); }
|
||||
private void comboBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox24); }
|
||||
private void comboBox25_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox25); }
|
||||
private void comboBox26_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox26); }
|
||||
private void comboBox27_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox27); }
|
||||
private void comboBox28_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox28); }
|
||||
private void comboBox29_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox29); }
|
||||
private void comboBox30_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox30); }
|
||||
private void comboBox31_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox31); }
|
||||
private void comboBox32_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox32); }
|
||||
private void comboBox33_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox33); }
|
||||
private void comboBox34_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox34); }
|
||||
private void comboBox35_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox35); }
|
||||
private void comboBox36_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox36); }
|
||||
private void comboBox37_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox37); }
|
||||
private void comboBox38_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox38); }
|
||||
private void comboBox39_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox39); }
|
||||
private void comboBox40_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox40); }
|
||||
private void comboBox41_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox41); }
|
||||
private void comboBox42_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox42); }
|
||||
private void comboBox43_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox43); }
|
||||
private void comboBox44_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox44); }
|
||||
private void comboBox45_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox45); }
|
||||
private void comboBox46_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox46); }
|
||||
private void comboBox47_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox47); }
|
||||
private void comboBox48_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox48); }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+305
@@ -0,0 +1,305 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
partial class CycleEndForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.groupBox6.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.textBox2);
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox2.Location = new System.Drawing.Point(25, 104);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Wasserzähler 2";
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(18, 34);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(74, 23);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Stand:";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.textBox1);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox1.Location = new System.Drawing.Point(25, 14);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Wasserzähler 1";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox1.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(18, 34);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(74, 23);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Stand:";
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(425, 23);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 7;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox3.Location = new System.Drawing.Point(25, 194);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Wasserzähler 3";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox3.TabIndex = 1;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(18, 34);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(74, 23);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "Stand:";
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.textBox4);
|
||||
this.groupBox4.Controls.Add(this.label4);
|
||||
this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox4.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox4.Location = new System.Drawing.Point(25, 284);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox4.TabIndex = 4;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Wasserzähler 4";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox4.TabIndex = 1;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(18, 34);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(74, 23);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Stand:";
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.textBox5);
|
||||
this.groupBox5.Controls.Add(this.label5);
|
||||
this.groupBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox5.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox5.Location = new System.Drawing.Point(25, 374);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox5.TabIndex = 5;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Wasserzähler 5";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(18, 34);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(74, 23);
|
||||
this.label5.TabIndex = 0;
|
||||
this.label5.Text = "Stand:";
|
||||
//
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Controls.Add(this.textBox6);
|
||||
this.groupBox6.Controls.Add(this.label6);
|
||||
this.groupBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox6.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox6.Location = new System.Drawing.Point(25, 464);
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox6.TabIndex = 6;
|
||||
this.groupBox6.TabStop = false;
|
||||
this.groupBox6.Text = "Wasserzähler 6";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox6.TabIndex = 1;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(18, 34);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(74, 23);
|
||||
this.label6.TabIndex = 0;
|
||||
this.label6.Text = "Stand:";
|
||||
//
|
||||
// CycleEndForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(559, 566);
|
||||
this.Controls.Add(this.groupBox6);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleEndForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Daten";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleEndForm_Load);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.groupBox6.ResumeLayout(false);
|
||||
this.groupBox6.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.Label label6;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleEndForm));
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public string[] EndStateText;
|
||||
|
||||
// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleEndForm(int waterMetersCount)
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
InitializeComponent();
|
||||
EndStateText = new string[WaterMetersCount];
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary> Parameterless constructor for 3 watermeters </summary>
|
||||
public CycleEndForm()
|
||||
: this(3)
|
||||
{
|
||||
}
|
||||
|
||||
private void CycleEndForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
Height = 50 + 90 * WaterMetersCount;
|
||||
|
||||
if (WaterMetersCount < 1) groupBox1.Visible = false;
|
||||
if (WaterMetersCount < 2) groupBox2.Visible = false;
|
||||
if (WaterMetersCount < 3) groupBox3.Visible = false;
|
||||
if (WaterMetersCount < 4) groupBox4.Visible = false;
|
||||
if (WaterMetersCount < 5) groupBox5.Visible = false;
|
||||
if (WaterMetersCount < 6) groupBox6.Visible = false;
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
groupBox1.Text = Strings.Water_Meter + " 1";
|
||||
groupBox2.Text = Strings.Water_Meter + " 2";
|
||||
groupBox3.Text = Strings.Water_Meter + " 3";
|
||||
groupBox4.Text = Strings.Water_Meter + " 4";
|
||||
groupBox5.Text = Strings.Water_Meter + " 5";
|
||||
groupBox6.Text = Strings.Water_Meter + " 6";
|
||||
label1.Text = Strings.State;
|
||||
label2.Text = Strings.State;
|
||||
label3.Text = Strings.State;
|
||||
label4.Text = Strings.State;
|
||||
label5.Text = Strings.State;
|
||||
label6.Text = Strings.State;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (WaterMetersCount >= 1) EndStateText[0] = textBox1.Text;
|
||||
if (WaterMetersCount >= 2) EndStateText[1] = textBox3.Text;
|
||||
if (WaterMetersCount >= 3) EndStateText[2] = textBox4.Text;
|
||||
if (WaterMetersCount >= 4) EndStateText[3] = textBox5.Text;
|
||||
if (WaterMetersCount >= 5) EndStateText[4] = textBox6.Text;
|
||||
if (WaterMetersCount >= 6) EndStateText[5] = textBox6.Text;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -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,276 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
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("DataEntry.Standard48({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin, End and WMStates form
|
||||
/// </summary>
|
||||
string purchaseOrder;
|
||||
public string PurchaseOrder { get { return purchaseOrder; } }
|
||||
|
||||
string[] serialNr;
|
||||
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
|
||||
|
||||
bool[] disabled;
|
||||
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
|
||||
|
||||
string[] wmCycleEndState;
|
||||
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
|
||||
|
||||
float[] wmStartState;
|
||||
public float WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
|
||||
|
||||
float[] wmEndState;
|
||||
public float WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
|
||||
|
||||
string[] wmStartStateStr;
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
|
||||
float refVolume;
|
||||
float errLimLo;
|
||||
float errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
ShowFormAtCycleBeginning,
|
||||
ShowFormAtCycleEnd,
|
||||
EnterTestStartStates,
|
||||
EnterTestEndStates,
|
||||
}
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
serialNr = new string[Program.WMsCount];
|
||||
disabled = new bool[Program.WMsCount];
|
||||
wmStartState = new float[Program.WMsCount];
|
||||
wmStartStateStr = new string[Program.WMsCount];
|
||||
wmEndState = new float[Program.WMsCount];
|
||||
wmCycleEndState = new string[Program.WMsCount];
|
||||
|
||||
entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> 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()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestStartStates;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestEndStates;
|
||||
this.refVolume = refVolume;
|
||||
this.errLimLo = errLimLo;
|
||||
this.errLimHi = errLimHi;
|
||||
return this;
|
||||
}
|
||||
|
||||
delegate void EntryFormDlgt(EntryForm myRef);
|
||||
///
|
||||
void OpenBeginningDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Program.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Program.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
resultSaved = false;
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.ShowFormAtCycleBeginning:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
break;
|
||||
case CurrentOp.ShowFormAtCycleEnd:
|
||||
if (entryFormCfg.ShowCycleEndForm)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), 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)
|
||||
{
|
||||
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
|
||||
|
||||
if (dlg != null)
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
|
||||
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = waterMeters.Count;
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty
|
||||
wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
|
||||
{
|
||||
/// Fixed start test - start
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
|
||||
for (int i = 0; i < dlg.WaterMetersCount; i++)
|
||||
{
|
||||
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);
|
||||
|
||||
for (int i = 0; i < dlg.WaterMetersCount; i++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates test results with the information collected in watermeters.
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<Entities.TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != Entities.MetersKind.Single) continue;
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public bool ShowCycleEndForm;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
Name = "DataEntry-Standard-48";
|
||||
ParentName = string.Empty;
|
||||
ShowCycleEndForm = false;
|
||||
}
|
||||
|
||||
public EntryFormCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
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();
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form;
|
||||
}
|
||||
|
||||
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;
|
||||
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
showCycleEndFormCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
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.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
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.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(131, 57);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(32, 60);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(128, 32);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 3;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// showCycleEndFormCheckBox
|
||||
//
|
||||
this.showCycleEndFormCheckBox.AutoSize = true;
|
||||
this.showCycleEndFormCheckBox.Enabled = false;
|
||||
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
|
||||
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
|
||||
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
|
||||
this.showCycleEndFormCheckBox.TabIndex = 13;
|
||||
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
|
||||
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// EntryFormCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.showCycleEndFormCheckBox);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "EntryFormCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 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 showCycleEndFormCheckBox;
|
||||
}
|
||||
}
|
||||
@@ -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,23 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public class EntryFormFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-48"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,649 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
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 bool[] disabled;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMStartState;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public readonly string[] WMStartStateStr;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMEndState;
|
||||
|
||||
bool endStates; /// false=start states, true=end states
|
||||
float refVolume;
|
||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||
|
||||
int TextBoxesCount;
|
||||
///
|
||||
Label[] labels;
|
||||
TextBox[] startTextBoxes;
|
||||
TextBox[] endTextBoxes;
|
||||
IList<TextBox> enabledTextBoxes;
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializing common part for start and endstate form
|
||||
/// </summary>
|
||||
public TestStartEndForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TextBoxesCount = 24;
|
||||
|
||||
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,
|
||||
};
|
||||
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,
|
||||
};
|
||||
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,
|
||||
};
|
||||
enabledTextBoxes = new List<TextBox>();
|
||||
|
||||
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, bool[] disabled)
|
||||
: this()
|
||||
{
|
||||
endStates = false;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.disabled = disabled;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMStartState = new float[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, string[] wmStartStateStr, bool[] disabled,
|
||||
float refVolume, float errLimLo, float errLimHi)
|
||||
: this()
|
||||
{
|
||||
endStates = true;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
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;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMEndState = new float[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 (Program.WMsCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Program.WMsCount / Program.LineSize;
|
||||
int gap = (TextBoxesCount - Program.WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Program.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Program.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Program.WMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (WMStartStateStr != null && i < WMStartStateStr.Length)
|
||||
{
|
||||
startTextBoxes[i].Text = WMStartStateStr[i];
|
||||
}
|
||||
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
endTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(endTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
startTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(startTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_Meter_States;
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = Strings.Water_Meter + " " + (i + 1).ToString();
|
||||
}
|
||||
startLabel.Text = Strings.Start;
|
||||
endLabel.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.ParseUFloat(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.ParseUFloat(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 endTextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { };
|
||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
/// <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 (enabledTextBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledTextBoxes.Count; i++)
|
||||
{
|
||||
if (enabledTextBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus();
|
||||
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 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); }
|
||||
}
|
||||
}
|
||||
+1516
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>
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
partial class CycleBeginningForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.orderGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.orderComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.orderGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
resources.ApplyResources(this.okButton, "okButton");
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// orderGroupBox
|
||||
//
|
||||
this.orderGroupBox.Controls.Add(this.orderComboBox);
|
||||
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
|
||||
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
|
||||
this.orderGroupBox.Name = "orderGroupBox";
|
||||
this.orderGroupBox.TabStop = false;
|
||||
//
|
||||
// orderComboBox
|
||||
//
|
||||
this.orderComboBox.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.orderComboBox, "orderComboBox");
|
||||
this.orderComboBox.Name = "orderComboBox";
|
||||
//
|
||||
// CycleBeginningForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.Controls.Add(this.orderGroupBox);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleBeginningForm";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
|
||||
this.orderGroupBox.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox orderGroupBox;
|
||||
private System.Windows.Forms.ComboBox orderComboBox;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
|
||||
|
||||
/// <summary> Number of water meters </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
/// To be retrieved after the form is closed
|
||||
public string PurchaseOrder;
|
||||
public string[] SNText;
|
||||
public bool[] Disabled;
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
|
||||
/// <summary> Parameterless constructor for common functionality </summary>
|
||||
public CycleBeginningForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleBeginningForm(int waterMetersCount)
|
||||
: this()
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
SNText = null;
|
||||
Disabled = null;
|
||||
}
|
||||
|
||||
|
||||
private void CycleBeginningForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Text = Strings.Data;
|
||||
orderGroupBox.Text = Strings.Purchase_Order;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
PrepareOrderCombo(orderComboBox);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Puchase order ComboBox</param>
|
||||
void PrepareOrderCombo(ComboBox orderComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
|
||||
{
|
||||
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
|
||||
}
|
||||
|
||||
if (orderComboBox.Items.Count > 0)
|
||||
{
|
||||
orderComboBox.Text = orderComboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PurchaseOrder = orderComboBox.Text;
|
||||
Program.LocalSettings.UpdateHistory(orderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+87
-17
@@ -118,31 +118,101 @@
|
||||
<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="languageLabel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 13</value>
|
||||
</data>
|
||||
<data name="languageLabel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>47, 13</value>
|
||||
</data>
|
||||
<data name="languageLabel.Text" xml:space="preserve">
|
||||
<value>Sprache</value>
|
||||
<data name="okButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>271, 13</value>
|
||||
<value>627, 26</value>
|
||||
</data>
|
||||
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 63</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="okButton.Text" xml:space="preserve">
|
||||
<value>&OK</value>
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>271, 52</value>
|
||||
<data name=">>okButton.Name" xml:space="preserve">
|
||||
<value>okButton</value>
|
||||
</data>
|
||||
<data name="cancelButton.Text" xml:space="preserve">
|
||||
<value>&Abbrechen</value>
|
||||
<data name=">>okButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="languageListBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>89, 13</value>
|
||||
<data name=">>okButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>okButton.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="orderComboBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>90, 31</value>
|
||||
</data>
|
||||
<data name="orderComboBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>376, 31</value>
|
||||
</data>
|
||||
<data name="orderComboBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>orderComboBox.Name" xml:space="preserve">
|
||||
<value>orderComboBox</value>
|
||||
</data>
|
||||
<data name=">>orderComboBox.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>orderComboBox.Parent" xml:space="preserve">
|
||||
<value>orderGroupBox</value>
|
||||
</data>
|
||||
<data name=">>orderComboBox.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="orderGroupBox.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="orderGroupBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>28, 12</value>
|
||||
</data>
|
||||
<data name="orderGroupBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>537, 82</value>
|
||||
</data>
|
||||
<data name="orderGroupBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="orderGroupBox.Text" xml:space="preserve">
|
||||
<value>Order</value>
|
||||
</data>
|
||||
<data name=">>orderGroupBox.Name" xml:space="preserve">
|
||||
<value>orderGroupBox</value>
|
||||
</data>
|
||||
<data name=">>orderGroupBox.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>orderGroupBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>orderGroupBox.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>801, 119</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Sprache wählen</value>
|
||||
<value>Batch data</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>CycleBeginningForm</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,305 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
partial class CycleEndForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.groupBox6.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.textBox2);
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox2.Location = new System.Drawing.Point(25, 104);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Wasserzähler 2";
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(18, 34);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(74, 23);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Stand:";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.textBox1);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox1.Location = new System.Drawing.Point(25, 14);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Wasserzähler 1";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox1.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(18, 34);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(74, 23);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Stand:";
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(425, 23);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 7;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox3.Location = new System.Drawing.Point(25, 194);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Wasserzähler 3";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox3.TabIndex = 1;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(18, 34);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(74, 23);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "Stand:";
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.textBox4);
|
||||
this.groupBox4.Controls.Add(this.label4);
|
||||
this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox4.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox4.Location = new System.Drawing.Point(25, 284);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox4.TabIndex = 4;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Wasserzähler 4";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox4.TabIndex = 1;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(18, 34);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(74, 23);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Stand:";
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.textBox5);
|
||||
this.groupBox5.Controls.Add(this.label5);
|
||||
this.groupBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox5.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox5.Location = new System.Drawing.Point(25, 374);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox5.TabIndex = 5;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Wasserzähler 5";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(18, 34);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(74, 23);
|
||||
this.label5.TabIndex = 0;
|
||||
this.label5.Text = "Stand:";
|
||||
//
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Controls.Add(this.textBox6);
|
||||
this.groupBox6.Controls.Add(this.label6);
|
||||
this.groupBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.groupBox6.ForeColor = System.Drawing.Color.Black;
|
||||
this.groupBox6.Location = new System.Drawing.Point(25, 464);
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.Size = new System.Drawing.Size(362, 81);
|
||||
this.groupBox6.TabIndex = 6;
|
||||
this.groupBox6.TabStop = false;
|
||||
this.groupBox6.Text = "Wasserzähler 6";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.Location = new System.Drawing.Point(183, 31);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(163, 31);
|
||||
this.textBox6.TabIndex = 1;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(18, 34);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(74, 23);
|
||||
this.label6.TabIndex = 0;
|
||||
this.label6.Text = "Stand:";
|
||||
//
|
||||
// CycleEndForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGoldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(559, 566);
|
||||
this.Controls.Add(this.groupBox6);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "CycleEndForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Daten";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleEndForm_Load);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.groupBox6.ResumeLayout(false);
|
||||
this.groupBox6.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.Label label6;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleEndForm));
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public string[] EndStateText;
|
||||
|
||||
// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleEndForm(int waterMetersCount)
|
||||
{
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
InitializeComponent();
|
||||
EndStateText = new string[WaterMetersCount];
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary> Parameterless constructor for 3 watermeters </summary>
|
||||
public CycleEndForm()
|
||||
: this(3)
|
||||
{
|
||||
}
|
||||
|
||||
private void CycleEndForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
Height = 50 + 90 * WaterMetersCount;
|
||||
|
||||
if (WaterMetersCount < 1) groupBox1.Visible = false;
|
||||
if (WaterMetersCount < 2) groupBox2.Visible = false;
|
||||
if (WaterMetersCount < 3) groupBox3.Visible = false;
|
||||
if (WaterMetersCount < 4) groupBox4.Visible = false;
|
||||
if (WaterMetersCount < 5) groupBox5.Visible = false;
|
||||
if (WaterMetersCount < 6) groupBox6.Visible = false;
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
groupBox1.Text = Strings.Water_Meter + " 1";
|
||||
groupBox2.Text = Strings.Water_Meter + " 2";
|
||||
groupBox3.Text = Strings.Water_Meter + " 3";
|
||||
groupBox4.Text = Strings.Water_Meter + " 4";
|
||||
groupBox5.Text = Strings.Water_Meter + " 5";
|
||||
groupBox6.Text = Strings.Water_Meter + " 6";
|
||||
label1.Text = Strings.State;
|
||||
label2.Text = Strings.State;
|
||||
label3.Text = Strings.State;
|
||||
label4.Text = Strings.State;
|
||||
label5.Text = Strings.State;
|
||||
label6.Text = Strings.State;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (WaterMetersCount >= 1) EndStateText[0] = textBox1.Text;
|
||||
if (WaterMetersCount >= 2) EndStateText[1] = textBox3.Text;
|
||||
if (WaterMetersCount >= 3) EndStateText[2] = textBox4.Text;
|
||||
if (WaterMetersCount >= 4) EndStateText[3] = textBox5.Text;
|
||||
if (WaterMetersCount >= 5) EndStateText[4] = textBox6.Text;
|
||||
if (WaterMetersCount >= 6) EndStateText[5] = textBox6.Text;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -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,233 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
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("DataEntry.Standard24({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin, End and WMStates form
|
||||
/// </summary>
|
||||
string purchaseOrder;
|
||||
public string PurchaseOrder { get { return purchaseOrder; } }
|
||||
|
||||
string[] serialNr;
|
||||
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
|
||||
|
||||
bool[] disabled;
|
||||
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
|
||||
|
||||
string[] wmCycleEndState;
|
||||
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
|
||||
|
||||
float[] wmStartState;
|
||||
public float WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
|
||||
|
||||
float[] wmEndState;
|
||||
public float WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
|
||||
|
||||
string[] wmStartStateStr;
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
|
||||
float refVolume;
|
||||
float errLimLo;
|
||||
float errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
ShowFormAtCycleBeginning,
|
||||
ShowFormAtCycleEnd,
|
||||
EnterTestStartStates,
|
||||
EnterTestEndStates,
|
||||
}
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
serialNr = new string[Program.WMsCount];
|
||||
disabled = new bool[Program.WMsCount];
|
||||
wmStartState = new float[Program.WMsCount];
|
||||
wmStartStateStr = new string[Program.WMsCount];
|
||||
wmEndState = new float[Program.WMsCount];
|
||||
wmCycleEndState = new string[Program.WMsCount];
|
||||
|
||||
entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> 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()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestStartStates;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestEndStates;
|
||||
this.refVolume = refVolume;
|
||||
this.errLimLo = errLimLo;
|
||||
this.errLimHi = errLimHi;
|
||||
return this;
|
||||
}
|
||||
|
||||
delegate void EntryFormDlgt(EntryForm myRef);
|
||||
///
|
||||
void OpenBeginningDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(Program.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(Program.WMsCount);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryForm myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
resultSaved = false;
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.ShowFormAtCycleBeginning:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
break;
|
||||
case CurrentOp.ShowFormAtCycleEnd:
|
||||
if (entryFormCfg.ShowCycleEndForm)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), 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)
|
||||
{
|
||||
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
|
||||
|
||||
if (dlg != null)
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
}
|
||||
}
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
}
|
||||
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
|
||||
{
|
||||
}
|
||||
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestEndStates)
|
||||
{
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates test results with the information collected in watermeters.
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<Entities.TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != Entities.MetersKind.Single) continue;
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public bool ShowCycleEndForm;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
Name = "DataEntry-iPerl";
|
||||
ParentName = string.Empty;
|
||||
ShowCycleEndForm = false;
|
||||
}
|
||||
|
||||
public EntryFormCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
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();
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form;
|
||||
}
|
||||
|
||||
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;
|
||||
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
showCycleEndFormCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
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.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
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.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(131, 57);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(32, 60);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(128, 32);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
this.classNameLabel.TabIndex = 3;
|
||||
this.classNameLabel.Text = "ComonentName";
|
||||
//
|
||||
// showCycleEndFormCheckBox
|
||||
//
|
||||
this.showCycleEndFormCheckBox.AutoSize = true;
|
||||
this.showCycleEndFormCheckBox.Enabled = false;
|
||||
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
|
||||
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
|
||||
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
|
||||
this.showCycleEndFormCheckBox.TabIndex = 13;
|
||||
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
|
||||
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// EntryFormCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.showCycleEndFormCheckBox);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "EntryFormCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 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 showCycleEndFormCheckBox;
|
||||
}
|
||||
}
|
||||
@@ -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,23 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
public class EntryFormFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-iPerl"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,649 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
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 bool[] disabled;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMStartState;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public readonly string[] WMStartStateStr;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public float[] WMEndState;
|
||||
|
||||
bool endStates; /// false=start states, true=end states
|
||||
float refVolume;
|
||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||
|
||||
int TextBoxesCount;
|
||||
///
|
||||
Label[] labels;
|
||||
TextBox[] startTextBoxes;
|
||||
TextBox[] endTextBoxes;
|
||||
IList<TextBox> enabledTextBoxes;
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializing common part for start and endstate form
|
||||
/// </summary>
|
||||
public TestStartEndForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TextBoxesCount = 24;
|
||||
|
||||
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,
|
||||
};
|
||||
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,
|
||||
};
|
||||
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,
|
||||
};
|
||||
enabledTextBoxes = new List<TextBox>();
|
||||
|
||||
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, bool[] disabled)
|
||||
: this()
|
||||
{
|
||||
endStates = false;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
this.disabled = disabled;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMStartState = new float[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, string[] wmStartStateStr, bool[] disabled,
|
||||
float refVolume, float errLimLo, float errLimHi)
|
||||
: this()
|
||||
{
|
||||
endStates = true;
|
||||
|
||||
this.WaterMetersCount = waterMetersCount;
|
||||
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;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMEndState = new float[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 (Program.WMsCount < TextBoxesCount)
|
||||
{
|
||||
int nrLines = Program.WMsCount / Program.LineSize;
|
||||
int gap = (TextBoxesCount - Program.WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < Program.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * Program.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * Program.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = Program.WMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (WMStartStateStr != null && i < WMStartStateStr.Length)
|
||||
{
|
||||
startTextBoxes[i].Text = WMStartStateStr[i];
|
||||
}
|
||||
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
endTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(endTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
startTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTextBoxes[i].Enabled = true;
|
||||
enabledTextBoxes.Add(startTextBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_Meter_States;
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = Strings.Water_Meter + " " + (i + 1).ToString();
|
||||
}
|
||||
startLabel.Text = Strings.Start;
|
||||
endLabel.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.ParseUFloat(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.ParseUFloat(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 endTextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { };
|
||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
float err = 0;
|
||||
try
|
||||
{
|
||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||
}
|
||||
|
||||
/// <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 (enabledTextBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledTextBoxes.Count; i++)
|
||||
{
|
||||
if (enabledTextBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus();
|
||||
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 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); }
|
||||
}
|
||||
}
|
||||
+1516
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>
|
||||
@@ -16,7 +16,7 @@ namespace TBF.BenchControl.Elde
|
||||
ResetShapesOfPulses = 8,
|
||||
}
|
||||
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || IPERLST || BADGER_VELKA_TRAT
|
||||
public enum StatusP : ulong
|
||||
{
|
||||
RefFlowMeterMask = 0x7,
|
||||
@@ -41,7 +41,7 @@ namespace TBF.BenchControl.Elde
|
||||
ErrorPressMeter3 = 0x4000000000000,
|
||||
ErrorPressMeter4 = 0x8000000000000,
|
||||
}
|
||||
#else // DN100 || MUNICH || FUZHOU150 || TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#else // DN100 || MUNICH || FUZHOU150 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
|
||||
public enum StatusP : ulong
|
||||
{
|
||||
RefFlowMeterMask = 0x7,
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace TBF.BenchControl.Elde
|
||||
public float RValvePosition(int rvNr1) { return controlCom.RValvePosition(rvNr1); }
|
||||
public float DivSamples(int ms) { return controlCom.DivSamples(ms); }
|
||||
public int ScopeSamples(int i, int j, int k) { return controlCom.ScopeSamples(i, j, k); }
|
||||
public uint DigitalInputs { get { return controlCom.DigitalInputs; } }
|
||||
public ulong DigitalInputs { get { return controlCom.DigitalInputs; } }
|
||||
public float AnalogInput(int adcNr0) { return controlCom.AnalogInput(adcNr0); }
|
||||
public uint AnalogInputRaw(int adcNr0, int bank) { return controlCom.AnalogInputRaw(adcNr0, bank); } /// adcNr0: 0=RV1, 1=RV2,... bank: 0=RV, 1=Temp
|
||||
public float ReferenceVolume { get { return controlCom.ReferenceVolume; } }
|
||||
@@ -73,6 +73,7 @@ namespace TBF.BenchControl.Elde
|
||||
private bool scheduleDiverterToTank;
|
||||
private bool scheduleDiverterToSink;
|
||||
private bool scheduleReadDiverterTransition;
|
||||
private bool pumpPowerChanged;
|
||||
///
|
||||
public void DiverterToTank(int flowmeterNr)
|
||||
{
|
||||
@@ -118,13 +119,12 @@ namespace TBF.BenchControl.Elde
|
||||
public float[,] TempCalibData = new float[8, 5];
|
||||
|
||||
// Array length is the reference flowmeters count plus one
|
||||
#if DN100
|
||||
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL
|
||||
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
|
||||
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || IPERLST || MURES_PT40 || BADGER_VELKA_TRAT
|
||||
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
|
||||
#elif FUZHOU150 || FUZHOU300 || PT200IL
|
||||
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
|
||||
#endif
|
||||
|
||||
public uint[] DiverterEdge = new uint[2] { 50, 50 };
|
||||
public uint[] BalanceRange = new uint[2];
|
||||
|
||||
@@ -151,19 +151,34 @@ namespace TBF.BenchControl.Elde
|
||||
/// <param name="power">Power (0.0f .. 100.0f)</param>
|
||||
public void SetFMFreq(int index, float power)
|
||||
{
|
||||
#if FUZHOU300 || PT200IL
|
||||
if ((FMFreq == null) || (FMFreq.Length != 6)) FMFreq = new float[6];
|
||||
#else
|
||||
if ((FMFreq == null) || (FMFreq.Length != 2)) FMFreq = new float[2];
|
||||
#if DN100 || MUNICH || FUZHOU150
|
||||
if ((FMFreq == null) || (FMFreq.Length != 2))
|
||||
{
|
||||
FMFreq = new float[2];
|
||||
pumpPowerChanged = true; /// Forces sending a command using Command.None
|
||||
}
|
||||
#else /// all newer benches
|
||||
if ((FMFreq == null) || (FMFreq.Length != 6))
|
||||
{
|
||||
FMFreq = new float[6];
|
||||
pumpPowerChanged = true; /// Forces sending a command using Command.None
|
||||
}
|
||||
#endif
|
||||
if (index >= 0 && index < FMFreq.Length) FMFreq[index] = power;
|
||||
log.DebugFormat("FMFreq=[{0}{1}{2}{3}{4}{5}]",
|
||||
FMFreq[0].ToString(),
|
||||
(FMFreq.Length > 1) ? ("," + FMFreq[1].ToString()) : "",
|
||||
(FMFreq.Length > 2) ? ("," + FMFreq[2].ToString()) : "",
|
||||
(FMFreq.Length > 3) ? ("," + FMFreq[3].ToString()) : "",
|
||||
(FMFreq.Length > 4) ? ("," + FMFreq[4].ToString()) : "",
|
||||
(FMFreq.Length > 5) ? ("," + FMFreq[5].ToString()) : "");
|
||||
|
||||
if (index >= 0 && index < FMFreq.Length && FMFreq[index] != power)
|
||||
{
|
||||
FMFreq[index] = power;
|
||||
|
||||
pumpPowerChanged = true; /// Forces sending a command using Command.None
|
||||
|
||||
log.DebugFormat("FMFreq=[{0}{1}{2}{3}{4}{5}]",
|
||||
FMFreq[0].ToString(),
|
||||
(FMFreq.Length > 1) ? ("," + FMFreq[1].ToString()) : "",
|
||||
(FMFreq.Length > 2) ? ("," + FMFreq[2].ToString()) : "",
|
||||
(FMFreq.Length > 3) ? ("," + FMFreq[3].ToString()) : "",
|
||||
(FMFreq.Length > 4) ? ("," + FMFreq[4].ToString()) : "",
|
||||
(FMFreq.Length > 5) ? ("," + FMFreq[5].ToString()) : "");
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateWeights()
|
||||
@@ -192,10 +207,10 @@ namespace TBF.BenchControl.Elde
|
||||
{
|
||||
controlBoardCfg = cfg;
|
||||
|
||||
#if FUZHOU300 || PT200IL
|
||||
FMFreq = new float[6] { 0, 0, 0, 0, 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300,PT200IL=6
|
||||
#else
|
||||
FMFreq = new float[2] { 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300=6
|
||||
#if DN100 || MUNICH || FUZHOU150
|
||||
FMFreq = new float[2] { 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300=6, newer=6
|
||||
#else /// all newer benches
|
||||
FMFreq = new float[6] { 0, 0, 0, 0, 0, 0 };
|
||||
#endif
|
||||
emergencyStop = false;
|
||||
previousEmergencyStop = false;
|
||||
@@ -227,14 +242,10 @@ namespace TBF.BenchControl.Elde
|
||||
ControlComponent3F300.UserControl1 ctrlBrdComponent,
|
||||
#elif PT200IL
|
||||
ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
|
||||
#elif TORINO50
|
||||
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
|
||||
#elif BADGER_MALA_TRAT
|
||||
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
|
||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#else /// all newer benches
|
||||
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
|
||||
#endif
|
||||
ulong valvesToInvert,
|
||||
ulong valvesToInvert,
|
||||
float[] tankCapacities)
|
||||
{
|
||||
this.valvesToInvert = valvesToInvert;
|
||||
@@ -255,6 +266,12 @@ namespace TBF.BenchControl.Elde
|
||||
/// <summary>Initialize this device</summary>
|
||||
public void Initialize()
|
||||
{
|
||||
DiverterEdge = new uint[BenchControl.Elde.Diverter.Diverter.DivertersCount];
|
||||
for (int i = 0; i < BenchControl.Elde.Diverter.Diverter.DivertersCount; i++)
|
||||
{
|
||||
DiverterEdge[i] = (uint)BenchControl.Elde.Diverter.Diverter.DiverterLevelsPct[i];
|
||||
}
|
||||
|
||||
controlCom.SendCalibData(RegValveCalib,
|
||||
MeretRS485Address,
|
||||
controlBoardCfg.ComPortNr,
|
||||
@@ -326,6 +343,13 @@ namespace TBF.BenchControl.Elde
|
||||
this.stopDevs = 0;
|
||||
scheduleReadDiverterTransition = false;
|
||||
}
|
||||
else if (pumpPowerChanged)
|
||||
{
|
||||
/// Reset all SendCommand() arguments
|
||||
sendCommandFlag = true;
|
||||
this.cmd = Command.None;
|
||||
pumpPowerChanged = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Reset all SendCommand() arguments
|
||||
@@ -468,9 +492,12 @@ namespace TBF.BenchControl.Elde
|
||||
/// <param name="readers">An array of register readers</param>
|
||||
/// <param name="refPulses">Number of reference pulses to complete the test</param>
|
||||
/// <returns>Created operation</returns>
|
||||
public IOperation StartMeasurementOp(IFlowMeter flowMeter, int refPulses, TestMethods method, float filterConstant)
|
||||
public IOperation StartMeasurementOp(OutputPath outputPath, TestMethods method,
|
||||
float requiredFlowLo, float requiredFlowHi,
|
||||
int refPulses, float filterConstant)
|
||||
{
|
||||
return new StartMeasurementOp(this, flowMeter, refPulses, method, filterConstant);
|
||||
return new StartMeasurementOp(this, outputPath, method,
|
||||
requiredFlowLo, requiredFlowHi, refPulses, filterConstant);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace TBF.BenchControl.Elde
|
||||
public float RValvePosition(int rvNr1) { return 0; }
|
||||
public float DivSamples(int ms) { return 0; }
|
||||
public int ScopeSamples(int i, int j, int k) { return 0; }
|
||||
public uint DigitalInputs { get { return 0; } }
|
||||
public ulong DigitalInputs { get { return 0; } }
|
||||
public float AnalogInput(int adcNr0) { return 0; }
|
||||
public uint AnalogInputRaw(int adcNr0, int bank) { return 0; } /// bank0=RV, bank1=Temp
|
||||
public float ReferenceVolume { get { return 0; } }
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace TBF.BenchControl.Elde
|
||||
/// Properties
|
||||
///
|
||||
public StatusP StatusP { get { return (StatusP)ctrlBrdComponent.StatusP; } }
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#if DN100 || MUNICH || FUZHOU150
|
||||
public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// In [Hz] 0..2500, nom.=2000
|
||||
#else /// all newer benches
|
||||
/// <summary>
|
||||
/// In case of I11, I12
|
||||
/// referenceFreq[0] = I11 + I12
|
||||
@@ -24,8 +26,6 @@ namespace TBF.BenchControl.Elde
|
||||
/// referenceFreq[0] = I2 or I3 or I4
|
||||
/// </summary>
|
||||
public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq[0]; } } /// In [Hz] 0..2500, nom.=2000
|
||||
#else
|
||||
public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// In [Hz] 0..2500, nom.=2000
|
||||
#endif
|
||||
public int EtPulses(int wmNr0) { return (int)ctrlBrdComponent.etPulses[wmNr0]; }
|
||||
public UInt16 WMeterPulses(int wmNr0) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr0]; }
|
||||
@@ -37,10 +37,10 @@ namespace TBF.BenchControl.Elde
|
||||
public ulong RRoute { get { return ctrlBrdComponent.rRoute; } }
|
||||
public uint DivTime { get { return ctrlBrdComponent.divTime; } }
|
||||
public float TTime { get { return ctrlBrdComponent.Ttime; } }
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#if DN100 || MUNICH || FUZHOU150
|
||||
public uint FmState { get { return ctrlBrdComponent.fMState; } }
|
||||
#else //if everything newer
|
||||
public uint FmState { get { return ctrlBrdComponent.fMState[0]; } } /// TODO: index
|
||||
#else
|
||||
public uint FmState { get { return ctrlBrdComponent.fMState; } }
|
||||
#endif
|
||||
public uint BeginState(int wmNr0) { return ctrlBrdComponent.beginSt[wmNr0]; }
|
||||
public float ReferenceFlow { get { return ctrlBrdComponent.referenceFlow; } }
|
||||
@@ -51,7 +51,7 @@ namespace TBF.BenchControl.Elde
|
||||
}
|
||||
public float DivSamples(int ms) { return ctrlBrdComponent.DIVSamples[ms, 0]; }
|
||||
public int ScopeSamples(int i, int j, int k) { return ctrlBrdComponent.ScopeSamples[i, j, k]; }
|
||||
public uint DigitalInputs { get { return ctrlBrdComponent.Vstupy; } }
|
||||
public ulong DigitalInputs { get { return (ulong)ctrlBrdComponent.Vstupy; } }
|
||||
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
|
||||
public uint AnalogInputRaw(int adcNr0, int bank) { return ctrlBrdComponent.AnalogyRaw[adcNr0, bank]; } /// bank0=RV, bank1=Temp
|
||||
public float ReferenceVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
|
||||
@@ -76,11 +76,7 @@ namespace TBF.BenchControl.Elde
|
||||
private ControlComponent3F300.UserControl1 ctrlBrdComponent;
|
||||
#elif PT200IL
|
||||
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
|
||||
#elif TORINO50
|
||||
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
|
||||
#elif BADGER_MALA_TRAT
|
||||
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
|
||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#else /// newer benches
|
||||
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
|
||||
#endif
|
||||
|
||||
@@ -98,14 +94,10 @@ namespace TBF.BenchControl.Elde
|
||||
public ControlComWrap(ControlComponent3F300.UserControl1 ctrlBrdComponent)
|
||||
#elif PT200IL
|
||||
public ControlComWrap(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
|
||||
#elif TORINO50
|
||||
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
|
||||
#elif BADGER_MALA_TRAT
|
||||
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
|
||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#else /// all newer benches
|
||||
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
|
||||
#endif
|
||||
{
|
||||
{
|
||||
this.ctrlBrdComponent = ctrlBrdComponent;
|
||||
}
|
||||
|
||||
@@ -198,10 +190,10 @@ namespace TBF.BenchControl.Elde
|
||||
// valveValue[0],
|
||||
// valveValue[1]));
|
||||
log.InfoFormat("ValveMove(#={0}, md={1}, [{2}, {3}])", valveNo, valveMode, valveValue[0], valveValue[1]);
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272
|
||||
#if DN100 || MUNICH || FUZHOU150
|
||||
ctrlBrdComponent.ValveMove((byte)valveNo, (byte)valveMode, valveValue);
|
||||
#else /// all newer benches
|
||||
ctrlBrdComponent.ValveMove((byte)valveNo, (byte)valveMode, valveValue, stableTime);
|
||||
#else
|
||||
ctrlBrdComponent.ValveMove((byte)valveNo, (byte)valveMode, valveValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,27 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Diverter));
|
||||
public override string ToString() { return string.Format("Diverter({0})", Cfg.ToString(1)); }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration of balances via static fields and methods
|
||||
/// </summary>
|
||||
static int nextIdx = 0;
|
||||
public static new void ResetStaticProperties()
|
||||
{
|
||||
nextIdx = 0;
|
||||
}
|
||||
public static int DivertersCount { get { return nextIdx; } }
|
||||
public static GenericDevices.IDiverter[] Diverters;
|
||||
public static int[] DiverterLevelsPct;
|
||||
///
|
||||
protected int diverterNr; /// 0-based balance number
|
||||
|
||||
|
||||
|
||||
readonly DiverterCfg diverterCfg;
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly ulong mask; /// derived from bitPosition in the constructor
|
||||
public int AdcNr { get { return diverterCfg.AdcNr; } }
|
||||
|
||||
public bool State
|
||||
{
|
||||
@@ -36,9 +54,27 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
if (cfg.BitPosition < 0 || cfg.BitPosition >= 64) throw new ArgumentOutOfRangeException("position");
|
||||
this.mask = (((ulong)1) << cfg.BitPosition);
|
||||
|
||||
/// Prepare data for SendCalibData() control board component method
|
||||
controlBoard.DiverterEdge[0] = (uint)diverterCfg.StartingLevel;
|
||||
controlBoard.DiverterEdge[1] = (uint)diverterCfg.StoppingLevel;
|
||||
|
||||
|
||||
diverterNr = nextIdx++;
|
||||
///
|
||||
if (Diverters == null || Diverters.Length < nextIdx)
|
||||
{
|
||||
GenericDevices.IDiverter[] divertersSoFar = Diverters;
|
||||
int[] levelsSoFar = DiverterLevelsPct;
|
||||
Diverters = new GenericDevices.IDiverter[nextIdx];
|
||||
DiverterLevelsPct = new int[nextIdx];
|
||||
if (divertersSoFar != null)
|
||||
{
|
||||
for (int i = 0; i < divertersSoFar.Length; i++)
|
||||
{
|
||||
Diverters[i] = divertersSoFar[i];
|
||||
DiverterLevelsPct[i] = levelsSoFar[i];
|
||||
}
|
||||
}
|
||||
Diverters[nextIdx - 1] = this;
|
||||
DiverterLevelsPct[nextIdx - 1] = diverterCfg.StartingLevel;
|
||||
}
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@@ -65,6 +65,18 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(RRProcedureParams prms)
|
||||
{
|
||||
prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
RRProcedureParams pars = new RRProcedureParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -77,7 +89,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
PulsesPerLtr = tmp.PulsesPerLtr;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -25,7 +25,9 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
|
||||
public float LtrPerPulseCorrected(float flow)
|
||||
{
|
||||
//return LtrPerPulse; /// TODO: apply correction
|
||||
if (flow < 0.1f * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||
|
||||
/// Apply correction
|
||||
float correctedFlow = BenchControl.Formulas.CorrectedValue(flow, Corrections);
|
||||
return LtrPerPulse * correctedFlow / flow;
|
||||
}
|
||||
|
||||
@@ -91,10 +91,10 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
message += Environment.NewLine + "'Idx1' should be between 1 and 7";
|
||||
}
|
||||
float fdummy;
|
||||
if (!Utils.TryParseUFloat(nominalFlowTextBox.Text, out fdummy) || fdummy < 0.2 || fdummy > 1600)
|
||||
if (!Utils.TryParseUFloat(nominalFlowTextBox.Text, out fdummy) || fdummy < 0.01 || fdummy > 1600)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Nominal flow' should be between 0.2 and 1600";
|
||||
message += Environment.NewLine + "'Nominal flow' should be between 0.01 and 1600";
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace TBF.BenchControl.Elde
|
||||
float RValvePosition(int rvNr1);
|
||||
float DivSamples(int ms);
|
||||
int ScopeSamples(int i, int j, int k);
|
||||
uint DigitalInputs { get; }
|
||||
ulong DigitalInputs { get; }
|
||||
float AnalogInput(int adcNr0);
|
||||
uint AnalogInputRaw(int adcNr0, int bank);
|
||||
float ReferenceVolume { get; }
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace TBF.BenchControl.Elde.Pump
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Bit Position' should be between 0 and 63";
|
||||
}
|
||||
if (!int.TryParse(delayTextBox.Text, out dummy) || dummy < 0 || dummy >= 300)
|
||||
if (!int.TryParse(delayTextBox.Text, out dummy) || dummy < 0 || dummy >= 300 || (dummy % StateMachine.Period) != 0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Delay' should be between 0 and 300s (5min)";
|
||||
|
||||
@@ -69,14 +69,14 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
|
||||
public void TurnOn(float powerArg)
|
||||
{
|
||||
log.DebugFormat("{0}.TurnOn({1})", Name, powerArg);
|
||||
log.InfoFormat("{0}.TurnOn({1})", Name, powerArg);
|
||||
this.power = powerArg;
|
||||
controlBoard.SetFMFreq(FMIndex, powerArg);
|
||||
}
|
||||
|
||||
public void TurnOff()
|
||||
{
|
||||
log.DebugFormat("{0}.TurnOff()", Name);
|
||||
log.InfoFormat("{0}.TurnOff()", Name);
|
||||
this.power = 0.0f;
|
||||
controlBoard.SetFMFreq(FMIndex, 0.0f);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'FM Index' should be between 0 and FMPumpsCount - 1";
|
||||
}
|
||||
if (!int.TryParse(delayTextBox.Text, out dummy) || dummy < 0 || dummy >= 300)
|
||||
if (!int.TryParse(delayTextBox.Text, out dummy) || dummy < 0 || dummy >= 300 || (dummy % StateMachine.Period) != 0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Delay' should be between 0 and 300s (5min)";
|
||||
|
||||
@@ -65,6 +65,18 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(RRProcedureParams prms)
|
||||
{
|
||||
prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
RRProcedureParams pars = new RRProcedureParams();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
||||
{
|
||||
if (dbEntity == null) return;
|
||||
@@ -77,7 +89,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
componentName = dbEntity.CmpntName;
|
||||
procedure = dbEntity.Procedure;
|
||||
|
||||
PulsesPerLtr = tmp.PulsesPerLtr;
|
||||
tmp.CopyContentTo(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -64,13 +64,13 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
{
|
||||
lastPulses = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 32768 - lastPulses) <= Int16.MaxValue)
|
||||
else if (Math.Abs(uncorrected + 65536 - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected + 32768;
|
||||
lastPulses = uncorrected + 65536;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 32768 - lastPulses) <= Int16.MaxValue)
|
||||
else if (Math.Abs(uncorrected - 65536 - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected - 32768;
|
||||
lastPulses = uncorrected - 65536;
|
||||
}
|
||||
}
|
||||
pulses.Val = lastPulses;
|
||||
|
||||
@@ -31,16 +31,24 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
|
||||
readonly float nominalFlow;
|
||||
|
||||
/// Process values
|
||||
///
|
||||
/// Internal states of this operation
|
||||
///
|
||||
enum OpState
|
||||
{
|
||||
Idle = 0,
|
||||
ValveMoveToPosition,
|
||||
ValveMoveToPosition1, /// Wait 1 takt
|
||||
ValveMoveToPosition2, /// This is actual move to position
|
||||
ValveMoveToPosition3, /// Wait 1 takt
|
||||
ValveMoveToPosition4, /// Verify
|
||||
SettingPosition,
|
||||
ValveMoveToFlow,
|
||||
ValveMoveToFlow2,
|
||||
ValveMoveToFlow1, /// Wait 1 takt
|
||||
ValveMoveToFlow2, /// This is actual move to flow
|
||||
ValveMoveToFlow3, /// Wait 1 takt
|
||||
ValveMoveToFlow4, /// Verify
|
||||
SettingFlow,
|
||||
FlowReached,
|
||||
SendCommandAgain,
|
||||
}
|
||||
OpState opState;
|
||||
|
||||
@@ -167,14 +175,14 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
log.InfoFormat("Start(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
|
||||
regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi, targetPositionLo, targetPositionHi);
|
||||
|
||||
opState = OpState.ValveMoveToPosition;
|
||||
opState = OpState.ValveMoveToPosition1;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.InfoFormat("Start(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
|
||||
regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi);
|
||||
|
||||
opState = OpState.ValveMoveToFlow;
|
||||
opState = OpState.ValveMoveToFlow1;
|
||||
}
|
||||
|
||||
expireTime = StateMachine.Time + timeout;
|
||||
@@ -202,52 +210,94 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
log.InfoFormat("Run(): rv#={0} pos={1}% freq={2} flow={3} opState={4}",
|
||||
regulValveNr, rvPosition.ToString("F1"), flowMtrFreq, flow, opState);
|
||||
|
||||
if (opState == OpState.ValveMoveToPosition)
|
||||
|
||||
if (opState == OpState.SendCommandAgain)
|
||||
{
|
||||
///
|
||||
/// Done once, issues an appropriate ValveMove(...) command
|
||||
///
|
||||
flowWithinBoundsTime = 0;
|
||||
|
||||
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi))
|
||||
{
|
||||
log.InfoFormat("Start(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
|
||||
regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi, targetPositionLo, targetPositionHi);
|
||||
|
||||
opState = OpState.ValveMoveToPosition1;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.InfoFormat("Start(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
|
||||
regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi);
|
||||
|
||||
opState = OpState.ValveMoveToFlow1;
|
||||
}
|
||||
|
||||
expireTime = StateMachine.Time + timeout;
|
||||
if (expireTime < 0) expireTime = int.MaxValue;
|
||||
|
||||
TestMethods tm = 0;
|
||||
StopDevs sd = 0;
|
||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route, int.MaxValue, tm,
|
||||
0.0f, (int)pidCoef, 0, sd);
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToPosition1)
|
||||
{
|
||||
opState = OpState.ValveMoveToPosition2;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToPosition2) /// Move to position
|
||||
{
|
||||
/// Issues the appropriate ValveMove(...) command
|
||||
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition,
|
||||
new float[2] { targetPositionLo, targetPositionHi },
|
||||
regulValve.StableTime);
|
||||
regulValve.StableTime);
|
||||
|
||||
opState = OpState.SettingPosition;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToPosition3)
|
||||
{
|
||||
opState = OpState.ValveMoveToPosition4;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToPosition4) /// Verify
|
||||
{
|
||||
if (((ulong)controlBoard.StatusP & (ulong)StatusP.RefPulsesMsrmnt) == 0)
|
||||
{
|
||||
opState = OpState.SendCommandAgain;
|
||||
return Event.None;
|
||||
}
|
||||
else if (controlBoard.RegulValveState(regulValveNr) != RegulValveState.DacValueRegul)
|
||||
{
|
||||
/// Repeat appropriate ValveMove(...) command
|
||||
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition,
|
||||
new float[2] { targetPositionLo, targetPositionHi },
|
||||
regulValve.StableTime);
|
||||
|
||||
opState = OpState.ValveMoveToPosition3;
|
||||
return Event.None;
|
||||
}
|
||||
else
|
||||
{
|
||||
opState = OpState.SettingPosition;
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
else if (opState == OpState.SettingPosition)
|
||||
{
|
||||
///
|
||||
/// Repeated untill position is reached
|
||||
///
|
||||
if ((targetPositionLo <= rvPosition) && (rvPosition <= targetPositionHi))
|
||||
{
|
||||
opState = OpState.ValveMoveToFlow;
|
||||
}
|
||||
return Event.None;
|
||||
if ((targetPositionLo <= rvPosition) && (rvPosition <= targetPositionHi))
|
||||
{
|
||||
opState = OpState.ValveMoveToFlow1;
|
||||
}
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToFlow)
|
||||
{
|
||||
///
|
||||
/// Done once, issues an appropriate ValveMove(...) command
|
||||
///
|
||||
if (reqFlowLo >= reqFlowHi || reqFlowLo > nominalFlow || reqFlowHi <= 0)
|
||||
{
|
||||
return Event.OpArgumentError;
|
||||
}
|
||||
|
||||
log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
|
||||
regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi);
|
||||
|
||||
float freqLo = 2000.0f * reqFlowLo / nominalFlow;
|
||||
float freqHi = 2000.0f * reqFlowHi / nominalFlow;
|
||||
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
|
||||
new float[2] { freqLo, freqHi },
|
||||
regulValve.StableTime);
|
||||
|
||||
else if (opState == OpState.ValveMoveToFlow1)
|
||||
{
|
||||
opState = OpState.ValveMoveToFlow2;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToFlow2)
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToFlow2) /// Move to flow
|
||||
{
|
||||
///
|
||||
/// Done once, issues an appropriate ValveMove(...) command
|
||||
@@ -266,9 +316,39 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
new float[2] { freqLo, freqHi },
|
||||
regulValve.StableTime);
|
||||
|
||||
opState = OpState.SettingFlow;
|
||||
opState = OpState.ValveMoveToFlow3;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToFlow3)
|
||||
{
|
||||
opState = OpState.ValveMoveToFlow4;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToFlow4)
|
||||
{
|
||||
if (((ulong)controlBoard.StatusP & (ulong)StatusP.RefPulsesMsrmnt) == 0)
|
||||
{
|
||||
opState = OpState.SendCommandAgain;
|
||||
return Event.None;
|
||||
}
|
||||
else if (controlBoard.RegulValveState(regulValveNr) != RegulValveState.PwOrFreqRegul)
|
||||
{
|
||||
/// Done once, issues an appropriate ValveMove(...) command
|
||||
float freqLo = 2000.0f * reqFlowLo / nominalFlow;
|
||||
float freqHi = 2000.0f * reqFlowHi / nominalFlow;
|
||||
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
|
||||
new float[2] { freqLo, freqHi },
|
||||
regulValve.StableTime);
|
||||
|
||||
opState = OpState.ValveMoveToFlow3;
|
||||
return Event.None;
|
||||
}
|
||||
else
|
||||
{
|
||||
opState = OpState.SettingFlow;
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
else if (opState == OpState.SettingFlow)
|
||||
{
|
||||
///
|
||||
@@ -276,33 +356,33 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
///
|
||||
if ((reqFlowLo <= flow) && (flow <= reqFlowHi))
|
||||
{
|
||||
if (flowWithinBoundsTime++ >= regulValve.FlowStableSec)
|
||||
{
|
||||
if (regulValve.RegulValveCfg.StoredPositionReuse)
|
||||
{
|
||||
float storedPosition;
|
||||
if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition))
|
||||
{
|
||||
/// update the stored valve position
|
||||
StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f);
|
||||
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position",
|
||||
regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// store the valve position
|
||||
StoreTargetPosition(reqFlowAve, rvPosition);
|
||||
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% <--- Storing a new position",
|
||||
regulValveNr, reqFlowAve, rvPosition.ToString("F1"));
|
||||
}
|
||||
}
|
||||
opState = OpState.FlowReached;
|
||||
return Event.FlowReached;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.None;
|
||||
}
|
||||
if (flowWithinBoundsTime++ >= regulValve.FlowStableSec)
|
||||
{
|
||||
if (regulValve.RegulValveCfg.StoredPositionReuse)
|
||||
{
|
||||
float storedPosition;
|
||||
if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition))
|
||||
{
|
||||
/// update the stored valve position
|
||||
StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f);
|
||||
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position",
|
||||
regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// store the valve position
|
||||
StoreTargetPosition(reqFlowAve, rvPosition);
|
||||
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% <--- Storing a new position",
|
||||
regulValveNr, reqFlowAve, rvPosition.ToString("F1"));
|
||||
}
|
||||
}
|
||||
opState = OpState.FlowReached;
|
||||
return Event.FlowReached;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
else if (StateMachine.Time > expireTime)
|
||||
{
|
||||
@@ -310,7 +390,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
}
|
||||
else
|
||||
{
|
||||
flowWithinBoundsTime = 0;
|
||||
flowWithinBoundsTime = 0;
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,44 +9,83 @@ namespace TBF.BenchControl.Elde
|
||||
public class StartMeasurementOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(StartMeasurementOp));
|
||||
public override string ToString() { return string.Format("StartMeasurementOp(ref={0},pulses={1})", flowMeterIdx, refPulses); }
|
||||
public override string ToString() { return string.Format("StartMeasurementOp(ref={0},pulses={1})", flowMeterNr, refPulses); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly int flowMeterIdx;
|
||||
readonly int refPulses; /// Number of reference pulses for a complete test
|
||||
readonly Elde.RegulValve.RegulValve regulValve;
|
||||
readonly int regulValveNr;
|
||||
readonly int flowMeterNr;
|
||||
readonly float nominalFlow;
|
||||
readonly float reqFlowLo;
|
||||
readonly float reqFlowHi;
|
||||
readonly float reqFlowAve;
|
||||
readonly float pidCoef;
|
||||
readonly int refPulses; /// Number of reference pulses for a complete test
|
||||
readonly TestMethods testMethod;
|
||||
readonly float filterConstant;
|
||||
readonly int diverterNr;
|
||||
|
||||
bool started = false;
|
||||
|
||||
///
|
||||
/// Internal states of this operation
|
||||
///
|
||||
enum OpState
|
||||
{
|
||||
StartingTest,
|
||||
TestStarted,
|
||||
ValveMoveToFlow,
|
||||
OpCompleted,
|
||||
}
|
||||
OpState opState;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Starts the measurement.
|
||||
/// Events: MeasurementStarted
|
||||
/// </summary>
|
||||
/// <param name="controlBoardDev">Control board component reference</param>
|
||||
/// <param name="flowMeter">Flow meter component reference</param>
|
||||
/// <param name="readers">Register readers references</param>
|
||||
/// <param name="volume">Water volume for the test in liters</param>
|
||||
public StartMeasurementOp(ControlBoardDev controlBoardDev, GenericDevices.IFlowMeter flowMeter,
|
||||
int refPulses, TestMethods method, float filterConstant)
|
||||
/// <param name="controlBoard">Control board component reference</param>
|
||||
/// <param name="outputPath">Specifies used components</param>
|
||||
/// <param name="method">Test method</param>
|
||||
/// <param name="refPulses">Test duration in number of reference flowmeter pulses</param>
|
||||
/// <param name="filterConstant">Specifies filter for watermeter pulses</param>
|
||||
public StartMeasurementOp(ControlBoardDev controlBoard, OutputPath outputPath, TestMethods method,
|
||||
float requiredFlowLo, float requiredFlowHi,
|
||||
int refPulses, float filterConstant)
|
||||
{
|
||||
if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev");
|
||||
this.controlBoard = controlBoardDev;
|
||||
if (controlBoard == null) throw new ArgumentNullException("controlBoardDev");
|
||||
this.controlBoard = controlBoard;
|
||||
|
||||
if (flowMeter is Elde.FlowMeter.FlowMeter)
|
||||
if (outputPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||
{
|
||||
flowMeterIdx = (flowMeter as Elde.FlowMeter.FlowMeter).Idx1;
|
||||
flowMeterNr = (outputPath.FlowMeter as Elde.FlowMeter.FlowMeter).Idx1;
|
||||
}
|
||||
else if (flowMeter is Elde.FlowMeterTwins.FlowMeter)
|
||||
else if (outputPath.FlowMeter is Elde.FlowMeterTwins.FlowMeter)
|
||||
{
|
||||
flowMeterIdx = 0;
|
||||
flowMeterNr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("flowMeter is null or is not Elde");
|
||||
}
|
||||
|
||||
regulValve = outputPath.RegulValve as Elde.RegulValve.RegulValve;
|
||||
if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde");
|
||||
regulValveNr = this.regulValve.Idx1;
|
||||
|
||||
if (outputPath.Diverter is Elde.Diverter.Diverter)
|
||||
{
|
||||
diverterNr = (outputPath.Diverter as Elde.Diverter.Diverter).AdcNr - 4;
|
||||
}
|
||||
|
||||
nominalFlow = outputPath.FlowMeter.NominalFlow;
|
||||
|
||||
this.reqFlowLo = requiredFlowLo;
|
||||
this.reqFlowHi = requiredFlowHi;
|
||||
this.reqFlowAve = (reqFlowLo + reqFlowHi) / 2.0f;
|
||||
this.pidCoef = outputPath.PidCoef;
|
||||
|
||||
this.refPulses = refPulses;
|
||||
this.testMethod = method;
|
||||
this.filterConstant = filterConstant;
|
||||
@@ -58,8 +97,16 @@ namespace TBF.BenchControl.Elde
|
||||
public void Start()
|
||||
{
|
||||
controlBoard.SyncRoute();
|
||||
controlBoard.SendCommand(Command.Start, flowMeterIdx, controlBoard.Route, refPulses, testMethod,
|
||||
#if IPERLST
|
||||
int flowMeterIdxAndDiv = flowMeterNr + 16 * diverterNr;
|
||||
#else
|
||||
int flowMeterIdxAndDiv = flowMeterNr;
|
||||
#endif
|
||||
|
||||
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route, refPulses, testMethod,
|
||||
filterConstant, 20, 0, StopDevs.None);
|
||||
|
||||
opState = OpState.StartingTest;
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
@@ -68,19 +115,50 @@ namespace TBF.BenchControl.Elde
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (started) return Event.MeasurementStarted;
|
||||
StatusP statusP = controlBoard.StatusP;
|
||||
log.DebugFormat("statusP = {0} {1} {2} {3}",
|
||||
(((ulong)statusP >> 48) & 0xFFFF).ToString("X4"),
|
||||
(((ulong)statusP >> 32) & 0xFFFF).ToString("X4"),
|
||||
(((ulong)statusP >> 16) & 0xFFFF).ToString("X4"),
|
||||
((ulong)statusP & 0xFFFF).ToString("X4"));
|
||||
if (0 != (statusP & StatusP.TestInProgress))
|
||||
{
|
||||
log.Info("Test started");
|
||||
started = true;
|
||||
return Event.MeasurementStarted;
|
||||
}
|
||||
if (opState == OpState.StartingTest)
|
||||
{
|
||||
StatusP statusP = controlBoard.StatusP;
|
||||
log.DebugFormat("statusP = {0} {1} {2} {3}",
|
||||
(((ulong)statusP >> 48) & 0xFFFF).ToString("X4"),
|
||||
(((ulong)statusP >> 32) & 0xFFFF).ToString("X4"),
|
||||
(((ulong)statusP >> 16) & 0xFFFF).ToString("X4"),
|
||||
((ulong)statusP & 0xFFFF).ToString("X4"));
|
||||
|
||||
if (0 != (statusP & StatusP.TestInProgress))
|
||||
{
|
||||
log.Info("Test started");
|
||||
opState = OpState.TestStarted;
|
||||
}
|
||||
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.TestStarted)
|
||||
{
|
||||
///
|
||||
/// Done once, issues an appropriate ValveMove(...) command
|
||||
///
|
||||
if (reqFlowLo >= reqFlowHi || reqFlowLo > nominalFlow || reqFlowHi <= 0)
|
||||
{
|
||||
return Event.OpArgumentError;
|
||||
}
|
||||
|
||||
log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
|
||||
regulValveNr, flowMeterNr, reqFlowLo, reqFlowHi);
|
||||
|
||||
float freqLo = 2000.0f * reqFlowLo / nominalFlow;
|
||||
float freqHi = 2000.0f * reqFlowHi / nominalFlow;
|
||||
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
|
||||
new float[2] { freqLo, freqHi },
|
||||
regulValve.StableTime);
|
||||
|
||||
opState = OpState.OpCompleted;
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.OpCompleted)
|
||||
{
|
||||
return Event.MeasurementStarted;
|
||||
}
|
||||
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,17 +149,17 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Bit Position' should be between 0 and 63";
|
||||
}
|
||||
if (!int.TryParse(openCloseTimeTextBox.Text, out dummy) || dummy < 0 || dummy > 300)
|
||||
if (!int.TryParse(openCloseTimeTextBox.Text, out dummy) || dummy < 0 || dummy > 300 || (dummy % StateMachine.Period) != 0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Open/close time' should be between 0 and 300 s";
|
||||
}
|
||||
if (!int.TryParse(lagOpeningTextBox.Text, out dummy))
|
||||
if (!int.TryParse(lagOpeningTextBox.Text, out dummy) || (dummy % StateMachine.Period) != 0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Delay when opening' error";
|
||||
}
|
||||
if (!int.TryParse(lagClosingTextBox.Text, out dummy))
|
||||
if (!int.TryParse(lagClosingTextBox.Text, out dummy) || (dummy % StateMachine.Period) != 0)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Delay when closing' error";
|
||||
|
||||
@@ -69,6 +69,13 @@ namespace TBF.BenchControl
|
||||
Stop,
|
||||
}
|
||||
|
||||
public enum CompoundTestType
|
||||
{
|
||||
Regular,
|
||||
DetectionRise,
|
||||
DetectionFall,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StateMachine events (issued by operations, IOperation derived classes)
|
||||
/// </summary>
|
||||
@@ -153,5 +160,6 @@ namespace TBF.BenchControl
|
||||
Next, /// To move to the next state when debugging
|
||||
OK,
|
||||
TimerBusy,
|
||||
SetOutputsDone,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,5 +46,11 @@ namespace TBF.BenchControl.Generic
|
||||
void UpdateParam(int ix, string strValue);
|
||||
|
||||
void UpdateDbEntity();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an object copy
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IParamsProvider Clone();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
/// <summary>
|
||||
/// Bench information interface
|
||||
/// </summary>
|
||||
public interface IBenchInfo : IComponent
|
||||
{
|
||||
string TestBenchId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IModbus : IComponent
|
||||
{
|
||||
void SendMessage(byte[] message);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// </summary>
|
||||
/// <param name="results">Results to print</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
IOperation PrintResultsOp(BenchControl.BenchId.Component benchId,
|
||||
IOperation PrintResultsOp(IBenchInfo benchInfo,
|
||||
IList<IWaterMeter> waterMeters,
|
||||
Entities.Procedure procedure,
|
||||
IList<Entities.TestResult> results,
|
||||
|
||||
@@ -13,6 +13,6 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// </summary>
|
||||
/// <param name="results">Results to write into a file</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
IOperation WriteResultsOp(Entities.Procedure procedure, IList<Entities.TestResult> results);
|
||||
IOperation WriteResultsOp(Entities.Procedure procedure, IList<IWaterMeter> waterMeters, IList<Entities.TestResult> results);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user