"""
Copyright (c) 2023, Miquel Massot
All rights reserved.
Licensed under the GPLv3 License.
See LICENSE.md file in the project root for full license information.
"""

"""
Error code returned by the API responses
"""
# No error detected
RESPONSE_ERROR_NONE = 0
# An unknown error has been detected
RESPONSE_ERROR_UNKNOWN = 1
# There is an error in the structure of the command
# Corruption is not guaranteed to produce a response
RESPONSE_ERROR_PAYLOAD = 2
# There is a error in the range of one of the supplied values.
RESPONSE_ERROR_VALUE_ERROR = 3
# The requested operation can not be completed while scanning
RESPONSE_ERROR_CANT_WHEN_SCANNING = 4
# Error writing to or opening file.
RESPONSE_ERROR_FILE = 5
# The requested operation requires connection to the scanner and is not connected.
RESPONSE_ERROR_NOT_CONNECTED = 6
# The requested operation can't be completed while monitor has control of the frame.
RESPONSE_ERROR_CANT_WHEN_MONITORING = 7
# Indicate that "StartScan" failed due to NAS mode being selected but not mounted.
RESPONSE_ERROR_CANT_SCAN_IN_NAS_WITHOUT_MOUNT = 8
# The requested scanner rotation failed because of bad rotation actuator condition.
RESPONSE_ERROR_RA_UNAVAILABLE = 9
# Can't update settings manually when autosetting is enabled
RESPONSE_ERROR_CANT_WHEN_AUTOSETTINGS = 10


def response_to_str(value):
    if value == RESPONSE_ERROR_NONE:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_UNKNOWN:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_PAYLOAD:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_VALUE_ERROR:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_CANT_WHEN_SCANNING:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_FILE:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_NOT_CONNECTED:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_CANT_WHEN_MONITORING:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_CANT_SCAN_IN_NAS_WITHOUT_MOUNT:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_RA_UNAVAILABLE:
        return "RESPONSE_ERROR_NONE"
    elif value == RESPONSE_ERROR_CANT_WHEN_AUTOSETTINGS:
        return "RESPONSE_ERROR_NONE"


""" Parameter used to set and get scanner configuration """
SCANNER_PARAM_PROFILE_GAP_PERMITTED = 0
SCANNER_PARAM_LASER_FREQ = 1
SCANNER_PARAM_STILL_FREQ = 2
SCANNER_PARAM_SCAN_START_ANGLE = 3
SCANNER_PARAM_SCAN_STOP_ANGLE = 4
SCANNER_PARAM_PROFILE_STEP_ANGLE = 5
SCANNER_PARAM_STILLS_STEP_ANGLE = 6
SCANNER_PARAM_PROFILE_LASER_EXP = 7
SCANNER_PARAM_PROFILE_STILLS_EXP = 8
SCANNER_PARAM_SCAN_LASER_EXP = 9
SCANNER_PARAM_SCAN_STILLS_EXP = 10
SCANNER_PARAM_LASER_SENSOR_GAIN = 11
SCANNER_PARAM_LASER_OUTPUT_GAIN = 12
SCANNER_PARAM_OUTPUT_LASER_DATA = 13
SCANNER_PARAM_DUMMY = 14
SCANNER_PARAM_LASER_MIN_RANGE = 15
SCANNER_PARAM_LASER_MAX_RANGE = 16
SCANNER_PARAM_INDEX_OF_REFRACTION = 17
SCANNER_PARAM_NOISE_FILTER = 18
SCANNER_PARAM_ANALYSIS_FILTER = 19
SCANNER_PARAM_AMBIENT_LIGHT_FILTER = 20
SCANNER_PARAM_MULTI_SAMPLE_VALUE = 21
SCANNER_PARAM_MULTI_SAMPLE_PASSED_TOLERANCE = 22
SCANNER_PARAM_MULTI_SAMPLE_TOLERANCE = 23
SCANNER_PARAM_LASER_SENSOR_BIN_LEVEL = 24
SCANNER_PARAM_MEMS_OUTPUT_ENABLE = 25
SCANNER_PARAM_LED_PANEL_INTENSITY = 26
SCANNER_PARAM_STILLS_SENSOR_8BIT_IMAGE = 27
SCANNER_PARAM_STILLS_SENSOR_BINNING = 28
SCANNER_PARAM_STILLS_SENSOR_ROI_WIDTH = 29
SCANNER_PARAM_STILLS_SENSOR_ROI_HEIGHT = 30
"""
# *  0 - disable leveling
# *  1 - algorithmic enhancement mode
# *  2 - realistic enhancement mode
"""
SCANNER_PARAM_STILLS_IMAGE_LEVEL = 31
SCANNER_PARAM_STILLS_IMAGE_UNDISTORT = 32
SCANNER_PARAM_STILLS_IMAGE_SAVE_ORIGINAL = 33
"""
# *  0 - do not rotate
# *  1 - Rotate 90 degrees clockwise.
# *  2 - Rotate 180 degrees clockwise
# *  3 - Rotate 270 degrees clockwise
"""
SCANNER_PARAM_STILLS_IMAGE_ROTATION = 34
SCANNER_PARAM_STILLS_IMAGE_FORCE_MAX_FOV = 35
SCANNER_PARAM_LASER_DISABLE_RANGE_GATING = 36
"""
# *  0 - tif format without compression
# *  1 - compressed jpeg format (does not apply to raw images).
"""
SCANNER_PARAM_STILLS_PROCESSED_IMAGE_FORMAT = 37


def scanner_param_to_str(value):
    if value == SCANNER_PARAM_PROFILE_GAP_PERMITTED:
        return "SCANNER_PARAM_PROFILE_GAP_PERMITTED"
    elif value == SCANNER_PARAM_LASER_FREQ:
        return "SCANNER_PARAM_LASER_FREQ"
    elif value == SCANNER_PARAM_STILL_FREQ:
        return "SCANNER_PARAM_STILL_FREQ"
    elif value == SCANNER_PARAM_SCAN_START_ANGLE:
        return "SCANNER_PARAM_SCAN_START_ANGLE"
    elif value == SCANNER_PARAM_SCAN_STOP_ANGLE:
        return "SCANNER_PARAM_SCAN_STOP_ANGLE"
    elif value == SCANNER_PARAM_PROFILE_STEP_ANGLE:
        return "SCANNER_PARAM_PROFILE_STEP_ANGLE"
    elif value == SCANNER_PARAM_STILLS_STEP_ANGLE:
        return "SCANNER_PARAM_STILLS_STEP_ANGLE"
    elif value == SCANNER_PARAM_PROFILE_LASER_EXP:
        return "SCANNER_PARAM_PROFILE_LASER_EXP"
    elif value == SCANNER_PARAM_PROFILE_STILLS_EXP:
        return "SCANNER_PARAM_PROFILE_STILLS_EXP"
    elif value == SCANNER_PARAM_SCAN_LASER_EXP:
        return "SCANNER_PARAM_SCAN_LASER_EXP"
    elif value == SCANNER_PARAM_SCAN_STILLS_EXP:
        return "SCANNER_PARAM_SCAN_STILLS_EXP"
    elif value == SCANNER_PARAM_LASER_SENSOR_GAIN:
        return "SCANNER_PARAM_LASER_SENSOR_GAIN"
    elif value == SCANNER_PARAM_LASER_OUTPUT_GAIN:
        return "SCANNER_PARAM_LASER_OUTPUT_GAIN"
    elif value == SCANNER_PARAM_OUTPUT_LASER_DATA:
        return "SCANNER_PARAM_OUTPUT_LASER_DATA"
    elif value == SCANNER_PARAM_DUMMY:
        return "SCANNER_PARAM_DUMMY"
    elif value == SCANNER_PARAM_LASER_MIN_RANGE:
        return "SCANNER_PARAM_LASER_MIN_RANGE"
    elif value == SCANNER_PARAM_LASER_MAX_RANGE:
        return "SCANNER_PARAM_LASER_MAX_RANGE"
    elif value == SCANNER_PARAM_INDEX_OF_REFRACTION:
        return "SCANNER_PARAM_INDEX_OF_REFRACTION"
    elif value == SCANNER_PARAM_NOISE_FILTER:
        return "SCANNER_PARAM_NOISE_FILTER"
    elif value == SCANNER_PARAM_ANALYSIS_FILTER:
        return "SCANNER_PARAM_ANALYSIS_FILTER"
    elif value == SCANNER_PARAM_AMBIENT_LIGHT_FILTER:
        return "SCANNER_PARAM_AMBIENT_LIGHT_FILTER"
    elif value == SCANNER_PARAM_MULTI_SAMPLE_VALUE:
        return "SCANNER_PARAM_MULTI_SAMPLE_VALUE"
    elif value == SCANNER_PARAM_MULTI_SAMPLE_PASSED_TOLERANCE:
        return "SCANNER_PARAM_MULTI_SAMPLE_PASSED_TOLERANCE"
    elif value == SCANNER_PARAM_MULTI_SAMPLE_TOLERANCE:
        return "SCANNER_PARAM_MULTI_SAMPLE_TOLERANCE"
    elif value == SCANNER_PARAM_LASER_SENSOR_BIN_LEVEL:
        return "SCANNER_PARAM_LASER_SENSOR_BIN_LEVEL"
    elif value == SCANNER_PARAM_MEMS_OUTPUT_ENABLE:
        return "SCANNER_PARAM_MEMS_OUTPUT_ENABLE"
    elif value == SCANNER_PARAM_LED_PANEL_INTENSITY:
        return "SCANNER_PARAM_LED_PANEL_INTENSITY"
    elif value == SCANNER_PARAM_STILLS_SENSOR_8BIT_IMAGE:
        return "SCANNER_PARAM_STILLS_SENSOR_8BIT_IMAGE"
    elif value == SCANNER_PARAM_STILLS_SENSOR_BINNING:
        return "SCANNER_PARAM_STILLS_SENSOR_BINNING"
    elif value == SCANNER_PARAM_STILLS_SENSOR_ROI_WIDTH:
        return "SCANNER_PARAM_STILLS_SENSOR_ROI_WIDTH"
    elif value == SCANNER_PARAM_STILLS_SENSOR_ROI_HEIGHT:
        return "SCANNER_PARAM_STILLS_SENSOR_ROI_HEIGHT"
    elif value == SCANNER_PARAM_STILLS_IMAGE_LEVEL:
        return "SCANNER_PARAM_STILLS_IMAGE_LEVEL"
    elif value == SCANNER_PARAM_STILLS_IMAGE_UNDISTORT:
        return "SCANNER_PARAM_STILLS_IMAGE_UNDISTORT"
    elif value == SCANNER_PARAM_STILLS_IMAGE_SAVE_ORIGINAL:
        return "SCANNER_PARAM_STILLS_IMAGE_SAVE_ORIGINAL"
    elif value == SCANNER_PARAM_STILLS_IMAGE_ROTATION:
        return "SCANNER_PARAM_STILLS_IMAGE_ROTATION"
    elif value == SCANNER_PARAM_STILLS_IMAGE_FORCE_MAX_FOV:
        return "SCANNER_PARAM_STILLS_IMAGE_FORCE_MAX_FOV"
    elif value == SCANNER_PARAM_LASER_DISABLE_RANGE_GATING:
        return "SCANNER_PARAM_LASER_DISABLE_RANGE_GATING"
    elif value == SCANNER_PARAM_STILLS_PROCESSED_IMAGE_FORMAT:
        return "SCANNER_PARAM_STILLS_PROCESSED_IMAGE_FORMAT"


