This commit is contained in:
Roland Drabesch 2025-03-12 10:23:28 +01:00
parent 6351a5f1f6
commit 48abf20ba9
28 changed files with 2116 additions and 890 deletions

View File

@ -890,376 +890,391 @@ namespace CordonelAssemblyLine.Model
var converter = new System.Windows.Media.BrushConverter();
while (!token.IsCancellationRequested && !_closeTask)
{
switch (_state)
try
{
case PickingStateMachine.Init:
SetState("Initialisierung");
Slot = $"Inaktiv EP {_slotNr}";
Scanner = $"Geschlossen {_scannerPort}";
//CheckAllPorts?
switch (_state)
{
case PickingStateMachine.Init:
SetState("Initialisierung");
Slot = $"Inaktiv EP {_slotNr}";
Scanner = $"Geschlossen {_scannerPort}";
//CheckAllPorts?
_state = PickingStateMachine.StartCom;
InitProgressBar();
break;
case PickingStateMachine.StartCom:
_orderDetails = null;
_orderOverview = null;
Scanner = $"Öfffne {_scannerPort}";
//CheckAllPorts?
_barScanner = new BarScanner(_scannerPort, token);
_barScanner.Start();
_state = PickingStateMachine.WaitForScanning;
var c = (System.Windows.Media.Brush)converter.ConvertFromString("Aquamarine");
c.Freeze();
ResultColor = c;
lblS01Text = "-";
lblS02Text = "-";
lblS03Text = "-";
lblS04Text = "-";
lblS05Text = "-";
lblS06Text = "-";
lblS07Text = "-";
lblS08Text = "-";
lblS09Text = "-";
lblS10Text = "-";
lblS11Text = "-";
lblS01Color = _progressWaiting;
lblS02Color = _progressWaiting;
lblS03Color = _progressWaiting;
lblS04Color = _progressWaiting;
lblS05Color = _progressWaiting;
lblS06Color = _progressWaiting;
lblS07Color = _progressWaiting;
lblS08Color = _progressWaiting;
lblS09Color = _progressWaiting;
lblS10Color = _progressWaiting;
lblS11Color = _progressWaiting;
break;
case PickingStateMachine.WaitForScanning:
Scanner = $"Offen {_scannerPort}";
if (State != $"Warte auf Scannereingabe({_scannerPort})")
{
SetState($"Warte auf Scannereingabe({_scannerPort})");
}
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
if (_barScanner.Input == "%Cordonel_SAP_100%" || _barScanner.Input == "%Cordonel_SAP_101%")
{
_state = PickingStateMachine.JustSapProgress;
}
else
{
if (int.TryParse(_barScanner.Input, out _))
{
_order = _barScanner.Input;
Scanner = $"Geschlossen {_scannerPort}";
_barScanner = null;
_state = PickingStateMachine.WaitForDetect;
lblS01Text = _order;
lblS01Color = _progressDone;
lblS02Color = _progressWaiting;
}
}
}
break;
case PickingStateMachine.JustSapProgress:
using (var batch = new MeterBatch())
{
using (var tryMeter = new GenesisMeter())
{
try
{
SetState("Warte auf Pcb");
Slot = $"Öffne EP {_slotNr}";
tryMeter.SetupFromConfigFile(_slotNr);
batch.AddMeter(tryMeter);
tryMeter.Logout();
Log("Try to get PcbID");
_pcbId = tryMeter.GetPcbId();
var hasDetect = !string.IsNullOrEmpty(_pcbId);
if (hasDetect)
{
SetState($"Pcb gefunden {_pcbId}");
Log($"New PcbID detected {_pcbId}");
//barScanner.Input = "%Cordonel_SAP_100%";
_state = PickingStateMachine.WaitForBuildingMeterReady;
}
else
{
Slot = $"Keine Konnektivität EP {_slotNr}";
lblS02Text = Slot;
Log($"No Meter found");
}
}
catch (Exception e)
{
Log($"Error occur.{ Environment.NewLine} {e.Message}");
}
}
}
break;
case PickingStateMachine.WaitForDetect:
using (var batch = new MeterBatch())
{
using (var tryMeter = new GenesisMeter())
{
try
{
SetState("Warte auf Pcb");
Slot = $"Öffne EP {_slotNr}";
tryMeter.SetupFromConfigFile(_slotNr);
batch.AddMeter(tryMeter);
tryMeter.Logout();
Log("Try to get PcbID");
_pcbId = tryMeter.GetPcbId();
var hasDetect = !string.IsNullOrEmpty(_pcbId);
if (hasDetect)
{
SetState($"Pcb gefunden {_pcbId}");
Log($"New PcbID detected {_pcbId}");
_state = PickingStateMachine.GetOrderDetails;
lblS02Text = _pcbId;
lblS02Color = _progressDone;
lblS03Color = _progressWaiting;
}
else
{
Slot = $"Keine Konnektivität EP {_slotNr}";
lblS02Text = Slot;
Log($"No Meter found");
}
}
catch (Exception e)
{
Log($"Error occur.{ Environment.NewLine} {e.Message}");
}
}
}
break;
case PickingStateMachine.GetOrderDetails:
SetState($"Lade Auftragsdaten {_order}");
var str = LocalWebRequest.GetRequestWithError($"{ServiceUrls.GenesisFinalCheckServiceUrl()}" +
$"GetOrderOverview?ProductionOrderNumber={_order}" +
$"&CheckPcbId={_pcbId}", out var retCode, 35000);
if (str.Contains("The request is invalid"))
{
Result = "Auftrag nicht gefunden";
lblS03Text = Result;
lblS03Color = _progressError;
_state = PickingStateMachine.MeterError;
_state = PickingStateMachine.StartCom;
InitProgressBar();
break;
}
if (retCode == 417)
{
_state = PickingStateMachine.MeterError;
Result = "Keine Funkparameter";
lblS03Text = Result;
UpdateLogText(Result);
lblS03Color = _progressError;
}
else
{
_orderOverview = JsonConvert.DeserializeObject<OrderOverViewCordonelWithPicking>(str);
_orderDetails = _orderOverview.PickingCompareItem;
if (_orderOverview.OrderOverViewCordonel.Count == _orderOverview.OrderOverViewCordonel.AssignedPicking)
case PickingStateMachine.StartCom:
_orderDetails = null;
_orderOverview = null;
Scanner = $"Öfffne {_scannerPort}";
//CheckAllPorts?
_barScanner = new BarScanner(_scannerPort, token);
_barScanner.Start();
_state = PickingStateMachine.WaitForScanning;
var c = (System.Windows.Media.Brush)converter.ConvertFromString("Aquamarine");
c.Freeze();
ResultColor = c;
lblS01Text = "-";
lblS02Text = "-";
lblS03Text = "-";
lblS04Text = "-";
lblS05Text = "-";
lblS06Text = "-";
lblS07Text = "-";
lblS08Text = "-";
lblS09Text = "-";
lblS10Text = "-";
lblS11Text = "-";
lblS01Color = _progressWaiting;
lblS02Color = _progressWaiting;
lblS03Color = _progressWaiting;
lblS04Color = _progressWaiting;
lblS05Color = _progressWaiting;
lblS06Color = _progressWaiting;
lblS07Color = _progressWaiting;
lblS08Color = _progressWaiting;
lblS09Color = _progressWaiting;
lblS10Color = _progressWaiting;
lblS11Color = _progressWaiting;
break;
case PickingStateMachine.WaitForScanning:
Scanner = $"Offen {_scannerPort}";
if (State != $"Warte auf Scannereingabe({_scannerPort})")
{
Result = "Auftrag schon komplett";
lblS03Text = Result;
lblS03Color = _progressError;
UpdateLogText(Result);
_state = PickingStateMachine.MeterError;
SetState($"Warte auf Scannereingabe({_scannerPort})");
}
else
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
SetState($"Auftragsdaten geladen {_order}");
var url = ServiceUrls.MeterProcessStateUrl();
url += $"GetCordonelSkipProcessStates?OrderNumber={_order}&PcbId={_pcbId}";
var retStr = LocalWebRequest.GetRequestWithError(url, out var tmp);
_skipProcessSteps = new SkipProcess();
if (tmp == 200)
if (_barScanner.Input == "%Cordonel_SAP_100%" || _barScanner.Input == "%Cordonel_SAP_101%")
{
_skipProcessSteps = JsonConvert.DeserializeObject<SkipProcess>(retStr);
}
_state = PickingStateMachine.Compare;
lblS03Text = $"Nr {_orderOverview.OrderOverViewCordonel.AssignedPicking + 1 } von {_orderOverview.OrderOverViewCordonel.Count}";
lblS03Color = _progressDone;
lblS04Color = _progressCurrent;
}
}
break;
case PickingStateMachine.Compare:
//Compare
SetState($"Vergleiche Auftragsdaten {_order} mit Pcb Eigenschaften");
var minDate = DateTime.Now;
lblS09Color = _progressCurrent;
////Rule from J.Schulz, 9 months for customers with immediately usage here temporary decided on order volume
////minDate = minDate.AddMonths(_orderOverview.OrderOverViewCordonel.Count < 5 ? -9 : -3);
//// The production date has to be at least within the last 3 months from now backwards
//minDate = minDate.AddMonths(-3);
//SetState($"Register wurde am {_orderOverview.KitronProductionDate } hergestellt, für diesen Auftrag " +
// $"muss das Register nach dem {minDate} hergestellt worden sein");
//lblS09Text = $"{_orderOverview.KitronProductionDate}";
////TODO may be useful to introduce SkipRegisterOldness instead of SkipBatteyCheck will be used for oldness of register
//if (_skipProcessSteps == null || !_skipProcessSteps.SkipBatteyCheck)
//{
// if (_orderOverview.KitronProductionDate <= minDate)
// {
// SetState($"Fehlgeschlagen Register ist zu alt! Bitte QS informieren. Kitron-Produktionsdatum: {_orderOverview.KitronProductionDate }");
// _state = PickingStateMachine.MeterError;
// lblS09Color = _progressError;
// var b = (System.Windows.Media.Brush)converter.ConvertFromString("#FFFF00");
// b.Freeze();
// ResultColor = b;
// break;
// }
//}
//else
//{
// SetState($"Produktionsdatum wird nicht überprüft Sonderfreigabe Nr.:{_skipProcessSteps.Id} von {_skipProcessSteps.Name}");
//}
lblS09Color = _progressDone;
if (Compare(_orderDetails.CheckAppsIdVersion, _orderDetails.FrequencyIndicator, _orderDetails.MeterSize, _orderDetails.PressurePresent))
{
_state = PickingStateMachine.MeterDone;
}
else
{
_state = PickingStateMachine.MeterError;
var b = (System.Windows.Media.Brush)converter.ConvertFromString("#FF8000");
b.Freeze();
ResultColor = b;
}
break;
case PickingStateMachine.MeterError:
_orderDetails = null;
_orderOverview = null;
SetState($"Vergleich abgeschlossen:{State}");
Result = "Vergleich fehlgeschlagen";
Thread.Sleep(10000);
_state = PickingStateMachine.StartCom;
break;
case PickingStateMachine.MeterDone:
SetState("Vergleich abgeschlossen, warte auf manuelle Montagerückmeldung");
Result = $"Pcb {_pcbId} wurde dem Auftrag {_order} hinzugefügt";
Scanner = $"Öffne {_scannerPort}";
_barScanner = new BarScanner(_scannerPort, token);
HistoryText = $"{HistoryText} {Environment.NewLine}{_order}({_orderOverview.OrderOverViewCordonel.AssignedPicking + 1 }/{ _orderOverview.OrderOverViewCordonel.Count})";
_barScanner.Start();
_state = PickingStateMachine.WaitForBuildingMeterReady;
Thread.Sleep(10000);
//CheckAllPorts?
ProgressBar.First(n => n.Name == "Scan Build").State = Ui.ProductionControls.Enums.ImgStatus.InProgress;
break;
case PickingStateMachine.WaitForBuildingMeterReady:
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
if (_barScanner.Input == "%Cordonel_SAP_100%")
{
_barScanner = null;
ProgressBar.First(n => n.Name == "Scan Build").State = Ui.ProductionControls.Enums.ImgStatus.Success;
var url = ServiceUrls.MeterProcessStateUrl();
url += $"setSapState?PcbID={_pcbId}&code=100&version=1";
try
{
LocalWebRequest.PostRequestAsync(url);
}
catch (Exception)
{
// ignored
}
if (_orderDetails != null && _orderDetails.PressurePresent)
{
_barScanner = new BarScanner(_scannerPort, token);
_barScanner.Start();
SetState("Montage Rückmeldung erhalten, Montage des Drucksensors bestätigen");
_state = PickingStateMachine.WaitForBuildingPressureReady;
ProgressBar.First(n => n.Name == "Scan Build Pressure").State = Ui.ProductionControls.Enums.ImgStatus.InProgress;
_state = PickingStateMachine.JustSapProgress;
}
else
{
SetState("Montage Rückmeldung erhalten, Auftrag Scannen");
_state = PickingStateMachine.StartCom;
Thread.Sleep(5000);
if (int.TryParse(_barScanner.Input, out _))
{
_order = _barScanner.Input;
Scanner = $"Geschlossen {_scannerPort}";
_barScanner = null;
_state = PickingStateMachine.WaitForDetect;
lblS01Text = _order;
lblS01Color = _progressDone;
lblS02Color = _progressWaiting;
}
}
}
break;
case PickingStateMachine.JustSapProgress:
using (var batch = new MeterBatch())
{
using (var tryMeter = new GenesisMeter())
{
try
{
SetState("Warte auf Pcb");
Slot = $"Öffne EP {_slotNr}";
tryMeter.SetupFromConfigFile(_slotNr);
batch.AddMeter(tryMeter);
tryMeter.Logout();
Log("Try to get PcbID");
_pcbId = tryMeter.GetPcbId();
var hasDetect = !string.IsNullOrEmpty(_pcbId);
if (hasDetect)
{
SetState($"Pcb gefunden {_pcbId}");
Log($"New PcbID detected {_pcbId}");
//barScanner.Input = "%Cordonel_SAP_100%";
_state = PickingStateMachine.WaitForBuildingMeterReady;
}
else
{
Slot = $"Keine Konnektivität EP {_slotNr}";
lblS02Text = Slot;
Log($"No Meter found");
}
}
catch (Exception e)
{
Log($"Error occur.{ Environment.NewLine} {e.Message}");
}
}
}
break;
case PickingStateMachine.WaitForDetect:
using (var batch = new MeterBatch())
{
using (var tryMeter = new GenesisMeter())
{
try
{
SetState("Warte auf Pcb");
Slot = $"Öffne EP {_slotNr}";
tryMeter.SetupFromConfigFile(_slotNr);
batch.AddMeter(tryMeter);
tryMeter.Logout();
Log("Try to get PcbID");
_pcbId = tryMeter.GetPcbId();
var hasDetect = !string.IsNullOrEmpty(_pcbId);
if (hasDetect)
{
SetState($"Pcb gefunden {_pcbId}");
Log($"New PcbID detected {_pcbId}");
_state = PickingStateMachine.GetOrderDetails;
lblS02Text = _pcbId;
lblS02Color = _progressDone;
lblS03Color = _progressWaiting;
}
else
{
Slot = $"Keine Konnektivität EP {_slotNr}";
lblS02Text = Slot;
Log($"No Meter found");
}
}
catch (Exception e)
{
Log($"Error occur.{ Environment.NewLine} {e.Message}");
}
}
}
break;
case PickingStateMachine.GetOrderDetails:
SetState($"Lade Auftragsdaten {_order}");
var str = LocalWebRequest.GetRequestWithError($"{ServiceUrls.GenesisFinalCheckServiceUrl()}" +
$"GetOrderOverview?ProductionOrderNumber={_order}" +
$"&CheckPcbId={_pcbId}", out var retCode, 50000);
Log($"GetOrderOverview {retCode}");
if (str.Contains("The request is invalid"))
{
Result = "Auftrag nicht gefunden";
lblS03Text = Result;
lblS03Color = _progressError;
_state = PickingStateMachine.MeterError;
break;
}
if (retCode == 417)
{
_state = PickingStateMachine.MeterError;
Result = "Keine Funkparameter";
lblS03Text = Result;
UpdateLogText(Result);
lblS03Color = _progressError;
}
else
{
_orderOverview = JsonConvert.DeserializeObject<OrderOverViewCordonelWithPicking>(str);
_orderDetails = _orderOverview.PickingCompareItem;
if (_orderOverview.OrderOverViewCordonel.Count == _orderOverview.OrderOverViewCordonel.AssignedPicking)
{
Result = "Auftrag schon komplett";
lblS03Text = Result;
lblS03Color = _progressError;
UpdateLogText(Result);
_state = PickingStateMachine.MeterError;
}
else
{
SetState($"Auftragsdaten geladen {_order}");
var url = ServiceUrls.MeterProcessStateUrl();
url += $"GetCordonelSkipProcessStates?OrderNumber={_order}&PcbId={_pcbId}";
var retStr = LocalWebRequest.GetRequestWithError(url, out var tmp, 10000);
_skipProcessSteps = new SkipProcess();
if (tmp == 200)
{
_skipProcessSteps = JsonConvert.DeserializeObject<SkipProcess>(retStr);
}
else
{
MessageBox.Show($"Auftragsdaten geladen {_order} Fehler ({tmp})");
}
_state = PickingStateMachine.Compare;
lblS03Text = $"Nr {_orderOverview.OrderOverViewCordonel.AssignedPicking + 1 } von {_orderOverview.OrderOverViewCordonel.Count}";
lblS03Color = _progressDone;
lblS04Color = _progressCurrent;
}
}
break;
case PickingStateMachine.Compare:
//Compare
SetState($"Vergleiche Auftragsdaten {_order} mit Pcb Eigenschaften");
var minDate = DateTime.Now;
lblS09Color = _progressCurrent;
////Rule from J.Schulz, 9 months for customers with immediately usage here temporary decided on order volume
////minDate = minDate.AddMonths(_orderOverview.OrderOverViewCordonel.Count < 5 ? -9 : -3);
//// The production date has to be at least within the last 3 months from now backwards
//minDate = minDate.AddMonths(-3);
//SetState($"Register wurde am {_orderOverview.KitronProductionDate } hergestellt, für diesen Auftrag " +
// $"muss das Register nach dem {minDate} hergestellt worden sein");
//lblS09Text = $"{_orderOverview.KitronProductionDate}";
////TODO may be useful to introduce SkipRegisterOldness instead of SkipBatteyCheck will be used for oldness of register
//if (_skipProcessSteps == null || !_skipProcessSteps.SkipBatteyCheck)
//{
// if (_orderOverview.KitronProductionDate <= minDate)
// {
// SetState($"Fehlgeschlagen Register ist zu alt! Bitte QS informieren. Kitron-Produktionsdatum: {_orderOverview.KitronProductionDate }");
// _state = PickingStateMachine.MeterError;
// lblS09Color = _progressError;
// var b = (System.Windows.Media.Brush)converter.ConvertFromString("#FFFF00");
// b.Freeze();
// ResultColor = b;
// break;
// }
//}
//else
//{
// SetState($"Produktionsdatum wird nicht überprüft Sonderfreigabe Nr.:{_skipProcessSteps.Id} von {_skipProcessSteps.Name}");
//}
lblS09Color = _progressDone;
if (Compare(_orderDetails.CheckAppsIdVersion, _orderDetails.FrequencyIndicator, _orderDetails.MeterSize, _orderDetails.PressurePresent))
{
_state = PickingStateMachine.MeterDone;
}
else
{
_state = PickingStateMachine.MeterError;
var b = (System.Windows.Media.Brush)converter.ConvertFromString("#FF8000");
b.Freeze();
ResultColor = b;
}
break;
case PickingStateMachine.MeterError:
_orderDetails = null;
_orderOverview = null;
SetState($"Vergleich abgeschlossen:{State}");
Result = "Vergleich fehlgeschlagen";
Thread.Sleep(10000);
_state = PickingStateMachine.StartCom;
break;
case PickingStateMachine.MeterDone:
SetState("Vergleich abgeschlossen, warte auf manuelle Montagerückmeldung");
Result = $"Pcb {_pcbId} wurde dem Auftrag {_order} hinzugefügt";
Scanner = $"Öffne {_scannerPort}";
_barScanner = new BarScanner(_scannerPort, token);
HistoryText = $"{HistoryText} {Environment.NewLine}{_order}({_orderOverview.OrderOverViewCordonel.AssignedPicking + 1 }/{ _orderOverview.OrderOverViewCordonel.Count})";
_barScanner.Start();
_state = PickingStateMachine.WaitForBuildingMeterReady;
Thread.Sleep(10000);
//CheckAllPorts?
ProgressBar.First(n => n.Name == "Scan Build").State = Ui.ProductionControls.Enums.ImgStatus.InProgress;
break;
case PickingStateMachine.WaitForBuildingMeterReady:
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
if (_barScanner.Input == "%Cordonel_SAP_100%")
{
_barScanner = null;
ProgressBar.First(n => n.Name == "Scan Build").State = Ui.ProductionControls.Enums.ImgStatus.Success;
var url = ServiceUrls.MeterProcessStateUrl();
url += $"setSapState?PcbID={_pcbId}&code=100&version=1";
try
{
LocalWebRequest.PostRequestAsync(url);
}
catch (Exception)
{
// ignored
}
if (_orderDetails != null && _orderDetails.PressurePresent)
{
_barScanner = new BarScanner(_scannerPort, token);
_barScanner.Start();
SetState("Montage Rückmeldung erhalten, Montage des Drucksensors bestätigen");
_state = PickingStateMachine.WaitForBuildingPressureReady;
ProgressBar.First(n => n.Name == "Scan Build Pressure").State = Ui.ProductionControls.Enums.ImgStatus.InProgress;
}
else
{
SetState("Montage Rückmeldung erhalten, Auftrag Scannen");
_state = PickingStateMachine.StartCom;
Thread.Sleep(5000);
var b = (System.Windows.Media.Brush)converter.ConvertFromString("#419C14");
b.Freeze();
ResultColor = b;
}
}
}
break;
case PickingStateMachine.WaitForBuildingPressureReady:
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
if (_barScanner.Input == "%Cordonel_SAP_101%")
{
_barScanner = null;
var url = ServiceUrls.MeterProcessStateUrl();
url += $"setSapState?PcbID={_pcbId}&code=101&version=1";
try
{
LocalWebRequest.PostRequestAsync(url);
}
catch (Exception)
{
// ignored
}
var b = (System.Windows.Media.Brush)converter.ConvertFromString("#419C14");
b.Freeze();
ResultColor = b;
Thread.Sleep(5000);
SetState("Montage Rückmeldung erhalten, Auftrag Scannen");
_state = PickingStateMachine.StartCom;
}
}
}
break;
case PickingStateMachine.WaitForBuildingPressureReady:
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
if (_barScanner.Input == "%Cordonel_SAP_101%")
{
_barScanner = null;
var url = ServiceUrls.MeterProcessStateUrl();
url += $"setSapState?PcbID={_pcbId}&code=101&version=1";
try
{
LocalWebRequest.PostRequestAsync(url);
}
catch (Exception)
{
// ignored
}
var b = (System.Windows.Media.Brush)converter.ConvertFromString("#419C14");
b.Freeze();
ResultColor = b;
Thread.Sleep(5000);
SetState("Montage Rückmeldung erhalten, Auftrag Scannen");
_state = PickingStateMachine.StartCom;
}
}
break;
break;
}
Thread.Sleep(1000);
}
Thread.Sleep(1000);
catch (Exception ex)
{
Log(ex.Message);
}
}
}
@ -1268,7 +1283,7 @@ namespace CordonelAssemblyLine.Model
// ReSharper disable once UnusedParameter.Local
private void Log(String v)
{
//throw new NotImplementedException();
}
}

View File

@ -125,9 +125,7 @@
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>

View File

@ -172,9 +172,9 @@ namespace CordonelPreadjustmentUi.Processes.Actions
{
pp.DebugMessage($"{ProcessName} procedure successful", meterctl.Slot, "APP", meterctl.Meter.PcbId);
if (pp.IsAutomaticMode)
if (!pp.IsAutomaticMode)
{
//meterctl.Meter.SetProcessState(Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts.DisplayCodes.ZeroFlow);
meterctl.Meter.SetProcessState(Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts.DisplayCodes.ZeroFlow);
}
}

View File

@ -257,7 +257,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
RegValue = Register.Genesisflow.ZeroOffset3;
break;
default:
RegValue = Register.Genesisflow.ZeroOffset1;
System.Windows.Forms.MessageBox.Show($"Path number incorrect {Path}");
break;
};
if (pp.Setting.NumberOfPaths != 1)

View File

@ -14064,7 +14064,7 @@
"id": 16,
"version": {
"first": 100,
"last": 541
"last": 545
},
"registers": {
"TxInterval": {
@ -14085,7 +14085,7 @@
"description": "The SensusRF transmission interval in seconds for the BUPs",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 15,
@ -14114,7 +14114,7 @@
"description": "The Open Metering transmission interval in seconds",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 3600,
@ -14143,7 +14143,7 @@
"description": "The Listen After Talk interval as number 'n'. After every 'n' BUPs follows a BUP-LAT",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 3,
@ -14172,7 +14172,7 @@
"description": "The Wake Up interval in seconds 's'. Every 's' seconds will the meter sniff for a WakeUp tone. 's' == 0 means active sending and no sniffing",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 3,
@ -14201,7 +14201,7 @@
"description": "The internal MBus state (Open Metering). A bit oriented value. Do not write if you do not know details",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 7,
@ -14230,7 +14230,7 @@
"description": "A number that shows the radio frequency used. Normally 433 or 868",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 433,
@ -14259,7 +14259,7 @@
"description": "A radio frequency calibration parameter",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14288,7 +14288,7 @@
"description": "A parameter for controling the radio power",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14317,7 +14317,7 @@
"description": "The internal System State of the Radio",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 1,
@ -14346,7 +14346,7 @@
"description": "The radio address used by the meter",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14375,7 +14375,7 @@
"description": "The offset the between meter time and UTC for time correction",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14404,7 +14404,7 @@
"description": "The number of bytes sent during meter lifetime",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14433,7 +14433,7 @@
"description": "The number of bytes received during meter lifetime",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14462,7 +14462,7 @@
"description": "The number of resets the application SensusRfRadio has performed over lifetime",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14491,7 +14491,7 @@
"description": "An internal temporary state (enum) regarding the firmwware update",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14520,7 +14520,7 @@
"description": "The flow value of the leakage (low flow) detection",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 25,
@ -14549,7 +14549,7 @@
"description": "The time in minutes of the leakage (low flow) detection threshold",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 360,
@ -14578,7 +14578,7 @@
"description": "The flow value of the broken pipe (high flow) detection",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 2500,
@ -14607,7 +14607,7 @@
"description": "The time in Minutes of the broken pipe (high flow) detection threshold",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 180,
@ -14636,7 +14636,7 @@
"description": "The pressure value of the maximum (high) pressure alarm",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 160,
@ -14665,7 +14665,7 @@
"description": "The pressure value of the minimum (low) pressure alarm",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 3,
@ -14694,7 +14694,7 @@
"description": "The time in seconds of the maximum (high) pressure alarm threshold",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 600,
@ -14723,7 +14723,7 @@
"description": "The time in seconds of the minimum (low) pressure alarm threshold",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 600,
@ -14752,7 +14752,7 @@
"description": "The period in seconds with which the pressure is measured (fix 60 sec)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 60,
@ -14781,7 +14781,7 @@
"description": "An enum respresenting the unit of pressure (0= no pressure sensor, 1= MPas, 2= PSI, 3= Bar)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14810,7 +14810,7 @@
"description": "The gauge offset of the pressure sensor value in mBar",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -14839,7 +14839,7 @@
"description": "The temperature value of the maximum (high) temperature alarm",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 50,
@ -14868,7 +14868,7 @@
"description": "The temperature value of the minimum (low) temperature alarm",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 2,
@ -14897,7 +14897,7 @@
"description": "The time in Minutes of the maximum (high) temperature alarm threshold",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 600,
@ -14926,7 +14926,7 @@
"description": "The time in Minutes of the minimum (low) temperature alarm threshold",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 600,
@ -14955,7 +14955,7 @@
"description": "The period in seconds with which the temperature is measured (only 60 is valid)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 60,
@ -14984,7 +14984,7 @@
"description": "An enum respresenting the unit of temperature (1= Celsius, 2= Fahrenheit)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 1,
@ -15013,7 +15013,7 @@
"description": "An enumerator defining the currently active PulseWidth (0 ... 8 for non testmode values and 9 ... 15 for testmode)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 4,
@ -15042,7 +15042,7 @@
"description": "A number representing the pulse weight multiplicator 1, 10, 100 or 1000",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 1,
@ -15071,7 +15071,7 @@
"description": "An enum (0 to 3) representing the pulse output mode (0= deactivated, ...)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 1,
@ -15100,7 +15100,7 @@
"description": "A parameter regarding the non existing current loop output",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "infrequentlyupdated"
}
@ -15124,7 +15124,7 @@
"description": "A parameter regarding the non existing current loop output",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "infrequentlyupdated"
}
@ -15148,7 +15148,7 @@
"description": "A byte value representing a mask of currently active (1) main alarms. These are the flow and genreral alarms",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 207,
@ -15177,7 +15177,7 @@
"description": "A byte value representing a mask of currently active (1) extended alarms. These are the temperature and pressure related alarms",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 60,
@ -15206,7 +15206,7 @@
"description": "A number of days (0 = off) after which alarms are cleared from the alarm byte values when they are no longer active",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 29,
@ -15235,7 +15235,7 @@
"description": "A value in minutes that defines the time the meter will stay in testmode after that mode was started",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15264,7 +15264,7 @@
"description": "The SensusRF encryption key (16 bytes) of the meter",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "static"
}
@ -15288,7 +15288,7 @@
"description": "The SensusRF Authentification PINs (3 PINs of 4 byte each) of the meter",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "static"
}
@ -15312,7 +15312,7 @@
"description": "The version of the complete Meter firmware package as represented by application FlexNetVersion",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15341,7 +15341,7 @@
"description": "An array of 9 bytes of freely programmable SensusRF customer Text",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "infrequentlyupdated"
}
@ -15365,7 +15365,7 @@
"description": "An uint32_t value representing the meter's system DateTime when the radio had last time sent a telegram",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15394,7 +15394,7 @@
"description": "An uint32_t value representing the meter's system DateTime when the radio had detected first the low-battery status",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15423,7 +15423,7 @@
"description": "A copy of the LowBatDateTime time stamp",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15452,7 +15452,7 @@
"description": "A byte value representing the currently active volume unit used by radio",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 19,
@ -15481,7 +15481,7 @@
"description": "A byte value representing additional information regarding the unit derived from the volume unit when used for flow or alternate volume, 0x1x= liter per sec, 0xx1= kiloLiter",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15510,7 +15510,7 @@
"description": "A byte value normaly never changed regarding general behavior of the firmware related to Over The Air updates",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 1,
@ -15539,7 +15539,7 @@
"description": "A complex structure of 84 bytes related to the Tfx mode of the meter respectively the volume channel",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "dynamic"
}
@ -15563,7 +15563,7 @@
"description": "A structure of 4 uint16_t values used for the customer DEWA",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "dynamic"
}
@ -15587,7 +15587,7 @@
"description": "A 4 byte bit mask representing whether the individual data items are logged in the periodic logging (1) or not (0)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 201335811,
@ -15616,7 +15616,7 @@
"description": "A number in seconds representing the time period for storing data records into the periodic logging file (memory)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 60,
@ -15645,7 +15645,7 @@
"description": "A number derived automatically from the DataLogPeriod that determines averaging periods in mimutes for min and max calculations",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 5,
@ -15674,7 +15674,7 @@
"description": "A 4 byte bit mask representing whether the individual data items are logged in the fixed date logging (1) or not (0)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 201335811,
@ -15703,7 +15703,7 @@
"description": "The day of the month (0 = every day) on which at 00:00 the fixed date logging takes place",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 1,
@ -15732,7 +15732,7 @@
"description": "An uint32_t counter used originally for debugging during development. Meanwhile out of use",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15761,7 +15761,7 @@
"description": "An uint8_t value related to the power level used by the radio when an Irda module is present",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15790,7 +15790,7 @@
"description": "An uint16_t value used for adjusting the antenna impedance",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 4,
@ -15819,7 +15819,7 @@
"description": "An uint16_t value used for adjusting the antenna impedance if an Irda module is present",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 4,
@ -15848,7 +15848,7 @@
"description": "A parameter of type bool that signals the presence of an Irda module. The value is controlled by the meter",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15877,7 +15877,7 @@
"description": "Write 1 to store configuration values to non-volatile storage. Read back for status",
"version": {
"first": 100,
"last": 541
"last": 545
},
"statictype": "dynamic"
}
@ -15901,7 +15901,7 @@
"description": "The number of seconds since the radio left the production (Set to 0 at the end of the production proccess)",
"version": {
"first": 100,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -15930,7 +15930,7 @@
"description": "A value (counter) used only during development for release testing",
"version": {
"first": 412,
"last": 541
"last": 545
},
"values": {
"default": 4320000,
@ -15959,7 +15959,7 @@
"description": "A counter used to control the radio activity which must not exceed certain regulatory limits",
"version": {
"first": 412,
"last": 541
"last": 545
},
"values": {
"default": 1000,
@ -15988,7 +15988,7 @@
"description": "Storage item for HistoricalErrorLimitCounters Reverse(1, hi) and Leak(0, lo)",
"version": {
"first": 437,
"last": 541
"last": 545
},
"values": {
"default": 16711935,
@ -16017,7 +16017,7 @@
"description": "Storage item for HistoricalErrorLimitCounters Magnet(3, hi) and Air(2, lo)",
"version": {
"first": 437,
"last": 541
"last": 545
},
"values": {
"default": 16711935,
@ -16046,7 +16046,7 @@
"description": "Storage item for HistoricalErrorLimitCounters PressureMin(5, hi) and PressureMax(4, lo)",
"version": {
"first": 437,
"last": 541
"last": 545
},
"values": {
"default": 16711935,
@ -16075,7 +16075,7 @@
"description": "Storage item for HistoricalErrorLimitCounters TempMin(7, hi) and TempMax(6, lo)",
"version": {
"first": 437,
"last": 541
"last": 545
},
"values": {
"default": 16711935,
@ -16104,7 +16104,7 @@
"description": "int8_t value to add an offset to the measured pressure in 10mBar resolution (for value from -1270 to +1270 mBar for field calibration purposes). -128 is an invalid value",
"version": {
"first": 483,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -16133,7 +16133,7 @@
"description": "a 6 bytes big complex structure for the Tfx settings of the secondary channel 1 (temperature)",
"version": {
"first": 494,
"last": 541
"last": 545
},
"statictype": "infrequentlyupdated"
}
@ -16157,7 +16157,7 @@
"description": "a 6 bytes big complex structure for the Tfx settings of the secondary channel 2 (pressure)",
"version": {
"first": 494,
"last": 541
"last": 545
},
"statictype": "infrequentlyupdated"
}
@ -16181,7 +16181,7 @@
"description": "An unit32_t value used to support/control the MB_MODE3_OMSv4B transmission uinque MCR",
"version": {
"first": 499,
"last": 541
"last": 545
},
"values": {
"default": 0,
@ -16210,7 +16210,7 @@
"description": "Storage item for HistoricalErrorLimitCounters NoFlowAlarm(7, hi) and Metrology Failure(6, lo)",
"version": {
"first": 536,
"last": 541
"last": 545
},
"values": {
"default": 16711935,
@ -16239,7 +16239,7 @@
"description": "Storage item for HistoricalErrorLimitCounters Reboot Alarm(7, hi) and reserved(6, lo)",
"version": {
"first": 536,
"last": 541
"last": 545
},
"values": {
"default": 16711680,

View File

@ -1 +1 @@
89102b0142e574de38a9f47d370f3334e5e6c268
c43c40a030005a8f189e6179faf40a6d42bfef5c

@ -1 +1 @@
Subproject commit fc6d1c60141d1dcce304443fe14f62a94e9dc123
Subproject commit 466fafaf46e31503975195fc911d6182971fa10b

View File

@ -29,7 +29,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
sb.AppendLine($" SELECT distinct[MapPcbIdToSerialNumber_SerialNumber], mapOrder.CordonelPressureTest_FertigungsAuftragsNr ");
sb.AppendLine($" FROM Auftrag.dbo.Cordonel_PressureTest mapOrder ");
sb.AppendLine($" left outer join [Auftrag].[dbo].[MapPcbIdToSerialNumber] map on mapOrder.CordonelPressureTest_PcbId = map.MapPcbIdToSerialNumber_PcbId ");
sb.AppendLine($" left outer join [Auftrag].[dbo].[MapPcbIdToSerialNumber] map on mapOrder.CordonelPressureTest_PcbId = map.MapPcbIdToSerialNumber_PcbId and map.MapPcbIdToSerialNumber_Deleted = 0 ");
sb.AppendLine($" left outer join Auftrag.dbo.AuftragPositionSerienNr mapSrn on map.[MapPcbIdToSerialNumber_SerialNumber] = mapSrn.SerienNr and mapSrn.Pruefgangnr = 0 ");
sb.AppendLine($" left outer join Auftrag.dbo.AlleAuftragPositionen auftraginfo on auftraginfo.AuftragNr = mapSrn.AuftragNr and auftraginfo.PositionNr = mapSrn.PositionNr ");

View File

@ -208,7 +208,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
sb.AppendLine($" FROM [Auftrag].[dbo].[MapPcbIdToSerialNumber] pcb ");
sb.AppendLine($" left outer join tmpRadioConfig radio on radio.pcbID = pcb.MapPcbIdToSerialNumber_PcbId");
sb.AppendLine($" inner join Genesis_Meter meter on meter.Seriennummer = pcb.MapPcbIdToSerialNumber_SerialNumber");
sb.AppendLine($" where [MapPcbIdToSerialNumber_PcbId] = '{pcbId}'");
sb.AppendLine($" where [MapPcbIdToSerialNumber_PcbId] = '{pcbId}' and MapPcbIdToSerialNumber_Deleted = 0 ");
var mapData = dataAccess.ExecuteQuery(sb.ToString());
if (mapData.Rows.Count != 1)

View File

@ -39,7 +39,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.Vako
VakoIdent = (Int32)mapData.Rows[0]["Identnr"],
Type = mapData.Rows[0]["Typ"].ToString(),
Dn = (Int32)mapData.Rows[0]["Nennweite"],
Length = (Int32)mapData.Rows[0]["Baulaenge"],
Length = mapData.Rows[0]["Baulaenge"].GetType() == typeof(System.DBNull) ? 0: (Int32)mapData.Rows[0]["Baulaenge"],
};
}

View File

@ -428,7 +428,7 @@ namespace ProductionUiCordonel
pc.Processes.Add(new ProductionCheckShippingState()); //[x] [x] [x]
pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x]
//pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x]
//pc.Processes.Add(new ProductionProcessFinalParametrizationFix()); //[x] [x] []
@ -436,13 +436,13 @@ namespace ProductionUiCordonel
pc.Processes.Add(new ProductionProcessShippingMode(true, true)); //[] [] []
//var radioCheck = new ProductionProcessRadioCheck();
var radioCheck = new ProductionProcessRadioCheck();
//orderBarcode.isDone += delegate (object sender, EventArgs e)
//{
// radioCheck.Ordernumber = ((ProductionProcessCheckOrderNumber)sender).Ordernumber;
//};
//pc.Processes.Add(radioCheck); //[] [] []
orderBarcode.isDone += delegate (object sender, EventArgs e)
{
radioCheck.Ordernumber = ((ProductionProcessCheckOrderNumber)sender).Ordernumber;
};
pc.Processes.Add(radioCheck); //[] [] []
//pc.Processes.Add(new ProductionProcessSpecialConfig()); //[x] [x] []

View File

@ -51,7 +51,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
if (msgbox)
{
UserControl.MessageBox(msg);
}
UserControl.lblText.Content = msg;
@ -109,8 +109,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (!HyState.HasValue || !HyState.Value)
{
setTxt("Zähler nicht erfolgreich geprüft",true,true);
setTxt("Zähler nicht erfolgreich geprüft", true, true);
currentProcessState = ProductionProcessState.Error;
}
@ -125,7 +125,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var genesisStatus = new GenesisStatus();
// this calculates all life time values
if (!GenesisStatusHandler.BuildLifeTimeInformation(Meter, genesisStatus))
if (!GenesisStatusHandler.BuildLifeTimeInformation(Meter, genesisStatus))
{
setTxt("Batterie nicht lesbar", true, true);
@ -163,7 +163,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
currentProcessState = ProductionProcessState.Error;
setTxt("EMEA Limit überschritten Limit 8% vs {genesisStatus.DrainedBatteryLoadPercent}", true, true);
Meter.WriteLog("Batterie über 10% entladen");
}
@ -200,16 +200,19 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
}
else
{
currentProcessState = ProductionProcessState.Error;
if (res[1] != "3239216" && res[1] != "3239217")
{
currentProcessState = ProductionProcessState.Error;
}
setTxt($"FW not correct Meter has {meterFWApp.Version} and should have {uint.Parse(res[9])}", true, true);
}
}
if (currentProcessState != ProductionProcessState.Error)
if (currentProcessState != ProductionProcessState.Error)
{
currentProcessState = ProductionProcessState.Done;
return;

View File

@ -114,7 +114,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
return JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet);
}
catch (Exception)
catch (Exception ec)
{
return new List<ProgrammingParameters>
{

View File

@ -0,0 +1,212 @@
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Xylem.Common.Logic.ServiceCore;
namespace Xylem.Common.Service.MeterProcessState.Controllers
{
[RoutePrefix("api/LuController")]
public class LuController : ApiController
{
public static class GlobalConfig
{
public static Lazy<String> connectionString = new Lazy<String>(()
=>
System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString
);
}
[Route("GetNZDaten")]
public async Task<HttpResponseMessage> GetNZDaten(string Seriennumer = "")
{
try
{
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
StringBuilder query = new StringBuilder();
query.AppendLine("SELECT TOP 1 * from Verbundzaehler where (Q1_SOLL is NULL) and (SerienNrNebenzaehler > 0 or KundeneigeneSerNrNbZ <> '') and (Herkunft is null or Herkunft <> 'M') and AnlageDatum > getdate() - 7 order by Datum desc ");
var retDic = new List<Tuple<string, string>>();
var dt = dataAccess.ExecuteQuery(query.ToString());
foreach (var item in dt.Select())
{
string strSQLOra;
int lngSerial;
string strSerial;
double Q1;
double Q2;
double F1;
double F2;
lngSerial = (int)item["SerienNrNebenzaehler"];
strSerial = item["KundeneigeneSerNrNbZ"].ToString().Trim();
if (strSerial == "" && lngSerial > 0)
{
strSQLOra = "SELECT * FROM PRIMA_RO.DT01_LAATZEN WHERE ZAEHLERNUMMER ='" + lngSerial.ToString("00000000") + "'";
}
else
{
if (strSerial != "")
{
//kundeneigenen NZ SerienNr ist bekannt
strSQLOra = "SELECT * FROM PRIMA_RO.DT01_LAATZEN WHERE ZAEHLERNUMMER='" + strSerial.Replace(" ", "") + "' or ZAEHLERNUMMER='" + strSerial + "'";
}
else
{
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return "ERROR 1#"; }));
// ' weder kundeneigenen SerienNr noch numerische NZ SerienNr bekannt
}
}
// create connection
OracleConnection con = new OracleConnection();
// create connection string using builder
OracleConnectionStringBuilder ocsb = new OracleConnectionStringBuilder();
ocsb.Password = "senspi2012";
ocsb.UserID = "prima_ro";
ocsb.DataSource = "//SLUORADB:1521/DT01";
// connect
con.ConnectionString = ocsb.ConnectionString;
con.Open();
OracleCommand command = con.CreateCommand();
command.CommandText = strSQLOra;
OracleDataReader reader = command.ExecuteReader();
while (reader.Read())
{
Q1 = ((double)reader["Q1_SOLL"]) / 1000;
Q2 = ((double)reader["Q2_SOLL"]) / 1000;
F1 = (double)reader["FEHLER_Q1"];
F2 = (double)reader["FEHLER_Q2"];
}
}
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return "store"; }));
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.ToString() + "<br >" + ex.InnerException.ToString());
}
}
//connect
//If Not rs.EOF Then
// If lngSerial = 0 Then
// StatusBar1.SimpleText = "LU: " & lngCount & "/" & ProgressBar1.Max & " " & strSerial & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 & " " & rsSQL("AnlageDatum")
// Else
// StatusBar1.SimpleText = "LU: " & lngCount & "/" & ProgressBar1.Max & " " & Format(lngSerial, "00000000") & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 & " " & rsSQL("AnlageDatum")
// End If
// 'Debug.Print Format(lngSerial, "00000000") & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2
// DoEvents
// If Not rsSQL Is Nothing Then
// ' Reihenfolge wieder zurückgesetzt Q1 < Q2 2018-04-19
// If Q1<Q2 Then
// ' richtig herum
// rsSQL("Q1_SOLL") = Q1
// rsSQL("FEHLER_Q1") = F1
// rsSQL("Q2_SOLL") = Q2
// rsSQL("FEHLER_Q2") = F2
// Else
// ' Q2 < Q1 => Tauschen
// rsSQL("Q1_SOLL") = Q2
// rsSQL("FEHLER_Q1") = F2
// rsSQL("Q2_SOLL") = Q1
// rsSQL("FEHLER_Q2") = F1
// End If
// Debug.Print rs("ZAEHLERNUMMER")
// If Val(rsSQL("SerienNrNebenzaehlerLU") &"") = 0 And lngSerial > 0 Then
// rsSQL("SerienNrNebenzaehlerLU") = lngSerial
// End If
// rsSQL("Herkunft") = "L"
// rsSQL("ErgaenzungDatum") = Now
// rsSQL.Update
// Debug.Print lngCount &"/" & ProgressBar1.Max & " OK " & lngSerial & " / " & strSerial
// End If
//Else
// StatusBar1.SimpleText = lngCount & "/" & ProgressBar1.Max & " unbekannte SNr: " & lngSerial & " / " & strSerial
// Debug.Print StatusBar1.SimpleText & " " & Now
// 'Debug.Print lngCount & "/" & ProgressBar1.Max & " unbekannt " & Format(lngSerial, "00000000") & " / " & strSerial
// DoEvents
// 'rsSQL("Q1_SOLL") = 0
// 'rsSQL("Herkunft") = "u"
// 'rsSQL("Info") = "unbekannt in LU"
// 'rsSQL.Update
//End If
//Exit Sub
//Errorhandler:
// Dim errnum As Long
// Dim errdesc As String
// errnum = Err.Number
// errdesc = Err.Description
// PrintStatus "Fehler " & errnum & " in Ergaenze(): " & errdesc & " SQL=" & strSQL
//End Sub
}
}

