csd preparations and calculations in the common console
This commit is contained in:
@@ -51,7 +51,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="DEBUGSEMI.txt" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
@@ -69,14 +68,6 @@
|
||||
<Project>{4e8bb839-d40a-488c-88ce-f21811f1f476}</Project>
|
||||
<Name>Common.Hardware.WaterMeter.eRegister</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Hardware\WaterMeter\Genesis\GenesisConfig\GenesisConfig.csproj">
|
||||
<Project>{f013a56b-7be6-4852-9cd8-b971cd1add0c}</Project>
|
||||
<Name>GenesisConfig</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Hardware\WaterMeter\Genesis\GenesisCore\GenesisCore.csproj">
|
||||
<Project>{04201e95-90a0-4b73-a72f-379739b2a3ae}</Project>
|
||||
<Name>GenesisCore</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Hardware\WaterMeter\Genesis\Registers\Registers.csproj">
|
||||
<Project>{f4aaf7e6-7333-4284-b735-e32deb076c64}</Project>
|
||||
<Name>Registers</Name>
|
||||
|
||||
@@ -1,99 +1,60 @@
|
||||
namespace CommonConsole
|
||||
{
|
||||
using Common.Hardware.SIRT;
|
||||
using Common.Hardware.SIRT.Parameters;
|
||||
using Common.Hardware.SIRT.Tasks;
|
||||
using Common.Hardware.WaterMeter.eRegister.Features;
|
||||
using Common.Hardware.WaterMeter.eRegister.Telegrams;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
private static uint[] addresses433 = new uint[]
|
||||
public static void Main()
|
||||
{
|
||||
4291024821,
|
||||
4291175952,
|
||||
4291318920,
|
||||
4291369854,
|
||||
4291577251,
|
||||
4291721523,
|
||||
4291796136,
|
||||
4291922942,
|
||||
4291922963,
|
||||
4291011837,
|
||||
|
||||
};
|
||||
private static uint[] addresses868 = new uint[]
|
||||
{
|
||||
0309018341,
|
||||
0309023213,
|
||||
0309023279,
|
||||
4291094212,
|
||||
4291134308,
|
||||
4291657730,
|
||||
4291759578,
|
||||
4291808024,
|
||||
4291868627,
|
||||
4291922821,
|
||||
4291923131,
|
||||
};
|
||||
}
|
||||
|
||||
private static readonly ConcurrentDictionary<uint, int> addressesWithFrequencies
|
||||
= new ConcurrentDictionary<uint, int>();
|
||||
|
||||
|
||||
internal enum AlarmMask
|
||||
{
|
||||
ALARM_REBOOT = 1 << 0,
|
||||
ALARM_LOW_BATTERY = 1 << 1,
|
||||
ALARM_VERY_LOW_BATTERY = 1 << 2, /* For consistency with st_alarm_bit_t only */
|
||||
ALARM_CONFIG_ERROR = 1 << 3,
|
||||
ALARM_EMPTY_PIPE = 1 << 4,
|
||||
ALARM_MAGNETIC_TAMPER = 1 << 5, /* For consistency with st_alarm_bit_t only */
|
||||
ALARM_REVERSE_FLOW = 1 << 6,
|
||||
ALARM_SUSPECT_LEAK = 1 << 7,
|
||||
ALARM_BROKEN_PIPE = 1 << 8,
|
||||
ALARM_LOW_PRESSURE = 1 << 9,
|
||||
ALARM_HIGH_PRESSURE = 1 << 10,
|
||||
ALARM_LOW_TEMPERATURE = 1 << 11,
|
||||
ALARM_HIGH_TEMPERATURE = 1 << 12,
|
||||
ALARM_RADIO_ERROR = 1 << 13,
|
||||
ALARM_METROLOGY_PARAMS = 1 << 14,
|
||||
ALARM_METROLOGY_MEASURE = 1 << 15,
|
||||
ALARM_MAX = 1 << 16
|
||||
};
|
||||
|
||||
internal enum FDRMask
|
||||
{
|
||||
LOG_BILLING_COUNTER = 0x00000002, //!< BillingCounter
|
||||
LOG_FORWARD_COUNTER = 0x00001000, //!< ForwardCounter
|
||||
LOG_REVERSE_COUNTER = 0x00000004, //!< Backward or ReverseCounter
|
||||
LOG_MIN_FLOW_TIME = 0x00000800, //!< Date/Time of FlowMin
|
||||
LOG_MIN_FLOW_VAL = 0x00000400, //!< Value of FlowMin
|
||||
LOG_BROKEN_PIPE_FLOW_TIME = 0x00000200, //!< Date/Time of BrokenPipe
|
||||
LOG_BROKEN_PIPE_FLOW_VAL = 0x00000100, //!< Value of BrokenPipe
|
||||
LOG_CUR_FLOW_VAL = 0x00000080, //!< Current Flow Value (Average of Period)
|
||||
LOG_PEAK_FLOW_TIME = 0x00000040, //!< Date/Time of PeakFlow
|
||||
LOG_PEAK_FLOW_VAL = 0x00000020, //!< Value of PeakFlow
|
||||
LOG_MAX_FLOW_TIME = 0x00000010, //!< Date/Time of MaxFlow
|
||||
LOG_MAX_FLOW_VAL = 0x00000008, //!< Value of MaxFlow
|
||||
LOG_CUR_TEMP_VAL = 0x02000000, //!< Temperature Current Value
|
||||
LOG_MAX_TEMP_TIME = 0x00800000, //!< Temperature Maximum
|
||||
LOG_MAX_TEMP_VAL = 0x00400000, //!< Temperature Maximum
|
||||
LOG_MIN_TEMP_TIME = 0x00200000, //!< Temperature Minimum
|
||||
LOG_MIN_TEMP_VAL = 0x00100000, //!< Temperature Minimum
|
||||
LOG_CUR_PRESS_VAL = 0x01000000, //!< Pressure Current Value
|
||||
LOG_MAX_PRESS_TIME = 0x00080000, //!< Pressure Maximum Time
|
||||
LOG_MAX_PRESS_VAL = 0x00040000, //!< Pressure Maximum
|
||||
LOG_MIN_PRESS_TIME = 0x00020000, //!< Pressure Minimum Time
|
||||
LOG_MIN_PRESS_VAL = 0x00010000, //!< Pressure Minimum
|
||||
LOG_ALARM_STATE = 0x00000001, //!< AlarmState (16 bits)
|
||||
LOG_EXT_ALARM_STATE = 0x04000000, //<! Extended Alarm Status
|
||||
};
|
||||
//internal enum AlarmMask
|
||||
//{
|
||||
// ALARM_REBOOT = 1 << 0, // immer An
|
||||
// ALARM_LOW_BATTERY = 1 << 1,
|
||||
// ALARM_VERY_LOW_BATTERY = 1 << 2, /* For consistency with st_alarm_bit_t only */
|
||||
// ALARM_CONFIG_ERROR = 1 << 3,
|
||||
// ALARM_EMPTY_PIPE = 1 << 4,
|
||||
// ALARM_MAGNETIC_TAMPER = 1 << 5, /* For consistency with st_alarm_bit_t only */
|
||||
// ALARM_REVERSE_FLOW = 1 << 6,
|
||||
// ALARM_SUSPECT_LEAK = 1 << 7,
|
||||
// ALARM_BROKEN_PIPE = 1 << 8,
|
||||
// ALARM_LOW_PRESSURE = 1 << 9,
|
||||
// ALARM_HIGH_PRESSURE = 1 << 10,
|
||||
// ALARM_LOW_TEMPERATURE = 1 << 11,
|
||||
// ALARM_HIGH_TEMPERATURE = 1 << 12,
|
||||
// ALARM_RADIO_ERROR = 1 << 13,
|
||||
// ALARM_METROLOGY_PARAMS = 1 << 14,
|
||||
// ALARM_METROLOGY_MEASURE = 1 << 15,
|
||||
// ALARM_MAX = 1 << 16
|
||||
//};
|
||||
|
||||
//internal enum FDRMask
|
||||
//{
|
||||
// LOG_BILLING_COUNTER = 0x00000002, //!< BillingCounter
|
||||
// LOG_FORWARD_COUNTER = 0x00001000, //!< ForwardCounter
|
||||
// LOG_REVERSE_COUNTER = 0x00000004, //!< Backward or ReverseCounter
|
||||
// LOG_MIN_FLOW_TIME = 0x00000800, //!< Date/Time of FlowMin
|
||||
// LOG_MIN_FLOW_VAL = 0x00000400, //!< Value of FlowMin
|
||||
// LOG_BROKEN_PIPE_FLOW_TIME = 0x00000200, //!< Date/Time of BrokenPipe
|
||||
// LOG_BROKEN_PIPE_FLOW_VAL = 0x00000100, //!< Value of BrokenPipe
|
||||
// LOG_CUR_FLOW_VAL = 0x00000080, //!< Current Flow Value (Average of Period)
|
||||
// LOG_PEAK_FLOW_TIME = 0x00000040, //!< Date/Time of PeakFlow
|
||||
// LOG_PEAK_FLOW_VAL = 0x00000020, //!< Value of PeakFlow
|
||||
// LOG_MAX_FLOW_TIME = 0x00000010, //!< Date/Time of MaxFlow
|
||||
// LOG_MAX_FLOW_VAL = 0x00000008, //!< Value of MaxFlow
|
||||
// LOG_CUR_TEMP_VAL = 0x02000000, //!< Temperature Current Value
|
||||
// LOG_MAX_TEMP_TIME = 0x00800000, //!< Temperature Maximum
|
||||
// LOG_MAX_TEMP_VAL = 0x00400000, //!< Temperature Maximum
|
||||
// LOG_MIN_TEMP_TIME = 0x00200000, //!< Temperature Minimum
|
||||
// LOG_MIN_TEMP_VAL = 0x00100000, //!< Temperature Minimum
|
||||
// LOG_CUR_PRESS_VAL = 0x01000000, //!< Pressure Current Value
|
||||
// LOG_MAX_PRESS_TIME = 0x00080000, //!< Pressure Maximum Time
|
||||
// LOG_MAX_PRESS_VAL = 0x00040000, //!< Pressure Maximum
|
||||
// LOG_MIN_PRESS_TIME = 0x00020000, //!< Pressure Minimum Time
|
||||
// LOG_MIN_PRESS_VAL = 0x00010000, //!< Pressure Minimum
|
||||
// LOG_ALARM_STATE = 0x00000001, //!< AlarmState (16 bits)
|
||||
// LOG_EXT_ALARM_STATE = 0x04000000, //<! Extended Alarm Status
|
||||
//};
|
||||
|
||||
//var alarm
|
||||
// = FDRMask.LOG_BILLING_COUNTER
|
||||
@@ -109,16 +70,56 @@
|
||||
// | FDRMask.LOG_ALARM_STATE
|
||||
// | FDRMask.LOG_EXT_ALARM_STATE;
|
||||
|
||||
//public static void Main()
|
||||
//{
|
||||
// var alarm = AlarmMask.ALARM_REBOOT
|
||||
// | AlarmMask.ALARM_EMPTY_PIPE
|
||||
// | AlarmMask.ALARM_SUSPECT_LEAK
|
||||
// | AlarmMask.ALARM_BROKEN_PIPE
|
||||
// | AlarmMask.ALARM_LOW_BATTERY
|
||||
// | AlarmMask.ALARM_REVERSE_FLOW
|
||||
// | AlarmMask.ALARM_HIGH_TEMPERATURE;
|
||||
|
||||
// 0B0126B768500A110B118427BAA2C5C18069035350000219BF3621116029186A00986A0000005A0A3
|
||||
// Console.WriteLine($"Alarm: {alarm}");
|
||||
// Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes((int)alarm)));
|
||||
// Console.WriteLine();
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
var hex = "0B-00-12-6B-76-85-00-0A-11-0B-11-08-04-02-7B-AA-2C-5C-18-00-69-00-35-35-00-00-00-00-02-19-BF-36-02-01-01-16-00-29-18-6A-00-00-98-6A-00-00-00-00-00-00-05-A0-A3";
|
||||
var bytes = hex.GetBytes();
|
||||
var debug = new DEBUG(bytes, new P11());
|
||||
// var fdr = FDRMask.LOG_BILLING_COUNTER
|
||||
// | FDRMask.LOG_REVERSE_COUNTER
|
||||
// | FDRMask.LOG_BROKEN_PIPE_FLOW_TIME
|
||||
// | FDRMask.LOG_BROKEN_PIPE_FLOW_VAL
|
||||
// | FDRMask.LOG_PEAK_FLOW_TIME
|
||||
// | FDRMask.LOG_PEAK_FLOW_VAL
|
||||
// | FDRMask.LOG_MAX_FLOW_TIME
|
||||
// | FDRMask.LOG_MAX_FLOW_VAL
|
||||
// | FDRMask.LOG_MAX_TEMP_TIME
|
||||
// | FDRMask.LOG_MAX_TEMP_VAL
|
||||
// | FDRMask.LOG_ALARM_STATE
|
||||
// | FDRMask.LOG_EXT_ALARM_STATE;
|
||||
|
||||
Console.WriteLine((debug.BatterySeconds - 0x02_00_00_00) / 60 / 60 / 24);
|
||||
}
|
||||
// Console.WriteLine($"FDR: {fdr}");
|
||||
// Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes((int)fdr)));
|
||||
// Console.WriteLine();
|
||||
|
||||
// Console.WriteLine($"HErrL: {BitConverter.ToString(BitConverter.GetBytes((short)90))}");
|
||||
// Console.WriteLine();
|
||||
|
||||
// Console.WriteLine("LeakageThreshold");
|
||||
// Console.WriteLine($"DN 40 100 l/h = 100 * 256 = {BitConverter.ToString(BitConverter.GetBytes(100 * 256))}");
|
||||
// Console.WriteLine($"DN 50 100 l/h = 100 * 256 = {BitConverter.ToString(BitConverter.GetBytes(100 * 256))}");
|
||||
// Console.WriteLine($"DN 65 125 l/h = 125 * 256 = {BitConverter.ToString(BitConverter.GetBytes(125 * 256))}");
|
||||
// Console.WriteLine($"DN 80 125 l/h = 125 * 256 = {BitConverter.ToString(BitConverter.GetBytes(125 * 256))}");
|
||||
// Console.WriteLine($"DN 100 125 l/h = 125 * 256 = {BitConverter.ToString(BitConverter.GetBytes(125 * 256))}");
|
||||
// Console.WriteLine($"DN 125 500 l/h = 500 * 256 = {BitConverter.ToString(BitConverter.GetBytes(500 * 256))}");
|
||||
// Console.WriteLine($"DN 150 375 l/h = 375 * 256 = {BitConverter.ToString(BitConverter.GetBytes(375 * 256))}");
|
||||
// Console.WriteLine();
|
||||
|
||||
|
||||
// Console.WriteLine("BrokenPipeThreshold");
|
||||
// Console.WriteLine($"DN 40 50 m³/h = 50 * 256 * 1000 = {BitConverter.ToString(BitConverter.GetBytes( 50 * 256 * 1000))}");
|
||||
// Console.WriteLine($"DN 80 125 m³/h = 125 * 256 * 1000 = {BitConverter.ToString(BitConverter.GetBytes(125 * 256 * 1000))}");
|
||||
// Console.WriteLine($"DN 150 250 m³/h = 250 * 256 * 1000 = {BitConverter.ToString(BitConverter.GetBytes(250 * 256 * 1000))}");
|
||||
// Console.WriteLine();
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user