namespace CommonConsole { using Common.SqlExtensions; using OmniPlus; using OmniPlus.Features; using System; using System.Linq; using System.Threading; public static class Program { public static void Main() { var a = 816242311982; var b = (int)a; Console.WriteLine(a); Console.WriteLine(b); Console.ReadKey(); //var connection = new OmniIrdaConnection("COM36"); //connection.StateChenged += Console.WriteLine; //connection.Open(); //if (connection.FactorySeal().Sealed) //{ // var _sealed = connection.FactorySeal(false); //} //var response = connection.Set(new BuildInfo //{ // Value = "816232411982" //}); //connection.Close(); //Console.ReadKey(); //response = connection.ClearDisplay(); //response = connection.Set(new LeakAlarm //{ // FlowRateGPM = defaults.LeakAlarmGPM, // TimeLimit = defaults.LeakAlarmTime //}); //response = connection.Set(new HighFlowAlarm //{ // FlowRateGPM = defaults.HighFlowAlarmGPM, // TimeLimit = defaults.HighFlowAlarmTime //}); //response = connection.Set(new ReverseFlowAlarm //{ // FlowRateGPM = defaults.ReverseFlowAlarmGPM, // TimeLimit = defaults.ReverseFlowAlarmTime //}); //response = connection.ClearAlarms(); //response = connection.EnableNFC(); //var alarmsState = connection.ViewAlarmsState(); //response = connection.ViewAlarmSettings(0x01); //response = connection.ViewAlarmSettings(0x02); //response = connection.ViewAlarmSettings(0x04); //response = connection.FactorySeal(true); //response = connection.FactorySeal(); //parameters = connection.ViewSystemParameters(); //settings = connection.ViewRegisterSettings(); //configuration = connection.ViewConfigurationParameters(); //var partnr = defaults.PartNr; //var pcbid = parameters.BuildInfo.Value; //var affected = sql.CreateCommand($@" // INSERT // INTO [PushExt].[dbo].[OmniExport] // ( [OrderNumber] // , [LineNumber] // , [ManufacturingSN] // , [CustomerSN] // , [MeterSN] // , [PCBAID] // , [EhatPCBAID] // , [ManufactureDate] // , [ShipDate] // , [Flow1] // , [Flow2] // , [Flow3] // , [PartNumber]) // SELECT [aps].[AuftragNr] // , [aps].[PositionNr] // , [aps].[SerienNr] // , '1111111111' // , [aps].[SerienNr] // , @{nameof(pcbid)} // , @{nameof(pcbid)} // , '21-05-2024' // , GETDATE() // , (SELECT TOP 1 ROUND([tr].[Q1_Acc], 1, 1) // FROM [Auftrag].[dbo].[OmniTestRuns] AS [tr] // WHERE [tr].[BuildInfo] = @{nameof(pcbid)} // AND [tr].[Succeeded] = 1 // ORDER BY [tr].[Id] DESC) // , (SELECT TOP 1 ROUND([tr].[Q2_Acc], 1, 1) // FROM [Auftrag].[dbo].[OmniTestRuns] AS [tr] // WHERE [tr].[BuildInfo] = @{nameof(pcbid)} // AND [tr].[Succeeded] = 1 // ORDER BY [tr].[Id] DESC) // , (SELECT TOP 1 ROUND([tr].[Q3_Acc], 1, 1) // FROM [Auftrag].[dbo].[OmniTestRuns] AS [tr] // WHERE [tr].[BuildInfo] = @{nameof(pcbid)} // AND [tr].[Succeeded] = 1 // ORDER BY [tr].[Id] DESC) // , @{nameof(partnr)} // FROM [Auftrag].[dbo].[AuftragPositionSerienNr] AS [aps] // WHERE [aps].[SerienNr] = @{nameof(programmableID)}") //.SetParameter(nameof(programmableID), programmableID) //.SetParameter(nameof(partnr), partnr) //.SetParameter(nameof(pcbid), pcbid) //.ExecuteNonQuery(); //Console.WriteLine(affected); //connection.Close(); } } } /**1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * T 1 X 9 X X 2 G X A 0 X L S D * T 1 X 9 X X B G 1 A 0 X L S D * T 2 X 9 X X 2 G X A 0 X L S D * T 2 X 9 X X B G 1 A 0 X L S D * R 1 X 9 X X 2 G X A 0 X L S D * R 2 X 9 X X 2 G X A 0 X L S D * * C 1 X 9 X X 2 G X A 0 X L S D * C 1 X 9 X X B G 1 A 0 X L S D * * C 2 X 9 X X 2 G X A 0 X L S D * C 2 X 9 X X B G 1 A 0 X L S D */