map_e300_current = {
    0: 'None',
    1: 'Overload',
    2: 'Phase Loss',
    4: 'Ground Fault',
    8: 'Stall',
    16: 'Jam',
    32: 'Underload',
    64: 'Current Imbalance',
    128: 'L1 Undercurrent',
    256: 'L2 Undercurrent',
    512: 'L3 Undercurrent',
    1024: 'L1 Overcurrent',
    2048: 'L2 Overcurrent',
    4096: 'L3 Overcurrent',
    8192: 'L1 Line Loss',
    16384: 'L2 Line Loss',
    32768: 'L3 Line Loss'
}

map_e300_voltage = {
    0: 'None',
    1: 'Undervoltage',
    2: 'Overvoltage',
    4: 'Voltage Unbalance',
    8: 'Phase Rotation',
    16: 'Overfrequency'
}

map_e300_control = {
    0: 'None',
    1: 'Test Trip',
    2: 'DLX Trip',
    4: 'PTC Trip',
    8: 'Operator Station Trip',
    16: 'Remote Trip',
    32: 'Blocked Start Trip',
    64: 'Hardware Fault Trip',
    128: 'Config Trip',
    256: 'Option Match Trip',
    512: 'DLX FB Timeout Trip',
    1024: 'Expansion Bus Trip',
    2048: 'Reserved',
    4096: 'Reserved',
    8192: 'NVS Trip',
    16384: 'Test Mode Trip'
}

map_e300_power = {
    0: 'None',
    1: 'Under kW',
    2: 'Over kW',
    4: 'Under kVAR Consumed',
    8: 'Over kVAR Consumed',
    16: 'Under kVAR Generated',
    32: 'Over kVAR Generated',
    64: 'Under kVA',
    128: 'Over kVA',
    256: 'Under PF Lag',
    512: 'Over PF Lag',
    1024: 'Under PF Lead',
    2048: 'Over PF Lead'
}

map_device_status = {
    1: "Startup",
    2: "Not ready to start",
    3: "Ready to start",
    4: "Lost run permissive",
    5: "Not able to restart - Overload Limit",
    6: "Not able to restart - Trip Limit",
    7: "Waiting to attempt restart",
    8: "Waiting to attempt restart (Overload)",
    9: "Running",
    10: "User stopped",
    11: "Waiting to start (Timer Mode)"
}
