Real-Time Java AOCS Framework v1.0 API Specification

JbedSmmApplication.TelemetryManagement
Class JbedSmmTelemetryStream

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--JbedSmmApplication.TelemetryManagement.JbedSmmTelemetryStream
All Implemented Interfaces:
Configurable, Resettable, Telemeterable, TelemetryStream

public class JbedSmmTelemetryStream
extends AocsObject
implements TelemetryStream

Implement the telemetry stream for the Jbed SMM application. The telemetry data are written to an integer array buffer which is called "the TM Buffer". Boolean variables are encoded as usual with 1 being true and 0 being false. Floating point variables are multiplied by a scaling factor and then converted to integer. A saturation check is introduced to prevent overflow. The telemetry stream internally maintains two TM buffers: the active buffer and the idle buffer. The active buffer is the buffer that is being filled in with telemetry data. The idel buffer is available for forwarding to the telemetry channel. The telemetry stream toggles between the active and idle buffers: After the active buffer has been filled, it becomes the idle buffer and the idle buffer becomes the active buffer.

The telemetry stream maintains a frame counter that is initialized to zero and is incremented by one every time a TM buffer has been completely filled.

The layout of a TM buffer that has been filled is as follows: element [0] contains the number of items N written to the buffer; element [1] contains the frame number; [2..N+1] contain the TM data written to the buffer by the telemetry manager. Change Record:

Copyright: see the Copyright Notice.

Version:
2.1
Author:
V. Cechticky/A. Pasetti (ETH-Zurich)

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
JbedSmmTelemetryStream()
          Create an application specific telemetry stream.
 
Method Summary
 void flushBuffer()
          Toggle the active and idle buffers.
 int getBufferLength()
          Returns a number of items stored in the active TM buffer.
 int getBufferSize()
          Returns the length of the TM buffer in bytes.
 IntArray getIdleBuffer()
          Get the idle buffer.
 int getTelemetryImageLength()
          Return the length in bits of the telemetry image that would be written by the object in response to a call to method writeToTelemetry.
 int getTmScalingFactor()
          Get the scaling factor for the telemetry data.
 boolean isConfigured()
          Checks that the TM buffers have been initialized.
 void resetBuffer()
          Reset the item counter, increment the frame counter and initializes the active buffer with the frame number.
 int scale(double val)
          Transform the argument into an integer suitable for storing in the TM buffer.
 int scale(float val)
          Transform the argument into an integer suitable for storing in the TM buffer.
 void setBufferSize(int bufferSize)
          This method initializes the size of the TM buffers.
 void setIdleBuffer(IntArray newIdleBuffer)
          Set the idle buffer.
 void setTmScalingFactor(int s)
          Set the scaling factor for the telemetry data.
 void write(boolean data)
          Write the boolean 'data' to the telemetry stream
 void write(byte d, int n, int m)
          Write bits n to m of byte 'd' to the telemetry stream This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.
 void write(double data)
          Write the double 'data' to the telemetry stream
 void write(float data)
          Write the float 'data' to the telemetry stream
 void write(int data)
          Write the integer 'd' to the telemetry stream
 void write(int address, int n)
          Write to telemetry stream n bytes starting from address 'address' This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.
 void write(int d, int n, int m)
          Write bits n to m of integer 'd' to the telemetry stream This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.
 void write(short data)
          Write the short integer 'data' to the telemetry stream
 void write(short d, int n, int m)
          Write bits n to m of short 'd' to the telemetry stream This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.
 void writeFrameNumber(int n)
          Write the telemetry frame number to the telemetry stream.
 void writeNumberOfBits(int n)
          Write the number of bits in the current frame to the telemetry stream.
 void writeNumberOfBytes(int n)
          Write the number of bytes in the current frame to the telemetry stream.
 void writeToTelemetry(TelemetryStream tmStream)
          Causes the object to write its own state to the telemetry stream.
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, reset, resetConfiguration, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager, setTelemetryFormat
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JbedSmmTelemetryStream

public JbedSmmTelemetryStream()
Create an application specific telemetry stream.

Method Detail

isConfigured

public boolean isConfigured()
Checks that the TM buffers have been initialized.

Specified by:
isConfigured in interface Configurable
Overrides:
isConfigured in class AocsObject

setIdleBuffer

public void setIdleBuffer(IntArray newIdleBuffer)
Set the idle buffer. This method would ordinarily be called by the component responsible for forwarding the telemetry data to the TM channel.


getIdleBuffer

public IntArray getIdleBuffer()
Get the idle buffer. This method would ordinarily be called by the component responsible for forwarding the telemetry data to the TM channel.


writeFrameNumber

