46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
using System.Collections.Generic;
|
|
using DTS.Common.Enums.DASFactory;
|
|
using DTS.Common.ICommunication;
|
|
|
|
namespace DTS.DASLib.Command.SLICE.DownloadCommands
|
|
{
|
|
public class QueryTotalEventCount : EventDataCommands
|
|
{
|
|
protected override Commands Command => Commands.QueryTotalEventCount;
|
|
private ushort _count;
|
|
|
|
public ushort Count => _count;
|
|
|
|
public QueryTotalEventCount(DTS.Common.Interface.DASFactory.ICommunication sock)
|
|
: base(sock)
|
|
{
|
|
}
|
|
|
|
public QueryTotalEventCount(DTS.Common.Interface.DASFactory.ICommunication sock, int timeoutMillisec)
|
|
: base(sock, timeoutMillisec)
|
|
{
|
|
}
|
|
|
|
protected override CommandReceiveAction WholePackage()
|
|
{
|
|
if (response.Status != DFConstantsAndEnums.CommandStatus.StatusNoError)
|
|
return CommandReceiveAction.StopReceiving;
|
|
if (response.ParameterLength > 0)
|
|
{
|
|
response.GetParameter(0, out _count);
|
|
}
|
|
else { _count = 0; }
|
|
return CommandReceiveAction.StopReceiving;
|
|
}
|
|
|
|
public override void ResponseToString(ref List<List<string>> lines)
|
|
{
|
|
base.ResponseToString(ref lines);
|
|
lines.Add(new List<string>
|
|
{
|
|
$"Count: {Count}"
|
|
});
|
|
}
|
|
}
|
|
}
|