""" Parameter used to send navigation data """
NAVDATA_TIME = 0
NAVDATA_ROLL = 1
NAVDATA_PITCH = 2
NAVDATA_HEADING = 3
NAVDATA_LATITUDE = 4
NAVDATA_LONGITUDE = 5
NAVDATA_ALTITUDE = 6
NAVDATA_RANGE = 7


def navdata_to_str(value):
    if value == NAVDATA_TIME:
        return "NAVDATA_TIME"
    elif value == NAVDATA_ROLL:
        return "NAVDATA_ROLL"
    elif value == NAVDATA_PITCH:
        return "NAVDATA_PITCH"
    elif value == NAVDATA_HEADING:
        return "NAVDATA_HEADING"
    elif value == NAVDATA_LATITUDE:
        return "NAVDATA_LATITUDE"
    elif value == NAVDATA_LONGITUDE:
        return "NAVDATA_LONGITUDE"
    elif value == NAVDATA_ALTITUDE:
        return "NAVDATA_ALTITUDE"
    elif value == NAVDATA_RANGE:
        return "NAVDATA_RANGE"


""" Parameter used to get API status """
API_STATUS_RAM = 0
API_STATUS_IO_READ = 1
API_STATUS_IO_WRITE = 2
API_STATUS_IO_OTHER = 3
API_STATUS_IO_TOTAL = 4
API_STATUS_LASER_AUTO_SETTINGS_ENABLED = 5
API_STATUS_STILLS_AUTO_SETTINGS_ENABLED = 6
API_STATUS_NUMBER_OF_TIMES_LASER_EXPOSURE_CORRECTED = 7
API_STATUS_NUMBER_OF_TIMES_STILLS_EXPOSURE_CORRECTED = 8


def api_status_to_str(value):
    if value == API_STATUS_RAM:
        return "API_STATUS_RAM"
    elif value == API_STATUS_IO_READ:
        return "API_STATUS_IO_READ"
    elif value == API_STATUS_IO_WRITE:
        return "API_STATUS_IO_WRITE"
    elif value == API_STATUS_IO_OTHER:
        return "API_STATUS_IO_OTHER"
    elif value == API_STATUS_IO_TOTAL:
        return "API_STATUS_IO_TOTAL"
    elif value == API_STATUS_LASER_AUTO_SETTINGS_ENABLED:
        return "API_STATUS_LASER_AUTO_SETTINGS_ENABLED"
    elif value == API_STATUS_STILLS_AUTO_SETTINGS_ENABLED:
        return "API_STATUS_STILLS_AUTO_SETTINGS_ENABLED"
    elif value == API_STATUS_NUMBER_OF_TIMES_LASER_EXPOSURE_CORRECTED:
        return "API_STATUS_NUMBER_OF_TIMES_LASER_EXPOSURE_CORRECTED"
    elif value == API_STATUS_NUMBER_OF_TIMES_STILLS_EXPOSURE_CORRECTED:
        return "API_STATUS_NUMBER_OF_TIMES_STILLS_EXPOSURE_CORRECTED"


""" Categories for scanner parameters """
SCANNER_PARAM_CAT_PROFILING_SPECIFIC = 0
SCANNER_PARAM_CAT_SCANNING_SPECIFIC = 1
SCANNER_PARAM_CAT_SCANNING_AND_PROFILING = 2
SCANNER_PARAM_CAT_ALGORITHM_GENERAL = 3
SCANNER_PARAM_CAT_ALGORITHM_SCANNING_SPECIFIC = 4
SCANNER_PARAM_CAT_OTHER = 5


def scanner_param_cat_to_str(value):
    if value == SCANNER_PARAM_CAT_PROFILING_SPECIFIC:
        return "SCANNER_PARAM_CAT_PROFILING_SPECIFIC"
    elif value == SCANNER_PARAM_CAT_SCANNING_SPECIFIC:
        return "SCANNER_PARAM_CAT_SCANNING_SPECIFIC"
    elif value == SCANNER_PARAM_CAT_SCANNING_AND_PROFILING:
        return "SCANNER_PARAM_CAT_SCANNING_AND_PROFILING"
    elif value == SCANNER_PARAM_CAT_ALGORITHM_GENERAL:
        return "SCANNER_PARAM_CAT_ALGORITHM_GENERAL"
    elif value == SCANNER_PARAM_CAT_ALGORITHM_SCANNING_SPECIFIC:
        return "SCANNER_PARAM_CAT_ALGORITHM_SCANNING_SPECIFIC"
    elif value == SCANNER_PARAM_CAT_OTHER:
        return "SCANNER_PARAM_CAT_OTHER"
    else:
        print("Unknown scanner parameter category:", value)
        return "Unknown"


""" API parameters"""
# * 0 - do not save 1 - save
API_PARAM_STILLS_IMAGE_SAVE_ORIGINAL = 0
# * 0 - do not undistort
# * 1 - undistort based on Axial model
# * 2 - TBD
API_PARAM_STILLS_IMAGE_UNDISTORT = 1
# * 0 - disable leveling
# * 1 - algorithmic enhancement mode
# * 2 - realistic enhancement mode
# * 3 - advanced enhancement mode
#
API_PARAM_STILLS_IMAGE_LEVEL = 2
# * Unused
API_PARAM_DUMMY_0 = 3
API_PARAM_DUMMY_1 = 4
# * 0 - do not covert (save image as 16 bit tif if needed)
# * 1 - save as 8 bit tif (has PPS as custom tag)
API_PARAM_STILLS_IMAGE_SAVE_8BIT = 5
# * The frame rate control variable in API configuration
# * TRUE: enable the frame rate control
# * FALSE: disable the frame rate control
API_PARAM_ENABLE_RAM_BUFF_MONITOR = 6
# *  0 - tif format without compression
# *  1 - compressed jpeg format (does not apply to raw images).
API_PARAM_STILLS_PROCESSED_IMAGE_FORMAT = 7
# Parameters for Advanced Stills enhancement see documentation for details
API_PARAM_STILLS_ADVANCED_COLOUR_MODE = 8
API_PARAM_STILLS_ADVANCED_COLOUR_ENHANCEMENT_LVL = 9
API_PARAM_STILLS_ADVANCED_CONTRAST_MODE = 10
API_PARAM_STILLS_ADVANCED_CONTRAST_LVL = 11
API_PARAM_STILLS_ADVANCED_BRIGHTNESS = 12
API_PARAM_STILLS_ADVANCED_CONTRAST = 13
API_PARAM_STILLS_ADVANCED_WHITE_BALANCE = 14
API_PARAM_STILLS_ADVANCED_ADAPTIVE_LIGHTING = 15


def api_param_stills_to_str(value):
    if value == API_PARAM_STILLS_IMAGE_SAVE_ORIGINAL:
        return "API_PARAM_STILLS_IMAGE_SAVE_ORIGINAL"
    elif value == API_PARAM_STILLS_IMAGE_UNDISTORT:
        return "API_PARAM_STILLS_IMAGE_UNDISTORT"
    elif value == API_PARAM_STILLS_IMAGE_LEVEL:
        return "API_PARAM_STILLS_IMAGE_LEVEL"
    elif value == API_PARAM_STILLS_IMAGE_SAVE_8BIT:
        return "API_PARAM_STILLS_IMAGE_SAVE_8BIT"
    elif value == API_PARAM_STILLS_PROCESSED_IMAGE_FORMAT:
        return "API_PARAM_STILLS_PROCESSED_IMAGE_FORMAT"
    elif value == API_PARAM_STILLS_ADVANCED_COLOUR_MODE:
        return "API_PARAM_STILLS_ADVANCED_COLOUR_MODE"
    elif value == API_PARAM_STILLS_ADVANCED_COLOUR_ENHANCEMENT_LVL:
        return "API_PARAM_STILLS_ADVANCED_COLOUR_ENHANCEMENT_LVL"
    elif value == API_PARAM_STILLS_ADVANCED_CONTRAST_MODE:
        return "API_PARAM_STILLS_ADVANCED_CONTRAST_MODE"
    elif value == API_PARAM_STILLS_ADVANCED_CONTRAST_LVL:
        return "API_PARAM_STILLS_ADVANCED_CONTRAST_LVL"
    elif value == API_PARAM_STILLS_ADVANCED_BRIGHTNESS:
        return "API_PARAM_STILLS_ADVANCED_BRIGHTNESS"
    elif value == API_PARAM_STILLS_ADVANCED_CONTRAST:
        return "API_PARAM_STILLS_ADVANCED_CONTRAST"
    elif value == API_PARAM_STILLS_ADVANCED_WHITE_BALANCE:
        return "API_PARAM_STILLS_ADVANCED_WHITE_BALANCE"
    elif value == API_PARAM_STILLS_ADVANCED_ADAPTIVE_LIGHTING:
        return "API_PARAM_STILLS_ADVANCED_ADAPTIVE_LIGHTING" 
    elif value == API_PARAM_DUMMY_0:
        return "API_PARAM_DUMMY_0"
    elif value == API_PARAM_DUMMY_1:
        return "API_PARAM_DUMMY_1"
    elif value == API_PARAM_ENABLE_RAM_BUFF_MONITOR:
        return "API_PARAM_ENABLE_RAM_BUFF_MONITOR"
    else:
        print("Unknown API parameter:", value)
        return "Unknown"


