CAL improvment

This commit is contained in:
Roland Drabesch
2024-02-12 15:18:19 +01:00
parent 312f5de1bc
commit 5178d8970b
15 changed files with 355 additions and 120 deletions
+2 -2
View File
@@ -6,13 +6,13 @@
<appSettings>
<add key="PickingSlot" value="1"/>
<add key="PickingBarcode" value="COM20"/>
<add key="PickingBarcode" value="COM41"/>
<add key="LeakSlot" value="2"/>
<add key="LeakStationId" value="1"/>
<add key="MarriageSlot" value="4"/>
<add key="MarriageBarcode" value="COM21"/>
<add key="MarriageBarcode" value="COM42"/>
</appSettings>
@@ -10,4 +10,15 @@ namespace CordonelAssemblyLine.Event
Content = content;
}
}
public class StringPressureArgs : EventArgs
{
public readonly bool NeedPressure;
public readonly String Content;
public StringPressureArgs(String content, bool needPressure = false)
{
Content = content;
NeedPressure = needPressure;
}
}
}
+1
View File
@@ -106,6 +106,7 @@
<TextBlock Name="tippBox" Grid.Column="5" HorizontalAlignment="Left" Grid.Row="2" Grid.RowSpan="3" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="10" />
<Label Content="Tipp:" Grid.Column="5" HorizontalAlignment="Left"
Grid.Row="1" VerticalAlignment="Top"/>
<Button Name="btnLock" Grid.ColumnSpan="6" Content="Dieser Zähler muss zur Druckprüfung.Bitte bestätigen und hier klicken" Visibility="{Binding LockedPressure, UpdateSourceTrigger=PropertyChanged}" Background="Yellow" Click="BtnLock_Click" HorizontalAlignment="Left" Height="419" Grid.RowSpan="7" VerticalAlignment="Top" Width="792"/>
+29 -2
View File
@@ -32,11 +32,27 @@ namespace CordonelAssemblyLine
private void BtnPresueOk_Click(Object sender, RoutedEventArgs e)
{
ViewModel.StoreData(true);
var ret = ViewModel.StoreData(true);
}
private void ViewModel_OnStoreDone(Object sender, StringArgs e)
private void LockForPressureTest()
{
Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() =>
{
ViewModel.LockedPressure = Visibility.Visible;
}));
}
private void ViewModel_OnStoreDone(Object sender, StringPressureArgs e)
{
MessageBox.Show(e.Content);
if (e.NeedPressure)
{
LockForPressureTest();
}
}
private void ViewModel_MeterDetectedHandler(Object sender, EventArgs e)
{
@@ -115,5 +131,16 @@ namespace CordonelAssemblyLine
ViewModel.Dispose();
this.Title = "";
}
private void BtnLock_Click(Object sender, RoutedEventArgs e)
{
Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() =>
{
ViewModel.LockedPressure = Visibility.Hidden;
}));
}
}
}
+1 -1
View File
@@ -40,7 +40,7 @@
<TextBox Name="txtMarrieageSlot" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Height="23" Margin="10,41,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
<Label Content="Slot" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="26" Width="30"/>
<Label Content="BarcodePort" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="26" Width="75"/>
<TextBox x:Name="txtTester" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" Height="23" Margin="10,41,0,0" TextWrapping="Wrap" Text="Gebauer" VerticalAlignment="Top" Width="120"/>
<TextBox x:Name="txtTester" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" Height="23" Margin="10,41,0,0" TextWrapping="Wrap" Text="" TextChanged="TxtTester_TextChanged" VerticalAlignment="Top" Width="120"/>
<Label Content="Tester" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="26" Width="57"/>
<ProductionControls1:ctlPictureProgressBar Name="progressBar" HorizontalAlignment="Left" Height="80" Margin="11,0,0,0" Grid.Row="3" VerticalAlignment="Top" Width="771" Grid.ColumnSpan="4"/>
+11 -2
View File
@@ -79,10 +79,18 @@ namespace CordonelAssemblyLine
var tmpSlot = 0;
var tmpStation = 0;
if (int.TryParse(txtLeakSlot.Text, out tmpSlot) && int.TryParse(txtLeakStation.Text, out tmpStation))
{
if (txtTester.Text == "")
{
MessageBox.Show("Bitte den Namen im Feld Tester eingeben!");
}
else
{
LeakWindow = new Leak(cancellation.Token, tmpSlot, tmpStation, txtTester.Text);
LeakWindow.Show();
}
}
}
else
{
@@ -156,8 +164,9 @@ namespace CordonelAssemblyLine
}
}
private void TxtTester_TextChanged(Object sender, System.Windows.Controls.TextChangedEventArgs e)
{
}
}
}
@@ -10,21 +10,20 @@ using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.Consts;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
using Xylem.Common.Logic.ProductionOrderCore.TestResults;
using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.Common.Utils.Logging;
namespace CordonelAssemblyLine.Model
{
public class LeakViewModel : INotifyPropertyChanged
{
public event EventHandler<StringArgs> OnStoreDone;
public event EventHandler<StringPressureArgs> OnStoreDone;
public event EventHandler MeterDetectedHandler;
protected virtual void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
{
@@ -115,6 +114,23 @@ namespace CordonelAssemblyLine.Model
NotifyPropertyChanged(nameof(CurrentPcbHasPressure));
}
}
public Visibility _lockedPressure = Visibility.Hidden;
public Visibility LockedPressure
{
get
{
return _lockedPressure;
}
set
{
_lockedPressure = value;
NotifyPropertyChanged(nameof(LockedPressure));
}
}
private Timer tmrAutoDetect;
public LeakViewModel(Int32 slotNR, Int32? stationID = null)
@@ -328,13 +344,13 @@ namespace CordonelAssemblyLine.Model
}
internal void StoreData(Boolean successfull)
internal bool StoreData(Boolean successfull)
{
if (Result != null && Result.PcbId == CurrentPcbID)
{
InputIsEnabled = false;
var isStored = false;
var isStored = "";
Result.TesterName = TesterName;
Task.Run(() =>
{
@@ -352,10 +368,10 @@ namespace CordonelAssemblyLine.Model
var mutedResult = Result.ToBase();
mutedResult.Passed = successfull;
isStored = LocalWebRequest.PostRequestAsync(url, json: mutedResult);
if (!isStored)
isStored = LocalWebRequest.PostRequestAsyncAndGetContent(url, json: mutedResult);
if (!isStored.Contains("0") && !isStored.Contains("1"))
{
OnStoreDone?.Invoke(null, new StringArgs("Kann nicht gespeichert werden"));
OnStoreDone?.Invoke(null, new StringPressureArgs("Kann nicht gespeichert werden"));
status = DisplayCodes.PressureTestedFailed;
}
@@ -368,20 +384,33 @@ namespace CordonelAssemblyLine.Model
{
Log(ex.Message);
status = DisplayCodes.PressureTestedFailed;
OnStoreDone?.Invoke(null, new StringArgs($"Kann nicht gespeichert werden.Fehler: {ex.Message}"));
OnStoreDone?.Invoke(null, new StringPressureArgs($"Kann nicht gespeichert werden.Fehler: {ex.Message}",false));
}
if (status == DisplayCodes.PressureTested)
{
OnStoreDone?.Invoke(null, new StringArgs("Ergebnis gespeichert der Zähler weiter bearbeitet werden."));
return;
}
OnStoreDone?.Invoke(null, new StringArgs("Bitte erneut testen oder Linienleitung und QS informieren."));
if (isStored.Contains("0"))
{
OnStoreDone?.Invoke(null, new StringPressureArgs("Ergebnis gespeichert der Zähler weiterbearbeitet werden. Dieser Zähler muss NICHT zur Druckprüfung",false));
return false;
}
else
{
OnStoreDone?.Invoke(null, new StringPressureArgs("Ergebnis gespeichert der Zähler weiterbearbeitet werden. Dieser Zähler muss zur Druckprüfung",true));
return true;
}
}
OnStoreDone?.Invoke(null, new StringPressureArgs("Bitte erneut testen oder Linienleitung und QS informieren.", true));
return false;
});
}
return false;
}
}
@@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
<OutputType>Library</OutputType>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
@@ -110,6 +110,9 @@
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</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>
@@ -549,69 +549,20 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
new RequestResponseDataEventArgs { RequestResponseData = responseRecord });
}
/// <summary>
/// Method to send basic Commands to Meter. Creates an integer of 4 bytes for the payload.
/// Supported Commands are: <see cref="Commands.ReadData" />,<see cref="Commands.MultipleReadData" />,
/// <see cref="Commands.WriteData" />, <see cref="Commands.MultipleWriteData" /> and <see cref="Commands.QueryCaps" />.
/// Calculate CRCs and Command length and check if command is valid.
/// Use <see cref="AddRecordToSendFifo" /> to push data to Port/Meter.
/// </summary>
/// <param name="command">
/// Supported <see cref="Commands.ReadData" />,<see cref="Commands.MultipleReadData" />,
/// <see cref="Commands.WriteData" />, <see cref="Commands.MultipleWriteData" /> and <see cref="Commands.QueryCaps" />.
/// </param>
/// <param name="meterRegister">Register to Read or Write, null for <see cref="Commands.QueryCaps" /></param>
/// <param name="payload">
/// Data to push into the <see cref="RegisterDefinition" />.
/// must be null on Read Commands ( <see cref="Commands.ReadData" />,<see cref="Commands.MultipleReadData" />)
/// and not null on WriteData (<see cref="Commands.WriteData" /> and <see cref="Commands.MultipleWriteData" />)
/// </param>
/// <param name="expectedLength"></param>
/// <param name="hideDataInLog">hiding data in log file to avoid spying of passwords</param>
/// <param name="skipRetryErrorCode">mask to skip reties on error</param>
/// <returns>an new command just send to port/meter </returns>
/// <remarks date="2018-Mar-15" author="R.Drahbesch">
/// - Initial
/// </remarks>
/// <remarks date="2018-Dec-08" author="T.Wiedebusch">
/// - Reworked to zero pad payload with chunks of 4 bytes, the caller needn't take care of the size
/// </remarks>
/// <remarks date="2018-Dec-09" author="T.Wiedebusch">
/// - Corrected payload content in request protocol
/// </remarks>
/// <remarks date="2019-Apr-11" author="T.Wiedebusch">
/// - Hide data in logging for e.g. passwords
/// </remarks>
/// <remarks date="2019-Jun-28" author="T.Wiedebusch">
/// - Skip retries on specific error mask to speed up communication on functional errors
/// or informational feed backs (e.g FW not installed 0x0004)
/// <see cref="RequestRecord.ResponseErrorCode"/>
/// </remarks>
/// <remarks date="2019-Aug-28" author="R.Drabesch">
/// - Multiple read for string split to simple reads.
/// </remarks>
/// <remarks date="2019-Jan-18" author="T.Wiedebusch">
/// - Default <see cref="CommunicationConfig.SkipRetryErrorCode"/> set.
/// </remarks>
/// <remarks date="2023-Sep-06" author="T.Wiedebusch">
/// - MultipleReadData based on data size.
/// </remarks>
/// <remarks date="2023-Nov-24" author="T.Wiedebusch">
/// - Exit multiple read date if retries exceeded.
/// </remarks>
public RequestRecord CommandToMeter(Byte command, RegisterDefinition meterRegister = null,
Byte[] payload = null, Int32 expectedLength = 4, Boolean hideDataInLog = false,
Byte[] payload = null, Int32? expectedLength = null, Boolean hideDataInLog = false,
UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode)
{
if (command == Commands.MultipleReadData && meterRegister != null && meterRegister.DataType == typeof(String))
{
var completeResponse = new List<Byte>();
while (!completeResponse.Contains(0) && _recordInProcess.RetryCtr < CommunicationConfig.RequestRetries)
//TODO THW check this including the recursive call CommandToMeter
while (true)
{
var cRecord = CommandToMeter(Commands.ReadData, meterRegister, payload, 4, hideDataInLog,
skipRetryErrorCode);
var cRecord = CommandToMeter(Commands.ReadData, meterRegister, payload, expectedLength,
hideDataInLog, skipRetryErrorCode);
var rest = ProcessRecordList();
if (rest == RequestAcknowledgeState.Ok && cRecord?.ResponsePayload != null)
if (rest == RequestAcknowledgeState.Ok && cRecord != null && cRecord.ResponsePayload != null)
{
completeResponse.AddRange(cRecord.ResponsePayload);
if (cRecord.ResponsePayload.Contains(0))
@@ -619,9 +570,40 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
cRecord.ResponsePayload = completeResponse;
OnMeterRegisterUpdated?.Invoke(this,
new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
if (expectedLength.HasValue && completeResponse.Count < expectedLength.Value)
{
_logger.Debug("Too Short. Payload contains zero");
}
return cRecord;
}
}
else
{
if (expectedLength.HasValue && completeResponse.Any() &&
completeResponse.Count < expectedLength.Value)
{
if (rest != RequestAcknowledgeState.Ok)
{
_logger.Debug($"Too Short.Request Acknowledge State is {rest}");
}
else if (cRecord == null)
{
_logger.Debug("Too Short.Record is empty or null");
}
else if (cRecord.ResponsePayload == null)
{
_logger.Debug("Too Short.ResponsePayload is empty or null");
}
else
{
_logger.Debug("Too Short.Unkown reason");
}
}
return cRecord;
}
}
}
//the minimum payload is one 4 byte chunk
@@ -666,7 +648,20 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
if (command == Commands.MultipleReadData)
{
var numberOfChunks = (UInt16)(expectedLength / chunkSize);
//TODO THW create expected size out of meterRegister.DataType
if (!expectedLength.HasValue)
{
if ((meterRegister.DataType == typeof(UInt64) || meterRegister.DataType == typeof(Int64)))
{
expectedLength = 8;
}
else
{
expectedLength = 24;
}
}
var numberOfChunks = (UInt16)(expectedLength.Value / chunkSize);
if (expectedLength % chunkSize != 0)
numberOfChunks++;
requestProtocol.Add((Byte)(numberOfChunks & 0xFF));
@@ -681,6 +676,138 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
hideDataInLog, skipRetryErrorCode);
}
///// <summary>
///// Method to send basic Commands to Meter. Creates an integer of 4 bytes for the payload.
///// Supported Commands are: <see cref="Commands.ReadData" />,<see cref="Commands.MultipleReadData" />,
///// <see cref="Commands.WriteData" />, <see cref="Commands.MultipleWriteData" /> and <see cref="Commands.QueryCaps" />.
///// Calculate CRCs and Command length and check if command is valid.
///// Use <see cref="AddRecordToSendFifo" /> to push data to Port/Meter.
///// </summary>
///// <param name="command">
///// Supported <see cref="Commands.ReadData" />,<see cref="Commands.MultipleReadData" />,
///// <see cref="Commands.WriteData" />, <see cref="Commands.MultipleWriteData" /> and <see cref="Commands.QueryCaps" />.
///// </param>
///// <param name="meterRegister">Register to Read or Write, null for <see cref="Commands.QueryCaps" /></param>
///// <param name="payload">
///// Data to push into the <see cref="RegisterDefinition" />.
///// must be null on Read Commands ( <see cref="Commands.ReadData" />,<see cref="Commands.MultipleReadData" />)
///// and not null on WriteData (<see cref="Commands.WriteData" /> and <see cref="Commands.MultipleWriteData" />)
///// </param>
///// <param name="expectedLength"></param>
///// <param name="hideDataInLog">hiding data in log file to avoid spying of passwords</param>
///// <param name="skipRetryErrorCode">mask to skip reties on error</param>
///// <returns>an new command just send to port/meter </returns>
///// <remarks date="2018-Mar-15" author="R.Drahbesch">
///// - Initial
///// </remarks>
///// <remarks date="2018-Dec-08" author="T.Wiedebusch">
///// - Reworked to zero pad payload with chunks of 4 bytes, the caller needn't take care of the size
///// </remarks>
///// <remarks date="2018-Dec-09" author="T.Wiedebusch">
///// - Corrected payload content in request protocol
///// </remarks>
///// <remarks date="2019-Apr-11" author="T.Wiedebusch">
///// - Hide data in logging for e.g. passwords
///// </remarks>
///// <remarks date="2019-Jun-28" author="T.Wiedebusch">
///// - Skip retries on specific error mask to speed up communication on functional errors
///// or informational feed backs (e.g FW not installed 0x0004)
///// <see cref="RequestRecord.ResponseErrorCode"/>
///// </remarks>
///// <remarks date="2019-Aug-28" author="R.Drabesch">
///// - Multiple read for string split to simple reads.
///// </remarks>
///// <remarks date="2019-Jan-18" author="T.Wiedebusch">
///// - Default <see cref="CommunicationConfig.SkipRetryErrorCode"/> set.
///// </remarks>
///// <remarks date="2023-Sep-06" author="T.Wiedebusch">
///// - MultipleReadData based on data size.
///// </remarks>
///// <remarks date="2023-Nov-24" author="T.Wiedebusch">
///// - Exit multiple read date if retries exceeded.
///// </remarks>
//public RequestRecord CommandToMeter(Byte command, RegisterDefinition meterRegister = null,
// Byte[] payload = null, Int32 expectedLength = 4, Boolean hideDataInLog = false,
// UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode)
//{
// if (command == Commands.MultipleReadData && meterRegister != null && meterRegister.DataType == typeof(String))
// {
// var completeResponse = new List<Byte>();
// while (!completeResponse.Contains(0) && _recordInProcess.RetryCtr < (CommunicationConfig.RequestRetries*3))
// {
// var cRecord = CommandToMeter(Commands.ReadData, meterRegister, payload, 4, hideDataInLog,
// skipRetryErrorCode);
// var rest = ProcessRecordList();
// if (rest == RequestAcknowledgeState.Ok && cRecord?.ResponsePayload != null)
// {
// completeResponse.AddRange(cRecord.ResponsePayload);
// if (cRecord.ResponsePayload.Contains(0))
// {
// cRecord.ResponsePayload = completeResponse;
// OnMeterRegisterUpdated?.Invoke(this,
// new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
// return cRecord;
// }
// }
// }
// }
// //the minimum payload is one 4 byte chunk
// var chunkSize = RegisterDefinition.ChunkSize;
// if (payload == null)
// {
// payload = new Byte[chunkSize];
// for (var i = 0; i < chunkSize; i++)
// {
// payload[i] = FillByte;
// }
// }
// //real payload based on 4 byte chunks
// var requestPayload = new List<Byte>();
// requestPayload.AddRange(payload);
// //fill-byte padding
// if (payload.Length % chunkSize != 0)
// {
// for (var i = 0; i < chunkSize - payload.Length % chunkSize; i++)
// {
// requestPayload.Add(FillByte);
// }
// }
// //request protocol excluding the command
// var requestProtocol = new List<Byte>();
// if (meterRegister != null)
// {
// requestProtocol.Add(meterRegister.RegisterAddress[1]);
// requestProtocol.Add(meterRegister.RegisterAddress[0]);
// if (command == Commands.MultipleWriteData)
// {
// //set counter to inform meter writes are expected
// //the payload size is already padded to 4 byte chunks
// var numberOfChunks = (UInt16)(requestPayload.Count / chunkSize);
// requestProtocol.Add((Byte)(numberOfChunks & 0xFF));
// requestProtocol.Add((Byte)((numberOfChunks >> 8) & 0xFF));
// }
// if (command == Commands.MultipleReadData)
// {
// var numberOfChunks = (UInt16)(expectedLength / chunkSize);
// if (expectedLength % chunkSize != 0)
// numberOfChunks++;
// requestProtocol.Add((Byte)(numberOfChunks & 0xFF));
// requestProtocol.Add((Byte)((numberOfChunks >> 8) & 0xFF));
// }
// //add always the payload to the request protocol
// requestProtocol.AddRange(requestPayload);
// }
// return AddRecordToSendFifo(command, requestProtocol.ToArray(), meterRegister,
// hideDataInLog, skipRetryErrorCode);
//}
/// <summary>
/// Analyzes the error code
/// </summary>
@@ -258,6 +258,8 @@ namespace Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore
{
if (measurementRecord is ERegisterRecord record)
{
WriteLog(record.ToString());
if (!record.IsValid)
{
return;
@@ -265,7 +267,7 @@ namespace Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore
}
AddData(measurementRecord);
AddData(measurementRecord);//-0,1 bis -0,6
}
}
@@ -481,7 +483,7 @@ namespace Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore
public void SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData = true, Boolean useRequest = true, Boolean useStreaming = true)
{
Slot = slot;
var configFile = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Genesis", ProgramConfig.SerialConfigFileName);
var configFile = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "eRegister", ProgramConfig.SerialConfigFileName);
if (!System.IO.File.Exists(configFile))
{
@@ -134,8 +134,13 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (!genesisStatus.UNTStatus)
{
Meter.CheckRegionSizeLutCrc();
if (Meter.Region == "NA")
{
currentProcessState = ProductionProcessState.Error;
}
//currentProcessState = ProductionProcessState.Error;
//
UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() =>
{
@@ -188,13 +188,12 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
query.AppendLine(" pg.PruefstationNr, ");
query.AppendLine(" pg.Datum, ");
query.AppendLine(" pg.Pruefzeit, ");
query.AppendLine(" pg.Vorlauftemperatur, ");
query.AppendLine(" apsn.Wiederholungen, ");
query.AppendLine(" apsn.Einbauplatz, ");
query.AppendLine(" pg.Nennweite, ");
query.AppendLine(" idt.Baulaenge, ");
query.AppendLine(" pg.Pruefzeit, ");
query.AppendLine(" PP1_Soll,PP1_Ist,PP1_Ist_V, ");
query.AppendLine(" pf.PP1_Fehler, ");
@@ -276,7 +275,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
var sb = new StringBuilder();
sb.Append("AuftragNr;PositionNr;SerienNr;PruefgangNr;PruefstationNr;Datum;Pruefzeit;Wiederholungen;Einbauplatz;Nennweite;Baulaenge;");
sb.Append("AuftragNr;PositionNr;SerienNr;PruefgangNr;PruefstationNr;Datum;Pruefzeit;Temp;Wiederholungen;Einbauplatz;Nennweite;Baulaenge;");
@@ -138,11 +138,11 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
try
{
var searchKey = "Flash TestFirmware";
var dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBMETROLOGYTEST_PD] where [ID_PCB] = '{PcbId}' order by ID_TEST desc");
var dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBMETROLOGYTEST_PD] where [ID_PCB] = '{PcbId}' order by cast(ID_Test as int) desc");
if (!dt.Select().Any())
{
dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBRADIOTEST_PD] where [ID_PCB] = '{PcbId}' order by ID_TEST desc");
dt = dataAccess.ExecuteQuery($"SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [MyOraDB]..[DELTACHEF].[GENESIS_PCBRADIOTEST_PD] where [ID_PCB] = '{PcbId}' order by cast(ID_Test as int) desc");
searchKey = "Flash Firmware";
}
@@ -160,6 +160,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
//pwString = "FE081F0 16 31 F0 59 06 9B EB 24 00 04 80 00 70 03 48 9A";
//pwString = "FE081F0 B3 F3 0D 5C 05 C3 9B 24 00 04 80 00 70 03 48 9E";
//pwString = "FE081F0 C3 30 F0 59 03 66 10 24 00 04 80 00 70 03 48 9A";
// pwString = "FE081F0 48 A8 94 62 05 AC 53 24 00 04 80 00 70 03 48 9E";
//E79E9F08AFBE
var pId = Convert.ToUInt64(pwString.Replace(" ", "").Substring(7, 16), 16);
@@ -8,7 +8,6 @@ using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.Consts;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
using Xylem.Common.Logic.ProductionOrderCore.ProcessState;
@@ -133,9 +132,30 @@ namespace Service.MeterProcessState.Controllers
query.AppendLine($" ,'{item.Input.Replace(",", ".")}')");
}
query.AppendLine($" declare @TestIdStr nvarchar(250) ");
query.AppendLine($" set @TestIdStr = cast(@TestId as nvarchar(250)) ");
query.AppendLine($" if (substring(@TestIdStr, LEN(@TestIdStr) , 1 ) = '0' ) ");
query.AppendLine($" BEGIN ");
query.AppendLine($" Select 1 as PressuretestNeeded ");
query.AppendLine($" end ");
query.AppendLine($" else ");
query.AppendLine($" begin ");
query.AppendLine($" INSERT INTO [dbo].[Druckpruefung] select 0,'Übersprungen wegen Stichprobe', current_timestamp ,0,0,0,0,@pcbID, null,null,null,null,'WZ',NULL,NULL,NULL, @Ordernr, 1 ,null,null,1 ");
query.AppendLine($" Select 0 as PressuretestNeeded ");
query.AppendLine($" end ");
var dt = dataacces.ExecuteQuery(query.ToString());
return ((int)dt.Rows[0]["PressuretestNeeded"]).ToString();
}
return "store";
}));
}
catch (Exception ex)
@@ -763,6 +763,7 @@ namespace XylemCommonUiLegacyGenCtl
break;
case MeterTypes.eRegister:
meter = new eRegisterMeter();
_rawLogging = true;
break;
default: