laatzen/Common/CommonConsole/Program.cs
2024-06-05 13:56:32 +02:00

134 lines
5.0 KiB
C#

namespace CommonConsole
{
using System;
using System.IO;
public static class Program
{
public static void Main()
{
var plugins = Directory.CreateDirectory(@"Z:\Programme_Sensus\plugins");
var files = plugins.GetFiles("*.Plugins.*.dll", SearchOption.AllDirectories);
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
*/