laser service

This commit is contained in:
Stoyan Zlatev
2025-11-28 10:01:46 +01:00
parent a4e4ee6f90
commit 4712139841
15 changed files with 361 additions and 155 deletions
@@ -171,7 +171,7 @@
</site>
<site name="MeterProcessState(2)" id="4">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\LAA_PRODUCTION\Common\Service\MeterProcessState" />
<virtualDirectory path="/" physicalPath="C:\Users\SZLATEV\source\repos\laa_production\Common\Service\MeterProcessState" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:50075:localhost" />
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<appSettings>
<add key="LocalFolder" value="\\sla12file\vorlagen\Stoyan"/>
<add key="SharedFolder" value="\\sla12file\auftrag\Stoyan"/>
</appSettings>
</configuration>
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6746517C-BE89-4637-A283-0A932A50497A}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Common.Services.LaserImport</RootNamespace>
<AssemblyName>Common.Services.LaserImport</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,78 @@
namespace Common.Services.LaserImport
{
using System;
using System.Configuration;
using System.IO;
using System.Threading;
class Program
{
static readonly KeyValueConfigurationCollection appsettings
= ConfigurationManager
.OpenExeConfiguration(typeof(Program).Assembly.Location)
.AppSettings
.Settings;
static readonly string sharedFolder = appsettings["SharedFolder"].Value;
static readonly string localFolder = appsettings["LocalFolder"].Value;
static readonly FileSystemWatcher serverWatcher = new FileSystemWatcher(sharedFolder);
static readonly FileSystemWatcher clientWhatcher = new FileSystemWatcher(localFolder);
static void Main()
{
serverWatcher.Created += ServerWatcher_FileCreated;
serverWatcher.NotifyFilter = NotifyFilters.FileName;
serverWatcher.EnableRaisingEvents = true;
clientWhatcher.Deleted += CleintWatcher_FileDeleted;
clientWhatcher.NotifyFilter = NotifyFilters.FileName;
clientWhatcher.EnableRaisingEvents = true;
Console.ReadKey();
}
private static void CleintWatcher_FileDeleted(object sender, FileSystemEventArgs args)
{
var fileFile = args.FullPath;
Console.WriteLine($"{fileFile} - deleted");
var filePath = Path.Combine(sharedFolder, args.Name);
if (File.Exists(filePath))
{
File.Delete(filePath);
Console.WriteLine($"{filePath} - deleted");
}
}
private static void ServerWatcher_FileCreated(object sender, FileSystemEventArgs args)
{
var sourceFilePath = args.FullPath;
Console.WriteLine($"{sourceFilePath} - created");
if (File.Exists(sourceFilePath))
{
var destinationFilePath = Path.Combine(localFolder, args.Name);
while (true)
{
Thread.Sleep(100);
try
{
File.Copy(sourceFilePath, destinationFilePath, true);
break;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
Console.WriteLine($"{sourceFilePath} copied to {destinationFilePath}");
}
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common.Services.LaserImport")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Common.Services.LaserImport")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6746517c-be89-4637-a283-0a932a50497a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+75
View File
@@ -374,6 +374,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FM2014Config", "Hardware\Wa
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FM2014Core", "Hardware\WaterMeter\MechanicalMeter\FM2014\FM2014Core\FM2014Core.csproj", "{0B205BE7-90CD-4C3A-8EBD-1E414E39528A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Services.LaserImport", "Common.Services.LaserImport\Common.Services.LaserImport.csproj", "{6746517C-BE89-4637-A283-0A932A50497A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4
@@ -6508,6 +6510,78 @@ Global
{0B205BE7-90CD-4C3A-8EBD-1E414E39528A}.XP32bit|x64.Build.0 = XP32bit|x64
{0B205BE7-90CD-4C3A-8EBD-1E414E39528A}.XP32bit|x86.ActiveCfg = XP32bit|x86
{0B205BE7-90CD-4C3A-8EBD-1E414E39528A}.XP32bit|x86.Build.0 = XP32bit|x86
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.COM|x86.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|x64.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|x64.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|x86.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Debug|x86.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.PerformTest|x86.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.Release|x86.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.ReleaseTest|x86.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|x64.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.VPN_Debug|x86.Build.0 = Debug|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x64.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x64.Build.0 = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x86.ActiveCfg = Release|Any CPU
{6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -6661,6 +6735,7 @@ Global
{5DFED68B-2113-4E5A-98ED-9DC07D3D39C8} = {AABD04D6-E911-4B1A-9D0B-9D0DD7E4DDC5}
{3862D89C-E32D-4182-BB58-38777D43EDD9} = {5DFED68B-2113-4E5A-98ED-9DC07D3D39C8}
{0B205BE7-90CD-4C3A-8EBD-1E414E39528A} = {5DFED68B-2113-4E5A-98ED-9DC07D3D39C8}
{6746517C-BE89-4637-A283-0A932A50497A} = {696A94BE-7237-4AE2-9E36-6059DE519971}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164}
+22 -22
View File
@@ -8,31 +8,31 @@
{
static void Main()
{
SIRTLogger.Message += Console.WriteLine;
var broadcaster = new SIRTBroadcaster("COM6");
broadcaster.Open();
//SIRTLogger.Message += Console.WriteLine;
//var broadcaster = new SIRTBroadcaster("COM6");
//broadcaster.Open();
if (broadcaster.IsOpen)
{
var task = new WritePamTask
{
Frequency = 868,
WakeUpCmd = true,
WakeUpModul = true,
RequestAddress = 4291377829,
IsEncrypted = true,
EncryptionKey = "E6C88800DEB868C0D6A84880CE982840".GetEncryptionKey()
};
//if (broadcaster.IsOpen)
//{
// var task = new WritePamTask
// {
// Frequency = 868,
// WakeUpCmd = true,
// WakeUpModul = true,
// RequestAddress = 4291377829,
// IsEncrypted = true,
// EncryptionKey = "E6C88800DEB868C0D6A84880CE982840".GetEncryptionKey()
// };
while (task.State != SIRTTaskState.Completed)
{
broadcaster.Start(task);
task.Wait();
}
}
// while (task.State != SIRTTaskState.Completed)
// {
// broadcaster.Start(task);
// task.Wait();
// }
//}
Console.ReadKey();
broadcaster.Close();
//Console.ReadKey();
//broadcaster.Close();
}
static void Main2435()
@@ -64,7 +64,6 @@
<Compile Include="Parameters\RSSI.cs" />
<Compile Include="Parameters\SirtOperating.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SensusRF\SirtCom.cs" />
<Compile Include="SIRTBroadcaster.cs" />
<Compile Include="SIRTConstants.cs" />
<Compile Include="SIRTExtensions.cs" />
@@ -1,89 +0,0 @@
namespace Common.Hardware.SIRT.SensusRF
{
using System;
using System.Collections.Generic;
using System.IO.Ports;
internal class SirtCom
{
private readonly SerialPort serialPort;
public SirtCom(string portName)
=> this.serialPort = new SerialPort
{
BaudRate = 115200,
DataBits = 8,
Parity = Parity.None,
PortName = portName,
StopBits = StopBits.One
};
public bool Close()
{
try
{
this.serialPort.Close();
return this.serialPort.IsOpen;
}
catch
{
return false;
}
}
public bool Open()
{
this.Close();
try
{
this.serialPort.Open();
return this.serialPort.IsOpen;
}
catch
{
return false;
}
}
public IEnumerable<byte[]> ReadBytes()
{
var buffer = default(byte[]);
var length = default(int);
while (true)
{
buffer = new byte[this.serialPort.ReadBufferSize];
try
{
length = this.serialPort.Read(buffer, 0, buffer.Length);
Array.Resize(ref buffer, length);
}
catch
{
buffer = Array.Empty<byte>();
}
yield return buffer;
}
}
public bool WriteBytes(params byte[] bytes)
{
try
{
this.serialPort.Write(bytes, 0, bytes.Length);
return true;
}
catch
{
return false;
}
}
}
}
@@ -94,8 +94,6 @@
public override void Receive(SIRTMessage response)
{
this.AnyTelegramReceived = true;
if (response.Command == SIRTConstants.ACKN_ANSW)
{
this.DecriptResponse(response);
@@ -103,7 +101,7 @@
}
else if (response.Command == SIRTConstants.FROM_AIR)
{
var payload = response.Payload;
var payload = response?.Payload;
if (this.UseEncryption(response))
{
@@ -116,20 +114,24 @@
if (type == SIRTConstants.BUP)
{
this.AnyTelegramReceived = true;
this.BUPReceived?.Invoke(response);
}
else if (type == SIRTConstants.LAT)
{
this.latReceived = true;
this.AnyTelegramReceived = true;
this.LATReceived?.Invoke(response);
}
else if (type == SIRTConstants.DEBUG)
{
this.debugReceived = true;
this.AnyTelegramReceived = true;
this.DEBUGReceived?.Invoke(response);
}
else if (type == SIRTConstants.SEMI)
{
this.AnyTelegramReceived = true;
this.SEMIReceived?.Invoke(response);
}
else
@@ -165,9 +167,9 @@
Frequency = this.Frequency,
SirtId = this.SirtId,
};
this.SetRunning();
this.MessageSent?.Invoke(this.request);
this.SetRunning();
return message.GetBytes();
}
@@ -219,11 +221,31 @@
}
protected virtual bool UseEncryption(SIRTMessage response)
=> response != null
&& response.Payload != null
&& response.Payload.Length > 2
&& response.Payload.GetCrc() != 0;
protected virtual bool UseEncryption(SIRTMessage response)
{
if (response is null)
{
return false;
}
var payload = response.Payload;
if (payload is null)
{
return false;
}
var payloadLength = payload.Length;
if (payloadLength == 0)
{
return false;
}
this.IsEncrypted = payload.GetCrc() != 0;
return this.IsEncrypted;
}
private byte[] EncryptRequest()
{
@@ -18,9 +18,9 @@
{
private readonly ConcurrentQueue<EregisterTask> runningTasks;
private readonly EregisterProgrammingParameters parameters;
private readonly SIRTHub sirtHub;
private readonly EregisterHistory history;
private readonly EregisterState state;
private readonly SIRTHub sirtHub;
private string executionType;
@@ -260,23 +260,22 @@
var frequency = this.parameters.Frequency;
if (this.executionType == nameof(this.LoadInspectionInitializationTasks))
this.runningTasks.Enqueue(new EregisterTask(frequency)
{
this.runningTasks.Enqueue(new EregisterTask(frequency)
{
Name = "WUP",
SlotNr = features.SlotNr,
PoNr = features.PoNr,
SerialNr = features.SerialNr,
RequestAddress = features.RequestAddress,
ResponseAddress = features.ResponseAddress,
EncryptionKey = features.EncryptionKey,
Data = new ChangeWakeUp(WakeUpMode.StayAwake)
Name = "WUP",
WakeUpCmd = true,
WakeUpModul = true,
SlotNr = features.SlotNr,
PoNr = features.PoNr,
SerialNr = features.SerialNr,
RequestAddress = features.RequestAddress,
ResponseAddress = features.ResponseAddress,
EncryptionKey = features.EncryptionKey,
Data = new ChangeWakeUp(WakeUpMode.StayAwake)
.Append(new ChangeNumberOfLatWindows(this.parameters.LatWindowsInitialization))
.Append(new ChangeTransmissionInterval(this.parameters.TransmissionIntervalInitialization))
.Append(new ProvidePin(AuthLevel.II)),
});
}
});
this.runningTasks.Enqueue(new EregisterCheckInitializationTask(this.parameters, frequency)
{
@@ -77,12 +77,12 @@
+ $"eingebaute E-Register mit Funkadressen: {this.RequestAddress} | {this.ResponseAddress}, "
+ $"sind folgenden Fehler aufgetreten:{Environment.NewLine}{Environment.NewLine}{errors}";
this.Name = "Final Check ✘";
this.ErrorMessage = new ErrorMessage
{
Title = "Fehler bei der Prüfungsabschluss",
Text = errors
};
//this.Name = "Final Check ✘";
//this.ErrorMessage = new ErrorMessage
//{
// Title = "Fehler bei der Prüfungsabschluss",
// Text = errors
//};
}
}
}
@@ -78,6 +78,8 @@
this.DEBUGMessage = default(DEBUG);
this.SEMIMessage = default(SEMI);
this.AnyTelegramReceived = false;
this.debugReceived = false;
this.latReceived = false;
if (this.FactoryState == FactoryState.Shipment)
{
@@ -178,17 +180,18 @@
}
else if (this.SEMIMessage.PAMStatus != PAMStatus.OK)
{
this.Label = "!OK";
this.countFailures++;
if (this.countFailures >= 2)
{
this.Label = "!OK";
this.SetCancelled();
}
else
{
this.Label = this.SEMIMessage.PAMStatus.ToString();
this.SetPending();
}
this.countFailures++;
}
else
{
@@ -203,13 +206,32 @@
this.SetPending();
}
protected override Boolean UseEncryption(SIRTMessage response)
protected override bool UseEncryption(SIRTMessage response)
{
var payloadLength = response.Payload.Length;
return (payloadLength == 13 && base.UseEncryption(response))
|| payloadLength == 54
|| payloadLength == 93;
if (response is null)
{
return false;
}
var payload = response.Payload;
if (payload is null)
{
return false;
}
var payloadLength = payload.Length;
if (payloadLength == 0)
{
return false;
}
this.IsEncrypted = (payloadLength == 13 && payload.GetCrc() != 0) // is bup encrypted
|| response.Payload.Length == 54 // is debug encrypted
|| response.Payload.Length == 93; // is semi encrypted
return this.IsEncrypted;
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
<add key="ConnectionString" value="Server=SLASQL01.emea.sensus.net; Database=Auftrag; User ID=sa; Password=sqlserver;" />
<add key="EncryptionKeisUrl" value="http://sla12iis01.emea.sensus.net/LaaProductionWeb/api/eregister/radiokey/byserialno/{0}" />
<add key="SIRTComPorts" value="COM6,COM8" />
<add key="PSNR" value="1001" />
<add key="PSNR" value="1000" />
<add key="SIRT_433" value=""/>
<add key="SIRT_868" value=""/>
</appSettings>
@@ -101,8 +101,8 @@
SELECT CAST((SELECT DISTINCT *
FROM VieweRegisterProgrammingParameters
WHERE SharedId = @{nameof(sharedId)}
AND Completed = @{nameof(completed)}
AND SlotNr > 0
-- AND Completed = @{nameof(completed)}
-- AND SlotNr > 0
FOR XML PATH('{nameof(EregisterProgrammingParameters)}')
, ROOT('{nameof(EregisterProgrammingParametersList)}'))
AS XML)")