Running file read

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
2024-11-22 22:05:20 +00:00
parent c76250d3ab
commit 592d87e887
2 changed files with 754 additions and 0 deletions

View File

@@ -0,0 +1,642 @@
+EPICSCAInterface= {
Class = EPICS::EPICSCAClient
StackSize = 1048576
CPUs = 0x1
AutoStart = 0
+PV_STATUS = {
Class = EPICS::EPICSPV
PVName = "MARTE2-DEMO-APP:STATUS"
PVType = int32
}
+PV_COMMAND = {
Class = EPICS::EPICSPV
PVName = "MARTE2-DEMO-APP:COMMAND"
PVType = uint32
Event = {
Destination = StateMachine
PVValue = Function
FunctionMap = {{"2", "GOTOPULSING"}, {"1", "GOTOWAITING_FOR_PRE"}, {"0", "GOTOIDLE"}}
}
}
}
+WebRoot = {
Class = HttpObjectBrowser
Root = "."
+ObjectBrowse = {
Class = HttpObjectBrowser
Root = "/"
}
+ResourcesHtml = {
Class = HttpDirectoryResource
BaseDir = "../../MARTe2/MARTe2/Resources/HTTP/"
}
+HttpMessageInterface = {
Class = HttpMessageInterface
+GOTOIDLE = {
Class = Message
Destination = StateMachine
Function = GOTOIDLE
Mode = ExpectsReply
}
+GOTOWAITING_FOR_PRE = {
Class = Message
Destination = StateMachine
Function = GOTOWAITING_FOR_PRE
Mode = ExpectsReply
}
+GOTOPULSING = {
Class = Message
Destination = StateMachine
Function = GOTOPULSING
Mode = ExpectsReply
}
+GOTOERR = {
Class = Message
Destination = StateMachineError
Function = GOTOERR
Mode = ExpectsReply
}
}
}
+WebServer = {
Class = HttpService
Port = 8084
WebRoot = WebRoot
Timeout = 0
ListenMaxConnections = 255
AcceptTimeout = 1000
MaxNumberOfThreads = 8
MinNumberOfThreads = 1
}
+StateMachine = {
Class = StateMachine
+INITIAL = {
Class = ReferenceContainer
+START = {
Class = StateMachineEvent
NextState = "IDLE"
NextStateError = "IDLE"
Timeout = 0
+StartHttpServer = {
Class = Message
Destination = "WebServer"
Function = "Start"
Mode = ExpectsReply
}
+StartEPICSCAInterface = {
Class = Message
Destination = "EPICSCAInterface"
Mode = ExpectsReply
Function = "Start"
}
+OpenTreeMsg = {
Class = Message
Destination = "MdsLoopApp.Data.MDSWriter"
Function = OpenTree
Mode = ExpectsReply
+Parameters = {
Class = ConfigurationDatabase
param1 = 1
}
}
+ChangeToStateIdleMsg = {
Class = Message
Destination = MdsLoopApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = Idle
}
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+IDLE = {
Class = ReferenceContainer
+GOTOWAITING_FOR_PRE = {
Class = StateMachineEvent
NextState = "WAITING_FOR_PRE"
NextStateError = "IDLE"
Timeout = 0
+ChangeToRunMsg = {
Class = Message
Destination = MdsLoopApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = Online
}
}
+StopCurrentStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StopCurrentStateExecution
Mode = ExpectsReply
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+WAITING_FOR_PRE = {
Class = ReferenceContainer
+ENTER = {
Class = ReferenceContainer
+SetStatusPV = {
Class = Message
Destination = "EPICSCAInterface.PV_STATUS"
Function = CAPut
Mode = ExpectsReply
+Parameters = {
Class = ConfigurationDatabase
param1 = 1
}
}
}
+GOTOPULSING = {
Class = StateMachineEvent
NextState = "PULSING"
NextStateError = "IDLE"
Timeout = 0
+CalcOffSetsMsg = {
Class = "Message"
Destination = "MdsLoopApp.Functions.GAMElectricProbes"
Function = "CalcOffSets"
Mode = "ExpectsReply"
}
+StopCurrentStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StopCurrentStateExecution
Mode = ExpectsReply
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+PULSING = {
Class = ReferenceContainer
+ENTER = {
Class = ReferenceContainer
+SetStatusPV = {
Class = Message
Destination = "EPICSCAInterface.PV_STATUS"
Function = CAPut
Mode = ExpectsReply
+Parameters = {
Class = ConfigurationDatabase
param1 = 2
}
}
}
+GOTOIDLE = {
Class = StateMachineEvent
NextState = "IDLE"
NextStateError = "IDLE"
Timeout = 0
+ChangeToIdleMsg = {
Class = Message
Destination = MdsLoopApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = Idle
}
}
+StopCurrentStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StopCurrentStateExecution
Mode = ExpectsReply
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
+SetStatusPV = {
Class = Message
Destination = "EPICSCAInterface.PV_STATUS"
Function = CAPut
Mode = ExpectsReply
+Parameters = {
Class = ConfigurationDatabase
param1 = 0
}
}
}
}
}
$MdsLoopApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Counter = {
DataSource = Timer
Type = uint32
}
Time = {
Frequency = 10000
DataSource = Timer
Type = uint32
}
Idle_Thread1_CycleTime = {
DataSource = Timings
Alias = "Idle.Thread1_CycleTime"
Type = uint32
}
Run_Thread1_CycleTime = {
DataSource = Timings
Alias = "Online.Thread1_CycleTime"
Type = uint32
}
}
OutputSignals = {
Counter = {
DataSource = DDB1
Type = uint32
}
Time = {
DataSource = DDB1
Type = uint32
}
Idle_Thread1_CycleTime = {
DataSource = DDB1
Type = uint32
}
Run_Thread1_CycleTime = {
DataSource = DDB1
Type = uint32
}
}
}
+GAMFileReader = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = FileReader_DS
Type = uint32
}
Langmuir0 = {
DataSource = FileReader_DS
Type = float32
}
Langmuir1 = {
DataSource = FileReader_DS
Type = float32
}
Langmuir2 = {
DataSource = FileReader_DS
Type = float32
}
Langmuir3= {
DataSource = FileReader_DS
Type = float32
}
}
OutputSignals = {
TimeSdas = {
DataSource = "DDB1"
Type = uint32
}
Langmuir0= {
DataSource = "DDB1"
Type = float32
}
Langmuir1= {
DataSource = "DDB1"
Type = float32
}
Langmuir2= {
DataSource = "DDB1"
Type = float32
}
Langmuir3= {
DataSource = "DDB1"
Type = float32
}
}
}
/*
Langmuir0 = {
DataSource = "DDB1"
Type = float32
}
Langmuir1 = {
DataSource = "DDB1"
Type = float32
}
Langmuir2 = {
DataSource = "DDB1"
Type = float32
}
Langmuir3 = {
DataSource = "DDB1"
Type = float32
}
LangmuirS = {
DataSource = "DDB1"
Type = float32
NumberOfElements = 4
Ranges = {{1,1}}
}
LangmuirS = {
DataSource = "DDB1"
Type = float32
NumberOfElements = 4
Ranges = {{2,2}}
}
LangmuirS = {
DataSource = "DDB1"
Type = float32
NumberOfElements = 4
Ranges = {{3,3}}
}
OutMdsW1 = {
DataSource = FileSignalsWriter
Type = float32
}
OutMdsW2 = {
DataSource = FileSignalsWriter
Type = float32
}
OutMdsW3 = {
DataSource = FileSignalsWriter
Type = float32
}
*/
+GAMSignalsWriter = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = "DDB1"
Type = uint32
}
Langmuir0 = {
DataSource = "DDB1"
Type = float32
}
Langmuir1 = {
DataSource = "DDB1"
Type = float32
}
Langmuir2 = {
DataSource = "DDB1"
Type = float32
}
Langmuir3 = {
DataSource = "DDB1"
Type = float32
}
}
OutputSignals = {
Time = {
DataSource = FileSignalsWriter
Type = uint32
}
OutMdsW0 = {
DataSource = FileSignalsWriter
Type = float32
}
OutMdsW1 = {
DataSource = FileSignalsWriter
Type = float32
}
OutMdsW2 = {
DataSource = FileSignalsWriter
Type = float32
}
OutMdsW3 = {
DataSource = FileSignalsWriter
Type = float32
}
}
}
+GAMElectricProbes = {
Class = ElectricProbesGAM
Gain = 5 //Compulsory
NumberOfSamplesAvg = 4 //Compulsory
ResetInEachState = 0//Compulsory. 1> reset in each state, 0> reset if the previous state is different from the next state
InputSignals = {
Langmuir0 = {
DataSource = "DDB1"
Type = float32
}
Langmuir1 = {
DataSource = "DDB1"
Type = float32
}
Langmuir2 = {
DataSource = "DDB1"
Type = float32
}
Langmuir3 = {
DataSource = "DDB1"
Type = float32
}
}
OutputSignals = {
SignalEP_OutR = {
DataSource = "DDB1"
Type = float32
}
SignalEP_OutZ = {
DataSource = "DDB1"
Type = float32
}
}
}
+GAMMDSWriter = {
Class = IOGAM
InputSignals = {
Langmuir0 = {
DataSource = "DDB1"
Type = float32
}
Langmuir1 = {
DataSource = "DDB1"
Type = float32
}
Langmuir2 = {
DataSource = "DDB1"
Type = float64
}
CycleTime = {
DataSource = Timings
Alias = Idle.Thread1_CycleTime
Type = uint32
}
}
OutputSignals = {
OutMdsW0 = {
DataSource = MDSWriter
Type = float32
}
OutMdsW1 = {
DataSource = MDSWriter
Type = float32
}
OutMdsW2 = {
DataSource = MDSWriter
Type = float64
}
CycleTime = {
DataSource = MDSWriter
Type = uint32
}
}
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = {
Class = GAMDataSource
}
+LoggerDataSource = {
Class = LoggerDataSource
}
+Timings = {
Class = TimingDataSource
}
+Timer = {
Class = LinuxTimer
SleepNature = "Default"
ExecutionMode = RealTimeThread
Signals = {
Counter = {
Type = uint32
}
Time = {
Type = uint32
}
}
}
+FileReader_DS = {
Class = FileDataSource::FileReader
Filename = "../Analysis/LangmuirSdas_46241.csv"
FileFormat = "csv"
CSVSeparator = ","
Interpolate = "no"
Preload = "yes" //Optional
EOF = "Last" // "Rewind"
}
+FileSignalsWriter = {
Class = FileDataSource::FileWriter
NumberOfBuffers = 10000
CPUMask = 1
StackSize = 10000000
Filename = "IsttokOutput.csv"
Overwrite = "yes"
FileFormat = "csv"
CSVSeparator = ","
StoreOnTrigger = 0
Signals = {
Time = {
Type = uint32
}
OutMdsW0 = {
Type = float32
}
OutMdsW1 = {
Type = float32
}
OutMdsW2 = {
Type = float32
}
OutMdsW3 = {
Type = float32
}
}
}
+MDSWriter = {
Class = MDSWriter
NumberOfBuffers = 10 //Compulsory. Number of buffers in the circular buffer defined above. Each buffer is capable of holding a copy of all the DataSourceI signals.
CPUMask = 2 //Compulsory. Affinity assigned to the threads responsible for asynchronously flush data into the MDSplus database.
StackSize = 10000000 //Compulsory. Stack size of the thread above.
TreeName = "isttokoutput" //Compulsory. Name of the MDSplus tree.
PulseNumber = 1 //Optional. If -1 a new pulse will be created and the MDSplus pulse number incremented.
StoreOnTrigger = 0 //Compulsory. If 0 all the data in the circular buffer is continuously stored. If 1 data is stored when the Trigger signal is 1 (see below).
EventName = "updatejScope" //Compulsory. Event sent to jScope when TimeRefresh seconds have elapsed.
TimeRefresh = 5 //Compulsory. An event with the name set in the property EventName is sent to jScope when TimeRefresh seconds have elapsed.
Signals = {
OutMdsW0 = { //As many as required.
NodeName = "\TOP.OUT.OUT0" // node of the tree node
Period = 0.0001 //Compulsory. Period between signal samples.
AutomaticSegmentation = 0
MakeSegmentAfterNWrites = 100
}
OutMdsW1 = { //As many as required.
NodeName = "\TOP.OUT.OUT1"
Period = 0.0001
AutomaticSegmentation = 1
// MakeSegmentAfterNWrites = 100
}
OutMdsW2 = {
NodeName = "\TOP.OUT.OUT2"
Period = 0.0001
AutomaticSegmentation = 0
MakeSegmentAfterNWrites = 100
}
CycleTime = { //As many as required.
NodeName = "\TOP.OUT.Cycle_Time" // node of the tree node
Period = 0.0001
AutomaticSegmentation = 0
MakeSegmentAfterNWrites = 100
}
}
}
}
+States = {
Class = ReferenceContainer
+Idle = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x1
Functions = {GAMTimer }
}
}
}
+Online = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x1
Functions = {GAMTimer GAMFileReader GAMElectricProbes GAMSignalsWriter GAMMDSWriter}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
// vim: syntax=cpp ts=4 sw=4 sts=4 sr et