Package org.yamcs.tctm
Class AbstractTcTmParamLink
java.lang.Object
com.google.common.util.concurrent.AbstractService
org.yamcs.tctm.AbstractLink
org.yamcs.tctm.AbstractTcTmParamLink
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,SystemParametersProducer,Link,LinkActionProvider,ParameterDataLink,TcDataLink,TmPacketDataLink
- Direct Known Subclasses:
TcpTcTmDataLink,UdpTcTmDataLink
public abstract class AbstractTcTmParamLink
extends AbstractLink
implements TmPacketDataLink, TcDataLink, ParameterDataLink
Base class for TM/TC/parameter links.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.yamcs.tctm.Link
Link.StatusNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandPostprocessorprotected CommandHistoryPublisherprotected AtomicLongprotected PacketPreprocessorprotected AtomicLongprotected ParameterSinkprotected booleanFields inherited from class org.yamcs.tctm.AbstractLink
config, dataInCount, dataOutCount, disabled, eventProducer, LINK_NAMESPACE, linkName, log, timeService, yamcsInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidackCommand(Commanding.CommandId commandId) send an ack in the command history that the command has been sent out of the linkprotected voidfailedCommand(Commanding.CommandId commandId, String reason) Send to command history the failed commandReturns a default linkSpec.voidinit(String instance, String name, YConfiguration config) Called at startup to initialize the link.protected voidinitTc(String instance, YConfiguration config) protected voidinitTm(String instance, YConfiguration config) protected byte[]Postprocesses the command, unless postprocessing is disabled.protected voidprocessPacket(TmPacket tmpkt) Sends the packet downstream for processing.voidsetCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener) voidsetParameterSink(ParameterSink parameterSink) voidsets the tm sink that should get all the tm packetsMethods inherited from class org.yamcs.tctm.AbstractLink
addAction, collectSystemParameters, connectionStatus, dataIn, dataOut, disable, doDisable, doEnable, enable, getAction, getActions, getConfig, getCurrentTime, getDataInCount, getDataOutCount, getDetailedStatus, getEventLoop, getLinkStatus, getName, getParent, getSystemParameters, getYamcsInstance, isDisabled, isRunningAndEnabled, resetCounters, setParent, setupSystemParametersMethods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, doStart, doStop, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.yamcs.tctm.Link
disable, enable, getConfig, getDataInCount, getDataOutCount, getDetailedStatus, getExtraInfo, getLinkStatus, getName, getParent, getSpec, isDisabled, isEffectivelyDisabled, resetCounters, setParent, setupSystemParametersMethods inherited from interface org.yamcs.tctm.ParameterDataLink
isParameterDataLinkImplementedMethods inherited from interface org.yamcs.parameter.SystemParametersProducer
getFrequencyMethods inherited from interface org.yamcs.tctm.TcDataLink
isCommandingAvailable, isTcDataLinkImplemented, sendCommandMethods inherited from interface org.yamcs.tctm.TmPacketDataLink
isTmPacketDataLinkImplemented
-
Field Details
-
cmdPostProcessor
-
commandHistoryPublisher
-
packetCount
-
updateSimulationTime
protected boolean updateSimulationTime -
packetPreprocessor
-
parameterSink
-
parameterCount
-
-
Constructor Details
-
AbstractTcTmParamLink
public AbstractTcTmParamLink()
-
-
Method Details
-
getDefaultSpec
Description copied from interface:LinkReturns a default linkSpec. This can be used in an implementation of {Link.getSpec(). Eventually (after a few years), it is expected to migrate this logic directly into {LinkLink.getSpec(), rather than returning null from there. But we want to give sufficient time for links everywhere to start defining their arguments.- Specified by:
getDefaultSpecin interfaceLink
-
init
Description copied from interface:LinkCalled at startup to initialize the link.The config corresponds to the map that is under the link definition in yamcs.instance.yaml.
- Specified by:
initin interfaceLink- Overrides:
initin classAbstractLinkconfig- - the configuration - cannot be null (but can be empty)- Throws:
ConfigurationException
-
initTc
- Throws:
ConfigurationException
-
initTm
-
postprocess
Postprocesses the command, unless postprocessing is disabled.- Returns:
- potentially modified binary, or
nullto indicate that the command should not be handled further.
-
processPacket
Sends the packet downstream for processing.Starting in Yamcs 5.2, if the updateSimulationTime option is set on the link configuration,
- the timeService is expected to be SimulationTimeService
- at initialization, the time0 is set to 0
- upon each packet received, the generationTime (as set by the pre-processor) is used to update the simulation elapsed time
Should be called by all sub-classes (instead of directly calling
TmSink.processPacket(TmPacket)- Parameters:
tmpkt-
-
failedCommand
Send to command history the failed command -
ackCommand
send an ack in the command history that the command has been sent out of the link- Parameters:
commandId-
-
setCommandHistoryPublisher
- Specified by:
setCommandHistoryPublisherin interfaceTcDataLink
-
setParameterSink
- Specified by:
setParameterSinkin interfaceParameterDataLink
-
setTmSink
Description copied from interface:TmPacketDataLinksets the tm sink that should get all the tm packets- Specified by:
setTmSinkin interfaceTmPacketDataLink
-