/*---------------------------------------------------------------------------*
 *  sysmana.d - LIBERO dialog data definitions for sysmana.c.                *
 *  Generated by LIBERO 2.4 on 11 Oct, 2010, 17:15.                          *
 *  Schema file used: smtschm.c.                                             *
 *---------------------------------------------------------------------------*/

/*- Symbolic constants and event numbers ------------------------------------*/

#define _LR_STOP                        0xFFFFL
#define _LR_NULL_EVENT                  -2
#define _LR_NULL_STATE                  -1
#define terminate_event                 -1
#define control_event                   0
#define control_master_event            1
#define error_event                     2
#define exception_event                 3
#define fatal_event                     4
#define halt_event                      5
#define list_event                      6
#define no_more_event                   7
#define normal_event                    8
#define ok_event                        9
#define pause_event                     10
#define pause_auto_event                11
#define pause_req_event                 12
#define paused_event                    13
#define refresh_event                   14
#define required_event                  15
#define restart_event                   16
#define running_event                   17
#define shutdown_event                  18
#define sock_closed_event               19
#define sock_error_event                20
#define sock_timeout_event              21
#define start_event                     22
#define start_auto_event                23
#define start_force_event               24
#define start_req_event                 25
#define status_event                    26
#define status_req_event                27
#define stop_event                      28
#define stop_force_event                29
#define stop_req_event                  30
#define stopped_event                   31
#define task_event                      32
#define task_alarm_event                33
#define task_failed_event               34
#define task_halted_event               35
#define _LR_STATE_after_init            0
#define _LR_STATE_control_master_input  1
#define _LR_STATE_control_message       2
#define _LR_STATE_control_refresh_task_stopping 3
#define _LR_STATE_control_refresh_task_wait_stop 4
#define _LR_STATE_control_status_task   5
#define _LR_STATE_control_status_task_wait 6
#define _LR_STATE_control_start_task    7
#define _LR_STATE_control_start_task_wait 8
#define _LR_STATE_control_pause_task    9
#define _LR_STATE_control_task_wait_pause 10
#define _LR_STATE_control_stop_task     11
#define _LR_STATE_control_task_wait_stop 12
#define _LR_STATE_task_stopped          13
#define _LR_STATE_task_running          14
#define _LR_STATE_task_paused           15
#define _LR_STATE_task_not_running      16
#define _LR_STATE_defaults              17
#define _LR_STATE_end_thread            18
#define _LR_defaults_state              17


/*- Function prototypes and macros ------------------------------------------*/

#ifndef MODULE
#define MODULE  static void             /*  Libero dialog modules            */
#endif

MODULE initialise_the_thread        (THREAD *thread);
MODULE load_global_configuration    (THREAD *thread);
MODULE open_master_log_file         (THREAD *thread);
MODULE create_task_threads          (THREAD *thread);
MODULE open_control_master_socket   (THREAD *thread);
MODULE wait_for_socket_input        (THREAD *thread);
MODULE control_ready_for_command    (THREAD *thread);
MODULE read_control_message         (THREAD *thread);
MODULE check_control_message        (THREAD *thread);
MODULE load_task_values             (THREAD *thread);
MODULE run_task_idle_command        (THREAD *thread);
MODULE refresh_logical_system_state (THREAD *thread);
MODULE accept_control_connection    (THREAD *thread);
MODULE control_list_of_tasks        (THREAD *thread);
MODULE control_halting              (THREAD *thread);
MODULE commit_outgoing_replies      (THREAD *thread);
MODULE shutdown_the_application     (THREAD *thread);
MODULE terminate_the_thread         (THREAD *thread);
MODULE get_first_affected_task      (THREAD *thread);
MODULE force_all_tasks              (THREAD *thread);
MODULE control_unrecognised_control (THREAD *thread);
MODULE pass_stop_to_task_thread     (THREAD *thread);
MODULE destroy_task_threads         (THREAD *thread);
MODULE close_manager_log_file       (THREAD *thread);
MODULE control_task_stopped_ok      (THREAD *thread);
MODULE get_next_affected_task       (THREAD *thread);
MODULE control_task_stopped_error   (THREAD *thread);
MODULE pass_status_to_task_thread   (THREAD *thread);
MODULE control_task_running         (THREAD *thread);
MODULE control_task_paused          (THREAD *thread);
MODULE control_task_stopped         (THREAD *thread);
MODULE pass_start_to_task_thread    (THREAD *thread);
MODULE control_task_started_ok      (THREAD *thread);
MODULE control_task_started_error   (THREAD *thread);
MODULE pass_pause_to_task_thread    (THREAD *thread);
MODULE control_task_paused_ok       (THREAD *thread);
MODULE control_task_paused_error    (THREAD *thread);
MODULE signal_task_stopped          (THREAD *thread);
MODULE load_task_time_slots         (THREAD *thread);
MODULE run_task_startup_command     (THREAD *thread);
MODULE monitor_active_task_status   (THREAD *thread);
MODULE signal_task_started_okay     (THREAD *thread);
MODULE signal_task_not_running      (THREAD *thread);
MODULE signal_task_running          (THREAD *thread);
MODULE signal_task_already_running  (THREAD *thread);
MODULE shut_down_child_task         (THREAD *thread);
MODULE run_task_cancel_command      (THREAD *thread);
MODULE signal_task_paused_okay      (THREAD *thread);
MODULE signal_task_stopped_okay     (THREAD *thread);
MODULE check_task_still_running     (THREAD *thread);
MODULE check_if_restartable_task    (THREAD *thread);
MODULE destroy_the_task             (THREAD *thread);
MODULE signal_task_paused           (THREAD *thread);
MODULE broadcast_stop_all_tasks     (THREAD *thread);
MODULE check_thread_type            (THREAD *thread);
MODULE signal_socket_error          (THREAD *thread);
MODULE log_invalid_dialog_event     (THREAD *thread);
MODULE signal_task_started_error    (THREAD *thread);
MODULE check_if_required_task       (THREAD *thread);

#define the_next_event              _the_next_event
#define the_exception_event         _the_exception_event
#define the_external_event          _the_external_event
#define exception_raised            _exception_raised
#define io_completed                _io_completed


/*- Static areas shared by all threads --------------------------------------*/

static word _LR_nextst [19][36] =
{
    { 2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,13,0,0,0
    },
    { 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,2,0,0,2,2,0,0,0,9,0,0,0,3,0,0,0,0,0,0,0,7,0,0,0,5,0,11,0
     ,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,5,0,0,0,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,5,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,7,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,9,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,11,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,0,0,0,0,13,13,0,0,0,0,0,0,0,0,0,0,13,14,14,0
     ,13,0,13,13,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,0,0,0,0,15,15,0,0,0,0,0,14,0,0,0,0,14,14,14,0
     ,14,0,13,13,0,0,14,0,16
    },
    { 0,0,0,0,0,0,0,0,0,0,0,15,15,0,0,0,0,0,0,0,0,0,0,14,14,14,0
     ,15,0,13,15,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,13,14,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 17,17,17,18,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18
     ,18,18,17,17,17,17,17,17,17,17,17,17,17,17,16,17
    },
    { 18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,18,0,0,0
    }
};

static word _LR_action [19][36] =
{
    { 2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,3,0,0,0
    },
    { 0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,10,0,0,7,6,0,0,0,8,0,0,0,9,0,0,0,0,0,0,0,8,0,0,0,8,0,8,0
     ,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,12,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 0,0,14,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,19,0,0,0,0,0,0,0,0,0,0,17,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,18,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,22,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,25,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,2,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0
    },
    { 0,0,14,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,0,0,0,0,29,28,0,0,0,0,0,0,0,0,0,0,29,30,27,0
     ,26,0,29,28,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,0,0,0,0,35,33,0,0,0,0,0,38,0,0,0,0,29,29,32,0
     ,31,0,35,34,0,0,36,0,37
    },
    { 0,0,0,0,0,0,0,0,0,0,0,29,28,0,0,0,0,0,0,0,0,0,0,40,30,27,0
     ,39,0,29,28,0,0,0,0,0
    },
    { 0,0,0,0,0,0,0,0,43,0,0,0,0,0,0,42,41,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,0,0,0,0
    },
    { 48,48,48,44,46,48,48,48,48,48,48,48,48,48,48,48,48,48,44,44
     ,45,44,48,48,48,48,48,48,48,48,48,48,48,29,47,48
    },
    { 50,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     ,0,0,0,51,0,0,0
    }
};

#if (defined (SMT_PROFILE))
static word _LR_count [58];
static long _LR_time  [58];
static word _LR_flow  [19][36];
#endif

static word _LR_offset [] =
{
    0,
    0,
    6,
    10,
    14,
    17,
    19,
    24,
    29,
    31,
    34,
    39,
    41,
    50,
    53,
    56,
    58,
    61,
    64,
    67,
    69,
    71,
    74,
    77,
    79,
    82,
    85,
    87,
    94,
    96,
    97,
    103,
    105,
    107,
    113,
    119,
    124,
    127,
    129,
    136,
    138,
    143,
    147,
    151,
    154,
    156,
    159,
    161,
    164,
    166,
    170,
    172
};

