Package net.simplace.sim.io.output
Klasse FWSimOutputAdapter
java.lang.Object
net.simplace.sim.io.FWSimIOAdapter
net.simplace.sim.io.output.FWSimOutputAdapter
- Alle implementierten Schnittstellen:
FWSimFieldContainer
- Bekannte direkte Unterklassen:
CacheOutputAdapter,CSVOutputAdapter,DatabaseOutputAdapter,NetCDFOutputAdapter
Abstract implementation for the IO-Adapter for only writing output data This
abstract implementation is
FWSimIOAdapter. It additionally implements
a blocking queue ArrayBlockingQueue that makes it possible to divide
the model output from writing the output to the different interfaces.
Cache size is the number of elements that can be cached in the queue before
the queue will also stop to take elements from the model output.
!!IMPORTANT!! Before finalizing the application it has to be checked, if all
output is written to the FWSimInterfaces resp. the blocking queue is
empty.
reads general information from the xml-structure given as - Autor:
- Andreas Enders
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen net.simplace.sim.io.FWSimIOAdapter
FWSimIOAdapter.FREQUENCE -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected intsize of the temporary output cacheprotected ArrayBlockingQueue<FWSimQueueObjectMap> Queue that temporarily stores output data until the writer is accessibleVon Klasse geerbte Felder net.simplace.sim.io.FWSimIOAdapter
iArrayMode, iFieldcount, iFrequence, iHeaderVariables, iInterface, iJexlRule, iKeyMap, iName, iOrderNumber, iProcessTime, iResourceElement, iSession, iSourceKey -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungFWSimOutputAdapter(String aName, org.jdom2.Element aOutputElement, FWSimInterface<?> aInterface, FWSimIOAdapter.FREQUENCE aFrequence, int aOrderNumber, String aCacheSize, ProcessTime aProcessTime, FWSimSession aSession) called from the graph panel while creating output adaptor.protectedFWSimOutputAdapter(FWSimOutputAdapter aOutputAdapter, FWSimInterface<?> aInterface) should be called from implementations while constructing an updated adapter.protectedFWSimOutputAdapter(org.jdom2.Element aOutputElement, int aOrderNumber, FWSimVarMap aVarMap) should be called from implementations while constructing. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic FWSimOutputAdaptercreateAdapter(org.jdom2.Element aOutputElement, int aOrderNumber, FWSimVarMap aVarMap) static FWSimOutputAdaptercreateOutputFromObservable(FWObservable aObservable, int aOrderNumber) returns list of the input variables given as header informationalways returns empty list.intgetStatisticsResultCache(String aSimulationID) booleanprotected abstract voidinit(FWSimVarMap aVarMap) voidinitialize(FWSimVarMap aVarMap) booleanisActive()booleanfor synchronization purposes checks, if the writing method is still active, even if the queue is emptyvoidreceiveData(FWSimQueueObjectMap aQueueObjectMap) Outputter should write the data to this method - writing is done automatically in another thread.creates HTML Documentation form of the Output Adaptororg.jdom2.ElementtoXML()static FWSimOutputAdapterupdateAdapter(FWSimOutputAdapter aAdapter, FWSimInterface<?> aInterface) voidmethod called by different thread actually writing the data to the given media in SimInterfaceprotected abstract voidwriteData(FWSimQueueObjectMap aObjectToWrite) writes data to the interface - has to be implemented for each adapter individuallyVon Klasse geerbte Methoden net.simplace.sim.io.FWSimIOAdapter
addProcessTime, addVariable, checkCondition, createFormFields, createVariables, finalize, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getHeaderVariables, getHeaderXML, getJexlRule, getKeyMap, getName, getOrderNumber, getVariable, isArrayMode, isConditionCheck, removeVariable, setInterface, setOrderNumber, toString, writeHeaderList
-
Felddetails
-
iQueue
Queue that temporarily stores output data until the writer is accessible -
iCacheSize
protected int iCacheSizesize of the temporary output cache
-
-
Konstruktordetails
-
FWSimOutputAdapter
protected FWSimOutputAdapter(org.jdom2.Element aOutputElement, int aOrderNumber, FWSimVarMap aVarMap) should be called from implementations while constructing.- Parameter:
aOutputElement-aOrderNumber-aVarMap-
-
FWSimOutputAdapter
should be called from implementations while constructing an updated adapter.- Parameter:
aOutputAdapter-aInterface-
-
FWSimOutputAdapter
public FWSimOutputAdapter(String aName, org.jdom2.Element aOutputElement, FWSimInterface<?> aInterface, FWSimIOAdapter.FREQUENCE aFrequence, int aOrderNumber, String aCacheSize, ProcessTime aProcessTime, FWSimSession aSession) called from the graph panel while creating output adaptor.- Parameter:
aName-aOutputElement-aInterface-aFrequence-aOrderNumber-aCacheSize-aProcessTime-aSession-aVarMap-
-
-
Methodendetails
-
initialize
- Parameter:
aVarMap-
-
init
- Parameter:
aVarMap-
-
receiveData
Outputter should write the data to this method - writing is done automatically in another thread.- Parameter:
aQueueObjectMap-
-
writeData
public void writeData()method called by different thread actually writing the data to the given media in SimInterface -
writeData
writes data to the interface - has to be implemented for each adapter individually- Parameter:
aObjectToWrite-aSimulationID-
-
createAdapter
public static FWSimOutputAdapter createAdapter(org.jdom2.Element aOutputElement, int aOrderNumber, FWSimVarMap aVarMap) throws MissingSimResourceException - Parameter:
aOutputElement-aOrderNumber-aVarMap-- Gibt zurück:
- the output Adapter to be created
- Löst aus:
MissingSimResourceException
-
updateAdapter
public static FWSimOutputAdapter updateAdapter(FWSimOutputAdapter aAdapter, FWSimInterface<?> aInterface) throws MissingSimResourceException - Parameter:
aAdapter-aInterface-- Gibt zurück:
- updated FWSimOutputAdapter
- Löst aus:
MissingSimResourceException
-
createOutputFromObservable
public static FWSimOutputAdapter createOutputFromObservable(FWObservable aObservable, int aOrderNumber) throws MissingSimResourceException - Parameter:
aObservable-aOrderNumber-- Gibt zurück:
- the output Adapter to be created
- Löst aus:
MissingSimResourceException
-
getOutputVariables
always returns empty list. No Output expected from this adapter- Gibt zurück:
- FWSimVarables filtered - only output Variables
- Siehe auch:
-
getInputVariables
returns list of the input variables given as header information- Gibt zurück:
- FWSimVarables filtered - only input Variables
- Siehe auch:
-
getResetScript
- Gibt zurück:
- the rule
-
getContentType
- Gibt zurück:
- number in the order of Components
- Siehe auch:
-
getQueueLenth
public int getQueueLenth()- Gibt zurück:
- length of the current queue
-
isActive
public boolean isActive()- Gibt zurück:
- if the Queue is actively running
-
getInterface
- Setzt außer Kraft:
getInterfacein KlasseFWSimIOAdapter- Gibt zurück:
- the connected interface
-
getVarMap
- Gibt zurück:
- number in the order of Components
-
hasStatistics
public boolean hasStatistics()- Gibt zurück:
- if the adapter has statistics
-
getStatisticsHeaderVariables
- Gibt zurück:
- the statistics header variable
-
getStatistics
- Gibt zurück:
- the statistics
-
getStatisticsResultCache
- Parameter:
aSimulationID-- Gibt zurück:
- the statisticsResultCache
-
getStatisticsAdapter
- Gibt zurück:
- the statisticsAdapter
-
toXML
public org.jdom2.Element toXML()- Gibt zurück:
- a xml element with all the settings of this component()
- Siehe auch:
-
toHTMLTablestring
creates HTML Documentation form of the Output Adaptor- Gibt zurück:
- the generated HTMLString
-
isWriting
public boolean isWriting()for synchronization purposes checks, if the writing method is still active, even if the queue is empty- Gibt zurück:
- true if the writing process is still active
-