View File

@ -488,10 +488,12 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
sb.AppendLine($" where CordonelPressureTest_PcbId = @PcbId and CordonelPressureTest_FertigungsAuftragsNr = @PcbIsPartOfOrder ");
sb.AppendLine($" and CordonelPressureTest_Valid = 1 and CordonelPressureTest_IsDeleted = 0 ");
sb.AppendLine($" ");
sb.AppendLine($" select top 1 @LastPressureTest = [Pruefgang] from [Druckpruefung] ");
sb.AppendLine($" where [FabNr] = @PcbId and [FertigungsauftragNr] = @PcbIsPartOfOrder ");
sb.AppendLine($" and [Dicht] = 1 ");
sb.AppendLine($" order by [Pruefgang] desc ");
sb.AppendLine($" select top 1 @LastPressureTest = case when(IstStichprobe = 0 or(IstStichprobe = 1 and IstDicht = 1)) then 1 else null end ");
sb.AppendLine($" from Stichproben left outer join [Druckpruefung] on[FabNr] = PcbId ");
sb.AppendLine($" where[FabNr] = @PcbId and [FertigungsauftragNr] = @PcbIsPartOfOrder ");
sb.AppendLine($" order by [id] desc ");

View File

@ -681,6 +681,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
[Route("GetRadioKey")]
public async Task<HttpResponseMessage> GetRadioKey(String PcbId)
{
throw new Exception("Use finalcheck get encyprion key");
try
{

View File

@ -128,7 +128,7 @@ namespace Service.MeterProcessState.Controllers
var dt = dataacces.ExecuteQuery(query.ToString());
return true;
return "1";
// return ((int)dt.Rows[0]["PressuretestNeeded"]).ToString();

View File

@ -50,6 +50,9 @@
<LangVersion>7</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\lib\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
@ -60,17 +63,51 @@
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess, Version=4.122.23.1, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
<HintPath>..\..\packages\Oracle.ManagedDataAccess.23.7.0\lib\net472\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\..\packages\Swashbuckle.Core.5.6.0\lib\net40\Swashbuckle.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.SqlClient, Version=4.6.1.5, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SqlClient.4.8.5\lib\net461\System.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Include="System.Diagnostics.DiagnosticSource, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.6.0.1\lib\net461\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
<Reference Include="System.Formats.Asn1, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Formats.Asn1.8.0.1\lib\net462\System.Formats.Asn1.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=8.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Text.Json.8.0.5\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
@ -228,6 +265,7 @@
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Controllers\CordonelPressureSensorTestController.cs" />
<Compile Include="Controllers\ConfigurationJsonController.cs" />
<Compile Include="Controllers\LUControler.cs" />
<Compile Include="Controllers\PushControler.cs" />
<Compile Include="Controllers\FinalCheckController.cs" />
<Compile Include="Controllers\FileUpToDateController.cs" />
@ -328,6 +366,12 @@
<Content Include="configuration.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Oracle.DataAccess.Common.Configuration.Section.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Oracle.ManagedDataAccess.Client.Configuration.Section.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Properties\PublishProfiles\a.pubxml" />
<Content Include="README.md" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="parameterDirection">
<xs:restriction base="xs:string">
<xs:enumeration value="Output"/>
<xs:enumeration value="InputOutput"/>
<xs:enumeration value="ReturnValue"/>
<xs:enumeration value="Implicit"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="customBoolean">
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ONSParameters">
<xs:restriction base="xs:string">
<xs:enumeration value="nodeList"/>
<!--<xs:enumeration value="walletFile"/>
<xs:enumeration value="walletPassword"/>-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ONSModeValues">
<xs:restriction base="xs:string">
<xs:enumeration value="local"/>
<xs:enumeration value="remote"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="datatype">
<xs:restriction base="xs:string">
<xs:enumeration value="System.Binary"/>
<xs:enumeration value="System.Boolean"/>
<xs:enumeration value="System.Byte"/>
<xs:enumeration value="System.Byte[]"/>
<xs:enumeration value="System.Char"/>
<xs:enumeration value="System.DateTime"/>
<xs:enumeration value="System.DateTimeOffset"/>
<xs:enumeration value="System.Decimal"/>
<xs:enumeration value="System.Double"/>
<xs:enumeration value="System.Guid"/>
<xs:enumeration value="System.Int16"/>
<xs:enumeration value="System.Int32"/>
<xs:enumeration value="System.Int64"/>
<xs:enumeration value="System.SByte"/>
<xs:enumeration value="System.Single"/>
<xs:enumeration value="System.String"/>
<xs:enumeration value="System.TimeSpan"/>
<xs:enumeration value="System.UInt16"/>
<xs:enumeration value="System.UInt32"/>
<xs:enumeration value="System.UInt64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="providerType">
<xs:restriction base="xs:string">
<xs:enumeration value="BFile"/>
<xs:enumeration value="BinaryFloat"/>
<xs:enumeration value="BinaryDouble"/>
<xs:enumeration value="Blob"/>
<xs:enumeration value="Byte"/>
<xs:enumeration value="Char"/>
<xs:enumeration value="Clob"/>
<xs:enumeration value="Date"/>
<xs:enumeration value="Decimal"/>
<xs:enumeration value="Double"/>
<xs:enumeration value="Int16"/>
<xs:enumeration value="Int32"/>
<xs:enumeration value="Int64"/>
<xs:enumeration value="IntervalDS"/>
<xs:enumeration value="IntervalYM"/>
<xs:enumeration value="Long"/>
<xs:enumeration value="LongRaw"/>
<xs:enumeration value="NChar"/>
<xs:enumeration value="NClob"/>
<xs:enumeration value="NVarchar2"/>
<xs:enumeration value="Object"/>
<xs:enumeration value="Raw"/>
<xs:enumeration value="Single"/>
<xs:enumeration value="TimeStamp"/>
<xs:enumeration value="TimeStampLTZ"/>
<xs:enumeration value="TimeStampTZ"/>
<xs:enumeration value="Varchar2"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="nativeDataType">
<xs:restriction base="xs:string">
<xs:enumeration value="BFile"/>
<xs:enumeration value="Binary_Float"/>
<xs:enumeration value="Binary_Double"/>
<xs:enumeration value="Blob"/>
<xs:enumeration value="Char"/>
<xs:enumeration value="Clob"/>
<xs:enumeration value="Date"/>
<xs:enumeration value="Number"/>
<xs:enumeration value="Interval Day To Second"/>
<xs:enumeration value="Interval Year To Month"/>
<xs:enumeration value="Long"/>
<xs:enumeration value="Long Raw"/>
<xs:enumeration value="NChar"/>
<xs:enumeration value="NClob"/>
<xs:enumeration value="NVarchar2"/>
<xs:enumeration value="Raw"/>
<xs:enumeration value="Rowid"/>
<xs:enumeration value="Timestamp"/>
<xs:enumeration value="Timestamp With Local Time Zone"/>
<xs:enumeration value="Timestamp With Time Zone"/>
<xs:enumeration value="URowid"/>
<xs:enumeration value="UserDefinedType"/>
<xs:enumeration value="Varchar2"/>
<xs:enumeration value="XmlType"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="providerDBType">
<xs:restriction base="xs:string">
<xs:enumeration value="AnsiString"/>
<xs:enumeration value="AnsiStringFixedLength"/>
<xs:enumeration value="Binary"/>
<xs:enumeration value="Byte"/>
<xs:enumeration value="Date"/>
<xs:enumeration value="DateTime"/>
<xs:enumeration value="DateTimeOffset"/>
<xs:enumeration value="Decimal"/>
<xs:enumeration value="Double"/>
<xs:enumeration value="Int16"/>
<xs:enumeration value="Int32"/>
<xs:enumeration value="Int64"/>
<xs:enumeration value="Object"/>
<xs:enumeration value="Single"/>
<xs:enumeration value="String"/>
<xs:enumeration value="StringFixedLength"/>
<xs:enumeration value="Time"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,221 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="Oracle.DataAccess.Common.Configuration.Section.xsd"/>
<xs:element name="oracle.manageddataaccess.client" >
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="version" type="odpmversiontype" minOccurs="0" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:complexType name="odpmversiontype">
<xs:complexContent>
<xs:extension base="odpmparameters">
<xs:attribute name="number" type="xs:string" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="odpmparameters">
<xs:all>
<xs:element minOccurs="0" name="settings">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="setting">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="udtMappings">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="udtMapping">
<xs:complexType>
<xs:attribute name="typeName" type="xs:string" use="required" />
<xs:attribute name="factoryName" type="xs:string" use="required" />
<xs:attribute name="dataSource" type="xs:string" use="required" />
<xs:attribute name="schemaName" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="LDAPsettings">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="LDAPsetting">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="distributedTransaction">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="setting">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="dataSources">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="dataSource">
<xs:complexType>
<xs:attribute name="alias" type="xs:string" use="required" />
<xs:attribute name="descriptor" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="connectionPools">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="connectionPool">
<xs:complexType>
<xs:attribute name="connectionString" type="xs:string" use="required" />
<xs:attribute name="poolName" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="edmMappings">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="edmMapping">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="add">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="precision" type="xs:int" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="dataType" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="edmNumberMapping">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="add">
<xs:complexType>
<xs:attribute name="NETType" type="xs:string" use="required" />
<xs:attribute name="MinPrecision" type="xs:int" use="required" />
<xs:attribute name="MaxPrecision" type="xs:int" use="required" />
<xs:attribute name="DBType" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="implicitRefCursor">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="storedProcedure">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="1" name="refCursor">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="bindInfo">
<xs:complexType>
<xs:attribute name="mode" type="parameterDirection" use="required" />
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" name="metadata">
<xs:complexType>
<xs:attribute name="columnOrdinal" type="xs:int" use="required" />
<xs:attribute name="columnName" type="xs:string" use="required" />
<xs:attribute name="baseColumnName" type="xs:string" use="optional" />
<xs:attribute name="baseSchemaName" type="xs:string" use="optional" />
<xs:attribute name="baseTableName" type="xs:string" use="optional" />
<xs:attribute name="providerType" type="providerType" use="optional" />
<xs:attribute name="columnSize" type="xs:int" use="optional" />
<xs:attribute name="numericPrecision" type="xs:int" use="optional" />
<xs:attribute name="numericScale" type="xs:int" use="optional" />
<xs:attribute name="isUnique" type="customBoolean" use="optional" />
<xs:attribute name="isKey" type="customBoolean" use="optional" />
<xs:attribute name="isRowID" type="customBoolean" use="optional" />
<xs:attribute name="dataType" type="datatype" use="optional" />
<xs:attribute name="allowDBNull" type="customBoolean" use="optional" />
<xs:attribute name="isAliased" type="customBoolean" use="optional" />
<xs:attribute name="isByteSemantic" type="customBoolean" use="optional" />
<xs:attribute name="isExpression" type="customBoolean" use="optional" />
<xs:attribute name="isHidden" type="customBoolean" use="optional" />
<xs:attribute name="isReadOnly" type="customBoolean" use="optional" />
<xs:attribute name="isLong" type="customBoolean" use="optional" />
<xs:attribute name="udtTypeName" type="xs:string" use="optional" />
<xs:attribute name="nativeDataType" type="nativeDataType" use="optional" />
<xs:attribute name="providerDBType" type="providerDBType" use="optional" />
<xs:attribute name="objectName" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="optional" />
<xs:attribute name="position" type="xs:int" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="schema" type="xs:string" use="optional" />
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="onsConfig">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="settings">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="2" minOccurs="0" name="setting">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="ons">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="3" minOccurs="1" name="add">
<xs:complexType>
<xs:attribute name="name" type="ONSParameters" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="database" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="configFile" type="xs:string" use="optional" />
<xs:attribute name="mode" type="ONSModeValues" use="required" />
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:schema>

View File

@ -7,6 +7,7 @@
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.23.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
<appSettings>
<add key="CordonelTestSpecJson" value="~/Content/JSON/CordonelTestSpec.json" />
@ -88,6 +89,14 @@
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
@ -102,4 +111,10 @@
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008,40000,40008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</compilers>
</system.codedom>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.23.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
</configuration>

View File

@ -19,6 +19,7 @@
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net46" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net472" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net46" />
<package id="Microsoft.Net.Compilers" version="3.2.1" targetFramework="net46" developmentDependency="true" />
@ -35,11 +36,22 @@
<package id="Modernizr" version="2.6.2" targetFramework="net46" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
<package id="Oracle.ManagedDataAccess" version="23.7.0" targetFramework="net472" />
<package id="Owin" version="1.0" targetFramework="net46" />
<package id="Respond" version="1.2.0" targetFramework="net46" />
<package id="Swashbuckle" version="5.5.3" targetFramework="net46" />
<package id="Swashbuckle.Core" version="5.6.0" targetFramework="net46" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Data.SqlClient" version="4.8.5" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="6.0.1" targetFramework="net472" />
<package id="System.Formats.Asn1" version="8.0.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net472" />
<package id="System.Text.Json" version="8.0.5" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="WebActivatorEx" version="2.2.0" targetFramework="net46" />
<package id="WebGrease" version="1.5.2" targetFramework="net46" />
</packages>

View File

@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecords;
using Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol;
namespace DynamicStremingLogAnalyzer
@ -28,14 +30,100 @@ namespace DynamicStremingLogAnalyzer
public Dictionary<string, List<string>> LedFiles;
public Dictionary<string, List<string>> LogFiles;
public List<TestRun> TestRuns = new List<TestRun>();
public List<OffsetRun> OffsetRuns = new List<OffsetRun>();
// public List<AmpRun> AmpRuns = new List<AmpRun>();
public List<CompRun> CompRuns = new List<CompRun>();
//public List<TestRun> TestRuns = new List<TestRun>();
//public List<PathOffsetBag> PathOffsets { get; set; }
//public bool MeterValid { get; set; } = true;
}
public class TestRun
public class AmpRun
{
public DateTime? Start;
public DateTime? End;
public int? FirstHitPercent1;
public int? FirstHitPercent2;
public int? FirstHitPercent3;
public List<CalibrationRecord> Chnl1 = new List<CalibrationRecord>();
public List<CalibrationRecord> Chnl2 = new List<CalibrationRecord>();
public List<CalibrationRecord> Chnl3 = new List<CalibrationRecord>();
public int TotalLineCount { get; internal set; }
public void Calc()
{
}
}
public enum Stage
{
Login,
FirstFlush,
Preparation,
Amp,
SecondFlush,
Temp,
Offset,
}
public class CompRun
{
public DateTime? Start;// Login sequence Login sequence successful
public DateTime? Flush;//First Flush procedure started
public DateTime? Preparation;//Preparation procedure started
public DateTime? StartAmp;//Amplitude Test procedure started
public DateTime? FlushSecond;//Amplitude Test sequence successful at all
public DateTime? StartTemp;//Temperature Calibration procedure started
public DateTime? StartOffset;//Temperature Calibration sequence successful at all
public DateTime? End; //Offset Test sequence Offset Test sequence successful at all ;
public List<CalibrationRecord> Chnl1 = new List<CalibrationRecord>();
public List<CalibrationRecord> Chnl2 = new List<CalibrationRecord>();
public List<CalibrationRecord> Chnl3 = new List<CalibrationRecord>();
public int TotalLineCount { get; internal set; }
public List<Tuple<DateTimeOffset, Stage, CalibrationRecord>> MatchData()
{
var ret = new List<Tuple<DateTimeOffset, Stage, CalibrationRecord>>();
var matchList = new List<CalibrationRecord>();
matchList.AddRange(Chnl1);
matchList.AddRange(Chnl2);
matchList.AddRange(Chnl3);
foreach (var item in matchList)
{
var matchtime = item.DecodedTime;
var currentStage = Stage.Login;
if (matchtime >= Start && matchtime < Flush) { currentStage = Stage.Login; }
if (matchtime >= Flush && matchtime < Preparation) { currentStage = Stage.FirstFlush; }
if (matchtime >= Preparation && matchtime < StartAmp) { currentStage = Stage.Preparation; }
if (matchtime >= StartAmp && matchtime < FlushSecond) { currentStage = Stage.Amp; }
if (matchtime >= FlushSecond && matchtime < StartTemp) { currentStage = Stage.SecondFlush; }
if (matchtime >= StartTemp && matchtime < StartOffset) { currentStage = Stage.Temp; }
if (matchtime >= StartOffset && matchtime < End) { currentStage = Stage.Offset; }
ret.Add(new Tuple<DateTimeOffset, Stage, CalibrationRecord>(matchtime, currentStage, item));
}
return ret;
}
}
public class OffsetRun
{
public DateTime? Start;
public DateTime? End;
@ -44,6 +132,10 @@ namespace DynamicStremingLogAnalyzer
public int? Offset2;
public int? Offset3;
public List<CalibrationRecord> Chnl1 = new List<CalibrationRecord>();
public List<CalibrationRecord> Chnl2 = new List<CalibrationRecord>();
public List<CalibrationRecord> Chnl3 = new List<CalibrationRecord>();
public List<double> DeltaTimeOfFlightS1 = new List<double>();
public List<double> DeltaTimeOfFlightS2 = new List<double>();
public List<double> DeltaTimeOfFlightS3 = new List<double>();
@ -76,7 +168,7 @@ namespace DynamicStremingLogAnalyzer
DateTimeOffset timestamp;
var meters = new List<MeterBag>();
foreach (var item in Directory.GetFiles("\\\\sla12buma\\cordonelds$\\LAA-D-70MYB62\\2023-06-05\\Pruef2000\\", "*_PreAdjustment.log", SearchOption.AllDirectories))
foreach (var item in Directory.GetFiles("\\\\sla12file\\Auftrag\\p2016nez\\GenesisLog2\\2025-02-17\\Pruef2000\\", "*_PreAdjustment.log", SearchOption.AllDirectories))
{
@ -103,102 +195,76 @@ namespace DynamicStremingLogAnalyzer
}
}
foreach (var meter in meters)
{
foreach (var logfile in meter.LogFiles)
{
var r = new TestRun();
var c = new CompRun();
foreach (var logline in logfile.Value)
{
if (logline.Contains("APP Offset Test procedure started "))
//Start logging at Meter 1 (244230137)
if (logline.Contains("Login sequence Login sequence successful"))
{
if (r.End.HasValue)
if (c.End.HasValue)
{
meter.TestRuns.Add(r);
meter.CompRuns.Add(c);
}
r = new TestRun();
c = new CompRun();
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
r.Start = tmp;
c.Start = tmp;
}
if (r.Start.HasValue)
if (c.Start.HasValue && logline.Contains("First Flush procedure started"))
{
if (logline.Contains("cRecords.Count="))
{
var starPos = logline.LastIndexOf("cRecords.Count=") + "cRecords.Count=".Length;
var endPos = logline.Length;
if (int.TryParse(logline.Substring(starPos, endPos- starPos -1), out var tmp))
{
r.TotalLineCount = tmp;
}
}
if (logline.Contains("to 'Zero flow offset Path 1'-register at Meter"))
{
var starPos = logline.LastIndexOf(" CC Writing ") + " CC Writing ".Length;
var endPos = logline.IndexOf("to 'Zero flow offset Path 1'-register at Meter");
var lineOffset = logline.Substring(starPos, endPos - starPos).Trim();
if (int.TryParse(lineOffset, out int tmpOffset1))
{
r.Offset1 = tmpOffset1;
}
else
{
r.Offset1 = 99;
}
}
if (logline.Contains("to 'Zero flow offset Path 2'-register at Meter"))
{
var starPos = logline.LastIndexOf(" CC Writing ") + " CC Writing ".Length;
var endPos = logline.IndexOf("to 'Zero flow offset Path 2'-register at Meter");
var lineOffset = logline.Substring(starPos, endPos - starPos).Trim();
if (int.TryParse(lineOffset, out int tmpOffset2))
{
r.Offset2 = tmpOffset2;
}
else
{
r.Offset2 = 99;
}
}
if (logline.Contains("to 'Zero flow offset Path 3'-register at Meter"))
{
var starPos = logline.LastIndexOf(" CC Writing ") + " CC Writing ".Length;
var endPos = logline.IndexOf("to 'Zero flow offset Path 3'-register at Meter");
var lineOffset = logline.Substring(starPos, endPos - starPos).Trim();
if (int.TryParse(lineOffset, out int tmpOffset3))
{
r.Offset3 = tmpOffset3;
}
else
{
r.Offset3 = 99;
}
}
if (logline.Contains("Offset Test sequence Offset Test sequence successful at all"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
r.End = tmp;
}
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.Flush = tmp;
}
if (c.Flush.HasValue && logline.Contains("Preparation procedure started"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.Preparation = tmp;
}
if (c.Preparation.HasValue && logline.Contains("Amplitude Test procedure started"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.StartAmp = tmp;
}
if (c.StartAmp.HasValue && logline.Contains("Amplitude Test sequence successful at all"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.FlushSecond = tmp;
}
if (c.FlushSecond.HasValue && logline.Contains("Temperature Calibration procedure started"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.StartTemp = tmp;
}
if (c.StartTemp.HasValue && logline.Contains("Temperature Calibration sequence successful at all"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.StartOffset = tmp;
}
if (c.StartOffset.HasValue && logline.Contains("Offset Test sequence Offset Test sequence successful at all"))
{
DateTime.TryParse(logline.Substring(0, "2023-06-05 17:50:38.3184".Length), out DateTime tmp);
c.End = tmp;
}
}
if (r.End.HasValue)
if (c.End.HasValue)
{
meter.TestRuns.Add(r);
meter.CompRuns.Add(c);
}
@ -216,24 +282,25 @@ namespace DynamicStremingLogAnalyzer
if (DateTimeOffset.TryParse(line.Split('|')[0], out timestamp))
{
if (meter.TestRuns.Any(run => run.Start <= timestamp && run.End >= timestamp))
if (meter.CompRuns.Any(run => run.Start <= timestamp && run.End >= timestamp))
{
var currentRun = meter.TestRuns.First(run => run.Start <= timestamp && run.End >= timestamp);
var currentRun = meter.CompRuns.First(run => run.Start <= timestamp && run.End >= timestamp);
if (StreamingDecode.DecodeMsg(line.Split('|')[1].Trim()))
{
var c = StreamingDecode.DataCalib;
if (c.IsValid)
var c = ((CalibrationRecord)StreamingDecode.DataCalib?.Clone());
if (StreamingDecode.DataCalib != null && c.IsValid)
{
c.DecodedTime = timestamp;
switch (c.Channel)
{
case 1:
currentRun.DeltaTimeOfFlightS1.Add(c.DeltaTimeOfFlightS);
currentRun.Chnl1.Add(c);
break;
case 2:
currentRun.DeltaTimeOfFlightS2.Add(c.DeltaTimeOfFlightS);
currentRun.Chnl2.Add(c);
break;
case 3:
currentRun.DeltaTimeOfFlightS3.Add(c.DeltaTimeOfFlightS);
currentRun.Chnl3.Add(c);
break;
@ -255,21 +322,84 @@ namespace DynamicStremingLogAnalyzer
}
}
string sep = ";";
var sb = new StringBuilder();
foreach (var meter in meters)
{
foreach (var testrun in meter.TestRuns)
foreach (var testrun in meter.CompRuns)
{
testrun.Calc();
Console.WriteLine($"{meter.SerialNumber} ; 1; {testrun.Offset1}; {testrun.CalcOffset1}; {testrun.TotalLineCount / 3}; {testrun.DeltaTimeOfFlightS1.Count} ");
Console.WriteLine($"{meter.SerialNumber} ; 2; {testrun.Offset2}; {testrun.CalcOffset2}; {testrun.TotalLineCount / 3}; {testrun.DeltaTimeOfFlightS2.Count} ");
Console.WriteLine($"{meter.SerialNumber} ; 3; {testrun.Offset3}; {testrun.CalcOffset3}; {testrun.TotalLineCount / 3}; {testrun.DeltaTimeOfFlightS3.Count} ");
var results = testrun.MatchData();
sb.AppendLine(meter.SerialNumber);
sb.Append("Time").Append(sep);
sb.Append("Stage").Append(sep);
sb.Append("Channel").Append(sep);
sb.Append("Validation").Append(sep);
sb.Append("TotalTimeOfFlightS").Append(sep);
sb.Append("DeltaTimeOfFlightS").Append(sep);
sb.Append("VolumeScaleRawPerMl").Append(sep);
sb.Append("VolumeFactorRawToQm").Append(sep);
sb.Append("DeltaVolumeRaw").Append(sep);
sb.Append("DeltaVolumeQm").Append(sep);
sb.Append("AccuVolumeRaw").Append(sep);
sb.Append("VolumeCm").Append(sep);
sb.Append("OverflowVolumeCm").Append(sep);
sb.Append("SampleIntervalS").Append(sep);
sb.Append("AmplitudeUpV").Append(sep);
sb.Append("AmplitudeDownV").Append(sep);
sb.Append("PulseWidthRatioUp").Append(sep);
sb.Append("PulseWidthRatioDown").Append(sep);
sb.Append("TemperatureRaw").Append(sep);
sb.Append("TemperaturePowFactor").Append(sep);
sb.Append("TemperatureDegC").Append(sep);
sb.Append("TimeS").Append(sep);
sb.Append("OverflowTimeS").Append(sep);
sb.Append("Crc").Append(sep);
sb.Append("IsValid").Append(sep);
foreach (var logI in results)
{
var h = logI.Item3;
sb.Append(logI.Item1).Append(sep);
sb.Append(logI.Item2).Append(sep);
sb.Append(h.Channel).Append(sep);
sb.Append(h.Validation).Append(sep);
sb.Append(h.TotalTimeOfFlightS).Append(sep);
sb.Append(h.DeltaTimeOfFlightS).Append(sep);
sb.Append(h.VolumeScaleRawPerMl).Append(sep);
sb.Append(h.VolumeFactorRawToQm).Append(sep);
sb.Append(h.DeltaVolumeRaw).Append(sep);
sb.Append(h.DeltaVolumeQm).Append(sep);
sb.Append(h.AccuVolumeRaw).Append(sep);
sb.Append(h.VolumeCm).Append(sep);
sb.Append(h.OverflowVolumeCm).Append(sep);
sb.Append(h.SampleIntervalS).Append(sep);
sb.Append(h.AmplitudeUpV).Append(sep);
sb.Append(h.AmplitudeDownV).Append(sep);
sb.Append(h.PulseWidthRatioUp).Append(sep);
sb.Append(h.PulseWidthRatioDown).Append(sep);
sb.Append(h.TemperatureRaw).Append(sep);
sb.Append(h.TemperaturePowFactor).Append(sep);
sb.Append(h.TemperatureDegC).Append(sep);
sb.Append(h.TimeS).Append(sep);
sb.Append(h.OverflowTimeS).Append(sep);
sb.Append(h.Crc).Append(sep);
sb.Append(h.IsValid).Append(sep);
sb.AppendLine("");
}
}
File.AppendAllLines($"{meter.SerialNumber}_offset.CSV", new[] { sb.ToString() });
sb = new StringBuilder();
}
Console.ReadLine();

View File

@ -70,14 +70,52 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.label2 = new System.Windows.Forms.Label();
this.GMHPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.label10 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.txtInterpolTofs = new System.Windows.Forms.TextBox();
this.txtInterPolPcbId = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.ReCalibration = new System.Windows.Forms.TabPage();
this.lblFlowDisplay = new System.Windows.Forms.Label();
this.lblFlowChnl1 = new System.Windows.Forms.Label();
this.lblFlowChnl2 = new System.Windows.Forms.Label();
this.lblFlowChnl3 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.btnStopM = new System.Windows.Forms.Button();
this.btnRefeshM = new System.Windows.Forms.Button();
this.btnStartM = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.label19 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.nudCal3 = new System.Windows.Forms.NumericUpDown();
this.nudCal2 = new System.Windows.Forms.NumericUpDown();
this.nudCal1 = new System.Windows.Forms.NumericUpDown();
this.label13 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.nudZeroOffset3 = new System.Windows.Forms.NumericUpDown();
this.nudZeroOffset2 = new System.Windows.Forms.NumericUpDown();
this.nudZeroOffset1 = new System.Windows.Forms.NumericUpDown();
this.brnRead = new System.Windows.Forms.Button();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.btnWirte = new System.Windows.Forms.Button();
this.nudSampleRate = new System.Windows.Forms.NumericUpDown();
this.lblTof3 = new System.Windows.Forms.Label();
this.lblTof1 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.lblTof2 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.BtnWritetemp = new System.Windows.Forms.Button();
this.nudTemp = new System.Windows.Forms.NumericUpDown();
this.timer3 = new System.Windows.Forms.Timer(this.components);
this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.button2 = new System.Windows.Forms.Button();
this.txtInterPolPcbId = new System.Windows.Forms.TextBox();
this.txtInterpolTofs = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.multiflancshCalibration.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -86,6 +124,15 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.AutomaticCalibrationTab.SuspendLayout();
this.automaticControlsPanel.SuspendLayout();
this.tabPage4.SuspendLayout();
this.ReCalibration.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudCal3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudCal2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudCal1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudZeroOffset3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudZeroOffset2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudZeroOffset1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudSampleRate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudTemp)).BeginInit();
this.SuspendLayout();
//
// timer1
@ -104,6 +151,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.multiflancshCalibration.Controls.Add(this.tabPage3);
this.multiflancshCalibration.Controls.Add(this.AutomaticCalibrationTab);
this.multiflancshCalibration.Controls.Add(this.tabPage4);
this.multiflancshCalibration.Controls.Add(this.ReCalibration);
this.multiflancshCalibration.Dock = System.Windows.Forms.DockStyle.Fill;
this.multiflancshCalibration.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.multiflancshCalibration.Location = new System.Drawing.Point(0, 24);
@ -111,7 +159,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.multiflancshCalibration.Name = "multiflancshCalibration";
this.multiflancshCalibration.Padding = new System.Drawing.Point(0, 0);
this.multiflancshCalibration.SelectedIndex = 0;
this.multiflancshCalibration.Size = new System.Drawing.Size(1225, 676);
this.multiflancshCalibration.Size = new System.Drawing.Size(1155, 663);
this.multiflancshCalibration.TabIndex = 55;
this.multiflancshCalibration.Tag = "";
//
@ -122,7 +170,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1217, 647);
this.tabPage1.Size = new System.Drawing.Size(1147, 634);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Current entrys in LUT";
this.tabPage1.UseVisualStyleBackColor = true;
@ -154,7 +202,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1217, 647);
this.tabPage2.Size = new System.Drawing.Size(1147, 634);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Manual check temp";
this.tabPage2.UseVisualStyleBackColor = true;
@ -217,7 +265,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.tabPage3.Location = new System.Drawing.Point(4, 25);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(1217, 647);
this.tabPage3.Size = new System.Drawing.Size(1147, 634);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Manual add LUT";
this.tabPage3.UseVisualStyleBackColor = true;
@ -356,7 +404,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.AutomaticCalibrationTab.Location = new System.Drawing.Point(4, 25);
this.AutomaticCalibrationTab.Margin = new System.Windows.Forms.Padding(0);
this.AutomaticCalibrationTab.Name = "AutomaticCalibrationTab";
this.AutomaticCalibrationTab.Size = new System.Drawing.Size(1217, 647);
this.AutomaticCalibrationTab.Size = new System.Drawing.Size(1147, 634);
this.AutomaticCalibrationTab.TabIndex = 3;
this.AutomaticCalibrationTab.Text = "Automatic Calibration";
//
@ -367,7 +415,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.automaticContentBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.automaticContentBox.Location = new System.Drawing.Point(331, 0);
this.automaticContentBox.Name = "automaticContentBox";
this.automaticContentBox.Size = new System.Drawing.Size(886, 647);
this.automaticContentBox.Size = new System.Drawing.Size(816, 634);
this.automaticContentBox.TabIndex = 2;
this.automaticContentBox.Text = "";
//
@ -377,7 +425,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.autometicControlsSplitter.Cursor = System.Windows.Forms.Cursors.VSplit;
this.autometicControlsSplitter.Location = new System.Drawing.Point(328, 0);
this.autometicControlsSplitter.Name = "autometicControlsSplitter";
this.autometicControlsSplitter.Size = new System.Drawing.Size(3, 647);
this.autometicControlsSplitter.Size = new System.Drawing.Size(3, 634);
this.autometicControlsSplitter.TabIndex = 1;
this.autometicControlsSplitter.TabStop = false;
//
@ -399,7 +447,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.automaticControlsPanel.Location = new System.Drawing.Point(0, 0);
this.automaticControlsPanel.Name = "automaticControlsPanel";
this.automaticControlsPanel.Padding = new System.Windows.Forms.Padding(5);
this.automaticControlsPanel.Size = new System.Drawing.Size(328, 647);
this.automaticControlsPanel.Size = new System.Drawing.Size(328, 634);
this.automaticControlsPanel.TabIndex = 0;
//
// button1
@ -549,20 +597,6 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.label1.Text = "Messgerät (COM port)";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// timer3
//
this.timer3.Interval = 10000;
this.timer3.Tick += new System.EventHandler(this.timer3_Tick);
//
// mainMenuStrip
//
this.mainMenuStrip.BackColor = System.Drawing.SystemColors.Control;
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
this.mainMenuStrip.Name = "mainMenuStrip";
this.mainMenuStrip.Size = new System.Drawing.Size(1225, 24);
this.mainMenuStrip.TabIndex = 57;
this.mainMenuStrip.Text = "menuStrip1";
//
// tabPage4
//
this.tabPage4.Controls.Add(this.label10);
@ -573,11 +607,44 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.tabPage4.Location = new System.Drawing.Point(4, 25);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(1217, 647);
this.tabPage4.Size = new System.Drawing.Size(1147, 634);
this.tabPage4.TabIndex = 4;
this.tabPage4.Text = "Interpolation";
this.tabPage4.UseVisualStyleBackColor = true;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(27, 131);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(35, 16);
this.label10.TabIndex = 43;
this.label10.Text = "Tofs";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(27, 91);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(45, 16);
this.label8.TabIndex = 42;
this.label8.Text = "PcbID";
//
// txtInterpolTofs
//
this.txtInterpolTofs.Location = new System.Drawing.Point(78, 128);
this.txtInterpolTofs.Multiline = true;
this.txtInterpolTofs.Name = "txtInterpolTofs";
this.txtInterpolTofs.Size = new System.Drawing.Size(196, 271);
this.txtInterpolTofs.TabIndex = 41;
//
// txtInterPolPcbId
//
this.txtInterPolPcbId.Location = new System.Drawing.Point(78, 91);
this.txtInterPolPcbId.Name = "txtInterPolPcbId";
this.txtInterPolPcbId.Size = new System.Drawing.Size(196, 22);
this.txtInterPolPcbId.TabIndex = 40;
//
// button2
//
this.button2.Location = new System.Drawing.Point(78, 24);
@ -588,44 +655,426 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// txtInterPolPcbId
// ReCalibration
//
this.txtInterPolPcbId.Location = new System.Drawing.Point(78, 91);
this.txtInterPolPcbId.Name = "txtInterPolPcbId";
this.txtInterPolPcbId.Size = new System.Drawing.Size(196, 22);
this.txtInterPolPcbId.TabIndex = 40;
this.ReCalibration.Controls.Add(this.label25);
this.ReCalibration.Controls.Add(this.label24);
this.ReCalibration.Controls.Add(this.lblFlowDisplay);
this.ReCalibration.Controls.Add(this.lblFlowChnl1);
this.ReCalibration.Controls.Add(this.lblFlowChnl2);
this.ReCalibration.Controls.Add(this.lblFlowChnl3);
this.ReCalibration.Controls.Add(this.label23);
this.ReCalibration.Controls.Add(this.label22);
this.ReCalibration.Controls.Add(this.btnStopM);
this.ReCalibration.Controls.Add(this.btnRefeshM);
this.ReCalibration.Controls.Add(this.btnStartM);
this.ReCalibration.Controls.Add(this.button3);
this.ReCalibration.Controls.Add(this.label19);
this.ReCalibration.Controls.Add(this.label20);
this.ReCalibration.Controls.Add(this.label21);
this.ReCalibration.Controls.Add(this.nudCal3);
this.ReCalibration.Controls.Add(this.nudCal2);
this.ReCalibration.Controls.Add(this.nudCal1);
this.ReCalibration.Controls.Add(this.label13);
this.ReCalibration.Controls.Add(this.label15);
this.ReCalibration.Controls.Add(this.label16);
this.ReCalibration.Controls.Add(this.nudZeroOffset3);
this.ReCalibration.Controls.Add(this.nudZeroOffset2);
this.ReCalibration.Controls.Add(this.nudZeroOffset1);
this.ReCalibration.Controls.Add(this.brnRead);
this.ReCalibration.Controls.Add(this.label18);
this.ReCalibration.Controls.Add(this.label17);
this.ReCalibration.Controls.Add(this.btnWirte);
this.ReCalibration.Controls.Add(this.nudSampleRate);
this.ReCalibration.Controls.Add(this.lblTof3);
this.ReCalibration.Controls.Add(this.lblTof1);
this.ReCalibration.Controls.Add(this.label14);
this.ReCalibration.Controls.Add(this.lblTof2);
this.ReCalibration.Controls.Add(this.label12);
this.ReCalibration.Controls.Add(this.label11);
this.ReCalibration.Controls.Add(this.BtnWritetemp);
this.ReCalibration.Controls.Add(this.nudTemp);
this.ReCalibration.Location = new System.Drawing.Point(4, 25);
this.ReCalibration.Margin = new System.Windows.Forms.Padding(2);
this.ReCalibration.Name = "ReCalibration";
this.ReCalibration.Padding = new System.Windows.Forms.Padding(2);
this.ReCalibration.Size = new System.Drawing.Size(1147, 634);
this.ReCalibration.TabIndex = 5;
this.ReCalibration.Text = "tabPage5";
this.ReCalibration.UseVisualStyleBackColor = true;
this.ReCalibration.Click += new System.EventHandler(this.ReCalibration_Click);
//
// txtInterpolTofs
// lblFlowDisplay
//
this.txtInterpolTofs.Location = new System.Drawing.Point(78, 128);
this.txtInterpolTofs.Multiline = true;
this.txtInterpolTofs.Name = "txtInterpolTofs";
this.txtInterpolTofs.Size = new System.Drawing.Size(196, 271);
this.txtInterpolTofs.TabIndex = 41;
this.lblFlowDisplay.AutoSize = true;
this.lblFlowDisplay.Location = new System.Drawing.Point(639, 190);
this.lblFlowDisplay.Name = "lblFlowDisplay";
this.lblFlowDisplay.Size = new System.Drawing.Size(15, 16);
this.lblFlowDisplay.TabIndex = 34;
this.lblFlowDisplay.Text = "0";
//
// label8
// lblFlowChnl1
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(27, 91);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(45, 16);
this.label8.TabIndex = 42;
this.label8.Text = "PcbID";
this.lblFlowChnl1.AutoSize = true;
this.lblFlowChnl1.Location = new System.Drawing.Point(639, 216);
this.lblFlowChnl1.Name = "lblFlowChnl1";
this.lblFlowChnl1.Size = new System.Drawing.Size(15, 16);
this.lblFlowChnl1.TabIndex = 33;
this.lblFlowChnl1.Text = "0";
//
// label10
// lblFlowChnl2
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(27, 131);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(35, 16);
this.label10.TabIndex = 43;
this.label10.Text = "Tofs";
this.lblFlowChnl2.AutoSize = true;
this.lblFlowChnl2.Location = new System.Drawing.Point(639, 240);
this.lblFlowChnl2.Name = "lblFlowChnl2";
this.lblFlowChnl2.Size = new System.Drawing.Size(15, 16);
this.lblFlowChnl2.TabIndex = 32;
this.lblFlowChnl2.Text = "0";
//
// lblFlowChnl3
//
this.lblFlowChnl3.AutoSize = true;
this.lblFlowChnl3.Location = new System.Drawing.Point(639, 266);
this.lblFlowChnl3.Name = "lblFlowChnl3";
this.lblFlowChnl3.Size = new System.Drawing.Size(15, 16);
this.lblFlowChnl3.TabIndex = 31;
this.lblFlowChnl3.Text = "0";
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(524, 216);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(75, 16);
this.label23.TabIndex = 30;
this.label23.Text = "Flow Chnl 1";
//
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(524, 190);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(85, 16);
this.label22.TabIndex = 29;
this.label22.Text = "Flow Display";
//
// btnStopM
//
this.btnStopM.Location = new System.Drawing.Point(583, 124);
this.btnStopM.Name = "btnStopM";
this.btnStopM.Size = new System.Drawing.Size(75, 23);
this.btnStopM.TabIndex = 28;
this.btnStopM.Text = "Stop";
this.btnStopM.UseVisualStyleBackColor = true;
this.btnStopM.Click += new System.EventHandler(this.btnStopM_Click);
//
// btnRefeshM
//
this.btnRefeshM.Location = new System.Drawing.Point(583, 91);
this.btnRefeshM.Name = "btnRefeshM";
this.btnRefeshM.Size = new System.Drawing.Size(75, 23);
this.btnRefeshM.TabIndex = 27;
this.btnRefeshM.Text = "Refresh";
this.btnRefeshM.UseVisualStyleBackColor = true;
this.btnRefeshM.Click += new System.EventHandler(this.btnRefeshM_Click);
//
// btnStartM
//
this.btnStartM.Location = new System.Drawing.Point(583, 62);
this.btnStartM.Name = "btnStartM";
this.btnStartM.Size = new System.Drawing.Size(75, 23);
this.btnStartM.TabIndex = 26;
this.btnStartM.Text = "Start";
this.btnStartM.UseVisualStyleBackColor = true;
this.btnStartM.Click += new System.EventHandler(this.btnStartM_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(299, 410);
this.button3.Margin = new System.Windows.Forms.Padding(2);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(56, 19);
this.button3.TabIndex = 25;
this.button3.Text = "Write";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(337, 329);
this.label19.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(43, 16);
this.label19.TabIndex = 24;
this.label19.Text = "CAL 2";
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(337, 359);
this.label20.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(43, 16);
this.label20.TabIndex = 23;
this.label20.Text = "CAL 3";
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(337, 291);
this.label21.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(43, 16);
this.label21.TabIndex = 22;
this.label21.Text = "CAL 1";
//
// nudCal3
//
this.nudCal3.Location = new System.Drawing.Point(411, 359);
this.nudCal3.Margin = new System.Windows.Forms.Padding(2);
this.nudCal3.Name = "nudCal3";
this.nudCal3.Size = new System.Drawing.Size(90, 22);
this.nudCal3.TabIndex = 21;
//
// nudCal2
//
this.nudCal2.Location = new System.Drawing.Point(411, 324);
this.nudCal2.Margin = new System.Windows.Forms.Padding(2);
this.nudCal2.Name = "nudCal2";
this.nudCal2.Size = new System.Drawing.Size(90, 22);
this.nudCal2.TabIndex = 20;
//
// nudCal1
//
this.nudCal1.Location = new System.Drawing.Point(411, 286);
this.nudCal1.Margin = new System.Windows.Forms.Padding(2);
this.nudCal1.Name = "nudCal1";
this.nudCal1.Size = new System.Drawing.Size(90, 22);
this.nudCal1.TabIndex = 19;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(128, 332);
this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(69, 16);
this.label13.TabIndex = 18;
this.label13.Text = "Zero Tof 2";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(128, 362);
this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(69, 16);
this.label15.TabIndex = 17;
this.label15.Text = "Zero Tof 3";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(128, 294);
this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(69, 16);
this.label16.TabIndex = 16;
this.label16.Text = "Zero Tof 1";
//
// nudZeroOffset3
//
this.nudZeroOffset3.Location = new System.Drawing.Point(202, 362);
this.nudZeroOffset3.Margin = new System.Windows.Forms.Padding(2);
this.nudZeroOffset3.Name = "nudZeroOffset3";
this.nudZeroOffset3.Size = new System.Drawing.Size(90, 22);
this.nudZeroOffset3.TabIndex = 15;
//
// nudZeroOffset2
//
this.nudZeroOffset2.Location = new System.Drawing.Point(202, 327);
this.nudZeroOffset2.Margin = new System.Windows.Forms.Padding(2);
this.nudZeroOffset2.Name = "nudZeroOffset2";
this.nudZeroOffset2.Size = new System.Drawing.Size(90, 22);
this.nudZeroOffset2.TabIndex = 14;
//
// nudZeroOffset1
//
this.nudZeroOffset1.Location = new System.Drawing.Point(202, 289);
this.nudZeroOffset1.Margin = new System.Windows.Forms.Padding(2);
this.nudZeroOffset1.Name = "nudZeroOffset1";
this.nudZeroOffset1.Size = new System.Drawing.Size(90, 22);
this.nudZeroOffset1.TabIndex = 13;
//
// brnRead
//
this.brnRead.Location = new System.Drawing.Point(184, 163);
this.brnRead.Margin = new System.Windows.Forms.Padding(2);
this.brnRead.Name = "brnRead";
this.brnRead.Size = new System.Drawing.Size(56, 19);
this.brnRead.TabIndex = 12;
this.brnRead.Text = "Read";
this.brnRead.UseVisualStyleBackColor = true;
this.brnRead.Click += new System.EventHandler(this.brnRead_Click);
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(45, 127);
this.label18.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(68, 16);
this.label18.TabIndex = 11;
this.label18.Text = "Ref Temp";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(37, 89);
this.label17.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(87, 16);
this.label17.TabIndex = 10;
this.label17.Text = "Sample Rate";
//
// btnWirte
//
this.btnWirte.Location = new System.Drawing.Point(284, 84);
this.btnWirte.Margin = new System.Windows.Forms.Padding(2);
this.btnWirte.Name = "btnWirte";
this.btnWirte.Size = new System.Drawing.Size(56, 19);
this.btnWirte.TabIndex = 9;
this.btnWirte.Text = "Write";
this.btnWirte.UseVisualStyleBackColor = true;
this.btnWirte.Click += new System.EventHandler(this.btnWirte_Click);
//
// nudSampleRate
//
this.nudSampleRate.Location = new System.Drawing.Point(184, 84);
this.nudSampleRate.Margin = new System.Windows.Forms.Padding(2);
this.nudSampleRate.Name = "nudSampleRate";
this.nudSampleRate.Size = new System.Drawing.Size(90, 22);
this.nudSampleRate.TabIndex = 8;
//
// lblTof3
//
this.lblTof3.AutoSize = true;
this.lblTof3.Location = new System.Drawing.Point(199, 256);
this.lblTof3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTof3.Name = "lblTof3";
this.lblTof3.Size = new System.Drawing.Size(52, 16);
this.lblTof3.TabIndex = 7;
this.lblTof3.Text = "label16";
//
// lblTof1
//
this.lblTof1.AutoSize = true;
this.lblTof1.Location = new System.Drawing.Point(199, 206);
this.lblTof1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTof1.Name = "lblTof1";
this.lblTof1.Size = new System.Drawing.Size(52, 16);
this.lblTof1.TabIndex = 6;
this.lblTof1.Text = "label15";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(128, 232);
this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(38, 16);
this.label14.TabIndex = 5;
this.label14.Text = "Tof 2";
//
// lblTof2
//
this.lblTof2.AutoSize = true;
this.lblTof2.Location = new System.Drawing.Point(199, 232);
this.lblTof2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTof2.Name = "lblTof2";
this.lblTof2.Size = new System.Drawing.Size(52, 16);
this.lblTof2.TabIndex = 4;
this.lblTof2.Text = "label13";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(128, 256);
this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(38, 16);
this.label12.TabIndex = 3;
this.label12.Text = "Tof 3";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(128, 206);
this.label11.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(38, 16);
this.label11.TabIndex = 2;
this.label11.Text = "Tof 1";
//
// BtnWritetemp
//
this.BtnWritetemp.Location = new System.Drawing.Point(284, 126);
this.BtnWritetemp.Margin = new System.Windows.Forms.Padding(2);
this.BtnWritetemp.Name = "BtnWritetemp";
this.BtnWritetemp.Size = new System.Drawing.Size(56, 19);
this.BtnWritetemp.TabIndex = 1;
this.BtnWritetemp.Text = "WriteTemp";
this.BtnWritetemp.UseVisualStyleBackColor = true;
this.BtnWritetemp.Click += new System.EventHandler(this.BtnWritetemp_Click);
//
// nudTemp
//
this.nudTemp.DecimalPlaces = 2;
this.nudTemp.Location = new System.Drawing.Point(184, 126);
this.nudTemp.Margin = new System.Windows.Forms.Padding(2);
this.nudTemp.Name = "nudTemp";
this.nudTemp.Size = new System.Drawing.Size(90, 22);
this.nudTemp.TabIndex = 0;
//
// timer3
//
this.timer3.Interval = 10000;
this.timer3.Tick += new System.EventHandler(this.timer3_Tick);
//
// mainMenuStrip
//
this.mainMenuStrip.BackColor = System.Drawing.SystemColors.Control;
this.mainMenuStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
this.mainMenuStrip.Name = "mainMenuStrip";
this.mainMenuStrip.Size = new System.Drawing.Size(1155, 24);
this.mainMenuStrip.TabIndex = 57;
this.mainMenuStrip.Text = "menuStrip1";
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(524, 240);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(75, 16);
this.label24.TabIndex = 35;
this.label24.Text = "Flow Chnl 2";
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(524, 266);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(75, 16);
this.label25.TabIndex = 36;
this.label25.Text = "Flow Chnl 3";
//
// FrmTempMeter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1225, 700);
this.ClientSize = new System.Drawing.Size(1155, 687);
this.Controls.Add(this.multiflancshCalibration);
this.Controls.Add(this.mainMenuStrip);
this.MainMenuStrip = this.mainMenuStrip;
@ -644,6 +1093,16 @@ namespace Xylem.Common.Ui.GenesisToolBox
this.automaticControlsPanel.PerformLayout();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.ReCalibration.ResumeLayout(false);
this.ReCalibration.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudCal3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudCal2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudCal1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudZeroOffset3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudZeroOffset2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudZeroOffset1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudSampleRate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudTemp)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -697,5 +1156,43 @@ namespace Xylem.Common.Ui.GenesisToolBox
private System.Windows.Forms.TextBox txtInterpolTofs;
private System.Windows.Forms.TextBox txtInterPolPcbId;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TabPage ReCalibration;
private System.Windows.Forms.Button brnRead;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Button btnWirte;
private System.Windows.Forms.NumericUpDown nudSampleRate;
private System.Windows.Forms.Label lblTof3;
private System.Windows.Forms.Label lblTof1;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label lblTof2;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Button BtnWritetemp;
private System.Windows.Forms.NumericUpDown nudTemp;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.NumericUpDown nudZeroOffset3;
private System.Windows.Forms.NumericUpDown nudZeroOffset2;
private System.Windows.Forms.NumericUpDown nudZeroOffset1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.NumericUpDown nudCal3;
private System.Windows.Forms.NumericUpDown nudCal2;
private System.Windows.Forms.NumericUpDown nudCal1;
private System.Windows.Forms.Label lblFlowDisplay;
private System.Windows.Forms.Label lblFlowChnl1;
private System.Windows.Forms.Label lblFlowChnl2;
private System.Windows.Forms.Label lblFlowChnl3;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.Button btnStopM;
private System.Windows.Forms.Button btnRefeshM;
private System.Windows.Forms.Button btnStartM;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Label label24;
}
}

View File

@ -20,6 +20,7 @@
using Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages;
using Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecords;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Logic.SoftwareAccessHelper;
@ -60,6 +61,14 @@
new RefTempRange() { Min = 28,Max = 30 },
new RefTempRange() { Min = 33,Max = 36 },
};
nudCal1.Maximum = Int32.MaxValue;
nudCal2.Maximum = Int32.MaxValue;
nudCal3.Maximum = Int32.MaxValue;
nudZeroOffset1.Minimum = Int32.MinValue;
nudZeroOffset2.Minimum = Int32.MinValue;
nudZeroOffset3.Minimum = Int32.MinValue;
}
private void BtnConnect_Click(Object sender, EventArgs e)
@ -1092,6 +1101,152 @@
}
private void btnWirte_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
gen.WriteRegister("GENESISFLOW_SampleRate", (int)nudSampleRate.Value);
}
}
}
private void BtnWritetemp_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
UInt32 TempToRegister = (UInt32)(nudTemp.Value * 4096);
gen.WriteRegister(Register.Genesisflow.ToFTempCalibrate, TempToRegister);
gen.Logout();
}
}
}
private void brnRead_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
gen.ReLogin();
lblTof1.Text = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.ToFTempOffset1), 0).ToString();
lblTof2.Text = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.ToFTempOffset2), 0).ToString();
lblTof3.Text = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.ToFTempOffset3), 0).ToString();
nudZeroOffset1.Value = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.ZeroOffset1), 0);
nudZeroOffset2.Value = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.ZeroOffset2), 0);
nudZeroOffset3.Value = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.ZeroOffset3), 0);
nudCal1.Value = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.CalFactor1), 0);
nudCal2.Value = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.CalFactor2), 0);
nudCal3.Value = BitConverter.ToInt32(gen.ReadRegister(Register.Genesisflow.CalFactor3), 0);
}
}
}
private void button3_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
gen.ReLogin();
gen.WriteRegister(Register.Genesisflow.ZeroOffset1, nudZeroOffset1.Value);
gen.WriteRegister(Register.Genesisflow.ZeroOffset2, nudZeroOffset2.Value);
gen.WriteRegister(Register.Genesisflow.ZeroOffset3, nudZeroOffset3.Value);
var r = gen.WriteRegister(Register.Genesisflow.CalFactor1, (UInt16)nudCal1.Value, true,true);
gen.WriteRegister(Register.Genesisflow.CalFactor2, (UInt16)nudCal2.Value, true, true);
gen.WriteRegister(Register.Genesisflow.CalFactor3, (UInt16)nudCal3.Value, true, true);
gen.WriteRegister(Register.Genesisflow.StoreCalibration, 1);
gen.Logout();
}
}
}
private void ReCalibration_Click(Object sender, EventArgs e)
{
}
private void btnStartM_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
gen.StartMeasurement();
}
}
}
private void btnRefeshM_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
try
{
var r = gen.GetAllMeasurementResults(null, null, true);
foreach (var item in r)
{
switch (item.Channel)
{
case 0 :
lblFlowDisplay.Text = item.DutFlowRateCmPh.ToString();
break;
case 1:
lblFlowChnl1.Text = item.DutFlowRateCmPh.ToString();
break;
case 2:
lblFlowChnl2.Text = item.DutFlowRateCmPh.ToString();
break;
case 3:
lblFlowChnl3.Text = item.DutFlowRateCmPh.ToString();
break;
}
}
}
catch (Exception)
{
throw;
}
}
}
}
private void btnStopM_Click(Object sender, EventArgs e)
{
foreach (var meter in this.meterBatch.ListOfMeters)
{
if (meter is GenesisMeter gen)
{
gen.GetAllMeasurementResults(null, null, true);
}
}
}
}
}

