Table of Contents

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

double

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

bool

ForceTransmit

[-] A flag that when enabled will force a transmission of a message

[EditableVariable("-", false, "", "")]
public bool ForceTransmit

Field Value

bool

In_TransmitterMsgQueue

The list of objects queued by the transmitter to be transmitted

public Queue<TelemetryPacket> In_TransmitterMsgQueue

Field Value

Queue<TelemetryPacket>

LineLoss

[dB] Line Loss from transmitter to antenna

[EditableVariable("dB", false, "", "")]
public double LineLoss

Field Value

double

Out_TelemetryMsgQueue

The list of messages queued by the transmitter to be sent to the link block

public Queue<TelemetryPacket> Out_TelemetryMsgQueue

Field Value

Queue<TelemetryPacket>

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

int

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

bool

IsTransmitting

[-] A flag for if the transmitter is attempting to transmit data

[EditableVariable("-", true, "", "")]
public bool IsTransmitting { get; }

Property Value

bool

NumMessages

[-] The number of messages in the transmitter buffer

[EditableVariable("-", true, "", "")]
public int NumMessages { get; }

Property Value

int

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

double

OnBegin(double)

Called when the 'Component' is beginning

protected override void OnBegin(double time)

Parameters

time double

current time (seconds)

OnUpdate(double, double)

Called when the 'Component' should update

protected override void OnUpdate(double time, double step)

Parameters

time double

current time (seconds)

step double

the time step (seconds)

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 Message

The message that will be stored

key string

The 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

obj object

The object to be transmitted across the network

key string

The key of the object to send

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

baudrate double

[bps] The new baudrate

receiver Receiver

[-] The receiver of the connection

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 Receiver

The receiver that is being connected

Returns

bool

A successful update of the line of sight