Ami API
This commit is contained in:
parent
95bdd51c38
commit
5897c685eb
@ -7,7 +7,7 @@
|
||||
<targets>
|
||||
|
||||
<!--CalibrationHelper-->
|
||||
<target name="CalibrationHelper" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\CalibrationHelper.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_CalibrationHelper.log" />
|
||||
<target name="CalibrationHelper" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\CalibrationHelper.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}CalibrationHelper.log" />
|
||||
|
||||
<!--LedRawData-->
|
||||
<target xsi:type="BufferingWrapper"
|
||||
@ -16,35 +16,35 @@
|
||||
flushTimeout="-1"
|
||||
slidingTimeout="true"
|
||||
>
|
||||
<target name="LedRawDataBase" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\LedRawData_BASE.log" CreateDirs="True" layout ="${longdate} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_LedRawData_BASE.log" />
|
||||
<target name="LedRawDataBase" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\LedRawData_BASE.log" CreateDirs="True" layout ="${longdate} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_LedRawData_BASE.log" />
|
||||
</target>
|
||||
<!--C:\GenesisLog\${shortdate}
|
||||
C:\GenesisLog\${shortdate}-->
|
||||
|
||||
<!--MeterBatch-->
|
||||
<target name="MeterBatch" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\Meter_BASE.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_Meter_BASE.log" />
|
||||
<target name="MeterBatch" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\Meter_BASE.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_Meter_BASE.log" />
|
||||
|
||||
<!--Meter-->
|
||||
<target name="MeterBase" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\Meter_BASE.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_Meter_BASE.log" />
|
||||
<target name="Slot:0" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\Meter_SlotSlot:0.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_Meter_SlotSlot:0.log" />
|
||||
<target name="MeterBase" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\Meter_BASE.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_Meter_BASE.log" />
|
||||
<target name="Slot:0" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\Meter_SlotSlot:0.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_Meter_SlotSlot:0.log" />
|
||||
|
||||
<!--COM-->
|
||||
<target name="COMBase" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\COM_BASE.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_COM_BASE.log" />
|
||||
<target name="COMBase" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\COM_BASE.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_COM_BASE.log" />
|
||||
|
||||
<!--ServiceFwUpdateBuilder-->
|
||||
<target name="ServiceFwUpdateBuilder" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ServiceFwUpdateBuilder.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_ServiceFwUpdateBuilder.log" />
|
||||
<target name="ServiceFwUpdateBuilder" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ServiceFwUpdateBuilder.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_ServiceFwUpdateBuilder.log" />
|
||||
|
||||
<!--ServiceFwUpdateLoader-->
|
||||
<target name="ServiceFwUpdateLoader" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ServiceFwUpdateLoader.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_ServiceFwUpdateLoader.log" />
|
||||
<target name="ServiceFwUpdateLoader" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ServiceFwUpdateLoader.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_ServiceFwUpdateLoader.log" />
|
||||
|
||||
<!--ServiceFwUpdateSw-->
|
||||
<target name="ServiceFwUpdateSw" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ServiceFwUpdateSw.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_ServiceFwUpdateSw.log" />
|
||||
<target name="ServiceFwUpdateSw" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ServiceFwUpdateSw.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_ServiceFwUpdateSw.log" />
|
||||
|
||||
<!--default-->
|
||||
<target name="default" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\default.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_default.log" />
|
||||
<target name="default" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\default.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_default.log" />
|
||||
<target name="PreAdjWr" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\PreAdjWr.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" />
|
||||
|
||||
<target name="ctlBatch" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ctlBatch.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="C:\GenesisLog\${shortdate}\${processname}\{##}_ctlBatch.log" />
|
||||
<target name="ctlBatch" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ctlBatch.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" archiveAboveSize="50000000" archiveFileName="${BasePath}\${shortdate}\${processname}\{##}_ctlBatch.log" />
|
||||
<target name="StreamingQualityFile" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\StreamingQuality.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" />
|
||||
<target name="ProductionUIFile" xsi:type="File" fileName="${BasePath}\${shortdate}\${processname}\ProductionUIFile.log" CreateDirs="True" layout ="${longdate} | ${level} | ${message} ${exception:format=toString}" />
|
||||
</targets>
|
||||
|
||||
@ -13,4 +13,4 @@ using System.Reflection;
|
||||
//
|
||||
//[assembly: AssemblyVersion("1.2.*.0")]
|
||||
|
||||
[assembly: AssemblyVersion("2.8.0.*")]
|
||||
[assembly: AssemblyVersion("2.8.2.*")]
|
||||
|
||||
@ -160,6 +160,14 @@
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
||||
</bindings>
|
||||
</site>
|
||||
<site name="MeterProcessState(1)" id="3">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56015:localhost" />
|
||||
</bindings>
|
||||
</site>
|
||||
<siteDefaults>
|
||||
<!-- To enable logging, please change the below attribute "enabled" to "true" -->
|
||||
|
||||
@ -155,7 +155,7 @@
|
||||
</site>
|
||||
<site name="MeterProcessState" id="2">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\SZLATEV\source\repos\laa_production\Common\Service\MeterProcessState" />
|
||||
<virtualDirectory path="/" physicalPath="E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
int ResetAlarms(byte alarmMask)
|
||||
{
|
||||
task.Data = new ResetAlarms(0xFF).Append(auth);
|
||||
task.Data = new ResetAlarms(alarmMask).Append(auth);
|
||||
task.SetPending();
|
||||
sirt.Start(task);
|
||||
task.Wait();
|
||||
|
||||
@ -2092,6 +2092,31 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
|
||||
WriteRegister(Register.Customer.TriggerAlarmCancel, Alarm.ALL);
|
||||
|
||||
|
||||
|
||||
if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup1"))
|
||||
{
|
||||
var x = ReadRegister("SENSUSRADIO_PersistenceGroup1");
|
||||
WriteRegister("SENSUSRADIO_PersistenceGroup1", new byte[] { 0x00,0xff,0x00,0xff });
|
||||
}
|
||||
|
||||
if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup2"))
|
||||
{
|
||||
WriteRegister("SENSUSRADIO_PersistenceGroup2", new byte[] { 0x00, 0xff, 0x00, 0xff });
|
||||
}
|
||||
if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup3"))
|
||||
{
|
||||
WriteRegister("SENSUSRADIO_PersistenceGroup3", new byte[] { 0x00, 0xff, 0x00, 0xff });
|
||||
}
|
||||
if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup4"))
|
||||
{
|
||||
WriteRegister("SENSUSRADIO_PersistenceGroup4", new byte[] { 0x00, 0xff, 0x00, 0xff });
|
||||
}
|
||||
if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup5"))
|
||||
{
|
||||
WriteRegister("SENSUSRADIO_PersistenceGroup5", new byte[] { 0x00, 0xff, 0x00, 0xff });
|
||||
}
|
||||
|
||||
WriteRegister("CUSTOMER_AlarmEnableMask", beforeCancelAlarmEnableMask);
|
||||
WriteRegister("CUSTOMER_AlarmBroadcastMask", beforeCancelAlarmBroadcastMask);
|
||||
|
||||
|
||||
@ -37,7 +37,11 @@
|
||||
<add key="Mode" value="1" /> <!--1 = EOL ; 2 = Picking-->
|
||||
<add key="SirtComport433" value="7" /> <!--Individual for Thomas 14-->
|
||||
<add key="SirtComport868" value="16" /> <!--Individual for Thomas 15-->
|
||||
<add key="SirtBoxNr" value="2" /> <!--Roland and Thomas, box for development, box at shipping station is 1-->
|
||||
<add key="SirtComportAlarm433" value="16" />
|
||||
<add key="SirtComportAlarm868" value="16" />
|
||||
|
||||
|
||||
<add key="SirtBoxNr" value="2" /> <!--Roland and Thomas, box for development, box at shipping station is 1-->
|
||||
<add key="StationID" value="1" /> <!--Roland and Thomas, shipping station is 1-->
|
||||
|
||||
</appSettings>
|
||||
|
||||
@ -109,6 +109,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
|
||||
/// </summary>
|
||||
private Byte _sirtComport;
|
||||
|
||||
/// <summary>
|
||||
/// Comport number of SIRT
|
||||
/// </summary>
|
||||
private Byte _sirtSecondComport;
|
||||
|
||||
/// <summary>
|
||||
/// Radio address Cordonel
|
||||
/// </summary>
|
||||
@ -273,6 +278,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
|
||||
ActualProcessProgress++;
|
||||
|
||||
_sirtComport = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtComport{freq}"]);
|
||||
//_sirtSecondComport = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtComportAlarm{freq}"]);
|
||||
_sirtBoxNr = Convert.ToByte(ConfigurationManager.AppSettings["SirtBoxNr"]);
|
||||
var ucRadio = (UcRadioCheck)UserControl;
|
||||
ucRadio.SetHeadline($"{Resources.StrStateRadioCheck} BOX: {_sirtBoxNr}");
|
||||
@ -329,77 +335,80 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr
|
||||
}
|
||||
|
||||
SuccessMsgDispatcher(Resources.StrSuccessMsgRadioInCustomerMode);
|
||||
|
||||
_stateMachine?.Stop();
|
||||
_stateMachine = null;
|
||||
|
||||
//Radio rest alarms
|
||||
//readout wakeup, interval
|
||||
//start process
|
||||
//wait for proccess exitcode
|
||||
var WakupRestore = RegisterConverter.ByteArrayToValue<ushort>(Meter.ReadRegister("SENSUSRADIO_WakeupInterval"));
|
||||
var TxIntervalRestore = RegisterConverter.ByteArrayToValue<UInt16>(Meter.ReadRegister("SENSUSRADIO_TxInterval"));
|
||||
var LatRestore = RegisterConverter.ByteArrayToValue<ushort>(Meter.ReadRegister("SENSUSRADIO_LatInterval"));
|
||||
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_WakeupInterval",
|
||||
new Byte[] { 0x00 }, ProgrammingSource.ProgramInternal));
|
||||
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_TxInterval",
|
||||
new Byte[] { 0x01 }, ProgrammingSource.ProgramInternal));
|
||||
|
||||
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_LatInterval", RegisterConverter.ValueToByteArray(3), ProgrammingSource.ProgramInternal));
|
||||
|
||||
|
||||
Meter.Logout();
|
||||
|
||||
var process = new Process
|
||||
// Initialize the SIRT
|
||||
if (!SirtInit())
|
||||
{
|
||||
EnableRaisingEvents = true,
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
Arguments = $"COM{_sirtComport} {_radioAddressCordonel} {_radioEncryptionKey}",
|
||||
FileName = @"\\sla12file\auftrag\ProductionUiCordonel\CommonConsole\CommonConsole.exe",
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
RedirectStandardError = true,
|
||||
RedirectStandardOutput = true
|
||||
}
|
||||
};
|
||||
return SetTestFailed(Resources.StrErrorMsgSirt);
|
||||
}
|
||||
|
||||
void logData(string data, bool error)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(data))
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
ErrorMsgDispatcher(data.Trim());
|
||||
}
|
||||
else
|
||||
{
|
||||
SuccessMsgDispatcher(data.Trim());
|
||||
}
|
||||
////Radio rest alarms
|
||||
////readout wakeup, interval
|
||||
////start process
|
||||
////wait for proccess exitcode
|
||||
//var WakupRestore = RegisterConverter.ByteArrayToValue<ushort>(Meter.ReadRegister("SENSUSRADIO_WakeupInterval"));
|
||||
//var TxIntervalRestore = RegisterConverter.ByteArrayToValue<UInt16>(Meter.ReadRegister("SENSUSRADIO_TxInterval"));
|
||||
//var LatRestore = RegisterConverter.ByteArrayToValue<ushort>(Meter.ReadRegister("SENSUSRADIO_LatInterval"));
|
||||
//WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_WakeupInterval",
|
||||
//new Byte[] { 0x00 }, ProgrammingSource.ProgramInternal));
|
||||
//WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_TxInterval",
|
||||
//new Byte[] { 0x01 }, ProgrammingSource.ProgramInternal));
|
||||
|
||||
//WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_LatInterval", RegisterConverter.ValueToByteArray(3), ProgrammingSource.ProgramInternal));
|
||||
|
||||
|
||||
//Meter.Logout();
|
||||
|
||||
//var process = new Process
|
||||
//{
|
||||
// EnableRaisingEvents = true,
|
||||
// StartInfo = new ProcessStartInfo
|
||||
// {
|
||||
// Arguments = $"COM{_sirtSecondComport} {_radioAddressCordonel} {_radioEncryptionKey}",
|
||||
// FileName = @"\\sla12file\auftrag\ProductionUiCordonel\CommonConsoleV2\CommonConsole.exe",
|
||||
// CreateNoWindow = true,
|
||||
// UseShellExecute = false,
|
||||
// RedirectStandardError = true,
|
||||
// RedirectStandardOutput = true
|
||||
// }
|
||||
//};
|
||||
|
||||
//void logData(string data, bool error)
|
||||
//{
|
||||
// if (!string.IsNullOrWhiteSpace(data))
|
||||
// {
|
||||
// if (error)
|
||||
// {
|
||||
// ErrorMsgDispatcher(data.Trim());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SuccessMsgDispatcher(data.Trim());
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
process.ErrorDataReceived += (_, args) => logData(args.Data, true);
|
||||
process.OutputDataReceived += (_, args) => logData(args.Data, false);
|
||||
//process.ErrorDataReceived += (_, args) => logData(args.Data, true);
|
||||
//process.OutputDataReceived += (_, args) => logData(args.Data, false);
|
||||
|
||||
process.Start();
|
||||
process.BeginOutputReadLine();
|
||||
process.BeginErrorReadLine();
|
||||
process.WaitForExit(80_000);
|
||||
if (process.ExitCode != 0)
|
||||
{
|
||||
ErrorMsgDispatcher($"AlarmReset failed ExitCode{process.ExitCode}");
|
||||
return SetTestFailed($"AlarmReset failed ExitCode{process.ExitCode}");
|
||||
}
|
||||
//restore
|
||||
//process.Start();
|
||||
//process.BeginOutputReadLine();
|
||||
//process.BeginErrorReadLine();
|
||||
//process.WaitForExit(80_000);
|
||||
//if (process.ExitCode != 0)
|
||||
//{
|
||||
// ErrorMsgDispatcher($"AlarmReset failed ExitCode{process.ExitCode}");
|
||||
// return SetTestFailed($"AlarmReset failed ExitCode{process.ExitCode}");
|
||||
//}
|
||||
////restore
|
||||
|
||||
// reset system state back to shipping mode
|
||||
//// reset system state back to shipping mode
|
||||
|
||||
Meter.Login();
|
||||
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_WakeupInterval", RegisterConverter.ValueToByteArray(WakupRestore) , ProgrammingSource.ProgramInternal));
|
||||
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_TxInterval", RegisterConverter.ValueToByteArray(TxIntervalRestore), ProgrammingSource.ProgramInternal));
|
||||
WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_LatInterval", RegisterConverter.ValueToByteArray(LatRestore), ProgrammingSource.ProgramInternal));
|
||||
//Meter.Login();
|
||||
//WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_WakeupInterval", RegisterConverter.ValueToByteArray(WakupRestore) , ProgrammingSource.ProgramInternal));
|
||||
//WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_TxInterval", RegisterConverter.ValueToByteArray(TxIntervalRestore), ProgrammingSource.ProgramInternal));
|
||||
//WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_LatInterval", RegisterConverter.ValueToByteArray(LatRestore), ProgrammingSource.ProgramInternal));
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1274,6 +1274,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpGet]
|
||||
[Route("CalibrationResults/{pcbId}")]
|
||||
public IHttpActionResult CalibrationResults(String pcbId)
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using LaaPackages.Features.Cordonel.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
@ -38,7 +40,98 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
public class retItem {
|
||||
|
||||
public int OrderNr;
|
||||
public int pos;
|
||||
public int Pcb;
|
||||
public DateTimeOffset kitronDate;
|
||||
|
||||
public int SerienNr { get; internal set; }
|
||||
}
|
||||
|
||||
|
||||
[Route("GetOrderProductionDates")]
|
||||
public async Task<HttpResponseMessage> GetOrderProductionDates(int? Order = null, int? Pos = null, int? PcbId = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
|
||||
{
|
||||
var ret = new List<retItem>();
|
||||
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
{
|
||||
|
||||
var listOfPcb = new List<int>();
|
||||
|
||||
var sbq = new StringBuilder();
|
||||
sbq.AppendLine("select distinct AuftragNr, PositionNr, aps.SerienNr, map.MapPcbIdToSerialNumber_PcbId " +
|
||||
"from Auftrag.dbo.AuftragPositionSerienNr aps " +
|
||||
"inner join Auftrag.dbo.MapPcbIdToSerialNumber map " +
|
||||
"on aps.SerienNr = map.MapPcbIdToSerialNumber_SerialNumber " +
|
||||
"" +
|
||||
"where Wiederholungen = -1 ");
|
||||
if (PcbId.HasValue)
|
||||
{
|
||||
sbq.AppendLine($" and map.MapPcbIdToSerialNumber_PcbId = {PcbId.Value}");
|
||||
}
|
||||
else if(Order.HasValue)
|
||||
{
|
||||
sbq.AppendLine($" and aps.AuftragNr = {Order.Value}");
|
||||
if (Pos.HasValue)
|
||||
{
|
||||
sbq.AppendLine($" and aps.PositionNr = {Pos.Value}");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
var OrderRow = dataacces.ExecuteQuery(sbq.ToString());
|
||||
|
||||
foreach (DataRow item in OrderRow.Rows)
|
||||
{
|
||||
var retC = new retItem();
|
||||
retC.OrderNr = (Int32)item["AuftragNr"];
|
||||
retC.pos = (Int32)item["PositionNr"];
|
||||
retC.SerienNr = (Int32)item["SerienNr"];
|
||||
retC.Pcb = (Int32)item["MapPcbIdToSerialNumber_PcbId"];
|
||||
|
||||
var dtPrdDate = dataacces.ExecuteQuery($"sELECT * FROM OPENQUERY(MyOraDB, ' SELECT JSON FROM DELTACHEF.GENESIS_PCBFUNCTIONALTEST_PD WHERE ID_PCB = ''{retC.Pcb}'' order by ID_TEST desc ');");
|
||||
if (dtPrdDate.Rows.Count >= 1)
|
||||
{
|
||||
var St = dtPrdDate.Rows[0]["JSON"].ToString();
|
||||
var startInex = St.IndexOf("\"StartDT\":\"") + "\"StartDT\":\"".Length;
|
||||
var datestring = St.Substring(startInex, "29.07.2022 06:47:27".Length);
|
||||
var olastProdDate = new DateTime();
|
||||
DateTime.TryParse(datestring, out olastProdDate);
|
||||
retC.kitronDate = olastProdDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
retC.kitronDate = DateTime.MinValue;
|
||||
}
|
||||
ret.Add(retC);
|
||||
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}));
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.ToString() + "<br >" + ex.InnerException.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>56011</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:56011/</IISUrl>
|
||||
<IISUrl>http://localhost:56015/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user