#ifndef  BUOYLAUNCHERMSGS_H
#define  BUOYLAUNCHERMSGS_H

// Error codes re. Launcher status - to return in struct LauncherStatus
// member "bLauncherError"
enum lerrors
{
   LAUNCHER_OK = 0,
   LC_BAD_BUOY,
   NO_BUOY_AT_DATA_POS,
   NO_BUOY_AT_LAUNCH_POS,
   MAX_BUOY_ARCHIVE_BYTES,
   BUOY_NOT_PUSHED_OUT,
   DOOR_NOT_CLOSED,
   MAX_PICO_BYTES,
   BAD_XMODEM_RECV,
   BAD_XMODEM_SEND,
   ARGOS_FILE_CORRUPTED,
   ARCHIVE_FILE_CORRUPTED,
   BAD_BUOY_DISK,
   CANNOT_FIND_BUOY,
   WEIGHT_DISK_POS_UNKNOWN,
   WEIGHT_MOTOR_STALLED,
   WEIGHT_MOTOR_FAIL,
   ROTATE_TOO_FAST,
                              //
   FATAL_ERROR,               // error conditions after this one result
                              // in an unuseable buoy launcher
                              //
   ROT_MOTOR_DID_NOT_TURN,    // timeout waiting for limit switch
   ROT_MOTOR_STALLED,         // max current
   ROT_MOTOR_FAIL,            // 0 current
   CAROUSEL_POS_UNKNOWN,
   ARMS_MOTOR_DID_NOT_TURN,    // timeout waiting for limit switch
   ARMS_MOTOR_STALLED,         // max current
   ARMS_MOTOR_FAIL,            // 0 current
   ARMS_POSITION_UNKNOWN,
   ARMS_FAILED_DOWN,
   ARMS_NOT_DOWN,             // timeout waiting for down limit switch
   CANNOT_FIND_GOOD_BUOY,
///   WEIGHT_DISK_POS_UNKNOWN,
///   WEIGHT_MOTOR_STALLED,
///   WEIGHT_MOTOR_FAIL,
   BAD_LAUNCHER_DISK,
   DATA_FILE_CORRUPTED,
   END_OF_FILE,
   LAST_LAUNCHER_ERROR // always keep this last in the structure
};

// Error messages to go along with error codes
//
static char *error_msgs[] = {
  "Launcher_status_is_OK",
  "Buoy_in_data_position_is_not_responding",
  "No_buoy_at_data_position",
  "No_buoy_at_launch_position",
  "Buoy_archive_storage_is_full",
  "Buoy_not_ejected",
  "Ejector_door_not_closed",
  "Launcher_pico_storage_is_full",
  "Error_in_Xmodem_receive",
  "Error_in_Xmodem_send",
  "Launcher_ARGOS_file_corrupted",
  "Launcher_Archive_file_corrupted",
  "Buoy_disk_corrupted_or_not_functional",
  "Cannot_find_any_buoy",
  "Counter-weight_disk_position_unknown",
  "Counter-weight_motor_stalled",
  "Counter-weight_motor_failure",
  "Carousel_rotated_too_fast",

  "Fatal_Launcher_Error_(no_message)",

  "Carousel_not_turning",
  "Carousel_motor_is_stalled_(current_maxed-out)",
  "Carousel_motor_failure_(zero_measured_current)",
  "Carousel_position_unknown",
  "Ejector_motor_not_turning",
  "Ejector_motor_is_stalled_(current_maxed-out)",
  "Ejector_motor_failure_(zero_measured_current)",
  "Ejector_arms_in_unknown_position",
  "Ejector_arms_failed_on_return",
  "Ejector_arms_not_in_resting_position",
  "Cannot_find_a_buoy_that_will_communicate",
  "Launcher_disk_failure",
  "Corrupted_data_file_in_Launcher_computer",
  "End_of_data_file_reached",
  "Last_Launcher_error_code_(no_message)"
};

#endif    //  BUOYLAUNCHERMSGS_H


