Initial commit
This commit is contained in:
262
BMS_D1000/DataStructure/BMSConstData.cs
Normal file
262
BMS_D1000/DataStructure/BMSConstData.cs
Normal file
@@ -0,0 +1,262 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using BMS_D1000H.Utils.Functions;
|
||||
|
||||
namespace BMS_D1000H.BMSConstData
|
||||
{
|
||||
public class ScreenID
|
||||
{
|
||||
public const int MAIN_SCREEN_ID = 0;
|
||||
public const int TRAY_SCREEN_ID = 1;
|
||||
public const int HISTORY_SCREEN_ID = 2;
|
||||
public const int PASSWORD_SCREEN_ID = 3;
|
||||
public const int PARAM_SET_SCREEN_ID = 4;
|
||||
public const int PARAM_SETCMD_SCREEN_ID = 5;
|
||||
public const int SCREEN_SAVER_SCREEN_ID = 6;
|
||||
public const int SET_MENU_SCREEN_ID = 7;
|
||||
public const int NET_CONFIG_SCREEN_ID = 8;
|
||||
public const int NET_CONFIG_CMD_SCREEN_ID = 9;
|
||||
public const int SYSTEM_SET_SCREEN = 10;
|
||||
public const int SYSTEM_SET_CMD_SCREEN = 11;
|
||||
|
||||
public const int CHANGE_PASSWORD_SCREEN_ID = 20;
|
||||
public const int NEW_PASSWORD_SCREEN_ID = 21;
|
||||
public const int CONFIRM_PASSWORD_SCREEN_ID = 22;
|
||||
}
|
||||
|
||||
public class SystemID
|
||||
{
|
||||
public const int MAX_MODULE_SIZE = 10;
|
||||
|
||||
public const int MAX_TRAY_CELL_SIZE = 15;
|
||||
public const int MAX_TRAY_TEMP_SIZE = 6;
|
||||
|
||||
public static readonly int FLOATING_VOLTAGE = (int)(3.55 * MAX_TRAY_CELL_SIZE * 10);
|
||||
}
|
||||
|
||||
public class AlarmFileConst
|
||||
{
|
||||
public static readonly string AlarmFilePath = PathHelper.GetFullPath("alarmlist.db");
|
||||
}
|
||||
|
||||
public class AlarmID
|
||||
{
|
||||
public static readonly int MAX_ALARM_COUNT = 200;
|
||||
|
||||
public const byte POWER_ON_RESET = 0;
|
||||
public const byte EXTERNAL_RESET = 1;
|
||||
public const byte SOV_WARNING = 2;
|
||||
public const byte COV_WARNING = 3;
|
||||
public const byte SUV_WARNING = 4;
|
||||
public const byte CUV_WARNING = 5;
|
||||
public const byte OCC_WARNING = 6;
|
||||
public const byte OCD_WARNING = 7;
|
||||
public const byte OTC_WARNING = 8;
|
||||
public const byte OTD_WARNING = 9;
|
||||
public const byte LTC_WARNING = 10;
|
||||
public const byte LTD_WARNING = 11;
|
||||
public const byte SOC_WARNING = 12;
|
||||
|
||||
public const byte SOV_PROTECTION = 13;
|
||||
public const byte COV_PROTECTION = 14;
|
||||
public const byte SUV_PROTECTION = 15;
|
||||
public const byte CUV_PROTECTION = 16;
|
||||
public const byte OCC_PROTECTION = 17;
|
||||
public const byte OCD_PROTECTION = 18;
|
||||
public const byte OTC_PROTECTION = 19;
|
||||
public const byte OTD_PROTECTION = 20;
|
||||
public const byte LTC_PROTECTION = 21;
|
||||
public const byte LTD_PROTECTION = 22;
|
||||
|
||||
public const byte BMU_COMM_FAIL = 23;
|
||||
public const byte BMS_COMM_FAIL = 24;
|
||||
|
||||
public const byte STS_STAND_BY = 25;
|
||||
public const byte STS_CHARGING = 26;
|
||||
public const byte STS_DISCHARGING = 27;
|
||||
public const byte STS_FLOATING = 28;
|
||||
public const byte HIST_DELETE = 29;
|
||||
|
||||
public static readonly string[] name =
|
||||
{
|
||||
" Power On Reset ", // 0
|
||||
" External Reset ", // 1
|
||||
" System Over Voltage ", // 2
|
||||
" Cell Over Voltage ", // 3
|
||||
" System Under Voltage", // 4
|
||||
" Cell Under Voltage ", // 5
|
||||
" CHG Over Current ", // 6
|
||||
" DCH Over Current ", // 7
|
||||
" High Temperature ", // 8
|
||||
" High Temperature ", // 9
|
||||
" Low Temperature ", // 10
|
||||
" Low Temperature ", // 11
|
||||
" Low Capacity ", // 12
|
||||
" System Over Voltage ", // 13
|
||||
" Cell Over Voltage ", // 14
|
||||
" System Under Voltage", // 15
|
||||
" Cell Under Voltage ", // 16
|
||||
" CHG Over Current ", // 17
|
||||
" DCH Over Current ", // 18
|
||||
" High Temperature ", // 19
|
||||
" High Temperature ", // 20
|
||||
" Low Temperature ", // 21
|
||||
" Low Temperature ", // 22
|
||||
|
||||
" mBMS Comm. Fail ", // 23
|
||||
" rBMS Comm. Fail ", // 24
|
||||
|
||||
" STAND BY ", // 25
|
||||
" CHARGING ", // 26
|
||||
" DISCHARGING ", // 27
|
||||
" FLOATING ", // 28
|
||||
" HISTORY DELETE ", // 29
|
||||
" UNKNOWN-1",
|
||||
" UNKNOWN-2",
|
||||
" UNKNOWN-3",
|
||||
" UNKNOWN-4",
|
||||
" UNKNOWN-5",
|
||||
};
|
||||
}
|
||||
public class StatusStr
|
||||
{
|
||||
public static readonly string[] operating =
|
||||
{
|
||||
"STAND BY", // 0
|
||||
"CHARGING", // 1
|
||||
"DISCHARGING", // 2
|
||||
"FLOATING", // 3
|
||||
"UNKNOWN[4]", // 4
|
||||
"UNKNOWN[5]", // 5
|
||||
"UNKNOWN[6]", // 6
|
||||
"UNKNOWN[7]", // 7
|
||||
"UNKNOWN[8]", // 8
|
||||
"UNKNOWN[9]", // 9
|
||||
"UNKNOWN[10]", // 10
|
||||
};
|
||||
|
||||
public static readonly string[] alarm =
|
||||
{
|
||||
"NORMAL", // 0
|
||||
"WARNING", // 1
|
||||
"TRIP", // 2
|
||||
"UNKNOWN[3]", // 3
|
||||
"UNKNOWN[4]", // 4
|
||||
"UNKNOWN[5]", // 5
|
||||
"UNKNOWN[6]", // 6
|
||||
"UNKNOWN[7]", // 7
|
||||
"UNKNOWN[8]", // 8
|
||||
"UNKNOWN[9]", // 9
|
||||
"UNKNOWN[10]", // 10
|
||||
};
|
||||
}
|
||||
|
||||
public class EventID
|
||||
{
|
||||
public const int EVENT_INFO = 0;
|
||||
public const int EVENT_RECOVERY = 1;
|
||||
public const int EVENT_WARNING = 2;
|
||||
public const int EVENT_PROTECTION = 3;
|
||||
|
||||
public static readonly string[] event_name =
|
||||
{
|
||||
"INFO",
|
||||
"RECOVERY",
|
||||
"WARNING",
|
||||
"TRIP",
|
||||
"UNKNOWN-1",
|
||||
"UNKNOWN-2",
|
||||
"UNKNOWN-3",
|
||||
};
|
||||
}
|
||||
|
||||
public class PosID
|
||||
{
|
||||
public static readonly byte POS_NON = 0;
|
||||
public static readonly byte POS_MODULE_1 = 1;
|
||||
public static readonly byte POS_MODULE_2 = 2;
|
||||
public static readonly byte POS_MODULE_3 = 3;
|
||||
public static readonly byte POS_MODULE_4 = 4;
|
||||
public static readonly byte POS_MODULE_5 = 5;
|
||||
public static readonly byte POS_MODULE_6 = 6;
|
||||
public static readonly byte POS_MODULE_7 = 7;
|
||||
public static readonly byte POS_MODULE_8 = 8;
|
||||
public static readonly byte POS_MODULE_9 = 9;
|
||||
public static readonly byte POS_MODULE_10 = 10;
|
||||
|
||||
public static readonly string[] pos =
|
||||
{
|
||||
"-",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
};
|
||||
}
|
||||
|
||||
public class SetSystemParameter
|
||||
{
|
||||
public static readonly string[] Name =
|
||||
{
|
||||
" Module Quantity",
|
||||
};
|
||||
}
|
||||
|
||||
public class SetParamter
|
||||
{
|
||||
public static readonly string[] Name =
|
||||
{
|
||||
" System Over Voltage",
|
||||
" Cell Over Voltage",
|
||||
" System Under Voltage",
|
||||
" Cell Under Voltage",
|
||||
" Charge Over Current",
|
||||
" Discharge Over Current",
|
||||
" Charge High Temperature",
|
||||
" Discharge High Temperature",
|
||||
" Low SOC (State of Charge)"
|
||||
};
|
||||
}
|
||||
|
||||
public class SetNetConfig
|
||||
{
|
||||
public static readonly string[] Name =
|
||||
{
|
||||
" IP Address",
|
||||
" Subnet Mask",
|
||||
" Gateway Address",
|
||||
" Trap #1 Address",
|
||||
" Trap #2 Address",
|
||||
" Trap #3 Address",
|
||||
" Trap #4 Address"
|
||||
};
|
||||
}
|
||||
|
||||
public class CommandFlag
|
||||
{
|
||||
public static readonly ushort Reset = 0x0001;
|
||||
public static readonly ushort Shutdown = 0x0002;
|
||||
public static readonly ushort Sound = 0x0003;
|
||||
public static readonly ushort SoundHold = 0x0004;
|
||||
}
|
||||
|
||||
public class MessageFlag
|
||||
{
|
||||
public static readonly byte Reset = 0x00; //Reset에 대한 메시지값
|
||||
public static readonly byte Enable = 0x01; //Shutdown, Sound 에 대한 메시지값
|
||||
public static readonly byte Disable = 0x00; //Shutdown, Sound 에 대한 메시지값
|
||||
public static readonly byte None = 0x00; //SoundHold에 대한 메시지값
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user