
-- ===============================================================================
@TIME_DOMAIN continuous

-- ===============================================================================
MODULE main
    VAR
        ExomarsSystem : ExomarsSystem(duration__in__rv_wakeup_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_prepare4night_start, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, duration__in__act_ades_activate_start, startEvent__in__rv_wakeup_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_prepare4night_start, startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, startEvent__in__act_ades_activate_start);
    VAR
        duration__in__rv_wakeup_start : real;
        duration__in__rv_configurereset_start : real;
        duration__in__rv_configure4travel_start : real;
        duration__in__rv_configure4science_start : real;
        duration__in__rv_mms_waitabstime_start : real;
        duration__in__rv_prepare4night_start : real;
        duration__in__act_rtb_switchon_start : real;
        duration__in__act_rtb_switchoff_start : real;
        duration__in__loccam_initialise_start : real;
        duration__in__imu_initialise_start : real;
        duration__in__gnc_fpath_straight_start : real;
        duration__in__bema_initialise_start : real;
        duration__in__gnc_updateposition_start : real;
        duration__in__gnc_updateheading_start : real;
        duration__in__start_dhs_reduced2nominal : real;
        duration__in__start_dhs_reduced2highpwr : real;
        duration__in__act_drill_1_start : real;
        duration__in__act_drill_positioner_move_start : real;
        duration__in__act_drill_initialize_start : real;
        duration__in__act_collect_sample_start : real;
        duration__in__act_deliver_sample_start : real;
        duration__in__act_drillandspds_ceswitchon_start : real;
        duration__in__act_drillandspds_ceswitchoff_start : real;
        duration__in__act_drill_dbe_initialize_start : real;
        duration__in__act_gotospds_start : real;
        duration__in__act_end_of_spds_start : real;
        duration__in__act_spds_homing_start : real;
        duration__in__act_spds_preparetoreceivedrillsample_start : real;
        duration__in__clupi_switchon_start : real;
        duration__in__clupi_diagnostic_start : real;
        duration__in__clupi_timesync_start : real;
        duration__in__clupi_acquirezscience_start : real;
        duration__in__clupi_switchoff_start : real;
        duration__in__act_ades_activate_start : real;

    IVAR
        startEvent__in__rv_wakeup_start : boolean;
        startEvent__in__rv_configurereset_start : boolean;
        startEvent__in__rv_configure4travel_start : boolean;
        startEvent__in__rv_configure4science_start : boolean;
        startEvent__in__rv_mms_waitabstime_start : boolean;
        startEvent__in__rv_prepare4night_start : boolean;
        startEvent__in__act_rtb_switchon_start : boolean;
        startEvent__in__act_rtb_switchoff_start : boolean;
        startEvent__in__loccam_initialise_start : boolean;
        startEvent__in__imu_initialise_start : boolean;
        startEvent__in__gnc_fpath_straight_start : boolean;
        startEvent__in__bema_initialise_start : boolean;
        startEvent__in__gnc_updateposition_start : boolean;
        startEvent__in__gnc_updateheading_start : boolean;
        startEvent__in__start_dhs_reduced2nominal : boolean;
        startEvent__in__start_dhs_reduced2highpwr : boolean;
        startEvent__in__act_drill_1_start : boolean;
        startEvent__in__act_drill_positioner_move_start : boolean;
        startEvent__in__act_drill_initialize_start : boolean;
        startEvent__in__act_collect_sample_start : boolean;
        startEvent__in__act_deliver_sample_start : boolean;
        startEvent__in__act_drillandspds_ceswitchon_start : boolean;
        startEvent__in__act_drillandspds_ceswitchoff_start : boolean;
        startEvent__in__act_drill_dbe_initialize_start : boolean;
        startEvent__in__act_gotospds_start : boolean;
        startEvent__in__act_end_of_spds_start : boolean;
        startEvent__in__act_spds_homing_start : boolean;
        startEvent__in__act_spds_preparetoreceivedrillsample_start : boolean;
        startEvent__in__clupi_switchon_start : boolean;
        startEvent__in__clupi_diagnostic_start : boolean;
        startEvent__in__clupi_timesync_start : boolean;
        startEvent__in__clupi_acquirezscience_start : boolean;
        startEvent__in__clupi_switchoff_start : boolean;
        startEvent__in__act_ades_activate_start : boolean;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE ExomarsSystem(duration__in__rv_wakeup_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_prepare4night_start, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, duration__in__act_ades_activate_start, startEvent__in__rv_wakeup_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_prepare4night_start, startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, startEvent__in__act_ades_activate_start)
    VAR
        rover : ExomarsRover(duration__in__rv_wakeup_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_prepare4night_start, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, duration__in__act_ades_activate_start, startEvent__in__rv_wakeup_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_prepare4night_start, startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, startEvent__in__act_ades_activate_start);
        env : Environment;

-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE ExomarsRover(duration__in__rv_wakeup_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_prepare4night_start, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, duration__in__act_ades_activate_start, startEvent__in__rv_wakeup_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_prepare4night_start, startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, startEvent__in__act_ades_activate_start)
    VAR
        drillmamissspds : DrillMamissSpds(startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, _drillmamissspds.startEvent__in__act_drill_dbe_switchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, _drillmamissspds.generatedEventPort__in__set_drill_status_deliver_sample, _drillmamissspds.generatedEventPort__in__set_drill_power_deliver_sample, _drillmamissspds.generatedEventPort__in__set_drill_status_drill_positioner_move, _drillmamissspds.generatedEventPort__in__set_drill_power_drill_positioner_move, _drillmamissspds.generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move, _drillmamissspds.generatedEventPort__in__set_drill_status_drill_1, _drillmamissspds.generatedEventPort__in__set_drill_power_drill_1, _drillmamissspds.generatedEventPort__in__set_drill_rod_q_drill_1, _drillmamissspds.generatedEventPort__in__set_drill_rod_sample_pose_drill_1, _drillmamissspds.generatedEventPort__in__set_drill_status_drill_dbe_initialize, _drillmamissspds.generatedEventPort__in__set_drill_power_drill_dbe_initialize, _drillmamissspds.generatedEventPort__in__set_drill_status_drillandspds_ceswitchon, _drillmamissspds.generatedEventPort__in__set_drill_power_drillandspds_ceswitchon, _drillmamissspds.generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff, _drillmamissspds.generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff, _drillmamissspds.generatedEventPort__in__set_drill_status_drill_dbe_switchoff, _drillmamissspds.generatedEventPort__in__set_drill_power_drill_dbe_switchoff, _drillmamissspds.generatedEventPort__in__set_drill_status_gotospds, _drillmamissspds.generatedEventPort__in__set_drill_power_gotospds, _drillmamissspds.generatedEventPort__in__set_drill_status_end_of_spds, _drillmamissspds.generatedEventPort__in__set_drill_power_end_of_spds, _drillmamissspds.generatedEventPort__in__set_drill_status_spds_homing, _drillmamissspds.generatedEventPort__in__set_drill_power_spds_homing, _drillmamissspds.generatedEventPort__in__set_spds_cstm_pose_spds_homing, _drillmamissspds.generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample, _drillmamissspds.generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample, _drillmamissspds.generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample, _drillmamissspds.generatedEventPort__in__set_drill_status_drill_initialize, _drillmamissspds.generatedEventPort__in__set_drill_power_drill_initialize, _drillmamissspds.generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize, _drillmamissspds.generatedEventPort__in__set_drill_status_collect_sample, _drillmamissspds.generatedEventPort__in__set_drill_power_collect_sample, rtb.rtb_power, gnc.imu_power, gnc.bema_power, gnc.loccam_power, clupi.clupi_power, dhs.dhs_power, ade.ade_left_power, ade.ade_right_power, dhs.dhs_status, rtb.rtb_status, gnc.bema_status, rover_subsys.sys_time_seconds, rover_subsys.sys_energy_used, rover_subsys.sys_rover_longitude, rover_subsys.sys_rover_latitude, rover_subsys.sys_simstart_utc, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, _drillmamissspds.duration__in__act_drill_dbe_switchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, _drillmamissspds.status__in__set_drill_status_deliver_sample, _drillmamissspds.power__in__set_drill_power_deliver_sample, _drillmamissspds.status__in__set_drill_status_drill_positioner_move, _drillmamissspds.power__in__set_drill_power_drill_positioner_move, _drillmamissspds.pose__in__set_drill_positioner_pose_drill_positioner_move, _drillmamissspds.status__in__set_drill_status_drill_1, _drillmamissspds.power__in__set_drill_power_drill_1, _drillmamissspds.power__in__set_drill_rod_q_drill_1, _drillmamissspds.pose__in__set_drill_rod_sample_pose_drill_1, _drillmamissspds.status__in__set_drill_status_drill_dbe_initialize, _drillmamissspds.power__in__set_drill_power_drill_dbe_initialize, _drillmamissspds.status__in__set_drill_status_drillandspds_ceswitchon, _drillmamissspds.power__in__set_drill_power_drillandspds_ceswitchon, _drillmamissspds.status__in__set_drill_status_drillandspds_ceswitchoff, _drillmamissspds.power__in__set_drill_power_drillandspds_ceswitchoff, _drillmamissspds.status__in__set_drill_status_drill_dbe_switchoff, _drillmamissspds.power__in__set_drill_power_drill_dbe_switchoff, _drillmamissspds.status__in__set_drill_status_gotospds, _drillmamissspds.power__in__set_drill_power_gotospds, _drillmamissspds.status__in__set_drill_status_end_of_spds, _drillmamissspds.power__in__set_drill_power_end_of_spds, _drillmamissspds.status__in__set_drill_status_spds_homing, _drillmamissspds.power__in__set_drill_power_spds_homing, _drillmamissspds.pose__in__set_spds_cstm_pose_spds_homing, _drillmamissspds.status__in__set_drill_status_spds_preparetoreceivedrillsample, _drillmamissspds.pose__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample, _drillmamissspds.power__in__set_drill_power_spds_preparetoreceivedrillsample, _drillmamissspds.status__in__set_drill_status_drill_initialize, _drillmamissspds.power__in__set_drill_power_drill_initialize, _drillmamissspds.status__in__set_drill_sensor_calib_status_drill_initialize, _drillmamissspds.status__in__set_drill_status_collect_sample, _drillmamissspds.power__in__set_drill_power_collect_sample);
        rtb : RTB(startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, _rtb.generatedEventPort__in__set_rtb_status_switchon, _rtb.generatedEventPort__in__set_rtb_status_switchoff, _rtb.generatedEventPort__in__set_rtb_power_switchon, _rtb.generatedEventPort__in__set_rtb_power_switchoff, ade.ade_left_power, ade.ade_right_power, dhs.dhs_power, gnc.imu_power, gnc.loccam_power, gnc.bema_power, drillmamissspds.drill_power, clupi.clupi_power, rover_subsys.sys_time_seconds, rover_subsys.sys_energy_used, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, _rtb.status__in__set_rtb_status_switchon, _rtb.status__in__set_rtb_status_switchoff, _rtb.power__in__set_rtb_power_switchon, _rtb.power__in__set_rtb_power_switchoff);
        clupi : Clupi(_clupi.generatedEventPort__in__set_clupi_status_switchon, _clupi.generatedEventPort__in__set_clupi_power_switchon, _clupi.generatedEventPort__in__set_clupi_time_synch_switchon, _clupi.generatedEventPort__in__set_clupi_imagedatatype_switchon, _clupi.generatedEventPort__in__set_clupi_binning_switchon, _clupi.generatedEventPort__in__set_clupi_mem_check_switchon, _clupi.generatedEventPort__in__set_clupi_quantization_switchon, _clupi.generatedEventPort__in__set_clupi_status_diagnostic, _clupi.generatedEventPort__in__set_clupi_power_diagnostic, _clupi.generatedEventPort__in__set_clupi_mem_check_diagnostic, _clupi.generatedEventPort__in__set_clupi_status_timesync, _clupi.generatedEventPort__in__set_clupi_power_timesync, _clupi.generatedEventPort__in__set_clupi_time_synch_timesync, _clupi.generatedEventPort__in__set_clupi_status_acquirezscience, _clupi.generatedEventPort__in__set_clupi_power_acquirezscience, _clupi.generatedEventPort__in__set_clupi_status_switchoff, _clupi.generatedEventPort__in__set_clupi_power_switchoff, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, next(rover_subsys.generatedEventPort__in__set_clupi_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_clupi_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_clupi_power_configurereset) != rover_subsys.generatedEventPort__in__set_clupi_power_configurereset, ade.ade_left_power, ade.ade_right_power, dhs.dhs_power, rtb.rtb_power, drillmamissspds.drill_power, gnc.imu_power, gnc.bema_power, gnc.loccam_power, dhs.dhs_status, rover_subsys.sys_time_seconds, rover_subsys.sys_energy_used, _clupi.status__in__set_clupi_status_switchon, _clupi.power__in__set_clupi_power_switchon, _clupi.sync__in__set_clupi_time_synch_switchon, _clupi.type__in__set_clupi_imagedatatype_switchon, _clupi.binning__in__set_clupi_binning_switchon, _clupi.check__in__set_clupi_mem_check_switchon, _clupi.quantization__in__set_clupi_quantization_switchon, _clupi.status__in__set_clupi_status_diagnostic, _clupi.power__in__set_clupi_power_diagnostic, _clupi.check__in__set_clupi_mem_check_diagnostic, _clupi.status__in__set_clupi_status_timesync, _clupi.power__in__set_clupi_power_timesync, _clupi.sync__in__set_clupi_time_synch_timesync, _clupi.status__in__set_clupi_status_acquirezscience, _clupi.power__in__set_clupi_power_acquirezscience, _clupi.status__in__set_clupi_status_switchoff, _clupi.power__in__set_clupi_power_switchoff, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, rover_subsys.status__in__set_clupi_status_rv_configurereset, rover_subsys.power__in__set_clupi_power_configurereset);
        rover_subsys : Rover(startEvent__in__rv_wakeup_start, startEvent__in__rv_prepare4night_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup, _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset, _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel, _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science, _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime, _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night, _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_wakeup, _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_configurereset, _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel, _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_configure4science, _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime, _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night, next(ade.generatedEventPort__in__set_sys_time_seconds) != ade.generatedEventPort__in__set_sys_time_seconds, next(ade.generatedEventPort__in__set_sys_energy_used) != ade.generatedEventPort__in__set_sys_energy_used, next(rtb.generatedEventPort__in__set_sys_time_seconds_switchon) != rtb.generatedEventPort__in__set_sys_time_seconds_switchon, next(rtb.generatedEventPort__in__set_sys_energy_used_switchon) != rtb.generatedEventPort__in__set_sys_energy_used_switchon, next(rtb.generatedEventPort__in__set_sys_time_seconds_switchoff) != rtb.generatedEventPort__in__set_sys_time_seconds_switchoff, next(rtb.generatedEventPort__in__set_sys_energy_used_switchoff) != rtb.generatedEventPort__in__set_sys_energy_used_switchoff, next(gnc.generatedEventPort__in__set_sys_time_seconds_loccam_initialise) != gnc.generatedEventPort__in__set_sys_time_seconds_loccam_initialise, next(gnc.generatedEventPort__in__set_sys_energy_used_loccam_initialise) != gnc.generatedEventPort__in__set_sys_energy_used_loccam_initialise, next(gnc.generatedEventPort__in__set_sys_time_seconds_imu_initialise) != gnc.generatedEventPort__in__set_sys_time_seconds_imu_initialise, next(gnc.generatedEventPort__in__set_sys_energy_used_imu_initialise) != gnc.generatedEventPort__in__set_sys_energy_used_imu_initialise, next(gnc.generatedEventPort__in__set_sys_time_seconds_gnc_updateheading) != gnc.generatedEventPort__in__set_sys_time_seconds_gnc_updateheading, next(gnc.generatedEventPort__in__set_sys_energy_used_gnc_updateheading) != gnc.generatedEventPort__in__set_sys_energy_used_gnc_updateheading, next(gnc.generatedEventPort__in__set_sys_time_seconds_gnc_updateposition) != gnc.generatedEventPort__in__set_sys_time_seconds_gnc_updateposition, next(gnc.generatedEventPort__in__set_sys_energy_used_gnc_updateposition) != gnc.generatedEventPort__in__set_sys_energy_used_gnc_updateposition, next(gnc.generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight) != gnc.generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight, next(gnc.generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight) != gnc.generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight, next(gnc.generatedEventPort__in__set_sys_time_seconds_bema_initialise) != gnc.generatedEventPort__in__set_sys_time_seconds_bema_initialise, next(gnc.generatedEventPort__in__set_sys_energy_used_bema_initialise) != gnc.generatedEventPort__in__set_sys_energy_used_bema_initialise, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_deliver_sample) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_deliver_sample, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_deliver_sample) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_deliver_sample, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_positioner_move) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_positioner_move, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_positioner_move) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_positioner_move, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_1) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_1, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_1) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_1, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_initialize) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_initialize, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_initialize) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_initialize, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_collect_sample) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_collect_sample, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_collect_sample) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_collect_sample, next(dhs.generatedEventPort__in__set_sys_time_seconds_reduced2nominal) != dhs.generatedEventPort__in__set_sys_time_seconds_reduced2nominal, next(dhs.generatedEventPort__in__set_sys_energy_used_reduced2nominal) != dhs.generatedEventPort__in__set_sys_energy_used_reduced2nominal, next(dhs.generatedEventPort__in__set_sys_time_seconds_reduced2highpwr) != dhs.generatedEventPort__in__set_sys_time_seconds_reduced2highpwr, next(dhs.generatedEventPort__in__set_sys_energy_used_reduced2highpwr) != dhs.generatedEventPort__in__set_sys_energy_used_reduced2highpwr, next(clupi.generatedEventPort__in__set_sys_time_seconds_switchon) != clupi.generatedEventPort__in__set_sys_time_seconds_switchon, next(clupi.generatedEventPort__in__set_sys_energy_used_switchon) != clupi.generatedEventPort__in__set_sys_energy_used_switchon, next(clupi.generatedEventPort__in__set_sys_time_seconds_diagnostic) != clupi.generatedEventPort__in__set_sys_time_seconds_diagnostic, next(clupi.generatedEventPort__in__set_sys_energy_used_diagnostic) != clupi.generatedEventPort__in__set_sys_energy_used_diagnostic, next(clupi.generatedEventPort__in__set_sys_time_seconds_timesync) != clupi.generatedEventPort__in__set_sys_time_seconds_timesync, next(clupi.generatedEventPort__in__set_sys_energy_used_timesync) != clupi.generatedEventPort__in__set_sys_energy_used_timesync, next(clupi.generatedEventPort__in__set_sys_time_seconds_acquirezscience) != clupi.generatedEventPort__in__set_sys_time_seconds_acquirezscience, next(clupi.generatedEventPort__in__set_sys_energy_used_acquirezscience) != clupi.generatedEventPort__in__set_sys_energy_used_acquirezscience, next(clupi.generatedEventPort__in__set_sys_time_seconds_switchoff) != clupi.generatedEventPort__in__set_sys_time_seconds_switchoff, next(clupi.generatedEventPort__in__set_sys_energy_used_switchoff) != clupi.generatedEventPort__in__set_sys_energy_used_switchoff, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_gotospds) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_gotospds, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_gotospds) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_gotospds, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_end_of_spds) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_end_of_spds, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_end_of_spds) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_end_of_spds, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_spds_homing) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_spds_homing, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_spds_homing) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_spds_homing, next(drillmamissspds.generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample) != drillmamissspds.generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, next(drillmamissspds.generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample) != drillmamissspds.generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample, gnc.navcam_status, gnc.bema_status, gnc.loccam_status, ade.ade_left_status, gnc.imu_status, clupi.clupi_status, dhs.dhs_status, _rover_subsys.drill_status, _rover_subsys.rtb_status, ade.ade_right_status, rtb.rtb_power, gnc.imu_power, gnc.bema_power, gnc.loccam_power, drillmamissspds.drill_power, clupi.clupi_power, dhs.dhs_power, ade.ade_left_power, ade.ade_right_power, duration__in__rv_wakeup_start, duration__in__rv_prepare4night_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, _rover_subsys.status__in__set_sys_time_seconds_act_rv_wakeup, _rover_subsys.status__in__set_sys_time_seconds_act_rv_configurereset, _rover_subsys.status__in__set_sys_time_seconds_act_rv_configure4travel, _rover_subsys.status__in__set_sys_time_seconds_act_rv_configure4science, _rover_subsys.status__in__set_sys_time_seconds_act_rv_mms_waitabstime, _rover_subsys.status__in__set_sys_time_seconds_act_rv_prepare4night, _rover_subsys.status__in__set_sys_energy_used_act_rv_wakeup, _rover_subsys.status__in__set_sys_energy_used_act_rv_configurereset, _rover_subsys.status__in__set_sys_energy_used_act_rv_configure4travel, _rover_subsys.status__in__set_sys_energy_used_act_rv_configure4science, _rover_subsys.status__in__set_sys_energy_used_act_rv_mms_waitabstime, _rover_subsys.status__in__set_sys_energy_used_act_rv_prepare4night, ade.status__in__set_sys_time_seconds, ade.status__in__set_sys_energy_used, rtb.status__in__set_sys_time_seconds_switchon, rtb.status__in__set_sys_energy_used_switchon, rtb.status__in__set_sys_time_seconds_switchoff, rtb.status__in__set_sys_energy_used_switchoff, gnc.status__in__set_sys_time_seconds_loccam_initialise, gnc.status__in__set_sys_energy_used_loccam_initialise, gnc.status__in__set_sys_time_seconds_imu_initialise, gnc.status__in__set_sys_energy_used_imu_initialise, gnc.status__in__set_sys_time_seconds_gnc_updateheading, gnc.status__in__set_sys_energy_used_gnc_updateheading, gnc.status__in__set_sys_time_seconds_gnc_updateposition, gnc.status__in__set_sys_energy_used_gnc_updateposition, gnc.status__in__set_sys_time_seconds_gnc_fpath_straight, gnc.status__in__set_sys_energy_used_gnc_fpath_straight, gnc.status__in__set_sys_time_seconds_bema_initialise, gnc.status__in__set_sys_energy_used_bema_initialise, drillmamissspds.status__in__set_sys_time_seconds_deliver_sample, drillmamissspds.status__in__set_sys_energy_used_deliver_sample, drillmamissspds.status__in__set_sys_time_seconds_drill_positioner_move, drillmamissspds.status__in__set_sys_energy_used_drill_positioner_move, drillmamissspds.status__in__set_sys_time_seconds_drill_1, drillmamissspds.status__in__set_sys_energy_used_drill_1, drillmamissspds.status__in__set_sys_time_seconds_drill_dbe_initialize, drillmamissspds.status__in__set_sys_energy_used_drill_dbe_initialize, drillmamissspds.status__in__set_sys_time_seconds_drillandspds_ceswitchon, drillmamissspds.status__in__set_sys_energy_used_drillandspds_ceswitchon, drillmamissspds.status__in__set_sys_time_seconds_drill_initialize, drillmamissspds.status__in__set_sys_energy_used_drill_initialize, drillmamissspds.status__in__set_sys_time_seconds_collect_sample, drillmamissspds.status__in__set_sys_energy_used_collect_sample, dhs.status__in__set_sys_time_seconds_reduced2nominal, dhs.status__in__set_sys_energy_used_reduced2nominal, dhs.status__in__set_sys_time_seconds_reduced2highpwr, dhs.status__in__set_sys_energy_used_reduced2highpwr, clupi.status__in__set_sys_time_seconds_switchon, clupi.status__in__set_sys_energy_used_switchon, clupi.status__in__set_sys_time_seconds_diagnostic, clupi.status__in__set_sys_energy_used_diagnostic, clupi.status__in__set_sys_time_seconds_timesync, clupi.status__in__set_sys_energy_used_timesync, clupi.status__in__set_sys_time_seconds_acquirezscience, clupi.status__in__set_sys_energy_used_acquirezscience, clupi.status__in__set_sys_time_seconds_switchoff, clupi.status__in__set_sys_energy_used_switchoff, drillmamissspds.status__in__set_sys_time_seconds_drill_dbe_switchoff, drillmamissspds.status__in__set_sys_energy_used_drill_dbe_switchoff, drillmamissspds.status__in__set_sys_time_seconds_gotospds, drillmamissspds.status__in__set_sys_energy_used_gotospds, drillmamissspds.status__in__set_sys_time_seconds_end_of_spds, drillmamissspds.status__in__set_sys_energy_used_end_of_spds, drillmamissspds.status__in__set_sys_time_seconds_spds_homing, drillmamissspds.status__in__set_sys_energy_used_spds_homing, drillmamissspds.status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, drillmamissspds.status__in__set_sys_energy_used_spds_preparetoreceivedrillsample);
        ade : Ade(startEvent__in__act_ades_activate_start, _ade.generatedEventPort__in__set_ade_right_status, _ade.generatedEventPort__in__set_ade_left_status, _ade.generatedEventPort__in__set_ade_left_power, _ade.generatedEventPort__in__set_ade_right_power, next(rover_subsys.generatedEventPort__in__set_ade_right_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_ade_right_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_ade_left_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_ade_left_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_ade_left_power_rv_configurereset) != rover_subsys.generatedEventPort__in__set_ade_left_power_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_ade_right_power_rv_configurereset) != rover_subsys.generatedEventPort__in__set_ade_right_power_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_ade_right_status_rv_configure4science) != rover_subsys.generatedEventPort__in__set_ade_right_status_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_ade_left_status_rv_configure4science) != rover_subsys.generatedEventPort__in__set_ade_left_status_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_ade_left_power_rv_configure4science) != rover_subsys.generatedEventPort__in__set_ade_left_power_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_ade_right_power_rv_configure4science) != rover_subsys.generatedEventPort__in__set_ade_right_power_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_ade_right_status_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_ade_right_status_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_ade_left_status_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_ade_left_status_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_ade_left_power_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_ade_left_power_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_ade_right_power_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_ade_right_power_rv_configure4travel, rtb.rtb_power, dhs.dhs_power, gnc.imu_power, gnc.loccam_power, gnc.bema_power, drillmamissspds.drill_power, clupi.clupi_power, rover_subsys.sys_time_seconds, rover_subsys.sys_energy_used, duration__in__act_ades_activate_start, _ade.status__in__set_ade_right_status, _ade.status__in__set_ade_left_status, _ade.status__in__set_ade_left_power, _ade.status__in__set_ade_right_power, rover_subsys.status__in__set_ade_right_status_rv_configurereset, rover_subsys.status__in__set_ade_left_status_rv_configurereset, rover_subsys.status__in__set_ade_left_power_rv_configurereset, rover_subsys.status__in__set_ade_right_power_rv_configurereset, rover_subsys.status__in__set_ade_right_status_rv_configure4science, rover_subsys.status__in__set_ade_left_status_rv_configure4science, rover_subsys.status__in__set_ade_left_power_rv_configure4science, rover_subsys.status__in__set_ade_right_power_rv_configure4science, rover_subsys.status__in__set_ade_right_status_rv_configure4travel, rover_subsys.status__in__set_ade_left_status_rv_configure4travel, rover_subsys.status__in__set_ade_left_power_rv_configure4travel, rover_subsys.status__in__set_ade_right_power_rv_configure4travel);
        gnc : GNC(startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, _gnc.generatedEventPort__in__set_loccam_power_initialise, _gnc.generatedEventPort__in__set_loccam_status_initialise, _gnc.generatedEventPort__in__set_imu_power_initialise, _gnc.generatedEventPort__in__set_imu_status_initialise, _gnc.generatedEventPort__in__set_imu_power_gnc_updateheading, _gnc.generatedEventPort__in__set_imu_status_gnc_updateheading, _gnc.generatedEventPort__in__set_heading_updated_gnc_updateheading, _gnc.generatedEventPort__in__set_position_updated_gnc_updateposition, _gnc.generatedEventPort__in__set_bema_power_initialise, _gnc.generatedEventPort__in__set_bema_status_initialise, next(rover_subsys.generatedEventPort__in__set_imu_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_imu_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_loccam_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_loccam_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_bema_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_bema_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_loccam_power_configurereset) != rover_subsys.generatedEventPort__in__set_loccam_power_configurereset, next(rover_subsys.generatedEventPort__in__set_imu_power_configurereset) != rover_subsys.generatedEventPort__in__set_imu_power_configurereset, next(rover_subsys.generatedEventPort__in__set_bema_power_configurereset) != rover_subsys.generatedEventPort__in__set_bema_power_configurereset, next(rover_subsys.generatedEventPort__in__set_imu_status_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_imu_status_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_loccam_status_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_loccam_status_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_bema_status_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_bema_status_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_loccam_power_configure4travel) != rover_subsys.generatedEventPort__in__set_loccam_power_configure4travel, next(rover_subsys.generatedEventPort__in__set_imu_power_configure4travel) != rover_subsys.generatedEventPort__in__set_imu_power_configure4travel, next(rover_subsys.generatedEventPort__in__set_bema_power_configure4travel) != rover_subsys.generatedEventPort__in__set_bema_power_configure4travel, next(rover_subsys.generatedEventPort__in__set_imu_status_rv_configure4science) != rover_subsys.generatedEventPort__in__set_imu_status_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_loccam_status_rv_configure4science) != rover_subsys.generatedEventPort__in__set_loccam_status_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_bema_status_rv_configure4science) != rover_subsys.generatedEventPort__in__set_bema_status_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_loccam_power_configure4science) != rover_subsys.generatedEventPort__in__set_loccam_power_configure4science, next(rover_subsys.generatedEventPort__in__set_imu_power_configure4science) != rover_subsys.generatedEventPort__in__set_imu_power_configure4science, next(rover_subsys.generatedEventPort__in__set_bema_power_configure4science) != rover_subsys.generatedEventPort__in__set_bema_power_configure4science, next(rover_subsys.generatedEventPort__in__set_navcam_status_rv_configurereset) != rover_subsys.generatedEventPort__in__set_navcam_status_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_navcam_status_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_navcam_status_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_navcam_status_rv_configure4science) != rover_subsys.generatedEventPort__in__set_navcam_status_rv_configure4science, dhs.dhs_status, ade.ade_right_status, ade.ade_left_status, ade.ade_left_power, ade.ade_right_power, clupi.clupi_power, drillmamissspds.drill_power, rtb.rtb_power, dhs.dhs_power, rover_subsys.sys_time_seconds, rover_subsys.sys_energy_used, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, _gnc.status__in__set_loccam_power_initialise, _gnc.status__in__set_loccam_status_initialise, _gnc.status__in__set_imu_power_initialise, _gnc.status__in__set_imu_status_initialise, _gnc.status__in__set_imu_power_gnc_updateheading, _gnc.status__in__set_imu_status_gnc_updateheading, _gnc.status__in__set_heading_updated_gnc_updateheading, _gnc.status__in__set_position_updated_gnc_updateposition, _gnc.status__in__set_bema_power_initialise, _gnc.status__in__set_bema_status_initialise, rover_subsys.status__in__set_imu_status_rv_configurereset, rover_subsys.status__in__set_navcam_status_rv_configurereset, rover_subsys.status__in__set_loccam_status_rv_configurereset, rover_subsys.status__in__set_bema_status_rv_configurereset, rover_subsys.status__in__set_loccam_power_configurereset, rover_subsys.status__in__set_imu_power_configurereset, rover_subsys.status__in__set_bema_power_configurereset, rover_subsys.status__in__set_imu_status_rv_configure4travel, rover_subsys.status__in__set_navcam_status_rv_configure4travel, rover_subsys.status__in__set_loccam_status_rv_configure4travel, rover_subsys.status__in__set_bema_status_rv_configure4travel, rover_subsys.status__in__set_loccam_power_configure4travel, rover_subsys.status__in__set_imu_power_configure4travel, rover_subsys.status__in__set_bema_power_configure4travel, rover_subsys.status__in__set_imu_status_rv_configure4science, rover_subsys.status__in__set_navcam_status_rv_configure4science, rover_subsys.status__in__set_loccam_status_rv_configure4science, rover_subsys.status__in__set_bema_status_rv_configure4science, rover_subsys.status__in__set_loccam_power_configure4science, rover_subsys.status__in__set_imu_power_configure4science, rover_subsys.status__in__set_bema_power_configure4science);
        dhs : Dhs(startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, _dhs.generatedEventPort__in__set_dhs_status_reduced2nominal, _dhs.generatedEventPort__in__set_dhs_status_reduced2highpwr, _dhs.generatedEventPort__in__set_dhs_power_reduced2nominal, _dhs.generatedEventPort__in__set_dhs_power_reduced2highpwr, next(rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_wakeup) != rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_wakeup, next(rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_configurereset) != rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_configurereset, next(rover_subsys.generatedEventPort__in__set_dhs_power_wakeup) != rover_subsys.generatedEventPort__in__set_dhs_power_wakeup, next(rover_subsys.generatedEventPort__in__set_dhs_power_configurereset) != rover_subsys.generatedEventPort__in__set_dhs_power_configurereset, next(rover_subsys.generatedEventPort__in__set_dhs_power_prepare4night) != rover_subsys.generatedEventPort__in__set_dhs_power_prepare4night, next(rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_prepare4night) != rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_prepare4night, next(rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_configure4travel) != rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_configure4travel, next(rover_subsys.generatedEventPort__in__set_dhs_power_configure4travel) != rover_subsys.generatedEventPort__in__set_dhs_power_configure4travel, next(rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_configure4science) != rover_subsys.generatedEventPort__in__set_dhs_status_act_rv_configure4science, next(rover_subsys.generatedEventPort__in__set_dhs_power_configure4science) != rover_subsys.generatedEventPort__in__set_dhs_power_configure4science, rover_subsys.sys_time_seconds, rover_subsys.sys_energy_used, ade.ade_left_power, ade.ade_right_power, clupi.clupi_power, drillmamissspds.drill_power, rtb.rtb_power, gnc.imu_power, gnc.bema_power, gnc.loccam_power, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, _dhs.status__in__set_dhs_status_reduced2nominal, _dhs.status__in__set_dhs_status_reduced2highpwr, _dhs.status__in__set_dhs_power_reduced2nominal, _dhs.status__in__set_dhs_power_reduced2highpwr, rover_subsys.status__in__set_dhs_status_act_rv_wakeup, rover_subsys.status__in__set_dhs_status_act_rv_configurereset, rover_subsys.status__in__set_dhs_power_wakeup, rover_subsys.status__in__set_dhs_power_configurereset, rover_subsys.status__in__set_dhs_power_prepare4night, rover_subsys.status__in__set_dhs_status_act_rv_prepare4night, rover_subsys.status__in__set_dhs_status_act_rv_configure4travel, rover_subsys.status__in__set_dhs_power_configure4travel, rover_subsys.status__in__set_dhs_status_act_rv_configure4science, rover_subsys.status__in__set_dhs_power_configure4science);
    VAR
        _dhs.status__in__set_dhs_status_reduced2nominal : {DHS_HIGHPOWER, DHS_NOMINAL, DHS_REDUCED, DHS_LOWPOWER};
        _dhs.status__in__set_dhs_status_reduced2highpwr : {DHS_HIGHPOWER, DHS_NOMINAL, DHS_REDUCED, DHS_LOWPOWER};
        _dhs.status__in__set_dhs_power_reduced2nominal : real;
        _dhs.status__in__set_dhs_power_reduced2highpwr : real;
        _gnc.status__in__set_loccam_power_initialise : real;
        _gnc.status__in__set_loccam_status_initialise : {LOCCAM_STANDBY, LOCCAM_OFF};
        _gnc.status__in__set_imu_power_initialise : real;
        _gnc.status__in__set_imu_status_initialise : {IMU_OPERATING, IMU_OFF};
        _gnc.status__in__set_imu_power_gnc_updateheading : real;
        _gnc.status__in__set_imu_status_gnc_updateheading : {IMU_OPERATING, IMU_OFF};
        _gnc.status__in__set_heading_updated_gnc_updateheading : boolean;
        _gnc.status__in__set_position_updated_gnc_updateposition : boolean;
        _gnc.status__in__set_bema_power_initialise : real;
        _gnc.status__in__set_bema_status_initialise : {BEMA_OFF, BEMA_STANDBY};
        _ade.status__in__set_ade_right_status : {ADE_RIGHT_STANDBY, ADE_RIGHT_OFF};
        _ade.status__in__set_ade_left_status : {ADE_LEFT_STANDBY, ADE_LEFT_OFF};
        _ade.status__in__set_ade_left_power : real;
        _ade.status__in__set_ade_right_power : real;
        _rover_subsys.drill_status : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _rover_subsys.rtb_status : {RTB_ON, RTB_OFF};
        _rover_subsys.status__in__set_sys_time_seconds_act_rv_wakeup : real;
        _rover_subsys.status__in__set_sys_time_seconds_act_rv_configurereset : real;
        _rover_subsys.status__in__set_sys_time_seconds_act_rv_configure4travel : real;
        _rover_subsys.status__in__set_sys_time_seconds_act_rv_configure4science : real;
        _rover_subsys.status__in__set_sys_time_seconds_act_rv_mms_waitabstime : real;
        _rover_subsys.status__in__set_sys_time_seconds_act_rv_prepare4night : real;
        _rover_subsys.status__in__set_sys_energy_used_act_rv_wakeup : real;
        _rover_subsys.status__in__set_sys_energy_used_act_rv_configurereset : real;
        _rover_subsys.status__in__set_sys_energy_used_act_rv_configure4travel : real;
        _rover_subsys.status__in__set_sys_energy_used_act_rv_configure4science : real;
        _rover_subsys.status__in__set_sys_energy_used_act_rv_mms_waitabstime : real;
        _rover_subsys.status__in__set_sys_energy_used_act_rv_prepare4night : real;
        _clupi.status__in__set_clupi_status_switchon : {CLUPI_OFF, CLUPI_SDBY};
        _clupi.power__in__set_clupi_power_switchon : real;
        _clupi.sync__in__set_clupi_time_synch_switchon : boolean;
        _clupi.type__in__set_clupi_imagedatatype_switchon : integer;
        _clupi.binning__in__set_clupi_binning_switchon : integer;
        _clupi.check__in__set_clupi_mem_check_switchon : boolean;
        _clupi.quantization__in__set_clupi_quantization_switchon : integer;
        _clupi.status__in__set_clupi_status_diagnostic : {CLUPI_OFF, CLUPI_SDBY};
        _clupi.power__in__set_clupi_power_diagnostic : real;
        _clupi.check__in__set_clupi_mem_check_diagnostic : boolean;
        _clupi.status__in__set_clupi_status_timesync : {CLUPI_OFF, CLUPI_SDBY};
        _clupi.power__in__set_clupi_power_timesync : real;
        _clupi.sync__in__set_clupi_time_synch_timesync : boolean;
        _clupi.status__in__set_clupi_status_acquirezscience : {CLUPI_OFF, CLUPI_SDBY};
        _clupi.power__in__set_clupi_power_acquirezscience : real;
        _clupi.status__in__set_clupi_status_switchoff : {CLUPI_OFF, CLUPI_SDBY};
        _clupi.power__in__set_clupi_power_switchoff : real;
        _rtb.status__in__set_rtb_status_switchon : {RTB_ON, RTB_OFF};
        _rtb.status__in__set_rtb_status_switchoff : {RTB_ON, RTB_OFF};
        _rtb.power__in__set_rtb_power_switchon : real;
        _rtb.power__in__set_rtb_power_switchoff : real;
        _drillmamissspds.duration__in__act_drill_dbe_switchoff_start : real;
        _drillmamissspds.status__in__set_drill_status_deliver_sample : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_deliver_sample : real;
        _drillmamissspds.status__in__set_drill_status_drill_positioner_move : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drill_positioner_move : real;
        _drillmamissspds.pose__in__set_drill_positioner_pose_drill_positioner_move : {HORIZONTAL, HORIZONTAL_DISCHARGE, LOW_FOR_DRILL, SAMPLE_DISCHARGE, VERTICAL, STOWED, VERTICAL_DISCHARGE, LOW_FOR_IMAGING};
        _drillmamissspds.status__in__set_drill_status_drill_1 : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drill_1 : real;
        _drillmamissspds.power__in__set_drill_rod_q_drill_1 : real;
        _drillmamissspds.pose__in__set_drill_rod_sample_pose_drill_1 : {SAMPLE_APPROACHED, HOME};
        _drillmamissspds.status__in__set_drill_status_drill_dbe_initialize : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drill_dbe_initialize : real;
        _drillmamissspds.status__in__set_drill_status_drillandspds_ceswitchon : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drillandspds_ceswitchon : real;
        _drillmamissspds.status__in__set_drill_status_drillandspds_ceswitchoff : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drillandspds_ceswitchoff : real;
        _drillmamissspds.status__in__set_drill_status_drill_dbe_switchoff : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drill_dbe_switchoff : real;
        _drillmamissspds.status__in__set_drill_status_gotospds : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_gotospds : real;
        _drillmamissspds.status__in__set_drill_status_end_of_spds : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_end_of_spds : real;
        _drillmamissspds.status__in__set_drill_status_spds_homing : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_spds_homing : real;
        _drillmamissspds.pose__in__set_spds_cstm_pose_spds_homing : real;
        _drillmamissspds.status__in__set_drill_status_spds_preparetoreceivedrillsample : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.pose__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample : real;
        _drillmamissspds.power__in__set_drill_power_spds_preparetoreceivedrillsample : real;
        _drillmamissspds.status__in__set_drill_status_drill_initialize : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_drill_initialize : real;
        _drillmamissspds.status__in__set_drill_sensor_calib_status_drill_initialize : {ON, OFF};
        _drillmamissspds.status__in__set_drill_status_collect_sample : {SPDS_STANDBY, DRILL_SPDS_CE_STANDBY, DRILL_DBE_READY, DRILL_SPDS_OFF};
        _drillmamissspds.power__in__set_drill_power_collect_sample : real;

    IVAR
        _dhs.generatedEventPort__in__set_dhs_status_reduced2nominal : boolean;
        _dhs.generatedEventPort__in__set_dhs_status_reduced2highpwr : boolean;
        _dhs.generatedEventPort__in__set_dhs_power_reduced2nominal : boolean;
        _dhs.generatedEventPort__in__set_dhs_power_reduced2highpwr : boolean;
        _gnc.generatedEventPort__in__set_loccam_power_initialise : boolean;
        _gnc.generatedEventPort__in__set_loccam_status_initialise : boolean;
        _gnc.generatedEventPort__in__set_imu_power_initialise : boolean;
        _gnc.generatedEventPort__in__set_imu_status_initialise : boolean;
        _gnc.generatedEventPort__in__set_imu_power_gnc_updateheading : boolean;
        _gnc.generatedEventPort__in__set_imu_status_gnc_updateheading : boolean;
        _gnc.generatedEventPort__in__set_heading_updated_gnc_updateheading : boolean;
        _gnc.generatedEventPort__in__set_position_updated_gnc_updateposition : boolean;
        _gnc.generatedEventPort__in__set_bema_power_initialise : boolean;
        _gnc.generatedEventPort__in__set_bema_status_initialise : boolean;
        _ade.generatedEventPort__in__set_ade_right_status : boolean;
        _ade.generatedEventPort__in__set_ade_left_status : boolean;
        _ade.generatedEventPort__in__set_ade_left_power : boolean;
        _ade.generatedEventPort__in__set_ade_right_power : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_wakeup : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_configurereset : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_configure4science : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime : boolean;
        _rover_subsys.generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night : boolean;
        _clupi.generatedEventPort__in__set_clupi_status_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_power_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_time_synch_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_imagedatatype_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_binning_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_mem_check_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_quantization_switchon : boolean;
        _clupi.generatedEventPort__in__set_clupi_status_diagnostic : boolean;
        _clupi.generatedEventPort__in__set_clupi_power_diagnostic : boolean;
        _clupi.generatedEventPort__in__set_clupi_mem_check_diagnostic : boolean;
        _clupi.generatedEventPort__in__set_clupi_status_timesync : boolean;
        _clupi.generatedEventPort__in__set_clupi_power_timesync : boolean;
        _clupi.generatedEventPort__in__set_clupi_time_synch_timesync : boolean;
        _clupi.generatedEventPort__in__set_clupi_status_acquirezscience : boolean;
        _clupi.generatedEventPort__in__set_clupi_power_acquirezscience : boolean;
        _clupi.generatedEventPort__in__set_clupi_status_switchoff : boolean;
        _clupi.generatedEventPort__in__set_clupi_power_switchoff : boolean;
        _rtb.generatedEventPort__in__set_rtb_status_switchon : boolean;
        _rtb.generatedEventPort__in__set_rtb_status_switchoff : boolean;
        _rtb.generatedEventPort__in__set_rtb_power_switchon : boolean;
        _rtb.generatedEventPort__in__set_rtb_power_switchoff : boolean;
        _drillmamissspds.startEvent__in__act_drill_dbe_switchoff_start : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_deliver_sample : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_deliver_sample : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drill_positioner_move : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drill_positioner_move : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drill_1 : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drill_1 : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_rod_q_drill_1 : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_rod_sample_pose_drill_1 : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drill_dbe_initialize : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drill_dbe_initialize : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drillandspds_ceswitchon : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drillandspds_ceswitchon : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drill_dbe_switchoff : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drill_dbe_switchoff : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_gotospds : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_gotospds : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_end_of_spds : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_end_of_spds : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_spds_homing : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_spds_homing : boolean;
        _drillmamissspds.generatedEventPort__in__set_spds_cstm_pose_spds_homing : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample : boolean;
        _drillmamissspds.generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_drill_initialize : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_drill_initialize : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_status_collect_sample : boolean;
        _drillmamissspds.generatedEventPort__in__set_drill_power_collect_sample : boolean;

    DEFINE
        performed__in__drill_initialize_done := drillmamissspds.performed__in__drill_initialize_done;
        performed__in__imu_initialise_done := gnc.performed__in__imu_initialise_done;
        performed__in__drillandspds_ceswitchon_done := drillmamissspds.performed__in__drillandspds_ceswitchon_done;
        performed__in__drillandspds_ceswitchoff_done := drillmamissspds.performed__in__drillandspds_ceswitchoff_done;
        performed__in__rtb_switchon_done := rtb.performed__in__rtb_switchon_done;
        performed__in__rtb_switchoff_done := rtb.performed__in__rtb_switchoff_done;
        performed__in__gnc_updateposition_done := gnc.performed__in__gnc_updateposition_done;
        performed__in__drill_positioner_move_done := drillmamissspds.performed__in__drill_positioner_move_done;
        performed__in__bema_initialise_done := gnc.performed__in__bema_initialise_done;
        performed__in__rv_wakeup_done := rover_subsys.performed__in__rv_wakeup_done;
        performed__in__drill_dbe_initialize_done := drillmamissspds.performed__in__drill_dbe_initialize_done;
        performed__in__drill_dbe_switchoff_done := drillmamissspds.performed__in__drill_dbe_switchoff_done;
        performed__in__rv_configurereset_done := rover_subsys.performed__in__rv_configurereset_done;
        performed__in__rv_configure4science_done := rover_subsys.performed__in__rv_configure4science_done;
        performed__in__rv_mms_waitabstime_done := rover_subsys.performed__in__rv_mms_waitabstime_done;
        performed__in__rv_prepare4night_done := rover_subsys.performed__in__rv_prepare4night_done;
        performed__in__rv_configure4travel_done := rover_subsys.performed__in__rv_configure4travel_done;
        performed__in__dhs_reduced2highpwr_done := dhs.performed__in__dhs_reduced2highpwr_done;
        performed__in__clupi_acquirezscience_done := clupi.performed__in__clupi_acquirezscience_done;
        performed__in__dhs_reduced2nominal_done := dhs.performed__in__dhs_reduced2nominal_done;
        performed__in__drill_1_done := drillmamissspds.performed__in__drill_1_done;
        performed__in__collect_sample_done := drillmamissspds.performed__in__collect_sample_done;
        performed__in__ades_activate_done := ade.performed__in__ades_activate_done;
        performed__in__deliver_sample_done := drillmamissspds.performed__in__deliver_sample_done;
        performed__in__clupi_switchon_done := clupi.performed__in__clupi_switchon_done;
        performed__in__clupi_switchoff_done := clupi.performed__in__clupi_switchoff_done;
        performed__in__clupi_diagnostic_done := clupi.performed__in__clupi_diagnostic_done;
        performed__in__gnc_fpath_straight_done := gnc.performed__in__gnc_fpath_straight_done;
        performed__in__gnc_updateheading_done := gnc.performed__in__gnc_updateheading_done;
        performed__in__clupi_timesync_done := clupi.performed__in__clupi_timesync_done;
        performed__in__loccam_initialise_done := gnc.performed__in__loccam_initialise_done;
        performed__in__gotospds_done := drillmamissspds.performed__in__gotospds_done;
        performed__in__end_of_spds_done := drillmamissspds.performed__in__end_of_spds_done;
        performed__in__spds_homing_done := drillmamissspds.performed__in__spds_homing_done;
        performed__in__spds_preparetoreceivedrillsample_done := drillmamissspds.performed__in__spds_preparetoreceivedrillsample_done;
        rv_status := rover_subsys.rv_status;
        bema_status := gnc.bema_status;
        clupi_status := clupi.clupi_status;
        clupi_time_synch := clupi.clupi_time_synch;
        clupi_imagedatatype := clupi.clupi_imagedatatype;
        drill_sensor_calib_status := drillmamissspds.drill_sensor_calib_status;
        drill_rod_q := drillmamissspds.drill_rod_q;
        loccam_status := gnc.loccam_status;
        spds_bsd_pose := drillmamissspds.spds_bsd_pose;
        clupi_mem_check := clupi.clupi_mem_check;
        spds_cs_dejam_pose := drillmamissspds.spds_cs_dejam_pose;
        spds_cs_vsm_pose := drillmamissspds.spds_cs_vsm_pose;
        spds_cstm_pose := drillmamissspds.spds_cstm_pose;
        navcam_status := gnc.navcam_status;
        heading_updated := gnc.heading_updated;
        drill_db_q2 := drillmamissspds.drill_db_q2;
        ade_left_status := ade.ade_left_status;
        ade_right_status := ade.ade_right_status;
        clupi_binning := clupi.clupi_binning;
        drill_db_q1 := drillmamissspds.drill_db_q1;
        drill_status := drillmamissspds.drill_status;
        DRILL_ROD_SAMPLE_POSE := drillmamissspds.DRILL_ROD_SAMPLE_POSE;
        DRILL_POSITIONER_POSE := drillmamissspds.DRILL_POSITIONER_POSE;
        rtb_status := rtb.rtb_status;
        position_updated := gnc.position_updated;
        spds_cs_crush_pose := drillmamissspds.spds_cs_crush_pose;
        imu_status := gnc.imu_status;
        clupi_quantization := clupi.clupi_quantization;
        dhs_status := dhs.dhs_status;
        spds_ds_1_pose := drillmamissspds.spds_ds_1_pose;
        spds_ds_2_pose := drillmamissspds.spds_ds_2_pose;
        rtb_power := rtb.rtb_power;
        dhs_power := dhs.dhs_power;
        drill_power := drillmamissspds.drill_power;
        ade_left_power := ade.ade_left_power;
        ade_right_power := ade.ade_right_power;
        clupi_power := clupi.clupi_power;
        imu_power := gnc.imu_power;
        bema_power := gnc.bema_power;
        loccam_power := gnc.loccam_power;

    INVAR (spds_ds_1_pose >= 0 & spds_ds_1_pose <= 10);

    INVAR (spds_ds_2_pose >= 0 & spds_ds_2_pose <= 10);

    INVAR (spds_cstm_pose >= 0.0 & spds_cstm_pose <= 0.32);


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE DrillMamissSpds(startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_switchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, generatedEventPort__in__set_drill_status_deliver_sample, generatedEventPort__in__set_drill_power_deliver_sample, generatedEventPort__in__set_drill_status_drill_positioner_move, generatedEventPort__in__set_drill_power_drill_positioner_move, generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move, generatedEventPort__in__set_drill_status_drill_1, generatedEventPort__in__set_drill_power_drill_1, generatedEventPort__in__set_drill_rod_q_drill_1, generatedEventPort__in__set_drill_rod_sample_pose_drill_1, generatedEventPort__in__set_drill_status_drill_dbe_initialize, generatedEventPort__in__set_drill_power_drill_dbe_initialize, generatedEventPort__in__set_drill_status_drillandspds_ceswitchon, generatedEventPort__in__set_drill_power_drillandspds_ceswitchon, generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff, generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff, generatedEventPort__in__set_drill_status_drill_dbe_switchoff, generatedEventPort__in__set_drill_power_drill_dbe_switchoff, generatedEventPort__in__set_drill_status_gotospds, generatedEventPort__in__set_drill_power_gotospds, generatedEventPort__in__set_drill_status_end_of_spds, generatedEventPort__in__set_drill_power_end_of_spds, generatedEventPort__in__set_drill_status_spds_homing, generatedEventPort__in__set_drill_power_spds_homing, generatedEventPort__in__set_spds_cstm_pose_spds_homing, generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample, generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample, generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample, generatedEventPort__in__set_drill_status_drill_initialize, generatedEventPort__in__set_drill_power_drill_initialize, generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize, generatedEventPort__in__set_drill_status_collect_sample, generatedEventPort__in__set_drill_power_collect_sample, rtb_power, imu_power, bema_power, loccam_power, clupi_power, dhs_power, ade_left_power, ade_right_power, dhs_status, rtb_status, bema_status, sys_time_seconds, sys_energy_used, sys_rover_longitude, sys_rover_latitude, sys_simstart_utc, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_switchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, status__in__set_drill_status_deliver_sample, power__in__set_drill_power_deliver_sample, status__in__set_drill_status_drill_positioner_move, power__in__set_drill_power_drill_positioner_move, pose__in__set_drill_positioner_pose_drill_positioner_move, status__in__set_drill_status_drill_1, power__in__set_drill_power_drill_1, power__in__set_drill_rod_q_drill_1, pose__in__set_drill_rod_sample_pose_drill_1, status__in__set_drill_status_drill_dbe_initialize, power__in__set_drill_power_drill_dbe_initialize, status__in__set_drill_status_drillandspds_ceswitchon, power__in__set_drill_power_drillandspds_ceswitchon, status__in__set_drill_status_drillandspds_ceswitchoff, power__in__set_drill_power_drillandspds_ceswitchoff, status__in__set_drill_status_drill_dbe_switchoff, power__in__set_drill_power_drill_dbe_switchoff, status__in__set_drill_status_gotospds, power__in__set_drill_power_gotospds, status__in__set_drill_status_end_of_spds, power__in__set_drill_power_end_of_spds, status__in__set_drill_status_spds_homing, power__in__set_drill_power_spds_homing, pose__in__set_spds_cstm_pose_spds_homing, status__in__set_drill_status_spds_preparetoreceivedrillsample, pose__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample, power__in__set_drill_power_spds_preparetoreceivedrillsample, status__in__set_drill_status_drill_initialize, power__in__set_drill_power_drill_initialize, status__in__set_drill_sensor_calib_status_drill_initialize, status__in__set_drill_status_collect_sample, power__in__set_drill_power_collect_sample)
    VAR
        act_drillandspds_ceswitchoff : DrillandSPDS_CESwitchOff(startEvent__in__act_drillandspds_ceswitchoff_start, drill_op_set_SM.drill_status, drill_op_set_SM.drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_drillandspds_ceswitchoff_start);
        act_drill_dbe_switchoff : Drill_DBE_SwitchOff(startEvent__in__act_drill_dbe_switchoff_start, drill_op_set_SM.drill_status, rtb_status, dhs_status, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_drill_dbe_switchoff_start);
        act_drill_dbe_initialize : Drill_DBE_Initialize(startEvent__in__act_drill_dbe_initialize_start, drill_op_set_SM.drill_status, drill_op_set_SM.drill_power, rtb_status, bema_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_drill_dbe_initialize_start);
        act_collect_sample : Collect_Sample(startEvent__in__act_collect_sample_start, drill_op_set_SM.drill_status, drill_op_set_SM.DRILL_ROD_SAMPLE_POSE, drill_op_set_SM.drill_rod_q, drill_op_set_SM.drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_collect_sample_start);
        act_gotospds : GoToSPDS(startEvent__in__act_gotospds_start, drill_op_set_SM.drill_status, rtb_status, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_gotospds_start);
        act_drill_initialize : Drill_Initialize(startEvent__in__act_drill_initialize_start, drill_op_set_SM.drill_status, drill_op_set_SM.drill_sensor_calib_status, drill_op_set_SM.drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_drill_initialize_start);
        act_spds_homing : SPDS_Homing(startEvent__in__act_spds_homing_start, drill_op_set_SM.drill_status, drill_op_set_SM.spds_cstm_pose, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_spds_homing_start);
        act_spds_preparetoreceivedrillsample : SPDS_PrepareToReceiveDrillSample(startEvent__in__act_spds_preparetoreceivedrillsample_start, drill_op_set_SM.drill_status, DRILL_POSITIONER_POSE, drill_op_set_SM.spds_cstm_pose, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_spds_preparetoreceivedrillsample_start);
        act_drill_positioner_move : Drill_Positioner_Move(startEvent__in__act_drill_positioner_move_start, drill_op_set_SM.drill_db_q2, drill_op_set_SM.drill_status, drill_op_set_SM.DRILL_POSITIONER_POSE, drill_op_set_SM.drill_db_q1, drill_op_set_SM.drill_power, rtb_status, dhs_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_drill_positioner_move_start);
        act_drill_1 : Drill_1(startEvent__in__act_drill_1_start, drill_op_set_SM.drill_rod_q, drill_op_set_SM.drill_status, drill_op_set_SM.DRILL_POSITIONER_POSE, drill_op_set_SM.drill_sensor_calib_status, drill_op_set_SM.DRILL_ROD_SAMPLE_POSE, drill_op_set_SM.drill_power, rtb_status, dhs_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, sys_simstart_utc, sys_rover_longitude, sys_rover_latitude, duration__in__act_drill_1_start, _act_drill_1.drill_1_duration, _act_drill_1.drill_1_power);
        act_drillandspds_ceswitchon : DrillandSPDS_CESwitchOn(startEvent__in__act_drillandspds_ceswitchon_start, drill_op_set_SM.drill_status, drill_op_set_SM.drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_drillandspds_ceswitchon_start);
        act_deliver_sample : Deliver_Sample(startEvent__in__act_deliver_sample_start, drill_op_set_SM.DRILL_POSITIONER_POSE, drill_op_set_SM.spds_cstm_pose, drill_op_set_SM.drill_status, drill_op_set_SM.drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_deliver_sample_start);
        drill_op_set_SM : DrillMamissSpds_SM(startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_switchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, next(act_deliver_sample.generatedEventPort__in__set_drill_status) != act_deliver_sample.generatedEventPort__in__set_drill_status, next(act_deliver_sample.generatedEventPort__in__set_drill_power) != act_deliver_sample.generatedEventPort__in__set_drill_power, next(act_drill_positioner_move.generatedEventPort__in__set_drill_status) != act_drill_positioner_move.generatedEventPort__in__set_drill_status, next(act_drill_positioner_move.generatedEventPort__in__set_drill_power) != act_drill_positioner_move.generatedEventPort__in__set_drill_power, next(act_drill_positioner_move.generatedEventPort__in__set_DRILL_POSITIONER_POSE) != act_drill_positioner_move.generatedEventPort__in__set_DRILL_POSITIONER_POSE, next(act_drill_1.generatedEventPort__in__set_drill_status) != act_drill_1.generatedEventPort__in__set_drill_status, next(act_drill_1.generatedEventPort__in__set_drill_power) != act_drill_1.generatedEventPort__in__set_drill_power, next(act_drill_1.generatedEventPort__in__set_drill_rod_q) != act_drill_1.generatedEventPort__in__set_drill_rod_q, next(act_drill_1.generatedEventPort__in__set_DRILL_ROD_SAMPLE_POSE) != act_drill_1.generatedEventPort__in__set_DRILL_ROD_SAMPLE_POSE, next(act_drill_dbe_initialize.generatedEventPort__in__set_drill_status) != act_drill_dbe_initialize.generatedEventPort__in__set_drill_status, next(act_drill_dbe_initialize.generatedEventPort__in__set_drill_power) != act_drill_dbe_initialize.generatedEventPort__in__set_drill_power, next(act_drillandspds_ceswitchon.generatedEventPort__in__set_drill_status) != act_drillandspds_ceswitchon.generatedEventPort__in__set_drill_status, next(act_drillandspds_ceswitchon.generatedEventPort__in__set_drill_power) != act_drillandspds_ceswitchon.generatedEventPort__in__set_drill_power, next(act_drillandspds_ceswitchoff.generatedEventPort__in__set_drill_status) != act_drillandspds_ceswitchoff.generatedEventPort__in__set_drill_status, next(act_drillandspds_ceswitchoff.generatedEventPort__in__set_drill_power) != act_drillandspds_ceswitchoff.generatedEventPort__in__set_drill_power, next(act_drill_dbe_switchoff.generatedEventPort__in__set_drill_status) != act_drill_dbe_switchoff.generatedEventPort__in__set_drill_status, next(act_drill_dbe_switchoff.generatedEventPort__in__set_drill_power) != act_drill_dbe_switchoff.generatedEventPort__in__set_drill_power, next(act_gotospds.generatedEventPort__in__set_drill_status) != act_gotospds.generatedEventPort__in__set_drill_status, next(act_gotospds.generatedEventPort__in__set_drill_power) != act_gotospds.generatedEventPort__in__set_drill_power, next(act_end_of_spds.generatedEventPort__in__set_drill_status) != act_end_of_spds.generatedEventPort__in__set_drill_status, next(act_end_of_spds.generatedEventPort__in__set_drill_power) != act_end_of_spds.generatedEventPort__in__set_drill_power, next(act_spds_homing.generatedEventPort__in__set_drill_status) != act_spds_homing.generatedEventPort__in__set_drill_status, next(act_spds_homing.generatedEventPort__in__set_drill_power) != act_spds_homing.generatedEventPort__in__set_drill_power, next(act_spds_homing.generatedEventPort__in__set_spds_cstm_pose) != act_spds_homing.generatedEventPort__in__set_spds_cstm_pose, next(act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_drill_status) != act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_drill_status, next(act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_spds_cstm_pose) != act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_spds_cstm_pose, next(act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_drill_power) != act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_drill_power, next(act_drill_initialize.generatedEventPort__in__set_drill_status) != act_drill_initialize.generatedEventPort__in__set_drill_status, next(act_drill_initialize.generatedEventPort__in__set_drill_power) != act_drill_initialize.generatedEventPort__in__set_drill_power, next(act_drill_initialize.generatedEventPort__in__set_drill_sensor_calib_status) != act_drill_initialize.generatedEventPort__in__set_drill_sensor_calib_status, next(act_collect_sample.generatedEventPort__in__set_drill_status) != act_collect_sample.generatedEventPort__in__set_drill_status, next(act_collect_sample.generatedEventPort__in__set_drill_power) != act_collect_sample.generatedEventPort__in__set_drill_power, next(act_drill_1.performed__in__activityPerformedPort) != act_drill_1.performed__in__activityPerformedPort, next(act_deliver_sample.performed__in__activityPerformedPort) != act_deliver_sample.performed__in__activityPerformedPort, next(act_drillandspds_ceswitchon.performed__in__activityPerformedPort) != act_drillandspds_ceswitchon.performed__in__activityPerformedPort, next(act_drillandspds_ceswitchoff.performed__in__activityPerformedPort) != act_drillandspds_ceswitchoff.performed__in__activityPerformedPort, next(act_drill_dbe_switchoff.performed__in__activityPerformedPort) != act_drill_dbe_switchoff.performed__in__activityPerformedPort, next(act_gotospds.performed__in__activityPerformedPort) != act_gotospds.performed__in__activityPerformedPort, next(act_end_of_spds.performed__in__activityPerformedPort) != act_end_of_spds.performed__in__activityPerformedPort, next(act_collect_sample.performed__in__activityPerformedPort) != act_collect_sample.performed__in__activityPerformedPort, next(act_drill_dbe_initialize.performed__in__activityPerformedPort) != act_drill_dbe_initialize.performed__in__activityPerformedPort, next(act_drill_positioner_move.performed__in__activityPerformedPort) != act_drill_positioner_move.performed__in__activityPerformedPort, next(act_drill_initialize.performed__in__activityPerformedPort) != act_drill_initialize.performed__in__activityPerformedPort, rtb_power, imu_power, bema_power, loccam_power, clupi_power, dhs_power, ade_left_power, ade_right_power, dhs_status, rtb_status, bema_status, sys_time_seconds, sys_energy_used, sys_rover_longitude, sys_rover_latitude, sys_simstart_utc, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_switchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, act_deliver_sample.status__in__set_drill_status, act_deliver_sample.power__in__set_drill_power, act_drill_positioner_move.status__in__set_drill_status, act_drill_positioner_move.power__in__set_drill_power, act_drill_positioner_move.pose__in__set_DRILL_POSITIONER_POSE, act_drill_1.status__in__set_drill_status, act_drill_1.power__in__set_drill_power, act_drill_1.q__in__set_drill_rod_q, act_drill_1.pose__in__set_DRILL_ROD_SAMPLE_POSE, act_drill_dbe_initialize.status__in__set_drill_status, act_drill_dbe_initialize.power__in__set_drill_power, act_drillandspds_ceswitchon.status__in__set_drill_status, act_drillandspds_ceswitchon.power__in__set_drill_power, act_drillandspds_ceswitchoff.status__in__set_drill_status, act_drillandspds_ceswitchoff.power__in__set_drill_power, act_drill_dbe_switchoff.status__in__set_drill_status, act_drill_dbe_switchoff.power__in__set_drill_power, act_gotospds.status__in__set_drill_status, act_gotospds.power__in__set_drill_power, act_end_of_spds.status__in__set_drill_status, act_end_of_spds.power__in__set_drill_power, act_spds_homing.status__in__set_drill_status, act_spds_homing.power__in__set_drill_power, act_spds_homing.pose__in__set_spds_cstm_pose, act_spds_preparetoreceivedrillsample.status__in__set_drill_status, act_spds_preparetoreceivedrillsample.pose__in__set_spds_cstm_pose, act_spds_preparetoreceivedrillsample.power__in__set_drill_power, act_drill_initialize.status__in__set_drill_status, act_drill_initialize.power__in__set_drill_power, act_drill_initialize.status__in__set_drill_sensor_calib_status, act_collect_sample.status__in__set_drill_status, act_collect_sample.power__in__set_drill_power);
        act_end_of_spds : End_Of_SPDS(startEvent__in__act_end_of_spds_start, drill_op_set_SM.drill_status, rtb_status, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_end_of_spds_start);
    DEFINE
        generatedEventPort__in__set_sys_energy_used_collect_sample := act_collect_sample.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_collect_sample := act_collect_sample.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drill_initialize := act_drill_initialize.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drill_initialize := act_drill_initialize.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample := act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample := act_spds_preparetoreceivedrillsample.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_spds_homing := act_spds_homing.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_spds_homing := act_spds_homing.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_end_of_spds := act_end_of_spds.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_end_of_spds := act_end_of_spds.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_gotospds := act_gotospds.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_gotospds := act_gotospds.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff := act_drill_dbe_switchoff.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff := act_drill_dbe_switchoff.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchoff := act_drillandspds_ceswitchoff.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchoff := act_drillandspds_ceswitchoff.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon := act_drillandspds_ceswitchon.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon := act_drillandspds_ceswitchon.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize := act_drill_dbe_initialize.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize := act_drill_dbe_initialize.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drill_1 := act_drill_1.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drill_1 := act_drill_1.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_drill_positioner_move := act_drill_positioner_move.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_drill_positioner_move := act_drill_positioner_move.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_deliver_sample := act_deliver_sample.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_deliver_sample := act_deliver_sample.generatedEventPort__in__set_sys_time_seconds;
        performed__in__spds_preparetoreceivedrillsample_done := act_spds_preparetoreceivedrillsample.performed__in__activityPerformedPort;
        performed__in__spds_homing_done := act_spds_homing.performed__in__activityPerformedPort;
        performed__in__end_of_spds_done := act_end_of_spds.performed__in__activityPerformedPort;
        performed__in__gotospds_done := act_gotospds.performed__in__activityPerformedPort;
        performed__in__deliver_sample_done := act_deliver_sample.performed__in__activityPerformedPort;
        performed__in__drill_positioner_move_done := act_drill_positioner_move.performed__in__activityPerformedPort;
        performed__in__drill_initialize_done := act_drill_initialize.performed__in__activityPerformedPort;
        performed__in__collect_sample_done := act_collect_sample.performed__in__activityPerformedPort;
        performed__in__drill_1_done := act_drill_1.performed__in__activityPerformedPort;
        performed__in__drill_dbe_switchoff_done := act_drill_dbe_switchoff.performed__in__activityPerformedPort;
        performed__in__drillandspds_ceswitchoff_done := act_drillandspds_ceswitchoff.performed__in__activityPerformedPort;
        performed__in__drillandspds_ceswitchon_done := act_drillandspds_ceswitchon.performed__in__activityPerformedPort;
        performed__in__drill_dbe_initialize_done := act_drill_dbe_initialize.performed__in__activityPerformedPort;
        status__in__set_sys_energy_used_collect_sample := act_collect_sample.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_collect_sample := act_collect_sample.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drill_initialize := act_drill_initialize.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drill_initialize := act_drill_initialize.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_spds_preparetoreceivedrillsample := act_spds_preparetoreceivedrillsample.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample := act_spds_preparetoreceivedrillsample.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_spds_homing := act_spds_homing.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_spds_homing := act_spds_homing.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_end_of_spds := act_end_of_spds.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_end_of_spds := act_end_of_spds.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_gotospds := act_gotospds.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_gotospds := act_gotospds.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drill_dbe_switchoff := act_drill_dbe_switchoff.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drill_dbe_switchoff := act_drill_dbe_switchoff.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drillandspds_ceswitchoff := act_drillandspds_ceswitchoff.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drillandspds_ceswitchoff := act_drillandspds_ceswitchoff.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drillandspds_ceswitchon := act_drillandspds_ceswitchon.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drillandspds_ceswitchon := act_drillandspds_ceswitchon.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drill_dbe_initialize := act_drill_dbe_initialize.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drill_dbe_initialize := act_drill_dbe_initialize.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drill_1 := act_drill_1.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drill_1 := act_drill_1.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_drill_positioner_move := act_drill_positioner_move.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_drill_positioner_move := act_drill_positioner_move.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_deliver_sample := act_deliver_sample.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_deliver_sample := act_deliver_sample.status__in__set_sys_time_seconds;
        drill_power := drill_op_set_SM.drill_power;
        spds_ds_2_pose := drill_op_set_SM.spds_ds_2_pose;
        spds_cstm_pose := drill_op_set_SM.spds_cstm_pose;
        spds_ds_1_pose := drill_op_set_SM.spds_ds_1_pose;
        drill_rod_q := drill_op_set_SM.drill_rod_q;
        drill_db_q1 := drill_op_set_SM.drill_db_q1;
        spds_cs_dejam_pose := drill_op_set_SM.spds_cs_dejam_pose;
        spds_cs_crush_pose := drill_op_set_SM.spds_cs_crush_pose;
        DRILL_POSITIONER_POSE := drill_op_set_SM.DRILL_POSITIONER_POSE;
        drill_db_q2 := drill_op_set_SM.drill_db_q2;
        DRILL_ROD_SAMPLE_POSE := drill_op_set_SM.DRILL_ROD_SAMPLE_POSE;
        drill_sensor_calib_status := drill_op_set_SM.drill_sensor_calib_status;
        spds_cs_vsm_pose := drill_op_set_SM.spds_cs_vsm_pose;
        drill_status := drill_op_set_SM.drill_status;
        spds_bsd_pose := drill_op_set_SM.spds_bsd_pose;

    FUN
        _act_drill_1.drill_1_duration : real * real * real * real * integer * real * real * real -> real;
        _act_drill_1.drill_1_power : real * real * real * real * integer * real * real * real -> real;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE DrillandSPDS_CESwitchOff(startEvent__in__startActivityPort, drill_status, drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_DrillandSPDS_CESwitchOff_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (drill_status = DRILL_SPDS_CE_STANDBY & rtb_status = RTB_ON);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_DrillandSPDS_CESwitchOff_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_DrillandSPDS_CESwitchOff_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_SPDS_OFF;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 0.0;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_DrillandSPDS_CESwitchOff_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Drill_DBE_SwitchOff(startEvent__in__startActivityPort, drill_status, rtb_status, dhs_status, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Drill_DBE_SwitchOff_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((drill_status = DRILL_DBE_READY & rtb_status = RTB_ON) & dhs_status = DHS_REDUCED);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Drill_DBE_SwitchOff_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Drill_DBE_SwitchOff_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_SPDS_CE_STANDBY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 11.82;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Drill_DBE_SwitchOff_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Drill_DBE_Initialize(startEvent__in__startActivityPort, drill_status, drill_power, rtb_status, bema_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Drill_DBE_Initialize_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((drill_status = DRILL_SPDS_CE_STANDBY & rtb_status = RTB_ON) & bema_status = BEMA_OFF);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Drill_DBE_Initialize_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Drill_DBE_Initialize_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 1);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_DBE_READY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 24.17;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Drill_DBE_Initialize_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Collect_Sample(startEvent__in__startActivityPort, drill_status, DRILL_ROD_SAMPLE_POSE, drill_rod_q, drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Collect_Sample_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((drill_status = DRILL_DBE_READY & DRILL_ROD_SAMPLE_POSE = SAMPLE_APPROACHED) & rtb_status = RTB_ON);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Collect_Sample_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Collect_Sample_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 1);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_DBE_READY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 24.17;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Collect_Sample_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE GoToSPDS(startEvent__in__startActivityPort, drill_status, rtb_status, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_GoToSPDS_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (drill_status = DRILL_SPDS_CE_STANDBY & rtb_status = RTB_ON);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_GoToSPDS_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_GoToSPDS_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) - 3.82);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : SPDS_STANDBY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 8.0;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_GoToSPDS_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Drill_Initialize(startEvent__in__startActivityPort, drill_status, drill_sensor_calib_status, drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        status__in__set_drill_sensor_calib_status : {OFF, ON};
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        generatedEventPort__in__set_drill_sensor_calib_status : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Drill_Initialize_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (drill_status = DRILL_DBE_READY & rtb_status = RTB_ON);
        getUpperBoundDuration := 30;
        getLowerBoundDuration := 30;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Drill_Initialize_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Drill_Initialize_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 30;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (30 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 684.9);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_DBE_READY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 24.17;
TRUE : power__in__set_drill_power;
esac;

        next(status__in__set_drill_sensor_calib_status) := case
Transition = _Progress_to_Idle_ : ON;
TRUE : status__in__set_drill_sensor_calib_status;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_drill_sensor_calib_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_sensor_calib_status;
TRUE : generatedEventPort__in__set_drill_sensor_calib_status;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Drill_Initialize_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE SPDS_Homing(startEvent__in__startActivityPort, drill_status, spds_cstm_pose, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        pose__in__set_spds_cstm_pose : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        generatedEventPort__in__set_spds_cstm_pose : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_SPDS_Homing_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := drill_status = SPDS_STANDBY;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_SPDS_Homing_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_SPDS_Homing_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : SPDS_STANDBY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 8.0;
TRUE : power__in__set_drill_power;
esac;

        next(pose__in__set_spds_cstm_pose) := case
Transition = _Progress_to_Idle_ : 0.005;
TRUE : pose__in__set_spds_cstm_pose;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_spds_cstm_pose) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_spds_cstm_pose;
TRUE : generatedEventPort__in__set_spds_cstm_pose;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_SPDS_Homing_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (spds_cstm_pose >= 0.0 & spds_cstm_pose <= 0.32);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE SPDS_PrepareToReceiveDrillSample(startEvent__in__startActivityPort, drill_status, DRILL_POSITIONER_POSE, spds_cstm_pose, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        pose__in__set_spds_cstm_pose : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        generatedEventPort__in__set_spds_cstm_pose : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_SPDS_PrepareToReceiveDrillSample_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((drill_status = SPDS_STANDBY & spds_cstm_pose = 0.005) & DRILL_POSITIONER_POSE = SAMPLE_DISCHARGE);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_SPDS_PrepareToReceiveDrillSample_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_SPDS_PrepareToReceiveDrillSample_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : SPDS_STANDBY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 8.0;
TRUE : power__in__set_drill_power;
esac;

        next(pose__in__set_spds_cstm_pose) := case
Transition = _Progress_to_Idle_ : 0.2976;
TRUE : pose__in__set_spds_cstm_pose;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_spds_cstm_pose) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_spds_cstm_pose;
TRUE : generatedEventPort__in__set_spds_cstm_pose;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_SPDS_PrepareToReceiveDrillSample_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (spds_cstm_pose >= 0.0 & spds_cstm_pose <= 0.32);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Drill_Positioner_Move(startEvent__in__startActivityPort, drill_db_q2, drill_status, DRILL_POSITIONER_POSE, drill_db_q1, drill_power, rtb_status, dhs_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        pose_id : {LOW_FOR_IMAGING, VERTICAL_DISCHARGE, STOWED, VERTICAL, SAMPLE_DISCHARGE, LOW_FOR_DRILL, HORIZONTAL_DISCHARGE, HORIZONTAL};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        pose__in__set_DRILL_POSITIONER_POSE : {LOW_FOR_IMAGING, VERTICAL_DISCHARGE, STOWED, VERTICAL, SAMPLE_DISCHARGE, LOW_FOR_DRILL, HORIZONTAL_DISCHARGE, HORIZONTAL};
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        generatedEventPort__in__set_DRILL_POSITIONER_POSE : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Drill_Positioner_Move_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((drill_status = DRILL_DBE_READY & rtb_status = RTB_ON) & dhs_status = DHS_REDUCED);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Drill_Positioner_Move_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Drill_Positioner_Move_to_Idle_ : getUpperBoundDuration;
esac;
        next(pose_id) := case
TRUE : pose_id;
esac;

        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 1);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_DBE_READY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 24.17;
TRUE : power__in__set_drill_power;
esac;

        next(pose__in__set_DRILL_POSITIONER_POSE) := case
Transition = _Progress_to_Idle_ : pose_id;
TRUE : pose__in__set_DRILL_POSITIONER_POSE;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_DRILL_POSITIONER_POSE) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_DRILL_POSITIONER_POSE;
TRUE : generatedEventPort__in__set_DRILL_POSITIONER_POSE;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Drill_Positioner_Move_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Drill_1(startEvent__in__startActivityPort, drill_rod_q, drill_status, DRILL_POSITIONER_POSE, drill_sensor_calib_status, DRILL_ROD_SAMPLE_POSE, drill_power, rtb_status, dhs_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, sys_simstart_utc, sys_rover_longitude, sys_rover_latitude, duration__in__startActivityPort, drill_1_duration, drill_1_power)
    VAR
        State : {Idle, Progress, t};
        final_pos : real;
        thrust : real;
        rot_speed : real;
        soil_type : integer;
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        q__in__set_drill_rod_q : real;
        pose__in__set_DRILL_ROD_SAMPLE_POSE : {HOME, SAMPLE_APPROACHED};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_rod_q : boolean;
        generatedEventPort__in__set_DRILL_ROD_SAMPLE_POSE : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Drill_1_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (((drill_status = DRILL_DBE_READY & (drill_sensor_calib_status = ON & DRILL_POSITIONER_POSE = LOW_FOR_DRILL)) & rtb_status = RTB_ON) & dhs_status = DHS_REDUCED);
        getUpperBoundDuration := drill_1_duration(drill_rod_q, final_pos, thrust, rot_speed, soil_type, sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude);
        getLowerBoundDuration := drill_1_duration(drill_rod_q, final_pos, thrust, rot_speed, soil_type, sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude);

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Drill_1_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Drill_1_to_Idle_ : getUpperBoundDuration;
esac;
        next(final_pos) := case
TRUE : final_pos;
esac;

        next(thrust) := case
TRUE : thrust;
esac;

        next(rot_speed) := case
TRUE : rot_speed;
esac;

        next(soil_type) := case
TRUE : soil_type;
esac;

        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + drill_1_duration(drill_rod_q, final_pos, thrust, rot_speed, soil_type, sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude);
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : (sys_energy_used + drill_1_duration(drill_rod_q, final_pos, thrust, rot_speed, soil_type, sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude) * (((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + rtb_power) + imu_power) + bema_power) + loccam_power)) + drill_1_power(drill_rod_q, final_pos, thrust, rot_speed, soil_type, sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude) * 3600;
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_DBE_READY;
TRUE : status__in__set_drill_status;
esac;

        next(q__in__set_drill_rod_q) := case
Transition = _Progress_to_Idle_ : final_pos;
TRUE : q__in__set_drill_rod_q;
esac;

        next(pose__in__set_DRILL_ROD_SAMPLE_POSE) := case
Transition = _Progress_to_Idle_ :  (final_pos = -0.127 ? HOME : SAMPLE_APPROACHED) ;
TRUE : pose__in__set_DRILL_ROD_SAMPLE_POSE;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 24.17;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_rod_q) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_rod_q;
TRUE : generatedEventPort__in__set_drill_rod_q;
esac;

        next(generatedEventPort__in__set_DRILL_ROD_SAMPLE_POSE) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_DRILL_ROD_SAMPLE_POSE;
TRUE : generatedEventPort__in__set_DRILL_ROD_SAMPLE_POSE;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Drill_1_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE DrillandSPDS_CESwitchOn(startEvent__in__startActivityPort, drill_status, drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_DrillandSPDS_CESwitchOn_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (drill_status = DRILL_SPDS_OFF & rtb_status = RTB_ON);
        getUpperBoundDuration := 60;
        getLowerBoundDuration := 60;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_DrillandSPDS_CESwitchOn_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_DrillandSPDS_CESwitchOn_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 60;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (60 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 960);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_SPDS_CE_STANDBY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 11.82;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_DrillandSPDS_CESwitchOn_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Deliver_Sample(startEvent__in__startActivityPort, DRILL_POSITIONER_POSE, spds_cstm_pose, drill_status, drill_power, rtb_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_Deliver_Sample_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((DRILL_POSITIONER_POSE = SAMPLE_DISCHARGE & (spds_cstm_pose = 0.2976 & drill_status = DRILL_DBE_READY)) & rtb_status = RTB_ON);
        getUpperBoundDuration := 542;
        getLowerBoundDuration := 542;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_Deliver_Sample_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_Deliver_Sample_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 542;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (542 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 12604.64);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_DBE_READY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 24.17;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_Deliver_Sample_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (spds_cstm_pose >= 0.0 & spds_cstm_pose <= 0.32);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE DrillMamissSpds_SM(startEvent__in__act_drill_1_start, startEvent__in__act_drill_positioner_move_start, startEvent__in__act_drill_initialize_start, startEvent__in__act_collect_sample_start, startEvent__in__act_deliver_sample_start, startEvent__in__act_drillandspds_ceswitchon_start, startEvent__in__act_drillandspds_ceswitchoff_start, startEvent__in__act_drill_dbe_switchoff_start, startEvent__in__act_drill_dbe_initialize_start, startEvent__in__act_gotospds_start, startEvent__in__act_end_of_spds_start, startEvent__in__act_spds_homing_start, startEvent__in__act_spds_preparetoreceivedrillsample_start, generatedEventPort__in__set_drill_status_deliver_sample, generatedEventPort__in__set_drill_power_deliver_sample, generatedEventPort__in__set_drill_status_drill_positioner_move, generatedEventPort__in__set_drill_power_drill_positioner_move, generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move, generatedEventPort__in__set_drill_status_drill_1, generatedEventPort__in__set_drill_power_drill_1, generatedEventPort__in__set_drill_rod_q_drill_1, generatedEventPort__in__set_drill_rod_sample_pose_drill_1, generatedEventPort__in__set_drill_status_drill_dbe_initialize, generatedEventPort__in__set_drill_power_drill_dbe_initialize, generatedEventPort__in__set_drill_status_drillandspds_ceswitchon, generatedEventPort__in__set_drill_power_drillandspds_ceswitchon, generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff, generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff, generatedEventPort__in__set_drill_status_drill_dbe_switchoff, generatedEventPort__in__set_drill_power_drill_dbe_switchoff, generatedEventPort__in__set_drill_status_gotospds, generatedEventPort__in__set_drill_power_gotospds, generatedEventPort__in__set_drill_status_end_of_spds, generatedEventPort__in__set_drill_power_end_of_spds, generatedEventPort__in__set_drill_status_spds_homing, generatedEventPort__in__set_drill_power_spds_homing, generatedEventPort__in__set_spds_cstm_pose_spds_homing, generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample, generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample, generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample, generatedEventPort__in__set_drill_status_drill_initialize, generatedEventPort__in__set_drill_power_drill_initialize, generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize, generatedEventPort__in__set_drill_status_collect_sample, generatedEventPort__in__set_drill_power_collect_sample, performed__in__act_drill_1_done_input, performed__in__act_deliver_sample_done_input, performed__in__act_drillandspds_ceswitchon_done_input, performed__in__act_drillandspds_ceswitchoff_done_input, performed__in__act_drill_dbe_switchoff_done_input, performed__in__act_gotospds_done_input, performed__in__act_end_of_spds_done_input, performed__in__act_collect_sample_done_input, performed__in__act_drill_dbe_initialize_done_input, performed__in__act_drill_positioner_move_done_input, performed__in__act_drill_initialize_done_input, rtb_power, imu_power, bema_power, loccam_power, clupi_power, dhs_power, ade_left_power, ade_right_power, dhs_status, rtb_status, bema_status, sys_time_seconds, sys_energy_used, sys_rover_longitude, sys_rover_latitude, sys_simstart_utc, duration__in__act_drill_1_start, duration__in__act_drill_positioner_move_start, duration__in__act_drill_initialize_start, duration__in__act_collect_sample_start, duration__in__act_deliver_sample_start, duration__in__act_drillandspds_ceswitchon_start, duration__in__act_drillandspds_ceswitchoff_start, duration__in__act_drill_dbe_switchoff_start, duration__in__act_drill_dbe_initialize_start, duration__in__act_gotospds_start, duration__in__act_end_of_spds_start, duration__in__act_spds_homing_start, duration__in__act_spds_preparetoreceivedrillsample_start, status__in__set_drill_status_deliver_sample, power__in__set_drill_power_deliver_sample, status__in__set_drill_status_drill_positioner_move, power__in__set_drill_power_drill_positioner_move, pose__in__set_drill_positioner_pose_drill_positioner_move, status__in__set_drill_status_drill_1, power__in__set_drill_power_drill_1, power__in__set_drill_rod_q_drill_1, pose__in__set_drill_rod_sample_pose_drill_1, status__in__set_drill_status_drill_dbe_initialize, power__in__set_drill_power_drill_dbe_initialize, status__in__set_drill_status_drillandspds_ceswitchon, power__in__set_drill_power_drillandspds_ceswitchon, status__in__set_drill_status_drillandspds_ceswitchoff, power__in__set_drill_power_drillandspds_ceswitchoff, status__in__set_drill_status_drill_dbe_switchoff, power__in__set_drill_power_drill_dbe_switchoff, status__in__set_drill_status_gotospds, power__in__set_drill_power_gotospds, status__in__set_drill_status_end_of_spds, power__in__set_drill_power_end_of_spds, status__in__set_drill_status_spds_homing, power__in__set_drill_power_spds_homing, pose__in__set_spds_cstm_pose_spds_homing, status__in__set_drill_status_spds_preparetoreceivedrillsample, pose__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample, power__in__set_drill_power_spds_preparetoreceivedrillsample, status__in__set_drill_status_drill_initialize, power__in__set_drill_power_drill_initialize, status__in__set_drill_sensor_calib_status_drill_initialize, status__in__set_drill_status_collect_sample, power__in__set_drill_power_collect_sample)
    VAR
        State : {drill_dbe_ready, drill_spds_off, drill_spds_ce_standby, spds_standby, t};
        c : clock;
        spds_bsd_pose : real;
        drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        spds_cs_vsm_pose : real;
        drill_sensor_calib_status : {OFF, ON};
        DRILL_ROD_SAMPLE_POSE : {HOME, SAMPLE_APPROACHED};
        drill_db_q2 : real;
        DRILL_POSITIONER_POSE : {LOW_FOR_IMAGING, VERTICAL_DISCHARGE, STOWED, VERTICAL, SAMPLE_DISCHARGE, LOW_FOR_DRILL, HORIZONTAL_DISCHARGE, HORIZONTAL};
        spds_cs_crush_pose : real;
        spds_cs_dejam_pose : real;
        drill_db_q1 : real;
        drill_rod_q : real;
        spds_ds_1_pose : integer;
        spds_cstm_pose : real;
        spds_ds_2_pose : integer;
        drill_power : real;
        status__in__set_sys_time_seconds_deliver_sample : real;
        status__in__set_sys_energy_used_deliver_sample : real;
        status__in__set_sys_time_seconds_drill_positioner_move : real;
        status__in__set_sys_energy_used_drill_positioner_move : real;
        status__in__set_sys_time_seconds_drill_1 : real;
        status__in__set_sys_energy_used_drill_1 : real;
        status__in__set_sys_time_seconds_drill_dbe_initialize : real;
        status__in__set_sys_energy_used_drill_dbe_initialize : real;
        status__in__set_sys_time_seconds_drillandspds_ceswitchon : real;
        status__in__set_sys_energy_used_drillandspds_ceswitchon : real;
        status__in__set_sys_time_seconds_drillandspds_ceswitchoff : real;
        status__in__set_sys_energy_used_drillandspds_ceswitchoff : real;
        status__in__set_sys_time_seconds_drill_dbe_switchoff : real;
        status__in__set_sys_energy_used_drill_dbe_switchoff : real;
        status__in__set_sys_time_seconds_gotospds : real;
        status__in__set_sys_energy_used_gotospds : real;
        status__in__set_sys_time_seconds_end_of_spds : real;
        status__in__set_sys_energy_used_end_of_spds : real;
        status__in__set_sys_time_seconds_spds_homing : real;
        status__in__set_sys_energy_used_spds_homing : real;
        status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample : real;
        status__in__set_sys_energy_used_spds_preparetoreceivedrillsample : real;
        status__in__set_sys_time_seconds_drill_initialize : real;
        status__in__set_sys_energy_used_drill_initialize : real;
        status__in__set_sys_time_seconds_collect_sample : real;
        status__in__set_sys_energy_used_collect_sample : real;
        performed__in__drill_dbe_initialize_done : boolean;
        performed__in__drillandspds_ceswitchon_done : boolean;
        performed__in__drillandspds_ceswitchoff_done : boolean;
        performed__in__drill_dbe_switchoff_done : boolean;
        performed__in__drill_1_done : boolean;
        performed__in__collect_sample_done : boolean;
        performed__in__drill_initialize_done : boolean;
        performed__in__drill_positioner_move_done : boolean;
        performed__in__deliver_sample_done : boolean;
        performed__in__gotospds_done : boolean;
        performed__in__end_of_spds_done : boolean;
        performed__in__spds_homing_done : boolean;
        performed__in__spds_preparetoreceivedrillsample_done : boolean;
        generatedEventPort__in__set_sys_time_seconds_deliver_sample : boolean;
        generatedEventPort__in__set_sys_energy_used_deliver_sample : boolean;
        generatedEventPort__in__set_sys_time_seconds_drill_positioner_move : boolean;
        generatedEventPort__in__set_sys_energy_used_drill_positioner_move : boolean;
        generatedEventPort__in__set_sys_time_seconds_drill_1 : boolean;
        generatedEventPort__in__set_sys_energy_used_drill_1 : boolean;
        generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize : boolean;
        generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize : boolean;
        generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon : boolean;
        generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon : boolean;
        generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchoff : boolean;
        generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchoff : boolean;
        generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff : boolean;
        generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff : boolean;
        generatedEventPort__in__set_sys_time_seconds_gotospds : boolean;
        generatedEventPort__in__set_sys_energy_used_gotospds : boolean;
        generatedEventPort__in__set_sys_time_seconds_end_of_spds : boolean;
        generatedEventPort__in__set_sys_energy_used_end_of_spds : boolean;
        generatedEventPort__in__set_sys_time_seconds_spds_homing : boolean;
        generatedEventPort__in__set_sys_energy_used_spds_homing : boolean;
        generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample : boolean;
        generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample : boolean;
        generatedEventPort__in__set_sys_time_seconds_drill_initialize : boolean;
        generatedEventPort__in__set_sys_energy_used_drill_initialize : boolean;
        generatedEventPort__in__set_sys_time_seconds_collect_sample : boolean;
        generatedEventPort__in__set_sys_energy_used_collect_sample : boolean;

    IVAR
        Transition : {drill_1_durative, deliver_sample_durative, spds_ce_standby_durative, drillandspds_ceswitchoff_durative, drill_dbe_switchoff_durative, gotospds_durative, end_of_spds_durative, collect_sample_durative, drill_dbe_initialize_durative, drill_positioner_move_durative, drill_initialize_durative, _drill_dbe_ready_to_drill_dbe_ready_, _drill_spds_off_to_drill_spds_off_, _drill_spds_ce_standby_to_drill_spds_ce_standby_, _spds_standby_to_spds_standby_, drill_dbe_ready_preeffects_of_act_collect_sample, drill_dbe_ready_preeffects_of_act_deliver_sample, drill_dbe_ready_preeffects_of_act_drill_1, drill_spds_ce_standby_preeffects_of_act_drill_dbe_initialize, drill_dbe_ready_preeffects_of_act_drill_dbe_switchoff, drill_dbe_ready_preeffects_of_act_drill_initialize, drill_dbe_ready_preeffects_of_act_drill_positioner_move, drill_spds_ce_standby_preeffects_of_act_drillandspds_ceswitchoff, drill_spds_off_preeffects_of_act_drillandspds_ceswitchon, spds_standby_preeffects_of_act_end_of_spds, drill_spds_ce_standby_preeffects_of_act_gotospds};

    FROZENVAR
        InitTransition : {_drill_op_set_SM_to_drill_spds_off_};

    ASSIGN
        init(spds_bsd_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(drill_status) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : DRILL_SPDS_OFF;
esac;
        init(spds_cs_vsm_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(drill_sensor_calib_status) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : OFF;
esac;
        init(DRILL_ROD_SAMPLE_POSE) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : HOME;
esac;
        init(drill_db_q2) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(DRILL_POSITIONER_POSE) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : LOW_FOR_IMAGING;
esac;
        init(spds_cs_crush_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(spds_cs_dejam_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(drill_db_q1) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(drill_rod_q) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(spds_ds_1_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(spds_cstm_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(spds_ds_2_pose) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        init(drill_power) := case
InitTransition = _drill_op_set_SM_to_drill_spds_off_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(spds_bsd_pose) := case
TRUE : spds_bsd_pose;
esac;

        next(drill_status) := case
Transition = drill_1_durative :  (generatedEventPort__in__set_drill_status_drill_1 = TRUE ? next(status__in__set_drill_status_drill_1) : drill_status) ;
Transition = deliver_sample_durative :  (generatedEventPort__in__set_drill_status_deliver_sample = TRUE ? next(status__in__set_drill_status_deliver_sample) : drill_status) ;
Transition = spds_ce_standby_durative :  (generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE ? next(status__in__set_drill_status_drillandspds_ceswitchon) : drill_status) ;
Transition = drillandspds_ceswitchoff_durative :  (generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE ? next(status__in__set_drill_status_drillandspds_ceswitchoff) : drill_status) ;
Transition = drill_dbe_switchoff_durative :  (generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE ? next(status__in__set_drill_status_drill_dbe_switchoff) : drill_status) ;
Transition = gotospds_durative :  (generatedEventPort__in__set_drill_status_gotospds = TRUE ? next(status__in__set_drill_status_gotospds) : drill_status) ;
Transition = end_of_spds_durative :  (generatedEventPort__in__set_drill_status_end_of_spds = TRUE ? next(status__in__set_drill_status_end_of_spds) : drill_status) ;
Transition = collect_sample_durative :  (generatedEventPort__in__set_drill_status_collect_sample = TRUE ? next(status__in__set_drill_status_collect_sample) : drill_status) ;
Transition = drill_dbe_initialize_durative :  (generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE ? next(status__in__set_drill_status_drill_dbe_initialize) : drill_status) ;
Transition = drill_positioner_move_durative :  (generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE ? next(status__in__set_drill_status_drill_positioner_move) : drill_status) ;
Transition = drill_initialize_durative :  (generatedEventPort__in__set_drill_status_drill_initialize = TRUE ? next(status__in__set_drill_status_drill_initialize) : drill_status) ;
Transition = drill_dbe_ready_preeffects_of_act_collect_sample :  (generatedEventPort__in__set_drill_status_collect_sample = TRUE ? next(status__in__set_drill_status_collect_sample) : drill_status) ;
Transition = drill_dbe_ready_preeffects_of_act_deliver_sample :  (generatedEventPort__in__set_drill_status_deliver_sample = TRUE ? next(status__in__set_drill_status_deliver_sample) : drill_status) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_1 :  (generatedEventPort__in__set_drill_status_drill_1 = TRUE ? next(status__in__set_drill_status_drill_1) : drill_status) ;
Transition = drill_spds_ce_standby_preeffects_of_act_drill_dbe_initialize :  (generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE ? next(status__in__set_drill_status_drill_dbe_initialize) : drill_status) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_dbe_switchoff :  (generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE ? next(status__in__set_drill_status_drill_dbe_switchoff) : drill_status) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_initialize :  (generatedEventPort__in__set_drill_status_drill_initialize = TRUE ? next(status__in__set_drill_status_drill_initialize) : drill_status) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_positioner_move :  (generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE ? next(status__in__set_drill_status_drill_positioner_move) : drill_status) ;
Transition = drill_spds_ce_standby_preeffects_of_act_drillandspds_ceswitchoff :  (generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE ? next(status__in__set_drill_status_drillandspds_ceswitchoff) : drill_status) ;
Transition = drill_spds_off_preeffects_of_act_drillandspds_ceswitchon :  (generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE ? next(status__in__set_drill_status_drillandspds_ceswitchon) : drill_status) ;
Transition = spds_standby_preeffects_of_act_end_of_spds :  (generatedEventPort__in__set_drill_status_end_of_spds = TRUE ? next(status__in__set_drill_status_end_of_spds) : drill_status) ;
Transition = drill_spds_ce_standby_preeffects_of_act_gotospds :  (generatedEventPort__in__set_drill_status_gotospds = TRUE ? next(status__in__set_drill_status_gotospds) : drill_status) ;
TRUE : drill_status;
esac;

        next(spds_cs_vsm_pose) := case
TRUE : spds_cs_vsm_pose;
esac;

        next(drill_sensor_calib_status) := case
Transition = drill_initialize_durative :  (generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE ? next(status__in__set_drill_sensor_calib_status_drill_initialize) : drill_sensor_calib_status) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_initialize :  (generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE ? next(status__in__set_drill_sensor_calib_status_drill_initialize) : drill_sensor_calib_status) ;
TRUE : drill_sensor_calib_status;
esac;

        next(DRILL_ROD_SAMPLE_POSE) := case
Transition = drill_1_durative :  (generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE ? next(pose__in__set_drill_rod_sample_pose_drill_1) : DRILL_ROD_SAMPLE_POSE) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_1 :  (generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE ? next(pose__in__set_drill_rod_sample_pose_drill_1) : DRILL_ROD_SAMPLE_POSE) ;
TRUE : DRILL_ROD_SAMPLE_POSE;
esac;

        next(drill_db_q2) := case
TRUE : drill_db_q2;
esac;

        next(DRILL_POSITIONER_POSE) := case
Transition = drill_positioner_move_durative :  (generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE ? next(pose__in__set_drill_positioner_pose_drill_positioner_move) : DRILL_POSITIONER_POSE) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_positioner_move :  (generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE ? next(pose__in__set_drill_positioner_pose_drill_positioner_move) : DRILL_POSITIONER_POSE) ;
TRUE : DRILL_POSITIONER_POSE;
esac;

        next(spds_cs_crush_pose) := case
TRUE : spds_cs_crush_pose;
esac;

        next(spds_cs_dejam_pose) := case
TRUE : spds_cs_dejam_pose;
esac;

        next(drill_db_q1) := case
TRUE : drill_db_q1;
esac;

        next(drill_rod_q) := case
Transition = drill_1_durative :  (generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE ? next(power__in__set_drill_rod_q_drill_1) : drill_rod_q) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_1 :  (generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE ? next(power__in__set_drill_rod_q_drill_1) : drill_rod_q) ;
TRUE : drill_rod_q;
esac;

        next(spds_ds_1_pose) := case
TRUE : spds_ds_1_pose;
esac;

        next(spds_cstm_pose) := case
TRUE : spds_cstm_pose;
esac;

        next(spds_ds_2_pose) := case
TRUE : spds_ds_2_pose;
esac;

        next(drill_power) := case
Transition = drill_1_durative :  (generatedEventPort__in__set_drill_power_drill_1 = TRUE ? next(power__in__set_drill_power_drill_1) : drill_power) ;
Transition = deliver_sample_durative :  (generatedEventPort__in__set_drill_power_deliver_sample = TRUE ? next(power__in__set_drill_power_deliver_sample) : drill_power) ;
Transition = spds_ce_standby_durative :  (generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE ? next(power__in__set_drill_power_drillandspds_ceswitchon) : drill_power) ;
Transition = drillandspds_ceswitchoff_durative :  (generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE ? next(power__in__set_drill_power_drillandspds_ceswitchoff) : drill_power) ;
Transition = drill_dbe_switchoff_durative :  (generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE ? next(power__in__set_drill_power_drill_dbe_switchoff) : drill_power) ;
Transition = gotospds_durative :  (generatedEventPort__in__set_drill_power_gotospds = TRUE ? next(power__in__set_drill_power_gotospds) : drill_power) ;
Transition = end_of_spds_durative :  (generatedEventPort__in__set_drill_power_end_of_spds = TRUE ? next(power__in__set_drill_power_end_of_spds) : drill_power) ;
Transition = collect_sample_durative :  (generatedEventPort__in__set_drill_power_collect_sample = TRUE ? next(power__in__set_drill_power_collect_sample) : drill_power) ;
Transition = drill_dbe_initialize_durative :  (generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE ? next(power__in__set_drill_power_drill_dbe_initialize) : drill_power) ;
Transition = drill_positioner_move_durative :  (generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE ? next(power__in__set_drill_power_drill_positioner_move) : drill_power) ;
Transition = drill_initialize_durative :  (generatedEventPort__in__set_drill_power_drill_initialize = TRUE ? next(power__in__set_drill_power_drill_initialize) : drill_power) ;
Transition = drill_dbe_ready_preeffects_of_act_collect_sample :  (generatedEventPort__in__set_drill_power_collect_sample = TRUE ? next(power__in__set_drill_power_collect_sample) : drill_power) ;
Transition = drill_dbe_ready_preeffects_of_act_deliver_sample :  (generatedEventPort__in__set_drill_power_deliver_sample = TRUE ? next(power__in__set_drill_power_deliver_sample) : drill_power) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_1 :  (generatedEventPort__in__set_drill_power_drill_1 = TRUE ? next(power__in__set_drill_power_drill_1) : drill_power) ;
Transition = drill_spds_ce_standby_preeffects_of_act_drill_dbe_initialize :  (generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE ? next(power__in__set_drill_power_drill_dbe_initialize) : drill_power) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_dbe_switchoff :  (generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE ? next(power__in__set_drill_power_drill_dbe_switchoff) : drill_power) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_initialize :  (generatedEventPort__in__set_drill_power_drill_initialize = TRUE ? next(power__in__set_drill_power_drill_initialize) : drill_power) ;
Transition = drill_dbe_ready_preeffects_of_act_drill_positioner_move :  (generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE ? next(power__in__set_drill_power_drill_positioner_move) : drill_power) ;
Transition = drill_spds_ce_standby_preeffects_of_act_drillandspds_ceswitchoff :  (generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE ? next(power__in__set_drill_power_drillandspds_ceswitchoff) : drill_power) ;
Transition = drill_spds_off_preeffects_of_act_drillandspds_ceswitchon :  (generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE ? next(power__in__set_drill_power_drillandspds_ceswitchon) : drill_power) ;
Transition = spds_standby_preeffects_of_act_end_of_spds :  (generatedEventPort__in__set_drill_power_end_of_spds = TRUE ? next(power__in__set_drill_power_end_of_spds) : drill_power) ;
Transition = drill_spds_ce_standby_preeffects_of_act_gotospds :  (generatedEventPort__in__set_drill_power_gotospds = TRUE ? next(power__in__set_drill_power_gotospds) : drill_power) ;
TRUE : drill_power;
esac;

        next(status__in__set_sys_time_seconds_deliver_sample) := case
TRUE : status__in__set_sys_time_seconds_deliver_sample;
esac;

        next(status__in__set_sys_energy_used_deliver_sample) := case
TRUE : status__in__set_sys_energy_used_deliver_sample;
esac;

        next(status__in__set_sys_time_seconds_drill_positioner_move) := case
TRUE : status__in__set_sys_time_seconds_drill_positioner_move;
esac;

        next(status__in__set_sys_energy_used_drill_positioner_move) := case
TRUE : status__in__set_sys_energy_used_drill_positioner_move;
esac;

        next(status__in__set_sys_time_seconds_drill_1) := case
TRUE : status__in__set_sys_time_seconds_drill_1;
esac;

        next(status__in__set_sys_energy_used_drill_1) := case
TRUE : status__in__set_sys_energy_used_drill_1;
esac;

        next(status__in__set_sys_time_seconds_drill_dbe_initialize) := case
TRUE : status__in__set_sys_time_seconds_drill_dbe_initialize;
esac;

        next(status__in__set_sys_energy_used_drill_dbe_initialize) := case
TRUE : status__in__set_sys_energy_used_drill_dbe_initialize;
esac;

        next(status__in__set_sys_time_seconds_drillandspds_ceswitchon) := case
TRUE : status__in__set_sys_time_seconds_drillandspds_ceswitchon;
esac;

        next(status__in__set_sys_energy_used_drillandspds_ceswitchon) := case
TRUE : status__in__set_sys_energy_used_drillandspds_ceswitchon;
esac;

        next(status__in__set_sys_time_seconds_drillandspds_ceswitchoff) := case
TRUE : status__in__set_sys_time_seconds_drillandspds_ceswitchoff;
esac;

        next(status__in__set_sys_energy_used_drillandspds_ceswitchoff) := case
TRUE : status__in__set_sys_energy_used_drillandspds_ceswitchoff;
esac;

        next(status__in__set_sys_time_seconds_drill_dbe_switchoff) := case
TRUE : status__in__set_sys_time_seconds_drill_dbe_switchoff;
esac;

        next(status__in__set_sys_energy_used_drill_dbe_switchoff) := case
TRUE : status__in__set_sys_energy_used_drill_dbe_switchoff;
esac;

        next(status__in__set_sys_time_seconds_gotospds) := case
TRUE : status__in__set_sys_time_seconds_gotospds;
esac;

        next(status__in__set_sys_energy_used_gotospds) := case
TRUE : status__in__set_sys_energy_used_gotospds;
esac;

        next(status__in__set_sys_time_seconds_end_of_spds) := case
TRUE : status__in__set_sys_time_seconds_end_of_spds;
esac;

        next(status__in__set_sys_energy_used_end_of_spds) := case
TRUE : status__in__set_sys_energy_used_end_of_spds;
esac;

        next(status__in__set_sys_time_seconds_spds_homing) := case
TRUE : status__in__set_sys_time_seconds_spds_homing;
esac;

        next(status__in__set_sys_energy_used_spds_homing) := case
TRUE : status__in__set_sys_energy_used_spds_homing;
esac;

        next(status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample) := case
TRUE : status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample;
esac;

        next(status__in__set_sys_energy_used_spds_preparetoreceivedrillsample) := case
TRUE : status__in__set_sys_energy_used_spds_preparetoreceivedrillsample;
esac;

        next(status__in__set_sys_time_seconds_drill_initialize) := case
TRUE : status__in__set_sys_time_seconds_drill_initialize;
esac;

        next(status__in__set_sys_energy_used_drill_initialize) := case
TRUE : status__in__set_sys_energy_used_drill_initialize;
esac;

        next(status__in__set_sys_time_seconds_collect_sample) := case
TRUE : status__in__set_sys_time_seconds_collect_sample;
esac;

        next(status__in__set_sys_energy_used_collect_sample) := case
TRUE : status__in__set_sys_energy_used_collect_sample;
esac;

        next(performed__in__drill_dbe_initialize_done) := case
TRUE : performed__in__drill_dbe_initialize_done;
esac;

        next(performed__in__drillandspds_ceswitchon_done) := case
TRUE : performed__in__drillandspds_ceswitchon_done;
esac;

        next(performed__in__drillandspds_ceswitchoff_done) := case
TRUE : performed__in__drillandspds_ceswitchoff_done;
esac;

        next(performed__in__drill_dbe_switchoff_done) := case
TRUE : performed__in__drill_dbe_switchoff_done;
esac;

        next(performed__in__drill_1_done) := case
TRUE : performed__in__drill_1_done;
esac;

        next(performed__in__collect_sample_done) := case
TRUE : performed__in__collect_sample_done;
esac;

        next(performed__in__drill_initialize_done) := case
TRUE : performed__in__drill_initialize_done;
esac;

        next(performed__in__drill_positioner_move_done) := case
TRUE : performed__in__drill_positioner_move_done;
esac;

        next(performed__in__deliver_sample_done) := case
TRUE : performed__in__deliver_sample_done;
esac;

        next(performed__in__gotospds_done) := case
TRUE : performed__in__gotospds_done;
esac;

        next(performed__in__end_of_spds_done) := case
TRUE : performed__in__end_of_spds_done;
esac;

        next(performed__in__spds_homing_done) := case
TRUE : performed__in__spds_homing_done;
esac;

        next(performed__in__spds_preparetoreceivedrillsample_done) := case
TRUE : performed__in__spds_preparetoreceivedrillsample_done;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_deliver_sample) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_deliver_sample;
esac;

        next(generatedEventPort__in__set_sys_energy_used_deliver_sample) := case
TRUE : generatedEventPort__in__set_sys_energy_used_deliver_sample;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drill_positioner_move) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drill_positioner_move;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drill_positioner_move) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drill_positioner_move;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drill_1) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drill_1;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drill_1) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drill_1;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchoff) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchoff;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchoff) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchoff;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_gotospds) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_gotospds;
esac;

        next(generatedEventPort__in__set_sys_energy_used_gotospds) := case
TRUE : generatedEventPort__in__set_sys_energy_used_gotospds;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_end_of_spds) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_end_of_spds;
esac;

        next(generatedEventPort__in__set_sys_energy_used_end_of_spds) := case
TRUE : generatedEventPort__in__set_sys_energy_used_end_of_spds;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_spds_homing) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_spds_homing;
esac;

        next(generatedEventPort__in__set_sys_energy_used_spds_homing) := case
TRUE : generatedEventPort__in__set_sys_energy_used_spds_homing;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample;
esac;

        next(generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample) := case
TRUE : generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_drill_initialize) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_drill_initialize;
esac;

        next(generatedEventPort__in__set_sys_energy_used_drill_initialize) := case
TRUE : generatedEventPort__in__set_sys_energy_used_drill_initialize;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_collect_sample) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_collect_sample;
esac;

        next(generatedEventPort__in__set_sys_energy_used_collect_sample) := case
TRUE : generatedEventPort__in__set_sys_energy_used_collect_sample;
esac;

    INIT (InitTransition = _drill_op_set_SM_to_drill_spds_off_ -> State = drill_spds_off);

    INVAR (spds_ds_1_pose >= 0 & spds_ds_1_pose <= 10);

    INVAR (spds_cstm_pose >= 0.0 & spds_cstm_pose <= 0.32);

    INVAR (spds_ds_2_pose >= 0 & spds_ds_2_pose <= 10);

    TRANS (Transition = drill_1_durative -> (((performed__in__act_drill_1_done_input = TRUE & (((generatedEventPort__in__set_drill_status_drill_1 = TRUE | generatedEventPort__in__set_drill_power_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = deliver_sample_durative -> (((performed__in__act_deliver_sample_done_input = TRUE & (generatedEventPort__in__set_drill_status_deliver_sample = TRUE | generatedEventPort__in__set_drill_power_deliver_sample = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = spds_ce_standby_durative -> (((performed__in__act_drillandspds_ceswitchon_done_input = TRUE & (generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE | generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE)) & State = drill_spds_off) & next(State) = drill_spds_ce_standby));

    TRANS (Transition = drillandspds_ceswitchoff_durative -> (((performed__in__act_drillandspds_ceswitchoff_done_input = TRUE & (generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE | generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE)) & State = drill_spds_ce_standby) & next(State) = drill_spds_off));

    TRANS (Transition = drill_dbe_switchoff_durative -> (((performed__in__act_drill_dbe_switchoff_done_input = TRUE & (generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE | generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE)) & State = drill_dbe_ready) & next(State) = drill_spds_ce_standby));

    TRANS (Transition = gotospds_durative -> (((performed__in__act_gotospds_done_input = TRUE & (generatedEventPort__in__set_drill_status_gotospds = TRUE | generatedEventPort__in__set_drill_power_gotospds = TRUE)) & State = drill_spds_ce_standby) & next(State) = spds_standby));

    TRANS (Transition = end_of_spds_durative -> (((performed__in__act_end_of_spds_done_input = TRUE & (generatedEventPort__in__set_drill_status_end_of_spds = TRUE | generatedEventPort__in__set_drill_power_end_of_spds = TRUE)) & State = spds_standby) & next(State) = drill_spds_ce_standby));

    TRANS (Transition = collect_sample_durative -> (((performed__in__act_collect_sample_done_input = TRUE & (generatedEventPort__in__set_drill_status_collect_sample = TRUE | generatedEventPort__in__set_drill_power_collect_sample = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_dbe_initialize_durative -> (((performed__in__act_drill_dbe_initialize_done_input = TRUE & (generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE | generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE)) & State = drill_spds_ce_standby) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_positioner_move_durative -> (((performed__in__act_drill_positioner_move_done_input = TRUE & ((generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE | generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_initialize_durative -> (((performed__in__act_drill_initialize_done_input = TRUE & ((generatedEventPort__in__set_drill_status_drill_initialize = TRUE | generatedEventPort__in__set_drill_power_drill_initialize = TRUE) | generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = _drill_dbe_ready_to_drill_dbe_ready_ -> ((!((((((((((((((((((((((((((((((((((((((((((generatedEventPort__in__set_drill_status_deliver_sample = TRUE | generatedEventPort__in__set_drill_power_deliver_sample = TRUE) | generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_status_drill_1 = TRUE) | generatedEventPort__in__set_drill_power_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_status_gotospds = TRUE) | generatedEventPort__in__set_drill_power_gotospds = TRUE) | generatedEventPort__in__set_drill_status_end_of_spds = TRUE) | generatedEventPort__in__set_drill_power_end_of_spds = TRUE) | generatedEventPort__in__set_drill_status_spds_homing = TRUE) | generatedEventPort__in__set_drill_power_spds_homing = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_homing = TRUE) | generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_initialize = TRUE) | generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_status_collect_sample = TRUE) | generatedEventPort__in__set_drill_power_collect_sample = TRUE) | performed__in__act_drill_1_done_input = TRUE) | performed__in__act_deliver_sample_done_input = TRUE) | performed__in__act_drillandspds_ceswitchon_done_input = TRUE) | performed__in__act_drillandspds_ceswitchoff_done_input = TRUE) | performed__in__act_drill_dbe_switchoff_done_input = TRUE) | performed__in__act_gotospds_done_input = TRUE) | performed__in__act_end_of_spds_done_input = TRUE) | performed__in__act_collect_sample_done_input = TRUE) | performed__in__act_drill_dbe_initialize_done_input = TRUE) | performed__in__act_drill_positioner_move_done_input = TRUE) | performed__in__act_drill_initialize_done_input = TRUE) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = _drill_spds_off_to_drill_spds_off_ -> ((!((((((((((((((((((((((((((((((((((((((((((generatedEventPort__in__set_drill_status_deliver_sample = TRUE | generatedEventPort__in__set_drill_power_deliver_sample = TRUE) | generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_status_drill_1 = TRUE) | generatedEventPort__in__set_drill_power_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_status_gotospds = TRUE) | generatedEventPort__in__set_drill_power_gotospds = TRUE) | generatedEventPort__in__set_drill_status_end_of_spds = TRUE) | generatedEventPort__in__set_drill_power_end_of_spds = TRUE) | generatedEventPort__in__set_drill_status_spds_homing = TRUE) | generatedEventPort__in__set_drill_power_spds_homing = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_homing = TRUE) | generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_initialize = TRUE) | generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_status_collect_sample = TRUE) | generatedEventPort__in__set_drill_power_collect_sample = TRUE) | performed__in__act_drill_1_done_input = TRUE) | performed__in__act_deliver_sample_done_input = TRUE) | performed__in__act_drillandspds_ceswitchon_done_input = TRUE) | performed__in__act_drillandspds_ceswitchoff_done_input = TRUE) | performed__in__act_drill_dbe_switchoff_done_input = TRUE) | performed__in__act_gotospds_done_input = TRUE) | performed__in__act_end_of_spds_done_input = TRUE) | performed__in__act_collect_sample_done_input = TRUE) | performed__in__act_drill_dbe_initialize_done_input = TRUE) | performed__in__act_drill_positioner_move_done_input = TRUE) | performed__in__act_drill_initialize_done_input = TRUE) & State = drill_spds_off) & next(State) = drill_spds_off));

    TRANS (Transition = _drill_spds_ce_standby_to_drill_spds_ce_standby_ -> ((!((((((((((((((((((((((((((((((((((((((((((generatedEventPort__in__set_drill_status_deliver_sample = TRUE | generatedEventPort__in__set_drill_power_deliver_sample = TRUE) | generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_status_drill_1 = TRUE) | generatedEventPort__in__set_drill_power_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_status_gotospds = TRUE) | generatedEventPort__in__set_drill_power_gotospds = TRUE) | generatedEventPort__in__set_drill_status_end_of_spds = TRUE) | generatedEventPort__in__set_drill_power_end_of_spds = TRUE) | generatedEventPort__in__set_drill_status_spds_homing = TRUE) | generatedEventPort__in__set_drill_power_spds_homing = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_homing = TRUE) | generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_initialize = TRUE) | generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_status_collect_sample = TRUE) | generatedEventPort__in__set_drill_power_collect_sample = TRUE) | performed__in__act_drill_1_done_input = TRUE) | performed__in__act_deliver_sample_done_input = TRUE) | performed__in__act_drillandspds_ceswitchon_done_input = TRUE) | performed__in__act_drillandspds_ceswitchoff_done_input = TRUE) | performed__in__act_drill_dbe_switchoff_done_input = TRUE) | performed__in__act_gotospds_done_input = TRUE) | performed__in__act_end_of_spds_done_input = TRUE) | performed__in__act_collect_sample_done_input = TRUE) | performed__in__act_drill_dbe_initialize_done_input = TRUE) | performed__in__act_drill_positioner_move_done_input = TRUE) | performed__in__act_drill_initialize_done_input = TRUE) & State = drill_spds_ce_standby) & next(State) = drill_spds_ce_standby));

    TRANS (Transition = _spds_standby_to_spds_standby_ -> ((!((((((((((((((((((((((((((((((((((((((((((generatedEventPort__in__set_drill_status_deliver_sample = TRUE | generatedEventPort__in__set_drill_power_deliver_sample = TRUE) | generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_status_drill_1 = TRUE) | generatedEventPort__in__set_drill_power_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE) | generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_drill_status_gotospds = TRUE) | generatedEventPort__in__set_drill_power_gotospds = TRUE) | generatedEventPort__in__set_drill_status_end_of_spds = TRUE) | generatedEventPort__in__set_drill_power_end_of_spds = TRUE) | generatedEventPort__in__set_drill_status_spds_homing = TRUE) | generatedEventPort__in__set_drill_power_spds_homing = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_homing = TRUE) | generatedEventPort__in__set_drill_status_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_spds_cstm_pose_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_power_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_drill_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_power_drill_initialize = TRUE) | generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE) | generatedEventPort__in__set_drill_status_collect_sample = TRUE) | generatedEventPort__in__set_drill_power_collect_sample = TRUE) | performed__in__act_drill_1_done_input = TRUE) | performed__in__act_deliver_sample_done_input = TRUE) | performed__in__act_drillandspds_ceswitchon_done_input = TRUE) | performed__in__act_drillandspds_ceswitchoff_done_input = TRUE) | performed__in__act_drill_dbe_switchoff_done_input = TRUE) | performed__in__act_gotospds_done_input = TRUE) | performed__in__act_end_of_spds_done_input = TRUE) | performed__in__act_collect_sample_done_input = TRUE) | performed__in__act_drill_dbe_initialize_done_input = TRUE) | performed__in__act_drill_positioner_move_done_input = TRUE) | performed__in__act_drill_initialize_done_input = TRUE) & State = spds_standby) & next(State) = spds_standby));

    TRANS (Transition = drill_dbe_ready_preeffects_of_act_collect_sample -> (((startEvent__in__act_collect_sample_start = TRUE & (generatedEventPort__in__set_drill_status_collect_sample = TRUE | generatedEventPort__in__set_drill_power_collect_sample = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_dbe_ready_preeffects_of_act_deliver_sample -> (((startEvent__in__act_deliver_sample_start = TRUE & (generatedEventPort__in__set_drill_status_deliver_sample = TRUE | generatedEventPort__in__set_drill_power_deliver_sample = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_dbe_ready_preeffects_of_act_drill_1 -> (((startEvent__in__act_drill_1_start = TRUE & (((generatedEventPort__in__set_drill_status_drill_1 = TRUE | generatedEventPort__in__set_drill_power_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_q_drill_1 = TRUE) | generatedEventPort__in__set_drill_rod_sample_pose_drill_1 = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_spds_ce_standby_preeffects_of_act_drill_dbe_initialize -> (((startEvent__in__act_drill_dbe_initialize_start = TRUE & (generatedEventPort__in__set_drill_status_drill_dbe_initialize = TRUE | generatedEventPort__in__set_drill_power_drill_dbe_initialize = TRUE)) & State = drill_spds_ce_standby) & next(State) = drill_spds_ce_standby));

    TRANS (Transition = drill_dbe_ready_preeffects_of_act_drill_dbe_switchoff -> (((startEvent__in__act_drill_dbe_switchoff_start = TRUE & (generatedEventPort__in__set_drill_status_drill_dbe_switchoff = TRUE | generatedEventPort__in__set_drill_power_drill_dbe_switchoff = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_dbe_ready_preeffects_of_act_drill_initialize -> (((startEvent__in__act_drill_initialize_start = TRUE & ((generatedEventPort__in__set_drill_status_drill_initialize = TRUE | generatedEventPort__in__set_drill_power_drill_initialize = TRUE) | generatedEventPort__in__set_drill_sensor_calib_status_drill_initialize = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_dbe_ready_preeffects_of_act_drill_positioner_move -> (((startEvent__in__act_drill_positioner_move_start = TRUE & ((generatedEventPort__in__set_drill_status_drill_positioner_move = TRUE | generatedEventPort__in__set_drill_power_drill_positioner_move = TRUE) | generatedEventPort__in__set_drill_positioner_pose_drill_positioner_move = TRUE)) & State = drill_dbe_ready) & next(State) = drill_dbe_ready));

    TRANS (Transition = drill_spds_ce_standby_preeffects_of_act_drillandspds_ceswitchoff -> (((startEvent__in__act_drillandspds_ceswitchoff_start = TRUE & (generatedEventPort__in__set_drill_status_drillandspds_ceswitchoff = TRUE | generatedEventPort__in__set_drill_power_drillandspds_ceswitchoff = TRUE)) & State = drill_spds_ce_standby) & next(State) = drill_spds_ce_standby));

    TRANS (Transition = drill_spds_off_preeffects_of_act_drillandspds_ceswitchon -> (((startEvent__in__act_drillandspds_ceswitchon_start = TRUE & (generatedEventPort__in__set_drill_status_drillandspds_ceswitchon = TRUE | generatedEventPort__in__set_drill_power_drillandspds_ceswitchon = TRUE)) & State = drill_spds_off) & next(State) = drill_spds_off));

    TRANS (Transition = spds_standby_preeffects_of_act_end_of_spds -> (((startEvent__in__act_end_of_spds_start = TRUE & (generatedEventPort__in__set_drill_status_end_of_spds = TRUE | generatedEventPort__in__set_drill_power_end_of_spds = TRUE)) & State = spds_standby) & next(State) = spds_standby));

    TRANS (Transition = drill_spds_ce_standby_preeffects_of_act_gotospds -> (((startEvent__in__act_gotospds_start = TRUE & (generatedEventPort__in__set_drill_status_gotospds = TRUE | generatedEventPort__in__set_drill_power_gotospds = TRUE)) & State = drill_spds_ce_standby) & next(State) = drill_spds_ce_standby));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE End_Of_SPDS(startEvent__in__startActivityPort, drill_status, rtb_status, sys_time_seconds, sys_energy_used, drill_power, ade_left_power, ade_right_power, clupi_power, dhs_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_drill_status : {DRILL_SPDS_OFF, DRILL_DBE_READY, DRILL_SPDS_CE_STANDBY, SPDS_STANDBY};
        power__in__set_drill_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_drill_status : boolean;
        generatedEventPort__in__set_drill_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_End_Of_SPDS_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (drill_status = SPDS_STANDBY & rtb_status = RTB_ON);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_End_Of_SPDS_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_End_Of_SPDS_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 3.82);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : DRILL_SPDS_CE_STANDBY;
TRUE : status__in__set_drill_status;
esac;

        next(power__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : 11.82;
TRUE : power__in__set_drill_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_drill_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_status;
TRUE : generatedEventPort__in__set_drill_status;
esac;

        next(generatedEventPort__in__set_drill_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_drill_power;
TRUE : generatedEventPort__in__set_drill_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_End_Of_SPDS_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RTB(startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, generatedEventPort__in__set_rtb_status_switchon, generatedEventPort__in__set_rtb_status_switchoff, generatedEventPort__in__set_rtb_power_switchon, generatedEventPort__in__set_rtb_power_switchoff, ade_left_power, ade_right_power, dhs_power, imu_power, loccam_power, bema_power, drill_power, clupi_power, sys_time_seconds, sys_energy_used, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, status__in__set_rtb_status_switchon, status__in__set_rtb_status_switchoff, power__in__set_rtb_power_switchon, power__in__set_rtb_power_switchoff)
    VAR
        rtb_op_set_SM : RTB_SM(startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, next(act_rtb_switchon.generatedEventPort__in__set_rtb_status) != act_rtb_switchon.generatedEventPort__in__set_rtb_status, next(act_rtb_switchoff.generatedEventPort__in__set_rtb_status) != act_rtb_switchoff.generatedEventPort__in__set_rtb_status, next(act_rtb_switchon.generatedEventPort__in__set_rtb_power) != act_rtb_switchon.generatedEventPort__in__set_rtb_power, next(act_rtb_switchoff.generatedEventPort__in__set_rtb_power) != act_rtb_switchoff.generatedEventPort__in__set_rtb_power, next(act_rtb_switchon.performed__in__activityPerformedPort) != act_rtb_switchon.performed__in__activityPerformedPort, next(act_rtb_switchoff.performed__in__activityPerformedPort) != act_rtb_switchoff.performed__in__activityPerformedPort, ade_left_power, ade_right_power, dhs_power, imu_power, loccam_power, bema_power, drill_power, clupi_power, sys_time_seconds, sys_energy_used, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, act_rtb_switchon.status__in__set_rtb_status, act_rtb_switchoff.status__in__set_rtb_status, act_rtb_switchon.power__in__set_rtb_power, act_rtb_switchoff.power__in__set_rtb_power);
        act_rtb_switchon : RTB_SwitchOn(startEvent__in__act_rtb_switchon_start, rtb_op_set_SM.rtb_status, rtb_op_set_SM.rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, sys_time_seconds, sys_energy_used, imu_power, bema_power, loccam_power, duration__in__act_rtb_switchon_start);
        act_rtb_switchoff : RTB_SwitchOff(startEvent__in__act_rtb_switchoff_start, rtb_op_set_SM.rtb_status, rtb_op_set_SM.rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, sys_time_seconds, sys_energy_used, imu_power, bema_power, loccam_power, duration__in__act_rtb_switchoff_start);
    DEFINE
        generatedEventPort__in__set_sys_energy_used_switchoff := act_rtb_switchoff.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_switchoff := act_rtb_switchoff.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_switchon := act_rtb_switchon.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_switchon := act_rtb_switchon.generatedEventPort__in__set_sys_time_seconds;
        performed__in__rtb_switchoff_done := act_rtb_switchoff.performed__in__activityPerformedPort;
        performed__in__rtb_switchon_done := act_rtb_switchon.performed__in__activityPerformedPort;
        status__in__set_sys_energy_used_switchoff := act_rtb_switchoff.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_switchoff := act_rtb_switchoff.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_switchon := act_rtb_switchon.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_switchon := act_rtb_switchon.status__in__set_sys_time_seconds;
        rtb_power := rtb_op_set_SM.rtb_power;
        rtb_status := rtb_op_set_SM.rtb_status;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RTB_SM(startEvent__in__act_rtb_switchon_start, startEvent__in__act_rtb_switchoff_start, generatedEventPort__in__set_rtb_status_switchon, generatedEventPort__in__set_rtb_status_switchoff, generatedEventPort__in__set_rtb_power_switchon, generatedEventPort__in__set_rtb_power_switchoff, performed__in__act_rtb_switchon_done_input, performed__in__act_rtb_switchoff_done_input, ade_left_power, ade_right_power, dhs_power, imu_power, loccam_power, bema_power, drill_power, clupi_power, sys_time_seconds, sys_energy_used, duration__in__act_rtb_switchon_start, duration__in__act_rtb_switchoff_start, status__in__set_rtb_status_switchon, status__in__set_rtb_status_switchoff, power__in__set_rtb_power_switchon, power__in__set_rtb_power_switchoff)
    VAR
        State : {rtb_off, rtb_on, t};
        c : clock;
        rtb_status : {RTB_OFF, RTB_ON};
        rtb_power : real;
        status__in__set_sys_time_seconds_switchon : real;
        status__in__set_sys_energy_used_switchon : real;
        status__in__set_sys_time_seconds_switchoff : real;
        status__in__set_sys_energy_used_switchoff : real;
        performed__in__rtb_switchon_done : boolean;
        performed__in__rtb_switchoff_done : boolean;
        generatedEventPort__in__set_sys_time_seconds_switchon : boolean;
        generatedEventPort__in__set_sys_energy_used_switchon : boolean;
        generatedEventPort__in__set_sys_time_seconds_switchoff : boolean;
        generatedEventPort__in__set_sys_energy_used_switchoff : boolean;

    IVAR
        Transition : {rtb_switchon_durative, rtb_switchoff_durative, _rtb_off_to_rtb_off_, _rtb_on_to_rtb_on_, rtb_on_preeffects_of_act_rtb_switchoff, rtb_off_preeffects_of_act_rtb_switchon};

    FROZENVAR
        InitTransition : {_rtb_op_set_SM_to_rtb_off_};

    ASSIGN
        init(rtb_status) := case
InitTransition = _rtb_op_set_SM_to_rtb_off_ : RTB_OFF;
esac;
        init(rtb_power) := case
InitTransition = _rtb_op_set_SM_to_rtb_off_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(rtb_status) := case
Transition = rtb_switchon_durative :  (generatedEventPort__in__set_rtb_status_switchon = TRUE ? next(status__in__set_rtb_status_switchon) : rtb_status) ;
Transition = rtb_switchoff_durative :  (generatedEventPort__in__set_rtb_status_switchoff = TRUE ? next(status__in__set_rtb_status_switchoff) : rtb_status) ;
Transition = rtb_on_preeffects_of_act_rtb_switchoff :  (generatedEventPort__in__set_rtb_status_switchoff = TRUE ? next(status__in__set_rtb_status_switchoff) : rtb_status) ;
Transition = rtb_off_preeffects_of_act_rtb_switchon :  (generatedEventPort__in__set_rtb_status_switchon = TRUE ? next(status__in__set_rtb_status_switchon) : rtb_status) ;
TRUE : rtb_status;
esac;

        next(rtb_power) := case
Transition = rtb_switchon_durative :  (generatedEventPort__in__set_rtb_power_switchon = TRUE ? next(power__in__set_rtb_power_switchon) : rtb_power) ;
Transition = rtb_switchoff_durative :  (generatedEventPort__in__set_rtb_power_switchoff = TRUE ? next(power__in__set_rtb_power_switchoff) : rtb_power) ;
Transition = rtb_on_preeffects_of_act_rtb_switchoff :  (generatedEventPort__in__set_rtb_power_switchoff = TRUE ? next(power__in__set_rtb_power_switchoff) : rtb_power) ;
Transition = rtb_off_preeffects_of_act_rtb_switchon :  (generatedEventPort__in__set_rtb_power_switchon = TRUE ? next(power__in__set_rtb_power_switchon) : rtb_power) ;
TRUE : rtb_power;
esac;

        next(status__in__set_sys_time_seconds_switchon) := case
TRUE : status__in__set_sys_time_seconds_switchon;
esac;

        next(status__in__set_sys_energy_used_switchon) := case
TRUE : status__in__set_sys_energy_used_switchon;
esac;

        next(status__in__set_sys_time_seconds_switchoff) := case
TRUE : status__in__set_sys_time_seconds_switchoff;
esac;

        next(status__in__set_sys_energy_used_switchoff) := case
TRUE : status__in__set_sys_energy_used_switchoff;
esac;

        next(performed__in__rtb_switchon_done) := case
TRUE : performed__in__rtb_switchon_done;
esac;

        next(performed__in__rtb_switchoff_done) := case
TRUE : performed__in__rtb_switchoff_done;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_switchon) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_switchon;
esac;

        next(generatedEventPort__in__set_sys_energy_used_switchon) := case
TRUE : generatedEventPort__in__set_sys_energy_used_switchon;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_switchoff) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_switchoff;
esac;

        next(generatedEventPort__in__set_sys_energy_used_switchoff) := case
TRUE : generatedEventPort__in__set_sys_energy_used_switchoff;
esac;

    INIT (InitTransition = _rtb_op_set_SM_to_rtb_off_ -> State = rtb_off);

    TRANS (Transition = rtb_switchon_durative -> (((performed__in__act_rtb_switchon_done_input = TRUE & (generatedEventPort__in__set_rtb_status_switchon = TRUE | generatedEventPort__in__set_rtb_power_switchon = TRUE)) & State = rtb_off) & next(State) = rtb_on));

    TRANS (Transition = rtb_switchoff_durative -> (((performed__in__act_rtb_switchoff_done_input = TRUE & (generatedEventPort__in__set_rtb_status_switchoff = TRUE | generatedEventPort__in__set_rtb_power_switchoff = TRUE)) & State = rtb_on) & next(State) = rtb_off));

    TRANS (Transition = _rtb_off_to_rtb_off_ -> ((!(((((generatedEventPort__in__set_rtb_status_switchon = TRUE | generatedEventPort__in__set_rtb_status_switchoff = TRUE) | generatedEventPort__in__set_rtb_power_switchon = TRUE) | generatedEventPort__in__set_rtb_power_switchoff = TRUE) | performed__in__act_rtb_switchon_done_input = TRUE) | performed__in__act_rtb_switchoff_done_input = TRUE) & State = rtb_off) & next(State) = rtb_off));

    TRANS (Transition = _rtb_on_to_rtb_on_ -> ((!(((((generatedEventPort__in__set_rtb_status_switchon = TRUE | generatedEventPort__in__set_rtb_status_switchoff = TRUE) | generatedEventPort__in__set_rtb_power_switchon = TRUE) | generatedEventPort__in__set_rtb_power_switchoff = TRUE) | performed__in__act_rtb_switchon_done_input = TRUE) | performed__in__act_rtb_switchoff_done_input = TRUE) & State = rtb_on) & next(State) = rtb_on));

    TRANS (Transition = rtb_on_preeffects_of_act_rtb_switchoff -> (((startEvent__in__act_rtb_switchoff_start = TRUE & (generatedEventPort__in__set_rtb_status_switchoff = TRUE | generatedEventPort__in__set_rtb_power_switchoff = TRUE)) & State = rtb_on) & next(State) = rtb_on));

    TRANS (Transition = rtb_off_preeffects_of_act_rtb_switchon -> (((startEvent__in__act_rtb_switchon_start = TRUE & (generatedEventPort__in__set_rtb_status_switchon = TRUE | generatedEventPort__in__set_rtb_power_switchon = TRUE)) & State = rtb_off) & next(State) = rtb_off));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RTB_SwitchOn(startEvent__in__startActivityPort, rtb_status, rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, sys_time_seconds, sys_energy_used, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_rtb_status : {RTB_OFF, RTB_ON};
        power__in__set_rtb_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_rtb_status : boolean;
        generatedEventPort__in__set_rtb_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RTB_SwitchOn_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := rtb_status = RTB_OFF;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RTB_SwitchOn_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RTB_SwitchOn_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_rtb_status) := case
Transition = _Progress_to_Idle_ : RTB_ON;
TRUE : status__in__set_rtb_status;
esac;

        next(power__in__set_rtb_power) := case
Transition = _Progress_to_Idle_ : 3.1;
TRUE : power__in__set_rtb_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_rtb_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_rtb_status;
TRUE : generatedEventPort__in__set_rtb_status;
esac;

        next(generatedEventPort__in__set_rtb_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_rtb_power;
TRUE : generatedEventPort__in__set_rtb_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RTB_SwitchOn_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RTB_SwitchOff(startEvent__in__startActivityPort, rtb_status, rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, sys_time_seconds, sys_energy_used, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_rtb_status : {RTB_OFF, RTB_ON};
        power__in__set_rtb_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_rtb_status : boolean;
        generatedEventPort__in__set_rtb_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RTB_SwitchOff_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := rtb_status = RTB_ON;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RTB_SwitchOff_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RTB_SwitchOff_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_rtb_status) := case
Transition = _Progress_to_Idle_ : RTB_OFF;
TRUE : status__in__set_rtb_status;
esac;

        next(power__in__set_rtb_power) := case
Transition = _Progress_to_Idle_ : 0.0;
TRUE : power__in__set_rtb_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_rtb_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_rtb_status;
TRUE : generatedEventPort__in__set_rtb_status;
esac;

        next(generatedEventPort__in__set_rtb_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_rtb_power;
TRUE : generatedEventPort__in__set_rtb_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RTB_SwitchOff_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Clupi(generatedEventPort__in__set_clupi_status_switchon, generatedEventPort__in__set_clupi_power_switchon, generatedEventPort__in__set_clupi_time_synch_switchon, generatedEventPort__in__set_clupi_imagedatatype_switchon, generatedEventPort__in__set_clupi_binning_switchon, generatedEventPort__in__set_clupi_mem_check_switchon, generatedEventPort__in__set_clupi_quantization_switchon, generatedEventPort__in__set_clupi_status_diagnostic, generatedEventPort__in__set_clupi_power_diagnostic, generatedEventPort__in__set_clupi_mem_check_diagnostic, generatedEventPort__in__set_clupi_status_timesync, generatedEventPort__in__set_clupi_power_timesync, generatedEventPort__in__set_clupi_time_synch_timesync, generatedEventPort__in__set_clupi_status_acquirezscience, generatedEventPort__in__set_clupi_power_acquirezscience, generatedEventPort__in__set_clupi_status_switchoff, generatedEventPort__in__set_clupi_power_switchoff, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, generatedEventPort__in__set_clupi_status_rv_configurereset, generatedEventPort__in__set_clupi_power_rv_configurereset, ade_left_power, ade_right_power, dhs_power, rtb_power, drill_power, imu_power, bema_power, loccam_power, dhs_status, sys_time_seconds, sys_energy_used, status__in__set_clupi_status_switchon, power__in__set_clupi_power_switchon, sync__in__set_clupi_time_synch_switchon, type__in__set_clupi_imagedatatype_switchon, binning__in__set_clupi_binning_switchon, check__in__set_clupi_mem_check_switchon, quantization__in__set_clupi_quantization_switchon, status__in__set_clupi_status_diagnostic, power__in__set_clupi_power_diagnostic, check__in__set_clupi_mem_check_diagnostic, status__in__set_clupi_status_timesync, power__in__set_clupi_power_timesync, sync__in__set_clupi_time_synch_timesync, status__in__set_clupi_status_acquirezscience, power__in__set_clupi_power_acquirezscience, status__in__set_clupi_status_switchoff, power__in__set_clupi_power_switchoff, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, status__in__set_clupi_status_rv_configurereset, power__in__set_clupi_power_rv_configurereset)
    VAR
        act_clupi_switchoff : CLUPI_SwitchOff(startEvent__in__clupi_switchoff_start, clupi_op_set_SM.clupi_status, clupi_op_set_SM.clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__clupi_switchoff_start);
        act_clupi_diagnostic : CLUPI_Diagnostic(startEvent__in__clupi_diagnostic_start, clupi_op_set_SM.clupi_status, clupi_op_set_SM.clupi_mem_check, clupi_op_set_SM.clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__clupi_diagnostic_start);
        act_clupi_timesync : CLUPI_TimeSync(startEvent__in__clupi_timesync_start, clupi_op_set_SM.clupi_status, clupi_op_set_SM.clupi_time_synch, clupi_op_set_SM.clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__clupi_timesync_start);
        act_clupi_acquirezscience : CLUPI_AcquireZScience(startEvent__in__clupi_acquirezscience_start, clupi_op_set_SM.clupi_status, clupi_op_set_SM.clupi_imagedatatype, clupi_op_set_SM.clupi_mem_check, clupi_op_set_SM.clupi_time_synch, clupi_op_set_SM.clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__clupi_acquirezscience_start);
        act_clupi_switchon : CLUPI_SwitchOn(startEvent__in__clupi_switchon_start, clupi_op_set_SM.clupi_binning, clupi_op_set_SM.clupi_mem_check, clupi_op_set_SM.clupi_time_synch, clupi_op_set_SM.clupi_status, clupi_op_set_SM.clupi_quantization, clupi_op_set_SM.clupi_imagedatatype, clupi_op_set_SM.clupi_power, ade_left_power, ade_right_power, dhs_power, rtb_power, drill_power, imu_power, bema_power, loccam_power, sys_time_seconds, sys_energy_used, dhs_status, duration__in__clupi_switchon_start);
        clupi_op_set_SM : Clupi_SM(next(act_clupi_switchon.generatedEventPort__in__set_clupi_status) != act_clupi_switchon.generatedEventPort__in__set_clupi_status, next(act_clupi_switchon.generatedEventPort__in__set_clupi_power) != act_clupi_switchon.generatedEventPort__in__set_clupi_power, next(act_clupi_switchon.generatedEventPort__in__set_clupi_time_synch) != act_clupi_switchon.generatedEventPort__in__set_clupi_time_synch, next(act_clupi_switchon.generatedEventPort__in__set_clupi_imagedatatype) != act_clupi_switchon.generatedEventPort__in__set_clupi_imagedatatype, next(act_clupi_switchon.generatedEventPort__in__set_clupi_binning) != act_clupi_switchon.generatedEventPort__in__set_clupi_binning, next(act_clupi_switchon.generatedEventPort__in__set_clupi_mem_check) != act_clupi_switchon.generatedEventPort__in__set_clupi_mem_check, next(act_clupi_switchon.generatedEventPort__in__set_clupi_quantization) != act_clupi_switchon.generatedEventPort__in__set_clupi_quantization, next(act_clupi_diagnostic.generatedEventPort__in__set_clupi_status) != act_clupi_diagnostic.generatedEventPort__in__set_clupi_status, next(act_clupi_diagnostic.generatedEventPort__in__set_clupi_power) != act_clupi_diagnostic.generatedEventPort__in__set_clupi_power, next(act_clupi_diagnostic.generatedEventPort__in__set_clupi_mem_check) != act_clupi_diagnostic.generatedEventPort__in__set_clupi_mem_check, next(act_clupi_timesync.generatedEventPort__in__set_clupi_status) != act_clupi_timesync.generatedEventPort__in__set_clupi_status, next(act_clupi_timesync.generatedEventPort__in__set_clupi_power) != act_clupi_timesync.generatedEventPort__in__set_clupi_power, next(act_clupi_timesync.generatedEventPort__in__set_clupi_time_synch) != act_clupi_timesync.generatedEventPort__in__set_clupi_time_synch, next(act_clupi_acquirezscience.generatedEventPort__in__set_clupi_status) != act_clupi_acquirezscience.generatedEventPort__in__set_clupi_status, next(act_clupi_acquirezscience.generatedEventPort__in__set_clupi_power) != act_clupi_acquirezscience.generatedEventPort__in__set_clupi_power, next(act_clupi_switchoff.generatedEventPort__in__set_clupi_status) != act_clupi_switchoff.generatedEventPort__in__set_clupi_status, next(act_clupi_switchoff.generatedEventPort__in__set_clupi_power) != act_clupi_switchoff.generatedEventPort__in__set_clupi_power, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, generatedEventPort__in__set_clupi_status_rv_configurereset, generatedEventPort__in__set_clupi_power_rv_configurereset, next(act_clupi_switchon.performed__in__activityPerformedPort) != act_clupi_switchon.performed__in__activityPerformedPort, next(act_clupi_diagnostic.performed__in__activityPerformedPort) != act_clupi_diagnostic.performed__in__activityPerformedPort, next(act_clupi_timesync.performed__in__activityPerformedPort) != act_clupi_timesync.performed__in__activityPerformedPort, next(act_clupi_acquirezscience.performed__in__activityPerformedPort) != act_clupi_acquirezscience.performed__in__activityPerformedPort, next(act_clupi_switchoff.performed__in__activityPerformedPort) != act_clupi_switchoff.performed__in__activityPerformedPort, ade_left_power, ade_right_power, dhs_power, rtb_power, drill_power, imu_power, bema_power, loccam_power, dhs_status, sys_time_seconds, sys_energy_used, act_clupi_switchon.status__in__set_clupi_status, act_clupi_switchon.power__in__set_clupi_power, act_clupi_switchon.sync__in__set_clupi_time_synch, act_clupi_switchon.type__in__set_clupi_imagedatatype, act_clupi_switchon.binning__in__set_clupi_binning, act_clupi_switchon.check__in__set_clupi_mem_check, act_clupi_switchon.quantization__in__set_clupi_quantization, act_clupi_diagnostic.status__in__set_clupi_status, act_clupi_diagnostic.power__in__set_clupi_power, act_clupi_diagnostic.check__in__set_clupi_mem_check, act_clupi_timesync.status__in__set_clupi_status, act_clupi_timesync.power__in__set_clupi_power, act_clupi_timesync.sync__in__set_clupi_time_synch, act_clupi_acquirezscience.status__in__set_clupi_status, act_clupi_acquirezscience.power__in__set_clupi_power, act_clupi_switchoff.status__in__set_clupi_status, act_clupi_switchoff.power__in__set_clupi_power, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, status__in__set_clupi_status_rv_configurereset, power__in__set_clupi_power_rv_configurereset);
    DEFINE
        performed__in__clupi_switchoff_done := act_clupi_switchoff.performed__in__activityPerformedPort;
        performed__in__clupi_acquirezscience_done := act_clupi_acquirezscience.performed__in__activityPerformedPort;
        performed__in__clupi_timesync_done := act_clupi_timesync.performed__in__activityPerformedPort;
        performed__in__clupi_diagnostic_done := act_clupi_diagnostic.performed__in__activityPerformedPort;
        performed__in__clupi_switchon_done := act_clupi_switchon.performed__in__activityPerformedPort;
        generatedEventPort__in__set_sys_energy_used_switchoff := act_clupi_switchoff.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_energy_used_acquirezscience := act_clupi_acquirezscience.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_energy_used_timesync := act_clupi_timesync.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_energy_used_diagnostic := act_clupi_diagnostic.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_energy_used_switchon := act_clupi_switchon.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_switchoff := act_clupi_switchoff.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_time_seconds_acquirezscience := act_clupi_acquirezscience.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_time_seconds_timesync := act_clupi_timesync.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_time_seconds_diagnostic := act_clupi_diagnostic.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_time_seconds_switchon := act_clupi_switchon.generatedEventPort__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_switchoff := act_clupi_switchoff.status__in__set_sys_energy_used;
        status__in__set_sys_energy_used_acquirezscience := act_clupi_acquirezscience.status__in__set_sys_energy_used;
        status__in__set_sys_energy_used_timesync := act_clupi_timesync.status__in__set_sys_energy_used;
        status__in__set_sys_energy_used_diagnostic := act_clupi_diagnostic.status__in__set_sys_energy_used;
        status__in__set_sys_energy_used_switchon := act_clupi_switchon.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_switchoff := act_clupi_switchoff.status__in__set_sys_time_seconds;
        status__in__set_sys_time_seconds_acquirezscience := act_clupi_acquirezscience.status__in__set_sys_time_seconds;
        status__in__set_sys_time_seconds_timesync := act_clupi_timesync.status__in__set_sys_time_seconds;
        status__in__set_sys_time_seconds_diagnostic := act_clupi_diagnostic.status__in__set_sys_time_seconds;
        status__in__set_sys_time_seconds_switchon := act_clupi_switchon.status__in__set_sys_time_seconds;
        clupi_power := clupi_op_set_SM.clupi_power;
        clupi_quantization := clupi_op_set_SM.clupi_quantization;
        clupi_mem_check := clupi_op_set_SM.clupi_mem_check;
        clupi_binning := clupi_op_set_SM.clupi_binning;
        clupi_imagedatatype := clupi_op_set_SM.clupi_imagedatatype;
        clupi_status := clupi_op_set_SM.clupi_status;
        clupi_time_synch := clupi_op_set_SM.clupi_time_synch;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE CLUPI_SwitchOff(startEvent__in__startActivityPort, clupi_status, clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        power__in__set_clupi_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_clupi_status : boolean;
        generatedEventPort__in__set_clupi_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_CLUPI_SwitchOff_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := TRUE;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_CLUPI_SwitchOff_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_CLUPI_SwitchOff_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : CLUPI_OFF;
TRUE : status__in__set_clupi_status;
esac;

        next(power__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : power__in__set_clupi_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_status;
TRUE : generatedEventPort__in__set_clupi_status;
esac;

        next(generatedEventPort__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_power;
TRUE : generatedEventPort__in__set_clupi_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_CLUPI_SwitchOff_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE CLUPI_Diagnostic(startEvent__in__startActivityPort, clupi_status, clupi_mem_check, clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        power__in__set_clupi_power : real;
        check__in__set_clupi_mem_check : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_clupi_status : boolean;
        generatedEventPort__in__set_clupi_power : boolean;
        generatedEventPort__in__set_clupi_mem_check : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_CLUPI_Diagnostic_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := clupi_status = CLUPI_SDBY;
        getUpperBoundDuration := 10;
        getLowerBoundDuration := 10;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_CLUPI_Diagnostic_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_CLUPI_Diagnostic_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 10;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (10 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 38);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : CLUPI_SDBY;
TRUE : status__in__set_clupi_status;
esac;

        next(power__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : 6.8;
TRUE : power__in__set_clupi_power;
esac;

        next(check__in__set_clupi_mem_check) := case
Transition = _Progress_to_Idle_ : TRUE;
TRUE : check__in__set_clupi_mem_check;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_status;
TRUE : generatedEventPort__in__set_clupi_status;
esac;

        next(generatedEventPort__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_power;
TRUE : generatedEventPort__in__set_clupi_power;
esac;

        next(generatedEventPort__in__set_clupi_mem_check) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_mem_check;
TRUE : generatedEventPort__in__set_clupi_mem_check;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_CLUPI_Diagnostic_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE CLUPI_TimeSync(startEvent__in__startActivityPort, clupi_status, clupi_time_synch, clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        power__in__set_clupi_power : real;
        sync__in__set_clupi_time_synch : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_clupi_status : boolean;
        generatedEventPort__in__set_clupi_power : boolean;
        generatedEventPort__in__set_clupi_time_synch : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_CLUPI_TimeSync_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := clupi_status = CLUPI_SDBY;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_CLUPI_TimeSync_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_CLUPI_TimeSync_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : CLUPI_SDBY;
TRUE : status__in__set_clupi_status;
esac;

        next(power__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : 6.8;
TRUE : power__in__set_clupi_power;
esac;

        next(sync__in__set_clupi_time_synch) := case
Transition = _Progress_to_Idle_ : TRUE;
TRUE : sync__in__set_clupi_time_synch;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_status;
TRUE : generatedEventPort__in__set_clupi_status;
esac;

        next(generatedEventPort__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_power;
TRUE : generatedEventPort__in__set_clupi_power;
esac;

        next(generatedEventPort__in__set_clupi_time_synch) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_time_synch;
TRUE : generatedEventPort__in__set_clupi_time_synch;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_CLUPI_TimeSync_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE CLUPI_AcquireZScience(startEvent__in__startActivityPort, clupi_status, clupi_imagedatatype, clupi_mem_check, clupi_time_synch, clupi_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        power__in__set_clupi_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_clupi_status : boolean;
        generatedEventPort__in__set_clupi_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_CLUPI_AcquireZScience_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((clupi_status = CLUPI_SDBY & clupi_time_synch = TRUE) & clupi_mem_check = TRUE);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_CLUPI_AcquireZScience_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_CLUPI_AcquireZScience_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 1);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : CLUPI_SDBY;
TRUE : status__in__set_clupi_status;
esac;

        next(power__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : 6.8;
TRUE : power__in__set_clupi_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_status;
TRUE : generatedEventPort__in__set_clupi_status;
esac;

        next(generatedEventPort__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_power;
TRUE : generatedEventPort__in__set_clupi_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_CLUPI_AcquireZScience_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE CLUPI_SwitchOn(startEvent__in__startActivityPort, clupi_binning, clupi_mem_check, clupi_time_synch, clupi_status, clupi_quantization, clupi_imagedatatype, clupi_power, ade_left_power, ade_right_power, dhs_power, rtb_power, drill_power, imu_power, bema_power, loccam_power, sys_time_seconds, sys_energy_used, dhs_status, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        power__in__set_clupi_power : real;
        sync__in__set_clupi_time_synch : boolean;
        type__in__set_clupi_imagedatatype : integer;
        binning__in__set_clupi_binning : integer;
        check__in__set_clupi_mem_check : boolean;
        quantization__in__set_clupi_quantization : integer;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_clupi_status : boolean;
        generatedEventPort__in__set_clupi_power : boolean;
        generatedEventPort__in__set_clupi_time_synch : boolean;
        generatedEventPort__in__set_clupi_imagedatatype : boolean;
        generatedEventPort__in__set_clupi_binning : boolean;
        generatedEventPort__in__set_clupi_mem_check : boolean;
        generatedEventPort__in__set_clupi_quantization : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_CLUPI_SwitchOn_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (clupi_status = CLUPI_OFF & dhs_status = DHS_NOMINAL);
        getUpperBoundDuration := 15;
        getLowerBoundDuration := 15;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_CLUPI_SwitchOn_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_CLUPI_SwitchOn_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 15;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (15 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 165);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : CLUPI_SDBY;
TRUE : status__in__set_clupi_status;
esac;

        next(power__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : 6.8;
TRUE : power__in__set_clupi_power;
esac;

        next(sync__in__set_clupi_time_synch) := case
Transition = _Progress_to_Idle_ : FALSE;
TRUE : sync__in__set_clupi_time_synch;
esac;

        next(type__in__set_clupi_imagedatatype) := case
Transition = _Progress_to_Idle_ : -1;
TRUE : type__in__set_clupi_imagedatatype;
esac;

        next(binning__in__set_clupi_binning) := case
Transition = _Progress_to_Idle_ : -1;
TRUE : binning__in__set_clupi_binning;
esac;

        next(check__in__set_clupi_mem_check) := case
Transition = _Progress_to_Idle_ : FALSE;
TRUE : check__in__set_clupi_mem_check;
esac;

        next(quantization__in__set_clupi_quantization) := case
Transition = _Progress_to_Idle_ : -1;
TRUE : quantization__in__set_clupi_quantization;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_status;
TRUE : generatedEventPort__in__set_clupi_status;
esac;

        next(generatedEventPort__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_power;
TRUE : generatedEventPort__in__set_clupi_power;
esac;

        next(generatedEventPort__in__set_clupi_time_synch) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_time_synch;
TRUE : generatedEventPort__in__set_clupi_time_synch;
esac;

        next(generatedEventPort__in__set_clupi_imagedatatype) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_imagedatatype;
TRUE : generatedEventPort__in__set_clupi_imagedatatype;
esac;

        next(generatedEventPort__in__set_clupi_binning) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_binning;
TRUE : generatedEventPort__in__set_clupi_binning;
esac;

        next(generatedEventPort__in__set_clupi_mem_check) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_mem_check;
TRUE : generatedEventPort__in__set_clupi_mem_check;
esac;

        next(generatedEventPort__in__set_clupi_quantization) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_quantization;
TRUE : generatedEventPort__in__set_clupi_quantization;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_CLUPI_SwitchOn_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Clupi_SM(generatedEventPort__in__set_clupi_status_switchon, generatedEventPort__in__set_clupi_power_switchon, generatedEventPort__in__set_clupi_time_synch_switchon, generatedEventPort__in__set_clupi_imagedatatype_switchon, generatedEventPort__in__set_clupi_binning_switchon, generatedEventPort__in__set_clupi_mem_check_switchon, generatedEventPort__in__set_clupi_quantization_switchon, generatedEventPort__in__set_clupi_status_diagnostic, generatedEventPort__in__set_clupi_power_diagnostic, generatedEventPort__in__set_clupi_mem_check_diagnostic, generatedEventPort__in__set_clupi_status_timesync, generatedEventPort__in__set_clupi_power_timesync, generatedEventPort__in__set_clupi_time_synch_timesync, generatedEventPort__in__set_clupi_status_acquirezscience, generatedEventPort__in__set_clupi_power_acquirezscience, generatedEventPort__in__set_clupi_status_switchoff, generatedEventPort__in__set_clupi_power_switchoff, startEvent__in__clupi_switchon_start, startEvent__in__clupi_diagnostic_start, startEvent__in__clupi_timesync_start, startEvent__in__clupi_acquirezscience_start, startEvent__in__clupi_switchoff_start, generatedEventPort__in__set_clupi_status_rv_configurereset, generatedEventPort__in__set_clupi_power_rv_configurereset, performed__in__act_clupi_switchon_done_input, performed__in__act_clupi_diagnostic_done_input, performed__in__act_clupi_timesync_done_input, performed__in__act_clupi_acquirezscience_done_input, performed__in__act_clupi_switchoff_done_input, ade_left_power, ade_right_power, dhs_power, rtb_power, drill_power, imu_power, bema_power, loccam_power, dhs_status, sys_time_seconds, sys_energy_used, status__in__set_clupi_status_switchon, power__in__set_clupi_power_switchon, sync__in__set_clupi_time_synch_switchon, type__in__set_clupi_imagedatatype_switchon, binning__in__set_clupi_binning_switchon, check__in__set_clupi_mem_check_switchon, quantization__in__set_clupi_quantization_switchon, status__in__set_clupi_status_diagnostic, power__in__set_clupi_power_diagnostic, check__in__set_clupi_mem_check_diagnostic, status__in__set_clupi_status_timesync, power__in__set_clupi_power_timesync, sync__in__set_clupi_time_synch_timesync, status__in__set_clupi_status_acquirezscience, power__in__set_clupi_power_acquirezscience, status__in__set_clupi_status_switchoff, power__in__set_clupi_power_switchoff, duration__in__clupi_switchon_start, duration__in__clupi_diagnostic_start, duration__in__clupi_timesync_start, duration__in__clupi_acquirezscience_start, duration__in__clupi_switchoff_start, status__in__set_clupi_status_rv_configurereset, power__in__set_clupi_power_rv_configurereset)
    VAR
        State : {clupi_sdby, clupi_off, t};
        c : clock;
        clupi_time_synch : boolean;
        clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        clupi_imagedatatype : integer;
        clupi_binning : integer;
        clupi_mem_check : boolean;
        clupi_quantization : integer;
        clupi_power : real;
        status__in__set_sys_time_seconds_switchon : real;
        status__in__set_sys_time_seconds_diagnostic : real;
        status__in__set_sys_time_seconds_timesync : real;
        status__in__set_sys_time_seconds_acquirezscience : real;
        status__in__set_sys_time_seconds_switchoff : real;
        status__in__set_sys_energy_used_switchon : real;
        status__in__set_sys_energy_used_diagnostic : real;
        status__in__set_sys_energy_used_timesync : real;
        status__in__set_sys_energy_used_acquirezscience : real;
        status__in__set_sys_energy_used_switchoff : real;
        generatedEventPort__in__set_sys_time_seconds_switchon : boolean;
        generatedEventPort__in__set_sys_time_seconds_diagnostic : boolean;
        generatedEventPort__in__set_sys_time_seconds_timesync : boolean;
        generatedEventPort__in__set_sys_time_seconds_acquirezscience : boolean;
        generatedEventPort__in__set_sys_time_seconds_switchoff : boolean;
        generatedEventPort__in__set_sys_energy_used_switchon : boolean;
        generatedEventPort__in__set_sys_energy_used_diagnostic : boolean;
        generatedEventPort__in__set_sys_energy_used_timesync : boolean;
        generatedEventPort__in__set_sys_energy_used_acquirezscience : boolean;
        generatedEventPort__in__set_sys_energy_used_switchoff : boolean;
        performed__in__clupi_switchon_done : boolean;
        performed__in__clupi_diagnostic_done : boolean;
        performed__in__clupi_timesync_done : boolean;
        performed__in__clupi_acquirezscience_done : boolean;
        performed__in__clupi_switchoff_done : boolean;

    IVAR
        Transition : {clupi_switchon_durative, clupi_diagnostic_durative, clupi_timesync_durative, clupi_acquirezscience_durative, clupi_switchoff_durative, _clupi_sdby_to_clupi_sdby_, _clupi_off_to_clupi_off_, clupi_sdby_preeffects_of_act_clupi_acquirezscience, clupi_sdby_preeffects_of_act_clupi_diagnostic, clupi_sdby_preeffects_of_act_clupi_switchoff, clupi_off_preeffects_of_act_clupi_switchon, clupi_sdby_preeffects_of_act_clupi_timesync, clupi_sdby_setter_from_act_rv_configurereset, clupi_off_setter_from_act_rv_configurereset};

    FROZENVAR
        InitTransition : {_clupi_op_set_SM_to_clupi_off_};

    ASSIGN
        init(clupi_status) := case
InitTransition = _clupi_op_set_SM_to_clupi_off_ : CLUPI_OFF;
esac;
        init(clupi_imagedatatype) := case
InitTransition = _clupi_op_set_SM_to_clupi_off_ : -1;
esac;
        init(clupi_binning) := case
InitTransition = _clupi_op_set_SM_to_clupi_off_ : 0;
esac;
        init(clupi_mem_check) := case
InitTransition = _clupi_op_set_SM_to_clupi_off_ : FALSE;
esac;
        init(clupi_quantization) := case
InitTransition = _clupi_op_set_SM_to_clupi_off_ : 0;
esac;
        init(clupi_power) := case
InitTransition = _clupi_op_set_SM_to_clupi_off_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(clupi_time_synch) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_time_synch_switchon = TRUE ? next(sync__in__set_clupi_time_synch_switchon) : clupi_time_synch) ;
Transition = clupi_timesync_durative :  (generatedEventPort__in__set_clupi_time_synch_timesync = TRUE ? next(sync__in__set_clupi_time_synch_timesync) : clupi_time_synch) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_time_synch_switchon = TRUE ? next(sync__in__set_clupi_time_synch_switchon) : clupi_time_synch) ;
Transition = clupi_sdby_preeffects_of_act_clupi_timesync :  (generatedEventPort__in__set_clupi_time_synch_timesync = TRUE ? next(sync__in__set_clupi_time_synch_timesync) : clupi_time_synch) ;
TRUE : clupi_time_synch;
esac;

        next(clupi_status) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_status_switchon = TRUE ? next(status__in__set_clupi_status_switchon) : clupi_status) ;
Transition = clupi_diagnostic_durative :  (generatedEventPort__in__set_clupi_status_diagnostic = TRUE ? next(status__in__set_clupi_status_diagnostic) : clupi_status) ;
Transition = clupi_timesync_durative :  (generatedEventPort__in__set_clupi_status_timesync = TRUE ? next(status__in__set_clupi_status_timesync) : clupi_status) ;
Transition = clupi_acquirezscience_durative :  (generatedEventPort__in__set_clupi_status_acquirezscience = TRUE ? next(status__in__set_clupi_status_acquirezscience) : clupi_status) ;
Transition = clupi_switchoff_durative :  (generatedEventPort__in__set_clupi_status_switchoff = TRUE ? next(status__in__set_clupi_status_switchoff) : clupi_status) ;
Transition = clupi_sdby_preeffects_of_act_clupi_acquirezscience :  (generatedEventPort__in__set_clupi_status_acquirezscience = TRUE ? next(status__in__set_clupi_status_acquirezscience) : clupi_status) ;
Transition = clupi_sdby_preeffects_of_act_clupi_diagnostic :  (generatedEventPort__in__set_clupi_status_diagnostic = TRUE ? next(status__in__set_clupi_status_diagnostic) : clupi_status) ;
Transition = clupi_sdby_preeffects_of_act_clupi_switchoff :  (generatedEventPort__in__set_clupi_status_switchoff = TRUE ? next(status__in__set_clupi_status_switchoff) : clupi_status) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_status_switchon = TRUE ? next(status__in__set_clupi_status_switchon) : clupi_status) ;
Transition = clupi_sdby_preeffects_of_act_clupi_timesync :  (generatedEventPort__in__set_clupi_status_timesync = TRUE ? next(status__in__set_clupi_status_timesync) : clupi_status) ;
Transition = clupi_sdby_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_clupi_status_rv_configurereset = TRUE ? next(status__in__set_clupi_status_rv_configurereset) : clupi_status) ;
Transition = clupi_off_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_clupi_status_rv_configurereset = TRUE ? next(status__in__set_clupi_status_rv_configurereset) : clupi_status) ;
TRUE : clupi_status;
esac;

        next(clupi_imagedatatype) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_imagedatatype_switchon = TRUE ? next(type__in__set_clupi_imagedatatype_switchon) : clupi_imagedatatype) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_imagedatatype_switchon = TRUE ? next(type__in__set_clupi_imagedatatype_switchon) : clupi_imagedatatype) ;
TRUE : clupi_imagedatatype;
esac;

        next(clupi_binning) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_binning_switchon = TRUE ? next(binning__in__set_clupi_binning_switchon) : clupi_binning) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_binning_switchon = TRUE ? next(binning__in__set_clupi_binning_switchon) : clupi_binning) ;
TRUE : clupi_binning;
esac;

        next(clupi_mem_check) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_mem_check_switchon = TRUE ? next(check__in__set_clupi_mem_check_switchon) : clupi_mem_check) ;
Transition = clupi_diagnostic_durative :  (generatedEventPort__in__set_clupi_mem_check_diagnostic = TRUE ? next(check__in__set_clupi_mem_check_diagnostic) : clupi_mem_check) ;
Transition = clupi_sdby_preeffects_of_act_clupi_diagnostic :  (generatedEventPort__in__set_clupi_mem_check_diagnostic = TRUE ? next(check__in__set_clupi_mem_check_diagnostic) : clupi_mem_check) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_mem_check_switchon = TRUE ? next(check__in__set_clupi_mem_check_switchon) : clupi_mem_check) ;
TRUE : clupi_mem_check;
esac;

        next(clupi_quantization) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_quantization_switchon = TRUE ? next(quantization__in__set_clupi_quantization_switchon) : clupi_quantization) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_quantization_switchon = TRUE ? next(quantization__in__set_clupi_quantization_switchon) : clupi_quantization) ;
TRUE : clupi_quantization;
esac;

        next(clupi_power) := case
Transition = clupi_switchon_durative :  (generatedEventPort__in__set_clupi_power_switchon = TRUE ? next(power__in__set_clupi_power_switchon) : clupi_power) ;
Transition = clupi_diagnostic_durative :  (generatedEventPort__in__set_clupi_power_diagnostic = TRUE ? next(power__in__set_clupi_power_diagnostic) : clupi_power) ;
Transition = clupi_timesync_durative :  (generatedEventPort__in__set_clupi_power_timesync = TRUE ? next(power__in__set_clupi_power_timesync) : clupi_power) ;
Transition = clupi_acquirezscience_durative :  (generatedEventPort__in__set_clupi_power_acquirezscience = TRUE ? next(power__in__set_clupi_power_acquirezscience) : clupi_power) ;
Transition = clupi_switchoff_durative :  (generatedEventPort__in__set_clupi_power_switchoff = TRUE ? next(power__in__set_clupi_power_switchoff) : clupi_power) ;
Transition = clupi_sdby_preeffects_of_act_clupi_acquirezscience :  (generatedEventPort__in__set_clupi_power_acquirezscience = TRUE ? next(power__in__set_clupi_power_acquirezscience) : clupi_power) ;
Transition = clupi_sdby_preeffects_of_act_clupi_diagnostic :  (generatedEventPort__in__set_clupi_power_diagnostic = TRUE ? next(power__in__set_clupi_power_diagnostic) : clupi_power) ;
Transition = clupi_sdby_preeffects_of_act_clupi_switchoff :  (generatedEventPort__in__set_clupi_power_switchoff = TRUE ? next(power__in__set_clupi_power_switchoff) : clupi_power) ;
Transition = clupi_off_preeffects_of_act_clupi_switchon :  (generatedEventPort__in__set_clupi_power_switchon = TRUE ? next(power__in__set_clupi_power_switchon) : clupi_power) ;
Transition = clupi_sdby_preeffects_of_act_clupi_timesync :  (generatedEventPort__in__set_clupi_power_timesync = TRUE ? next(power__in__set_clupi_power_timesync) : clupi_power) ;
Transition = clupi_sdby_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_clupi_power_rv_configurereset = TRUE ? next(power__in__set_clupi_power_rv_configurereset) : clupi_power) ;
Transition = clupi_off_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_clupi_power_rv_configurereset = TRUE ? next(power__in__set_clupi_power_rv_configurereset) : clupi_power) ;
TRUE : clupi_power;
esac;

        next(status__in__set_sys_time_seconds_switchon) := case
TRUE : status__in__set_sys_time_seconds_switchon;
esac;

        next(status__in__set_sys_time_seconds_diagnostic) := case
TRUE : status__in__set_sys_time_seconds_diagnostic;
esac;

        next(status__in__set_sys_time_seconds_timesync) := case
TRUE : status__in__set_sys_time_seconds_timesync;
esac;

        next(status__in__set_sys_time_seconds_acquirezscience) := case
TRUE : status__in__set_sys_time_seconds_acquirezscience;
esac;

        next(status__in__set_sys_time_seconds_switchoff) := case
TRUE : status__in__set_sys_time_seconds_switchoff;
esac;

        next(status__in__set_sys_energy_used_switchon) := case
TRUE : status__in__set_sys_energy_used_switchon;
esac;

        next(status__in__set_sys_energy_used_diagnostic) := case
TRUE : status__in__set_sys_energy_used_diagnostic;
esac;

        next(status__in__set_sys_energy_used_timesync) := case
TRUE : status__in__set_sys_energy_used_timesync;
esac;

        next(status__in__set_sys_energy_used_acquirezscience) := case
TRUE : status__in__set_sys_energy_used_acquirezscience;
esac;

        next(status__in__set_sys_energy_used_switchoff) := case
TRUE : status__in__set_sys_energy_used_switchoff;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_switchon) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_switchon;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_diagnostic) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_diagnostic;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_timesync) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_timesync;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_acquirezscience) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_acquirezscience;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_switchoff) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_switchoff;
esac;

        next(generatedEventPort__in__set_sys_energy_used_switchon) := case
TRUE : generatedEventPort__in__set_sys_energy_used_switchon;
esac;

        next(generatedEventPort__in__set_sys_energy_used_diagnostic) := case
TRUE : generatedEventPort__in__set_sys_energy_used_diagnostic;
esac;

        next(generatedEventPort__in__set_sys_energy_used_timesync) := case
TRUE : generatedEventPort__in__set_sys_energy_used_timesync;
esac;

        next(generatedEventPort__in__set_sys_energy_used_acquirezscience) := case
TRUE : generatedEventPort__in__set_sys_energy_used_acquirezscience;
esac;

        next(generatedEventPort__in__set_sys_energy_used_switchoff) := case
TRUE : generatedEventPort__in__set_sys_energy_used_switchoff;
esac;

        next(performed__in__clupi_switchon_done) := case
TRUE : performed__in__clupi_switchon_done;
esac;

        next(performed__in__clupi_diagnostic_done) := case
TRUE : performed__in__clupi_diagnostic_done;
esac;

        next(performed__in__clupi_timesync_done) := case
TRUE : performed__in__clupi_timesync_done;
esac;

        next(performed__in__clupi_acquirezscience_done) := case
TRUE : performed__in__clupi_acquirezscience_done;
esac;

        next(performed__in__clupi_switchoff_done) := case
TRUE : performed__in__clupi_switchoff_done;
esac;

    INIT (InitTransition = _clupi_op_set_SM_to_clupi_off_ -> State = clupi_off);

    TRANS (Transition = clupi_switchon_durative -> (((performed__in__act_clupi_switchon_done_input = TRUE & ((((((generatedEventPort__in__set_clupi_status_switchon = TRUE | generatedEventPort__in__set_clupi_power_switchon = TRUE) | generatedEventPort__in__set_clupi_time_synch_switchon = TRUE) | generatedEventPort__in__set_clupi_imagedatatype_switchon = TRUE) | generatedEventPort__in__set_clupi_binning_switchon = TRUE) | generatedEventPort__in__set_clupi_mem_check_switchon = TRUE) | generatedEventPort__in__set_clupi_quantization_switchon = TRUE)) & State = clupi_off) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_diagnostic_durative -> (((performed__in__act_clupi_diagnostic_done_input = TRUE & ((generatedEventPort__in__set_clupi_status_diagnostic = TRUE | generatedEventPort__in__set_clupi_power_diagnostic = TRUE) | generatedEventPort__in__set_clupi_mem_check_diagnostic = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_timesync_durative -> (((performed__in__act_clupi_timesync_done_input = TRUE & ((generatedEventPort__in__set_clupi_status_timesync = TRUE | generatedEventPort__in__set_clupi_power_timesync = TRUE) | generatedEventPort__in__set_clupi_time_synch_timesync = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_acquirezscience_durative -> (((performed__in__act_clupi_acquirezscience_done_input = TRUE & (generatedEventPort__in__set_clupi_status_acquirezscience = TRUE | generatedEventPort__in__set_clupi_power_acquirezscience = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_switchoff_durative -> (((performed__in__act_clupi_switchoff_done_input = TRUE & (generatedEventPort__in__set_clupi_status_switchoff = TRUE | generatedEventPort__in__set_clupi_power_switchoff = TRUE)) & State = clupi_sdby) & next(State) = clupi_off));

    TRANS (Transition = _clupi_sdby_to_clupi_sdby_ -> ((!(((((((((((((((((((((((generatedEventPort__in__set_clupi_status_switchon = TRUE | generatedEventPort__in__set_clupi_power_switchon = TRUE) | generatedEventPort__in__set_clupi_time_synch_switchon = TRUE) | generatedEventPort__in__set_clupi_imagedatatype_switchon = TRUE) | generatedEventPort__in__set_clupi_binning_switchon = TRUE) | generatedEventPort__in__set_clupi_mem_check_switchon = TRUE) | generatedEventPort__in__set_clupi_quantization_switchon = TRUE) | generatedEventPort__in__set_clupi_status_diagnostic = TRUE) | generatedEventPort__in__set_clupi_power_diagnostic = TRUE) | generatedEventPort__in__set_clupi_mem_check_diagnostic = TRUE) | generatedEventPort__in__set_clupi_status_timesync = TRUE) | generatedEventPort__in__set_clupi_power_timesync = TRUE) | generatedEventPort__in__set_clupi_time_synch_timesync = TRUE) | generatedEventPort__in__set_clupi_status_acquirezscience = TRUE) | generatedEventPort__in__set_clupi_power_acquirezscience = TRUE) | generatedEventPort__in__set_clupi_status_switchoff = TRUE) | generatedEventPort__in__set_clupi_power_switchoff = TRUE) | generatedEventPort__in__set_clupi_status_rv_configurereset = TRUE) | generatedEventPort__in__set_clupi_power_rv_configurereset = TRUE) | performed__in__act_clupi_switchon_done_input = TRUE) | performed__in__act_clupi_diagnostic_done_input = TRUE) | performed__in__act_clupi_timesync_done_input = TRUE) | performed__in__act_clupi_acquirezscience_done_input = TRUE) | performed__in__act_clupi_switchoff_done_input = TRUE) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = _clupi_off_to_clupi_off_ -> ((!(((((((((((((((((((((((generatedEventPort__in__set_clupi_status_switchon = TRUE | generatedEventPort__in__set_clupi_power_switchon = TRUE) | generatedEventPort__in__set_clupi_time_synch_switchon = TRUE) | generatedEventPort__in__set_clupi_imagedatatype_switchon = TRUE) | generatedEventPort__in__set_clupi_binning_switchon = TRUE) | generatedEventPort__in__set_clupi_mem_check_switchon = TRUE) | generatedEventPort__in__set_clupi_quantization_switchon = TRUE) | generatedEventPort__in__set_clupi_status_diagnostic = TRUE) | generatedEventPort__in__set_clupi_power_diagnostic = TRUE) | generatedEventPort__in__set_clupi_mem_check_diagnostic = TRUE) | generatedEventPort__in__set_clupi_status_timesync = TRUE) | generatedEventPort__in__set_clupi_power_timesync = TRUE) | generatedEventPort__in__set_clupi_time_synch_timesync = TRUE) | generatedEventPort__in__set_clupi_status_acquirezscience = TRUE) | generatedEventPort__in__set_clupi_power_acquirezscience = TRUE) | generatedEventPort__in__set_clupi_status_switchoff = TRUE) | generatedEventPort__in__set_clupi_power_switchoff = TRUE) | generatedEventPort__in__set_clupi_status_rv_configurereset = TRUE) | generatedEventPort__in__set_clupi_power_rv_configurereset = TRUE) | performed__in__act_clupi_switchon_done_input = TRUE) | performed__in__act_clupi_diagnostic_done_input = TRUE) | performed__in__act_clupi_timesync_done_input = TRUE) | performed__in__act_clupi_acquirezscience_done_input = TRUE) | performed__in__act_clupi_switchoff_done_input = TRUE) & State = clupi_off) & next(State) = clupi_off));

    TRANS (Transition = clupi_sdby_preeffects_of_act_clupi_acquirezscience -> (((startEvent__in__clupi_acquirezscience_start = TRUE & (generatedEventPort__in__set_clupi_status_acquirezscience = TRUE | generatedEventPort__in__set_clupi_power_acquirezscience = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_sdby_preeffects_of_act_clupi_diagnostic -> (((startEvent__in__clupi_diagnostic_start = TRUE & ((generatedEventPort__in__set_clupi_status_diagnostic = TRUE | generatedEventPort__in__set_clupi_power_diagnostic = TRUE) | generatedEventPort__in__set_clupi_mem_check_diagnostic = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_sdby_preeffects_of_act_clupi_switchoff -> (((startEvent__in__clupi_switchoff_start = TRUE & (generatedEventPort__in__set_clupi_status_switchoff = TRUE | generatedEventPort__in__set_clupi_power_switchoff = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_off_preeffects_of_act_clupi_switchon -> (((startEvent__in__clupi_switchon_start = TRUE & ((((((generatedEventPort__in__set_clupi_status_switchon = TRUE | generatedEventPort__in__set_clupi_power_switchon = TRUE) | generatedEventPort__in__set_clupi_time_synch_switchon = TRUE) | generatedEventPort__in__set_clupi_imagedatatype_switchon = TRUE) | generatedEventPort__in__set_clupi_binning_switchon = TRUE) | generatedEventPort__in__set_clupi_mem_check_switchon = TRUE) | generatedEventPort__in__set_clupi_quantization_switchon = TRUE)) & State = clupi_off) & next(State) = clupi_off));

    TRANS (Transition = clupi_sdby_preeffects_of_act_clupi_timesync -> (((startEvent__in__clupi_timesync_start = TRUE & ((generatedEventPort__in__set_clupi_status_timesync = TRUE | generatedEventPort__in__set_clupi_power_timesync = TRUE) | generatedEventPort__in__set_clupi_time_synch_timesync = TRUE)) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_sdby_setter_from_act_rv_configurereset -> (((generatedEventPort__in__set_clupi_status_rv_configurereset = TRUE | generatedEventPort__in__set_clupi_power_rv_configurereset = TRUE) & State = clupi_sdby) & next(State) = clupi_sdby));

    TRANS (Transition = clupi_off_setter_from_act_rv_configurereset -> (((generatedEventPort__in__set_clupi_status_rv_configurereset = TRUE | generatedEventPort__in__set_clupi_power_rv_configurereset = TRUE) & State = clupi_off) & next(State) = clupi_off));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Rover(startEvent__in__rv_wakeup_start, startEvent__in__rv_prepare4night_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup, generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset, generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel, generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science, generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime, generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night, generatedEventPort__in__set_sys_energy_used_act_rv_wakeup, generatedEventPort__in__set_sys_energy_used_act_rv_configurereset, generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel, generatedEventPort__in__set_sys_energy_used_act_rv_configure4science, generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime, generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night, generatedEventPort__in__set_sys_time_seconds_act_ades_activate, generatedEventPort__in__set_sys_energy_used_act_ades_activate, generatedEventPort__in__set_sys_time_seconds_act_rtb_switchon, generatedEventPort__in__set_sys_energy_used_act_rtb_switchon, generatedEventPort__in__set_sys_time_seconds_act_rtb_switchoff, generatedEventPort__in__set_sys_energy_used_act_rtb_switchoff, generatedEventPort__in__set_sys_time_seconds_loccam_initialise, generatedEventPort__in__set_sys_energy_used_loccam_initialise, generatedEventPort__in__set_sys_time_seconds_imu_initialise, generatedEventPort__in__set_sys_energy_used_imu_initialise, generatedEventPort__in__set_sys_time_seconds_gnc_updateheading, generatedEventPort__in__set_sys_energy_used_gnc_updateheading, generatedEventPort__in__set_sys_time_seconds_gnc_updateposition, generatedEventPort__in__set_sys_energy_used_gnc_updateposition, generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight, generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight, generatedEventPort__in__set_sys_time_seconds_bema_initialise, generatedEventPort__in__set_sys_energy_used_bema_initialise, generatedEventPort__in__set_sys_time_seconds_deliver_sample, generatedEventPort__in__set_sys_energy_used_deliver_sample, generatedEventPort__in__set_sys_time_seconds_drill_positioner_move, generatedEventPort__in__set_sys_energy_used_drill_positioner_move, generatedEventPort__in__set_sys_time_seconds_drill_1, generatedEventPort__in__set_sys_energy_used_drill_1, generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize, generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize, generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon, generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon, generatedEventPort__in__set_sys_time_seconds_drill_initialize, generatedEventPort__in__set_sys_energy_used_drill_initialize, generatedEventPort__in__set_sys_time_seconds_collect_sample, generatedEventPort__in__set_sys_energy_used_collect_sample, generatedEventPort__in__set_sys_time_seconds_reduced2nominal, generatedEventPort__in__set_sys_energy_used_reduced2nominal, generatedEventPort__in__set_sys_time_seconds_reduced2highpwr, generatedEventPort__in__set_sys_energy_used_reduced2highpwr, generatedEventPort__in__set_sys_time_seconds_switchon, generatedEventPort__in__set_sys_energy_used_switchon, generatedEventPort__in__set_sys_time_seconds_diagnostic, generatedEventPort__in__set_sys_energy_used_diagnostic, generatedEventPort__in__set_sys_time_seconds_timesync, generatedEventPort__in__set_sys_energy_used_timesync, generatedEventPort__in__set_sys_time_seconds_acquirezscience, generatedEventPort__in__set_sys_energy_used_acquirezscience, generatedEventPort__in__set_sys_time_seconds_switchoff, generatedEventPort__in__set_sys_energy_used_switchoff, generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff, generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff, generatedEventPort__in__set_sys_time_seconds_gotospds, generatedEventPort__in__set_sys_energy_used_gotospds, generatedEventPort__in__set_sys_time_seconds_end_of_spds, generatedEventPort__in__set_sys_energy_used_end_of_spds, generatedEventPort__in__set_sys_time_seconds_spds_homing, generatedEventPort__in__set_sys_energy_used_spds_homing, generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample, navcam_status, bema_status, loccam_status, ade_left_status, imu_status, clupi_status, dhs_status, drill_status, rtb_status, ade_right_status, rtb_power, imu_power, bema_power, loccam_power, drill_power, clupi_power, dhs_power, ade_left_power, ade_right_power, duration__in__rv_wakeup_start, duration__in__rv_prepare4night_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, status__in__set_sys_time_seconds_act_rv_wakeup, status__in__set_sys_time_seconds_act_rv_configurereset, status__in__set_sys_time_seconds_act_rv_configure4travel, status__in__set_sys_time_seconds_act_rv_configure4science, status__in__set_sys_time_seconds_act_rv_mms_waitabstime, status__in__set_sys_time_seconds_act_rv_prepare4night, status__in__set_sys_energy_used_act_rv_wakeup, status__in__set_sys_energy_used_act_rv_configurereset, status__in__set_sys_energy_used_act_rv_configure4travel, status__in__set_sys_energy_used_act_rv_configure4science, status__in__set_sys_energy_used_act_rv_mms_waitabstime, status__in__set_sys_energy_used_act_rv_prepare4night, status__in__set_sys_time_seconds_act_ades_activate, status__in__set_sys_energy_used_act_ades_activate, status__in__set_sys_time_seconds_act_rtb_switchon, status__in__set_sys_energy_used_act_rtb_switchon, status__in__set_sys_time_seconds_act_rtb_switchoff, status__in__set_sys_energy_used_act_rtb_switchoff, status__in__set_sys_time_seconds_loccam_initialise, status__in__set_sys_energy_used_loccam_initialise, status__in__set_sys_time_seconds_imu_initialise, status__in__set_sys_energy_used_imu_initialise, status__in__set_sys_time_seconds_gnc_updateheading, status__in__set_sys_energy_used_gnc_updateheading, status__in__set_sys_time_seconds_gnc_updateposition, status__in__set_sys_energy_used_gnc_updateposition, status__in__set_sys_time_seconds_gnc_fpath_straight, status__in__set_sys_energy_used_gnc_fpath_straight, status__in__set_sys_time_seconds_bema_initialise, status__in__set_sys_energy_used_bema_initialise, status__in__set_sys_time_seconds_deliver_sample, status__in__set_sys_energy_used_deliver_sample, status__in__set_sys_time_seconds_drill_positioner_move, status__in__set_sys_energy_used_drill_positioner_move, status__in__set_sys_time_seconds_drill_1, status__in__set_sys_energy_used_drill_1, status__in__set_sys_time_seconds_drill_dbe_initialize, status__in__set_sys_energy_used_drill_dbe_initialize, status__in__set_sys_time_seconds_drillandspds_ceswitchon, status__in__set_sys_energy_used_drillandspds_ceswitchon, status__in__set_sys_time_seconds_drill_initialize, status__in__set_sys_energy_used_drill_initialize, status__in__set_sys_time_seconds_collect_sample, status__in__set_sys_energy_used_collect_sample, status__in__set_sys_time_seconds_reduced2nominal, status__in__set_sys_energy_used_reduced2nominal, status__in__set_sys_time_seconds_reduced2highpwr, status__in__set_sys_energy_used_reduced2highpwr, status__in__set_sys_time_seconds_switchon, status__in__set_sys_energy_used_switchon, status__in__set_sys_time_seconds_diagnostic, status__in__set_sys_energy_used_diagnostic, status__in__set_sys_time_seconds_timesync, status__in__set_sys_energy_used_timesync, status__in__set_sys_time_seconds_acquirezscience, status__in__set_sys_energy_used_acquirezscience, status__in__set_sys_time_seconds_switchoff, status__in__set_sys_energy_used_switchoff, status__in__set_sys_time_seconds_drill_dbe_switchoff, status__in__set_sys_energy_used_drill_dbe_switchoff, status__in__set_sys_time_seconds_gotospds, status__in__set_sys_energy_used_gotospds, status__in__set_sys_time_seconds_end_of_spds, status__in__set_sys_energy_used_end_of_spds, status__in__set_sys_time_seconds_spds_homing, status__in__set_sys_energy_used_spds_homing, status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, status__in__set_sys_energy_used_spds_preparetoreceivedrillsample)
    VAR
        act_rv_prepare4night : RV_Prepare4Night(startEvent__in__rv_prepare4night_start, dhs_status, drill_status, rtb_status, rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, imu_power, bema_power, loccam_power, sys_time_seconds, sys_energy_used, duration__in__rv_prepare4night_start);
        rv_op_set_SM : Rover_SM(startEvent__in__rv_wakeup_start, startEvent__in__rv_prepare4night_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, next(act_rv_wakeup.generatedEventPort__in__set_sys_time_seconds) != act_rv_wakeup.generatedEventPort__in__set_sys_time_seconds, next(act_rv_configurereset.generatedEventPort__in__set_sys_time_seconds) != act_rv_configurereset.generatedEventPort__in__set_sys_time_seconds, next(act_rv_configure4travel.generatedEventPort__in__set_sys_time_seconds) != act_rv_configure4travel.generatedEventPort__in__set_sys_time_seconds, next(act_rv_configure4science.generatedEventPort__in__set_sys_time_seconds) != act_rv_configure4science.generatedEventPort__in__set_sys_time_seconds, next(act_rv_mms_waitabstime.generatedEventPort__in__set_sys_time_seconds) != act_rv_mms_waitabstime.generatedEventPort__in__set_sys_time_seconds, next(act_rv_prepare4night.generatedEventPort__in__set_sys_time_seconds) != act_rv_prepare4night.generatedEventPort__in__set_sys_time_seconds, next(act_rv_wakeup.generatedEventPort__in__set_sys_energy_used) != act_rv_wakeup.generatedEventPort__in__set_sys_energy_used, next(act_rv_configurereset.generatedEventPort__in__set_sys_energy_used) != act_rv_configurereset.generatedEventPort__in__set_sys_energy_used, next(act_rv_configure4travel.generatedEventPort__in__set_sys_energy_used) != act_rv_configure4travel.generatedEventPort__in__set_sys_energy_used, next(act_rv_configure4science.generatedEventPort__in__set_sys_energy_used) != act_rv_configure4science.generatedEventPort__in__set_sys_energy_used, next(act_rv_mms_waitabstime.generatedEventPort__in__set_sys_energy_used) != act_rv_mms_waitabstime.generatedEventPort__in__set_sys_energy_used, next(act_rv_prepare4night.generatedEventPort__in__set_sys_energy_used) != act_rv_prepare4night.generatedEventPort__in__set_sys_energy_used, generatedEventPort__in__set_sys_time_seconds_act_ades_activate, generatedEventPort__in__set_sys_energy_used_act_ades_activate, generatedEventPort__in__set_sys_time_seconds_act_rtb_switchon, generatedEventPort__in__set_sys_energy_used_act_rtb_switchon, generatedEventPort__in__set_sys_time_seconds_act_rtb_switchoff, generatedEventPort__in__set_sys_energy_used_act_rtb_switchoff, generatedEventPort__in__set_sys_time_seconds_loccam_initialise, generatedEventPort__in__set_sys_energy_used_loccam_initialise, generatedEventPort__in__set_sys_time_seconds_imu_initialise, generatedEventPort__in__set_sys_energy_used_imu_initialise, generatedEventPort__in__set_sys_time_seconds_gnc_updateheading, generatedEventPort__in__set_sys_energy_used_gnc_updateheading, generatedEventPort__in__set_sys_time_seconds_gnc_updateposition, generatedEventPort__in__set_sys_energy_used_gnc_updateposition, generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight, generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight, generatedEventPort__in__set_sys_time_seconds_bema_initialise, generatedEventPort__in__set_sys_energy_used_bema_initialise, generatedEventPort__in__set_sys_time_seconds_deliver_sample, generatedEventPort__in__set_sys_energy_used_deliver_sample, generatedEventPort__in__set_sys_time_seconds_drill_positioner_move, generatedEventPort__in__set_sys_energy_used_drill_positioner_move, generatedEventPort__in__set_sys_time_seconds_drill_1, generatedEventPort__in__set_sys_energy_used_drill_1, generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize, generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize, generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon, generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon, generatedEventPort__in__set_sys_time_seconds_drill_initialize, generatedEventPort__in__set_sys_energy_used_drill_initialize, generatedEventPort__in__set_sys_time_seconds_collect_sample, generatedEventPort__in__set_sys_energy_used_collect_sample, generatedEventPort__in__set_sys_time_seconds_reduced2nominal, generatedEventPort__in__set_sys_energy_used_reduced2nominal, generatedEventPort__in__set_sys_time_seconds_reduced2highpwr, generatedEventPort__in__set_sys_energy_used_reduced2highpwr, generatedEventPort__in__set_sys_time_seconds_switchon, generatedEventPort__in__set_sys_energy_used_switchon, generatedEventPort__in__set_sys_time_seconds_diagnostic, generatedEventPort__in__set_sys_energy_used_diagnostic, generatedEventPort__in__set_sys_time_seconds_timesync, generatedEventPort__in__set_sys_energy_used_timesync, generatedEventPort__in__set_sys_time_seconds_acquirezscience, generatedEventPort__in__set_sys_energy_used_acquirezscience, generatedEventPort__in__set_sys_time_seconds_switchoff, generatedEventPort__in__set_sys_energy_used_switchoff, generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff, generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff, generatedEventPort__in__set_sys_time_seconds_gotospds, generatedEventPort__in__set_sys_energy_used_gotospds, generatedEventPort__in__set_sys_time_seconds_end_of_spds, generatedEventPort__in__set_sys_energy_used_end_of_spds, generatedEventPort__in__set_sys_time_seconds_spds_homing, generatedEventPort__in__set_sys_energy_used_spds_homing, generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample, next(act_rv_wakeup.performed__in__activityPerformedPort) != act_rv_wakeup.performed__in__activityPerformedPort, next(act_rv_configurereset.performed__in__activityPerformedPort) != act_rv_configurereset.performed__in__activityPerformedPort, next(act_rv_configure4science.performed__in__activityPerformedPort) != act_rv_configure4science.performed__in__activityPerformedPort, next(act_rv_configure4travel.performed__in__activityPerformedPort) != act_rv_configure4travel.performed__in__activityPerformedPort, next(act_rv_prepare4night.performed__in__activityPerformedPort) != act_rv_prepare4night.performed__in__activityPerformedPort, next(act_rv_mms_waitabstime.performed__in__activityPerformedPort) != act_rv_mms_waitabstime.performed__in__activityPerformedPort, navcam_status, bema_status, loccam_status, ade_left_status, imu_status, clupi_status, dhs_status, drill_status, rtb_status, ade_right_status, rtb_power, imu_power, bema_power, loccam_power, drill_power, clupi_power, dhs_power, ade_left_power, ade_right_power, duration__in__rv_wakeup_start, duration__in__rv_prepare4night_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, act_rv_wakeup.status__in__set_sys_time_seconds, act_rv_configurereset.status__in__set_sys_time_seconds, act_rv_configure4travel.status__in__set_sys_time_seconds, act_rv_configure4science.status__in__set_sys_time_seconds, act_rv_mms_waitabstime.status__in__set_sys_time_seconds, act_rv_prepare4night.status__in__set_sys_time_seconds, act_rv_wakeup.status__in__set_sys_energy_used, act_rv_configurereset.status__in__set_sys_energy_used, act_rv_configure4travel.status__in__set_sys_energy_used, act_rv_configure4science.status__in__set_sys_energy_used, act_rv_mms_waitabstime.status__in__set_sys_energy_used, act_rv_prepare4night.status__in__set_sys_energy_used, status__in__set_sys_time_seconds_act_ades_activate, status__in__set_sys_energy_used_act_ades_activate, status__in__set_sys_time_seconds_act_rtb_switchon, status__in__set_sys_energy_used_act_rtb_switchon, status__in__set_sys_time_seconds_act_rtb_switchoff, status__in__set_sys_energy_used_act_rtb_switchoff, status__in__set_sys_time_seconds_loccam_initialise, status__in__set_sys_energy_used_loccam_initialise, status__in__set_sys_time_seconds_imu_initialise, status__in__set_sys_energy_used_imu_initialise, status__in__set_sys_time_seconds_gnc_updateheading, status__in__set_sys_energy_used_gnc_updateheading, status__in__set_sys_time_seconds_gnc_updateposition, status__in__set_sys_energy_used_gnc_updateposition, status__in__set_sys_time_seconds_gnc_fpath_straight, status__in__set_sys_energy_used_gnc_fpath_straight, status__in__set_sys_time_seconds_bema_initialise, status__in__set_sys_energy_used_bema_initialise, status__in__set_sys_time_seconds_deliver_sample, status__in__set_sys_energy_used_deliver_sample, status__in__set_sys_time_seconds_drill_positioner_move, status__in__set_sys_energy_used_drill_positioner_move, status__in__set_sys_time_seconds_drill_1, status__in__set_sys_energy_used_drill_1, status__in__set_sys_time_seconds_drill_dbe_initialize, status__in__set_sys_energy_used_drill_dbe_initialize, status__in__set_sys_time_seconds_drillandspds_ceswitchon, status__in__set_sys_energy_used_drillandspds_ceswitchon, status__in__set_sys_time_seconds_drill_initialize, status__in__set_sys_energy_used_drill_initialize, status__in__set_sys_time_seconds_collect_sample, status__in__set_sys_energy_used_collect_sample, status__in__set_sys_time_seconds_reduced2nominal, status__in__set_sys_energy_used_reduced2nominal, status__in__set_sys_time_seconds_reduced2highpwr, status__in__set_sys_energy_used_reduced2highpwr, status__in__set_sys_time_seconds_switchon, status__in__set_sys_energy_used_switchon, status__in__set_sys_time_seconds_diagnostic, status__in__set_sys_energy_used_diagnostic, status__in__set_sys_time_seconds_timesync, status__in__set_sys_energy_used_timesync, status__in__set_sys_time_seconds_acquirezscience, status__in__set_sys_energy_used_acquirezscience, status__in__set_sys_time_seconds_switchoff, status__in__set_sys_energy_used_switchoff, status__in__set_sys_time_seconds_drill_dbe_switchoff, status__in__set_sys_energy_used_drill_dbe_switchoff, status__in__set_sys_time_seconds_gotospds, status__in__set_sys_energy_used_gotospds, status__in__set_sys_time_seconds_end_of_spds, status__in__set_sys_energy_used_end_of_spds, status__in__set_sys_time_seconds_spds_homing, status__in__set_sys_energy_used_spds_homing, status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, status__in__set_sys_energy_used_spds_preparetoreceivedrillsample);
        act_rv_wakeup : RV_WakeUp(startEvent__in__rv_wakeup_start, dhs_status, rv_op_set_SM.sys_time_seconds, rv_op_set_SM.sys_energy_used, rv_op_set_SM.sys_simstart_utc, rv_op_set_SM.sys_rover_longitude, rv_op_set_SM.sys_rover_latitude, duration__in__rv_wakeup_start, _act_rv_wakeup.wakeup_duration, _act_rv_wakeup.wakeup_power);
        act_rv_configure4travel : RV_Configure4Travel(startEvent__in__rv_configure4travel_start, imu_status, navcam_status, ade_right_status, loccam_status, ade_left_status, dhs_status, bema_status, rv_op_set_SM.sys_time_seconds, rv_op_set_SM.sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__rv_configure4travel_start);
        act_rv_configurereset : RV_ConfigureReset(startEvent__in__rv_configurereset_start, imu_status, navcam_status, ade_right_status, loccam_status, clupi_status, ade_left_status, dhs_status, bema_status, rv_op_set_SM.sys_time_seconds, rv_op_set_SM.sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__rv_configurereset_start);
        act_rv_mms_waitabstime : MMS_WaitAbsTime(startEvent__in__rv_mms_waitabstime_start, rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, imu_power, bema_power, loccam_power, rv_op_set_SM.sys_time_seconds, rv_op_set_SM.sys_energy_used, duration__in__rv_mms_waitabstime_start);
        act_rv_configure4science : RV_Configure4Science(startEvent__in__rv_configure4science_start, imu_status, navcam_status, ade_right_status, loccam_status, ade_left_status, dhs_status, bema_status, rv_op_set_SM.sys_time_seconds, rv_op_set_SM.sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__rv_configure4science_start);
    DEFINE
        generatedEventPort__in__set_dhs_power_prepare4night := act_rv_configure4science.generatedEventPort__in__set_dhs_power;
        generatedEventPort__in__set_bema_power_configure4science := act_rv_configure4science.generatedEventPort__in__set_bema_power;
        generatedEventPort__in__set_loccam_power_configure4science := act_rv_configure4science.generatedEventPort__in__set_loccam_power;
        generatedEventPort__in__set_imu_power_configure4science := act_rv_configure4science.generatedEventPort__in__set_imu_power;
        generatedEventPort__in__set_dhs_power_configure4science := act_rv_configure4science.generatedEventPort__in__set_dhs_power;
        generatedEventPort__in__set_bema_power_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_bema_power;
        generatedEventPort__in__set_loccam_power_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_loccam_power;
        generatedEventPort__in__set_imu_power_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_imu_power;
        generatedEventPort__in__set_dhs_power_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_dhs_power;
        generatedEventPort__in__set_bema_power_configurereset := act_rv_configurereset.generatedEventPort__in__set_bema_power;
        generatedEventPort__in__set_loccam_power_configurereset := act_rv_configurereset.generatedEventPort__in__set_loccam_power;
        generatedEventPort__in__set_imu_power_configurereset := act_rv_configurereset.generatedEventPort__in__set_imu_power;
        generatedEventPort__in__set_clupi_power_configurereset := act_rv_configurereset.generatedEventPort__in__set_clupi_power;
        generatedEventPort__in__set_dhs_power_configurereset := act_rv_configurereset.generatedEventPort__in__set_dhs_power;
        generatedEventPort__in__set_dhs_power_wakeup := act_rv_wakeup.generatedEventPort__in__set_dhs_power;
        generatedEventPort__in__set_bema_status_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_bema_status;
        generatedEventPort__in__set_loccam_status_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_loccam_status;
        generatedEventPort__in__set_navcam_status_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_navcam_status;
        generatedEventPort__in__set_imu_status_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_imu_status;
        generatedEventPort__in__set_ade_left_status_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_ade_left_status;
        generatedEventPort__in__set_ade_right_status_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_ade_right_status;
        generatedEventPort__in__set_ade_right_power_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_ade_right_power;
        generatedEventPort__in__set_ade_left_power_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_ade_left_power;
        generatedEventPort__in__set_bema_status_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_bema_status;
        generatedEventPort__in__set_loccam_status_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_loccam_status;
        generatedEventPort__in__set_navcam_status_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_navcam_status;
        generatedEventPort__in__set_imu_status_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_imu_status;
        generatedEventPort__in__set_ade_left_status_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_ade_left_status;
        generatedEventPort__in__set_ade_right_status_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_ade_right_status;
        generatedEventPort__in__set_ade_right_power_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_ade_right_power;
        generatedEventPort__in__set_ade_left_power_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_ade_left_power;
        generatedEventPort__in__set_bema_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_bema_status;
        generatedEventPort__in__set_loccam_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_loccam_status;
        generatedEventPort__in__set_navcam_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_navcam_status;
        generatedEventPort__in__set_imu_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_imu_status;
        generatedEventPort__in__set_clupi_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_clupi_status;
        generatedEventPort__in__set_ade_left_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_ade_left_status;
        generatedEventPort__in__set_ade_right_status_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_ade_right_status;
        generatedEventPort__in__set_ade_right_power_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_ade_right_power;
        generatedEventPort__in__set_ade_left_power_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_ade_left_power;
        generatedEventPort__in__set_dhs_status_act_rv_configure4travel := act_rv_configure4travel.generatedEventPort__in__set_dhs_status;
        generatedEventPort__in__set_dhs_status_act_rv_configure4science := act_rv_configure4science.generatedEventPort__in__set_dhs_status;
        generatedEventPort__in__set_dhs_status_act_rv_configurereset := act_rv_configurereset.generatedEventPort__in__set_dhs_status;
        generatedEventPort__in__set_dhs_status_act_rv_prepare4night := act_rv_prepare4night.generatedEventPort__in__set_dhs_status;
        generatedEventPort__in__set_dhs_status_act_rv_wakeup := act_rv_wakeup.generatedEventPort__in__set_dhs_status;
        performed__in__rv_mms_waitabstime_done := act_rv_mms_waitabstime.performed__in__activityPerformedPort;
        performed__in__rv_configure4travel_done := act_rv_configure4travel.performed__in__activityPerformedPort;
        performed__in__rv_configure4science_done := act_rv_configure4science.performed__in__activityPerformedPort;
        performed__in__rv_configurereset_done := act_rv_configurereset.performed__in__activityPerformedPort;
        performed__in__rv_prepare4night_done := act_rv_prepare4night.performed__in__activityPerformedPort;
        performed__in__rv_wakeup_done := act_rv_wakeup.performed__in__activityPerformedPort;
        status__in__set_dhs_power_prepare4night := act_rv_configure4science.status__in__set_dhs_power;
        status__in__set_bema_power_configure4science := act_rv_configure4science.status__in__set_bema_power;
        status__in__set_loccam_power_configure4science := act_rv_configure4science.status__in__set_loccam_power;
        status__in__set_imu_power_configure4science := act_rv_configure4science.status__in__set_imu_power;
        status__in__set_dhs_power_configure4science := act_rv_configure4science.status__in__set_dhs_power;
        status__in__set_bema_power_configure4travel := act_rv_configure4travel.status__in__set_bema_power;
        status__in__set_loccam_power_configure4travel := act_rv_configure4travel.status__in__set_loccam_power;
        status__in__set_imu_power_configure4travel := act_rv_configure4travel.status__in__set_imu_power;
        status__in__set_dhs_power_configure4travel := act_rv_configure4travel.status__in__set_dhs_power;
        status__in__set_bema_power_configurereset := act_rv_configurereset.status__in__set_bema_power;
        status__in__set_loccam_power_configurereset := act_rv_configurereset.status__in__set_loccam_power;
        status__in__set_imu_power_configurereset := act_rv_configurereset.status__in__set_imu_power;
        power__in__set_clupi_power_configurereset := act_rv_configurereset.power__in__set_clupi_power;
        status__in__set_dhs_power_configurereset := act_rv_configurereset.status__in__set_dhs_power;
        status__in__set_dhs_power_wakeup := act_rv_wakeup.status__in__set_dhs_power;
        status__in__set_bema_status_rv_configure4travel := act_rv_configure4travel.status__in__set_bema_status;
        status__in__set_loccam_status_rv_configure4travel := act_rv_configure4travel.status__in__set_loccam_status;
        status__in__set_navcam_status_rv_configure4travel := act_rv_configure4travel.status__in__set_navcam_status;
        status__in__set_imu_status_rv_configure4travel := act_rv_configure4travel.status__in__set_imu_status;
        status__in__set_ade_left_status_rv_configure4travel := act_rv_configure4travel.status__in__set_ade_left_status;
        status__in__set_ade_right_status_rv_configure4travel := act_rv_configure4travel.status__in__set_ade_right_status;
        status__in__set_ade_right_power_rv_configure4travel := act_rv_configure4travel.status__in__set_ade_right_power;
        status__in__set_ade_left_power_rv_configure4travel := act_rv_configure4travel.status__in__set_ade_left_power;
        status__in__set_bema_status_rv_configure4science := act_rv_configure4science.status__in__set_bema_status;
        status__in__set_loccam_status_rv_configure4science := act_rv_configure4science.status__in__set_loccam_status;
        status__in__set_navcam_status_rv_configure4science := act_rv_configure4science.status__in__set_navcam_status;
        status__in__set_imu_status_rv_configure4science := act_rv_configure4science.status__in__set_imu_status;
        status__in__set_ade_left_status_rv_configure4science := act_rv_configure4science.status__in__set_ade_left_status;
        status__in__set_ade_right_status_rv_configure4science := act_rv_configure4science.status__in__set_ade_right_status;
        status__in__set_ade_right_power_rv_configure4science := act_rv_configure4science.status__in__set_ade_right_power;
        status__in__set_ade_left_power_rv_configure4science := act_rv_configure4science.status__in__set_ade_left_power;
        status__in__set_bema_status_rv_configurereset := act_rv_configurereset.status__in__set_bema_status;
        status__in__set_loccam_status_rv_configurereset := act_rv_configurereset.status__in__set_loccam_status;
        status__in__set_navcam_status_rv_configurereset := act_rv_configurereset.status__in__set_navcam_status;
        status__in__set_imu_status_rv_configurereset := act_rv_configurereset.status__in__set_imu_status;
        status__in__set_clupi_status_rv_configurereset := act_rv_configurereset.status__in__set_clupi_status;
        status__in__set_ade_left_status_rv_configurereset := act_rv_configurereset.status__in__set_ade_left_status;
        status__in__set_ade_right_status_rv_configurereset := act_rv_configurereset.status__in__set_ade_right_status;
        status__in__set_ade_right_power_rv_configurereset := act_rv_configurereset.status__in__set_ade_right_power;
        status__in__set_ade_left_power_rv_configurereset := act_rv_configurereset.status__in__set_ade_left_power;
        status__in__set_dhs_status_act_rv_configure4travel := act_rv_configure4travel.status__in__set_dhs_status;
        status__in__set_dhs_status_act_rv_configure4science := act_rv_configure4science.status__in__set_dhs_status;
        status__in__set_dhs_status_act_rv_configurereset := act_rv_configurereset.status__in__set_dhs_status;
        status__in__set_dhs_status_act_rv_prepare4night := act_rv_prepare4night.status__in__set_dhs_status;
        status__in__set_dhs_status_act_rv_wakeup := act_rv_wakeup.status__in__set_dhs_status;
        sys_energy_used := rv_op_set_SM.sys_energy_used;
        sys_time_seconds := rv_op_set_SM.sys_time_seconds;
        sys_simstart_utc := rv_op_set_SM.sys_simstart_utc;
        sys_rover_latitude := rv_op_set_SM.sys_rover_latitude;
        sys_rover_longitude := rv_op_set_SM.sys_rover_longitude;
        rv_status := rv_op_set_SM.rv_status;

    FUN
        _act_rv_wakeup.wakeup_duration : real * real * real -> real;
        _act_rv_wakeup.wakeup_power : real * real * real -> real;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RV_Prepare4Night(startEvent__in__startActivityPort, dhs_status, drill_status, rtb_status, rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, imu_power, bema_power, loccam_power, sys_time_seconds, sys_energy_used, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RV_Prepare4Night_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := ((dhs_status = DHS_REDUCED & drill_status = DRILL_SPDS_OFF) & rtb_status = RTB_OFF);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RV_Prepare4Night_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RV_Prepare4Night_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_LOWPOWER;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 7.96;
TRUE : status__in__set_dhs_power;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RV_Prepare4Night_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Rover_SM(startEvent__in__rv_wakeup_start, startEvent__in__rv_prepare4night_start, startEvent__in__rv_mms_waitabstime_start, startEvent__in__rv_configurereset_start, startEvent__in__rv_configure4travel_start, startEvent__in__rv_configure4science_start, generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup, generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset, generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel, generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science, generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime, generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night, generatedEventPort__in__set_sys_energy_used_act_rv_wakeup, generatedEventPort__in__set_sys_energy_used_act_rv_configurereset, generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel, generatedEventPort__in__set_sys_energy_used_act_rv_configure4science, generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime, generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night, generatedEventPort__in__set_sys_time_seconds_act_ades_activate, generatedEventPort__in__set_sys_energy_used_act_ades_activate, generatedEventPort__in__set_sys_time_seconds_act_rtb_switchon, generatedEventPort__in__set_sys_energy_used_act_rtb_switchon, generatedEventPort__in__set_sys_time_seconds_act_rtb_switchoff, generatedEventPort__in__set_sys_energy_used_act_rtb_switchoff, generatedEventPort__in__set_sys_time_seconds_loccam_initialise, generatedEventPort__in__set_sys_energy_used_loccam_initialise, generatedEventPort__in__set_sys_time_seconds_imu_initialise, generatedEventPort__in__set_sys_energy_used_imu_initialise, generatedEventPort__in__set_sys_time_seconds_gnc_updateheading, generatedEventPort__in__set_sys_energy_used_gnc_updateheading, generatedEventPort__in__set_sys_time_seconds_gnc_updateposition, generatedEventPort__in__set_sys_energy_used_gnc_updateposition, generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight, generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight, generatedEventPort__in__set_sys_time_seconds_bema_initialise, generatedEventPort__in__set_sys_energy_used_bema_initialise, generatedEventPort__in__set_sys_time_seconds_deliver_sample, generatedEventPort__in__set_sys_energy_used_deliver_sample, generatedEventPort__in__set_sys_time_seconds_drill_positioner_move, generatedEventPort__in__set_sys_energy_used_drill_positioner_move, generatedEventPort__in__set_sys_time_seconds_drill_1, generatedEventPort__in__set_sys_energy_used_drill_1, generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize, generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize, generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon, generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon, generatedEventPort__in__set_sys_time_seconds_drill_initialize, generatedEventPort__in__set_sys_energy_used_drill_initialize, generatedEventPort__in__set_sys_time_seconds_collect_sample, generatedEventPort__in__set_sys_energy_used_collect_sample, generatedEventPort__in__set_sys_time_seconds_reduced2nominal, generatedEventPort__in__set_sys_energy_used_reduced2nominal, generatedEventPort__in__set_sys_time_seconds_reduced2highpwr, generatedEventPort__in__set_sys_energy_used_reduced2highpwr, generatedEventPort__in__set_sys_time_seconds_switchon, generatedEventPort__in__set_sys_energy_used_switchon, generatedEventPort__in__set_sys_time_seconds_diagnostic, generatedEventPort__in__set_sys_energy_used_diagnostic, generatedEventPort__in__set_sys_time_seconds_timesync, generatedEventPort__in__set_sys_energy_used_timesync, generatedEventPort__in__set_sys_time_seconds_acquirezscience, generatedEventPort__in__set_sys_energy_used_acquirezscience, generatedEventPort__in__set_sys_time_seconds_switchoff, generatedEventPort__in__set_sys_energy_used_switchoff, generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff, generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff, generatedEventPort__in__set_sys_time_seconds_gotospds, generatedEventPort__in__set_sys_energy_used_gotospds, generatedEventPort__in__set_sys_time_seconds_end_of_spds, generatedEventPort__in__set_sys_energy_used_end_of_spds, generatedEventPort__in__set_sys_time_seconds_spds_homing, generatedEventPort__in__set_sys_energy_used_spds_homing, generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample, performed__in__act_rv_wakeup_done_input, performed__in__act_rv_configurereset_done_input, performed__in__act_rv_configure4science_done_input, performed__in__act_rv_configure4travel_done_input, performed__in__act_rv_prepare4night_done_input, performed__in__act_rv_mms_waitabstime_done_input, navcam_status, bema_status, loccam_status, ade_left_status, imu_status, clupi_status, dhs_status, drill_status, rtb_status, ade_right_status, rtb_power, imu_power, bema_power, loccam_power, drill_power, clupi_power, dhs_power, ade_left_power, ade_right_power, duration__in__rv_wakeup_start, duration__in__rv_prepare4night_start, duration__in__rv_mms_waitabstime_start, duration__in__rv_configurereset_start, duration__in__rv_configure4travel_start, duration__in__rv_configure4science_start, status__in__set_sys_time_seconds_act_rv_wakeup, status__in__set_sys_time_seconds_act_rv_configurereset, status__in__set_sys_time_seconds_act_rv_configure4travel, status__in__set_sys_time_seconds_act_rv_configure4science, status__in__set_sys_time_seconds_act_rv_mms_waitabstime, status__in__set_sys_time_seconds_act_rv_prepare4night, status__in__set_sys_energy_used_act_rv_wakeup, status__in__set_sys_energy_used_act_rv_configurereset, status__in__set_sys_energy_used_act_rv_configure4travel, status__in__set_sys_energy_used_act_rv_configure4science, status__in__set_sys_energy_used_act_rv_mms_waitabstime, status__in__set_sys_energy_used_act_rv_prepare4night, status__in__set_sys_time_seconds_act_ades_activate, status__in__set_sys_energy_used_act_ades_activate, status__in__set_sys_time_seconds_act_rtb_switchon, status__in__set_sys_energy_used_act_rtb_switchon, status__in__set_sys_time_seconds_act_rtb_switchoff, status__in__set_sys_energy_used_act_rtb_switchoff, status__in__set_sys_time_seconds_loccam_initialise, status__in__set_sys_energy_used_loccam_initialise, status__in__set_sys_time_seconds_imu_initialise, status__in__set_sys_energy_used_imu_initialise, status__in__set_sys_time_seconds_gnc_updateheading, status__in__set_sys_energy_used_gnc_updateheading, status__in__set_sys_time_seconds_gnc_updateposition, status__in__set_sys_energy_used_gnc_updateposition, status__in__set_sys_time_seconds_gnc_fpath_straight, status__in__set_sys_energy_used_gnc_fpath_straight, status__in__set_sys_time_seconds_bema_initialise, status__in__set_sys_energy_used_bema_initialise, status__in__set_sys_time_seconds_deliver_sample, status__in__set_sys_energy_used_deliver_sample, status__in__set_sys_time_seconds_drill_positioner_move, status__in__set_sys_energy_used_drill_positioner_move, status__in__set_sys_time_seconds_drill_1, status__in__set_sys_energy_used_drill_1, status__in__set_sys_time_seconds_drill_dbe_initialize, status__in__set_sys_energy_used_drill_dbe_initialize, status__in__set_sys_time_seconds_drillandspds_ceswitchon, status__in__set_sys_energy_used_drillandspds_ceswitchon, status__in__set_sys_time_seconds_drill_initialize, status__in__set_sys_energy_used_drill_initialize, status__in__set_sys_time_seconds_collect_sample, status__in__set_sys_energy_used_collect_sample, status__in__set_sys_time_seconds_reduced2nominal, status__in__set_sys_energy_used_reduced2nominal, status__in__set_sys_time_seconds_reduced2highpwr, status__in__set_sys_energy_used_reduced2highpwr, status__in__set_sys_time_seconds_switchon, status__in__set_sys_energy_used_switchon, status__in__set_sys_time_seconds_diagnostic, status__in__set_sys_energy_used_diagnostic, status__in__set_sys_time_seconds_timesync, status__in__set_sys_energy_used_timesync, status__in__set_sys_time_seconds_acquirezscience, status__in__set_sys_energy_used_acquirezscience, status__in__set_sys_time_seconds_switchoff, status__in__set_sys_energy_used_switchoff, status__in__set_sys_time_seconds_drill_dbe_switchoff, status__in__set_sys_energy_used_drill_dbe_switchoff, status__in__set_sys_time_seconds_gotospds, status__in__set_sys_energy_used_gotospds, status__in__set_sys_time_seconds_end_of_spds, status__in__set_sys_energy_used_end_of_spds, status__in__set_sys_time_seconds_spds_homing, status__in__set_sys_energy_used_spds_homing, status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample, status__in__set_sys_energy_used_spds_preparetoreceivedrillsample)
    VAR
        State : {rv_ready, t};
        c : clock;
        rv_status : {RV_READY, FAKE};
        sys_rover_longitude : real;
        sys_rover_latitude : real;
        sys_simstart_utc : real;
        sys_time_seconds : real;
        sys_energy_used : real;
        status__in__set_dhs_status_act_rv_wakeup : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_status_act_rv_prepare4night : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_status_act_rv_configurereset : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_status_act_rv_configure4science : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_status_act_rv_configure4travel : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_ade_left_power_rv_configurereset : real;
        status__in__set_ade_right_power_rv_configurereset : real;
        status__in__set_ade_right_status_rv_configurereset : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status_rv_configurereset : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_clupi_status_rv_configurereset : {CLUPI_SDBY, CLUPI_OFF};
        status__in__set_imu_status_rv_configurereset : {IMU_OFF, IMU_OPERATING};
        status__in__set_navcam_status_rv_configurereset : {NAVCAM_OFF, NAVCAM_STANDBY};
        status__in__set_loccam_status_rv_configurereset : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_bema_status_rv_configurereset : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_ade_left_power_rv_configure4science : real;
        status__in__set_ade_right_power_rv_configure4science : real;
        status__in__set_ade_right_status_rv_configure4science : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status_rv_configure4science : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_imu_status_rv_configure4science : {IMU_OFF, IMU_OPERATING};
        status__in__set_navcam_status_rv_configure4science : {NAVCAM_OFF, NAVCAM_STANDBY};
        status__in__set_loccam_status_rv_configure4science : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_bema_status_rv_configure4science : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_ade_left_power_rv_configure4travel : real;
        status__in__set_ade_right_power_rv_configure4travel : real;
        status__in__set_ade_right_status_rv_configure4travel : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status_rv_configure4travel : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_imu_status_rv_configure4travel : {IMU_OFF, IMU_OPERATING};
        status__in__set_navcam_status_rv_configure4travel : {NAVCAM_OFF, NAVCAM_STANDBY};
        status__in__set_loccam_status_rv_configure4travel : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_bema_status_rv_configure4travel : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_dhs_power_wakeup : real;
        status__in__set_dhs_power_configurereset : real;
        power__in__set_clupi_power_configurereset : real;
        status__in__set_imu_power_configurereset : real;
        status__in__set_loccam_power_configurereset : real;
        status__in__set_bema_power_configurereset : real;
        status__in__set_dhs_power_configure4travel : real;
        status__in__set_imu_power_configure4travel : real;
        status__in__set_loccam_power_configure4travel : real;
        status__in__set_bema_power_configure4travel : real;
        status__in__set_dhs_power_configure4science : real;
        status__in__set_imu_power_configure4science : real;
        status__in__set_loccam_power_configure4science : real;
        status__in__set_bema_power_configure4science : real;
        status__in__set_dhs_power_prepare4night : real;
        performed__in__rv_wakeup_done : boolean;
        performed__in__rv_prepare4night_done : boolean;
        performed__in__rv_configurereset_done : boolean;
        performed__in__rv_configure4science_done : boolean;
        performed__in__rv_configure4travel_done : boolean;
        performed__in__rv_mms_waitabstime_done : boolean;
        generatedEventPort__in__set_dhs_status_act_rv_wakeup : boolean;
        generatedEventPort__in__set_dhs_status_act_rv_prepare4night : boolean;
        generatedEventPort__in__set_dhs_status_act_rv_configurereset : boolean;
        generatedEventPort__in__set_dhs_status_act_rv_configure4science : boolean;
        generatedEventPort__in__set_dhs_status_act_rv_configure4travel : boolean;
        generatedEventPort__in__set_ade_left_power_rv_configurereset : boolean;
        generatedEventPort__in__set_ade_right_power_rv_configurereset : boolean;
        generatedEventPort__in__set_ade_right_status_rv_configurereset : boolean;
        generatedEventPort__in__set_ade_left_status_rv_configurereset : boolean;
        generatedEventPort__in__set_clupi_status_rv_configurereset : boolean;
        generatedEventPort__in__set_imu_status_rv_configurereset : boolean;
        generatedEventPort__in__set_navcam_status_rv_configurereset : boolean;
        generatedEventPort__in__set_loccam_status_rv_configurereset : boolean;
        generatedEventPort__in__set_bema_status_rv_configurereset : boolean;
        generatedEventPort__in__set_ade_left_power_rv_configure4science : boolean;
        generatedEventPort__in__set_ade_right_power_rv_configure4science : boolean;
        generatedEventPort__in__set_ade_right_status_rv_configure4science : boolean;
        generatedEventPort__in__set_ade_left_status_rv_configure4science : boolean;
        generatedEventPort__in__set_imu_status_rv_configure4science : boolean;
        generatedEventPort__in__set_navcam_status_rv_configure4science : boolean;
        generatedEventPort__in__set_loccam_status_rv_configure4science : boolean;
        generatedEventPort__in__set_bema_status_rv_configure4science : boolean;
        generatedEventPort__in__set_ade_left_power_rv_configure4travel : boolean;
        generatedEventPort__in__set_ade_right_power_rv_configure4travel : boolean;
        generatedEventPort__in__set_ade_right_status_rv_configure4travel : boolean;
        generatedEventPort__in__set_ade_left_status_rv_configure4travel : boolean;
        generatedEventPort__in__set_imu_status_rv_configure4travel : boolean;
        generatedEventPort__in__set_navcam_status_rv_configure4travel : boolean;
        generatedEventPort__in__set_loccam_status_rv_configure4travel : boolean;
        generatedEventPort__in__set_bema_status_rv_configure4travel : boolean;
        generatedEventPort__in__set_dhs_power_wakeup : boolean;
        generatedEventPort__in__set_dhs_power_configurereset : boolean;
        generatedEventPort__in__set_clupi_power_configurereset : boolean;
        generatedEventPort__in__set_imu_power_configurereset : boolean;
        generatedEventPort__in__set_loccam_power_configurereset : boolean;
        generatedEventPort__in__set_bema_power_configurereset : boolean;
        generatedEventPort__in__set_dhs_power_configure4travel : boolean;
        generatedEventPort__in__set_imu_power_configure4travel : boolean;
        generatedEventPort__in__set_loccam_power_configure4travel : boolean;
        generatedEventPort__in__set_bema_power_configure4travel : boolean;
        generatedEventPort__in__set_dhs_power_configure4science : boolean;
        generatedEventPort__in__set_imu_power_configure4science : boolean;
        generatedEventPort__in__set_loccam_power_configure4science : boolean;
        generatedEventPort__in__set_bema_power_configure4science : boolean;
        generatedEventPort__in__set_dhs_power_prepare4night : boolean;

    IVAR
        Transition : {rv_wakeup_durative, rv_configurereset_durative, rv_configure4science_durative, rv_configure4travel_durative, rv_prepare4night_durative, rv_mms_waitabstime_durative, _rv_ready_to_rv_ready_, rv_ready_setter_from_act_ades_activate, rv_ready_setter_from_act_bema_initialise, rv_ready_setter_from_act_clupi_acquirezscience, rv_ready_setter_from_act_clupi_diagnostic, rv_ready_setter_from_act_clupi_switchoff, rv_ready_setter_from_act_clupi_switchon, rv_ready_setter_from_act_clupi_timesync, rv_ready_setter_from_act_collect_sample, rv_ready_setter_from_act_deliver_sample, rv_ready_setter_from_act_dhs_reduced2highpwr, rv_ready_setter_from_act_dhs_reduced2nominal, rv_ready_setter_from_act_drill_1, rv_ready_setter_from_act_drill_dbe_initialize, rv_ready_setter_from_act_drill_dbe_switchoff, rv_ready_setter_from_act_drill_initialize, rv_ready_setter_from_act_drill_positioner_move, rv_ready_setter_from_act_drillandspds_ceswitchon, rv_ready_setter_from_act_end_of_spds, rv_ready_setter_from_act_gnc_fpath_straight, rv_ready_setter_from_act_gnc_updateheading, rv_ready_setter_from_act_gnc_updateposition, rv_ready_setter_from_act_gotospds, rv_ready_setter_from_act_imu_initialise, rv_ready_setter_from_act_loccam_initialise, rv_ready_setter_from_act_rtb_switchoff, rv_ready_setter_from_act_rtb_switchon, rv_ready_preeffects_of_act_rv_configure4science, rv_ready_preeffects_of_act_rv_configure4travel, rv_ready_preeffects_of_act_rv_configurereset, rv_ready_preeffects_of_act_rv_mms_waitabstime, rv_ready_preeffects_of_act_rv_prepare4night, rv_ready_preeffects_of_act_rv_wakeup, rv_ready_setter_from_act_spds_homing, rv_ready_setter_from_act_spds_preparetoreceivedrillsample};

    FROZENVAR
        InitTransition : {_rv_op_set_SM_to_rv_ready_};

    ASSIGN
        init(rv_status) := case
InitTransition = _rv_op_set_SM_to_rv_ready_ : RV_READY;
esac;
        init(sys_rover_longitude) := case
InitTransition = _rv_op_set_SM_to_rv_ready_ : -24.55;
esac;
        init(sys_rover_latitude) := case
InitTransition = _rv_op_set_SM_to_rv_ready_ : 25;
esac;
        init(sys_time_seconds) := case
InitTransition = _rv_op_set_SM_to_rv_ready_ : 0;
esac;
        init(sys_energy_used) := case
InitTransition = _rv_op_set_SM_to_rv_ready_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(rv_status) := case
TRUE : rv_status;
esac;

        next(sys_rover_longitude) := case
TRUE : sys_rover_longitude;
esac;

        next(sys_rover_latitude) := case
TRUE : sys_rover_latitude;
esac;

        next(sys_simstart_utc) := case
TRUE : sys_simstart_utc;
esac;

        next(sys_time_seconds) := case
Transition = rv_wakeup_durative :  (generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup = TRUE ? next(status__in__set_sys_time_seconds_act_rv_wakeup) : sys_time_seconds) ;
Transition = rv_configurereset_durative :  (generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset = TRUE ? next(status__in__set_sys_time_seconds_act_rv_configurereset) : sys_time_seconds) ;
Transition = rv_configure4science_durative :  (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science = TRUE ? next(status__in__set_sys_time_seconds_act_rv_configure4science) : sys_time_seconds) ;
Transition = rv_configure4travel_durative :  (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel = TRUE ? next(status__in__set_sys_time_seconds_act_rv_configure4travel) : sys_time_seconds) ;
Transition = rv_prepare4night_durative :  (generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night = TRUE ? next(status__in__set_sys_time_seconds_act_rv_prepare4night) : sys_time_seconds) ;
Transition = rv_mms_waitabstime_durative :  (generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime = TRUE ? next(status__in__set_sys_time_seconds_act_rv_mms_waitabstime) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_ades_activate :  (generatedEventPort__in__set_sys_time_seconds_act_ades_activate = TRUE ? next(status__in__set_sys_time_seconds_act_ades_activate) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_bema_initialise :  (generatedEventPort__in__set_sys_time_seconds_bema_initialise = TRUE ? next(status__in__set_sys_time_seconds_bema_initialise) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_clupi_acquirezscience :  (generatedEventPort__in__set_sys_time_seconds_acquirezscience = TRUE ? next(status__in__set_sys_time_seconds_acquirezscience) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_clupi_diagnostic :  (generatedEventPort__in__set_sys_time_seconds_diagnostic = TRUE ? next(status__in__set_sys_time_seconds_diagnostic) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_clupi_switchoff :  (generatedEventPort__in__set_sys_time_seconds_switchoff = TRUE ? next(status__in__set_sys_time_seconds_switchoff) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_clupi_switchon :  (generatedEventPort__in__set_sys_time_seconds_switchon = TRUE ? next(status__in__set_sys_time_seconds_switchon) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_clupi_timesync :  (generatedEventPort__in__set_sys_time_seconds_timesync = TRUE ? next(status__in__set_sys_time_seconds_timesync) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_collect_sample :  (generatedEventPort__in__set_sys_time_seconds_collect_sample = TRUE ? next(status__in__set_sys_time_seconds_collect_sample) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_deliver_sample :  (generatedEventPort__in__set_sys_time_seconds_deliver_sample = TRUE ? next(status__in__set_sys_time_seconds_deliver_sample) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_dhs_reduced2highpwr :  (generatedEventPort__in__set_sys_time_seconds_reduced2highpwr = TRUE ? next(status__in__set_sys_time_seconds_reduced2highpwr) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_dhs_reduced2nominal :  (generatedEventPort__in__set_sys_time_seconds_reduced2nominal = TRUE ? next(status__in__set_sys_time_seconds_reduced2nominal) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_drill_1 :  (generatedEventPort__in__set_sys_time_seconds_drill_1 = TRUE ? next(status__in__set_sys_time_seconds_drill_1) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_drill_dbe_initialize :  (generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize = TRUE ? next(status__in__set_sys_time_seconds_drill_dbe_initialize) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_drill_dbe_switchoff :  (generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff = TRUE ? next(status__in__set_sys_time_seconds_drill_dbe_switchoff) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_drill_initialize :  (generatedEventPort__in__set_sys_time_seconds_drill_initialize = TRUE ? next(status__in__set_sys_time_seconds_drill_initialize) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_drill_positioner_move :  (generatedEventPort__in__set_sys_time_seconds_drill_positioner_move = TRUE ? next(status__in__set_sys_time_seconds_drill_positioner_move) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_drillandspds_ceswitchon :  (generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon = TRUE ? next(status__in__set_sys_time_seconds_drillandspds_ceswitchon) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_end_of_spds :  (generatedEventPort__in__set_sys_time_seconds_end_of_spds = TRUE ? next(status__in__set_sys_time_seconds_end_of_spds) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_gnc_fpath_straight :  (generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight = TRUE ? next(status__in__set_sys_time_seconds_gnc_fpath_straight) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_gnc_updateheading :  (generatedEventPort__in__set_sys_time_seconds_gnc_updateheading = TRUE ? next(status__in__set_sys_time_seconds_gnc_updateheading) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_gnc_updateposition :  (generatedEventPort__in__set_sys_time_seconds_gnc_updateposition = TRUE ? next(status__in__set_sys_time_seconds_gnc_updateposition) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_gotospds :  (generatedEventPort__in__set_sys_time_seconds_gotospds = TRUE ? next(status__in__set_sys_time_seconds_gotospds) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_imu_initialise :  (generatedEventPort__in__set_sys_time_seconds_imu_initialise = TRUE ? next(status__in__set_sys_time_seconds_imu_initialise) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_loccam_initialise :  (generatedEventPort__in__set_sys_time_seconds_loccam_initialise = TRUE ? next(status__in__set_sys_time_seconds_loccam_initialise) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_rtb_switchoff :  (generatedEventPort__in__set_sys_time_seconds_act_rtb_switchoff = TRUE ? next(status__in__set_sys_time_seconds_act_rtb_switchoff) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_rtb_switchon :  (generatedEventPort__in__set_sys_time_seconds_act_rtb_switchon = TRUE ? next(status__in__set_sys_time_seconds_act_rtb_switchon) : sys_time_seconds) ;
Transition = rv_ready_preeffects_of_act_rv_configure4science :  (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science = TRUE ? next(status__in__set_sys_time_seconds_act_rv_configure4science) : sys_time_seconds) ;
Transition = rv_ready_preeffects_of_act_rv_configure4travel :  (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel = TRUE ? next(status__in__set_sys_time_seconds_act_rv_configure4travel) : sys_time_seconds) ;
Transition = rv_ready_preeffects_of_act_rv_configurereset :  (generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset = TRUE ? next(status__in__set_sys_time_seconds_act_rv_configurereset) : sys_time_seconds) ;
Transition = rv_ready_preeffects_of_act_rv_mms_waitabstime :  (generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime = TRUE ? next(status__in__set_sys_time_seconds_act_rv_mms_waitabstime) : sys_time_seconds) ;
Transition = rv_ready_preeffects_of_act_rv_prepare4night :  (generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night = TRUE ? next(status__in__set_sys_time_seconds_act_rv_prepare4night) : sys_time_seconds) ;
Transition = rv_ready_preeffects_of_act_rv_wakeup :  (generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup = TRUE ? next(status__in__set_sys_time_seconds_act_rv_wakeup) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_spds_homing :  (generatedEventPort__in__set_sys_time_seconds_spds_homing = TRUE ? next(status__in__set_sys_time_seconds_spds_homing) : sys_time_seconds) ;
Transition = rv_ready_setter_from_act_spds_preparetoreceivedrillsample :  (generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample = TRUE ? next(status__in__set_sys_time_seconds_spds_preparetoreceivedrillsample) : sys_time_seconds) ;
TRUE : sys_time_seconds;
esac;

        next(sys_energy_used) := case
Transition = rv_wakeup_durative :  (generatedEventPort__in__set_sys_energy_used_act_rv_wakeup = TRUE ? next(status__in__set_sys_energy_used_act_rv_wakeup) : sys_energy_used) ;
Transition = rv_configurereset_durative :  (generatedEventPort__in__set_sys_energy_used_act_rv_configurereset = TRUE ? next(status__in__set_sys_energy_used_act_rv_configurereset) : sys_energy_used) ;
Transition = rv_configure4science_durative :  (generatedEventPort__in__set_sys_energy_used_act_rv_configure4science = TRUE ? next(status__in__set_sys_energy_used_act_rv_configure4science) : sys_energy_used) ;
Transition = rv_configure4travel_durative :  (generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel = TRUE ? next(status__in__set_sys_energy_used_act_rv_configure4travel) : sys_energy_used) ;
Transition = rv_prepare4night_durative :  (generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night = TRUE ? next(status__in__set_sys_energy_used_act_rv_prepare4night) : sys_energy_used) ;
Transition = rv_mms_waitabstime_durative :  (generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime = TRUE ? next(status__in__set_sys_energy_used_act_rv_mms_waitabstime) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_ades_activate :  (generatedEventPort__in__set_sys_energy_used_act_ades_activate = TRUE ? next(status__in__set_sys_energy_used_act_ades_activate) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_bema_initialise :  (generatedEventPort__in__set_sys_energy_used_bema_initialise = TRUE ? next(status__in__set_sys_energy_used_bema_initialise) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_clupi_acquirezscience :  (generatedEventPort__in__set_sys_energy_used_acquirezscience = TRUE ? next(status__in__set_sys_energy_used_acquirezscience) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_clupi_diagnostic :  (generatedEventPort__in__set_sys_energy_used_diagnostic = TRUE ? next(status__in__set_sys_energy_used_diagnostic) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_clupi_switchoff :  (generatedEventPort__in__set_sys_energy_used_switchoff = TRUE ? next(status__in__set_sys_energy_used_switchoff) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_clupi_switchon :  (generatedEventPort__in__set_sys_energy_used_switchon = TRUE ? next(status__in__set_sys_energy_used_switchon) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_clupi_timesync :  (generatedEventPort__in__set_sys_energy_used_timesync = TRUE ? next(status__in__set_sys_energy_used_timesync) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_collect_sample :  (generatedEventPort__in__set_sys_energy_used_collect_sample = TRUE ? next(status__in__set_sys_energy_used_collect_sample) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_deliver_sample :  (generatedEventPort__in__set_sys_energy_used_deliver_sample = TRUE ? next(status__in__set_sys_energy_used_deliver_sample) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_dhs_reduced2highpwr :  (generatedEventPort__in__set_sys_energy_used_reduced2highpwr = TRUE ? next(status__in__set_sys_energy_used_reduced2highpwr) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_dhs_reduced2nominal :  (generatedEventPort__in__set_sys_energy_used_reduced2nominal = TRUE ? next(status__in__set_sys_energy_used_reduced2nominal) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_drill_1 :  (generatedEventPort__in__set_sys_energy_used_drill_1 = TRUE ? next(status__in__set_sys_energy_used_drill_1) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_drill_dbe_initialize :  (generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize = TRUE ? next(status__in__set_sys_energy_used_drill_dbe_initialize) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_drill_dbe_switchoff :  (generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff = TRUE ? next(status__in__set_sys_energy_used_drill_dbe_switchoff) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_drill_initialize :  (generatedEventPort__in__set_sys_energy_used_drill_initialize = TRUE ? next(status__in__set_sys_energy_used_drill_initialize) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_drill_positioner_move :  (generatedEventPort__in__set_sys_energy_used_drill_positioner_move = TRUE ? next(status__in__set_sys_energy_used_drill_positioner_move) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_drillandspds_ceswitchon :  (generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon = TRUE ? next(status__in__set_sys_energy_used_drillandspds_ceswitchon) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_end_of_spds :  (generatedEventPort__in__set_sys_energy_used_end_of_spds = TRUE ? next(status__in__set_sys_energy_used_end_of_spds) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_gnc_fpath_straight :  (generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight = TRUE ? next(status__in__set_sys_energy_used_gnc_fpath_straight) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_gnc_updateheading :  (generatedEventPort__in__set_sys_energy_used_gnc_updateheading = TRUE ? next(status__in__set_sys_energy_used_gnc_updateheading) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_gnc_updateposition :  (generatedEventPort__in__set_sys_energy_used_gnc_updateposition = TRUE ? next(status__in__set_sys_energy_used_gnc_updateposition) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_gotospds :  (generatedEventPort__in__set_sys_energy_used_gotospds = TRUE ? next(status__in__set_sys_energy_used_gotospds) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_imu_initialise :  (generatedEventPort__in__set_sys_energy_used_imu_initialise = TRUE ? next(status__in__set_sys_energy_used_imu_initialise) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_loccam_initialise :  (generatedEventPort__in__set_sys_energy_used_loccam_initialise = TRUE ? next(status__in__set_sys_energy_used_loccam_initialise) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_rtb_switchoff :  (generatedEventPort__in__set_sys_energy_used_act_rtb_switchoff = TRUE ? next(status__in__set_sys_energy_used_act_rtb_switchoff) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_rtb_switchon :  (generatedEventPort__in__set_sys_energy_used_act_rtb_switchon = TRUE ? next(status__in__set_sys_energy_used_act_rtb_switchon) : sys_energy_used) ;
Transition = rv_ready_preeffects_of_act_rv_configure4science :  (generatedEventPort__in__set_sys_energy_used_act_rv_configure4science = TRUE ? next(status__in__set_sys_energy_used_act_rv_configure4science) : sys_energy_used) ;
Transition = rv_ready_preeffects_of_act_rv_configure4travel :  (generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel = TRUE ? next(status__in__set_sys_energy_used_act_rv_configure4travel) : sys_energy_used) ;
Transition = rv_ready_preeffects_of_act_rv_configurereset :  (generatedEventPort__in__set_sys_energy_used_act_rv_configurereset = TRUE ? next(status__in__set_sys_energy_used_act_rv_configurereset) : sys_energy_used) ;
Transition = rv_ready_preeffects_of_act_rv_mms_waitabstime :  (generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime = TRUE ? next(status__in__set_sys_energy_used_act_rv_mms_waitabstime) : sys_energy_used) ;
Transition = rv_ready_preeffects_of_act_rv_prepare4night :  (generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night = TRUE ? next(status__in__set_sys_energy_used_act_rv_prepare4night) : sys_energy_used) ;
Transition = rv_ready_preeffects_of_act_rv_wakeup :  (generatedEventPort__in__set_sys_energy_used_act_rv_wakeup = TRUE ? next(status__in__set_sys_energy_used_act_rv_wakeup) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_spds_homing :  (generatedEventPort__in__set_sys_energy_used_spds_homing = TRUE ? next(status__in__set_sys_energy_used_spds_homing) : sys_energy_used) ;
Transition = rv_ready_setter_from_act_spds_preparetoreceivedrillsample :  (generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample = TRUE ? next(status__in__set_sys_energy_used_spds_preparetoreceivedrillsample) : sys_energy_used) ;
TRUE : sys_energy_used;
esac;

        next(status__in__set_dhs_status_act_rv_wakeup) := case
TRUE : status__in__set_dhs_status_act_rv_wakeup;
esac;

        next(status__in__set_dhs_status_act_rv_prepare4night) := case
TRUE : status__in__set_dhs_status_act_rv_prepare4night;
esac;

        next(status__in__set_dhs_status_act_rv_configurereset) := case
TRUE : status__in__set_dhs_status_act_rv_configurereset;
esac;

        next(status__in__set_dhs_status_act_rv_configure4science) := case
TRUE : status__in__set_dhs_status_act_rv_configure4science;
esac;

        next(status__in__set_dhs_status_act_rv_configure4travel) := case
TRUE : status__in__set_dhs_status_act_rv_configure4travel;
esac;

        next(status__in__set_ade_left_power_rv_configurereset) := case
TRUE : status__in__set_ade_left_power_rv_configurereset;
esac;

        next(status__in__set_ade_right_power_rv_configurereset) := case
TRUE : status__in__set_ade_right_power_rv_configurereset;
esac;

        next(status__in__set_ade_right_status_rv_configurereset) := case
TRUE : status__in__set_ade_right_status_rv_configurereset;
esac;

        next(status__in__set_ade_left_status_rv_configurereset) := case
TRUE : status__in__set_ade_left_status_rv_configurereset;
esac;

        next(status__in__set_clupi_status_rv_configurereset) := case
TRUE : status__in__set_clupi_status_rv_configurereset;
esac;

        next(status__in__set_imu_status_rv_configurereset) := case
TRUE : status__in__set_imu_status_rv_configurereset;
esac;

        next(status__in__set_navcam_status_rv_configurereset) := case
TRUE : status__in__set_navcam_status_rv_configurereset;
esac;

        next(status__in__set_loccam_status_rv_configurereset) := case
TRUE : status__in__set_loccam_status_rv_configurereset;
esac;

        next(status__in__set_bema_status_rv_configurereset) := case
TRUE : status__in__set_bema_status_rv_configurereset;
esac;

        next(status__in__set_ade_left_power_rv_configure4science) := case
TRUE : status__in__set_ade_left_power_rv_configure4science;
esac;

        next(status__in__set_ade_right_power_rv_configure4science) := case
TRUE : status__in__set_ade_right_power_rv_configure4science;
esac;

        next(status__in__set_ade_right_status_rv_configure4science) := case
TRUE : status__in__set_ade_right_status_rv_configure4science;
esac;

        next(status__in__set_ade_left_status_rv_configure4science) := case
TRUE : status__in__set_ade_left_status_rv_configure4science;
esac;

        next(status__in__set_imu_status_rv_configure4science) := case
TRUE : status__in__set_imu_status_rv_configure4science;
esac;

        next(status__in__set_navcam_status_rv_configure4science) := case
TRUE : status__in__set_navcam_status_rv_configure4science;
esac;

        next(status__in__set_loccam_status_rv_configure4science) := case
TRUE : status__in__set_loccam_status_rv_configure4science;
esac;

        next(status__in__set_bema_status_rv_configure4science) := case
TRUE : status__in__set_bema_status_rv_configure4science;
esac;

        next(status__in__set_ade_left_power_rv_configure4travel) := case
TRUE : status__in__set_ade_left_power_rv_configure4travel;
esac;

        next(status__in__set_ade_right_power_rv_configure4travel) := case
TRUE : status__in__set_ade_right_power_rv_configure4travel;
esac;

        next(status__in__set_ade_right_status_rv_configure4travel) := case
TRUE : status__in__set_ade_right_status_rv_configure4travel;
esac;

        next(status__in__set_ade_left_status_rv_configure4travel) := case
TRUE : status__in__set_ade_left_status_rv_configure4travel;
esac;

        next(status__in__set_imu_status_rv_configure4travel) := case
TRUE : status__in__set_imu_status_rv_configure4travel;
esac;

        next(status__in__set_navcam_status_rv_configure4travel) := case
TRUE : status__in__set_navcam_status_rv_configure4travel;
esac;

        next(status__in__set_loccam_status_rv_configure4travel) := case
TRUE : status__in__set_loccam_status_rv_configure4travel;
esac;

        next(status__in__set_bema_status_rv_configure4travel) := case
TRUE : status__in__set_bema_status_rv_configure4travel;
esac;

        next(status__in__set_dhs_power_wakeup) := case
TRUE : status__in__set_dhs_power_wakeup;
esac;

        next(status__in__set_dhs_power_configurereset) := case
TRUE : status__in__set_dhs_power_configurereset;
esac;

        next(power__in__set_clupi_power_configurereset) := case
TRUE : power__in__set_clupi_power_configurereset;
esac;

        next(status__in__set_imu_power_configurereset) := case
TRUE : status__in__set_imu_power_configurereset;
esac;

        next(status__in__set_loccam_power_configurereset) := case
TRUE : status__in__set_loccam_power_configurereset;
esac;

        next(status__in__set_bema_power_configurereset) := case
TRUE : status__in__set_bema_power_configurereset;
esac;

        next(status__in__set_dhs_power_configure4travel) := case
TRUE : status__in__set_dhs_power_configure4travel;
esac;

        next(status__in__set_imu_power_configure4travel) := case
TRUE : status__in__set_imu_power_configure4travel;
esac;

        next(status__in__set_loccam_power_configure4travel) := case
TRUE : status__in__set_loccam_power_configure4travel;
esac;

        next(status__in__set_bema_power_configure4travel) := case
TRUE : status__in__set_bema_power_configure4travel;
esac;

        next(status__in__set_dhs_power_configure4science) := case
TRUE : status__in__set_dhs_power_configure4science;
esac;

        next(status__in__set_imu_power_configure4science) := case
TRUE : status__in__set_imu_power_configure4science;
esac;

        next(status__in__set_loccam_power_configure4science) := case
TRUE : status__in__set_loccam_power_configure4science;
esac;

        next(status__in__set_bema_power_configure4science) := case
TRUE : status__in__set_bema_power_configure4science;
esac;

        next(status__in__set_dhs_power_prepare4night) := case
TRUE : status__in__set_dhs_power_prepare4night;
esac;

        next(performed__in__rv_wakeup_done) := case
TRUE : performed__in__rv_wakeup_done;
esac;

        next(performed__in__rv_prepare4night_done) := case
TRUE : performed__in__rv_prepare4night_done;
esac;

        next(performed__in__rv_configurereset_done) := case
TRUE : performed__in__rv_configurereset_done;
esac;

        next(performed__in__rv_configure4science_done) := case
TRUE : performed__in__rv_configure4science_done;
esac;

        next(performed__in__rv_configure4travel_done) := case
TRUE : performed__in__rv_configure4travel_done;
esac;

        next(performed__in__rv_mms_waitabstime_done) := case
TRUE : performed__in__rv_mms_waitabstime_done;
esac;

        next(generatedEventPort__in__set_dhs_status_act_rv_wakeup) := case
TRUE : generatedEventPort__in__set_dhs_status_act_rv_wakeup;
esac;

        next(generatedEventPort__in__set_dhs_status_act_rv_prepare4night) := case
TRUE : generatedEventPort__in__set_dhs_status_act_rv_prepare4night;
esac;

        next(generatedEventPort__in__set_dhs_status_act_rv_configurereset) := case
TRUE : generatedEventPort__in__set_dhs_status_act_rv_configurereset;
esac;

        next(generatedEventPort__in__set_dhs_status_act_rv_configure4science) := case
TRUE : generatedEventPort__in__set_dhs_status_act_rv_configure4science;
esac;

        next(generatedEventPort__in__set_dhs_status_act_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_dhs_status_act_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_ade_left_power_rv_configurereset) := case
TRUE : generatedEventPort__in__set_ade_left_power_rv_configurereset;
esac;

        next(generatedEventPort__in__set_ade_right_power_rv_configurereset) := case
TRUE : generatedEventPort__in__set_ade_right_power_rv_configurereset;
esac;

        next(generatedEventPort__in__set_ade_right_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_ade_right_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_ade_left_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_ade_left_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_clupi_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_clupi_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_imu_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_imu_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_navcam_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_navcam_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_loccam_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_loccam_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_bema_status_rv_configurereset) := case
TRUE : generatedEventPort__in__set_bema_status_rv_configurereset;
esac;

        next(generatedEventPort__in__set_ade_left_power_rv_configure4science) := case
TRUE : generatedEventPort__in__set_ade_left_power_rv_configure4science;
esac;

        next(generatedEventPort__in__set_ade_right_power_rv_configure4science) := case
TRUE : generatedEventPort__in__set_ade_right_power_rv_configure4science;
esac;

        next(generatedEventPort__in__set_ade_right_status_rv_configure4science) := case
TRUE : generatedEventPort__in__set_ade_right_status_rv_configure4science;
esac;

        next(generatedEventPort__in__set_ade_left_status_rv_configure4science) := case
TRUE : generatedEventPort__in__set_ade_left_status_rv_configure4science;
esac;

        next(generatedEventPort__in__set_imu_status_rv_configure4science) := case
TRUE : generatedEventPort__in__set_imu_status_rv_configure4science;
esac;

        next(generatedEventPort__in__set_navcam_status_rv_configure4science) := case
TRUE : generatedEventPort__in__set_navcam_status_rv_configure4science;
esac;

        next(generatedEventPort__in__set_loccam_status_rv_configure4science) := case
TRUE : generatedEventPort__in__set_loccam_status_rv_configure4science;
esac;

        next(generatedEventPort__in__set_bema_status_rv_configure4science) := case
TRUE : generatedEventPort__in__set_bema_status_rv_configure4science;
esac;

        next(generatedEventPort__in__set_ade_left_power_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_ade_left_power_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_ade_right_power_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_ade_right_power_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_ade_right_status_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_ade_right_status_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_ade_left_status_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_ade_left_status_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_imu_status_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_imu_status_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_navcam_status_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_navcam_status_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_loccam_status_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_loccam_status_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_bema_status_rv_configure4travel) := case
TRUE : generatedEventPort__in__set_bema_status_rv_configure4travel;
esac;

        next(generatedEventPort__in__set_dhs_power_wakeup) := case
TRUE : generatedEventPort__in__set_dhs_power_wakeup;
esac;

        next(generatedEventPort__in__set_dhs_power_configurereset) := case
TRUE : generatedEventPort__in__set_dhs_power_configurereset;
esac;

        next(generatedEventPort__in__set_clupi_power_configurereset) := case
TRUE : generatedEventPort__in__set_clupi_power_configurereset;
esac;

        next(generatedEventPort__in__set_imu_power_configurereset) := case
TRUE : generatedEventPort__in__set_imu_power_configurereset;
esac;

        next(generatedEventPort__in__set_loccam_power_configurereset) := case
TRUE : generatedEventPort__in__set_loccam_power_configurereset;
esac;

        next(generatedEventPort__in__set_bema_power_configurereset) := case
TRUE : generatedEventPort__in__set_bema_power_configurereset;
esac;

        next(generatedEventPort__in__set_dhs_power_configure4travel) := case
TRUE : generatedEventPort__in__set_dhs_power_configure4travel;
esac;

        next(generatedEventPort__in__set_imu_power_configure4travel) := case
TRUE : generatedEventPort__in__set_imu_power_configure4travel;
esac;

        next(generatedEventPort__in__set_loccam_power_configure4travel) := case
TRUE : generatedEventPort__in__set_loccam_power_configure4travel;
esac;

        next(generatedEventPort__in__set_bema_power_configure4travel) := case
TRUE : generatedEventPort__in__set_bema_power_configure4travel;
esac;

        next(generatedEventPort__in__set_dhs_power_configure4science) := case
TRUE : generatedEventPort__in__set_dhs_power_configure4science;
esac;

        next(generatedEventPort__in__set_imu_power_configure4science) := case
TRUE : generatedEventPort__in__set_imu_power_configure4science;
esac;

        next(generatedEventPort__in__set_loccam_power_configure4science) := case
TRUE : generatedEventPort__in__set_loccam_power_configure4science;
esac;

        next(generatedEventPort__in__set_bema_power_configure4science) := case
TRUE : generatedEventPort__in__set_bema_power_configure4science;
esac;

        next(generatedEventPort__in__set_dhs_power_prepare4night) := case
TRUE : generatedEventPort__in__set_dhs_power_prepare4night;
esac;

    INIT (InitTransition = _rv_op_set_SM_to_rv_ready_ -> State = rv_ready);

    TRANS (Transition = rv_wakeup_durative -> (((performed__in__act_rv_wakeup_done_input = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_wakeup = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_configurereset_durative -> (((performed__in__act_rv_configurereset_done_input = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_configurereset = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_configure4science_durative -> (((performed__in__act_rv_configure4science_done_input = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_configure4science = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_configure4travel_durative -> (((performed__in__act_rv_configure4travel_done_input = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_prepare4night_durative -> (((performed__in__act_rv_prepare4night_done_input = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_mms_waitabstime_durative -> (((performed__in__act_rv_mms_waitabstime_done_input = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = _rv_ready_to_rv_ready_ -> ((!(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup = TRUE | generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rv_wakeup = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rv_configurereset = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rv_configure4science = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_ades_activate = TRUE) | generatedEventPort__in__set_sys_energy_used_act_ades_activate = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_rtb_switchon = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rtb_switchon = TRUE) | generatedEventPort__in__set_sys_time_seconds_act_rtb_switchoff = TRUE) | generatedEventPort__in__set_sys_energy_used_act_rtb_switchoff = TRUE) | generatedEventPort__in__set_sys_time_seconds_loccam_initialise = TRUE) | generatedEventPort__in__set_sys_energy_used_loccam_initialise = TRUE) | generatedEventPort__in__set_sys_time_seconds_imu_initialise = TRUE) | generatedEventPort__in__set_sys_energy_used_imu_initialise = TRUE) | generatedEventPort__in__set_sys_time_seconds_gnc_updateheading = TRUE) | generatedEventPort__in__set_sys_energy_used_gnc_updateheading = TRUE) | generatedEventPort__in__set_sys_time_seconds_gnc_updateposition = TRUE) | generatedEventPort__in__set_sys_energy_used_gnc_updateposition = TRUE) | generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight = TRUE) | generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight = TRUE) | generatedEventPort__in__set_sys_time_seconds_bema_initialise = TRUE) | generatedEventPort__in__set_sys_energy_used_bema_initialise = TRUE) | generatedEventPort__in__set_sys_time_seconds_deliver_sample = TRUE) | generatedEventPort__in__set_sys_energy_used_deliver_sample = TRUE) | generatedEventPort__in__set_sys_time_seconds_drill_positioner_move = TRUE) | generatedEventPort__in__set_sys_energy_used_drill_positioner_move = TRUE) | generatedEventPort__in__set_sys_time_seconds_drill_1 = TRUE) | generatedEventPort__in__set_sys_energy_used_drill_1 = TRUE) | generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize = TRUE) | generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon = TRUE) | generatedEventPort__in__set_sys_time_seconds_drill_initialize = TRUE) | generatedEventPort__in__set_sys_energy_used_drill_initialize = TRUE) | generatedEventPort__in__set_sys_time_seconds_collect_sample = TRUE) | generatedEventPort__in__set_sys_energy_used_collect_sample = TRUE) | generatedEventPort__in__set_sys_time_seconds_reduced2nominal = TRUE) | generatedEventPort__in__set_sys_energy_used_reduced2nominal = TRUE) | generatedEventPort__in__set_sys_time_seconds_reduced2highpwr = TRUE) | generatedEventPort__in__set_sys_energy_used_reduced2highpwr = TRUE) | generatedEventPort__in__set_sys_time_seconds_switchon = TRUE) | generatedEventPort__in__set_sys_energy_used_switchon = TRUE) | generatedEventPort__in__set_sys_time_seconds_diagnostic = TRUE) | generatedEventPort__in__set_sys_energy_used_diagnostic = TRUE) | generatedEventPort__in__set_sys_time_seconds_timesync = TRUE) | generatedEventPort__in__set_sys_energy_used_timesync = TRUE) | generatedEventPort__in__set_sys_time_seconds_acquirezscience = TRUE) | generatedEventPort__in__set_sys_energy_used_acquirezscience = TRUE) | generatedEventPort__in__set_sys_time_seconds_switchoff = TRUE) | generatedEventPort__in__set_sys_energy_used_switchoff = TRUE) | generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff = TRUE) | generatedEventPort__in__set_sys_time_seconds_gotospds = TRUE) | generatedEventPort__in__set_sys_energy_used_gotospds = TRUE) | generatedEventPort__in__set_sys_time_seconds_end_of_spds = TRUE) | generatedEventPort__in__set_sys_energy_used_end_of_spds = TRUE) | generatedEventPort__in__set_sys_time_seconds_spds_homing = TRUE) | generatedEventPort__in__set_sys_energy_used_spds_homing = TRUE) | generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample = TRUE) | generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample = TRUE) | performed__in__act_rv_wakeup_done_input = TRUE) | performed__in__act_rv_configurereset_done_input = TRUE) | performed__in__act_rv_configure4science_done_input = TRUE) | performed__in__act_rv_configure4travel_done_input = TRUE) | performed__in__act_rv_prepare4night_done_input = TRUE) | performed__in__act_rv_mms_waitabstime_done_input = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_ades_activate -> (((generatedEventPort__in__set_sys_time_seconds_act_ades_activate = TRUE | generatedEventPort__in__set_sys_energy_used_act_ades_activate = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_bema_initialise -> (((generatedEventPort__in__set_sys_time_seconds_bema_initialise = TRUE | generatedEventPort__in__set_sys_energy_used_bema_initialise = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_clupi_acquirezscience -> (((generatedEventPort__in__set_sys_time_seconds_acquirezscience = TRUE | generatedEventPort__in__set_sys_energy_used_acquirezscience = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_clupi_diagnostic -> (((generatedEventPort__in__set_sys_time_seconds_diagnostic = TRUE | generatedEventPort__in__set_sys_energy_used_diagnostic = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_clupi_switchoff -> (((generatedEventPort__in__set_sys_time_seconds_switchoff = TRUE | generatedEventPort__in__set_sys_energy_used_switchoff = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_clupi_switchon -> (((generatedEventPort__in__set_sys_time_seconds_switchon = TRUE | generatedEventPort__in__set_sys_energy_used_switchon = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_clupi_timesync -> (((generatedEventPort__in__set_sys_time_seconds_timesync = TRUE | generatedEventPort__in__set_sys_energy_used_timesync = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_collect_sample -> (((generatedEventPort__in__set_sys_time_seconds_collect_sample = TRUE | generatedEventPort__in__set_sys_energy_used_collect_sample = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_deliver_sample -> (((generatedEventPort__in__set_sys_time_seconds_deliver_sample = TRUE | generatedEventPort__in__set_sys_energy_used_deliver_sample = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_dhs_reduced2highpwr -> (((generatedEventPort__in__set_sys_time_seconds_reduced2highpwr = TRUE | generatedEventPort__in__set_sys_energy_used_reduced2highpwr = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_dhs_reduced2nominal -> (((generatedEventPort__in__set_sys_time_seconds_reduced2nominal = TRUE | generatedEventPort__in__set_sys_energy_used_reduced2nominal = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_drill_1 -> (((generatedEventPort__in__set_sys_time_seconds_drill_1 = TRUE | generatedEventPort__in__set_sys_energy_used_drill_1 = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_drill_dbe_initialize -> (((generatedEventPort__in__set_sys_time_seconds_drill_dbe_initialize = TRUE | generatedEventPort__in__set_sys_energy_used_drill_dbe_initialize = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_drill_dbe_switchoff -> (((generatedEventPort__in__set_sys_time_seconds_drill_dbe_switchoff = TRUE | generatedEventPort__in__set_sys_energy_used_drill_dbe_switchoff = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_drill_initialize -> (((generatedEventPort__in__set_sys_time_seconds_drill_initialize = TRUE | generatedEventPort__in__set_sys_energy_used_drill_initialize = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_drill_positioner_move -> (((generatedEventPort__in__set_sys_time_seconds_drill_positioner_move = TRUE | generatedEventPort__in__set_sys_energy_used_drill_positioner_move = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_drillandspds_ceswitchon -> (((generatedEventPort__in__set_sys_time_seconds_drillandspds_ceswitchon = TRUE | generatedEventPort__in__set_sys_energy_used_drillandspds_ceswitchon = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_end_of_spds -> (((generatedEventPort__in__set_sys_time_seconds_end_of_spds = TRUE | generatedEventPort__in__set_sys_energy_used_end_of_spds = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_gnc_fpath_straight -> (((generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight = TRUE | generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_gnc_updateheading -> (((generatedEventPort__in__set_sys_time_seconds_gnc_updateheading = TRUE | generatedEventPort__in__set_sys_energy_used_gnc_updateheading = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_gnc_updateposition -> (((generatedEventPort__in__set_sys_time_seconds_gnc_updateposition = TRUE | generatedEventPort__in__set_sys_energy_used_gnc_updateposition = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_gotospds -> (((generatedEventPort__in__set_sys_time_seconds_gotospds = TRUE | generatedEventPort__in__set_sys_energy_used_gotospds = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_imu_initialise -> (((generatedEventPort__in__set_sys_time_seconds_imu_initialise = TRUE | generatedEventPort__in__set_sys_energy_used_imu_initialise = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_loccam_initialise -> (((generatedEventPort__in__set_sys_time_seconds_loccam_initialise = TRUE | generatedEventPort__in__set_sys_energy_used_loccam_initialise = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_rtb_switchoff -> (((generatedEventPort__in__set_sys_time_seconds_act_rtb_switchoff = TRUE | generatedEventPort__in__set_sys_energy_used_act_rtb_switchoff = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_rtb_switchon -> (((generatedEventPort__in__set_sys_time_seconds_act_rtb_switchon = TRUE | generatedEventPort__in__set_sys_energy_used_act_rtb_switchon = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_preeffects_of_act_rv_configure4science -> (((startEvent__in__rv_configure4science_start = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4science = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_configure4science = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_preeffects_of_act_rv_configure4travel -> (((startEvent__in__rv_configure4travel_start = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_configure4travel = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_configure4travel = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_preeffects_of_act_rv_configurereset -> (((startEvent__in__rv_configurereset_start = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_configurereset = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_configurereset = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_preeffects_of_act_rv_mms_waitabstime -> (((startEvent__in__rv_mms_waitabstime_start = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_mms_waitabstime = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_mms_waitabstime = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_preeffects_of_act_rv_prepare4night -> (((startEvent__in__rv_prepare4night_start = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_prepare4night = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_prepare4night = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_preeffects_of_act_rv_wakeup -> (((startEvent__in__rv_wakeup_start = TRUE & (generatedEventPort__in__set_sys_time_seconds_act_rv_wakeup = TRUE | generatedEventPort__in__set_sys_energy_used_act_rv_wakeup = TRUE)) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_spds_homing -> (((generatedEventPort__in__set_sys_time_seconds_spds_homing = TRUE | generatedEventPort__in__set_sys_energy_used_spds_homing = TRUE) & State = rv_ready) & next(State) = rv_ready));

    TRANS (Transition = rv_ready_setter_from_act_spds_preparetoreceivedrillsample -> (((generatedEventPort__in__set_sys_time_seconds_spds_preparetoreceivedrillsample = TRUE | generatedEventPort__in__set_sys_energy_used_spds_preparetoreceivedrillsample = TRUE) & State = rv_ready) & next(State) = rv_ready));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RV_WakeUp(startEvent__in__startActivityPort, dhs_status, sys_time_seconds, sys_energy_used, sys_simstart_utc, sys_rover_longitude, sys_rover_latitude, duration__in__startActivityPort, wakeup_duration, wakeup_power)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RV_WakeUp_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := dhs_status = DHS_LOWPOWER;
        getUpperBoundDuration := wakeup_duration(sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude);
        getLowerBoundDuration := wakeup_duration(sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude);

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RV_WakeUp_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RV_WakeUp_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_REDUCED;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 10.23;
TRUE : status__in__set_dhs_power;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + wakeup_duration(sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude);
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + wakeup_power(sys_simstart_utc + sys_time_seconds, sys_rover_longitude, sys_rover_latitude) * 3600;
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RV_WakeUp_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RV_Configure4Travel(startEvent__in__startActivityPort, imu_status, navcam_status, ade_right_status, loccam_status, ade_left_status, dhs_status, bema_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        status__in__set_ade_right_status : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_ade_left_power : real;
        status__in__set_ade_right_power : real;
        status__in__set_imu_status : {IMU_OFF, IMU_OPERATING};
        status__in__set_imu_power : real;
        status__in__set_navcam_status : {NAVCAM_OFF, NAVCAM_STANDBY};
        status__in__set_loccam_status : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_loccam_power : real;
        status__in__set_bema_status : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_bema_power : real;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        generatedEventPort__in__set_ade_right_status : boolean;
        generatedEventPort__in__set_ade_left_status : boolean;
        generatedEventPort__in__set_ade_left_power : boolean;
        generatedEventPort__in__set_ade_right_power : boolean;
        generatedEventPort__in__set_imu_status : boolean;
        generatedEventPort__in__set_imu_power : boolean;
        generatedEventPort__in__set_navcam_status : boolean;
        generatedEventPort__in__set_loccam_status : boolean;
        generatedEventPort__in__set_loccam_power : boolean;
        generatedEventPort__in__set_bema_status : boolean;
        generatedEventPort__in__set_bema_power : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RV_Configure4Travel_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := dhs_status = DHS_REDUCED;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RV_Configure4Travel_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RV_Configure4Travel_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_HIGHPOWER;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 22.49;
TRUE : status__in__set_dhs_power;
esac;

        next(status__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : ADE_RIGHT_STANDBY;
TRUE : status__in__set_ade_right_status;
esac;

        next(status__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : ADE_LEFT_STANDBY;
TRUE : status__in__set_ade_left_status;
esac;

        next(status__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : 4.05;
TRUE : status__in__set_ade_left_power;
esac;

        next(status__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : 4.05;
TRUE : status__in__set_ade_right_power;
esac;

        next(status__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : IMU_OPERATING;
TRUE : status__in__set_imu_status;
esac;

        next(status__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_imu_power;
esac;

        next(status__in__set_navcam_status) := case
Transition = _Progress_to_Idle_ : NAVCAM_OFF;
TRUE : status__in__set_navcam_status;
esac;

        next(status__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : LOCCAM_STANDBY;
TRUE : status__in__set_loccam_status;
esac;

        next(status__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_loccam_power;
esac;

        next(status__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : BEMA_STANDBY;
TRUE : status__in__set_bema_status;
esac;

        next(status__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_bema_power;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : (sys_energy_used + 1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power)) + 0;
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_status;
TRUE : generatedEventPort__in__set_ade_right_status;
esac;

        next(generatedEventPort__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_status;
TRUE : generatedEventPort__in__set_ade_left_status;
esac;

        next(generatedEventPort__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_power;
TRUE : generatedEventPort__in__set_ade_left_power;
esac;

        next(generatedEventPort__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_power;
TRUE : generatedEventPort__in__set_ade_right_power;
esac;

        next(generatedEventPort__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_status;
TRUE : generatedEventPort__in__set_imu_status;
esac;

        next(generatedEventPort__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_power;
TRUE : generatedEventPort__in__set_imu_power;
esac;

        next(generatedEventPort__in__set_navcam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_navcam_status;
TRUE : generatedEventPort__in__set_navcam_status;
esac;

        next(generatedEventPort__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_status;
TRUE : generatedEventPort__in__set_loccam_status;
esac;

        next(generatedEventPort__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_power;
TRUE : generatedEventPort__in__set_loccam_power;
esac;

        next(generatedEventPort__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_status;
TRUE : generatedEventPort__in__set_bema_status;
esac;

        next(generatedEventPort__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_power;
TRUE : generatedEventPort__in__set_bema_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RV_Configure4Travel_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RV_ConfigureReset(startEvent__in__startActivityPort, imu_status, navcam_status, ade_right_status, loccam_status, clupi_status, ade_left_status, dhs_status, bema_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        status__in__set_ade_right_status : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_ade_left_power : real;
        status__in__set_ade_right_power : real;
        status__in__set_clupi_status : {CLUPI_SDBY, CLUPI_OFF};
        power__in__set_clupi_power : real;
        status__in__set_imu_status : {IMU_OFF, IMU_OPERATING};
        status__in__set_imu_power : real;
        status__in__set_navcam_status : {NAVCAM_OFF, NAVCAM_STANDBY};
        status__in__set_loccam_status : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_loccam_power : real;
        status__in__set_bema_status : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_bema_power : real;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        generatedEventPort__in__set_ade_right_status : boolean;
        generatedEventPort__in__set_ade_left_status : boolean;
        generatedEventPort__in__set_ade_left_power : boolean;
        generatedEventPort__in__set_ade_right_power : boolean;
        generatedEventPort__in__set_clupi_status : boolean;
        generatedEventPort__in__set_clupi_power : boolean;
        generatedEventPort__in__set_imu_status : boolean;
        generatedEventPort__in__set_imu_power : boolean;
        generatedEventPort__in__set_navcam_status : boolean;
        generatedEventPort__in__set_loccam_status : boolean;
        generatedEventPort__in__set_loccam_power : boolean;
        generatedEventPort__in__set_bema_status : boolean;
        generatedEventPort__in__set_bema_power : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RV_ConfigureReset_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := clupi_status = CLUPI_OFF;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RV_ConfigureReset_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RV_ConfigureReset_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_REDUCED;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 10.23;
TRUE : status__in__set_dhs_power;
esac;

        next(status__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : ADE_RIGHT_OFF;
TRUE : status__in__set_ade_right_status;
esac;

        next(status__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : ADE_LEFT_OFF;
TRUE : status__in__set_ade_left_status;
esac;

        next(status__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_ade_left_power;
esac;

        next(status__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_ade_right_power;
esac;

        next(status__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : CLUPI_OFF;
TRUE : status__in__set_clupi_status;
esac;

        next(power__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : power__in__set_clupi_power;
esac;

        next(status__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : IMU_OFF;
TRUE : status__in__set_imu_status;
esac;

        next(status__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_imu_power;
esac;

        next(status__in__set_navcam_status) := case
Transition = _Progress_to_Idle_ : NAVCAM_OFF;
TRUE : status__in__set_navcam_status;
esac;

        next(status__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : LOCCAM_OFF;
TRUE : status__in__set_loccam_status;
esac;

        next(status__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_loccam_power;
esac;

        next(status__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : BEMA_OFF;
TRUE : status__in__set_bema_status;
esac;

        next(status__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_bema_power;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : (sys_energy_used + 1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power)) + 0;
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_status;
TRUE : generatedEventPort__in__set_ade_right_status;
esac;

        next(generatedEventPort__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_status;
TRUE : generatedEventPort__in__set_ade_left_status;
esac;

        next(generatedEventPort__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_power;
TRUE : generatedEventPort__in__set_ade_left_power;
esac;

        next(generatedEventPort__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_power;
TRUE : generatedEventPort__in__set_ade_right_power;
esac;

        next(generatedEventPort__in__set_clupi_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_status;
TRUE : generatedEventPort__in__set_clupi_status;
esac;

        next(generatedEventPort__in__set_clupi_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_clupi_power;
TRUE : generatedEventPort__in__set_clupi_power;
esac;

        next(generatedEventPort__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_status;
TRUE : generatedEventPort__in__set_imu_status;
esac;

        next(generatedEventPort__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_power;
TRUE : generatedEventPort__in__set_imu_power;
esac;

        next(generatedEventPort__in__set_navcam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_navcam_status;
TRUE : generatedEventPort__in__set_navcam_status;
esac;

        next(generatedEventPort__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_status;
TRUE : generatedEventPort__in__set_loccam_status;
esac;

        next(generatedEventPort__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_power;
TRUE : generatedEventPort__in__set_loccam_power;
esac;

        next(generatedEventPort__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_status;
TRUE : generatedEventPort__in__set_bema_status;
esac;

        next(generatedEventPort__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_power;
TRUE : generatedEventPort__in__set_bema_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RV_ConfigureReset_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE MMS_WaitAbsTime(startEvent__in__startActivityPort, rtb_power, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, imu_power, bema_power, loccam_power, sys_time_seconds, sys_energy_used, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        absolute_Time : integer;
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_MMS_WaitAbsTime_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := TRUE;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_MMS_WaitAbsTime_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_MMS_WaitAbsTime_to_Idle_ : getUpperBoundDuration;
esac;
        next(absolute_Time) := case
TRUE : absolute_Time;
esac;

        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_MMS_WaitAbsTime_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE RV_Configure4Science(startEvent__in__startActivityPort, imu_status, navcam_status, ade_right_status, loccam_status, ade_left_status, dhs_status, bema_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        status__in__set_ade_right_status : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_ade_left_power : real;
        status__in__set_ade_right_power : real;
        status__in__set_imu_status : {IMU_OFF, IMU_OPERATING};
        status__in__set_imu_power : real;
        status__in__set_navcam_status : {NAVCAM_OFF, NAVCAM_STANDBY};
        status__in__set_loccam_status : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_loccam_power : real;
        status__in__set_bema_status : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_bema_power : real;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        generatedEventPort__in__set_ade_right_status : boolean;
        generatedEventPort__in__set_ade_left_status : boolean;
        generatedEventPort__in__set_ade_left_power : boolean;
        generatedEventPort__in__set_ade_right_power : boolean;
        generatedEventPort__in__set_imu_status : boolean;
        generatedEventPort__in__set_imu_power : boolean;
        generatedEventPort__in__set_navcam_status : boolean;
        generatedEventPort__in__set_loccam_status : boolean;
        generatedEventPort__in__set_loccam_power : boolean;
        generatedEventPort__in__set_bema_status : boolean;
        generatedEventPort__in__set_bema_power : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_RV_Configure4Science_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := dhs_status = DHS_REDUCED;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_RV_Configure4Science_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_RV_Configure4Science_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_NOMINAL;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 12.55;
TRUE : status__in__set_dhs_power;
esac;

        next(status__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : ADE_RIGHT_OFF;
TRUE : status__in__set_ade_right_status;
esac;

        next(status__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : ADE_LEFT_OFF;
TRUE : status__in__set_ade_left_status;
esac;

        next(status__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_ade_left_power;
esac;

        next(status__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_ade_right_power;
esac;

        next(status__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : IMU_OFF;
TRUE : status__in__set_imu_status;
esac;

        next(status__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_imu_power;
esac;

        next(status__in__set_navcam_status) := case
Transition = _Progress_to_Idle_ : NAVCAM_OFF;
TRUE : status__in__set_navcam_status;
esac;

        next(status__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : LOCCAM_OFF;
TRUE : status__in__set_loccam_status;
esac;

        next(status__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_loccam_power;
esac;

        next(status__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : BEMA_OFF;
TRUE : status__in__set_bema_status;
esac;

        next(status__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_bema_power;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : (sys_energy_used + 1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power)) + 0;
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_status;
TRUE : generatedEventPort__in__set_ade_right_status;
esac;

        next(generatedEventPort__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_status;
TRUE : generatedEventPort__in__set_ade_left_status;
esac;

        next(generatedEventPort__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_power;
TRUE : generatedEventPort__in__set_ade_left_power;
esac;

        next(generatedEventPort__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_power;
TRUE : generatedEventPort__in__set_ade_right_power;
esac;

        next(generatedEventPort__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_status;
TRUE : generatedEventPort__in__set_imu_status;
esac;

        next(generatedEventPort__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_power;
TRUE : generatedEventPort__in__set_imu_power;
esac;

        next(generatedEventPort__in__set_navcam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_navcam_status;
TRUE : generatedEventPort__in__set_navcam_status;
esac;

        next(generatedEventPort__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_status;
TRUE : generatedEventPort__in__set_loccam_status;
esac;

        next(generatedEventPort__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_power;
TRUE : generatedEventPort__in__set_loccam_power;
esac;

        next(generatedEventPort__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_status;
TRUE : generatedEventPort__in__set_bema_status;
esac;

        next(generatedEventPort__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_power;
TRUE : generatedEventPort__in__set_bema_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_RV_Configure4Science_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Ade(startEvent__in__act_ades_activate_start, generatedEventPort__in__set_ade_right_status, generatedEventPort__in__set_ade_left_status, generatedEventPort__in__set_ade_left_power, generatedEventPort__in__set_ade_right_power, generatedEventPort__in__set_ade_right_status_rv_configurereset, generatedEventPort__in__set_ade_left_status_rv_configurereset, generatedEventPort__in__set_ade_left_power_rv_configurereset, generatedEventPort__in__set_ade_right_power_rv_configurereset, generatedEventPort__in__set_ade_right_status_rv_configure4science, generatedEventPort__in__set_ade_left_status_rv_configure4science, generatedEventPort__in__set_ade_left_power_rv_configure4science, generatedEventPort__in__set_ade_right_power_rv_configure4science, generatedEventPort__in__set_ade_right_status_rv_configure4travel, generatedEventPort__in__set_ade_left_status_rv_configure4travel, generatedEventPort__in__set_ade_left_power_rv_configure4travel, generatedEventPort__in__set_ade_right_power_rv_configure4travel, rtb_power, dhs_power, imu_power, loccam_power, bema_power, drill_power, clupi_power, sys_time_seconds, sys_energy_used, duration__in__act_ades_activate_start, status__in__set_ade_right_status, status__in__set_ade_left_status, status__in__set_ade_left_power, status__in__set_ade_right_power, status__in__set_ade_right_status_rv_configurereset, status__in__set_ade_left_status_rv_configurereset, status__in__set_ade_left_power_rv_configurereset, status__in__set_ade_right_power_rv_configurereset, status__in__set_ade_right_status_rv_configure4science, status__in__set_ade_left_status_rv_configure4science, status__in__set_ade_left_power_rv_configure4science, status__in__set_ade_right_power_rv_configure4science, status__in__set_ade_right_status_rv_configure4travel, status__in__set_ade_left_status_rv_configure4travel, status__in__set_ade_left_power_rv_configure4travel, status__in__set_ade_right_power_rv_configure4travel)
    VAR
        ade_SM : Ade_SM(startEvent__in__act_ades_activate_start, next(act_ades_activate.generatedEventPort__in__set_ade_right_status) != act_ades_activate.generatedEventPort__in__set_ade_right_status, next(act_ades_activate.generatedEventPort__in__set_ade_left_status) != act_ades_activate.generatedEventPort__in__set_ade_left_status, next(act_ades_activate.generatedEventPort__in__set_ade_left_power) != act_ades_activate.generatedEventPort__in__set_ade_left_power, next(act_ades_activate.generatedEventPort__in__set_ade_right_power) != act_ades_activate.generatedEventPort__in__set_ade_right_power, generatedEventPort__in__set_ade_right_status_rv_configurereset, generatedEventPort__in__set_ade_left_status_rv_configurereset, generatedEventPort__in__set_ade_left_power_rv_configurereset, generatedEventPort__in__set_ade_right_power_rv_configurereset, generatedEventPort__in__set_ade_right_status_rv_configure4science, generatedEventPort__in__set_ade_left_status_rv_configure4science, generatedEventPort__in__set_ade_left_power_rv_configure4science, generatedEventPort__in__set_ade_right_power_rv_configure4science, generatedEventPort__in__set_ade_right_status_rv_configure4travel, generatedEventPort__in__set_ade_left_status_rv_configure4travel, generatedEventPort__in__set_ade_left_power_rv_configure4travel, generatedEventPort__in__set_ade_right_power_rv_configure4travel, next(act_ades_activate.performed__in__activityPerformedPort) != act_ades_activate.performed__in__activityPerformedPort, rtb_power, dhs_power, imu_power, loccam_power, bema_power, drill_power, clupi_power, sys_time_seconds, sys_energy_used, duration__in__act_ades_activate_start, act_ades_activate.status__in__set_ade_right_status, act_ades_activate.status__in__set_ade_left_status, act_ades_activate.status__in__set_ade_left_power, act_ades_activate.status__in__set_ade_right_power, status__in__set_ade_right_status_rv_configurereset, status__in__set_ade_left_status_rv_configurereset, status__in__set_ade_left_power_rv_configurereset, status__in__set_ade_right_power_rv_configurereset, status__in__set_ade_right_status_rv_configure4science, status__in__set_ade_left_status_rv_configure4science, status__in__set_ade_left_power_rv_configure4science, status__in__set_ade_right_power_rv_configure4science, status__in__set_ade_right_status_rv_configure4travel, status__in__set_ade_left_status_rv_configure4travel, status__in__set_ade_left_power_rv_configure4travel, status__in__set_ade_right_power_rv_configure4travel);
        act_ades_activate : ADEs_Activate(startEvent__in__act_ades_activate_start, ade_SM.ade_left_status, ade_SM.ade_right_status, ade_SM.ade_left_power, ade_SM.ade_right_power, sys_time_seconds, sys_energy_used, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__act_ades_activate_start);
    DEFINE
        generatedEventPort__in__set_sys_energy_used := act_ades_activate.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds := act_ades_activate.generatedEventPort__in__set_sys_time_seconds;
        performed__in__ades_activate_done := act_ades_activate.performed__in__activityPerformedPort;
        status__in__set_sys_energy_used := act_ades_activate.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds := act_ades_activate.status__in__set_sys_time_seconds;
        ade_right_power := ade_SM.ade_right_power;
        ade_left_power := ade_SM.ade_left_power;
        ade_right_status := ade_SM.ade_right_status;
        ade_left_status := ade_SM.ade_left_status;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Ade_SM(startEvent__in__act_ades_activate_start, generatedEventPort__in__set_ade_right_status, generatedEventPort__in__set_ade_left_status, generatedEventPort__in__set_ade_left_power, generatedEventPort__in__set_ade_right_power, generatedEventPort__in__set_ade_right_status_rv_configurereset, generatedEventPort__in__set_ade_left_status_rv_configurereset, generatedEventPort__in__set_ade_left_power_rv_configurereset, generatedEventPort__in__set_ade_right_power_rv_configurereset, generatedEventPort__in__set_ade_right_status_rv_configure4science, generatedEventPort__in__set_ade_left_status_rv_configure4science, generatedEventPort__in__set_ade_left_power_rv_configure4science, generatedEventPort__in__set_ade_right_power_rv_configure4science, generatedEventPort__in__set_ade_right_status_rv_configure4travel, generatedEventPort__in__set_ade_left_status_rv_configure4travel, generatedEventPort__in__set_ade_left_power_rv_configure4travel, generatedEventPort__in__set_ade_right_power_rv_configure4travel, performed__in__act_ades_activate_done_input, rtb_power, dhs_power, imu_power, loccam_power, bema_power, drill_power, clupi_power, sys_time_seconds, sys_energy_used, duration__in__act_ades_activate_start, status__in__set_ade_right_status, status__in__set_ade_left_status, status__in__set_ade_left_power, status__in__set_ade_right_power, status__in__set_ade_right_status_rv_configurereset, status__in__set_ade_left_status_rv_configurereset, status__in__set_ade_left_power_rv_configurereset, status__in__set_ade_right_power_rv_configurereset, status__in__set_ade_right_status_rv_configure4science, status__in__set_ade_left_status_rv_configure4science, status__in__set_ade_left_power_rv_configure4science, status__in__set_ade_right_power_rv_configure4science, status__in__set_ade_right_status_rv_configure4travel, status__in__set_ade_left_status_rv_configure4travel, status__in__set_ade_left_power_rv_configure4travel, status__in__set_ade_right_power_rv_configure4travel)
    VAR
        State : {ade_all_states, t};
        c : clock;
        ade_left_status : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        ade_right_status : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        ade_left_power : real;
        ade_right_power : real;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        performed__in__ades_activate_done : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;

    IVAR
        Transition : {ades_activate_durative, _ade_all_states_to_ade_all_states_, ade_all_states_preeffects_of_act_ades_activate, ade_all_states_setter_from_act_rv_configure4science, ade_all_states_setter_from_act_rv_configure4travel, ade_all_states_setter_from_act_rv_configurereset};

    FROZENVAR
        InitTransition : {_ade_SM_to_ade_all_states_};

    ASSIGN
        init(ade_left_status) := case
InitTransition = _ade_SM_to_ade_all_states_ : ADE_LEFT_OFF;
esac;
        init(ade_right_status) := case
InitTransition = _ade_SM_to_ade_all_states_ : ADE_RIGHT_OFF;
esac;
        init(ade_left_power) := case
InitTransition = _ade_SM_to_ade_all_states_ : 0;
esac;
        init(ade_right_power) := case
InitTransition = _ade_SM_to_ade_all_states_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(ade_left_status) := case
Transition = ades_activate_durative :  (generatedEventPort__in__set_ade_left_status = TRUE ? next(status__in__set_ade_left_status) : ade_left_status) ;
Transition = ade_all_states_preeffects_of_act_ades_activate :  (generatedEventPort__in__set_ade_left_status = TRUE ? next(status__in__set_ade_left_status) : ade_left_status) ;
Transition = ade_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_ade_left_status_rv_configure4science = TRUE ? next(status__in__set_ade_left_status_rv_configure4science) : ade_left_status) ;
Transition = ade_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_ade_left_status_rv_configure4travel = TRUE ? next(status__in__set_ade_left_status_rv_configure4travel) : ade_left_status) ;
Transition = ade_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_ade_left_status_rv_configurereset = TRUE ? next(status__in__set_ade_left_status_rv_configurereset) : ade_left_status) ;
TRUE : ade_left_status;
esac;

        next(ade_right_status) := case
Transition = ades_activate_durative :  (generatedEventPort__in__set_ade_right_status = TRUE ? next(status__in__set_ade_right_status) : ade_right_status) ;
Transition = ade_all_states_preeffects_of_act_ades_activate :  (generatedEventPort__in__set_ade_right_status = TRUE ? next(status__in__set_ade_right_status) : ade_right_status) ;
Transition = ade_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_ade_right_status_rv_configure4science = TRUE ? next(status__in__set_ade_right_status_rv_configure4science) : ade_right_status) ;
Transition = ade_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_ade_right_status_rv_configure4travel = TRUE ? next(status__in__set_ade_right_status_rv_configure4travel) : ade_right_status) ;
Transition = ade_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_ade_right_status_rv_configurereset = TRUE ? next(status__in__set_ade_right_status_rv_configurereset) : ade_right_status) ;
TRUE : ade_right_status;
esac;

        next(ade_left_power) := case
Transition = ades_activate_durative :  (generatedEventPort__in__set_ade_left_power = TRUE ? next(status__in__set_ade_left_power) : ade_left_power) ;
Transition = ade_all_states_preeffects_of_act_ades_activate :  (generatedEventPort__in__set_ade_left_power = TRUE ? next(status__in__set_ade_left_power) : ade_left_power) ;
Transition = ade_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_ade_left_power_rv_configure4science = TRUE ? next(status__in__set_ade_left_power_rv_configure4science) : ade_left_power) ;
Transition = ade_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_ade_left_power_rv_configure4travel = TRUE ? next(status__in__set_ade_left_power_rv_configure4travel) : ade_left_power) ;
Transition = ade_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_ade_left_power_rv_configurereset = TRUE ? next(status__in__set_ade_left_power_rv_configurereset) : ade_left_power) ;
TRUE : ade_left_power;
esac;

        next(ade_right_power) := case
Transition = ades_activate_durative :  (generatedEventPort__in__set_ade_right_power = TRUE ? next(status__in__set_ade_right_power) : ade_right_power) ;
Transition = ade_all_states_preeffects_of_act_ades_activate :  (generatedEventPort__in__set_ade_right_power = TRUE ? next(status__in__set_ade_right_power) : ade_right_power) ;
Transition = ade_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_ade_right_power_rv_configure4science = TRUE ? next(status__in__set_ade_right_power_rv_configure4science) : ade_right_power) ;
Transition = ade_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_ade_right_power_rv_configure4travel = TRUE ? next(status__in__set_ade_right_power_rv_configure4travel) : ade_right_power) ;
Transition = ade_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_ade_right_power_rv_configurereset = TRUE ? next(status__in__set_ade_right_power_rv_configurereset) : ade_right_power) ;
TRUE : ade_right_power;
esac;

        next(status__in__set_sys_time_seconds) := case
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
TRUE : status__in__set_sys_energy_used;
esac;

        next(performed__in__ades_activate_done) := case
TRUE : performed__in__ades_activate_done;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

    INIT (InitTransition = _ade_SM_to_ade_all_states_ -> State = ade_all_states);

    TRANS (Transition = ades_activate_durative -> (((performed__in__act_ades_activate_done_input = TRUE & (((generatedEventPort__in__set_ade_right_status = TRUE | generatedEventPort__in__set_ade_left_status = TRUE) | generatedEventPort__in__set_ade_left_power = TRUE) | generatedEventPort__in__set_ade_right_power = TRUE)) & State = ade_all_states) & next(State) = ade_all_states));

    TRANS (Transition = _ade_all_states_to_ade_all_states_ -> ((!((((((((((((((((generatedEventPort__in__set_ade_right_status = TRUE | generatedEventPort__in__set_ade_left_status = TRUE) | generatedEventPort__in__set_ade_left_power = TRUE) | generatedEventPort__in__set_ade_right_power = TRUE) | generatedEventPort__in__set_ade_right_status_rv_configurereset = TRUE) | generatedEventPort__in__set_ade_left_status_rv_configurereset = TRUE) | generatedEventPort__in__set_ade_left_power_rv_configurereset = TRUE) | generatedEventPort__in__set_ade_right_power_rv_configurereset = TRUE) | generatedEventPort__in__set_ade_right_status_rv_configure4science = TRUE) | generatedEventPort__in__set_ade_left_status_rv_configure4science = TRUE) | generatedEventPort__in__set_ade_left_power_rv_configure4science = TRUE) | generatedEventPort__in__set_ade_right_power_rv_configure4science = TRUE) | generatedEventPort__in__set_ade_right_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_ade_left_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_ade_left_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_ade_right_power_rv_configure4travel = TRUE) | performed__in__act_ades_activate_done_input = TRUE) & State = ade_all_states) & next(State) = ade_all_states));

    TRANS (Transition = ade_all_states_preeffects_of_act_ades_activate -> (((startEvent__in__act_ades_activate_start = TRUE & (((generatedEventPort__in__set_ade_right_status = TRUE | generatedEventPort__in__set_ade_left_status = TRUE) | generatedEventPort__in__set_ade_left_power = TRUE) | generatedEventPort__in__set_ade_right_power = TRUE)) & State = ade_all_states) & next(State) = ade_all_states));

    TRANS (Transition = ade_all_states_setter_from_act_rv_configure4science -> (((((generatedEventPort__in__set_ade_right_status_rv_configure4science = TRUE | generatedEventPort__in__set_ade_left_status_rv_configure4science = TRUE) | generatedEventPort__in__set_ade_left_power_rv_configure4science = TRUE) | generatedEventPort__in__set_ade_right_power_rv_configure4science = TRUE) & State = ade_all_states) & next(State) = ade_all_states));

    TRANS (Transition = ade_all_states_setter_from_act_rv_configure4travel -> (((((generatedEventPort__in__set_ade_right_status_rv_configure4travel = TRUE | generatedEventPort__in__set_ade_left_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_ade_left_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_ade_right_power_rv_configure4travel = TRUE) & State = ade_all_states) & next(State) = ade_all_states));

    TRANS (Transition = ade_all_states_setter_from_act_rv_configurereset -> (((((generatedEventPort__in__set_ade_right_status_rv_configurereset = TRUE | generatedEventPort__in__set_ade_left_status_rv_configurereset = TRUE) | generatedEventPort__in__set_ade_left_power_rv_configurereset = TRUE) | generatedEventPort__in__set_ade_right_power_rv_configurereset = TRUE) & State = ade_all_states) & next(State) = ade_all_states));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE ADEs_Activate(startEvent__in__startActivityPort, ade_left_status, ade_right_status, ade_left_power, ade_right_power, sys_time_seconds, sys_energy_used, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_ade_right_status : {ADE_RIGHT_OFF, ADE_RIGHT_STANDBY};
        status__in__set_ade_left_status : {ADE_LEFT_OFF, ADE_LEFT_STANDBY};
        status__in__set_ade_left_power : real;
        status__in__set_ade_right_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_ade_right_status : boolean;
        generatedEventPort__in__set_ade_left_status : boolean;
        generatedEventPort__in__set_ade_left_power : boolean;
        generatedEventPort__in__set_ade_right_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_ADEs_Activate_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := (ade_left_status = ADE_LEFT_OFF & ade_right_status = ADE_RIGHT_OFF);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_ADEs_Activate_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_ADEs_Activate_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : ADE_RIGHT_STANDBY;
TRUE : status__in__set_ade_right_status;
esac;

        next(status__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : ADE_LEFT_STANDBY;
TRUE : status__in__set_ade_left_status;
esac;

        next(status__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : 4.05;
TRUE : status__in__set_ade_left_power;
esac;

        next(status__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : 4.05;
TRUE : status__in__set_ade_right_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_ade_right_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_status;
TRUE : generatedEventPort__in__set_ade_right_status;
esac;

        next(generatedEventPort__in__set_ade_left_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_status;
TRUE : generatedEventPort__in__set_ade_left_status;
esac;

        next(generatedEventPort__in__set_ade_left_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_left_power;
TRUE : generatedEventPort__in__set_ade_left_power;
esac;

        next(generatedEventPort__in__set_ade_right_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_ade_right_power;
TRUE : generatedEventPort__in__set_ade_right_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_ADEs_Activate_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE GNC(startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, generatedEventPort__in__set_loccam_power_initialise, generatedEventPort__in__set_loccam_status_initialise, generatedEventPort__in__set_imu_power_initialise, generatedEventPort__in__set_imu_status_initialise, generatedEventPort__in__set_imu_power_gnc_updateheading, generatedEventPort__in__set_imu_status_gnc_updateheading, generatedEventPort__in__set_heading_updated_gnc_updateheading, generatedEventPort__in__set_position_updated_gnc_updateposition, generatedEventPort__in__set_bema_power_initialise, generatedEventPort__in__set_bema_status_initialise, generatedEventPort__in__set_imu_status_rv_configurereset, generatedEventPort__in__set_loccam_status_rv_configurereset, generatedEventPort__in__set_bema_status_rv_configurereset, generatedEventPort__in__set_loccam_power_rv_configurereset, generatedEventPort__in__set_imu_power_rv_configurereset, generatedEventPort__in__set_bema_power_rv_configurereset, generatedEventPort__in__set_imu_status_rv_configure4travel, generatedEventPort__in__set_loccam_status_rv_configure4travel, generatedEventPort__in__set_bema_status_rv_configure4travel, generatedEventPort__in__set_loccam_power_rv_configure4travel, generatedEventPort__in__set_imu_power_rv_configure4travel, generatedEventPort__in__set_bema_power_rv_configure4travel, generatedEventPort__in__set_imu_status_rv_configure4science, generatedEventPort__in__set_loccam_status_rv_configure4science, generatedEventPort__in__set_bema_status_rv_configure4science, generatedEventPort__in__set_loccam_power_rv_configure4science, generatedEventPort__in__set_imu_power_rv_configure4science, generatedEventPort__in__set_bema_power_rv_configure4science, generatedEventPort__in__set_navcam_status_rv_configurereset, generatedEventPort__in__set_navcam_status_rv_configure4travel, generatedEventPort__in__set_navcam_status_rv_configure4science, dhs_status, ade_right_status, ade_left_status, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, dhs_power, sys_time_seconds, sys_energy_used, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, status__in__set_loccam_power_initialise, status__in__set_loccam_status_initialise, status__in__set_imu_power_initialise, status__in__set_imu_status_initialise, status__in__set_imu_power_gnc_updateheading, status__in__set_imu_status_gnc_updateheading, status__in__set_heading_updated_gnc_updateheading, status__in__set_position_updated_gnc_updateposition, status__in__set_bema_power_initialise, status__in__set_bema_status_initialise, status__in__set_imu_status_rv_configurereset, status__in__set_navcam_status_rv_configurereset, status__in__set_loccam_status_rv_configurereset, status__in__set_bema_status_rv_configurereset, status__in__set_loccam_power_rv_configurereset, status__in__set_imu_power_rv_configurereset, status__in__set_bema_power_rv_configurereset, status__in__set_imu_status_rv_configure4travel, status__in__set_navcam_status_rv_configure4travel, status__in__set_loccam_status_rv_configure4travel, status__in__set_bema_status_rv_configure4travel, status__in__set_loccam_power_rv_configure4travel, status__in__set_imu_power_rv_configure4travel, status__in__set_bema_power_rv_configure4travel, status__in__set_imu_status_rv_configure4science, status__in__set_navcam_status_rv_configure4science, status__in__set_loccam_status_rv_configure4science, status__in__set_bema_status_rv_configure4science, status__in__set_loccam_power_rv_configure4science, status__in__set_imu_power_rv_configure4science, status__in__set_bema_power_rv_configure4science)
    VAR
        act_gnc_fpath_straight : GNC_FPATH_Straight(startEvent__in__gnc_fpath_straight_start, gnc_SM.bema_status, gnc_SM.position_updated, gnc_SM.imu_status, gnc_SM.heading_updated, gnc_SM.loccam_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, gnc_SM.imu_power, gnc_SM.bema_power, gnc_SM.loccam_power, ade_left_status, ade_right_status, dhs_status, duration__in__gnc_fpath_straight_start);
        gnc_SM : GNC_SM(startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, next(act_loccam_initialise.generatedEventPort__in__set_loccam_power) != act_loccam_initialise.generatedEventPort__in__set_loccam_power, next(act_loccam_initialise.generatedEventPort__in__set_loccam_status) != act_loccam_initialise.generatedEventPort__in__set_loccam_status, next(act_imu_initialise.generatedEventPort__in__set_imu_power) != act_imu_initialise.generatedEventPort__in__set_imu_power, next(act_imu_initialise.generatedEventPort__in__set_imu_status) != act_imu_initialise.generatedEventPort__in__set_imu_status, next(act_gnc_updateheading.generatedEventPort__in__set_imu_power) != act_gnc_updateheading.generatedEventPort__in__set_imu_power, next(act_gnc_updateheading.generatedEventPort__in__set_imu_status) != act_gnc_updateheading.generatedEventPort__in__set_imu_status, next(act_gnc_updateheading.generatedEventPort__in__set_heading_updated) != act_gnc_updateheading.generatedEventPort__in__set_heading_updated, next(act_gnc_updateposition.generatedEventPort__in__set_position_updated) != act_gnc_updateposition.generatedEventPort__in__set_position_updated, next(act_bema_initialise.generatedEventPort__in__set_bema_power) != act_bema_initialise.generatedEventPort__in__set_bema_power, next(act_bema_initialise.generatedEventPort__in__set_bema_status) != act_bema_initialise.generatedEventPort__in__set_bema_status, generatedEventPort__in__set_imu_status_rv_configurereset, generatedEventPort__in__set_loccam_status_rv_configurereset, generatedEventPort__in__set_bema_status_rv_configurereset, generatedEventPort__in__set_loccam_power_rv_configurereset, generatedEventPort__in__set_imu_power_rv_configurereset, generatedEventPort__in__set_bema_power_rv_configurereset, generatedEventPort__in__set_imu_status_rv_configure4travel, generatedEventPort__in__set_loccam_status_rv_configure4travel, generatedEventPort__in__set_bema_status_rv_configure4travel, generatedEventPort__in__set_loccam_power_rv_configure4travel, generatedEventPort__in__set_imu_power_rv_configure4travel, generatedEventPort__in__set_bema_power_rv_configure4travel, generatedEventPort__in__set_imu_status_rv_configure4science, generatedEventPort__in__set_loccam_status_rv_configure4science, generatedEventPort__in__set_bema_status_rv_configure4science, generatedEventPort__in__set_loccam_power_rv_configure4science, generatedEventPort__in__set_imu_power_rv_configure4science, generatedEventPort__in__set_bema_power_rv_configure4science, generatedEventPort__in__set_navcam_status_rv_configurereset, generatedEventPort__in__set_navcam_status_rv_configure4travel, generatedEventPort__in__set_navcam_status_rv_configure4science, next(act_gnc_updateheading.performed__in__activityPerformedPort) != act_gnc_updateheading.performed__in__activityPerformedPort, next(act_bema_initialise.performed__in__activityPerformedPort) != act_bema_initialise.performed__in__activityPerformedPort, next(act_loccam_initialise.performed__in__activityPerformedPort) != act_loccam_initialise.performed__in__activityPerformedPort, next(act_imu_initialise.performed__in__activityPerformedPort) != act_imu_initialise.performed__in__activityPerformedPort, next(act_gnc_fpath_straight.performed__in__activityPerformedPort) != act_gnc_fpath_straight.performed__in__activityPerformedPort, next(act_gnc_updateposition.performed__in__activityPerformedPort) != act_gnc_updateposition.performed__in__activityPerformedPort, dhs_status, ade_right_status, ade_left_status, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, dhs_power, sys_time_seconds, sys_energy_used, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, act_loccam_initialise.status__in__set_loccam_power, act_loccam_initialise.status__in__set_loccam_status, act_imu_initialise.status__in__set_imu_power, act_imu_initialise.status__in__set_imu_status, act_gnc_updateheading.status__in__set_imu_power, act_gnc_updateheading.status__in__set_imu_status, act_gnc_updateheading.status__in__set_heading_updated, act_gnc_updateposition.status__in__set_position_updated, act_bema_initialise.status__in__set_bema_power, act_bema_initialise.status__in__set_bema_status, status__in__set_imu_status_rv_configurereset, status__in__set_navcam_status_rv_configurereset, status__in__set_loccam_status_rv_configurereset, status__in__set_bema_status_rv_configurereset, status__in__set_loccam_power_rv_configurereset, status__in__set_imu_power_rv_configurereset, status__in__set_bema_power_rv_configurereset, status__in__set_imu_status_rv_configure4travel, status__in__set_navcam_status_rv_configure4travel, status__in__set_loccam_status_rv_configure4travel, status__in__set_bema_status_rv_configure4travel, status__in__set_loccam_power_rv_configure4travel, status__in__set_imu_power_rv_configure4travel, status__in__set_bema_power_rv_configure4travel, status__in__set_imu_status_rv_configure4science, status__in__set_navcam_status_rv_configure4science, status__in__set_loccam_status_rv_configure4science, status__in__set_bema_status_rv_configure4science, status__in__set_loccam_power_rv_configure4science, status__in__set_imu_power_rv_configure4science, status__in__set_bema_power_rv_configure4science);
        act_bema_initialise : BEMA_Initialise(startEvent__in__bema_initialise_start, gnc_SM.bema_status, gnc_SM.bema_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, gnc_SM.imu_power, gnc_SM.loccam_power, duration__in__bema_initialise_start);
        act_loccam_initialise : LocCam_Initialise(startEvent__in__loccam_initialise_start, gnc_SM.loccam_status, gnc_SM.loccam_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, gnc_SM.imu_power, gnc_SM.bema_power, duration__in__loccam_initialise_start);
        act_imu_initialise : IMU_Initialise(startEvent__in__imu_initialise_start, gnc_SM.imu_status, gnc_SM.imu_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, gnc_SM.bema_power, gnc_SM.loccam_power, duration__in__imu_initialise_start);
        act_gnc_updateheading : GNC_UpdateHeading(startEvent__in__gnc_updateheading_start, gnc_SM.imu_status, gnc_SM.heading_updated, gnc_SM.imu_power, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, gnc_SM.bema_power, gnc_SM.loccam_power, sys_time_seconds, duration__in__gnc_updateheading_start);
        act_gnc_updateposition : GNC_UpdatePosition(startEvent__in__gnc_updateposition_start, gnc_SM.position_updated, sys_energy_used, sys_time_seconds, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, gnc_SM.imu_power, gnc_SM.bema_power, gnc_SM.loccam_power, duration__in__gnc_updateposition_start);
    DEFINE
        generatedEventPort__in__set_sys_energy_used_bema_initialise := act_bema_initialise.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_bema_initialise := act_bema_initialise.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight := act_gnc_fpath_straight.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight := act_gnc_fpath_straight.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_gnc_updateposition := act_gnc_updateposition.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_gnc_updateposition := act_gnc_updateposition.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_gnc_updateheading := act_gnc_updateheading.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_gnc_updateheading := act_gnc_updateheading.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_imu_initialise := act_imu_initialise.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_imu_initialise := act_imu_initialise.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_energy_used_loccam_initialise := act_loccam_initialise.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_loccam_initialise := act_loccam_initialise.generatedEventPort__in__set_sys_time_seconds;
        performed__in__gnc_updateheading_done := act_gnc_updateheading.performed__in__activityPerformedPort;
        performed__in__gnc_updateposition_done := act_gnc_updateposition.performed__in__activityPerformedPort;
        performed__in__bema_initialise_done := act_bema_initialise.performed__in__activityPerformedPort;
        performed__in__gnc_fpath_straight_done := act_gnc_fpath_straight.performed__in__activityPerformedPort;
        performed__in__imu_initialise_done := act_imu_initialise.performed__in__activityPerformedPort;
        performed__in__loccam_initialise_done := act_loccam_initialise.performed__in__activityPerformedPort;
        status__in__set_sys_energy_used_bema_initialise := act_bema_initialise.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_bema_initialise := act_bema_initialise.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_gnc_fpath_straight := act_gnc_fpath_straight.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_gnc_fpath_straight := act_gnc_fpath_straight.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_gnc_updateposition := act_gnc_updateposition.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_gnc_updateposition := act_gnc_updateposition.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_gnc_updateheading := act_gnc_updateheading.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_gnc_updateheading := act_gnc_updateheading.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_imu_initialise := act_imu_initialise.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_imu_initialise := act_imu_initialise.status__in__set_sys_time_seconds;
        status__in__set_sys_energy_used_loccam_initialise := act_loccam_initialise.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_loccam_initialise := act_loccam_initialise.status__in__set_sys_time_seconds;
        loccam_power := gnc_SM.loccam_power;
        bema_power := gnc_SM.bema_power;
        imu_power := gnc_SM.imu_power;
        bema_status := gnc_SM.bema_status;
        loccam_status := gnc_SM.loccam_status;
        heading_updated := gnc_SM.heading_updated;
        position_updated := gnc_SM.position_updated;
        imu_status := gnc_SM.imu_status;
        navcam_status := gnc_SM.navcam_status;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE GNC_FPATH_Straight(startEvent__in__startActivityPort, bema_status, position_updated, imu_status, heading_updated, loccam_status, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, ade_left_status, ade_right_status, dhs_status, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_GNC_FPATH_Straight_to_Idle_};

    DEFINE
        postcondition := (((((bema_status = BEMA_STANDBY & ade_left_status = ADE_LEFT_STANDBY) & ade_right_status = ADE_RIGHT_STANDBY) & imu_status = IMU_OPERATING) & dhs_status = DHS_HIGHPOWER) & loccam_status = LOCCAM_STANDBY);
        precondition := (((((((bema_status = BEMA_STANDBY & ade_left_status = ADE_LEFT_STANDBY) & ade_right_status = ADE_RIGHT_STANDBY) & imu_status = IMU_OPERATING) & dhs_status = DHS_HIGHPOWER) & loccam_status = LOCCAM_STANDBY) & heading_updated = TRUE) & position_updated = TRUE);
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_GNC_FPATH_Straight_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_GNC_FPATH_Straight_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 1);
TRUE : status__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_GNC_FPATH_Straight_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE GNC_SM(startEvent__in__loccam_initialise_start, startEvent__in__imu_initialise_start, startEvent__in__gnc_fpath_straight_start, startEvent__in__bema_initialise_start, startEvent__in__gnc_updateposition_start, startEvent__in__gnc_updateheading_start, generatedEventPort__in__set_loccam_power_initialise, generatedEventPort__in__set_loccam_status_initialise, generatedEventPort__in__set_imu_power_initialise, generatedEventPort__in__set_imu_status_initialise, generatedEventPort__in__set_imu_power_gnc_updateheading, generatedEventPort__in__set_imu_status_gnc_updateheading, generatedEventPort__in__set_heading_updated_gnc_updateheading, generatedEventPort__in__set_position_updated_gnc_updateposition, generatedEventPort__in__set_bema_power_initialise, generatedEventPort__in__set_bema_status_initialise, generatedEventPort__in__set_imu_status_rv_configurereset, generatedEventPort__in__set_loccam_status_rv_configurereset, generatedEventPort__in__set_bema_status_rv_configurereset, generatedEventPort__in__set_loccam_power_rv_configurereset, generatedEventPort__in__set_imu_power_rv_configurereset, generatedEventPort__in__set_bema_power_rv_configurereset, generatedEventPort__in__set_imu_status_rv_configure4travel, generatedEventPort__in__set_loccam_status_rv_configure4travel, generatedEventPort__in__set_bema_status_rv_configure4travel, generatedEventPort__in__set_loccam_power_rv_configure4travel, generatedEventPort__in__set_imu_power_rv_configure4travel, generatedEventPort__in__set_bema_power_rv_configure4travel, generatedEventPort__in__set_imu_status_rv_configure4science, generatedEventPort__in__set_loccam_status_rv_configure4science, generatedEventPort__in__set_bema_status_rv_configure4science, generatedEventPort__in__set_loccam_power_rv_configure4science, generatedEventPort__in__set_imu_power_rv_configure4science, generatedEventPort__in__set_bema_power_rv_configure4science, generatedEventPort__in__set_navcam_status_rv_configurereset, generatedEventPort__in__set_navcam_status_rv_configure4travel, generatedEventPort__in__set_navcam_status_rv_configure4science, performed__in__act_gnc_updateheading_done_input, performed__in__act_bema_initialise_done_input, performed__in__act_loccam_initialise_done_input, performed__in__act_imu_initialise_done_input, performed__in__act_gnc_fpath_straight_done_input, performed__in__act_gnc_updateposition_done_input, dhs_status, ade_right_status, ade_left_status, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, dhs_power, sys_time_seconds, sys_energy_used, duration__in__loccam_initialise_start, duration__in__imu_initialise_start, duration__in__gnc_fpath_straight_start, duration__in__bema_initialise_start, duration__in__gnc_updateposition_start, duration__in__gnc_updateheading_start, status__in__set_loccam_power_initialise, status__in__set_loccam_status_initialise, status__in__set_imu_power_initialise, status__in__set_imu_status_initialise, status__in__set_imu_power_gnc_updateheading, status__in__set_imu_status_gnc_updateheading, status__in__set_heading_updated_gnc_updateheading, status__in__set_position_updated_gnc_updateposition, status__in__set_bema_power_initialise, status__in__set_bema_status_initialise, status__in__set_imu_status_rv_configurereset, status__in__set_navcam_status_rv_configurereset, status__in__set_loccam_status_rv_configurereset, status__in__set_bema_status_rv_configurereset, status__in__set_loccam_power_rv_configurereset, status__in__set_imu_power_rv_configurereset, status__in__set_bema_power_rv_configurereset, status__in__set_imu_status_rv_configure4travel, status__in__set_navcam_status_rv_configure4travel, status__in__set_loccam_status_rv_configure4travel, status__in__set_bema_status_rv_configure4travel, status__in__set_loccam_power_rv_configure4travel, status__in__set_imu_power_rv_configure4travel, status__in__set_bema_power_rv_configure4travel, status__in__set_imu_status_rv_configure4science, status__in__set_navcam_status_rv_configure4science, status__in__set_loccam_status_rv_configure4science, status__in__set_bema_status_rv_configure4science, status__in__set_loccam_power_rv_configure4science, status__in__set_imu_power_rv_configure4science, status__in__set_bema_power_rv_configure4science)
    VAR
        State : {gnc_all_states, t};
        c : clock;
        navcam_status : {NAVCAM_OFF, NAVCAM_STANDBY};
        imu_status : {IMU_OFF, IMU_OPERATING};
        position_updated : boolean;
        heading_updated : boolean;
        loccam_status : {LOCCAM_OFF, LOCCAM_STANDBY};
        bema_status : {BEMA_STANDBY, BEMA_OFF};
        imu_power : real;
        bema_power : real;
        loccam_power : real;
        status__in__set_sys_time_seconds_loccam_initialise : real;
        status__in__set_sys_energy_used_loccam_initialise : real;
        status__in__set_sys_time_seconds_imu_initialise : real;
        status__in__set_sys_energy_used_imu_initialise : real;
        status__in__set_sys_time_seconds_gnc_updateheading : real;
        status__in__set_sys_energy_used_gnc_updateheading : real;
        status__in__set_sys_time_seconds_gnc_updateposition : real;
        status__in__set_sys_energy_used_gnc_updateposition : real;
        status__in__set_sys_time_seconds_gnc_fpath_straight : real;
        status__in__set_sys_energy_used_gnc_fpath_straight : real;
        status__in__set_sys_time_seconds_bema_initialise : real;
        status__in__set_sys_energy_used_bema_initialise : real;
        performed__in__loccam_initialise_done : boolean;
        performed__in__imu_initialise_done : boolean;
        performed__in__gnc_fpath_straight_done : boolean;
        performed__in__bema_initialise_done : boolean;
        performed__in__gnc_updateposition_done : boolean;
        performed__in__gnc_updateheading_done : boolean;
        generatedEventPort__in__set_sys_time_seconds_loccam_initialise : boolean;
        generatedEventPort__in__set_sys_energy_used_loccam_initialise : boolean;
        generatedEventPort__in__set_sys_time_seconds_imu_initialise : boolean;
        generatedEventPort__in__set_sys_energy_used_imu_initialise : boolean;
        generatedEventPort__in__set_sys_time_seconds_gnc_updateheading : boolean;
        generatedEventPort__in__set_sys_energy_used_gnc_updateheading : boolean;
        generatedEventPort__in__set_sys_time_seconds_gnc_updateposition : boolean;
        generatedEventPort__in__set_sys_energy_used_gnc_updateposition : boolean;
        generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight : boolean;
        generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight : boolean;
        generatedEventPort__in__set_sys_time_seconds_bema_initialise : boolean;
        generatedEventPort__in__set_sys_energy_used_bema_initialise : boolean;

    IVAR
        Transition : {gnc_updateheading_durative, bema_initialise_durative, loccam_initialise_durative, imu_initialise_durative, gnc_fpath_straight_durative, gnc_updateposition_durative, _gnc_all_states_to_gnc_all_states_, gnc_all_states_preeffects_of_act_bema_initialise, gnc_all_states_preeffects_of_act_gnc_updateheading, gnc_all_states_preeffects_of_act_gnc_updateposition, gnc_all_states_preeffects_of_act_imu_initialise, gnc_all_states_preeffects_of_act_loccam_initialise, gnc_all_states_setter_from_act_rv_configure4science, gnc_all_states_setter_from_act_rv_configure4travel, gnc_all_states_setter_from_act_rv_configurereset};

    FROZENVAR
        InitTransition : {_gnc_SM_to_gnc_all_states_};

    ASSIGN
        init(imu_status) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : IMU_OFF;
esac;
        init(position_updated) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : FALSE;
esac;
        init(heading_updated) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : FALSE;
esac;
        init(loccam_status) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : LOCCAM_OFF;
esac;
        init(bema_status) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : BEMA_OFF;
esac;
        init(imu_power) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : 0;
esac;
        init(bema_power) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : 0;
esac;
        init(loccam_power) := case
InitTransition = _gnc_SM_to_gnc_all_states_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(navcam_status) := case
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_navcam_status_rv_configure4science = TRUE ? next(status__in__set_navcam_status_rv_configure4science) : navcam_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_navcam_status_rv_configure4travel = TRUE ? next(status__in__set_navcam_status_rv_configure4travel) : navcam_status) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_navcam_status_rv_configurereset = TRUE ? next(status__in__set_navcam_status_rv_configurereset) : navcam_status) ;
TRUE : navcam_status;
esac;

        next(imu_status) := case
Transition = gnc_updateheading_durative :  (generatedEventPort__in__set_imu_status_gnc_updateheading = TRUE ? next(status__in__set_imu_status_gnc_updateheading) : imu_status) ;
Transition = imu_initialise_durative :  (generatedEventPort__in__set_imu_status_initialise = TRUE ? next(status__in__set_imu_status_initialise) : imu_status) ;
Transition = gnc_all_states_preeffects_of_act_gnc_updateheading :  (generatedEventPort__in__set_imu_status_gnc_updateheading = TRUE ? next(status__in__set_imu_status_gnc_updateheading) : imu_status) ;
Transition = gnc_all_states_preeffects_of_act_imu_initialise :  (generatedEventPort__in__set_imu_status_initialise = TRUE ? next(status__in__set_imu_status_initialise) : imu_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_imu_status_rv_configure4science = TRUE ? next(status__in__set_imu_status_rv_configure4science) : imu_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_imu_status_rv_configure4travel = TRUE ? next(status__in__set_imu_status_rv_configure4travel) : imu_status) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_imu_status_rv_configurereset = TRUE ? next(status__in__set_imu_status_rv_configurereset) : imu_status) ;
TRUE : imu_status;
esac;

        next(position_updated) := case
Transition = gnc_updateposition_durative :  (generatedEventPort__in__set_position_updated_gnc_updateposition = TRUE ? next(status__in__set_position_updated_gnc_updateposition) : position_updated) ;
Transition = gnc_all_states_preeffects_of_act_gnc_updateposition :  (generatedEventPort__in__set_position_updated_gnc_updateposition = TRUE ? next(status__in__set_position_updated_gnc_updateposition) : position_updated) ;
TRUE : position_updated;
esac;

        next(heading_updated) := case
Transition = gnc_updateheading_durative :  (generatedEventPort__in__set_heading_updated_gnc_updateheading = TRUE ? next(status__in__set_heading_updated_gnc_updateheading) : heading_updated) ;
Transition = gnc_all_states_preeffects_of_act_gnc_updateheading :  (generatedEventPort__in__set_heading_updated_gnc_updateheading = TRUE ? next(status__in__set_heading_updated_gnc_updateheading) : heading_updated) ;
TRUE : heading_updated;
esac;

        next(loccam_status) := case
Transition = loccam_initialise_durative :  (generatedEventPort__in__set_loccam_status_initialise = TRUE ? next(status__in__set_loccam_status_initialise) : loccam_status) ;
Transition = gnc_all_states_preeffects_of_act_loccam_initialise :  (generatedEventPort__in__set_loccam_status_initialise = TRUE ? next(status__in__set_loccam_status_initialise) : loccam_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_loccam_status_rv_configure4science = TRUE ? next(status__in__set_loccam_status_rv_configure4science) : loccam_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_loccam_status_rv_configure4travel = TRUE ? next(status__in__set_loccam_status_rv_configure4travel) : loccam_status) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_loccam_status_rv_configurereset = TRUE ? next(status__in__set_loccam_status_rv_configurereset) : loccam_status) ;
TRUE : loccam_status;
esac;

        next(bema_status) := case
Transition = bema_initialise_durative :  (generatedEventPort__in__set_bema_status_initialise = TRUE ? next(status__in__set_bema_status_initialise) : bema_status) ;
Transition = gnc_all_states_preeffects_of_act_bema_initialise :  (generatedEventPort__in__set_bema_status_initialise = TRUE ? next(status__in__set_bema_status_initialise) : bema_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_bema_status_rv_configure4science = TRUE ? next(status__in__set_bema_status_rv_configure4science) : bema_status) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_bema_status_rv_configure4travel = TRUE ? next(status__in__set_bema_status_rv_configure4travel) : bema_status) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_bema_status_rv_configurereset = TRUE ? next(status__in__set_bema_status_rv_configurereset) : bema_status) ;
TRUE : bema_status;
esac;

        next(imu_power) := case
Transition = gnc_updateheading_durative :  (generatedEventPort__in__set_imu_power_gnc_updateheading = TRUE ? next(status__in__set_imu_power_gnc_updateheading) : imu_power) ;
Transition = imu_initialise_durative :  (generatedEventPort__in__set_imu_power_initialise = TRUE ? next(status__in__set_imu_power_initialise) : imu_power) ;
Transition = gnc_all_states_preeffects_of_act_gnc_updateheading :  (generatedEventPort__in__set_imu_power_gnc_updateheading = TRUE ? next(status__in__set_imu_power_gnc_updateheading) : imu_power) ;
Transition = gnc_all_states_preeffects_of_act_imu_initialise :  (generatedEventPort__in__set_imu_power_initialise = TRUE ? next(status__in__set_imu_power_initialise) : imu_power) ;
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_imu_power_rv_configure4science = TRUE ? next(status__in__set_imu_power_rv_configure4science) : imu_power) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_imu_power_rv_configure4travel = TRUE ? next(status__in__set_imu_power_rv_configure4travel) : imu_power) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_imu_power_rv_configurereset = TRUE ? next(status__in__set_imu_power_rv_configurereset) : imu_power) ;
TRUE : imu_power;
esac;

        next(bema_power) := case
Transition = bema_initialise_durative :  (generatedEventPort__in__set_bema_power_initialise = TRUE ? next(status__in__set_bema_power_initialise) : bema_power) ;
Transition = gnc_all_states_preeffects_of_act_bema_initialise :  (generatedEventPort__in__set_bema_power_initialise = TRUE ? next(status__in__set_bema_power_initialise) : bema_power) ;
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_bema_power_rv_configure4science = TRUE ? next(status__in__set_bema_power_rv_configure4science) : bema_power) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_bema_power_rv_configure4travel = TRUE ? next(status__in__set_bema_power_rv_configure4travel) : bema_power) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_bema_power_rv_configurereset = TRUE ? next(status__in__set_bema_power_rv_configurereset) : bema_power) ;
TRUE : bema_power;
esac;

        next(loccam_power) := case
Transition = loccam_initialise_durative :  (generatedEventPort__in__set_loccam_power_initialise = TRUE ? next(status__in__set_loccam_power_initialise) : loccam_power) ;
Transition = gnc_all_states_preeffects_of_act_loccam_initialise :  (generatedEventPort__in__set_loccam_power_initialise = TRUE ? next(status__in__set_loccam_power_initialise) : loccam_power) ;
Transition = gnc_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_loccam_power_rv_configure4science = TRUE ? next(status__in__set_loccam_power_rv_configure4science) : loccam_power) ;
Transition = gnc_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_loccam_power_rv_configure4travel = TRUE ? next(status__in__set_loccam_power_rv_configure4travel) : loccam_power) ;
Transition = gnc_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_loccam_power_rv_configurereset = TRUE ? next(status__in__set_loccam_power_rv_configurereset) : loccam_power) ;
TRUE : loccam_power;
esac;

        next(status__in__set_sys_time_seconds_loccam_initialise) := case
TRUE : status__in__set_sys_time_seconds_loccam_initialise;
esac;

        next(status__in__set_sys_energy_used_loccam_initialise) := case
TRUE : status__in__set_sys_energy_used_loccam_initialise;
esac;

        next(status__in__set_sys_time_seconds_imu_initialise) := case
TRUE : status__in__set_sys_time_seconds_imu_initialise;
esac;

        next(status__in__set_sys_energy_used_imu_initialise) := case
TRUE : status__in__set_sys_energy_used_imu_initialise;
esac;

        next(status__in__set_sys_time_seconds_gnc_updateheading) := case
TRUE : status__in__set_sys_time_seconds_gnc_updateheading;
esac;

        next(status__in__set_sys_energy_used_gnc_updateheading) := case
TRUE : status__in__set_sys_energy_used_gnc_updateheading;
esac;

        next(status__in__set_sys_time_seconds_gnc_updateposition) := case
TRUE : status__in__set_sys_time_seconds_gnc_updateposition;
esac;

        next(status__in__set_sys_energy_used_gnc_updateposition) := case
TRUE : status__in__set_sys_energy_used_gnc_updateposition;
esac;

        next(status__in__set_sys_time_seconds_gnc_fpath_straight) := case
TRUE : status__in__set_sys_time_seconds_gnc_fpath_straight;
esac;

        next(status__in__set_sys_energy_used_gnc_fpath_straight) := case
TRUE : status__in__set_sys_energy_used_gnc_fpath_straight;
esac;

        next(status__in__set_sys_time_seconds_bema_initialise) := case
TRUE : status__in__set_sys_time_seconds_bema_initialise;
esac;

        next(status__in__set_sys_energy_used_bema_initialise) := case
TRUE : status__in__set_sys_energy_used_bema_initialise;
esac;

        next(performed__in__loccam_initialise_done) := case
TRUE : performed__in__loccam_initialise_done;
esac;

        next(performed__in__imu_initialise_done) := case
TRUE : performed__in__imu_initialise_done;
esac;

        next(performed__in__gnc_fpath_straight_done) := case
TRUE : performed__in__gnc_fpath_straight_done;
esac;

        next(performed__in__bema_initialise_done) := case
TRUE : performed__in__bema_initialise_done;
esac;

        next(performed__in__gnc_updateposition_done) := case
TRUE : performed__in__gnc_updateposition_done;
esac;

        next(performed__in__gnc_updateheading_done) := case
TRUE : performed__in__gnc_updateheading_done;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_loccam_initialise) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_loccam_initialise;
esac;

        next(generatedEventPort__in__set_sys_energy_used_loccam_initialise) := case
TRUE : generatedEventPort__in__set_sys_energy_used_loccam_initialise;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_imu_initialise) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_imu_initialise;
esac;

        next(generatedEventPort__in__set_sys_energy_used_imu_initialise) := case
TRUE : generatedEventPort__in__set_sys_energy_used_imu_initialise;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_gnc_updateheading) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_gnc_updateheading;
esac;

        next(generatedEventPort__in__set_sys_energy_used_gnc_updateheading) := case
TRUE : generatedEventPort__in__set_sys_energy_used_gnc_updateheading;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_gnc_updateposition) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_gnc_updateposition;
esac;

        next(generatedEventPort__in__set_sys_energy_used_gnc_updateposition) := case
TRUE : generatedEventPort__in__set_sys_energy_used_gnc_updateposition;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_gnc_fpath_straight;
esac;

        next(generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight) := case
TRUE : generatedEventPort__in__set_sys_energy_used_gnc_fpath_straight;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_bema_initialise) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_bema_initialise;
esac;

        next(generatedEventPort__in__set_sys_energy_used_bema_initialise) := case
TRUE : generatedEventPort__in__set_sys_energy_used_bema_initialise;
esac;

    INIT (InitTransition = _gnc_SM_to_gnc_all_states_ -> State = gnc_all_states);

    TRANS (Transition = gnc_updateheading_durative -> (((performed__in__act_gnc_updateheading_done_input = TRUE & ((generatedEventPort__in__set_imu_status_gnc_updateheading = TRUE | generatedEventPort__in__set_imu_power_gnc_updateheading = TRUE) | generatedEventPort__in__set_heading_updated_gnc_updateheading = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = bema_initialise_durative -> (((performed__in__act_bema_initialise_done_input = TRUE & (generatedEventPort__in__set_bema_status_initialise = TRUE | generatedEventPort__in__set_bema_power_initialise = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = loccam_initialise_durative -> (((performed__in__act_loccam_initialise_done_input = TRUE & (generatedEventPort__in__set_loccam_status_initialise = TRUE | generatedEventPort__in__set_loccam_power_initialise = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = imu_initialise_durative -> (((performed__in__act_imu_initialise_done_input = TRUE & (generatedEventPort__in__set_imu_status_initialise = TRUE | generatedEventPort__in__set_imu_power_initialise = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_fpath_straight_durative -> ((performed__in__act_gnc_fpath_straight_done_input = TRUE & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_updateposition_durative -> (((performed__in__act_gnc_updateposition_done_input = TRUE & generatedEventPort__in__set_position_updated_gnc_updateposition = TRUE) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = _gnc_all_states_to_gnc_all_states_ -> ((!((((((((((((((((((((((((((((((((((((generatedEventPort__in__set_loccam_power_initialise = TRUE | generatedEventPort__in__set_loccam_status_initialise = TRUE) | generatedEventPort__in__set_imu_power_initialise = TRUE) | generatedEventPort__in__set_imu_status_initialise = TRUE) | generatedEventPort__in__set_imu_power_gnc_updateheading = TRUE) | generatedEventPort__in__set_imu_status_gnc_updateheading = TRUE) | generatedEventPort__in__set_heading_updated_gnc_updateheading = TRUE) | generatedEventPort__in__set_position_updated_gnc_updateposition = TRUE) | generatedEventPort__in__set_bema_power_initialise = TRUE) | generatedEventPort__in__set_bema_status_initialise = TRUE) | generatedEventPort__in__set_imu_status_rv_configurereset = TRUE) | generatedEventPort__in__set_loccam_status_rv_configurereset = TRUE) | generatedEventPort__in__set_bema_status_rv_configurereset = TRUE) | generatedEventPort__in__set_loccam_power_rv_configurereset = TRUE) | generatedEventPort__in__set_imu_power_rv_configurereset = TRUE) | generatedEventPort__in__set_bema_power_rv_configurereset = TRUE) | generatedEventPort__in__set_imu_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_loccam_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_bema_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_loccam_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_imu_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_bema_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_imu_status_rv_configure4science = TRUE) | generatedEventPort__in__set_loccam_status_rv_configure4science = TRUE) | generatedEventPort__in__set_bema_status_rv_configure4science = TRUE) | generatedEventPort__in__set_loccam_power_rv_configure4science = TRUE) | generatedEventPort__in__set_imu_power_rv_configure4science = TRUE) | generatedEventPort__in__set_bema_power_rv_configure4science = TRUE) | generatedEventPort__in__set_navcam_status_rv_configurereset = TRUE) | generatedEventPort__in__set_navcam_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_navcam_status_rv_configure4science = TRUE) | performed__in__act_gnc_updateheading_done_input = TRUE) | performed__in__act_bema_initialise_done_input = TRUE) | performed__in__act_loccam_initialise_done_input = TRUE) | performed__in__act_imu_initialise_done_input = TRUE) | performed__in__act_gnc_fpath_straight_done_input = TRUE) | performed__in__act_gnc_updateposition_done_input = TRUE) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_preeffects_of_act_bema_initialise -> (((startEvent__in__bema_initialise_start = TRUE & (generatedEventPort__in__set_bema_status_initialise = TRUE | generatedEventPort__in__set_bema_power_initialise = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_preeffects_of_act_gnc_updateheading -> (((startEvent__in__gnc_updateheading_start = TRUE & ((generatedEventPort__in__set_imu_status_gnc_updateheading = TRUE | generatedEventPort__in__set_imu_power_gnc_updateheading = TRUE) | generatedEventPort__in__set_heading_updated_gnc_updateheading = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_preeffects_of_act_gnc_updateposition -> (((startEvent__in__gnc_updateposition_start = TRUE & generatedEventPort__in__set_position_updated_gnc_updateposition = TRUE) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_preeffects_of_act_imu_initialise -> (((startEvent__in__imu_initialise_start = TRUE & (generatedEventPort__in__set_imu_status_initialise = TRUE | generatedEventPort__in__set_imu_power_initialise = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_preeffects_of_act_loccam_initialise -> (((startEvent__in__loccam_initialise_start = TRUE & (generatedEventPort__in__set_loccam_status_initialise = TRUE | generatedEventPort__in__set_loccam_power_initialise = TRUE)) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_setter_from_act_rv_configure4science -> ((((((((generatedEventPort__in__set_imu_status_rv_configure4science = TRUE | generatedEventPort__in__set_navcam_status_rv_configure4science = TRUE) | generatedEventPort__in__set_loccam_status_rv_configure4science = TRUE) | generatedEventPort__in__set_bema_status_rv_configure4science = TRUE) | generatedEventPort__in__set_loccam_power_rv_configure4science = TRUE) | generatedEventPort__in__set_imu_power_rv_configure4science = TRUE) | generatedEventPort__in__set_bema_power_rv_configure4science = TRUE) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_setter_from_act_rv_configure4travel -> ((((((((generatedEventPort__in__set_imu_status_rv_configure4travel = TRUE | generatedEventPort__in__set_navcam_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_loccam_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_bema_status_rv_configure4travel = TRUE) | generatedEventPort__in__set_loccam_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_imu_power_rv_configure4travel = TRUE) | generatedEventPort__in__set_bema_power_rv_configure4travel = TRUE) & State = gnc_all_states) & next(State) = gnc_all_states));

    TRANS (Transition = gnc_all_states_setter_from_act_rv_configurereset -> ((((((((generatedEventPort__in__set_imu_status_rv_configurereset = TRUE | generatedEventPort__in__set_navcam_status_rv_configurereset = TRUE) | generatedEventPort__in__set_loccam_status_rv_configurereset = TRUE) | generatedEventPort__in__set_bema_status_rv_configurereset = TRUE) | generatedEventPort__in__set_loccam_power_rv_configurereset = TRUE) | generatedEventPort__in__set_imu_power_rv_configurereset = TRUE) | generatedEventPort__in__set_bema_power_rv_configurereset = TRUE) & State = gnc_all_states) & next(State) = gnc_all_states));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE BEMA_Initialise(startEvent__in__startActivityPort, bema_status, bema_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_bema_status : {BEMA_STANDBY, BEMA_OFF};
        status__in__set_bema_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_bema_status : boolean;
        generatedEventPort__in__set_bema_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_BEMA_Initialise_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := bema_status = BEMA_OFF;
        getUpperBoundDuration := 10;
        getLowerBoundDuration := 10;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_BEMA_Initialise_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_BEMA_Initialise_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 10;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (10 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 606);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : BEMA_STANDBY;
TRUE : status__in__set_bema_status;
esac;

        next(status__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : 0;
TRUE : status__in__set_bema_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_bema_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_status;
TRUE : generatedEventPort__in__set_bema_status;
esac;

        next(generatedEventPort__in__set_bema_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_bema_power;
TRUE : generatedEventPort__in__set_bema_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_BEMA_Initialise_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE LocCam_Initialise(startEvent__in__startActivityPort, loccam_status, loccam_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_loccam_status : {LOCCAM_OFF, LOCCAM_STANDBY};
        status__in__set_loccam_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_loccam_status : boolean;
        generatedEventPort__in__set_loccam_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_LocCam_Initialise_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := loccam_status = LOCCAM_OFF;
        getUpperBoundDuration := 600;
        getLowerBoundDuration := 600;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_LocCam_Initialise_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_LocCam_Initialise_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 600;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (600 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 2520);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : LOCCAM_STANDBY;
TRUE : status__in__set_loccam_status;
esac;

        next(status__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : 1.63;
TRUE : status__in__set_loccam_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_loccam_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_status;
TRUE : generatedEventPort__in__set_loccam_status;
esac;

        next(generatedEventPort__in__set_loccam_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_loccam_power;
TRUE : generatedEventPort__in__set_loccam_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_LocCam_Initialise_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE IMU_Initialise(startEvent__in__startActivityPort, imu_status, imu_power, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_imu_status : {IMU_OFF, IMU_OPERATING};
        status__in__set_imu_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_imu_status : boolean;
        generatedEventPort__in__set_imu_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_IMU_Initialise_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := imu_status = IMU_OFF;
        getUpperBoundDuration := 10;
        getLowerBoundDuration := 10;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_IMU_Initialise_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_IMU_Initialise_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 10;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (10 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 72.7);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : IMU_OPERATING;
TRUE : status__in__set_imu_status;
esac;

        next(status__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : 7.27;
TRUE : status__in__set_imu_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_status;
TRUE : generatedEventPort__in__set_imu_status;
esac;

        next(generatedEventPort__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_power;
TRUE : generatedEventPort__in__set_imu_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_IMU_Initialise_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE GNC_UpdateHeading(startEvent__in__startActivityPort, imu_status, heading_updated, imu_power, sys_energy_used, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, bema_power, loccam_power, sys_time_seconds, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_imu_status : {IMU_OFF, IMU_OPERATING};
        status__in__set_imu_power : real;
        status__in__set_heading_updated : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_imu_status : boolean;
        generatedEventPort__in__set_imu_power : boolean;
        generatedEventPort__in__set_heading_updated : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_GNC_UpdateHeading_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := imu_status = IMU_OPERATING;
        getUpperBoundDuration := 25.0;
        getLowerBoundDuration := 25.0;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_GNC_UpdateHeading_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_GNC_UpdateHeading_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 25;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (25 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : IMU_OPERATING;
TRUE : status__in__set_imu_status;
esac;

        next(status__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : 7.27;
TRUE : status__in__set_imu_power;
esac;

        next(status__in__set_heading_updated) := case
Transition = _Progress_to_Idle_ : TRUE;
TRUE : status__in__set_heading_updated;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_imu_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_status;
TRUE : generatedEventPort__in__set_imu_status;
esac;

        next(generatedEventPort__in__set_imu_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_imu_power;
TRUE : generatedEventPort__in__set_imu_power;
esac;

        next(generatedEventPort__in__set_heading_updated) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_heading_updated;
TRUE : generatedEventPort__in__set_heading_updated;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_GNC_UpdateHeading_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE GNC_UpdatePosition(startEvent__in__startActivityPort, position_updated, sys_energy_used, sys_time_seconds, ade_left_power, ade_right_power, clupi_power, dhs_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_position_updated : boolean;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_position_updated : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_GNC_UpdatePosition_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := TRUE;
        getUpperBoundDuration := 5.0;
        getLowerBoundDuration := 5.0;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_GNC_UpdatePosition_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_GNC_UpdatePosition_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 5;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (5 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_position_updated) := case
Transition = _Progress_to_Idle_ : TRUE;
TRUE : status__in__set_position_updated;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_position_updated) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_position_updated;
TRUE : generatedEventPort__in__set_position_updated;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_GNC_UpdatePosition_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Dhs(startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, generatedEventPort__in__set_dhs_status_reduced2nominal, generatedEventPort__in__set_dhs_status_reduced2highpwr, generatedEventPort__in__set_dhs_power_reduced2nominal, generatedEventPort__in__set_dhs_power_reduced2highpwr, generatedEventPort__in__set_dhs_status_act_rv_wakeup, generatedEventPort__in__set_dhs_status_act_rv_configurereset, generatedEventPort__in__set_dhs_power_act_rv_wakeup, generatedEventPort__in__set_dhs_power_act_rv_configurereset, generatedEventPort__in__set_dhs_power_act_rv_prepare4night, generatedEventPort__in__set_dhs_status_act_rv_prepare4night, generatedEventPort__in__set_dhs_status_act_rv_configure4travel, generatedEventPort__in__set_dhs_power_act_rv_configure4travel, generatedEventPort__in__set_dhs_status_act_rv_configure4science, generatedEventPort__in__set_dhs_power_act_rv_configure4science, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, status__in__set_dhs_status_reduced2nominal, status__in__set_dhs_status_reduced2highpwr, status__in__set_dhs_power_reduced2nominal, status__in__set_dhs_power_reduced2highpwr, status__in__set_dhs_status_act_rv_wakeup, status__in__set_dhs_status_act_rv_configurereset, status__in__set_dhs_power_act_rv_wakeup, status__in__set_dhs_power_act_rv_configurereset, status__in__set_dhs_power_act_rv_prepare4night, status__in__set_dhs_status_act_rv_prepare4night, status__in__set_dhs_status_act_rv_configure4travel, status__in__set_dhs_power_act_rv_configure4travel, status__in__set_dhs_status_act_rv_configure4science, status__in__set_dhs_power_act_rv_configure4science)
    VAR
        act_dhs_reduced2highpwr : DHS_Reduced2HighPwr(startEvent__in__start_dhs_reduced2highpwr, dhs_op_set_SM.dhs_status, sys_energy_used, dhs_op_set_SM.dhs_power, sys_time_seconds, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__start_dhs_reduced2highpwr);
        act_dhs_reduced2nominal : DHS_Reduced2Nominal(startEvent__in__start_dhs_reduced2nominal, dhs_op_set_SM.dhs_status, sys_energy_used, dhs_op_set_SM.dhs_power, sys_time_seconds, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__start_dhs_reduced2nominal);
        dhs_op_set_SM : Dhs_SM(startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, next(act_dhs_reduced2nominal.generatedEventPort__in__set_dhs_status) != act_dhs_reduced2nominal.generatedEventPort__in__set_dhs_status, next(act_dhs_reduced2highpwr.generatedEventPort__in__set_dhs_status) != act_dhs_reduced2highpwr.generatedEventPort__in__set_dhs_status, next(act_dhs_reduced2nominal.generatedEventPort__in__set_dhs_power) != act_dhs_reduced2nominal.generatedEventPort__in__set_dhs_power, next(act_dhs_reduced2highpwr.generatedEventPort__in__set_dhs_power) != act_dhs_reduced2highpwr.generatedEventPort__in__set_dhs_power, generatedEventPort__in__set_dhs_status_act_rv_wakeup, generatedEventPort__in__set_dhs_status_act_rv_configurereset, generatedEventPort__in__set_dhs_power_act_rv_wakeup, generatedEventPort__in__set_dhs_power_act_rv_configurereset, generatedEventPort__in__set_dhs_power_act_rv_prepare4night, generatedEventPort__in__set_dhs_status_act_rv_prepare4night, generatedEventPort__in__set_dhs_status_act_rv_configure4travel, generatedEventPort__in__set_dhs_power_act_rv_configure4travel, generatedEventPort__in__set_dhs_status_act_rv_configure4science, generatedEventPort__in__set_dhs_power_act_rv_configure4science, next(act_dhs_reduced2nominal.performed__in__activityPerformedPort) != act_dhs_reduced2nominal.performed__in__activityPerformedPort, next(act_dhs_reduced2highpwr.performed__in__activityPerformedPort) != act_dhs_reduced2highpwr.performed__in__activityPerformedPort, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, act_dhs_reduced2nominal.status__in__set_dhs_status, act_dhs_reduced2highpwr.status__in__set_dhs_status, act_dhs_reduced2nominal.status__in__set_dhs_power, act_dhs_reduced2highpwr.status__in__set_dhs_power, status__in__set_dhs_status_act_rv_wakeup, status__in__set_dhs_status_act_rv_configurereset, status__in__set_dhs_power_act_rv_wakeup, status__in__set_dhs_power_act_rv_configurereset, status__in__set_dhs_power_act_rv_prepare4night, status__in__set_dhs_status_act_rv_prepare4night, status__in__set_dhs_status_act_rv_configure4travel, status__in__set_dhs_power_act_rv_configure4travel, status__in__set_dhs_status_act_rv_configure4science, status__in__set_dhs_power_act_rv_configure4science);
    DEFINE
        generatedEventPort__in__set_sys_energy_used_reduced2highpwr := act_dhs_reduced2highpwr.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_energy_used_reduced2nominal := act_dhs_reduced2nominal.generatedEventPort__in__set_sys_energy_used;
        generatedEventPort__in__set_sys_time_seconds_reduced2highpwr := act_dhs_reduced2highpwr.generatedEventPort__in__set_sys_time_seconds;
        generatedEventPort__in__set_sys_time_seconds_reduced2nominal := act_dhs_reduced2nominal.generatedEventPort__in__set_sys_time_seconds;
        performed__in__dhs_reduced2highpwr_done := act_dhs_reduced2highpwr.performed__in__activityPerformedPort;
        performed__in__dhs_reduced2nominal_done := act_dhs_reduced2nominal.performed__in__activityPerformedPort;
        status__in__set_sys_energy_used_reduced2highpwr := act_dhs_reduced2highpwr.status__in__set_sys_energy_used;
        status__in__set_sys_energy_used_reduced2nominal := act_dhs_reduced2nominal.status__in__set_sys_energy_used;
        status__in__set_sys_time_seconds_reduced2highpwr := act_dhs_reduced2highpwr.status__in__set_sys_time_seconds;
        status__in__set_sys_time_seconds_reduced2nominal := act_dhs_reduced2nominal.status__in__set_sys_time_seconds;
        dhs_power := dhs_op_set_SM.dhs_power;
        dhs_status := dhs_op_set_SM.dhs_status;


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE DHS_Reduced2HighPwr(startEvent__in__startActivityPort, dhs_status, sys_energy_used, dhs_power, sys_time_seconds, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_DHS_Reduced2HighPwr_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := dhs_status = DHS_REDUCED;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_DHS_Reduced2HighPwr_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_DHS_Reduced2HighPwr_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_HIGHPOWER;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 22.49;
TRUE : status__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_DHS_Reduced2HighPwr_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE DHS_Reduced2Nominal(startEvent__in__startActivityPort, dhs_status, sys_energy_used, dhs_power, sys_time_seconds, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__startActivityPort)
    VAR
        State : {Idle, Progress, t};
        lbDuration : real;
        ubDuration : real;
        c : clock;
        status__in__set_sys_time_seconds : real;
        status__in__set_sys_energy_used : real;
        status__in__set_dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        status__in__set_dhs_power : real;
        generatedEventPort__in__set_sys_time_seconds : boolean;
        generatedEventPort__in__set_sys_energy_used : boolean;
        generatedEventPort__in__set_dhs_status : boolean;
        generatedEventPort__in__set_dhs_power : boolean;
        performed__in__activityPerformedPort : boolean;

    IVAR
        Transition : {_Idle_to_Progress_, _Progress_to_Idle_, _Idle_to_Idle_, _Progress_to_Progress_};

    FROZENVAR
        InitTransition : {_activityBehavior_DHS_Reduced2Nominal_to_Idle_};

    DEFINE
        postcondition := TRUE;
        precondition := dhs_status = DHS_REDUCED;
        getUpperBoundDuration := 1;
        getLowerBoundDuration := 1;

    ASSIGN
        init(lbDuration) := case
InitTransition = _activityBehavior_DHS_Reduced2Nominal_to_Idle_ : getLowerBoundDuration;
esac;
        init(ubDuration) := case
InitTransition = _activityBehavior_DHS_Reduced2Nominal_to_Idle_ : getUpperBoundDuration;
esac;
        next(lbDuration) := case
TRUE : lbDuration;
esac;

        next(ubDuration) := case
TRUE : ubDuration;
esac;

        next(c) := case
Transition = _Idle_to_Progress_ : 0;
TRUE : c;
esac;

        next(status__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : sys_time_seconds + 1;
TRUE : status__in__set_sys_time_seconds;
esac;

        next(status__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : sys_energy_used + (1 * ((((((((ade_left_power + ade_right_power) + clupi_power) + dhs_power) + drill_power) + rtb_power) + imu_power) + bema_power) + loccam_power) + 0);
TRUE : status__in__set_sys_energy_used;
esac;

        next(status__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : DHS_NOMINAL;
TRUE : status__in__set_dhs_status;
esac;

        next(status__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : 12.55;
TRUE : status__in__set_dhs_power;
esac;

        next(generatedEventPort__in__set_sys_time_seconds) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_time_seconds;
TRUE : generatedEventPort__in__set_sys_time_seconds;
esac;

        next(generatedEventPort__in__set_sys_energy_used) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_sys_energy_used;
TRUE : generatedEventPort__in__set_sys_energy_used;
esac;

        next(generatedEventPort__in__set_dhs_status) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_status;
TRUE : generatedEventPort__in__set_dhs_status;
esac;

        next(generatedEventPort__in__set_dhs_power) := case
Transition = _Progress_to_Idle_ : !generatedEventPort__in__set_dhs_power;
TRUE : generatedEventPort__in__set_dhs_power;
esac;

        next(performed__in__activityPerformedPort) := case
Transition = _Progress_to_Idle_ : !performed__in__activityPerformedPort;
TRUE : performed__in__activityPerformedPort;
esac;

    INIT (InitTransition = _activityBehavior_DHS_Reduced2Nominal_to_Idle_ -> State = Idle);

    INVAR (State = Progress -> c <= duration__in__startActivityPort);

    INVAR (!TRUE | (duration__in__startActivityPort >= lbDuration & duration__in__startActivityPort <= ubDuration));

    TRANS (Transition = _Idle_to_Progress_ -> (((startEvent__in__startActivityPort = TRUE & precondition = TRUE) & State = Idle) & next(State) = Progress));

    TRANS (Transition = _Progress_to_Idle_ -> (((c = duration__in__startActivityPort & postcondition = TRUE) & State = Progress) & next(State) = Idle));

    TRANS (Transition = _Idle_to_Idle_ -> ((!startEvent__in__startActivityPort & State = Idle) & next(State) = Idle));

    TRANS (Transition = _Progress_to_Progress_ -> ((!startEvent__in__startActivityPort & State = Progress) & next(State) = Progress));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Dhs_SM(startEvent__in__start_dhs_reduced2nominal, startEvent__in__start_dhs_reduced2highpwr, generatedEventPort__in__set_dhs_status_reduced2nominal, generatedEventPort__in__set_dhs_status_reduced2highpwr, generatedEventPort__in__set_dhs_power_reduced2nominal, generatedEventPort__in__set_dhs_power_reduced2highpwr, generatedEventPort__in__set_dhs_status_act_rv_wakeup, generatedEventPort__in__set_dhs_status_act_rv_configurereset, generatedEventPort__in__set_dhs_power_act_rv_wakeup, generatedEventPort__in__set_dhs_power_act_rv_configurereset, generatedEventPort__in__set_dhs_power_act_rv_prepare4night, generatedEventPort__in__set_dhs_status_act_rv_prepare4night, generatedEventPort__in__set_dhs_status_act_rv_configure4travel, generatedEventPort__in__set_dhs_power_act_rv_configure4travel, generatedEventPort__in__set_dhs_status_act_rv_configure4science, generatedEventPort__in__set_dhs_power_act_rv_configure4science, performed__in__act_dhs_reduced2nominal_done_input, performed__in__act_dhs_reduced2highpwr_done_input, sys_time_seconds, sys_energy_used, ade_left_power, ade_right_power, clupi_power, drill_power, rtb_power, imu_power, bema_power, loccam_power, duration__in__start_dhs_reduced2nominal, duration__in__start_dhs_reduced2highpwr, status__in__set_dhs_status_reduced2nominal, status__in__set_dhs_status_reduced2highpwr, status__in__set_dhs_power_reduced2nominal, status__in__set_dhs_power_reduced2highpwr, status__in__set_dhs_status_act_rv_wakeup, status__in__set_dhs_status_act_rv_configurereset, status__in__set_dhs_power_act_rv_wakeup, status__in__set_dhs_power_act_rv_configurereset, status__in__set_dhs_power_act_rv_prepare4night, status__in__set_dhs_status_act_rv_prepare4night, status__in__set_dhs_status_act_rv_configure4travel, status__in__set_dhs_power_act_rv_configure4travel, status__in__set_dhs_status_act_rv_configure4science, status__in__set_dhs_power_act_rv_configure4science)
    VAR
        State : {dhs_all_states, t};
        c : clock;
        dhs_status : {DHS_LOWPOWER, DHS_REDUCED, DHS_NOMINAL, DHS_HIGHPOWER};
        dhs_power : real;
        status__in__set_sys_time_seconds_reduced2nominal : real;
        status__in__set_sys_time_seconds_reduced2highpwr : real;
        status__in__set_sys_energy_used_reduced2nominal : real;
        status__in__set_sys_energy_used_reduced2highpwr : real;
        performed__in__dhs_reduced2nominal_done : boolean;
        performed__in__dhs_reduced2highpwr_done : boolean;
        generatedEventPort__in__set_sys_time_seconds_reduced2nominal : boolean;
        generatedEventPort__in__set_sys_time_seconds_reduced2highpwr : boolean;
        generatedEventPort__in__set_sys_energy_used_reduced2nominal : boolean;
        generatedEventPort__in__set_sys_energy_used_reduced2highpwr : boolean;

    IVAR
        Transition : {dhs_reduced2nominal_durative, dhs_reduced2highpwr_durative, _dhs_all_states_to_dhs_all_states_, dhs_all_states_preeffects_of_act_dhs_reduced2highpwr, dhs_all_states_preeffects_of_act_dhs_reduced2nominal, dhs_all_states_setter_from_act_rv_configure4science, dhs_all_states_setter_from_act_rv_configure4travel, dhs_all_states_setter_from_act_rv_configurereset, dhs_all_states_setter_from_act_rv_prepare4night, dhs_all_states_setter_from_act_rv_wakeup};

    FROZENVAR
        InitTransition : {_dhs_op_set_SM_to_dhs_all_states_};

    ASSIGN
        init(dhs_status) := case
InitTransition = _dhs_op_set_SM_to_dhs_all_states_ : DHS_LOWPOWER;
esac;
        init(dhs_power) := case
InitTransition = _dhs_op_set_SM_to_dhs_all_states_ : 0;
esac;
        next(c) := case
TRUE : c;
esac;

        next(dhs_status) := case
Transition = dhs_reduced2nominal_durative :  (generatedEventPort__in__set_dhs_status_reduced2nominal = TRUE ? next(status__in__set_dhs_status_reduced2nominal) : dhs_status) ;
Transition = dhs_reduced2highpwr_durative :  (generatedEventPort__in__set_dhs_status_reduced2highpwr = TRUE ? next(status__in__set_dhs_status_reduced2highpwr) : dhs_status) ;
Transition = dhs_all_states_preeffects_of_act_dhs_reduced2highpwr :  (generatedEventPort__in__set_dhs_status_reduced2highpwr = TRUE ? next(status__in__set_dhs_status_reduced2highpwr) : dhs_status) ;
Transition = dhs_all_states_preeffects_of_act_dhs_reduced2nominal :  (generatedEventPort__in__set_dhs_status_reduced2nominal = TRUE ? next(status__in__set_dhs_status_reduced2nominal) : dhs_status) ;
Transition = dhs_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_dhs_status_act_rv_configure4science = TRUE ? next(status__in__set_dhs_status_act_rv_configure4science) : dhs_status) ;
Transition = dhs_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_dhs_status_act_rv_configure4travel = TRUE ? next(status__in__set_dhs_status_act_rv_configure4travel) : dhs_status) ;
Transition = dhs_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_dhs_status_act_rv_configurereset = TRUE ? next(status__in__set_dhs_status_act_rv_configurereset) : dhs_status) ;
Transition = dhs_all_states_setter_from_act_rv_prepare4night :  (generatedEventPort__in__set_dhs_status_act_rv_prepare4night = TRUE ? next(status__in__set_dhs_status_act_rv_prepare4night) : dhs_status) ;
Transition = dhs_all_states_setter_from_act_rv_wakeup :  (generatedEventPort__in__set_dhs_status_act_rv_wakeup = TRUE ? next(status__in__set_dhs_status_act_rv_wakeup) : dhs_status) ;
TRUE : dhs_status;
esac;

        next(dhs_power) := case
Transition = dhs_reduced2nominal_durative :  (generatedEventPort__in__set_dhs_power_reduced2nominal = TRUE ? next(status__in__set_dhs_power_reduced2nominal) : dhs_power) ;
Transition = dhs_reduced2highpwr_durative :  (generatedEventPort__in__set_dhs_power_reduced2highpwr = TRUE ? next(status__in__set_dhs_power_reduced2highpwr) : dhs_power) ;
Transition = dhs_all_states_preeffects_of_act_dhs_reduced2highpwr :  (generatedEventPort__in__set_dhs_power_reduced2highpwr = TRUE ? next(status__in__set_dhs_power_reduced2highpwr) : dhs_power) ;
Transition = dhs_all_states_preeffects_of_act_dhs_reduced2nominal :  (generatedEventPort__in__set_dhs_power_reduced2nominal = TRUE ? next(status__in__set_dhs_power_reduced2nominal) : dhs_power) ;
Transition = dhs_all_states_setter_from_act_rv_configure4science :  (generatedEventPort__in__set_dhs_power_act_rv_configure4science = TRUE ? next(status__in__set_dhs_power_act_rv_configure4science) : dhs_power) ;
Transition = dhs_all_states_setter_from_act_rv_configure4travel :  (generatedEventPort__in__set_dhs_power_act_rv_configure4travel = TRUE ? next(status__in__set_dhs_power_act_rv_configure4travel) : dhs_power) ;
Transition = dhs_all_states_setter_from_act_rv_configurereset :  (generatedEventPort__in__set_dhs_power_act_rv_configurereset = TRUE ? next(status__in__set_dhs_power_act_rv_configurereset) : dhs_power) ;
Transition = dhs_all_states_setter_from_act_rv_wakeup :  (generatedEventPort__in__set_dhs_power_act_rv_wakeup = TRUE ? next(status__in__set_dhs_power_act_rv_wakeup) : dhs_power) ;
TRUE : dhs_power;
esac;

        next(status__in__set_sys_time_seconds_reduced2nominal) := case
TRUE : status__in__set_sys_time_seconds_reduced2nominal;
esac;

        next(status__in__set_sys_time_seconds_reduced2highpwr) := case
TRUE : status__in__set_sys_time_seconds_reduced2highpwr;
esac;

        next(status__in__set_sys_energy_used_reduced2nominal) := case
TRUE : status__in__set_sys_energy_used_reduced2nominal;
esac;

        next(status__in__set_sys_energy_used_reduced2highpwr) := case
TRUE : status__in__set_sys_energy_used_reduced2highpwr;
esac;

        next(performed__in__dhs_reduced2nominal_done) := case
TRUE : performed__in__dhs_reduced2nominal_done;
esac;

        next(performed__in__dhs_reduced2highpwr_done) := case
TRUE : performed__in__dhs_reduced2highpwr_done;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_reduced2nominal) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_reduced2nominal;
esac;

        next(generatedEventPort__in__set_sys_time_seconds_reduced2highpwr) := case
TRUE : generatedEventPort__in__set_sys_time_seconds_reduced2highpwr;
esac;

        next(generatedEventPort__in__set_sys_energy_used_reduced2nominal) := case
TRUE : generatedEventPort__in__set_sys_energy_used_reduced2nominal;
esac;

        next(generatedEventPort__in__set_sys_energy_used_reduced2highpwr) := case
TRUE : generatedEventPort__in__set_sys_energy_used_reduced2highpwr;
esac;

    INIT (InitTransition = _dhs_op_set_SM_to_dhs_all_states_ -> State = dhs_all_states);

    TRANS (Transition = dhs_reduced2nominal_durative -> (((performed__in__act_dhs_reduced2nominal_done_input = TRUE & (generatedEventPort__in__set_dhs_status_reduced2nominal = TRUE | generatedEventPort__in__set_dhs_power_reduced2nominal = TRUE)) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_reduced2highpwr_durative -> (((performed__in__act_dhs_reduced2highpwr_done_input = TRUE & (generatedEventPort__in__set_dhs_status_reduced2highpwr = TRUE | generatedEventPort__in__set_dhs_power_reduced2highpwr = TRUE)) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = _dhs_all_states_to_dhs_all_states_ -> ((!(((((((((((((((generatedEventPort__in__set_dhs_status_reduced2nominal = TRUE | generatedEventPort__in__set_dhs_status_reduced2highpwr = TRUE) | generatedEventPort__in__set_dhs_power_reduced2nominal = TRUE) | generatedEventPort__in__set_dhs_power_reduced2highpwr = TRUE) | generatedEventPort__in__set_dhs_status_act_rv_wakeup = TRUE) | generatedEventPort__in__set_dhs_status_act_rv_configurereset = TRUE) | generatedEventPort__in__set_dhs_power_act_rv_wakeup = TRUE) | generatedEventPort__in__set_dhs_power_act_rv_configurereset = TRUE) | generatedEventPort__in__set_dhs_power_act_rv_prepare4night = TRUE) | generatedEventPort__in__set_dhs_status_act_rv_prepare4night = TRUE) | generatedEventPort__in__set_dhs_status_act_rv_configure4travel = TRUE) | generatedEventPort__in__set_dhs_power_act_rv_configure4travel = TRUE) | generatedEventPort__in__set_dhs_status_act_rv_configure4science = TRUE) | generatedEventPort__in__set_dhs_power_act_rv_configure4science = TRUE) | performed__in__act_dhs_reduced2nominal_done_input = TRUE) | performed__in__act_dhs_reduced2highpwr_done_input = TRUE) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_preeffects_of_act_dhs_reduced2highpwr -> (((startEvent__in__start_dhs_reduced2highpwr = TRUE & (generatedEventPort__in__set_dhs_status_reduced2highpwr = TRUE | generatedEventPort__in__set_dhs_power_reduced2highpwr = TRUE)) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_preeffects_of_act_dhs_reduced2nominal -> (((startEvent__in__start_dhs_reduced2nominal = TRUE & (generatedEventPort__in__set_dhs_status_reduced2nominal = TRUE | generatedEventPort__in__set_dhs_power_reduced2nominal = TRUE)) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_setter_from_act_rv_configure4science -> ((((generatedEventPort__in__set_dhs_power_act_rv_prepare4night = TRUE | generatedEventPort__in__set_dhs_status_act_rv_configure4science = TRUE) | generatedEventPort__in__set_dhs_power_act_rv_configure4science = TRUE) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_setter_from_act_rv_configure4travel -> (((generatedEventPort__in__set_dhs_status_act_rv_configure4travel = TRUE | generatedEventPort__in__set_dhs_power_act_rv_configure4travel = TRUE) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_setter_from_act_rv_configurereset -> (((generatedEventPort__in__set_dhs_status_act_rv_configurereset = TRUE | generatedEventPort__in__set_dhs_power_act_rv_configurereset = TRUE) & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_setter_from_act_rv_prepare4night -> ((generatedEventPort__in__set_dhs_status_act_rv_prepare4night = TRUE & State = dhs_all_states) & next(State) = dhs_all_states));

    TRANS (Transition = dhs_all_states_setter_from_act_rv_wakeup -> (((generatedEventPort__in__set_dhs_status_act_rv_wakeup = TRUE | generatedEventPort__in__set_dhs_power_act_rv_wakeup = TRUE) & State = dhs_all_states) & next(State) = dhs_all_states));


-- ===============================================================================
--                               End of module
-- ===============================================================================

-- ===============================================================================
MODULE Environment

-- ===============================================================================
--                               End of module
-- ===============================================================================
