Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CC_ComponentFactory.cpp

00001 00002 // 00003 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00004 // 00005 // CC_ComponentFactory.cpp 00006 // 00007 // This file was automatically generated by an XSL program 00008 00009 #include "../GeneralInclude/ForwardDeclarations.h" 00010 #include "../GeneralInclude/CompilerSwitches.h" 00011 #include "../GeneralInclude/DebugSupport.h" 00012 #include "../GeneralInclude/BasicTypes.h" 00013 #include "../GeneralInclude/Constants.h" 00014 #include "CC_ComponentFactory_inc.h" 00015 #include "CC_ComponentFactory.h" 00016 #include "../Base/CC_RootObject.h" 00017 00018 #include "../Data/DC_ControlAction.h" 00019 #include "../Data/DC_SampleControlBlock_1.h" 00020 #include "../Data/DC_SampleControlBlock_2.h" 00021 #include "../Data/DC_SampleControlBlock_3.h" 00022 #include "../Data/DC_SampleControlBlock_4.h" 00023 #include "../Data/DC_SampleFullDataPool.h" 00024 #include "../Data/DC_SampleR2Database.h" 00025 #include "../Event/DC_PUSEventRepository.h" 00026 #include "../FDIR/DC_NullRecoveryAction.h" 00027 #include "../FDIR/DC_OutOfRangeProfile.h" 00028 #include "../FDIR/DC_SampleMonitoringProfile.h" 00029 #include "../FDIR/DC_SampleRecoveryAction.h" 00030 #include "../FDIR/DC_StuckDataProfile.h" 00031 #include "../FSM/CC_FSM.h" 00032 #include "../FSM/DC_AfsFsmState.h" 00033 #include "../FSM/DC_DummyFsmState.h" 00034 #include "../FSM/DC_FromFsmEvent.h" 00035 #include "../FSM/DC_NestedFsmActivatorWithEndState.h" 00036 #include "../FSM/DC_NestedFsmActivatorWithExitCheck.h" 00037 #include "../FSM/DC_OCM_FsmState.h" 00038 #include "../FSM/DC_SBY_PostSepFsmState.h" 00039 #include "../FSM/DC_SBY_PreSepFsmState.h" 00040 #include "../FSM/DC_SCM_FsmState.h" 00041 #include "../FSM/DC_SM_PreSepFsmState.h" 00042 #include "../FSM/DC_UnstableFsmState.h" 00043 #include "../Manoeuvre/CC_ManoeuvreManager.h" 00044 #include "../Manoeuvre/DC_DummyConfigurableManoeuvre.h" 00045 #include "../Manoeuvre/DC_DummyManoeuvre.h" 00046 #include "../Manoeuvre/DC_TestPUSConfigurableManoeuvre.h" 00047 #include "../System/DC_DummyObsClock.h" 00048 #include "../System/DC_DummyTracer.h" 00049 #include "../Telecommand/CC_TelecommandManager.h" 00050 #include "../Telecommand/DC_BasicPUSTcLoader.h" 00051 #include "../Telecommand/DC_DummyPUSTelecommand.h" 00052 #include "../Telecommand/DC_DummyTelecommand.h" 00053 #include "../Telecommand/DC_PUSControlDataReporting.h" 00054 #include "../Telecommand/DC_PUSDefineDataReporting.h" 00055 #include "../Telecommand/DC_PUSDumpMemoryAbsolute.h" 00056 #include "../Telecommand/DC_PUSDumpMemoryOffset.h" 00057 #include "../Telecommand/DC_PUSMemoryLoadAbsolute.h" 00058 #include "../Telecommand/DC_PUSMemoryLoadOffset.h" 00059 #include "../Telecommand/DC_TestPUSTelecommand.h" 00060 #include "../Telemetry/CC_TelemetryManager.h" 00061 #include "../Telemetry/DC_BasicPUSTmStream.h" 00062 #include "../Telemetry/DC_DummyPUSTelemetryPacket.h" 00063 #include "../Telemetry/DC_PUSDataReportingPacket.h" 00064 #include "../Telemetry/DC_PUSMemoryDumpAbsolute.h" 00065 #include "../Telemetry/DC_PUSMemoryDumpOffset.h" 00066 #include "../Telemetry/DC_PUSTcVerificationPacket.h" 00067 #include "../Telemetry/DC_PUSTelemetryModeManager.h" 00068 00069 // Disable type mismatch warning that arise when calling 00070 // the configuration methods on monitoring profiles 00071 #pragma warning( disable : 4305 ) 00072 00073 00074 00075 // Create the parameter database storage areas. In an operational 00076 // context the two pointers should be made to point to the database 00077 // operational and default tables. The names of the pointers must 00078 // match the names in the parameter database application models. 00079 char* PARDATABASE_OP_TABLE_START = new char[50]; 00080 char* PARDATABASE_DEF_TABLE_START = new char[50]; 00081 00082 // Create the telecommand storage area. In an operational setting, 00083 // this should be linked to the area where TCs are written. The name 00084 // used here must match the name used in the telecommand loader model and 00085 // the size of the allocated memory should be consistent with the configuration 00086 // parameters of the telecommand loader. 00087 unsigned char* TC_LOADER_AREA_START = new unsigned char[1000]; 00088 00089 // Create the telemetry storage area. In an operational setting, 00090 // this should be linked to the area from where TMs are read. The name 00091 // used here must match the name used in the telemetry stream model and 00092 // the size of the allocated memory should be consistent with the configuration 00093 // parameters of the telemetry stream. 00094 unsigned char* TM_STREAM_START = new unsigned char[5000]; 00095 00096 CC_ComponentFactory* CC_ComponentFactory::pInstance = pNULL; 00097 00098 CC_ComponentFactory::CC_ComponentFactory(void) { 00099 00100 00101 00102 // Initialize the system list size. The size is computed as the number of components 00103 // defined in the application model plus a (heuritically defined) margin of ten to 00104 // account for components that are created internally to other components 00105 CC_RootObject::setSystemListSize(101+10); 00106 00107 fullDataPool = new DC_SampleFullDataPool(); 00108 list[1] = fullDataPool; 00109 type[1] = TN_SampleFullDataPool; 00110 sdMonProf_1 = new DC_StuckDataProfile(); 00111 list[2] = sdMonProf_1; 00112 type[2] = TN_StuckDataProfile; 00113 orMonProf_1 = new DC_OutOfRangeProfile(); 00114 list[3] = orMonProf_1; 00115 type[3] = TN_OutOfRangeProfile; 00116 sMonProf_1 = new DC_SampleMonitoringProfile(); 00117 list[4] = sMonProf_1; 00118 type[4] = TN_SampleMonitoringProfile; 00119 nRecAct_1 = new DC_NullRecoveryAction(); 00120 list[5] = nRecAct_1; 00121 type[5] = TN_NullRecoveryAction; 00122 orMonProf_2 = new DC_OutOfRangeProfile(); 00123 list[6] = orMonProf_2; 00124 type[6] = TN_OutOfRangeProfile; 00125 sRecAct_2 = new DC_SampleRecoveryAction(); 00126 list[7] = sRecAct_2; 00127 type[7] = TN_SampleRecoveryAction; 00128 nRecAct_2 = new DC_NullRecoveryAction(); 00129 list[8] = nRecAct_2; 00130 type[8] = TN_NullRecoveryAction; 00131 sdMonProf_4 = new DC_StuckDataProfile(); 00132 list[9] = sdMonProf_4; 00133 type[9] = TN_StuckDataProfile; 00134 orMonProf_4 = new DC_OutOfRangeProfile(); 00135 list[10] = orMonProf_4; 00136 type[10] = TN_OutOfRangeProfile; 00137 nRecAct_4 = new DC_NullRecoveryAction(); 00138 list[11] = nRecAct_4; 00139 type[11] = TN_NullRecoveryAction; 00140 orMonProf_5 = new DC_OutOfRangeProfile(); 00141 list[12] = orMonProf_5; 00142 type[12] = TN_OutOfRangeProfile; 00143 nRecAct_5 = new DC_NullRecoveryAction(); 00144 list[13] = nRecAct_5; 00145 type[13] = TN_NullRecoveryAction; 00146 sdMonProf_7 = new DC_StuckDataProfile(); 00147 list[14] = sdMonProf_7; 00148 type[14] = TN_StuckDataProfile; 00149 orMonProf_7 = new DC_OutOfRangeProfile(); 00150 list[15] = orMonProf_7; 00151 type[15] = TN_OutOfRangeProfile; 00152 nRecAct_7 = new DC_NullRecoveryAction(); 00153 list[16] = nRecAct_7; 00154 type[16] = TN_NullRecoveryAction; 00155 orMonProf_8 = new DC_OutOfRangeProfile(); 00156 list[17] = orMonProf_8; 00157 type[17] = TN_OutOfRangeProfile; 00158 nRecAct_8 = new DC_NullRecoveryAction(); 00159 list[18] = nRecAct_8; 00160 type[18] = TN_NullRecoveryAction; 00161 sdMonProf_10 = new DC_StuckDataProfile(); 00162 list[19] = sdMonProf_10; 00163 type[19] = TN_StuckDataProfile; 00164 orMonProf_10 = new DC_OutOfRangeProfile(); 00165 list[20] = orMonProf_10; 00166 type[20] = TN_OutOfRangeProfile; 00167 nRecAct_10 = new DC_NullRecoveryAction(); 00168 list[21] = nRecAct_10; 00169 type[21] = TN_NullRecoveryAction; 00170 orMonProf_11 = new DC_OutOfRangeProfile(); 00171 list[22] = orMonProf_11; 00172 type[22] = TN_OutOfRangeProfile; 00173 nRecAct_11 = new DC_NullRecoveryAction(); 00174 list[23] = nRecAct_11; 00175 type[23] = TN_NullRecoveryAction; 00176 parDB = new DC_SampleR2Database(); 00177 list[24] = parDB; 00178 type[24] = TN_SampleR2Database; 00179 Nominal_FSM = new CC_FSM(); 00180 list[25] = Nominal_FSM; 00181 type[25] = TN_FSM; 00182 SBY_FsmState = new DC_NestedFsmActivatorWithEndState(); 00183 list[26] = SBY_FsmState; 00184 type[26] = TN_NestedFsmActivatorWithEndState; 00185 SAM_FsmState = new DC_NestedFsmActivatorWithExitCheck(); 00186 list[27] = SAM_FsmState; 00187 type[27] = TN_NestedFsmActivatorWithExitCheck; 00188 SCM_FsmState = new DC_SCM_FsmState(); 00189 list[28] = SCM_FsmState; 00190 type[28] = TN_SCM_FsmState; 00191 OCM_FsmState = new DC_OCM_FsmState(); 00192 list[29] = OCM_FsmState; 00193 type[29] = TN_OCM_FsmState; 00194 SAM_to_OCM = new DC_FromFsmEvent(); 00195 list[30] = SAM_to_OCM; 00196 type[30] = TN_FromFsmEvent; 00197 OCM_to_SAM = new DC_FromFsmEvent(); 00198 list[31] = OCM_to_SAM; 00199 type[31] = TN_FromFsmEvent; 00200 SCM_to_SAM = new DC_FromFsmEvent(); 00201 list[32] = SCM_to_SAM; 00202 type[32] = TN_FromFsmEvent; 00203 SAM_to_SCM = new DC_FromFsmEvent(); 00204 list[33] = SAM_to_SCM; 00205 type[33] = TN_FromFsmEvent; 00206 SCM_to_OCM = new DC_FromFsmEvent(); 00207 list[34] = SCM_to_OCM; 00208 type[34] = TN_FromFsmEvent; 00209 OCM_to_SCM = new DC_FromFsmEvent(); 00210 list[35] = OCM_to_SCM; 00211 type[35] = TN_FromFsmEvent; 00212 SBY_FSM = new CC_FSM(); 00213 list[36] = SBY_FSM; 00214 type[36] = TN_FSM; 00215 SBY_PreSeparation = new DC_SBY_PreSepFsmState(); 00216 list[37] = SBY_PreSeparation; 00217 type[37] = TN_SBY_PreSepFsmState; 00218 SBY_PostSeparation = new DC_SBY_PostSepFsmState(); 00219 list[38] = SBY_PostSeparation; 00220 type[38] = TN_SBY_PostSepFsmState; 00221 END = new DC_DummyFsmState(); 00222 list[39] = END; 00223 type[39] = TN_DummyFsmState; 00224 SAM_FSM = new CC_FSM(); 00225 list[40] = SAM_FSM; 00226 type[40] = TN_FSM; 00227 SAM_SunAcquisition = new DC_UnstableFsmState(); 00228 list[41] = SAM_SunAcquisition; 00229 type[41] = TN_UnstableFsmState; 00230 SAM_SunPointing = new DC_DummyFsmState(); 00231 list[42] = SAM_SunPointing; 00232 type[42] = TN_DummyFsmState; 00233 OCM_FSM = new CC_FSM(); 00234 list[43] = OCM_FSM; 00235 type[43] = TN_FSM; 00236 OCM_Slewing = new DC_UnstableFsmState(); 00237 list[44] = OCM_Slewing; 00238 type[44] = TN_UnstableFsmState; 00239 OCM_Pointing = new DC_DummyFsmState(); 00240 list[45] = OCM_Pointing; 00241 type[45] = TN_DummyFsmState; 00242 OCM_Thrusting = new DC_DummyFsmState(); 00243 list[46] = OCM_Thrusting; 00244 type[46] = TN_DummyFsmState; 00245 SCM_FSM = new CC_FSM(); 00246 list[47] = SCM_FSM; 00247 type[47] = TN_FSM; 00248 SCM_Slewing = new DC_DummyFsmState(); 00249 list[48] = SCM_Slewing; 00250 type[48] = TN_DummyFsmState; 00251 SCM_Pointing = new DC_DummyFsmState(); 00252 list[49] = SCM_Pointing; 00253 type[49] = TN_DummyFsmState; 00254 SCM_Scanning = new DC_DummyFsmState(); 00255 list[50] = SCM_Scanning; 00256 type[50] = TN_DummyFsmState; 00257 SM_FSM = new CC_FSM(); 00258 list[51] = SM_FSM; 00259 type[51] = TN_FSM; 00260 SM_PreSeparation = new DC_SM_PreSepFsmState(); 00261 list[52] = SM_PreSeparation; 00262 type[52] = TN_SM_PreSepFsmState; 00263 SM_PostSeparation = new DC_UnstableFsmState(); 00264 list[53] = SM_PostSeparation; 00265 type[53] = TN_UnstableFsmState; 00266 SM_SunAcquisition = new DC_UnstableFsmState(); 00267 list[54] = SM_SunAcquisition; 00268 type[54] = TN_UnstableFsmState; 00269 SM_SunPointing = new DC_DummyFsmState(); 00270 list[55] = SM_SunPointing; 00271 type[55] = TN_DummyFsmState; 00272 SM_PreToPost = new DC_FromFsmEvent(); 00273 list[56] = SM_PreToPost; 00274 type[56] = TN_FromFsmEvent; 00275 FDIR_FSM = new CC_FSM(); 00276 list[57] = FDIR_FSM; 00277 type[57] = TN_FSM; 00278 AFS = new DC_AfsFsmState(); 00279 list[58] = AFS; 00280 type[58] = TN_AfsFsmState; 00281 AFO = new DC_DummyFsmState(); 00282 list[59] = AFO; 00283 type[59] = TN_DummyFsmState; 00284 AFS_to_AFO = new DC_FromFsmEvent(); 00285 list[60] = AFS_to_AFO; 00286 type[60] = TN_FromFsmEvent; 00287 AFO_to_AFS = new DC_FromFsmEvent(); 00288 list[61] = AFO_to_AFS; 00289 type[61] = TN_FromFsmEvent; 00290 contAction_1 = new DC_ControlAction(); 00291 list[62] = contAction_1; 00292 type[62] = TN_ControlAction; 00293 contBlock_1 = new DC_SampleControlBlock_1(); 00294 list[63] = contBlock_1; 00295 type[63] = TN_SampleControlBlock_1; 00296 contAction_2 = new DC_ControlAction(); 00297 list[64] = contAction_2; 00298 type[64] = TN_ControlAction; 00299 contBlock_2 = new DC_SampleControlBlock_2(); 00300 list[65] = contBlock_2; 00301 type[65] = TN_SampleControlBlock_2; 00302 contAction_3 = new DC_ControlAction(); 00303 list[66] = contAction_3; 00304 type[66] = TN_ControlAction; 00305 contBlock_3 = new DC_SampleControlBlock_3(); 00306 list[67] = contBlock_3; 00307 type[67] = TN_SampleControlBlock_3; 00308 contAction_4 = new DC_ControlAction(); 00309 list[68] = contAction_4; 00310 type[68] = TN_ControlAction; 00311 contBlock_4 = new DC_SampleControlBlock_4(); 00312 list[69] = contBlock_4; 00313 type[69] = TN_SampleControlBlock_4; 00314 obsClk = new DC_DummyObsClock(); 00315 list[70] = obsClk; 00316 type[70] = TN_DummyObsClock; 00317 evtRep = new DC_PUSEventRepository(); 00318 list[71] = evtRep; 00319 type[71] = TN_PUSEventRepository; 00320 tracer = new DC_DummyTracer(); 00321 list[72] = tracer; 00322 type[72] = TN_DummyTracer; 00323 manMan = new CC_ManoeuvreManager(); 00324 list[73] = manMan; 00325 type[73] = TN_ManoeuvreManager; 00326 man_1 = new DC_DummyManoeuvre(); 00327 list[74] = man_1; 00328 type[74] = TN_DummyManoeuvre; 00329 man_2 = new DC_DummyConfigurableManoeuvre(); 00330 list[75] = man_2; 00331 type[75] = TN_DummyConfigurableManoeuvre; 00332 man_3 = new DC_TestPUSConfigurableManoeuvre(); 00333 list[76] = man_3; 00334 type[76] = TN_TestPUSConfigurableManoeuvre; 00335 tcMan = new CC_TelecommandManager(); 00336 list[77] = tcMan; 00337 type[77] = TN_TelecommandManager; 00338 tcLoader = new DC_BasicPUSTcLoader(); 00339 list[78] = tcLoader; 00340 type[78] = TN_BasicPUSTcLoader; 00341 tc_1 = new DC_DummyTelecommand(); 00342 list[79] = tc_1; 00343 type[79] = TN_DummyTelecommand; 00344 tc_2 = new DC_DummyTelecommand(); 00345 list[80] = tc_2; 00346 type[80] = TN_DummyTelecommand; 00347 tc_3 = new DC_DummyPUSTelecommand(); 00348 list[81] = tc_3; 00349 type[81] = TN_DummyPUSTelecommand; 00350 tc_4 = new DC_PUSDefineDataReporting(); 00351 list[82] = tc_4; 00352 type[82] = TN_PUSDefineDataReporting; 00353 tc_5 = new DC_PUSControlDataReporting(); 00354 list[83] = tc_5; 00355 type[83] = TN_PUSControlDataReporting; 00356 tc_6 = new DC_TestPUSTelecommand(); 00357 list[84] = tc_6; 00358 type[84] = TN_TestPUSTelecommand; 00359 tc_7 = new DC_TestPUSTelecommand(); 00360 list[85] = tc_7; 00361 type[85] = TN_TestPUSTelecommand; 00362 tc_8 = new DC_TestPUSTelecommand(); 00363 list[86] = tc_8; 00364 type[86] = TN_TestPUSTelecommand; 00365 tc_9 = new DC_PUSDumpMemoryAbsolute(); 00366 list[87] = tc_9; 00367 type[87] = TN_PUSDumpMemoryAbsolute; 00368 tc_10 = new DC_PUSDumpMemoryOffset(); 00369 list[88] = tc_10; 00370 type[88] = TN_PUSDumpMemoryOffset; 00371 tc_11 = new DC_PUSMemoryLoadAbsolute(); 00372 list[89] = tc_11; 00373 type[89] = TN_PUSMemoryLoadAbsolute; 00374 tc_12 = new DC_PUSMemoryLoadAbsolute(); 00375 list[90] = tc_12; 00376 type[90] = TN_PUSMemoryLoadAbsolute; 00377 tc_13 = new DC_PUSMemoryLoadOffset(); 00378 list[91] = tc_13; 00379 type[91] = TN_PUSMemoryLoadOffset; 00380 tmMan = new CC_TelemetryManager(); 00381 list[92] = tmMan; 00382 type[92] = TN_TelemetryManager; 00383 tmStream = new DC_BasicPUSTmStream(); 00384 list[93] = tmStream; 00385 type[93] = TN_BasicPUSTmStream; 00386 tm_1 = new DC_DummyPUSTelemetryPacket(); 00387 list[94] = tm_1; 00388 type[94] = TN_DummyPUSTelemetryPacket; 00389 tm_2 = new DC_DummyPUSTelemetryPacket(); 00390 list[95] = tm_2; 00391 type[95] = TN_DummyPUSTelemetryPacket; 00392 tm_3 = new DC_PUSTcVerificationPacket(); 00393 list[96] = tm_3; 00394 type[96] = TN_PUSTcVerificationPacket; 00395 tm_4 = new DC_PUSDataReportingPacket(); 00396 list[97] = tm_4; 00397 type[97] = TN_PUSDataReportingPacket; 00398 tm_5 = new DC_PUSDataReportingPacket(); 00399 list[98] = tm_5; 00400 type[98] = TN_PUSDataReportingPacket; 00401 tm_6 = new DC_PUSMemoryDumpAbsolute(); 00402 list[99] = tm_6; 00403 type[99] = TN_PUSMemoryDumpAbsolute; 00404 tm_7 = new DC_PUSMemoryDumpOffset(); 00405 list[100] = tm_7; 00406 type[100] = TN_PUSMemoryDumpOffset; 00407 tmModeMan = new DC_PUSTelemetryModeManager(); 00408 list[101] = tmModeMan; 00409 type[101] = TN_PUSTelemetryModeManager; 00410 00411 } 00412 00413 CC_ComponentFactory* CC_ComponentFactory::getInstance(void) { 00414 if (pInstance==pNULL) 00415 pInstance = new CC_ComponentFactory(); 00416 return pInstance; 00417 } 00418 00419 void CC_ComponentFactory::configureApplication(void) { 00420 configureRootObject(); 00421 configureEventRepository(); 00422 configureObsClock(); 00423 configureDataPool(); 00424 configureParameterDatabase(); 00425 configureFSM(); 00426 configureFunctionalityManagers(); 00427 configureControllers(); 00428 } 00429 00430 void CC_ComponentFactory::configureRootObject(void) { 00431 00432 00433 // Load the event repository 00434 CC_RootObject::setEventRepository(evtRep); 00435 00436 // Load the parameter database 00437 CC_RootObject::setParameterDatabase(parDB); 00438 00439 // Load the datapool 00440 CC_RootObject::setDataPool(fullDataPool); 00441 00442 // Load the tracer 00443 CC_RootObject::setTracer(tracer); 00444 00445 00446 } 00447 00448 00449 void CC_ComponentFactory::configureObsClock(void) { 00450 00451 // ---- Configure the OBS Clock "obsClk" ---- 00452 obsClk->setTime(10); 00453 obsClk->setCycle(20); 00454 00455 } 00456 00457 void CC_ComponentFactory::configureEventRepository(void) { 00458 00459 // ---- Configure the event repository "evtRep" ---- 00460 evtRep->setRepositorySize(10); 00461 evtRep->setObsClock(obsClk); 00462 evtRep->setTelemetryManager(tmMan); 00463 evtRep->setEnabled(ENABLED); 00464 00465 } 00466 00467 void CC_ComponentFactory::configureFSM(void) { 00468 00469 // ---- Configuration of FsmEvent "SAM_to_OCM" ---- 00470 SAM_to_OCM->setTargetFsm(Nominal_FSM); 00471 SAM_to_OCM->setTargetState(3); 00472 SAM_to_OCM->setStartingState(1); 00473 00474 // ---- Configuration of FsmEvent "OCM_to_SAM" ---- 00475 OCM_to_SAM->setTargetFsm(Nominal_FSM); 00476 OCM_to_SAM->setTargetState(1); 00477 OCM_to_SAM->setStartingState(3); 00478 00479 // ---- Configuration of FsmEvent "SCM_to_SAM" ---- 00480 SCM_to_SAM->setTargetFsm(Nominal_FSM); 00481 SCM_to_SAM->setTargetState(1); 00482 SCM_to_SAM->setStartingState(2); 00483 00484 // ---- Configuration of FsmEvent "SAM_to_SCM" ---- 00485 SAM_to_SCM->setTargetFsm(Nominal_FSM); 00486 SAM_to_SCM->setTargetState(2); 00487 SAM_to_SCM->setStartingState(1); 00488 00489 // ---- Configuration of FsmEvent "SCM_to_OCM" ---- 00490 SCM_to_OCM->setTargetFsm(Nominal_FSM); 00491 SCM_to_OCM->setTargetState(3); 00492 SCM_to_OCM->setStartingState(2); 00493 00494 // ---- Configuration of FsmEvent "OCM_to_SCM" ---- 00495 OCM_to_SCM->setTargetFsm(Nominal_FSM); 00496 OCM_to_SCM->setTargetState(2); 00497 OCM_to_SCM->setStartingState(3); 00498 00499 // ---- Configuration of FsmState "SBY_FsmState" ---- 00500 SBY_FsmState->setTargetState(2); 00501 SBY_FsmState->setNextState(SAM_FsmState); 00502 SBY_FsmState->setTargetFsm(SBY_FSM); 00503 00504 // ---- Configuration of FsmState "SAM_FsmState" ---- 00505 SAM_FsmState->setTargetState(1); 00506 SAM_FsmState->setTargetFsm(SAM_FSM); 00507 00508 // ---- Configuration of FsmState "SCM_FsmState" ---- 00509 SCM_FsmState->setNextState(SAM_FsmState); 00510 00511 // ---- Configuration of FsmState "OCM_FsmState" ---- 00512 OCM_FsmState->setNextState(SAM_FsmState); 00513 00514 // ---- Configure the FSM "Nominal_FSM" ---- 00515 Nominal_FSM->setNumberOfStates(4); 00516 Nominal_FSM->setState(0,SBY_FsmState); 00517 Nominal_FSM->setState(1,SAM_FsmState); 00518 Nominal_FSM->setState(2,SCM_FsmState); 00519 Nominal_FSM->setState(3,OCM_FsmState); 00520 00521 // ---- Configuration of FsmState "SBY_PreSeparation" ---- 00522 SBY_PreSeparation->setNextState(SBY_PostSeparation); 00523 00524 // ---- Configuration of FsmState "SBY_PostSeparation" ---- 00525 SBY_PostSeparation->setNextState(END); 00526 00527 // ---- Configuration of FsmState "END" ---- 00528 END->setNextState(END); 00529 00530 // ---- Configure the FSM "SBY_FSM" ---- 00531 SBY_FSM->setNumberOfStates(3); 00532 SBY_FSM->setState(0,SBY_PreSeparation); 00533 SBY_FSM->setState(1,SBY_PostSeparation); 00534 SBY_FSM->setState(2,END); 00535 00536 // ---- Configuration of FsmState "SAM_SunAcquisition" ---- 00537 SAM_SunAcquisition->setNextState(SAM_SunPointing); 00538 00539 // ---- Configuration of FsmState "SAM_SunPointing" ---- 00540 00541 // ---- Configure the FSM "SAM_FSM" ---- 00542 SAM_FSM->setNumberOfStates(2); 00543 SAM_FSM->setState(0,SAM_SunAcquisition); 00544 SAM_FSM->setState(1,SAM_SunPointing); 00545 00546 // ---- Configuration of FsmState "OCM_Slewing" ---- 00547 OCM_Slewing->setNextState(OCM_Pointing); 00548 00549 // ---- Configuration of FsmState "OCM_Pointing" ---- 00550 00551 // ---- Configuration of FsmState "OCM_Thrusting" ---- 00552 00553 // ---- Configure the FSM "OCM_FSM" ---- 00554 OCM_FSM->setNumberOfStates(3); 00555 OCM_FSM->setState(0,OCM_Slewing); 00556 OCM_FSM->setState(1,OCM_Pointing); 00557 OCM_FSM->setState(2,OCM_Thrusting); 00558 00559 // ---- Configuration of FsmState "SCM_Slewing" ---- 00560 00561 // ---- Configuration of FsmState "SCM_Pointing" ---- 00562 00563 // ---- Configuration of FsmState "SCM_Scanning" ---- 00564 00565 // ---- Configure the FSM "SCM_FSM" ---- 00566 SCM_FSM->setNumberOfStates(3); 00567 SCM_FSM->setState(0,SCM_Slewing); 00568 SCM_FSM->setState(1,SCM_Pointing); 00569 SCM_FSM->setState(2,SCM_Scanning); 00570 00571 // ---- Configuration of FsmEvent "SM_PreToPost" ---- 00572 SM_PreToPost->setTargetFsm(SM_FSM); 00573 SM_PreToPost->setTargetState(1); 00574 SM_PreToPost->setStartingState(0); 00575 00576 // ---- Configuration of FsmState "SM_PreSeparation" ---- 00577 SM_PreSeparation->setNextState(SM_PostSeparation); 00578 00579 // ---- Configuration of FsmState "SM_PostSeparation" ---- 00580 SM_PostSeparation->setNextState(SM_SunAcquisition); 00581 00582 // ---- Configuration of FsmState "SM_SunAcquisition" ---- 00583 SM_SunAcquisition->setNextState(SM_SunPointing); 00584 00585 // ---- Configuration of FsmState "SM_SunPointing" ---- 00586 00587 // ---- Configure the FSM "SM_FSM" ---- 00588 SM_FSM->setNumberOfStates(4); 00589 SM_FSM->setState(0,SM_PreSeparation); 00590 SM_FSM->setState(1,SM_PostSeparation); 00591 SM_FSM->setState(2,SM_SunAcquisition); 00592 SM_FSM->setState(3,SM_SunPointing); 00593 00594 // ---- Configuration of FsmEvent "AFS_to_AFO" ---- 00595 AFS_to_AFO->setTargetFsm(FDIR_FSM); 00596 AFS_to_AFO->setTargetState(1); 00597 AFS_to_AFO->setStartingState(0); 00598 00599 // ---- Configuration of FsmEvent "AFO_to_AFS" ---- 00600 AFO_to_AFS->setTargetFsm(FDIR_FSM); 00601 AFO_to_AFS->setTargetState(0); 00602 AFO_to_AFS->setStartingState(1); 00603 00604 // ---- Configuration of FsmState "AFS" ---- 00605 00606 // ---- Configuration of FsmState "AFO" ---- 00607 00608 // ---- Configure the FSM "FDIR_FSM" ---- 00609 FDIR_FSM->setNumberOfStates(2); 00610 FDIR_FSM->setState(0,AFS); 00611 FDIR_FSM->setState(1,AFO); 00612 00613 // ---- Reset all the FSM ---- 00614 Nominal_FSM->reset(); 00615 SBY_FSM->reset(); 00616 SAM_FSM->reset(); 00617 OCM_FSM->reset(); 00618 SCM_FSM->reset(); 00619 SM_FSM->reset(); 00620 FDIR_FSM->reset(); 00621 00622 } 00623 00624 void CC_ComponentFactory::configureControllers(void) { 00625 00626 // ---- Configure the control block "contBlock_1" ---- 00627 contBlock_1->setInputLink(0,DP_RW_SPD_1); 00628 contBlock_1->setOutputLink(0,DP_RW_TOR_1); 00629 contBlock_1->setParameter(0,CC_RootObject::getParameterDatabase()->getParameterFloat(DB_G1)); 00630 00631 // ---- Configure the control block "contBlock_2" ---- 00632 contBlock_2->setInputLink(0,DP_RW_SPD_2); 00633 contBlock_2->setOutputLink(0,DP_RW_TOR_2); 00634 contBlock_2->setParameter(0,CC_RootObject::getParameterDatabase()->getParameterFloat(DB_G2)); 00635 00636 // ---- Configure the control block "contBlock_3" ---- 00637 contBlock_3->setInputLink(0,DP_RW_SPD_3); 00638 contBlock_3->setOutputLink(0,DP_RW_TOR_3); 00639 contBlock_3->setParameter(0,CC_RootObject::getParameterDatabase()->getParameterFloat(DB_G3)); 00640 00641 // ---- Configure the control block "contBlock_4" ---- 00642 contBlock_4->setInputLink(0,DP_RW_SPD_4); 00643 contBlock_4->setOutputLink(0,DP_RW_TOR_4); 00644 contBlock_4->setParameter(0,CC_RootObject::getParameterDatabase()->getParameterFloat(DB_G4)); 00645 00646 // ---- Configure the control action "contAction_1" ---- 00647 contAction_1->setTargetControlBlock(contBlock_1); 00648 00649 // ---- Configure the control action "contAction_2" ---- 00650 contAction_2->setTargetControlBlock(contBlock_2); 00651 00652 // ---- Configure the control action "contAction_3" ---- 00653 contAction_3->setTargetControlBlock(contBlock_3); 00654 00655 // ---- Configure the control action "contAction_4" ---- 00656 contAction_4->setTargetControlBlock(contBlock_4); 00657 00658 } 00659 00660 void CC_ComponentFactory::configureDataPool(void) { 00661 00662 sdMonProf_1->setStuckThreshold(3); 00663 orMonProf_1->setLowerBound(-2400); 00664 orMonProf_1->setUpperBound(2400); 00665 orMonProf_2->setLowerBound(-0.2); 00666 orMonProf_2->setUpperBound(0.2); 00667 sdMonProf_4->setStuckThreshold(3); 00668 orMonProf_4->setLowerBound(-2400); 00669 orMonProf_4->setUpperBound(2400); 00670 orMonProf_5->setLowerBound(-0.2); 00671 orMonProf_5->setUpperBound(0.2); 00672 sdMonProf_7->setStuckThreshold(3); 00673 orMonProf_7->setLowerBound(-2400); 00674 orMonProf_7->setUpperBound(2400); 00675 orMonProf_8->setLowerBound(-0.2); 00676 orMonProf_8->setUpperBound(0.2); 00677 sdMonProf_10->setStuckThreshold(3); 00678 orMonProf_10->setLowerBound(-2400); 00679 orMonProf_10->setUpperBound(2400); 00680 orMonProf_11->setLowerBound(-0.2); 00681 orMonProf_11->setUpperBound(0.2); 00682 00683 00684 00685 00686 00687 00688 00689 00690 00691 00692 // Set the properties of the data pool 00693 fullDataPool->setObsClock(obsClk); 00694 00695 00696 // ---- Configuration of data pool item "RW_SPD_1" ---- 00697 sdMonProf_1->setNextMonitoringProfile(orMonProf_1); 00698 orMonProf_1->setNextMonitoringProfile(sMonProf_1); 00699 fullDataPool->setMonitoringProfile(DP_RW_SPD_1,sdMonProf_1); 00700 fullDataPool->setRecoveryAction(DP_RW_SPD_1,nRecAct_1); 00701 00702 // ---- Configuration of data pool item "RW_TOR_1" ---- 00703 fullDataPool->setMonitoringProfile(DP_RW_TOR_1,orMonProf_2); 00704 sRecAct_2->setNextRecoveryAction(nRecAct_2); 00705 fullDataPool->setRecoveryAction(DP_RW_TOR_1,sRecAct_2); 00706 00707 // ---- Configuration of data pool item "RW_SPD_2" ---- 00708 sdMonProf_4->setNextMonitoringProfile(orMonProf_4); 00709 fullDataPool->setMonitoringProfile(DP_RW_SPD_2,sdMonProf_4); 00710 fullDataPool->setRecoveryAction(DP_RW_SPD_2,nRecAct_4); 00711 00712 // ---- Configuration of data pool item "RW_TOR_2" ---- 00713 fullDataPool->setMonitoringProfile(DP_RW_TOR_2,orMonProf_5); 00714 fullDataPool->setRecoveryAction(DP_RW_TOR_2,nRecAct_5); 00715 00716 // ---- Configuration of data pool item "RW_SPD_3" ---- 00717 sdMonProf_7->setNextMonitoringProfile(orMonProf_7); 00718 fullDataPool->setMonitoringProfile(DP_RW_SPD_3,sdMonProf_7); 00719 fullDataPool->setRecoveryAction(DP_RW_SPD_3,nRecAct_7); 00720 00721 // ---- Configuration of data pool item "RW_TOR_3" ---- 00722 fullDataPool->setMonitoringProfile(DP_RW_TOR_3,orMonProf_8); 00723 fullDataPool->setRecoveryAction(DP_RW_TOR_3,nRecAct_8); 00724 00725 // ---- Configuration of data pool item "RW_SPD_4" ---- 00726 sdMonProf_10->setNextMonitoringProfile(orMonProf_10); 00727 fullDataPool->setMonitoringProfile(DP_RW_SPD_4,sdMonProf_10); 00728 fullDataPool->setRecoveryAction(DP_RW_SPD_4,nRecAct_10); 00729 00730 // ---- Configuration of data pool item "RW_TOR_4" ---- 00731 fullDataPool->setMonitoringProfile(DP_RW_TOR_4,orMonProf_11); 00732 fullDataPool->setRecoveryAction(DP_RW_TOR_4,nRecAct_11); 00733 } 00734 00735 void CC_ComponentFactory::configureParameterDatabase(void) { 00736 parDB->setOperationalTable(PARDATABASE_OP_TABLE_START); 00737 parDB->setDefaultTable(PARDATABASE_DEF_TABLE_START); 00738 parDB->reset(); 00739 00740 } 00741 00742 00743 void CC_ComponentFactory::configureFunctionalityManagers(void) { 00744 00745 // ---- Configure the manoeuvre manager 00746 manMan->setPendingManoeuvreListSize(10); 00747 00748 // ---- Configure the telecommand manager 00749 tcMan->setPendingTelecommandListSize(10); 00750 tcMan->setTelecommandLoader(tcLoader); 00751 00752 00753 00754 // ---- Configure the telecommand loader 00755 tcLoader->setMaxNumberOfTc(4); 00756 tcLoader->setMaxTcLength(100); 00757 tcLoader->setTcLoadAreaStart(TC_LOADER_AREA_START); 00758 tcLoader->setTelecommandManager(tcMan); 00759 00760 00761 // ---- Configure the telemetry manager 00762 tmMan->setImmediateQueueSize(5); 00763 tmMan->setTelemetryStream(tmStream); 00764 tmMan->setTelemetryModeManager(tmModeMan); 00765 00766 // ---- Configure the telemetry stream 00767 tmStream->setCapacity(100); 00768 tmStream->setStartAddress(TM_STREAM_START); 00769 00770 // ---- Configure the telemetry mode manager 00771 tmModeMan->setMaxNumberOfPackets(10); 00772 00773 } 00774
Copyright 2003 P&P Software GmbH - All Rights Reserved