public void writeFrameNumber(int n)
Write the telemetry frame number to the telemetry stream. This method is required by the TelemetryStream interface but has a dummy implementation in the case of Jbed SMM application.

Specified by:
writeFrameNumber in interface TelemetryStream
Parameters:
n - the telemetry frame number.

writeNumberOfBytes

public void writeNumberOfBytes(int n)
Write the number of bytes in the current frame to the telemetry stream. This method is required by the TelemetryStream interface but has a dummy implementation in the case of Jbed SMM application.

Specified by:
writeNumberOfBytes in interface TelemetryStream
Parameters:
n - the number of bytes in the current telemetry frame.

writeNumberOfBits

public void writeNumberOfBits(int n)
Write the number of bits in the current frame to the telemetry stream. This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.

Specified by:
writeNumberOfBits in interface TelemetryStream
Parameters:
n - the number of bits that were written using bit writing methods. The bit writing methods are those that write individual bits to the telemetry stream.

write

public void write(int address,
                  int n)
Write to telemetry stream n bytes starting from address 'address' This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.

Specified by:
write in interface TelemetryStream

write

public void write(double data)
Write the double 'data' to the telemetry stream

Specified by:
write in interface TelemetryStream

write

public void write(float data)
Write the float 'data' to the telemetry stream

Specified by:
write in interface TelemetryStream

write

public void write(int data)
Write the integer 'd' to the telemetry stream

Specified by:
write in interface TelemetryStream

write

public void write(short data)
Write the short integer 'data' to the telemetry stream

Specified by:
write in interface TelemetryStream

write

public void write(boolean data)
Write the boolean 'data' to the telemetry stream

Specified by:
write in interface TelemetryStream

write

public void write(int d,
                  int n,
                  int m)
Write bits n to m of integer 'd' to the telemetry stream This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.

Specified by:
write in interface TelemetryStream

write

public void write(short d,
                  int n,
                  int m)
Write bits n to m of short 'd' to the telemetry stream This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.

Specified by:
write in interface TelemetryStream

write

public void write(byte d,
                  int n,
                  int m)
Write bits n to m of byte 'd' to the telemetry stream This method is required by the TelemetryStream interface but has a dummy implementation in th case of Jbed SMM application.

Specified by:
write in interface TelemetryStream

flushBuffer

public void flushBuffer()
Toggle the active and idle buffers. Before de-activating the active buffer, the number of items written in the buffer is written to its first position.

Specified by:
flushBuffer in interface TelemetryStream

resetBuffer

public void resetBuffer()
Reset the item counter, increment the frame counter and initializes the active buffer with the frame number.

Specified by:
resetBuffer in interface TelemetryStream

setTmScalingFactor

public void setTmScalingFactor(int s)
Set the scaling factor for the telemetry data.

Parameters:
s - the telemetry scaling factor
See Also:
scale(float)

getTmScalingFactor

public int getTmScalingFactor()
Get the scaling factor for the telemetry data.

Returns:
the telemetry scaling factor
See Also:
scale(float)

setBufferSize

public void setBufferSize(int bufferSize)
This method initializes the size of the TM buffers. It should only be called once. Attempts to call it more than once will result in a configuration event being generated. The newly created TM buffers are initialized to contain -1 in every location. This is an initialization method.

Specified by:
setBufferSize in interface TelemetryStream

getBufferSize

public int getBufferSize()
Returns the length of the TM buffer in bytes.

Specified by:
getBufferSize in interface TelemetryStream

getBufferLength

public int getBufferLength()
Returns a number of items stored in the active TM buffer.


writeToTelemetry

public void writeToTelemetry(TelemetryStream tmStream)
Causes the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject

getTelemetryImageLength

public int getTelemetryImageLength()
Return the length in bits of the telemetry image that would be written by the object in response to a call to method writeToTelemetry.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject
Returns:
the length in bits of the telemetry image

scale

public int scale(float val)
Transform the argument into an integer suitable for storing in the TM buffer. The telemetry data are stored in a TM buffer that is implemented as an array of integers. Floating point data are scaled and then converted to integers before being stored in the TM buffer. The scaling factor is a configuration parameter. A saturation check is performed to avoid overflow. Argument values that exceed the saturation threshold are treated as if they were equal to the threshold. The saturation threshold is equal to largest integer.


scale

public int scale(double val)
Transform the argument into an integer suitable for storing in the TM buffer. The telemetry data are stored in a TM buffer that is implemented as an array of integers. Floating point data are scaled and then converted to integers before being stored in the TM buffer. The scaling factor is a configuration parameter. A saturation check is performed to avoid overflow. Argument values that exceed the saturation threshold are treated as if they were equal to the threshold. The saturation threshold is equal to largest integer.


Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland