/* CIF PROCESS (250, 150), (150, 75) */ process Payloadmanager; /* CIF TEXT (133, 144), (516, 248) */ -- input parameters dcl param_on_off TC_2_1_DistributeOnoffDeviceCommands_Type; dcl param_register_load TC_2_2_DistributeRegisterLoadCommands_Type; dcl param_payload_enabled T_Boolean; -- output parameters dcl param_hk_data PAYLOAD_HK_DATA; dcl param_execution_report EXECUTION_REPORT; -- state dcl payload_data_enabled T_Boolean := false; dcl payload_data UINT8T := 0; -- auxilary dcl hal_success T_Boolean := false; /* CIF ENDTEXT */ /* CIF procedure (766, 482), (184, 35) */ procedure execute_onoff_instruction; /* CIF TEXT (52, 53), (394, 140) */ -- Text area for declarations and comments fpar in instruction DistributeAnOnoffDeviceCommand_Type, in/out operation_success T_Boolean; /* CIF ENDTEXT */ /* CIF START (731, 78), (70, 35) */ START; /* CIF decision (700, 133), (131, 50) */ decision operation_success; /* CIF ANSWER (686, 203), (70, 24) */ (true): /* CIF decision (614, 247), (212, 50) */ decision instruction.onOffDeviceAddress; /* CIF ANSWER (570, 317), (207, 24) */ (on_off_device_address_display): /* CIF decision (596, 361), (156, 50) */ decision payload_data_enabled; /* CIF ANSWER (531, 431), (70, 24) */ (true): /* CIF task (464, 475), (203, 35) */ task payload_data_enabled := false; /* CIF ANSWER (817, 431), (70, 24) */ (false): /* CIF task (752, 475), (199, 35) */ task payload_data_enabled := true; enddecision; /* CIF PROCEDURECALL (469, 526), (409, 35) */ call oled_set_data_enable(payload_data_enabled, operation_success); /* CIF ANSWER (963, 317), (70, 24) */ ELSE: enddecision; /* CIF ANSWER (1044, 203), (70, 24) */ (false): enddecision; /* CIF return (748, 592), (35, 35) */ return ; endprocedure; /* CIF procedure (416, 584), (233, 35) */ procedure execute_register_load_instruction; /* CIF TEXT (161, 110), (388, 140) */ -- Text area for declarations and comments fpar in instruction DistributeARegisterLoadCommand_Type, in/out operation_success T_Boolean; /* CIF ENDTEXT */ /* CIF START (895, 208), (70, 35) */ START; /* CIF decision (864, 263), (131, 50) */ decision operation_success; /* CIF ANSWER (769, 333), (70, 24) */ (true): /* CIF task (583, 377), (441, 35) */ task payload_data := instruction.registerData.register_address_display_data; /* CIF PROCEDURECALL (635, 432), (336, 35) */ call oled_load_register(payload_data, operation_success); /* CIF ANSWER (1035, 333), (70, 24) */ (false): enddecision; /* CIF return (912, 483), (35, 35) */ return ; endprocedure; /* CIF START (917, 10), (70, 35) */ START; /* CIF NEXTSTATE (890, 60), (125, 35) */ NEXTSTATE PayloadDisabled; /* CIF state (2564, 23), (121, 35) */ state PayloadEnabled; /* CIF input (2473, 78), (304, 35) */ input command_register_load(param_register_load); /* CIF decision (2544, 133), (162, 50) */ decision payload_data_enabled; /* CIF ANSWER (2450, 203), (70, 24) */ (true): /* CIF task (2418, 247), (134, 35) */ task hal_success := true; /* CIF task (2206, 297), (558, 56) */ task for instruction in param_register_load.instructionsToDistributeARegisterLoadCommand: call execute_register_load_instruction(instruction, hal_success); endfor; /* CIF decision (2439, 373), (91, 50) */ decision hal_success; /* CIF ANSWER (2136, 443), (70, 24) */ (true): /* CIF task (1976, 487), (389, 88) */ task param_execution_report := execution_report_success : { successfulStartOfExecutionNotificationNotification { requestID request_id_distribute_register_load_command } }; /* CIF ANSWER (2576, 443), (70, 24) */ (false): /* CIF task (2377, 487), (468, 104) */ task param_execution_report := execution_report_failed : { failedStartOfExecutionNotificationNotification { requestID request_id_distribute_register_load_command, failureNoticeData failure_notice_code_invalid_address : invalid_address } }; enddecision; /* CIF ANSWER (3034, 203), (70, 24) */ (false): /* CIF task (2857, 247), (425, 104) */ task param_execution_report := execution_report_failed : { failedStartOfExecutionNotificationNotification { requestID request_id_distribute_register_load_command, failureNoticeData failure_notice_code_invalid_state : disabled } }; enddecision; /* CIF PROCEDURECALL (2481, 641), (289, 35) */ call report_execution(param_execution_report); /* CIF NEXTSTATE (2565, 691), (121, 35) */ NEXTSTATE PayloadEnabled; endstate; /* CIF state (98, 722), (121, 35) */ state PayloadEnabled; /* CIF input (64, 777), (190, 35) */ input trigger_gather_payload_hk; /* CIF task (0, 832), (319, 88) */ task param_hk_data := { payload_enabled true, payload_data_enabled payload_data_enabled, payload_data payload_data }; /* CIF PROCEDURECALL (43, 940), (233, 35) */ call payload_hk_store(param_hk_data); /* CIF NEXTSTATE (97, 990), (125, 35) */ NEXTSTATE PayloadEnabled; endstate; /* CIF state (426, 717), (125, 35) */ state PayloadDisabled; /* CIF input (394, 772), (190, 35) */ input trigger_gather_payload_hk; /* CIF task (330, 827), (319, 88) */ task param_hk_data := { payload_enabled false, payload_data_enabled payload_data_enabled, payload_data payload_data }; /* CIF PROCEDURECALL (373, 978), (233, 35) */ call payload_hk_store(param_hk_data); /* CIF NEXTSTATE (427, 1033), (125, 35) */ NEXTSTATE PayloadDisabled; endstate; /* CIF state (1807, 19), (125, 35) */ state PayloadDisabled; /* CIF input (1760, 74), (219, 35) */ input command_on_off(param_on_off); /* CIF task (1657, 129), (425, 111) */ task param_execution_report := execution_report_failed : { failedStartOfExecutionNotificationNotification { requestID request_id_distribute_on_off_device_command, failureNoticeData failure_notice_code_invalid_state : disabled } }; /* CIF PROCEDURECALL (1725, 260), (289, 35) */ call report_execution(param_execution_report); /* CIF NEXTSTATE (1807, 315), (125, 35) */ NEXTSTATE PayloadDisabled; endstate; /* CIF state (2038, 720), (226, 35) */ state PayloadEnabled,PayloadDisabled; /* CIF input (2012, 775), (277, 35) */ input enable_payload(param_payload_enabled); /* CIF decision (2065, 830), (172, 50) */ decision param_payload_enabled; /* CIF ANSWER (1983, 900), (70, 24) */ (true): /* CIF task (1914, 944), (209, 35) */ task payload_data_enabled := false; /* CIF task (1954, 999), (129, 35) */ task payload_data := 0; /* CIF PROCEDURECALL (1901, 1049), (234, 35) */ call oled_turn_on_off(true, hal_success); /* CIF NEXTSTATE (1956, 1104), (125, 35) */ NEXTSTATE PayloadEnabled; /* CIF ANSWER (2234, 900), (70, 24) */ (false): /* CIF task (2165, 944), (209, 35) */ task payload_data_enabled := false; /* CIF task (2205, 999), (129, 35) */ task payload_data := 0; /* CIF PROCEDURECALL (2147, 1049), (244, 35) */ call oled_turn_on_off(false, hal_success); /* CIF NEXTSTATE (2207, 1104), (125, 35) */ NEXTSTATE PayloadDisabled; enddecision; endstate; /* CIF state (1689, 412), (125, 35) */ state PayloadDisabled; /* CIF input (1600, 467), (304, 35) */ input command_register_load(param_register_load); /* CIF task (1540, 522), (425, 104) */ task param_execution_report := execution_report_failed : { failedStartOfExecutionNotificationNotification { requestID request_id_distribute_register_load_command, failureNoticeData failure_notice_code_invalid_state : disabled } }; /* CIF PROCEDURECALL (1608, 647), (289, 35) */ call report_execution(param_execution_report); /* CIF NEXTSTATE (1690, 702), (125, 35) */ NEXTSTATE PayloadDisabled; endstate; /* CIF state (1108, 373), (121, 35) */ state PayloadEnabled; /* CIF input (1059, 428), (219, 35) */ input command_on_off(param_on_off); /* CIF task (1100, 483), (137, 35) */ task hal_success := true; /* CIF task (911, 533), (516, 56) */ task for instruction in param_on_off.instructionsToDistributeAnOnoffDeviceCommand: call execute_onoff_instruction(instruction, hal_success); endfor; /* CIF decision (1123, 609), (91, 50) */ decision hal_success; /* CIF ANSWER (819, 679), (70, 24) */ (true): /* CIF task (659, 723), (389, 88) */ task param_execution_report := execution_report_success : { successfulStartOfExecutionNotificationNotification { requestID request_id_distribute_on_off_device_command } }; /* CIF ANSWER (1260, 679), (70, 24) */ (false): /* CIF task (1061, 723), (468, 104) */ task param_execution_report := execution_report_failed : { failedStartOfExecutionNotificationNotification { requestID request_id_distribute_on_off_device_command, failureNoticeData failure_notice_code_invalid_address : invalid_address } }; enddecision; /* CIF PROCEDURECALL (1024, 843), (289, 35) */ call report_execution(param_execution_report); /* CIF NEXTSTATE (1108, 893), (121, 35) */ NEXTSTATE PayloadEnabled; endstate; endprocess Payloadmanager;