""" Scanner status """
SCANNER_STATUS_CONNECTED = 0
SCANNER_STATUS_READY = 1
SCANNER_STATUS_TCU_CONNECTED = 2
SCANNER_STATUS_TCU_READY = 3
SCANNER_STATUS_LASER_CAMERA_CONNECTED = 4
SCANNER_STATUS_LASER_CAMERA_READY = 5
SCANNER_STATUS_LASER_CONNECTED = 6
SCANNER_STATUS_LASER_READY = 7
SCANNER_STATUS_STILLS_CAMERA_CONNECTED = 8
SCANNER_STATUS_STILLS_CAMERA_READY = 9
SCANNER_STATUS_RA_CONNECTED = 10
SCANNER_STATUS_RA_READY = 11
SCANNER_STATUS_CH_CPU = 20
SCANNER_STATUS_CH_RAM = 21
SCANNER_STATUS_CH_SSD = 22
SCANNER_STATUS_LASER_CAM_CPU = 23
SCANNER_STATUS_LASER_CAM_RAM = 24
SCANNER_STATUS_LASER_CAM_SSD = 25
SCANNER_STATUS_STILLS_CAM_CPU = 26
SCANNER_STATUS_STILLS_CAM_RAM = 27
SCANNER_STATUS_STILLS_CAM_SSD = 28
SCANNER_STATUS_PROF_TRIG_MARGIN = 29
SCANNER_STATUS_LASER_CAM_POWER = 30
SCANNER_STATUS_STILLS_CAM_POWER = 31
SCANNER_STATUS_ETH_SPEED_TOPSIDE = 40
SCANNER_STATUS_ETH_SPEED_CH_TOPSIDE = 41
SCANNER_STATUS_ETH_SPEED_CH_BOTTOMSIDE = 42
SCANNER_STATUS_ETH_SPEED_LASER = 43
SCANNER_STATUS_ETH_SPEED_STILLS = 44
SCANNER_STATUS_ETH_CONGESTION_TOPSIDE = 45
SCANNER_STATUS_ETH_CONGESTION_LASER = 46
SCANNER_STATUS_ETH_CONGESTION_STILLS = 47
SCANNER_STATUS_CPU_TEMP_CH = 50
SCANNER_STATUS_CPU_TEMP_LASER = 51
SCANNER_STATUS_CPU_TEMP_STILLS = 52
SCANNER_STATUS_INTERNAL_TEMP_LASER = 53
SCANNER_STATUS_INTERNAL_TEMP_CH = 54
SCANNER_STATUS_INTERNAL_TEMP_LASER_SENSOR = 55
SCANNER_STATUS_INTERNAL_TEMP_STILLS_SENSOR = 56
SCANNER_STATUS_SENSOR_TEMP_LASER_SENSOR = 57
SCANNER_STATUS_SENSOR_TEMP_STILLS_SENSOR = 58
SCANNER_STATUS_LASER_DIODE_TEMP = 59
SCANNER_STATUS_HUMIDITY_LASER = 60
SCANNER_STATUS_HUMIDITY_CH = 61
SCANNER_STATUS_HUMIDITY_LASER_SENSOR = 62
SCANNER_STATUS_HUMIDITY_STILLS_SENSOR = 63
SCANNER_STATUS_LASER_TEMP_ERROR_ACTIVE = 64
SCANNER_STATUS_CURRENT_PPS_STATE = 70
SCANNER_STATUS_ZDA_LISTENER_ACTIVE = 72
SCANNER_STATUS_ZDA_TIME_LAST = 73
SCANNER_STATUS_ZDA_MAX_PERIOD_RECEIVED = 74
SCANNER_STATUS_TCU_PPS_TIME = 75
SCANNER_STATUS_TCU_TCU_TIME = 76
SCANNER_STATUS_PPS_PULSES_REJECTED = 77
SCANNER_STATUS_PPS_TAGS_REJECTED = 78
SCANNER_STATUS_PPS_STATE_CHANGE_COUNT = 79
SCANNER_STATUS_PPS_TCU_TIME_LAST_PULSE = 80
SCANNER_STATUS_PPS_TCU_TAG_TIME = 81
SCANNER_STATUS_PPS_TCU_LAST_TAG_TIME = 82
SCANNER_STATUS_NTP_STATE = 83
SCANNER_STATUS_COUNT_LASER_ENABLE_CH = 90
SCANNER_STATUS_COUNT_INHIBIT_CH = 91
SCANNER_STATUS_COUNT_LASER_SENSOR_TRIGGER_CH = 92
SCANNER_STATUS_COUNT_STILLS_SENSOR_TRIGGER_CH = 93
SCANNER_STATUS_COUNT_LASER_ARMING_CH = 94
SCANNER_STATUS_COUNT_PROFILE_SKIPPED_FROM_INHIBIT = 95
SCANNER_STATUS_COUNT_STILLS_SKIPPED_FROM_INHIBIT = 96
SCANNER_STATUS_COUNT_PPS_PULSES_CH = 97
SCANNER_STATUS_COUNT_PPS_TAGS_CH = 98
SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_TOPSIDE_CH = 100
SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_LASER = 101
SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_STILLS = 102
SCANNER_STATUS_COUNT_ETH_DATA_BUFF_CH = 103
SCANNER_STATUS_COUNT_ETH_CMD_BUFF_CH = 104
SCANNER_STATUS_COUNT_ETH_DATA_BUFF_LASER = 105
SCANNER_STATUS_COUNT_ETH_CMD_BUFF_LASER = 106
SCANNER_STATUS_COUNT_ETH_DATA_BUFF_STILLS = 107
SCANNER_STATUS_COUNT_ETH_CMD_BUFF_STILLS = 108
SCANNER_STATUS_COUNT_ETH_SPEED_CAHNGE_BOTTOMSIDE_CH = 109
SCANNER_STATUS_COUNT_LASER_IMAGE_CAPTURED = 110
SCANNER_STATUS_COUNT_LASER_IMAGE_RC_PROCESSED = 111
SCANNER_STATUS_COUNT_STILLS_IMAGE_CAPTURED = 112
SCANNER_STATUS_COUNT_STILLS_IMAGE_RC_PROCESSED = 113
SCANNER_STATUS_LASER_DONGLE_AT_CH = 120
SCANNER_STATUS_LASER_DONGLE_AT_LASER = 121
SCANNER_STATUS_LASER_PREPARED = 122
SCANNER_STATUS_LAST_SETTINGS_ID = 123
SCANNER_STATUS_SCAN_IN_PROGRESS = 124
SCANNER_STATUS_RA_HOMING_STATE = 130
SCANNER_STATUS_RA_MOTOR_STATE = 131
SCANNER_STATUS_RA_MOTOR_POS = 132
SCANNER_STATUS_CAL_PRESENT_LASER = 140
SCANNER_STATUS_CAL_PRESENT_LASER_SENSOR = 141
SCANNER_STATUS_CAL_PRESENT_LASER_TO_LASER_SENSOR = 142
SCANNER_STATUS_CAL_PRESENT_STILLS_SENSOR = 143
SCANNER_STATUS_CAL_PRESENT_STILLS_SENSOR_TO_LASER_SENSOR = 144
SCANNER_STATUS_CAL_DATA_LASER = 150
SCANNER_STATUS_CAL_DATA_LASER_SENSOR = 151
SCANNER_STATUS_CAL_DATA_LASER_TO_LASER_SENSOR = 152
SCANNER_STATUS_CAL_DATA_STILLS_SENSOR = 153
SCANNER_STATUS_CAL_DATA_STILLS_SENSOR_TO_LASER_SENSOR = 154
SCANNER_STATUS_CH_VERSION = 160
SCANNER_STATUS_TCU_VERSION = 161
SCANNER_STATUS_LASER_VERSION = 162
SCANNER_STATUS_LASER_CAM_VERSION = 163
SCANNER_STATUS_STILLS_CAM_VERSION = 164
SCANNER_STATUS_LASER_SENSOR_GAIN_SUPPORTED = 165
SCANNER_STATUS_LASER_CAM_STATUS = 166
SCANNER_STATUS_STILLS_CAM_STATUS = 167
SCANNER_STATUS_CH_ID = 170
SCANNER_STATUS_LASER_ID = 171
SCANNER_STATUS_LASER_CAM_ID = 172
SCANNER_STATUS_STILLS_CAM_ID = 173
SCANNER_STATUS_LASER_SENSOR_BITS = 180
SCANNER_STATUS_LASER_SENSOR_WIDTH = 181
SCANNER_STATUS_LASER_SENSOR_HEIGHT = 182
SCANNER_STATUS_STILLS_SENSOR_BITS = 183
SCANNER_STATUS_STILLS_SENSOR_WIDTH = 184
SCANNER_STATUS_STILLS_SENSOR_HEIGHT = 185
SCANNER_STATUS_LAST_RECEIVED_DATA_NUM = 186
SCANNER_STATUS_LAST_RECEIVED_CMD_NUM = 187
SCANNER_STATUS_LASER_INHIBIT_ENABLED = 189
SCANNER_STATUS_LASER_SAFETY_DISABLED = 190
SCANNER_STATUS_LASER_SENSOR_ACTUAL_FPS = 191
SCANNER_STATUS_LASER_SENSOR_ACTUAL_DATARATE = 192
SCANNER_STATUS_STILLS_SENSOR_ACTUAL_FPS = 193
SCANNER_STATUS_STILLS_SENSOR_ACTUAL_DATARATE = 194
SCANNER_STATUS_STILLS_RECEIVED_IMAGE_NUM = 195
SCANNER_STATUS_LED_PANEL_CONNECTED = 196
SCANNER_STATUS_LED_PANEL_READY = 197
SCANNER_STATUS_LED_PANEL_HEAT_STATE = 198
SCANNER_STATUS_LED_PANEL_TEMPERATURE = 199
SCANNER_STATUS_LED_PANEL_HUMIDITY = 200
SCANNER_STATUS_LED_PANEL_UV_COUNT = 201
SCANNER_STATUS_LED_PANEL_CURRENT_LIM = 202
SCANNER_STATUS_LASER_MCU_VERSION = 203
SCANNER_STATUS_STILLS_MCU_VERSION = 204
SCANNER_STATUS_NFS_RPC_CALLS = 205
SCANNER_STATUS_NFS_RPC_BADCALLS = 206
SCANNER_STATUS_NFS_RPC_RETRANS = 207
SCANNER_STATUS_NFS_RPC_BADXID = 208
SCANNER_STATUS_NFS_RPC_TIMEOUT = 209
SCANNER_STATUS_NFS_RPC_WAIT = 210
SCANNER_STATUS_NFS_RPC_NEWCRED = 211
SCANNER_STATUS_NFS_RPC_NULL = 212
SCANNER_STATUS_NAS_ENABLED = 213
# * 0 - indicates not_mount
# * 1 - indicates mount_pending
# * 2 - indicates mounted
# * 3 - indicates unmount_pending
SCANNER_STATUS_NAS_MOUNT_STATE = 214
SCANNER_STATUS_NAS_XYZ_STATUS = 215
SCANNER_STATUS_NAS_XYZ_PATH = 216
SCANNER_STATUS_NAS_STREAM_STATUS = 217
SCANNER_STATUS_NAS_STREAM_PATH = 218
SCANNER_STATUS_NAS_LASER_IMAGE_STATUS = 219
SCANNER_STATUS_NAS_LASER_IMAGE_PATH = 220
SCANNER_STATUS_NAS_STILLS_IMAGE_STATUS = 221
SCANNER_STATUS_NAS_STILLS_IMAGE_PATH = 222
SCANNER_STATUS_NAS_SKIPPED_PROFILES_BAD_DATA_POINT = 223
SCANNER_STATUS_NAS_SKIPPED_PROFILES_NOT_MOUNTED = 224
SCANNER_STATUS_NAS_SKIPPED_IMAGES_BAD_DATA_POINT = 225
SCANNER_STATUS_NAS_SKIPPED_IMAGES_NOT_MOUNTED = 226
SCANNER_STATUS_NAS_SKIPPED_IMAGES_PENDING_WRITES = 227
SCANNER_STATUS_NAS_SKIPPED_IMAGES_PENDING_PROCESSORS = 228
SCANNER_STATUS_STILLS_RECEIVED_PROPERTIES_NUM = 229
SCANNER_STATUS_NAS_LAS_STATUS = 230
SCANNER_STATUS_NAS_LAS_PATH = 231
SCANNER_STATUS_TARGET_DEVICE_TYPE = 232
SCANNER_STATUS_LOCAL_STORAGE_ENABLED = 233
SCANNER_STATUS_LOCAL_STORAGE_MOUNT_STATE = 234
SCANNER_STATUS_LOCAL_STORAGE_CAPACITY = 235
SCANNER_STATUS_LOCAL_STORAGE_FREE = 236
SCANNER_STATUS_LOCAL_STORAGE_AVAILABLE = 237
SCANNER_STATUS_STILLS_DATA_ANALYSIS_ENABLED = 238
SCANNER_STATUS_LATEST_STILLS_IMAGE_MIN_INTENSITY = 239
SCANNER_STATUS_LATEST_STILLS_IMAGE_MAX_INTENSITY = 240
SCANNER_STATUS_LATEST_STILLS_IMAGE_STD_DEV = 241
SCANNER_STATUS_LATEST_STILLS_IMAGE_MEAN_INTENSITY = 242
SCANNER_STATUS_LASER_DATA_ANALYSIS_ENABLED = 243
SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_INTENSITY = 244
SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_QUALITY = 245
SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_DEVIATION = 246
SCANNER_STATUS_LASER_MAX_AMBIENT_TEMPERATURE = 247
SCANNER_STATUS_STILLS_MAX_AMBIENT_TEMPERATURE = 248
SCANNER_STATUS_LATEST_STILLS_IMAGE_MEAN_SAMPLE_VALUE = 249
SCANNER_STATUS_LATEST_STILLS_IMAGE_SATURATION = 250
SCANNER_STATUS_CONFIGURATION_APPLIED = 251
SCANNER_STATUS_STILLS_VIGNETTING = 252
SCANNER_STATUS_CH_LEAK_COUNT = 253
SCANNER_STATUS_LED_BULKHEAD_1_STATE = 254
SCANNER_STATUS_LED_BULKHEAD_2_STATE = 255
SCANNER_STATUS_LED_BULKHEAD_3_STATE = 256
SCANNER_STATUS_LED_BULKHEAD_4_STATE = 257
SCANNER_STATUS_LED_PANEL_INPUT_UNDERVOLTAGE_COUNT = 258
SCANNER_STATUS_HM_CONNECTED = 259
SCANNER_STATUS_HM_READY = 260
SCANNER_STATUS_HM_LEAK_COUNT = 261
SCANNER_STATUS_HM_VOLTAGE = 262
SCANNER_STATUS_HM_CURRENT = 263
SCANNER_STATUS_HM_PRESSURE = 264
SCANNER_STATUS_HM_TEMPERATURE = 265
SCANNER_STATUS_NAV_LISTENER_READY = 266
SCANNER_STATUS_RANGE_LISTENER_READY = 267
SCANNER_STATUS_NAV_TIME_LAST = 268
SCANNER_STATUS_NAV_LAT = 269
SCANNER_STATUS_NAV_LON = 270
SCANNER_STATUS_NAV_ALTITUDE = 271
SCANNER_STATUS_NAV_HEADING = 272
SCANNER_STATUS_NAV_ROLL = 273
SCANNER_STATUS_NAV_PITCH = 274
SCANNER_STATUS_NAV_RANGE = 275
SCANNER_STATUS_NAS_STILLS_IMAGE_RAW_PATH = 276
SCANNER_STATUS_NAS_STILLS_IMAGE_RAW_STATUS = 277
SCANNER_STATUS_NAS_STILLS_IMAGE_PROCESSED_PATH = 278
SCANNER_STATUS_NAS_STILLS_IMAGE_PROCESSED_STATUS = 279
SCANNER_STATUS_CORR_MODEL_STATUS = 280
SCANNER_STATUS_CORR_CURRENT_MODEL = 281


