Exemplo n.º 1
0
 /// <summary>
 /// Builds text for reading logging.
 /// </summary>
 protected string BuildReadingText(byte[] buffer, int index, int bytesToRead, int bytesRead)
 {
     return("Receive (" + bytesRead + "/" + bytesToRead + "): " +
            ScadaUtils.BytesToString(buffer, index, Math.Min(bytesRead, MaxLoggingSize)) +
            (bytesRead <= MaxLoggingSize ? "" : "...") +
            (bytesToRead > 0 ? "" : "no data"));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Builds text for writing logging.
 /// </summary>
 protected string BuildWritingText(byte[] buffer, int index, int bytesToWrite)
 {
     return("Send (" + bytesToWrite + "): " +
            ScadaUtils.BytesToString(buffer, index, Math.Min(bytesToWrite, MaxLoggingSize)) +
            (bytesToWrite <= MaxLoggingSize ? "" : "..."));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Builds a log text about writing data.
 /// </summary>
 protected static string BuildWriteLogText(byte[] buffer, int offset, int count, ProtocolFormat format)
 {
     return($"{CommPhrases.SendNotation} ({count}): " +
            ScadaUtils.BytesToString(buffer, offset, count, format == ProtocolFormat.Hex));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Builds a log text about reading data.
 /// </summary>
 protected static string BuildReadLogText(byte[] buffer, int offset, int readCnt, ProtocolFormat format)
 {
     return($"{CommPhrases.ReceiveNotation} ({readCnt}): " +
            ScadaUtils.BytesToString(buffer, offset, readCnt, format == ProtocolFormat.Hex));
 }