static word _LR_vector [] =
{
    0,1,2,3,4,_LR_STOP,
    5,6,7,_LR_STOP,
    8,9,10,_LR_STOP,
    11,4,_LR_STOP,
    4,_LR_STOP,
    12,5,6,7,_LR_STOP,
    13,14,15,16,_LR_STOP,
    17,_LR_STOP,
    18,17,_LR_STOP,
    19,5,6,7,_LR_STOP,
    20,_LR_STOP,
    21,22,0,1,2,5,6,7,_LR_STOP,
    23,24,_LR_STOP,
    25,24,_LR_STOP,
    26,_LR_STOP,
    27,24,_LR_STOP,
    28,24,_LR_STOP,
    29,24,_LR_STOP,
    24,_LR_STOP,
    30,_LR_STOP,
    31,24,_LR_STOP,
    32,24,_LR_STOP,
    33,_LR_STOP,
    34,24,_LR_STOP,
    35,24,_LR_STOP,
    36,_LR_STOP,
    8,37,38,10,39,40,_LR_STOP,
    41,_LR_STOP,
    _LR_STOP,
    8,37,38,10,39,_LR_STOP,
    42,_LR_STOP,
    43,_LR_STOP,
    44,45,9,10,46,_LR_STOP,
    44,45,9,10,47,_LR_STOP,
    44,45,9,10,_LR_STOP,
    48,39,_LR_STOP,
    49,_LR_STOP,
    44,45,9,10,50,16,_LR_STOP,
    51,_LR_STOP,
    8,38,10,39,_LR_STOP,
    38,10,39,_LR_STOP,
    52,9,10,_LR_STOP,
    9,10,_LR_STOP,
    53,_LR_STOP,
    54,53,_LR_STOP,
    15,_LR_STOP,
    56,57,_LR_STOP,
    55,_LR_STOP,
    22,15,16,_LR_STOP,
    16,_LR_STOP,
    50,16,_LR_STOP
};

static HOOK *_LR_module [58] = {
    load_global_configuration,
    open_master_log_file,
    create_task_threads,
    open_control_master_socket,
    wait_for_socket_input,
    control_ready_for_command,
    read_control_message,
    check_control_message,
    load_task_values,
    run_task_idle_command,
    refresh_logical_system_state,
    accept_control_connection,
    control_list_of_tasks,
    control_halting,
    commit_outgoing_replies,
    shutdown_the_application,
    terminate_the_thread,
    get_first_affected_task,
    force_all_tasks,
    control_unrecognised_control,
    pass_stop_to_task_thread,
    destroy_task_threads,
    close_manager_log_file,
    control_task_stopped_ok,
    get_next_affected_task,
    control_task_stopped_error,
    pass_status_to_task_thread,
    control_task_running,
    control_task_paused,
    control_task_stopped,
    pass_start_to_task_thread,
    control_task_started_ok,
    control_task_started_error,
    pass_pause_to_task_thread,
    control_task_paused_ok,
    control_task_paused_error,
    signal_task_stopped,
    load_task_time_slots,
    run_task_startup_command,
    monitor_active_task_status,
    signal_task_started_okay,
    signal_task_not_running,
    signal_task_running,
    signal_task_already_running,
    shut_down_child_task,
    run_task_cancel_command,
    signal_task_paused_okay,
    signal_task_stopped_okay,
    check_task_still_running,
    check_if_restartable_task,
    destroy_the_task,
    signal_task_paused,
    broadcast_stop_all_tasks,
    check_thread_type,
    signal_socket_error,
    log_invalid_dialog_event,
    signal_task_started_error,
    check_if_required_task
};