def scanner_status_to_str(value):
    if value == SCANNER_STATUS_CONNECTED:
        return "SCANNER_STATUS_CONNECTED"
    elif value == SCANNER_STATUS_READY:
        return "SCANNER_STATUS_READY"
    elif value == SCANNER_STATUS_TCU_CONNECTED:
        return "SCANNER_STATUS_TCU_CONNECTED"
    elif value == SCANNER_STATUS_TCU_READY:
        return "SCANNER_STATUS_TCU_READY"
    elif value == SCANNER_STATUS_LASER_CAMERA_CONNECTED:
        return "SCANNER_STATUS_LASER_CAMERA_CONNECTED"
    elif value == SCANNER_STATUS_LASER_CAMERA_READY:
        return "SCANNER_STATUS_LASER_CAMERA_READY"
    elif value == SCANNER_STATUS_LASER_CONNECTED:
        return "SCANNER_STATUS_LASER_CONNECTED"
    elif value == SCANNER_STATUS_LASER_READY:
        return "SCANNER_STATUS_LASER_READY"
    elif value == SCANNER_STATUS_STILLS_CAMERA_CONNECTED:
        return "SCANNER_STATUS_STILLS_CAMERA_CONNECTED"
    elif value == SCANNER_STATUS_STILLS_CAMERA_READY:
        return "SCANNER_STATUS_STILLS_CAMERA_READY"
    elif value == SCANNER_STATUS_RA_CONNECTED:
        return "SCANNER_STATUS_RA_CONNECTED"
    elif value == SCANNER_STATUS_RA_READY:
        return "SCANNER_STATUS_RA_READY"
    elif value == SCANNER_STATUS_CH_CPU:
        return "SCANNER_STATUS_CH_CPU"
    elif value == SCANNER_STATUS_CH_RAM:
        return "SCANNER_STATUS_CH_RAM"
    elif value == SCANNER_STATUS_CH_SSD:
        return "SCANNER_STATUS_CH_SSD"
    elif value == SCANNER_STATUS_LASER_CAM_CPU:
        return "SCANNER_STATUS_LASER_CAM_CPU"
    elif value == SCANNER_STATUS_LASER_CAM_RAM:
        return "SCANNER_STATUS_LASER_CAM_RAM"
    elif value == SCANNER_STATUS_LASER_CAM_SSD:
        return "SCANNER_STATUS_LASER_CAM_SSD"
    elif value == SCANNER_STATUS_STILLS_CAM_CPU:
        return "SCANNER_STATUS_STILLS_CAM_CPU"
    elif value == SCANNER_STATUS_STILLS_CAM_RAM:
        return "SCANNER_STATUS_STILLS_CAM_RAM"
    elif value == SCANNER_STATUS_STILLS_CAM_SSD:
        return "SCANNER_STATUS_STILLS_CAM_SSD"
    elif value == SCANNER_STATUS_PROF_TRIG_MARGIN:
        return "SCANNER_STATUS_PROF_TRIG_MARGIN"
    elif value == SCANNER_STATUS_LASER_CAM_POWER:
        return "SCANNER_STATUS_LASER_CAM_POWER"
    elif value == SCANNER_STATUS_STILLS_CAM_POWER:
        return "SCANNER_STATUS_STILLS_CAM_POWER"
    elif value == SCANNER_STATUS_ETH_SPEED_TOPSIDE:
        return "SCANNER_STATUS_ETH_SPEED_TOPSIDE"
    elif value == SCANNER_STATUS_ETH_SPEED_CH_TOPSIDE:
        return "SCANNER_STATUS_ETH_SPEED_CH_TOPSIDE"
    elif value == SCANNER_STATUS_ETH_SPEED_CH_BOTTOMSIDE:
        return "SCANNER_STATUS_ETH_SPEED_CH_BOTTOMSIDE"
    elif value == SCANNER_STATUS_ETH_SPEED_LASER:
        return "SCANNER_STATUS_ETH_SPEED_LASER"
    elif value == SCANNER_STATUS_ETH_SPEED_STILLS:
        return "SCANNER_STATUS_ETH_SPEED_STILLS"
    elif value == SCANNER_STATUS_ETH_CONGESTION_TOPSIDE:
        return "SCANNER_STATUS_ETH_CONGESTION_TOPSIDE"
    elif value == SCANNER_STATUS_ETH_CONGESTION_LASER:
        return "SCANNER_STATUS_ETH_CONGESTION_LASER"
    elif value == SCANNER_STATUS_ETH_CONGESTION_STILLS:
        return "SCANNER_STATUS_ETH_CONGESTION_STILLS"
    elif value == SCANNER_STATUS_CPU_TEMP_CH:
        return "SCANNER_STATUS_CPU_TEMP_CH"
    elif value == SCANNER_STATUS_CPU_TEMP_LASER:
        return "SCANNER_STATUS_CPU_TEMP_LASER"
    elif value == SCANNER_STATUS_CPU_TEMP_STILLS:
        return "SCANNER_STATUS_CPU_TEMP_STILLS"
    elif value == SCANNER_STATUS_INTERNAL_TEMP_LASER:
        return "SCANNER_STATUS_INTERNAL_TEMP_LASER"
    elif value == SCANNER_STATUS_INTERNAL_TEMP_CH:
        return "SCANNER_STATUS_INTERNAL_TEMP_CH"
    elif value == SCANNER_STATUS_INTERNAL_TEMP_LASER_SENSOR:
        return "SCANNER_STATUS_INTERNAL_TEMP_LASER_SENSOR"
    elif value == SCANNER_STATUS_INTERNAL_TEMP_STILLS_SENSOR:
        return "SCANNER_STATUS_INTERNAL_TEMP_STILLS_SENSOR"
    elif value == SCANNER_STATUS_SENSOR_TEMP_LASER_SENSOR:
        return "SCANNER_STATUS_SENSOR_TEMP_LASER_SENSOR"
    elif value == SCANNER_STATUS_SENSOR_TEMP_STILLS_SENSOR:
        return "SCANNER_STATUS_SENSOR_TEMP_STILLS_SENSOR"
    elif value == SCANNER_STATUS_LASER_DIODE_TEMP:
        return "SCANNER_STATUS_LASER_DIODE_TEMP"
    elif value == SCANNER_STATUS_HUMIDITY_LASER:
        return "SCANNER_STATUS_HUMIDITY_LASER"
    elif value == SCANNER_STATUS_HUMIDITY_CH:
        return "SCANNER_STATUS_HUMIDITY_CH"
    elif value == SCANNER_STATUS_HUMIDITY_LASER_SENSOR:
        return "SCANNER_STATUS_HUMIDITY_LASER_SENSOR"
    elif value == SCANNER_STATUS_HUMIDITY_STILLS_SENSOR:
        return "SCANNER_STATUS_HUMIDITY_STILLS_SENSOR"
    elif value == SCANNER_STATUS_LASER_TEMP_ERROR_ACTIVE:
        return "SCANNER_STATUS_LASER_TEMP_ERROR_ACTIVE"
    elif value == SCANNER_STATUS_CURRENT_PPS_STATE:
        return "SCANNER_STATUS_CURRENT_PPS_STATE"
    elif value == SCANNER_STATUS_ZDA_LISTENER_ACTIVE:
        return "SCANNER_STATUS_ZDA_LISTENER_ACTIVE"
    elif value == SCANNER_STATUS_ZDA_TIME_LAST:
        return "SCANNER_STATUS_ZDA_TIME_LAST"
    elif value == SCANNER_STATUS_ZDA_MAX_PERIOD_RECEIVED:
        return "SCANNER_STATUS_ZDA_MAX_PERIOD_RECEIVED"
    elif value == SCANNER_STATUS_TCU_PPS_TIME:
        return "SCANNER_STATUS_TCU_PPS_TIME"
    elif value == SCANNER_STATUS_TCU_TCU_TIME:
        return "SCANNER_STATUS_TCU_TCU_TIME"
    elif value == SCANNER_STATUS_PPS_PULSES_REJECTED:
        return "SCANNER_STATUS_PPS_PULSES_REJECTED"
    elif value == SCANNER_STATUS_PPS_TAGS_REJECTED:
        return "SCANNER_STATUS_PPS_TAGS_REJECTED"
    elif value == SCANNER_STATUS_PPS_STATE_CHANGE_COUNT:
        return "SCANNER_STATUS_PPS_STATE_CHANGE_COUNT"
    elif value == SCANNER_STATUS_PPS_TCU_TIME_LAST_PULSE:
        return "SCANNER_STATUS_PPS_TCU_TIME_LAST_PULSE"
    elif value == SCANNER_STATUS_PPS_TCU_TAG_TIME:
        return "SCANNER_STATUS_PPS_TCU_TAG_TIME"
    elif value == SCANNER_STATUS_PPS_TCU_LAST_TAG_TIME:
        return "SCANNER_STATUS_PPS_TCU_LAST_TAG_TIME"
    elif value == SCANNER_STATUS_NTP_STATE:
        return "SCANNER_STATUS_NTP_STATE"
    elif value == SCANNER_STATUS_COUNT_LASER_ENABLE_CH:
        return "SCANNER_STATUS_COUNT_LASER_ENABLE_CH"
    elif value == SCANNER_STATUS_COUNT_INHIBIT_CH:
        return "SCANNER_STATUS_COUNT_INHIBIT_CH"
    elif value == SCANNER_STATUS_COUNT_LASER_SENSOR_TRIGGER_CH:
        return "SCANNER_STATUS_COUNT_LASER_SENSOR_TRIGGER_CH"
    elif value == SCANNER_STATUS_COUNT_STILLS_SENSOR_TRIGGER_CH:
        return "SCANNER_STATUS_COUNT_STILLS_SENSOR_TRIGGER_CH"
    elif value == SCANNER_STATUS_COUNT_LASER_ARMING_CH:
        return "SCANNER_STATUS_COUNT_LASER_ARMING_CH"
    elif value == SCANNER_STATUS_COUNT_PROFILE_SKIPPED_FROM_INHIBIT:
        return "SCANNER_STATUS_COUNT_PROFILE_SKIPPED_FROM_INHIBIT"
    elif value == SCANNER_STATUS_COUNT_STILLS_SKIPPED_FROM_INHIBIT:
        return "SCANNER_STATUS_COUNT_STILLS_SKIPPED_FROM_INHIBIT"
    elif value == SCANNER_STATUS_COUNT_PPS_PULSES_CH:
        return "SCANNER_STATUS_COUNT_PPS_PULSES_CH"
    elif value == SCANNER_STATUS_COUNT_PPS_TAGS_CH:
        return "SCANNER_STATUS_COUNT_PPS_TAGS_CH"
    elif value == SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_TOPSIDE_CH:
        return "SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_TOPSIDE_CH"
    elif value == SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_LASER:
        return "SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_LASER"
    elif value == SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_STILLS:
        return "SCANNER_STATUS_COUNT_ETH_SPEED_CHANGE_STILLS"
    elif value == SCANNER_STATUS_COUNT_ETH_DATA_BUFF_CH:
        return "SCANNER_STATUS_COUNT_ETH_DATA_BUFF_CH"
    elif value == SCANNER_STATUS_COUNT_ETH_CMD_BUFF_CH:
        return "SCANNER_STATUS_COUNT_ETH_CMD_BUFF_CH"
    elif value == SCANNER_STATUS_COUNT_ETH_DATA_BUFF_LASER:
        return "SCANNER_STATUS_COUNT_ETH_DATA_BUFF_LASER"
    elif value == SCANNER_STATUS_COUNT_ETH_CMD_BUFF_LASER:
        return "SCANNER_STATUS_COUNT_ETH_CMD_BUFF_LASER"
    elif value == SCANNER_STATUS_COUNT_ETH_DATA_BUFF_STILLS:
        return "SCANNER_STATUS_COUNT_ETH_DATA_BUFF_STILLS"
    elif value == SCANNER_STATUS_COUNT_ETH_CMD_BUFF_STILLS:
        return "SCANNER_STATUS_COUNT_ETH_CMD_BUFF_STILLS"
    elif value == SCANNER_STATUS_COUNT_ETH_SPEED_CAHNGE_BOTTOMSIDE_CH:
        return "SCANNER_STATUS_COUNT_ETH_SPEED_CAHNGE_BOTTOMSIDE_CH"
    elif value == SCANNER_STATUS_COUNT_LASER_IMAGE_CAPTURED:
        return "SCANNER_STATUS_COUNT_LASER_IMAGE_CAPTURED"
    elif value == SCANNER_STATUS_COUNT_LASER_IMAGE_RC_PROCESSED:
        return "SCANNER_STATUS_COUNT_LASER_IMAGE_RC_PROCESSED"
    elif value == SCANNER_STATUS_COUNT_STILLS_IMAGE_CAPTURED:
        return "SCANNER_STATUS_COUNT_STILLS_IMAGE_CAPTURED"
    elif value == SCANNER_STATUS_COUNT_STILLS_IMAGE_RC_PROCESSED:
        return "SCANNER_STATUS_COUNT_STILLS_IMAGE_RC_PROCESSED"
    elif value == SCANNER_STATUS_LASER_DONGLE_AT_CH:
        return "SCANNER_STATUS_LASER_DONGLE_AT_CH"
    elif value == SCANNER_STATUS_LASER_DONGLE_AT_LASER:
        return "SCANNER_STATUS_LASER_DONGLE_AT_LASER"
    elif value == SCANNER_STATUS_LASER_PREPARED:
        return "SCANNER_STATUS_LASER_PREPARED"
    elif value == SCANNER_STATUS_LAST_SETTINGS_ID:
        return "SCANNER_STATUS_LAST_SETTINGS_ID"
    elif value == SCANNER_STATUS_SCAN_IN_PROGRESS:
        return "SCANNER_STATUS_SCAN_IN_PROGRESS"
    elif value == SCANNER_STATUS_RA_HOMING_STATE:
        return "SCANNER_STATUS_RA_HOMING_STATE"
    elif value == SCANNER_STATUS_RA_MOTOR_STATE:
        return "SCANNER_STATUS_RA_MOTOR_STATE"
    elif value == SCANNER_STATUS_RA_MOTOR_POS:
        return "SCANNER_STATUS_RA_MOTOR_POS"
    elif value == SCANNER_STATUS_CAL_PRESENT_LASER:
        return "SCANNER_STATUS_CAL_PRESENT_LASER"
    elif value == SCANNER_STATUS_CAL_PRESENT_LASER_SENSOR:
        return "SCANNER_STATUS_CAL_PRESENT_LASER_SENSOR"
    elif value == SCANNER_STATUS_CAL_PRESENT_LASER_TO_LASER_SENSOR:
        return "SCANNER_STATUS_CAL_PRESENT_LASER_TO_LASER_SENSOR"
    elif value == SCANNER_STATUS_CAL_PRESENT_STILLS_SENSOR:
        return "SCANNER_STATUS_CAL_PRESENT_STILLS_SENSOR"
    elif value == SCANNER_STATUS_CAL_PRESENT_STILLS_SENSOR_TO_LASER_SENSOR:
        return "SCANNER_STATUS_CAL_PRESENT_STILLS_SENSOR_TO_LASER_SENSOR"
    elif value == SCANNER_STATUS_CAL_DATA_LASER:
        return "SCANNER_STATUS_CAL_DATA_LASER"
    elif value == SCANNER_STATUS_CAL_DATA_LASER_SENSOR:
        return "SCANNER_STATUS_CAL_DATA_LASER_SENSOR"
    elif value == SCANNER_STATUS_CAL_DATA_LASER_TO_LASER_SENSOR:
        return "SCANNER_STATUS_CAL_DATA_LASER_TO_LASER_SENSOR"
    elif value == SCANNER_STATUS_CAL_DATA_STILLS_SENSOR:
        return "SCANNER_STATUS_CAL_DATA_STILLS_SENSOR"
    elif value == SCANNER_STATUS_CAL_DATA_STILLS_SENSOR_TO_LASER_SENSOR:
        return "SCANNER_STATUS_CAL_DATA_STILLS_SENSOR_TO_LASER_SENSOR"
    elif value == SCANNER_STATUS_CH_VERSION:
        return "SCANNER_STATUS_CH_VERSION"
    elif value == SCANNER_STATUS_TCU_VERSION:
        return "SCANNER_STATUS_TCU_VERSION"
    elif value == SCANNER_STATUS_LASER_VERSION:
        return "SCANNER_STATUS_LASER_VERSION"
    elif value == SCANNER_STATUS_LASER_CAM_VERSION:
        return "SCANNER_STATUS_LASER_CAM_VERSION"
    elif value == SCANNER_STATUS_STILLS_CAM_VERSION:
        return "SCANNER_STATUS_STILLS_CAM_VERSION"
    elif value == SCANNER_STATUS_LASER_SENSOR_GAIN_SUPPORTED:
        return "SCANNER_STATUS_LASER_SENSOR_GAIN_SUPPORTED"
    elif value == SCANNER_STATUS_LASER_CAM_STATUS:
        return "SCANNER_STATUS_LASER_CAM_STATUS"
    elif value == SCANNER_STATUS_STILLS_CAM_STATUS:
        return "SCANNER_STATUS_STILLS_CAM_STATUS"
    elif value == SCANNER_STATUS_CH_ID:
        return "SCANNER_STATUS_CH_ID"
    elif value == SCANNER_STATUS_LASER_ID:
        return "SCANNER_STATUS_LASER_ID"
    elif value == SCANNER_STATUS_LASER_CAM_ID:
        return "SCANNER_STATUS_LASER_CAM_ID"
    elif value == SCANNER_STATUS_STILLS_CAM_ID:
        return "SCANNER_STATUS_STILLS_CAM_ID"
    elif value == SCANNER_STATUS_LASER_SENSOR_BITS:
        return "SCANNER_STATUS_LASER_SENSOR_BITS"
    elif value == SCANNER_STATUS_LASER_SENSOR_WIDTH:
        return "SCANNER_STATUS_LASER_SENSOR_WIDTH"
    elif value == SCANNER_STATUS_LASER_SENSOR_HEIGHT:
        return "SCANNER_STATUS_LASER_SENSOR_HEIGHT"
    elif value == SCANNER_STATUS_STILLS_SENSOR_BITS:
        return "SCANNER_STATUS_STILLS_SENSOR_BITS"
    elif value == SCANNER_STATUS_STILLS_SENSOR_WIDTH:
        return "SCANNER_STATUS_STILLS_SENSOR_WIDTH"
    elif value == SCANNER_STATUS_STILLS_SENSOR_HEIGHT:
        return "SCANNER_STATUS_STILLS_SENSOR_HEIGHT"
    elif value == SCANNER_STATUS_LAST_RECEIVED_DATA_NUM:
        return "SCANNER_STATUS_LAST_RECEIVED_DATA_NUM"
    elif value == SCANNER_STATUS_LAST_RECEIVED_CMD_NUM:
        return "SCANNER_STATUS_LAST_RECEIVED_CMD_NUM"
    elif value == SCANNER_STATUS_LASER_INHIBIT_ENABLED:
        return "SCANNER_STATUS_LASER_INHIBIT_ENABLED"
    elif value == SCANNER_STATUS_LASER_SAFETY_DISABLED:
        return "SCANNER_STATUS_LASER_SAFETY_DISABLED"
    elif value == SCANNER_STATUS_LASER_SENSOR_ACTUAL_FPS:
        return "SCANNER_STATUS_LASER_SENSOR_ACTUAL_FPS"
    elif value == SCANNER_STATUS_LASER_SENSOR_ACTUAL_DATARATE:
        return "SCANNER_STATUS_LASER_SENSOR_ACTUAL_DATARATE"
    elif value == SCANNER_STATUS_STILLS_SENSOR_ACTUAL_FPS:
        return "SCANNER_STATUS_STILLS_SENSOR_ACTUAL_FPS"
    elif value == SCANNER_STATUS_STILLS_SENSOR_ACTUAL_DATARATE:
        return "SCANNER_STATUS_STILLS_SENSOR_ACTUAL_DATARATE"
    elif value == SCANNER_STATUS_STILLS_RECEIVED_IMAGE_NUM:
        return "SCANNER_STATUS_STILLS_RECEIVED_IMAGE_NUM"
    elif value == SCANNER_STATUS_LED_PANEL_CONNECTED:
        return "SCANNER_STATUS_LED_PANEL_CONNECTED"
    elif value == SCANNER_STATUS_LED_PANEL_READY:
        return "SCANNER_STATUS_LED_PANEL_READY"
    elif value == SCANNER_STATUS_LED_PANEL_HEAT_STATE:
        return "SCANNER_STATUS_LED_PANEL_HEAT_STATE"
    elif value == SCANNER_STATUS_LED_PANEL_TEMPERATURE:
        return "SCANNER_STATUS_LED_PANEL_TEMPERATURE"
    elif value == SCANNER_STATUS_LED_PANEL_HUMIDITY:
        return "SCANNER_STATUS_LED_PANEL_HUMIDITY"
    elif value == SCANNER_STATUS_LED_PANEL_UV_COUNT:
        return "SCANNER_STATUS_LED_PANEL_UV_COUNT"
    elif value == SCANNER_STATUS_LED_PANEL_CURRENT_LIM:
        return "SCANNER_STATUS_LED_PANEL_CURRENT_LIM"
    elif value == SCANNER_STATUS_LASER_MCU_VERSION:
        return "SCANNER_STATUS_LASER_MCU_VERSION"
    elif value == SCANNER_STATUS_STILLS_MCU_VERSION:
        return "SCANNER_STATUS_STILLS_MCU_VERSION"
    elif value == SCANNER_STATUS_NFS_RPC_CALLS:
        return "SCANNER_STATUS_NFS_RPC_CALLS"
    elif value == SCANNER_STATUS_NFS_RPC_BADCALLS:
        return "SCANNER_STATUS_NFS_RPC_BADCALLS"
    elif value == SCANNER_STATUS_NFS_RPC_RETRANS:
        return "SCANNER_STATUS_NFS_RPC_RETRANS"
    elif value == SCANNER_STATUS_NFS_RPC_BADXID:
        return "SCANNER_STATUS_NFS_RPC_BADXID"
    elif value == SCANNER_STATUS_NFS_RPC_TIMEOUT:
        return "SCANNER_STATUS_NFS_RPC_TIMEOUT"
    elif value == SCANNER_STATUS_NFS_RPC_WAIT:
        return "SCANNER_STATUS_NFS_RPC_WAIT"
    elif value == SCANNER_STATUS_NFS_RPC_NEWCRED:
        return "SCANNER_STATUS_NFS_RPC_NEWCRED"
    elif value == SCANNER_STATUS_NFS_RPC_NULL:
        return "SCANNER_STATUS_NFS_RPC_NULL"
    elif value == SCANNER_STATUS_NAS_ENABLED:
        return "SCANNER_STATUS_NAS_ENABLED"
    elif value == SCANNER_STATUS_NAS_MOUNT_STATE:
        return "SCANNER_STATUS_NAS_MOUNT_STATE"
    elif value == SCANNER_STATUS_NAS_XYZ_STATUS:
        return "SCANNER_STATUS_NAS_XYZ_STATUS"
    elif value == SCANNER_STATUS_NAS_XYZ_PATH:
        return "SCANNER_STATUS_NAS_XYZ_PATH"
    elif value == SCANNER_STATUS_NAS_STREAM_STATUS:
        return "SCANNER_STATUS_NAS_STREAM_STATUS"
    elif value == SCANNER_STATUS_NAS_STREAM_PATH:
        return "SCANNER_STATUS_NAS_STREAM_PATH"
    elif value == SCANNER_STATUS_NAS_LASER_IMAGE_STATUS:
        return "SCANNER_STATUS_NAS_LASER_IMAGE_STATUS"
    elif value == SCANNER_STATUS_NAS_LASER_IMAGE_PATH:
        return "SCANNER_STATUS_NAS_LASER_IMAGE_PATH"
    elif value == SCANNER_STATUS_NAS_STILLS_IMAGE_STATUS:
        return "SCANNER_STATUS_NAS_STILLS_IMAGE_STATUS"
    elif value == SCANNER_STATUS_NAS_STILLS_IMAGE_PATH:
        return "SCANNER_STATUS_NAS_STILLS_IMAGE_PATH"
    elif value == SCANNER_STATUS_NAS_SKIPPED_PROFILES_BAD_DATA_POINT:
        return "SCANNER_STATUS_NAS_SKIPPED_PROFILES_BAD_DATA_POINT"
    elif value == SCANNER_STATUS_NAS_SKIPPED_PROFILES_NOT_MOUNTED:
        return "SCANNER_STATUS_NAS_SKIPPED_PROFILES_NOT_MOUNTED"
    elif value == SCANNER_STATUS_NAS_SKIPPED_IMAGES_BAD_DATA_POINT:
        return "SCANNER_STATUS_NAS_SKIPPED_IMAGES_BAD_DATA_POINT"
    elif value == SCANNER_STATUS_NAS_SKIPPED_IMAGES_NOT_MOUNTED:
        return "SCANNER_STATUS_NAS_SKIPPED_IMAGES_NOT_MOUNTED"
    elif value == SCANNER_STATUS_NAS_SKIPPED_IMAGES_PENDING_WRITES:
        return "SCANNER_STATUS_NAS_SKIPPED_IMAGES_PENDING_WRITES"
    elif value == SCANNER_STATUS_NAS_SKIPPED_IMAGES_PENDING_PROCESSORS:
        return "SCANNER_STATUS_NAS_SKIPPED_IMAGES_PENDING_PROCESSORS"
    elif value == SCANNER_STATUS_STILLS_RECEIVED_PROPERTIES_NUM:
        return "SCANNER_STATUS_STILLS_RECEIVED_PROPERTIES_NUM"
    elif value == SCANNER_STATUS_NAS_LAS_STATUS:
        return "SCANNER_STATUS_NAS_LAS_STATUS"
    elif value == SCANNER_STATUS_NAS_LAS_PATH:
        return "SCANNER_STATUS_NAS_LAS_PATH"
    elif value == SCANNER_STATUS_TARGET_DEVICE_TYPE:
        return "SCANNER_STATUS_TARGET_DEVICE_TYPE"
    elif value == SCANNER_STATUS_LOCAL_STORAGE_ENABLED:
        return "SCANNER_STATUS_LOCAL_STORAGE_ENABLED"
    elif value == SCANNER_STATUS_LOCAL_STORAGE_MOUNT_STATE:
        return "SCANNER_STATUS_LOCAL_STORAGE_MOUNT_STATE"
    elif value == SCANNER_STATUS_LOCAL_STORAGE_CAPACITY:
        return "SCANNER_STATUS_LOCAL_STORAGE_CAPACITY"
    elif value == SCANNER_STATUS_LOCAL_STORAGE_FREE:
        return "SCANNER_STATUS_LOCAL_STORAGE_FREE"
    elif value == SCANNER_STATUS_LOCAL_STORAGE_AVAILABLE:
        return "SCANNER_STATUS_LOCAL_STORAGE_AVAILABLE"
    elif value == SCANNER_STATUS_STILLS_DATA_ANALYSIS_ENABLED:
        return "SCANNER_STATUS_STILLS_DATA_ANALYSIS_ENABLED"
    elif value == SCANNER_STATUS_LATEST_STILLS_IMAGE_MIN_INTENSITY:
        return "SCANNER_STATUS_LATEST_STILLS_IMAGE_MIN_INTENSITY"
    elif value == SCANNER_STATUS_LATEST_STILLS_IMAGE_MAX_INTENSITY:
        return "SCANNER_STATUS_LATEST_STILLS_IMAGE_MAX_INTENSITY"
    elif value == SCANNER_STATUS_LATEST_STILLS_IMAGE_STD_DEV:
        return "SCANNER_STATUS_LATEST_STILLS_IMAGE_STD_DEV"
    elif value == SCANNER_STATUS_LATEST_STILLS_IMAGE_MEAN_INTENSITY:
        return "SCANNER_STATUS_LATEST_STILLS_IMAGE_MEAN_INTENSITY"
    elif value == SCANNER_STATUS_LASER_DATA_ANALYSIS_ENABLED:
        return "SCANNER_STATUS_LASER_DATA_ANALYSIS_ENABLED"
    elif value == SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_INTENSITY:
        return "SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_INTENSITY"
    elif value == SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_QUALITY:
        return "SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_QUALITY"
    elif value == SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_DEVIATION:
        return "SCANNER_STATUS_LATEST_LASER_PROFILE_AVG_DEVIATION"
    elif value == SCANNER_STATUS_LASER_MAX_AMBIENT_TEMPERATURE:
        return "SCANNER_STATUS_LASER_MAX_AMBIENT_TEMPERATURE"
    elif value == SCANNER_STATUS_STILLS_MAX_AMBIENT_TEMPERATURE:
        return "SCANNER_STATUS_STILLS_MAX_AMBIENT_TEMPERATURE"
    elif value == SCANNER_STATUS_LATEST_STILLS_IMAGE_MEAN_SAMPLE_VALUE:
        return "SCANNER_STATUS_LATEST_STILLS_IMAGE_MEAN_SAMPLE_VALUE"
    elif value == SCANNER_STATUS_LATEST_STILLS_IMAGE_SATURATION:
        return "SCANNER_STATUS_LATEST_STILLS_IMAGE_SATURATION"
    elif value == SCANNER_STATUS_CONFIGURATION_APPLIED:
        return "SCANNER_STATUS_CONFIGURATION_APPLIED"
    elif value == SCANNER_STATUS_STILLS_VIGNETTING:
        return "SCANNER_STATUS_STILLS_VIGNETTING"
    elif value == SCANNER_STATUS_CH_LEAK_COUNT:
        return "SCANNER_STATUS_CH_LEAK_COUNT"
    elif value == SCANNER_STATUS_LED_BULKHEAD_1_STATE:
        return "SCANNER_STATUS_LED_BULKHEAD_1_STATE"
    elif value == SCANNER_STATUS_LED_BULKHEAD_2_STATE:
        return "SCANNER_STATUS_LED_BULKHEAD_2_STATE"
    elif value == SCANNER_STATUS_LED_BULKHEAD_3_STATE:
        return "SCANNER_STATUS_LED_BULKHEAD_3_STATE"
    elif value == SCANNER_STATUS_LED_BULKHEAD_4_STATE:
        return "SCANNER_STATUS_LED_BULKHEAD_4_STATE"
    elif value == SCANNER_STATUS_LED_PANEL_INPUT_UNDERVOLTAGE_COUNT:
        return "SCANNER_STATUS_LED_PANEL_INPUT_UNDERVOLTAGE_COUNT"
    elif value == SCANNER_STATUS_HM_CONNECTED:
        return "SCANNER_STATUS_HM_CONNECTED"
    elif value == SCANNER_STATUS_HM_READY:
        return "SCANNER_STATUS_HM_READY"
    elif value == SCANNER_STATUS_HM_LEAK_COUNT:
        return "SCANNER_STATUS_HM_LEAK_COUNT"
    elif value == SCANNER_STATUS_HM_VOLTAGE:
        return "SCANNER_STATUS_HM_VOLTAGE"
    elif value == SCANNER_STATUS_HM_CURRENT:
        return "SCANNER_STATUS_HM_CURRENT"
    elif value == SCANNER_STATUS_HM_PRESSURE:
        return "SCANNER_STATUS_HM_PRESSURE"
    elif value == SCANNER_STATUS_HM_TEMPERATURE:
        return "SCANNER_STATUS_HM_TEMPERATURE"
    elif value == SCANNER_STATUS_NAV_LISTENER_READY:
        return "SCANNER_STATUS_NAV_LISTENER_READY"
    elif value == SCANNER_STATUS_RANGE_LISTENER_READY:
        return "SCANNER_STATUS_RANGE_LISTENER_READY"
    elif value == SCANNER_STATUS_NAV_TIME_LAST:
        return "SCANNER_STATUS_NAV_TIME_LAST"
    elif value == SCANNER_STATUS_NAV_LAT:
        return "SCANNER_STATUS_NAV_LAT"
    elif value == SCANNER_STATUS_NAV_LON:
        return "SCANNER_STATUS_NAV_LON"
    elif value == SCANNER_STATUS_NAV_ALTITUDE:
        return "SCANNER_STATUS_NAV_ALTITUDE"
    elif value == SCANNER_STATUS_NAV_HEADING:
        return "SCANNER_STATUS_NAV_HEADING"
    elif value == SCANNER_STATUS_NAV_ROLL:
        return "SCANNER_STATUS_NAV_ROLL"
    elif value == SCANNER_STATUS_NAV_PITCH:
        return "SCANNER_STATUS_NAV_PITCH"
    elif value == SCANNER_STATUS_NAV_RANGE:
        return "SCANNER_STATUS_NAV_RANGE"
    elif value == SCANNER_STATUS_NAS_STILLS_IMAGE_RAW_PATH:
        return "SCANNER_STATUS_NAS_STILLS_IMAGE_RAW_PATH"
    elif value == SCANNER_STATUS_NAS_STILLS_IMAGE_RAW_STATUS:
        return "SCANNER_STATUS_NAS_STILLS_IMAGE_RAW_STATUS"
    elif value == SCANNER_STATUS_NAS_STILLS_IMAGE_PROCESSED_PATH:
        return "SCANNER_STATUS_NAS_STILLS_IMAGE_PROCESSED_PATH"
    elif value == SCANNER_STATUS_NAS_STILLS_IMAGE_PROCESSED_STATUS:
        return "SCANNER_STATUS_NAS_STILLS_IMAGE_PROCESSED_STATUS"
    elif value == SCANNER_STATUS_CORR_MODEL_STATUS:
        return "SCANNER_STATUS_CORR_MODEL_STATUS"
    elif value == SCANNER_STATUS_CORR_CURRENT_MODEL:
        return "SCANNER_STATUS_CORR_CURRENT_MODEL"
    else:
        print("Value", value, "not found in scanner_status_to_str")
        return "SCANNER_STATUS_UNKNOWN"


