Class GroundSensorCommandPacket
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
Represents a command packet for tasking a ground sensor.
public class GroundSensorCommandPacket : IComparable<GroundSensorCommandPacket>
- Inheritance
-
GroundSensorCommandPacket
- Implements
Constructors
GroundSensorCommandPacket(string)
Attempts to parse a string into a CommandPacket.
public GroundSensorCommandPacket(string data)
Parameters
data
stringThe string to load from
GroundSensorCommandPacket(string, int, string, double, AccessMessage, double)
Constructor to create a new CommandPacket.
public GroundSensorCommandPacket(string sensorId, int priority, string taskType, double timestamp, AccessMessage inAccessMsg, double duration = 60)
Parameters
sensorId
stringThe ID of the sensor to target.
priority
intThe priority of the command.
taskType
stringThe type of task to execute.
timestamp
doubleThe timestamp (in UTC) for command execution.
inAccessMsg
AccessMessageThe access message that contains properties for the ground sensor
duration
doubleThe duration to spend sensing
GroundSensorCommandPacket(string, int, string, double, Dictionary<string, object>, double)
Constructor to create a new CommandPacket.
public GroundSensorCommandPacket(string sensorId, int priority, string taskType, double timestamp, Dictionary<string, object> taskDetails, double duration = 60)
Parameters
sensorId
stringThe ID of the sensor to target.
priority
intThe priority of the command.
taskType
stringThe type of task to execute.
timestamp
doubleThe timestamp (in UTC) for command execution.
taskDetails
Dictionary<string, object>Additional details about the task.
duration
doubleThe duration that the sensor should sense for for this task
Fields
In_AccessMsg
Define an access message that can help direct the command.
public AccessMessage? In_AccessMsg
Field Value
Properties
CommandID
The unique ID of the command.
public Guid CommandID { get; }
Property Value
Duration
The duration that the sensor should spend sensing
public double Duration { get; }
Property Value
Priority
The priority of the command. Higher values indicate higher priority.
public int Priority { get; }
Property Value
SensorID
The ID of the sensor to which this command is targeted.
public string SensorID { get; }
Property Value
TaskDetails
The details of the task associated with the command.
public Dictionary<string, object> TaskDetails { get; }
Property Value
TaskType
The type of task associated with the command.
public string TaskType { get; }
Property Value
Timestamp
The timestamp (in UTC) at which the command should be executed.
public double Timestamp { get; }
Property Value
Methods
CompareTo(GroundSensorCommandPacket?)
Compares this command to another, prioritizing by timestamp and then by priority.
public int CompareTo(GroundSensorCommandPacket? other)
Parameters
other
GroundSensorCommandPacketThe command to compare with.
Returns
- int
A value less than 0 if this command has a lower priority. 0 if both have the same priority and timestamp. A value greater than 0 if this command has a higher priority.
ParseString(string)
Converts the command packet to a string for serialization.
public void ParseString(string data)
Parameters
data
stringThe data that was valid as a string
ToString()
Provides a string representation of the command packet.
public override string ToString()