#if (defined (DEBUG))
static char *_LR_mname [58] =
{
     "Load-Global-Configuration",
     "Open-Master-Log-File",
     "Create-Task-Threads",
     "Open-Control-Master-Socket",
     "Wait-For-Socket-Input",
     "Control-Ready-For-Command",
     "Read-Control-Message",
     "Check-Control-Message",
     "Load-Task-Values",
     "Run-Task-Idle-Command",
     "Refresh-Logical-System-State",
     "Accept-Control-Connection",
     "Control-List-Of-Tasks",
     "Control-Halting",
     "Commit-Outgoing-Replies",
     "Shutdown-The-Application",
     "Terminate-The-Thread",
     "Get-First-Affected-Task",
     "Force-All-Tasks",
     "Control-Unrecognised-Control",
     "Pass-Stop-To-Task-Thread",
     "Destroy-Task-Threads",
     "Close-Manager-Log-File",
     "Control-Task-Stopped-Ok",
     "Get-Next-Affected-Task",
     "Control-Task-Stopped-Error",
     "Pass-Status-To-Task-Thread",
     "Control-Task-Running",
     "Control-Task-Paused",
     "Control-Task-Stopped",
     "Pass-Start-To-Task-Thread",
     "Control-Task-Started-Ok",
     "Control-Task-Started-Error",
     "Pass-Pause-To-Task-Thread",
     "Control-Task-Paused-Ok",
     "Control-Task-Paused-Error",
     "Signal-Task-Stopped",
     "Load-Task-Time-Slots",
     "Run-Task-Startup-Command",
     "Monitor-Active-Task-Status",
     "Signal-Task-Started-Okay",
     "Signal-Task-Not-Running",
     "Signal-Task-Running",
     "Signal-Task-Already-Running",
     "Shut-Down-Child-Task",
     "Run-Task-Cancel-Command",
     "Signal-Task-Paused-Okay",
     "Signal-Task-Stopped-Okay",
     "Check-Task-Still-Running",
     "Check-If-Restartable-Task",
     "Destroy-The-Task",
     "Signal-Task-Paused",
     "Broadcast-Stop-All-Tasks",
     "Check-Thread-Type",
     "Signal-Socket-Error",
     "Log-Invalid-Dialog-Event",
     "Signal-Task-Started-Error",
     "Check-If-Required-Task"
};

static char *_LR_sname [19] =
{
     "After-Init",
     "Control-Master-Input",
     "Control-Message",
     "Control-Refresh-Task-Stopping",
     "Control-Refresh-Task-Wait-Stop",
     "Control-Status-Task",
     "Control-Status-Task-Wait",
     "Control-Start-Task",
     "Control-Start-Task-Wait",
     "Control-Pause-Task",
     "Control-Task-Wait-Pause",
     "Control-Stop-Task",
     "Control-Task-Wait-Stop",
     "Task-Stopped",
     "Task-Running",
     "Task-Paused",
     "Task-Not-Running",
     "Defaults",
     "End-Thread"
};

static char *_LR_ename [36] =
{
     "Control-Event",
     "Control-Master-Event",
     "Error-Event",
     "Exception-Event",
     "Fatal-Event",
     "Halt-Event",
     "List-Event",
     "No-More-Event",
     "Normal-Event",
     "Ok-Event",
     "Pause-Event",
     "Pause-Auto-Event",
     "Pause-Req-Event",
     "Paused-Event",
     "Refresh-Event",
     "Required-Event",
     "Restart-Event",
     "Running-Event",
     "Shutdown-Event",
     "Sock-Closed-Event",
     "Sock-Error-Event",
     "Sock-Timeout-Event",
     "Start-Event",
     "Start-Auto-Event",
     "Start-Force-Event",
     "Start-Req-Event",
     "Status-Event",
     "Status-Req-Event",
     "Stop-Event",
     "Stop-Force-Event",
     "Stop-Req-Event",
     "Stopped-Event",
     "Task-Event",
     "Task-Alarm-Event",
     "Task-Failed-Event",
     "Task-Halted-Event"
};
#else
static char *_LR_mname [58] =
{
     "0",
     "1",
     "2",
     "3",
     "4",
     "5",
     "6",
     "7",
     "8",
     "9",
     "10",
     "11",
     "12",
     "13",
     "14",
     "15",
     "16",
     "17",
     "18",
     "19",
     "20",
     "21",
     "22",
     "23",
     "24",
     "25",
     "26",
     "27",
     "28",
     "29",
     "30",
     "31",
     "32",
     "33",
     "34",
     "35",
     "36",
     "37",
     "38",
     "39",
     "40",
     "41",
     "42",
     "43",
     "44",
     "45",
     "46",
     "47",
     "48",
     "49",
     "50",
     "51",
     "52",
     "53",
     "54",
     "55",
     "56",
     "57"
};

static char *_LR_sname [19] =
{
     "0",
     "1",
     "2",
     "3",
     "4",
     "5",
     "6",
     "7",
     "8",
     "9",
     "10",
     "11",
     "12",
     "13",
     "14",
     "15",
     "16",
     "17",
     "18"
};

static char *_LR_ename [36] =
{
     "0",
     "1",
     "2",
     "3",
     "4",
     "5",
     "6",
     "7",
     "8",
     "9",
     "10",
     "11",
     "12",
     "13",
     "14",
     "15",
     "16",
     "17",
     "18",
     "19",
     "20",
     "21",
     "22",
     "23",
     "24",
     "25",
     "26",
     "27",
     "28",
     "29",
     "30",
     "31",
     "32",
     "33",
     "34",
     "35"
};
#endif