""" Scanner status categories - See API documentation for definition and usage """
SCANNER_STAT_CAT_DETECTION = 0
SCANNER_STAT_CAT_SYSTEM_LOADS = 1
SCANNER_STAT_CAT_SYSTEM_THROUGHPUT = 2
SCANNER_STAT_CAT_ENVIRONMENT = 3
SCANNER_STAT_CAT_PPS = 4
SCANNER_STAT_CAT_COUNTERS = 5
SCANNER_STAT_CAT_STATE = 6
SCANNER_STAT_CAT_CALIBRATION = 7
SCANNER_STAT_CAT_IDENTIFICATION = 8
SCANNER_STAT_CAT_INTERNAL = 9
SCANNER_STAT_CAT_NAVIGATION = 10


def scanner_stat_to_str(value):
    if value == SCANNER_STAT_CAT_DETECTION:
        return "SCANNER_STAT_CAT_DETECTION"
    elif value == SCANNER_STAT_CAT_SYSTEM_LOADS:
        return "SCANNER_STAT_CAT_SYSTEM_LOADS"
    elif value == SCANNER_STAT_CAT_SYSTEM_THROUGHPUT:
        return "SCANNER_STAT_CAT_SYSTEM_THROUGHPUT"
    elif value == SCANNER_STAT_CAT_ENVIRONMENT:
        return "SCANNER_STAT_CAT_ENVIRONMENT"
    elif value == SCANNER_STAT_CAT_PPS:
        return "SCANNER_STAT_CAT_PPS"
    elif value == SCANNER_STAT_CAT_COUNTERS:
        return "SCANNER_STAT_CAT_COUNTERS"
    elif value == SCANNER_STAT_CAT_STATE:
        return "SCANNER_STAT_CAT_STATE"
    elif value == SCANNER_STAT_CAT_CALIBRATION:
        return "SCANNER_STAT_CAT_CALIBRATION"
    elif value == SCANNER_STAT_CAT_IDENTIFICATION:
        return "SCANNER_STAT_CAT_IDENTIFICATION"
    elif value == SCANNER_STAT_CAT_INTERNAL:
        return "SCANNER_STAT_CAT_INTERNAL"
    elif value == SCANNER_STAT_CAT_NAVIGATION:
        return "SCANNER_STAT_CAT_NAVIGATION"


