History window for additional information

This commit is contained in:
Thomas Wiedebusch
2022-03-28 13:23:03 +02:00
parent c015b16f0a
commit 50f15842aa
15 changed files with 1096 additions and 454 deletions
@@ -630,8 +630,8 @@ namespace Xylem.Common.Hardware.Interfaces.Ports.SerialPorts
/// <remarks date="2018-Oct-23" author="T.Wiedebusch">
/// - Doubling of sync byte in protocol behind sync byte itself implemented
/// </remarks>
/// <remarks date="2022-Feb-25" author="T.Wiedebusch">
/// - RTS signal trial as MOXA sometimes takes two messages and combines these two one!
/// <remarks date="2022-Feb-25" author="T.Wiedebusch, R.Drabesch">
/// - Flush buffer as MOXA sometimes takes two messages and combines these two one!
/// As the Genesis needs a separated wake-up message with a following delay before the
/// real payload message, this causes a lot of trouble.
/// </remarks>
@@ -655,18 +655,19 @@ namespace Xylem.Common.Hardware.Interfaces.Ports.SerialPorts
}
}
_serialPort.RtsEnable = true;
_serialPort.Write(txByteList.ToArray(), 0, txByteList.Count);
_serialPort.RtsEnable = false;
OnRawRecordSendOut?.Invoke(this, new ListBytePortDataEventArgs(txByteList, DateTimeOffset.UtcNow));
// flush the buffer for MOXA, to avoid two subsequent communications assembled to one communication!
_serialPort.BaseStream.Flush();
OnRawRecordSendOut?.Invoke(this, new ListBytePortDataEventArgs(txByteList, DateTimeOffset.UtcNow));
}
catch (Exception ex)
{
_byteDataLogger.Error($"{Ident} {ex.Message}");
}
}
#region Prop
#endregion
}
@@ -22,13 +22,6 @@ namespace Xylem.Common.Hardware.Interfaces.Ports.SerialPorts
/// - wakeup burst pattern changed from 2 times 0xF0 to 4 times 0x01,
/// - required delay from 500µs to 1ms between wakeup burst and data.
/// </remarks>
/// <remarks date="2022-Mar-03" author="T.Wiedebusch">
/// - Generated the required delay with an 8 Byte pattern, as MOXA interface collects data
/// and sends it in one burst, meaning it sends the wake up and payload without delay.
/// So including a pattern instead will force this delay. At 115.200 kBit/s a Byte of 8 Bit
/// one start and one stop step resulting in 10 bits with a Byte length of 86.8 µs. An 8
/// Byte pattern will generate a 694 µs delay.
/// </remarks>
protected override void SpecificPortWrite(Byte[] tx)
{
//send wake up burst
@@ -36,8 +29,7 @@ namespace Xylem.Common.Hardware.Interfaces.Ports.SerialPorts
PhysicalWrite(wakeUpBurst);
//delay at least 500 µs
var delayPattern = new Byte[] { 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F };
PhysicalWrite(delayPattern);
Thread.Sleep(1);
//send the IrDA record
PhysicalWrite(tx);