Class Transmitter
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
This class handles the transmitting of data from some data source and can send out the data to a LinkedBlock that can communicate it over the ether. This requires a connection to some form of receiver.
public class Transmitter : Antenna, IGroundStationAttachment, IPowerAttachment
- Inheritance
-
Transmitter
- Implements
- Inherited Members
Constructors
Transmitter()
Initializes the the transmitter
public Transmitter()
Fields
BaudRate
[bps] Transmission rate in bits per second
[EditableVariable("bps", 0, false, "", "")]
public double BaudRate
Field Value
ClearIfInaccessible
[-] A flag to clear all messages if inaccessible via some connection. If not, then the messages will remain in queue.
[EditableVariable("-", false, "", "")]
public bool ClearIfInaccessible
Field Value
ForceTransmit
[-] A flag that when enabled will force a transmission of a message
[EditableVariable("-", false, "", "")]
public bool ForceTransmit
Field Value
In_TransmitterMsgQueue
The list of objects queued by the transmitter to be transmitted
public Queue<TelemetryPacket> In_TransmitterMsgQueue
Field Value
LineLoss
[dB] Line Loss from transmitter to antenna
[EditableVariable("dB", false, "", "")]
public double LineLoss
Field Value
Out_TelemetryMsgQueue
The list of messages queued by the transmitter to be sent to the link block
public Queue<TelemetryPacket> Out_TelemetryMsgQueue
Field Value
PacketSize
The number of bytes in each packet that is fixed within the packet list for the data.
[EditableVariable("B", 8, false, "", "")]
public int PacketSize
Field Value
Properties
IsTransmitter
A flag for if this class is a transmitter - overriding the antenna class value.
public override bool IsTransmitter { get; protected set; }
Property Value
IsTransmitting
[-] A flag for if the transmitter is attempting to transmit data
[EditableVariable("-", true, "", "")]
public bool IsTransmitting { get; }
Property Value
NumMessages
[-] The number of messages in the transmitter buffer
[EditableVariable("-", true, "", "")]
public int NumMessages { get; }
Property Value
Methods
BlockLineOfSight()
Blocks all line of sight for all transmitters that are optical transmitters
public void BlockLineOfSight()
CalculateTransmittingPower()
Calculates the transmitting power of the transmitter in its current stage.
protected virtual double CalculateTransmittingPower()
Returns
OnBegin(double)
Called when the 'Component' is beginning
protected override void OnBegin(double time)
Parameters
time
doublecurrent time (seconds)
OnUpdate(double, double)
Called when the 'Component' should update
protected override void OnUpdate(double time, double step)
Parameters
TransmitMessage(Message, string, ulong)
Transmits a custom message that is made as a timed message with the message stored. The nanos is able to adjust the time that the message is transmitted at.
public bool TransmitMessage(Message msg, string key = "", ulong nanos = 0)
Parameters
msg
MessageThe message that will be stored
key
stringThe key of the message to send
nanos
ulong[ns] The timed value of the message
Returns
- bool
A flag whether the message could be transmitted
TransmitObject(object, string)
Adds a custom piece of data (any object that can be serialized) to the transmitter queue, ready to be transmitted.
public bool TransmitObject(object obj, string key = "")
Parameters
Returns
- bool
A successful flag that the message is loaded into the queue
UpdateBaudRate(double, Receiver)
Updates the baud rate of a particular connection between the transmitter and the receiver.
public void UpdateBaudRate(double baudrate, Receiver receiver)
Parameters
UpdateLineOfSight(bool, Receiver)
Updates the line of sight flag for a particular connection with another receiver.
public bool UpdateLineOfSight(bool los, Receiver receiver)
Parameters
los
bool[-] Whether line of sight is reached
receiver
ReceiverThe receiver that is being connected
Returns
- bool
A successful update of the line of sight