View File

@ -123,229 +123,13 @@
<metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</metadata>
<metadata name="multiflancshCalibration.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabPage1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnRefreshLut.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtLuts.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabPage2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtComport.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblCheck.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label9.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnCheck.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabPage3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblAvgDutTof.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label7.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label6.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblDuration.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblLines.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnAddLut.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="nudRef.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnStopRecord.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnStartRecord.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtCurrentTofs.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="AutomaticCalibrationTab.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="automaticContentBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="autometicControlsSplitter.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="automaticControlsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabPage4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnRefreshLut.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtLuts.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtComport.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblCheck.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label9.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnCheck.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblAvgDutTof.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label7.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label6.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblDuration.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblLines.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnAddLut.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="nudRef.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnStopRecord.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnStartRecord.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtCurrentTofs.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="automaticContentBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="autometicControlsSplitter.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="automaticControlsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="button1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="connectedMeters.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="saveSettingsBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="messurementDauerMS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="stopAutomaticBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="startAutomaticBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="messurementStepMS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="GMHPort.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="button1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="connectedMeters.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="saveSettingsBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="messurementDauerMS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="stopAutomaticBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="startAutomaticBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="messurementStepMS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="GMHPort.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="timer3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>191, 17</value>
</metadata>
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>278, 17</value>
</metadata>
<metadata name="mainMenuStrip.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value>
<value>25</value>
</metadata>
</root>

