Version = "$Id: MARTe-fileread.cfg,v 1.1 2011/04/06 11:30:36 aneto Exp $"
LoggerAddress = "localhost"
DefaultCPUs = 8
+WEB = {
    Class = HttpGroupResource
    +BROWSE = {
        Title = "Http Object Browser"
        Class = HttpGCRCBrowser
        AddReference = {MARTe StateMachine OBJBROWSE THRBROWSE CFGUpload MATLABSupport}
    }
}
+HTTPSERVER = {
    Class = HttpService
    Port = 8084
    HttpRelayURL = "ignore.me:1234"
    VerboseLevel = 10
    Root = WEB
}
+OBJBROWSE = {
    Class = HttpClassListResource
}
+THRBROWSE = {
    Class = HttpThreadListResource
}
+MATLABSupport = {
    Class = MATLABHandler
}
+CFGUpload = {
    Class = CFGUploader
}
+StateMachine = {
    Class = StateMachine
    VerboseLevel = 10
    +INITIAL = {
        Class = StateMachineState
        StateCode = 0x0
        +START = {
            Class = StateMachineEvent
            NextState = IDLE
            Value = START
            +STARTALL = {
                Class = MessageDeliveryRequest
                Sender = StateMachine
                Destinations = "HTTPSERVER MARTe"
                MsecTimeOut = 1000
                Flags = NoReply
                Message = {
                    Class = Message
                    Content = START
                }
            }
        }
    }
    +IDLE = {
        Class = StateMachineState
        StateCode = 0x500
        +PULSE_SETUP_COMPLETED = {
            Class = StateMachineEvent
            Code = 0x701
            NextState = WAITING_FOR_PRE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = MARTe
                +MESSAGE = {
                    Class = Message
                    Content = PREPULSECHECK
                }
            }
            +UPDATE_GAP = {
                Class = MessageEnvelope
                Destination = MATLABSupport
                +MESSAGE = {
                    Class = Message
                    Content = AUTODETECT
                }
            }
        }
        +INHIBIT = {
            Class = StateMachineEvent
            Code = 0x704
            NextState = INHIBIT
        }
        +ACTIVATE = {
            Class = StateMachineEvent
            Code = 0x705
            NextState = SAMESTATE
        }
        +UNRECOVERABLE = {
            Class = StateMachineEvent
            Code = 0x776
            NextState = UNRECOVERABLE
        }
        +CONFIG_ERROR = {
            Class = StateMachineEvent
            Code = 0x777
            NextState = CONFIG_ERROR
        }
        +CONFIG_OK = {
            Class = StateMachineEvent
            Code = 0x778
            NextState = SAMESTATE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = CODAS.SMH
                +SENDSTATE = {
                    Class = Message
                    Code = 0x500
                }
            }
        }
        +STOP = {
            Class = StateMachineEvent
            NextState = IDLE
            Value = STOP
            Code = 0x005
            +STOPALL = {
                Class = MessageDeliveryRequest
                Sender = StateMachine
                Destinations = "HTTPSERVER MARTe"
                MsecTimeOut = 1000
                Flags = NoReply
                Message = {
                    Class = Message
                    Content = STOP
                }
            }
        }
    }
    +WAITING_FOR_PRE = {
        Class = StateMachineState
        StateCode = 0x504
        +PRE = {
            Class = StateMachineEvent
            Code = 0x708
            NextState = PULSING
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = MARTe
                +MESSAGE = {
                    Class = Message
                    Content = PULSESTART
                }
            }
        }
        +ABORT = {
            Class = StateMachineEvent
            Code = 0x702
            NextState = IDLE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = MARTe
                +MESSAGE = {
                    Class = Message
                    Content = PULSESTOP
                }
            }
        }
        +COLLECTION_COMPLETED = {
            Class = StateMachineEvent
            Code = 0x703
            NextState = COMM_ERROR
        }
    }
    +PULSING = {
        Class = StateMachineState
        StateCode = 0x505
        +ENTER = {
            Class = MessageEnvelope
            Destination = CODAS.SMH
            +SENDSTATE = {
                Class = Message
            }
        }
        +ABORT = {
            Class = StateMachineEvent
            Code = 0x702
            NextState = IDLE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = MARTe
                +MESSAGE = {
                    Class = Message
                    Content = PULSESTOP
                }
            }
        }
        +EJP = {
            Class = StateMachineEvent
            Code = 0x709
            NextState = POST_PULSE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = MARTe
                +MESSAGE = {
                    Class = Message
                    Content = PULSESTOP
                }
            }
        }
    }
    +POST_PULSE = {
        Class = StateMachineState
        StateCode = 0x507
        +ENTER = {
            Class = MessageEnvelope
            Destination = CODAS.SMH
            +SENDSTATE = {
                Class = Message
            }
        }
        +COLLECTION_COMPLETED = {
            Class = StateMachineEvent
            Code = 0x703
            NextState = IDLE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = MARTe
                +MESSAGE = {
                    Class = Message
                    Content = COLLECTIONCOMPLETED
                }
            }
        }
    }
    +INHIBIT = {
        Class = StateMachineState
        StateCode = 0x508
        +ACTIVATE = {
            Class = StateMachineEvent
            Code = 0x705
            NextState = IDLE
        }
    }
    +ERROR = {
        Class = StateMachineState
        StateCode = 0x601
        +ACTIVATE = {
            Class = StateMachineEvent
            Code = 0x705
            NextState = IDLE
        }
        +COLLECTION_COMPLETED = {
            Class = StateMachineEvent
            Code = 0x703
            NextState = IDLE
        }
    }
    +CONFIG_ERROR = {
        Class = StateMachineState
        StateCode = 0x601
        +ENTER = {
            Class = MessageEnvelope
            Destination = CODAS.SMH
            +SENDSTATE = {
                Class = Message
            }
        }
        +ACTIVATE = {
            Class = StateMachineEvent
            Code = 0x705
            NextState = IDLE
        }
        +CONFIG_OK = {
            Class = StateMachineEvent
            Code = 0x778
            NextState = IDLE
            +NOTIFY = {
                Class = MessageEnvelope
                Sender = StateMachine
                Destination = CODAS.SMH
                +SENDSTATE = {
                    Class = Message
                    Code = 0x500
                }
            }
        }
	+CONFIG_ERROR = {
            Class = StateMachineEvent
            Code = 0x777
            NextState = CONFIG_ERROR
        }
    }
    +UNRECOVERABLE = {
        Class = StateMachineState
        StateCode = 0x601
        +DEFAULT = {
            Class = StateMachineEvent
            UserCode = 0
            NextState = UNRECOVERABLE
        }
    }
    +COMM_ERROR = {
        StateCode = 0x601
        Class = StateMachineState
        +ABORT = {
            Class = StateMachineEvent
            Code = 0x702
            NextState = SAMESTATE
        }
    }
    +DEFAULT = {
        Class = StateMachineState
        StateCode = 0x601
        +ABORT = {
            Class = StateMachineEvent
            Code = 0x702
            NextState = IDLE
        }
        +PRE = {
            Class = StateMachineEvent
            Code = 0x708
            NextState = SAMESTATE
        }
        +EJP = {
            Class = StateMachineEvent
            Code = 0x709
            NextState = SAMESTATE
        }
    }
}
+MARTeMenu = {
    Class = MARTeSupLib::MARTeMenu
    Title = "MARTe Menu"
    +MenuA = {
        Class = MenuContainer
        Title = "CODAS Interface"
        +ABORT = {
            Class = SendMessageMenuEntry
            Title = Abort
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x702
                    Content = ABORT
                }
            }
        }
        +INHIBIT = {
            Class = SendMessageMenuEntry
            Title = Inhibit
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x704
                    Content = Inhibit
                }
            }
        }
        +ACTIVATE = {
            Class = SendMessageMenuEntry
            Title = Activate
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x705
                    Content = Activate
                }
            }
        }
        +PULSESETUPCOMPLETE = {
            Class = SendMessageMenuEntry
            Title = "Pulse Setup Conplete"
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x701
                    Content = WAITING_FOR_PRE
                }
            }
        }
        +PRE = {
            Class = SendMessageMenuEntry
            Title = "Pulse Start"
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x708
                    Content = PRE
                }
            }
        }
        +EJP = {
            Class = SendMessageMenuEntry
            Title = "Pulse End"
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x709
                    Content = EJP
                }
            }
        }
        +COLLECTIONCOMPLETED = {
            Class = SendMessageMenuEntry
            Title = "Collection Completed"
            Envelope = {
                Class = MessageEnvelope
                Sender = MARTeMenu
                Destination = StateMachine
                +Message = {
                    Class = Message
                    Code = 0x703
                    Content = POSTPULSE
                }
            }
        }
    }
    AddReference = MARTe.MARTe
}
+MARTe = {
    Class = MARTeContainer
    StateMachineName = StateMachine
    Level1Name = LEVEL1
    MenuContainerName = MARTe
    +MARTe = {
        Class = MenuContainer
    }
	+DriverPool = {
		Class = GCReferenceContainer
		+TimerBoard = {
			Class = LinuxTimerDrv
			NumberOfInputs = 2
			NumberOfOutputs = 0
			TimerPeriodUsec = 1000
			SynchronizationMethod = Synchronizing
			RunOnCPU = 4
		}
        +FileReader = {
            Class = BinaryFileReader
            //NumberOfInputs  = 47608990
            NumberOfInputs  = 40000000
			DataSize = 190435960
			FileName = "../../../cplusplus/compression/data/90653/1.bin"
        }
    }
    +Messages = {
        Class = GCReferenceContainer
        +FatalErrorMessage = {
            Class = MessageDeliveryRequest
            Destinations = StateMachine
            MsecTimeOut = 1000
            Flags = NoReply
            Message = {
                Class = Message
                Code = 0x776
                Content = UNRECOVERABLE
            }
        }
        +ConfigLoadErrorMessage = {
            Class = MessageDeliveryRequest
            Destinations = StateMachine
            MsecTimeOut = 1000
            Flags = NoReply
            Message = {
                Class = Message
                Code = 0x777
                Content = CONFIG_ERROR
            }
        }
        +ConfigLoadOKMessage = {
            Class = MessageDeliveryRequest
            Destinations = StateMachine
            MsecTimeOut = 1000
            Flags = NoReply
            Message = {
                Class = Message
                Code = 0x778
                Content = CONFIG_OK
            }
        }
        +SafetyErrorMessage = {
            Class = MessageDeliveryRequest
            Destinations = MARTe
            MsecTimeOut = 1000
            Flags = NoReply
            Message = {
                Class = Message
                Content = ERROR
            }
        }
    }
	+ExternalTimeTriggeringService = {
		Class = InterruptDrivenTTS
		TsOnlineUsecPeriod = 1000000
		TsOnlineUsecPhase = 0
		TsOfflineUsecPeriod = 1000000
		TsOfflineUsecPhase = 0
		TimeModule = {
			BoardName = TimerBoard
		}
	}
    +Thread_1 = {
        Class = RealTimeThread
        ThreadPriority = 28
        RunOnCPU = 8
        RTStatusChangeMsecTimeout = 1000
        SMStatusChangeMsecTimeout = 1000
        OfflineSemaphoreTimeout = 50
        TriggeringServiceName = MARTe.ExternalTimeTriggeringService
        SafetyMsecSleep = 1
        +DDB = {
            Class = DDB
        }
		+Timer = {
			Class = IOGAMs::TimeInputGAM
			TriggeringServiceName = ExternalTimeTriggeringService
			BoardName = TimerBoard
			Signals = {
				counter = {
					SignalName = packetNumber
					SignalType = int32
				}
				time = {
					SignalName = usecTime
					SignalType = int32
				}				
			}
		}
        +InputData = {
            Class = IOGAMs::InputGAM
            BoardName = FileReader
			UsecTimeSignalName = usecTime
            Signals = {
                /*+input_data = {
                    SignalName = input_data[47608990]
                    SignalType = uint32
                }*/
                +input_data = {
                    SignalName = input_data[40000000]
                    SignalType = uint32
                }

            }
        }
        +Statistic = {
            Class = WebStatisticGAM
            Verbose = True
            FrequencyOfVerbose = 2000000
            Signals = {
                SignalU = {
                    SignalName = usecTime
                    SignalType = int32
                }
				CycleTime = {
					SignalName = CycleUsecTime
					SignalType = float
				}
                TimerRelativeTime = {
                    SignalName = TimerRelativeUsecTime
                    SignalType = float
                }
                InputDataRelativeTime = {
                    SignalName = InputDataRelativeUsecTime
                    SignalType = float
                }
                SINE1 = {
                    SignalName = "input_data(0:5)"
                    SignalType = uint32
                }
            }
        }
        +Collection = {
            Class = CollectionGAMs::DataCollectionGAM
            UsecTimeSignalName = usecTime
            PreTrigger = 200
            EventTrigger = {
                MaxFastAcquisitionPoints = 800
                PointsForSingleFastAcquisition = 400
                TimeWindow0 = {
                    NOfSamples = 80000
                    UsecPeriod = 1000
                }
            }
            NOfAcquisitionSamples = 80000
            Signals = {
                CLOCK = {
                    SignalName = usecTime
                    JPFName = "TIME"
                    SignalType = int32
                    Cal0 = 0.0
                    Cal1 = 1.000000e-06
                }
                CycleTime = {
                    SignalName = CycleUsecTime
                    JPFName = "CycleTime"
                    SignalType = float
                }
                SignalTime = {
                    SignalName = TimerRelativeUsecTime
                    JPFName    = "TimerRelativeUsecTime"
                    SignalType = float
                }
                SINE1 = {
                    SignalName = "input_data(0:5)"
                    JPFName    = "input_data"
                    SignalType = uint32
                }
            }
        }
/*
        Online = "Timer InputData"
        Offline = "Timer InputData"
*/
        Online = "Timer InputData Statistic Collection"
        Offline = "Timer InputData Statistic"

    }
}
ReloadAll = 0
