latest e-register changes

This commit is contained in:
Stoyan Zlatev
2025-05-21 10:26:07 +02:00
parent a2123133f5
commit d8732f3d65
7 changed files with 44691 additions and 49 deletions
File diff suppressed because it is too large Load Diff
+45 -1
View File
@@ -37,6 +37,48 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Office.Client.Policy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.Office.Client.Policy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.TranslationServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.Office.Client.TranslationServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.SharePoint.Tools, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.Office.SharePoint.Tools.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProjectServer.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.ProjectServer.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.DocumentManagement, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.DocumentManagement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Publishing, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.Publishing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.Search.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search.Applications, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.Search.Applications.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Taxonomy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.Taxonomy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.UserProfiles, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.UserProfiles.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.WorkflowServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.26017.12000\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -54,7 +96,9 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Hardware\Common.Hardware.SIRT\Common.Hardware.SIRT.csproj">
<Project>{8de8e742-ee0a-4004-aa49-3d08d748e5ac}</Project>
+69 -37
View File
@@ -1,57 +1,89 @@
namespace CommonConsole
{
using Common.Hardware.SIRT;
using Common.Hardware.SIRT.Tasks;
using Common.Hardware.WaterMeter.eRegister;
using Common.Hardware.WaterMeter.eRegister.Features;
using Common.Hardware.WaterMeter.eRegister.Telegrams;
using Microsoft.SharePoint.Client;
using System;
using System.Security;
public static class Program
{
public static void Main()
{
SIRTLogger.State += Console.WriteLine;
var semiBytes25747925 = new byte[] { 0x08, 0x03, 0x12, 0x6B, 0x78, 0x41, 0x00, 0x00, 0x01, 0xF4, 0x00, 0x00, 0x83, 0x0C, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x13, 0x01, 0x88, 0xE1, 0xD5, 0x07, 0x0E, 0x10, 0xEC, 0x56, 0x13, 0xDA, 0x4C, 0x00, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x1E, 0x00, 0x03, 0x01, 0x2F, 0xBE, 0xCA, 0x47, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0xEF, 0xA6 };
var semi25747925 = new SEMI(semiBytes25747925, 868, 0);
var sirtHub = new SIRTHub();
var debugBytes25747925 = new byte[] { 0x0B, 0x10, 0x12, 0x6B, 0x78, 0x41, 0x00, 0x0C, 0x11, 0x0B, 0x11, 0x08, 0x04, 0x02, 0x7C, 0x4C, 0x12, 0x84, 0x15, 0x00, 0x66, 0x00, 0x35, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4A, 0x8F, 0xD2, 0x02, 0x01, 0x01, 0x16, 0x00, 0x1B, 0x02, 0x71, 0x00, 0x00, 0x82, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xA0, 0xA5 };
var debug25747925 = new DEBUG(debugBytes25747925, 0);
if (sirtHub.TryOpen("COM6", out var sirtId, out var frequency))
{
SIRTLogger.State -= Console.WriteLine;
SIRTLogger.Message += Console.WriteLine;
Console.WriteLine($"Listening on: COM6 - {frequency} - {sirtId}");
var task = new LEDTask(frequency, 319017453)
{
//WakeUpCmd = true,
//WakeUpModul = true,
//DelPamSemi = true,
Data = new byte[] { 0x1F, 0x01, 0x08, 0x43, 0x03, 0x63, 0x93, 0x73, 0x22 },
EncryptionKey = "E6C88800DEB868C0D6A84880CE982840".GetBytes(),
IsEncrypted = true,
};
//var siteUrl = "https://1xylemeur.sharepoint.com/sites/geckoSrc/customer/Pub_CSD/Forms/AllItems.aspx";
//var userName = "stoyan.zlatev@xylem.com";
//var password = "****************";
sirtHub.Start(task);
task.Wait();
//var securePassword = new SecureString();
Console.ReadKey();
sirtHub.Close("COM6");
}
//foreach (var c in password)
//{
// securePassword.AppendChar(c);
//}
//using (var context = new ClientContext(siteUrl))
//{
// context.Credentials = new SharePointOnlineCredentials(userName, securePassword);
// var web = context.Web;
// context.Load(web);
// context.ExecuteQuery();
// Console.WriteLine("Site Title: " + web.Title);
//}
}
public class LEDTask : EregisterTask
{
public LEDTask(int frequency, uint address) : base(frequency)
{
this.RequestAddress = address;
}
public byte P811
{
get => this.p811;
set => this.p811 = value;
}
}
//public static void Main()
//{
// SIRTLogger.State += Console.WriteLine;
// var sirtHub = new SIRTHub();
// if (sirtHub.TryOpen("COM6", out var sirtId, out var frequency))
// {
// SIRTLogger.State -= Console.WriteLine;
// SIRTLogger.Message += Console.WriteLine;
// Console.WriteLine($"Listening on: COM6 - {frequency} - {sirtId}");
// var task = new LEDTask(frequency, 319017453)
// {
// //WakeUpCmd = true,
// //WakeUpModul = true,
// //DelPamSemi = true,
// Data = new byte[] { 0x1F, 0x01, 0x08, 0x43, 0x03, 0x63, 0x93, 0x73, 0x22 },
// EncryptionKey = "E6C88800DEB868C0D6A84880CE982840".GetBytes(),
// IsEncrypted = true,
// };
// sirtHub.Start(task);
// task.Wait();
// Console.ReadKey();
// sirtHub.Close("COM6");
// }
//}
//public class LEDTask : EregisterTask
//{
// public LEDTask(int frequency, uint address) : base(frequency)
// {
// this.RequestAddress = address;
// }
// public byte P811
// {
// get => this.p811;
// set => this.p811 = value;
// }
//}
//internal enum AlarmMask
//{
@@ -949,6 +949,8 @@ namespace CordonelAssemblyLine.Model
SetState($"Warte auf Scannereingabe({_scannerPort})");
}
_barScanner.Input = "3238927";
if (_barScanner != null && !string.IsNullOrEmpty(_barScanner.Input))
{
if (_barScanner.Input == "%Cordonel_SAP_100%" || _barScanner.Input == "%Cordonel_SAP_101%")
@@ -1026,7 +1028,7 @@ namespace CordonelAssemblyLine.Model
batch.AddMeter(tryMeter);
tryMeter.Logout();
Log("Try to get PcbID");
_pcbId = tryMeter.GetPcbId();
_pcbId = "250639533"; // tryMeter.GetPcbId();
var hasDetect = !string.IsNullOrEmpty(_pcbId);
File diff suppressed because it is too large Load Diff
@@ -2,6 +2,7 @@
{
using Common.Hardware.SIRT;
using Common.Hardware.SIRT.Tasks;
using Common.Hardware.WaterMeter.eRegister.Features;
using Common.Hardware.WaterMeter.eRegister.Models;
using System;
@@ -136,12 +137,12 @@
break;
}
// if (task.FactoryState == FactoryState.Shipment && !this.runningTasks.IsEmpty)
// {
// lastTask.Label = "GESCHLOSSEN";
// lastTask.NotifyChanged();
// break;
// }
if (task.FactoryState == FactoryState.Shipment && !this.runningTasks.IsEmpty)
{
task.Label = "GESCHLOSSEN";
break;
}
this.UpdateTasksStateInTheQueue(task);
@@ -229,7 +230,6 @@
SerialNr = features.SerialNr,
DelPamTx = true,
WakeUpCmd = true,
WakeUpModul = true,
RequestAddress = features.RequestAddress,
ResponseAddress = features.ResponseAddress,
EncryptionKey = features.EncryptionKey,
@@ -260,10 +260,14 @@
}
catch { }
try
{
this.eregisterFactory.StopProgramming();
}
catch { }
AuftragDbContext.eRegister.Update(this.eregisterFactory.GetEregisterStates());
AuftragDbContext.eRegister_History.Save(this.eregisterFactory.GetEregisterHistories());
this.eregisterFactory.StopProgramming();
}
private void Timer_Elapsed(object _, ElapsedEventArgs args)