"""Statuses of the scanner statuses - See API documentation for definition and usage"""
STATUS_VALID = 0
STATUS_WARNING = 1
STATUS_ERR = 2
STATUS_NOT_AVAILABLE = 3


def status_status_to_str(value):
    if value == STATUS_VALID:
        return "STATUS_VALID"
    elif value == STATUS_WARNING:
        return "STATUS_WARNING"
    elif value == STATUS_ERR:
        return "STATUS_ERR"
    elif value == STATUS_NOT_AVAILABLE:
        return "STATUS_NOT_AVAILABLE"


"""Configurable data endpoints - See API documentation for definition and usage"""
ENDPOINT_ID_LOG = 0
ENDPOINT_ID_STREAM = 1
ENDPOINT_ID_LAS = 2
ENDPOINT_ID_XYZ_LASER = 3
ENDPOINT_ID_XYZ_GYRO = 4
ENDPOINT_ID_XYZ_ACCEL = 5
ENDPOINT_ID_SENSOR_STILLS = 6
ENDPOINT_ID_SENSOR_STILLS_SIMPLE = 7
ENDPOINT_ID_SENSOR_LASER = 8
ENDPOINT_ID_SENSOR_LASER_SIMPLE = 9
ENDPOINT_ID_IJ = 10
ENDPOINT_ID_SENSOR_STILLS_RAW = 11
ENDPOINT_ID_SENSOR_STILLS_PROCESSED = 12


