changed LED state from 4 to 7 in

This commit is contained in:
2026-07-02 21:47:14 +02:00
parent 110b880304
commit 3c5a28f69d
73 changed files with 17282 additions and 13066 deletions
@@ -205,7 +205,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.common
private const double GAL_TO_LITER = 3.785411784;
public void UpdateFromSmart(
DiagnosticLedState4Data data,
DiagnosticLedState7Data data,
int counter,
float refFlow,
ref double volumeRawExtLast,
@@ -7,9 +7,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication.C4.diagnosticLed.
{
private readonly Common.Unit _unitFlow;
private readonly Common.Unit _unitVolume;
private readonly DiagnosticLedState4Data _data;
private readonly DiagnosticLedState7Data _data;
public DiagnostigLedDataByUnit(Common.Unit unitFlow, Common.Unit unitVolume, DiagnosticLedState4Data data)
public DiagnostigLedDataByUnit(Common.Unit unitFlow, Common.Unit unitVolume, DiagnosticLedState7Data data)
{
this._unitFlow = unitFlow;
this._unitVolume = unitVolume;
@@ -17,7 +17,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication.C4.diagnosticLed.
}
public Common.Unit Unit => _unitVolume;
public DiagnosticLedState4Data Data => _data;
public DiagnosticLedState7Data Data => _data;
public double RawFlow {
get { return UnitVolume(_unitFlow, _data.RawFlow); }
@@ -185,7 +185,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication
RadioService headService = new RadioService(serialDriver);
bool optTestMode = headService.SetOptTestMode(iperlHead);
if (iperlHead.ConfigStruct != null)
iperlHead.ConfigStruct.OpthoStatusMode = optTestMode ? DiagnosticLedState.State4 : DiagnosticLedState.StatusUnknown;
iperlHead.ConfigStruct.OpthoStatusMode = optTestMode ? DiagnosticLedState.State7 : DiagnosticLedState.StatusUnknown;
return optTestMode;
}
}
@@ -162,7 +162,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication
serialDriver.Open();
}
//Set LED to state 4
//Set State to Active 02
byte[] request = new IperlHatFrameBuilder()
.RequestResponse(true)
.AddCommand(ProtocolCommand.SetState)
@@ -192,7 +192,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication
serialDriver.Open();
}
//Set Activity State Idle
//Set Activity State Idle 01
byte[] request = new IperlHatFrameBuilder()
.RequestResponse(true)
.AddCommand(ProtocolCommand.SetState)
@@ -222,11 +222,11 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication
serialDriver.Open();
}
//Set LED to state 4
//Set LED to state 7
var request = new IperlHatFrameBuilder()
.RequestResponse(true)
.AddDeviceCommand(ProtocolDeviceSubCommand.SetDiagnosticLEDState)
.AddPayload(DiagnosticLedState.State4)
.AddPayload(DiagnosticLedState.State7)
.BuildBytes();
byte[] rawData = serialDriver.SendAndWait(request, 5000);
@@ -241,7 +241,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication
log.Debug("SetOptTestMode isOK: " + isOk);
if (decoded.IsOk && iHead.ConfigStruct != null)
{
iHead.ConfigStruct.OpthoStatusMode = DiagnosticLedState.State4;
iHead.ConfigStruct.OpthoStatusMode = DiagnosticLedState.State7;
}
return isOk;
@@ -894,7 +894,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
/// Read configuration
if (ihead.OptoHeadTest.ReadConfiguration(DiagnosticLedState.State4))
if (ihead.OptoHeadTest.ReadConfiguration(DiagnosticLedState.State7))
{
error = CommErr.None;
//read, set and create ConfigStruct is set directly in method ReadConfiguration
@@ -940,7 +940,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
//I will do communication to meter now
DiagnosticLedState testModeConfig = DiagnosticLedState.State4; /// Default value
DiagnosticLedState testModeConfig = DiagnosticLedState.State7; /// Default value
///
if (ihead.OptoHeadTest.SetTestMode())
@@ -1020,7 +1020,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
bool synchronized2;
string partOfTelegram;
DiagnosticLedParser parser = new DiagnosticLedParser(DiagnosticLedState.State4);
DiagnosticLedParser parser = new DiagnosticLedParser(DiagnosticLedState.State7);
/// <summary>
/// Reads opto-datastream via serial port. Invoked from RunDeviceBefore()
@@ -1052,8 +1052,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
if (optoState == DataStreamState.ProcessAndSave)
{
DiagnosticLedState4Data data =
(DiagnosticLedState4Data)parser.ParseLine(line, false);
DiagnosticLedState7Data data =
(DiagnosticLedState7Data)parser.ParseLine(line, false);
int bufferIx = BufferIdx(optoDataCount);
@@ -1089,8 +1089,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
else
{
// Flush mode
DiagnosticLedState4Data data =
(DiagnosticLedState4Data)parser.ParseLine(line, false);
DiagnosticLedState7Data data =
(DiagnosticLedState7Data)parser.ParseLine(line, false);
flowDirectionDetection.WriteToFifo(volumeRawExtLast, timestampExtLast);
}
@@ -1705,14 +1705,14 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
{
try
{
DiagnosticLedState4Data data =
(DiagnosticLedState4Data)parser.ParseLine(readOptoDataWithTimeout, false);
DiagnosticLedState7Data data =
(DiagnosticLedState7Data)parser.ParseLine(readOptoDataWithTimeout, false);
volumeLtr = data.RawVolume;
break;
}
catch (Exception ex)
{
log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
log.Warn($"Parsing DiagnosticLedState7Data: {ex.Message}");
}
}
}
@@ -1779,14 +1779,14 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
{
try
{
DiagnosticLedState4Data data =
(DiagnosticLedState4Data)parser.ParseLine(readOptoDataWithTimeout, false);
DiagnosticLedState7Data data =
(DiagnosticLedState7Data)parser.ParseLine(readOptoDataWithTimeout, false);
volumeLtr0 = data.RawVolume;
break;
}
catch (Exception ex)
{
log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}");
log.Warn($"Parsing DiagnosticLedState7Data: {ex.Message}");
}
}
}