View File

@ -56,11 +56,9 @@
this.groupBox1.Controls.Add(this.rbMeasurement);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.cblSlots);
this.groupBox1.Location = new System.Drawing.Point(16, 15);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Size = new System.Drawing.Size(317, 129);
this.groupBox1.Size = new System.Drawing.Size(238, 105);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Connection";
@ -69,10 +67,9 @@
// cbRequest
//
this.cbRequest.AutoSize = true;
this.cbRequest.Location = new System.Drawing.Point(8, 101);
this.cbRequest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cbRequest.Location = new System.Drawing.Point(6, 82);
this.cbRequest.Name = "cbRequest";
this.cbRequest.Size = new System.Drawing.Size(83, 21);
this.cbRequest.Size = new System.Drawing.Size(66, 17);
this.cbRequest.TabIndex = 11;
this.cbRequest.Text = "Request";
this.cbRequest.UseVisualStyleBackColor = true;
@ -80,10 +77,9 @@
// rbFlowCalibration
//
this.rbFlowCalibration.AutoSize = true;
this.rbFlowCalibration.Location = new System.Drawing.Point(133, 78);
this.rbFlowCalibration.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.rbFlowCalibration.Location = new System.Drawing.Point(100, 63);
this.rbFlowCalibration.Name = "rbFlowCalibration";
this.rbFlowCalibration.Size = new System.Drawing.Size(128, 21);
this.rbFlowCalibration.Size = new System.Drawing.Size(99, 17);
this.rbFlowCalibration.TabIndex = 10;
this.rbFlowCalibration.Text = "Flow Calibration";
this.rbFlowCalibration.UseVisualStyleBackColor = true;
@ -92,10 +88,9 @@
//
this.rbMeasurement.AutoSize = true;
this.rbMeasurement.Checked = true;
this.rbMeasurement.Location = new System.Drawing.Point(12, 78);
this.rbMeasurement.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.rbMeasurement.Location = new System.Drawing.Point(9, 63);
this.rbMeasurement.Name = "rbMeasurement";
this.rbMeasurement.Size = new System.Drawing.Size(115, 21);
this.rbMeasurement.Size = new System.Drawing.Size(89, 17);
this.rbMeasurement.TabIndex = 9;
this.rbMeasurement.TabStop = true;
this.rbMeasurement.Text = "Measurement";
@ -104,20 +99,18 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(8, 28);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Location = new System.Drawing.Point(6, 23);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(49, 17);
this.label1.Size = new System.Drawing.Size(36, 13);
this.label1.TabIndex = 6;
this.label1.Text = "Slot(s)";
//
// cblSlots
//
this.cblSlots.FormattingEnabled = true;
this.cblSlots.Location = new System.Drawing.Point(64, 23);
this.cblSlots.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cblSlots.Location = new System.Drawing.Point(48, 19);
this.cblSlots.Name = "cblSlots";
this.cblSlots.Size = new System.Drawing.Size(151, 38);
this.cblSlots.Size = new System.Drawing.Size(114, 19);
this.cblSlots.TabIndex = 4;
this.cblSlots.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.cblSlots_ItemCheck);
this.cblSlots.SelectedIndexChanged += new System.EventHandler(this.cblSlots_SelectedIndexChanged);
@ -131,31 +124,27 @@
this.groupBox2.Controls.Add(this.btnMeasurementStop);
this.groupBox2.Controls.Add(this.btnMeasurementPreparation);
this.groupBox2.Controls.Add(this.btnMeasurementStart);
this.groupBox2.Location = new System.Drawing.Point(376, 15);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox2.Location = new System.Drawing.Point(282, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox2.Size = new System.Drawing.Size(875, 129);
this.groupBox2.Size = new System.Drawing.Size(656, 105);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Control";
//
// btnGetResults
//
this.btnGetResults.Location = new System.Drawing.Point(617, 16);
this.btnGetResults.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnGetResults.Location = new System.Drawing.Point(463, 13);
this.btnGetResults.Name = "btnGetResults";
this.btnGetResults.Size = new System.Drawing.Size(111, 98);
this.btnGetResults.Size = new System.Drawing.Size(83, 80);
this.btnGetResults.TabIndex = 12;
this.btnGetResults.Text = "Store Calibration";
this.btnGetResults.UseVisualStyleBackColor = true;
//
// btnStoreCal
//
this.btnStoreCal.Location = new System.Drawing.Point(752, 16);
this.btnStoreCal.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnStoreCal.Location = new System.Drawing.Point(564, 13);
this.btnStoreCal.Name = "btnStoreCal";
this.btnStoreCal.Size = new System.Drawing.Size(111, 98);
this.btnStoreCal.Size = new System.Drawing.Size(83, 80);
this.btnStoreCal.TabIndex = 11;
this.btnStoreCal.Text = "Store Calibration";
this.btnStoreCal.UseVisualStyleBackColor = true;
@ -163,18 +152,16 @@
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(379, 44);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox1.Location = new System.Drawing.Point(284, 36);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(128, 22);
this.textBox1.Size = new System.Drawing.Size(97, 20);
this.textBox1.TabIndex = 10;
//
// btnUpdate
//
this.btnUpdate.Location = new System.Drawing.Point(251, 23);
this.btnUpdate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnUpdate.Location = new System.Drawing.Point(188, 19);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(103, 98);
this.btnUpdate.Size = new System.Drawing.Size(77, 80);
this.btnUpdate.TabIndex = 9;
this.btnUpdate.Text = "SetBatchInfos";
this.btnUpdate.UseVisualStyleBackColor = true;
@ -182,10 +169,9 @@
//
// btnMeasurementStop
//
this.btnMeasurementStop.Location = new System.Drawing.Point(523, 16);
this.btnMeasurementStop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnMeasurementStop.Location = new System.Drawing.Point(392, 13);
this.btnMeasurementStop.Name = "btnMeasurementStop";
this.btnMeasurementStop.Size = new System.Drawing.Size(87, 98);
this.btnMeasurementStop.Size = new System.Drawing.Size(65, 80);
this.btnMeasurementStop.TabIndex = 8;
this.btnMeasurementStop.Text = "Stop";
this.btnMeasurementStop.UseVisualStyleBackColor = true;
@ -193,10 +179,9 @@
//
// btnMeasurementPreparation
//
this.btnMeasurementPreparation.Location = new System.Drawing.Point(28, 23);
this.btnMeasurementPreparation.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnMeasurementPreparation.Location = new System.Drawing.Point(21, 19);
this.btnMeasurementPreparation.Name = "btnMeasurementPreparation";
this.btnMeasurementPreparation.Size = new System.Drawing.Size(104, 98);
this.btnMeasurementPreparation.Size = new System.Drawing.Size(78, 80);
this.btnMeasurementPreparation.TabIndex = 6;
this.btnMeasurementPreparation.Text = "Preparation";
this.btnMeasurementPreparation.UseVisualStyleBackColor = true;
@ -204,10 +189,9 @@
//
// btnMeasurementStart
//
this.btnMeasurementStart.Location = new System.Drawing.Point(140, 23);
this.btnMeasurementStart.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnMeasurementStart.Location = new System.Drawing.Point(105, 19);
this.btnMeasurementStart.Name = "btnMeasurementStart";
this.btnMeasurementStart.Size = new System.Drawing.Size(103, 98);
this.btnMeasurementStart.Size = new System.Drawing.Size(77, 80);
this.btnMeasurementStart.TabIndex = 7;
this.btnMeasurementStart.Text = "Start";
this.btnMeasurementStart.UseVisualStyleBackColor = true;
@ -215,10 +199,9 @@
//
// btnCheckAll
//
this.btnCheckAll.Location = new System.Drawing.Point(1556, 151);
this.btnCheckAll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnCheckAll.Location = new System.Drawing.Point(1167, 123);
this.btnCheckAll.Name = "btnCheckAll";
this.btnCheckAll.Size = new System.Drawing.Size(120, 82);
this.btnCheckAll.Size = new System.Drawing.Size(90, 67);
this.btnCheckAll.TabIndex = 14;
this.btnCheckAll.Text = "CheckBatch";
this.btnCheckAll.UseVisualStyleBackColor = true;
@ -228,32 +211,31 @@
//
this.ctlBatch.AutoSize = true;
this.ctlBatch.BackColor = System.Drawing.SystemColors.Control;
this.ctlBatch.Location = new System.Drawing.Point(16, 180);
this.ctlBatch.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.ctlBatch.MinimumSize = new System.Drawing.Size(880, 542);
this.ctlBatch.Location = new System.Drawing.Point(12, 146);
this.ctlBatch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ctlBatch.MinimumSize = new System.Drawing.Size(660, 440);
this.ctlBatch.Name = "ctlBatch";
this.ctlBatch.Size = new System.Drawing.Size(1409, 570);
this.ctlBatch.Size = new System.Drawing.Size(1057, 463);
this.ctlBatch.TabIndex = 15;
//
// preAdjWr1
//
this.preAdjWr1.Location = new System.Drawing.Point(969, 220);
this.preAdjWr1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.preAdjWr1.Location = new System.Drawing.Point(727, 179);
this.preAdjWr1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.preAdjWr1.Name = "preAdjWr1";
this.preAdjWr1.Size = new System.Drawing.Size(1301, 810);
this.preAdjWr1.Size = new System.Drawing.Size(976, 658);
this.preAdjWr1.TabIndex = 16;
//
// FrmLegacyTestApp
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1837, 858);
this.ClientSize = new System.Drawing.Size(1378, 697);
this.Controls.Add(this.preAdjWr1);
this.Controls.Add(this.ctlBatch);
this.Controls.Add(this.btnCheckAll);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "FrmLegacyTestApp";
this.Text = "FrmLegacyTestApp";
this.Load += new System.EventHandler(this.TestForm_Load);

View File

@ -1590,13 +1590,26 @@ namespace XylemCommonUiLegacyGenCtl
{
t = MeasurementDirection.TakeOnlyForward;
}
if (testset.meterType == MeterTypes.eRegister)
{
t = MeasurementDirection.TakeBoth;
}
if (testset.meterType == MeterTypes.MagFlux)
{
t = MeasurementDirection.TakeBoth;
if (testset.FlowTestingOnlyRevers)
{
t = MeasurementDirection.TakeOnlyBackward;
}else if (testset.FlowAdjustment)
{
t = MeasurementDirection.TakeBoth;
}
else
{
t = MeasurementDirection.TakeOnlyForward;
}
}
}
else
@ -2452,6 +2465,10 @@ namespace XylemCommonUiLegacyGenCtl
public dynamic GetTestSetupContainer()
{
if (TestSetupContainer == null)
{
return new TestSetupContainer();
}
return TestSetupContainer;
}