def endpoint_id_to_str(value):
    if value == ENDPOINT_ID_LOG:
        return "ENDPOINT_ID_LOG"
    elif value == ENDPOINT_ID_STREAM:
        return "ENDPOINT_ID_STREAM"
    elif value == ENDPOINT_ID_LAS:
        return "ENDPOINT_ID_LAS"
    elif value == ENDPOINT_ID_XYZ_LASER:
        return "ENDPOINT_ID_XYZ_LASER"
    elif value == ENDPOINT_ID_XYZ_GYRO:
        return "ENDPOINT_ID_XYZ_GYRO"
    elif value == ENDPOINT_ID_XYZ_ACCEL:
        return "ENDPOINT_ID_XYZ_ACCEL"
    elif value == ENDPOINT_ID_SENSOR_STILLS:
        return "ENDPOINT_ID_SENSOR_STILLS"
    elif value == ENDPOINT_ID_SENSOR_STILLS_SIMPLE:
        return "ENDPOINT_ID_SENSOR_STILLS_SIMPLE"
    elif value == ENDPOINT_ID_SENSOR_LASER:
        return "ENDPOINT_ID_SENSOR_LASER"
    elif value == ENDPOINT_ID_SENSOR_LASER_SIMPLE:
        return "ENDPOINT_ID_SENSOR_LASER_SIMPLE"
    elif value == ENDPOINT_ID_IJ:
        return "ENDPOINT_ID_IJ"
    elif value == ENDPOINT_ID_SENSOR_STILLS_RAW:
        return "ENDPOINT_ID_SENSOR_STILLS_RAW"
    elif value == ENDPOINT_ID_SENSOR_STILLS_PROCESSED:
        return "ENDPOINT_ID_SENSOR_STILLS_PROCESSED"
    else:
        print("Value", value, "not found in endpoint_id_to_str")
        return "ENDPOINT_ID_UNKNOWN"


FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_CH = 0
FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_LASER = 1
FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_STILLS = 2
FEEDBACK_CATEGORY_OVERHEATING_SENSOR_LASER = 3
FEEDBACK_CATEGORY_OVERHEATING_SENSOR_STILLS = 4
FEEDBACK_CATEGORY_BUFF_RAM_MONITOR_FREQ_REDUCED = 5
FEEDBACK_CATEGORY_BUFF_RAM_MONITOR_FREQ_RESTORED = 6


def feedback_category_to_str(value):
    if value == FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_CH:
        return "FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_CH"
    elif value == FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_LASER:
        return "FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_LASER"
    elif value == FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_STILLS:
        return "FEEDBACK_CATEGORY_OVERHEATING_AMBIENT_STILLS"
    elif value == FEEDBACK_CATEGORY_OVERHEATING_SENSOR_LASER:
        return "FEEDBACK_CATEGORY_OVERHEATING_SENSOR_LASER"
    elif value == FEEDBACK_CATEGORY_OVERHEATING_SENSOR_STILLS:
        return "FEEDBACK_CATEGORY_OVERHEATING_SENSOR_STILLS"
    elif value == FEEDBACK_CATEGORY_BUFF_RAM_MONITOR_FREQ_REDUCED:
        return "FEEDBACK_CATEGORY_BUFF_RAM_MONITOR_FREQ_REDUCED"
    elif value == FEEDBACK_CATEGORY_BUFF_RAM_MONITOR_FREQ_RESTORED:
        return "FEEDBACK_CATEGORY_BUFF_RAM_MONITOR_FREQ_RESTORED"


"""The type of the general notification received from scanner`"""
SCANNER_NOTIFICATION_ID_ERROR = 0
SCANNER_NOTIFICATION_ID_WARNING = 1
SCANNER_NOTIFICATION_ID_INFO = 2
SCANNER_NOTIFICATION_ID_UNKNOWN = 3
SCANNER_NOTIFICATION_ID_DEBUG_DATA = 4


def scanner_notification_to_str(value):
    if value == SCANNER_NOTIFICATION_ID_ERROR:
        return "SCANNER_NOTIFICATION_ID_ERROR"
    elif value == SCANNER_NOTIFICATION_ID_WARNING:
        return "SCANNER_NOTIFICATION_ID_WARNING"
    elif value == SCANNER_NOTIFICATION_ID_INFO:
        return "SCANNER_NOTIFICATION_ID_INFO"
    elif value == SCANNER_NOTIFICATION_ID_UNKNOWN:
        return "SCANNER_NOTIFICATION_ID_UNKNOWN"
    elif value == SCANNER_NOTIFICATION_ID_DEBUG_DATA:
        return "SCANNER_NOTIFICATION_ID_DEBUG_DATA"


FEEDBACK_STATUS_INFO = 0
FEEDBACK_STATUS_WARNING = 1
FEEDBACK_STATUS_ERROR = 2
FEEDBACK_STATUS_CRITICAL_ERROR = 3


def feedback_status_to_str(value):
    if value == FEEDBACK_STATUS_INFO:
        return "FEEDBACK_STATUS_INFO"
    elif value == FEEDBACK_STATUS_WARNING:
        return "FEEDBACK_STATUS_WARNING"
    elif value == FEEDBACK_STATUS_ERROR:
        return "FEEDBACK_STATUS_ERROR"
    elif value == FEEDBACK_STATUS_CRITICAL_ERROR:
        return "FEEDBACK_STATUS_CRITICAL_ERROR"


COMPONENT_TYPE_LASER = 0
COMPONENT_TYPE_STILLS = 1


def component_type_to_str(value):
    if value == COMPONENT_TYPE_LASER:
        return "COMPONENT_TYPE_LASER"
    elif value == COMPONENT_TYPE_STILLS:
        return "COMPONENT_TYPE_STILLS"


SCAN_MODE_PROFILE = 0
SCAN_MODE_SCAN = 1


def scan_mode_to_str(value):
    if value == SCAN_MODE_PROFILE:
        return "SCAN_MODE_PROFILE"
    elif value == SCAN_MODE_SCAN:
        return "SCAN_MODE_SCAN"


SOURCE_COM = 0
SOURCE_UDP = 1
SOURCE_TCP_CLIENT = 2
SOURCE_TCP_SERVER = 3
SOURCE_MULTICAST = 4

def str_to_network_source(value:str):
    if value.lower() == "com":
        return SOURCE_COM
    elif value.lower() == "udp":
        return SOURCE_UDP
    elif value.lower() == "tcp_client":
        return SOURCE_TCP_CLIENT
    elif value.lower() == "tcp_server":
        return SOURCE_TCP_SERVER
    elif value.lower() == "multicast":
        return SOURCE_MULTICAST


def source_to_str(value):
    if value == SOURCE_COM:
        return "SOURCE_COM"
    elif value == SOURCE_UDP:
        return "SOURCE_UDP"
    elif value == SOURCE_TCP_CLIENT:
        return "SOURCE_TCP_CLIENT"
    elif value == SOURCE_TCP_SERVER:
        return "SOURCE_TCP_SERVER"
    elif value == SOURCE_MULTICAST:
        return "SOURCE_MULTICAST"


# Supported time input protocols (not used by API used internally)
TIMEPROTO_ZDA = 0  # NMEA ZDA messages.


def timeproto_to_str(value):
    if value == TIMEPROTO_ZDA:
        return "TIMEPROTO_ZDA"


# Supported Nav data protocols
NAVPROTO_RAW = 0  # (not currently implemented)
NAVPROTO_LNAV = 10  # Sonardyne LNAV format supports range
NAVPROTO_DELPHINS = 20  # DelphINS format
NAVPROTO_ISE = 30  # ISE navigation format
NAVPROTO_KONGSBERG = 40  # Kongsberg navigation format
NAVPROTO_ROVINS = 50  # ROVINS INS format
NAVPROTO_NAVLAB = 60  # NAVLAB format
NAVPROTO_IXBLUESTD = 70  # IXBlue Std format
NAVPROTO_PHINSSTD = 80  # PHINS Std format supports range
NAVPROTO_PSONNAV = 1  # Sonardyne PSONNAV format


def str_to_navproto(value:str):
    if value.lower() == "raw":
        return NAVPROTO_RAW
    if value.lower() == "lnav":
        return NAVPROTO_LNAV
    if value.lower() == "delphins":
        return NAVPROTO_DELPHINS
    if value.lower() == "ise":
        return NAVPROTO_ISE
    if value.lower() == "kongsberg":
        return NAVPROTO_KONGSBERG
    if value.lower() == "rovins":
        return NAVPROTO_ROVINS
    if value.lower() == "navlab":
        return NAVPROTO_NAVLAB
    if value.lower() == "ixbluestd":
        return NAVPROTO_IXBLUESTD
    if value.lower() == "phinsstd":
        return NAVPROTO_PHINSSTD
    if value.lower() == "psonnav":
        return NAVPROTO_PSONNAV


def navproto_to_str(value):
    if value == NAVPROTO_RAW:
        return "NAVPROTO_RAW"
    elif value == NAVPROTO_LNAV:
        return "NAVPROTO_LNAV"
    elif value == NAVPROTO_DELPHINS:
        return "NAVPROTO_DELPHINS"
    elif value == NAVPROTO_ISE:
        return "NAVPROTO_ISE"
    elif value == NAVPROTO_KONGSBERG:
        return "NAVPROTO_KONGSBERG"
    elif value == NAVPROTO_ROVINS:
        return "NAVPROTO_ROVINS"
    elif value == NAVPROTO_NAVLAB:
        return "NAVPROTO_NAVLAB"
    elif value == NAVPROTO_IXBLUESTD:
        return "NAVPROTO_IXBLUESTD"
    elif value == NAVPROTO_PHINSSTD:
        return "NAVPROTO_PHINSSTD"
    elif value == NAVPROTO_PSONNAV:
        return "NAVPROTO_PSONNAV"


# Supported DVL/range to target protocols
# (not currently implemented)
RANGEPROTO_RAW = 0
# LNAV navigation format (include dvl information)
RANGEPROTO_LNAV = 1
# RDI PD4 format - You must use a system clock synchronized with UTC to work correctly.
RANGEPROTO_PD4 = 2


def rangeproto_to_str(value):
    if value == RANGEPROTO_RAW:
        return "RANGEPROTO_RAW"
    elif value == RANGEPROTO_LNAV:
        return "RANGEPROTO_LNAV"
    elif value == RANGEPROTO_PD4:
        return "RANGEPROTO_PD4"


# State of the connection to the scanner represented by the API
SCANNER_NOT_FOUND = 0
SCANNER_NOT_DISCOVERABLE = 1
SCANNER_NOT_READY = 2
SCANNER_READY_BUT_NOT_CONNECTED = 3
SCANNER_NOT_CONNECTED_TO_THIS_API = 4
SCANNER_CONNECTED_TO_THIS_API = 5


def scanner_connection_to_str(value):
    if value == SCANNER_NOT_FOUND:
        return "SCANNER_NOT_FOUND"
    elif value == SCANNER_NOT_DISCOVERABLE:
        return "SCANNER_NOT_DISCOVERABLE"
    elif value == SCANNER_NOT_READY:
        return "SCANNER_NOT_READY"
    elif value == SCANNER_READY_BUT_NOT_CONNECTED:
        return "SCANNER_READY_BUT_NOT_CONNECTED"
    elif value == SCANNER_NOT_CONNECTED_TO_THIS_API:
        return "SCANNER_NOT_CONNECTED_TO_THIS_API"
    elif value == SCANNER_CONNECTED_TO_THIS_API:
        return "SCANNER_CONNECTED_TO_THIS_API"


VALUE_TYPE_BOOL = 0
VALUE_TYPE_STRING = 1
VALUE_TYPE_INT = 2
VALUE_TYPE_UINT = 3
VALUE_TYPE_FLOAT = 4
VALUE_TYPE_NUM = 5


def value_type_to_str(value):
    if value == VALUE_TYPE_BOOL:
        return "VALUE_TYPE_BOOL"
    elif value == VALUE_TYPE_STRING:
        return "VALUE_TYPE_STRING"
    elif value == VALUE_TYPE_INT:
        return "VALUE_TYPE_INT"
    elif value == VALUE_TYPE_UINT:
        return "VALUE_TYPE_UINT"
    elif value == VALUE_TYPE_FLOAT:
        return "VALUE_TYPE_FLOAT"
    elif value == VALUE_TYPE_NUM:
        return "VALUE_TYPE_NUM"
