WIP Scada
This commit is contained in:
@@ -9,6 +9,182 @@ namespace CMS_CORE_Library.Models
|
||||
{
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Constants
|
||||
|
||||
public static readonly string[] VALID_PP_FORMATS = { ".txt", ".cnc", ".ini" };
|
||||
public static readonly string[] VALID_IMAGE_FORMATS = { ".jpg", ".jpeg", ".png" };
|
||||
|
||||
public const string IMAGES_PATH = @"C:\CMS\STEP\pp_img\";
|
||||
public const string MILLIMETERS = "mm";
|
||||
public const string INCHES = "inches";
|
||||
|
||||
public const int USER_SOFTKEYS_NUMBER = 128;
|
||||
public const int NC_SOFTKEYS_NUMBER = 32;
|
||||
public const int PROCESS_NUMBER = 6;
|
||||
public const int ALARMS_NUMBER = 1024;
|
||||
public const int MAX_HEADS_NUMBER = 20;
|
||||
|
||||
public enum HEAD_OVERRIDE_SIGN
|
||||
{
|
||||
PLUS = 0,
|
||||
MINUS = 1
|
||||
}
|
||||
|
||||
/** <summary>Process-Status</summary> */
|
||||
|
||||
public enum PROC_STATUS : ushort
|
||||
{
|
||||
/** <summary>Idle-Status</summary> */
|
||||
IDLE = 1,
|
||||
/** <summary>Run-Status</summary> */
|
||||
RUN = 2,
|
||||
/** <summary>Hold-Status</summary> */
|
||||
HOLD = 3,
|
||||
/** <summary>Error-Status</summary> */
|
||||
ERROR = 4,
|
||||
/** <summary>Reset-Status</summary> */
|
||||
RESET = 5,
|
||||
/** <summary>Emergency-Status</summary> */
|
||||
EMERG = 6
|
||||
};
|
||||
|
||||
/** <summary>CMS-Process-Mode</summary> */
|
||||
|
||||
public enum PROC_MODE : ushort
|
||||
{
|
||||
/** <summary>Automatic-Mode</summary> */
|
||||
AUTO = 1,
|
||||
/** <summary>Edit-Mode</summary> */
|
||||
EDIT = 2,
|
||||
/** <summary>Mdi-Mode</summary> */
|
||||
MDI = 3,
|
||||
/** <summary>Remote-Mode</summary> */
|
||||
REMOTE = 4,
|
||||
/** <summary>Teach-Mode</summary> */
|
||||
TEACH = 5,
|
||||
/** <summary>Ref-Mode</summary> */
|
||||
REF = 6,
|
||||
/** <summary>Jog-Mode</summary> */
|
||||
JOG = 7,
|
||||
/** <summary>Joginc-Mode</summary> */
|
||||
JOGINC = 8,
|
||||
/** <summary>Ret_on_Profile-Mode</summary> */
|
||||
RETPROF = 9,
|
||||
/** <summary>Handle-Mode</summary> */
|
||||
HANDLE = 10,
|
||||
/** <summary>Restart-Mode</summary> */
|
||||
RESTART = 11,
|
||||
/** <summary>Error-Mode</summary> */
|
||||
ERROR = 12
|
||||
};
|
||||
|
||||
public enum MAGAZINE_ACTIONS
|
||||
{
|
||||
NOT_READY = 0,
|
||||
READY = 1,
|
||||
LOADING = 2,
|
||||
UNLOADING = 3,
|
||||
EXCHANGE = 5
|
||||
}
|
||||
|
||||
public enum SIEMENS_MAGAZINE_TYPE
|
||||
{
|
||||
CHAIN = 1,
|
||||
REVOLVER = 3,
|
||||
BOX_MAGAZINE = 5,
|
||||
MAGAZINE_TOOL_BUFFER = 7,
|
||||
MAGAZINE_LOADING_STATION = 9
|
||||
}
|
||||
|
||||
public enum NC_MAGAZINE_TYPE
|
||||
{
|
||||
BOX_MAGAZINE = 0,
|
||||
DISK = 1,
|
||||
CHAIN = 2,
|
||||
}
|
||||
|
||||
public enum POSITION_TYPE
|
||||
{
|
||||
MAGAZINE_LOCATION = 1,
|
||||
SPINDLE = 2,
|
||||
GRIPPER = 3,
|
||||
LOADER = 4,
|
||||
TRANSFER_LOCATION = 5,
|
||||
LOADING_STATION = 6,
|
||||
LOADING_POINT = 7
|
||||
}
|
||||
|
||||
public enum ROTATION
|
||||
{
|
||||
NONE = 0,
|
||||
CLOCKWHISE = 1,
|
||||
COUNTERCLOCKWHISE = 2
|
||||
}
|
||||
|
||||
public enum SIEMENS_LIFE_TYPE
|
||||
{
|
||||
NONE = 0,
|
||||
TIME = 1,
|
||||
COUNT = 2,
|
||||
WEAR = 4
|
||||
}
|
||||
|
||||
public enum PROGRAM_TYPE_ENUM
|
||||
{
|
||||
NONE = 0,
|
||||
PART_PROGRAM = 1,
|
||||
JOB = 2
|
||||
}
|
||||
|
||||
public enum M155_TYPE
|
||||
{
|
||||
REAL = 0,
|
||||
MULTIPLE_BUTTONS = 1
|
||||
}
|
||||
|
||||
public enum SCADA_MEM_TYPE
|
||||
{
|
||||
BOOL = 0,
|
||||
BYTE = 1,
|
||||
WORD = 2,
|
||||
INT = 3,
|
||||
REAL = 4
|
||||
}
|
||||
|
||||
public static IFormatProvider numberFormat = (NumberFormatInfo)CultureInfo.InvariantCulture.NumberFormat.Clone();
|
||||
|
||||
#region Cms Errors Codes
|
||||
|
||||
public static CmsError NO_ERROR = new CmsError(CMS_ERROR_CODES.OK, "");
|
||||
public static CmsError NOT_CONNECTED_ERROR = new CmsError(CMS_ERROR_CODES.NOT_CONNECTED, "error_not_connected");
|
||||
public static CmsError PROC_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "error_process_not_found");
|
||||
public static CmsError FUNCTION_NOT_ALLOWED_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "error_function_not_allowed");
|
||||
public static CmsError BIT_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BIT_NOT_IN_RANGE, "error_bit_not_in_range");
|
||||
public static CmsError BYTE_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BYTE_NOT_IN_RANGE, "error_byte_not_in_range");
|
||||
public static CmsError INCORRECT_PARAMETERS_ERROR = new CmsError(CMS_ERROR_CODES.INCORRECT_PARAMETERS, "error_incorrect_parameters");
|
||||
public static CmsError INCORRECT_LANGUAGE_ERROR = new CmsError(CMS_ERROR_CODES.NC_LANGUAGE_ERROR, "error_invalid_language");
|
||||
public static CmsError SIEMENS_ENVIRONMENT_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND, "error_siemens_enviroment_not_found_error");
|
||||
public static CmsError SIEMENS_HMI_NOT_RUNNING_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING, "error_siemens_hmi_not_running");
|
||||
public static CmsError MAX_TOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_TOOL_REACHED, "error_max_tool_reached");
|
||||
public static CmsError MAX_EDGES_PER_TOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_EDGES_PER_TOOL_REACHED, "error_max_edges_per_tool_reached");
|
||||
public static CmsError MAX_FAMILY_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_FAMILY_REACHED, "error_max_family_reached");
|
||||
public static CmsError MAX_MULTITOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_MULTITOOL_REACHED, "error_max_multitools_reached");
|
||||
public static CmsError MAX_TOOLS_PER_MULTITOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_TOOLS_PER_MULTITOOL_REACHED, "error_max_tools_per_multitool_reached");
|
||||
public static CmsError MAX_MULTITOOL_LOCATION_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_MULTITOOL_LOCATION_REACHED, "error_max_multitools_location_reached");
|
||||
public static CmsError MAGAZINE_POSITION_OCCUPIED_ERROR = new CmsError(CMS_ERROR_CODES.MAG_POS_OCCUPIED, "error_magazine_position_occupied");
|
||||
public static CmsError MAGAZINE_BUSY_ERROR = new CmsError(CMS_ERROR_CODES.MAGAZINE_OCCUPIED, "error_magazine_occupied");
|
||||
public static CmsError TOOL_IS_MOUNTED_ERROR = new CmsError(CMS_ERROR_CODES.TOOL_IS_MOUNTED, "error_tool_mounted");
|
||||
public static CmsError TOOL_AND_POSITION_NOT_MATCHING_ERROR = new CmsError(CMS_ERROR_CODES.TOOL_IS_MOUNTED, "error_tool_and_position_not_matching");
|
||||
public static CmsError FILE_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.FILE_NOT_FOUND, "error_file_not_found");
|
||||
public static CmsError PLC_NOT_RUNNING_ERROR = new CmsError(CMS_ERROR_CODES.PLC_NOT_RUNNING, "error_plc_not_running");
|
||||
public static CmsError HMI_NOT_RESPONDING_ERROR = new CmsError(CMS_ERROR_CODES.HMI_NOT_RESPONDING, "error_hmi_not_responding");
|
||||
|
||||
#endregion Cms Errors Codes
|
||||
|
||||
#endregion Constants
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Data structure models
|
||||
|
||||
// R-W MEMORY Cell
|
||||
@@ -202,179 +378,12 @@ namespace CMS_CORE_Library.Models
|
||||
WAITING_OPERATOR = 2,
|
||||
CLOSING = 3
|
||||
}
|
||||
|
||||
|
||||
public enum AXIS_TYPE
|
||||
{
|
||||
LINEAR = 0,
|
||||
LINEAR = 0,
|
||||
ROTATING = 1
|
||||
}
|
||||
#endregion Data structure models
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Constants
|
||||
|
||||
public static readonly string[] VALID_PP_FORMATS = { ".txt", ".cnc", ".ini" };
|
||||
public static readonly string[] VALID_IMAGE_FORMATS = { ".jpg", ".jpeg", ".png" };
|
||||
|
||||
public const string IMAGES_PATH = @"C:\CMS\STEP\pp_img\";
|
||||
public const string MILLIMETERS = "mm";
|
||||
public const string INCHES = "inches";
|
||||
|
||||
public const int USER_SOFTKEYS_NUMBER = 128;
|
||||
public const int NC_SOFTKEYS_NUMBER = 32;
|
||||
public const int PROCESS_NUMBER = 6;
|
||||
public const int ALARMS_NUMBER = 1024;
|
||||
public const int MAX_HEADS_NUMBER = 20;
|
||||
|
||||
public enum HEAD_OVERRIDE_SIGN
|
||||
{
|
||||
PLUS = 0,
|
||||
MINUS = 1
|
||||
}
|
||||
|
||||
/** <summary>Process-Status</summary> */
|
||||
|
||||
public enum PROC_STATUS : ushort
|
||||
{
|
||||
/** <summary>Idle-Status</summary> */
|
||||
IDLE = 1,
|
||||
/** <summary>Run-Status</summary> */
|
||||
RUN = 2,
|
||||
/** <summary>Hold-Status</summary> */
|
||||
HOLD = 3,
|
||||
/** <summary>Error-Status</summary> */
|
||||
ERROR = 4,
|
||||
/** <summary>Reset-Status</summary> */
|
||||
RESET = 5,
|
||||
/** <summary>Emergency-Status</summary> */
|
||||
EMERG = 6
|
||||
};
|
||||
|
||||
/** <summary>CMS-Process-Mode</summary> */
|
||||
|
||||
public enum PROC_MODE : ushort
|
||||
{
|
||||
/** <summary>Automatic-Mode</summary> */
|
||||
AUTO = 1,
|
||||
/** <summary>Edit-Mode</summary> */
|
||||
EDIT = 2,
|
||||
/** <summary>Mdi-Mode</summary> */
|
||||
MDI = 3,
|
||||
/** <summary>Remote-Mode</summary> */
|
||||
REMOTE = 4,
|
||||
/** <summary>Teach-Mode</summary> */
|
||||
TEACH = 5,
|
||||
/** <summary>Ref-Mode</summary> */
|
||||
REF = 6,
|
||||
/** <summary>Jog-Mode</summary> */
|
||||
JOG = 7,
|
||||
/** <summary>Joginc-Mode</summary> */
|
||||
JOGINC = 8,
|
||||
/** <summary>Ret_on_Profile-Mode</summary> */
|
||||
RETPROF = 9,
|
||||
/** <summary>Handle-Mode</summary> */
|
||||
HANDLE = 10,
|
||||
/** <summary>Restart-Mode</summary> */
|
||||
RESTART = 11,
|
||||
/** <summary>Error-Mode</summary> */
|
||||
ERROR = 12
|
||||
};
|
||||
|
||||
public enum MAGAZINE_ACTIONS
|
||||
{
|
||||
NOT_READY = 0,
|
||||
READY = 1,
|
||||
LOADING = 2,
|
||||
UNLOADING = 3,
|
||||
EXCHANGE = 5
|
||||
}
|
||||
|
||||
public enum SIEMENS_MAGAZINE_TYPE
|
||||
{
|
||||
CHAIN = 1,
|
||||
REVOLVER = 3,
|
||||
BOX_MAGAZINE = 5,
|
||||
MAGAZINE_TOOL_BUFFER = 7,
|
||||
MAGAZINE_LOADING_STATION = 9
|
||||
}
|
||||
|
||||
public enum NC_MAGAZINE_TYPE
|
||||
{
|
||||
BOX_MAGAZINE = 0,
|
||||
DISK = 1,
|
||||
CHAIN = 2,
|
||||
}
|
||||
|
||||
public enum POSITION_TYPE
|
||||
{
|
||||
MAGAZINE_LOCATION = 1,
|
||||
SPINDLE = 2,
|
||||
GRIPPER = 3,
|
||||
LOADER = 4,
|
||||
TRANSFER_LOCATION = 5,
|
||||
LOADING_STATION = 6,
|
||||
LOADING_POINT = 7
|
||||
}
|
||||
|
||||
public enum ROTATION
|
||||
{
|
||||
NONE = 0,
|
||||
CLOCKWHISE = 1,
|
||||
COUNTERCLOCKWHISE = 2
|
||||
}
|
||||
|
||||
public enum SIEMENS_LIFE_TYPE
|
||||
{
|
||||
NONE = 0,
|
||||
TIME = 1,
|
||||
COUNT = 2,
|
||||
WEAR = 4
|
||||
}
|
||||
|
||||
public enum PROGRAM_TYPE_ENUM
|
||||
{
|
||||
NONE = 0,
|
||||
PART_PROGRAM = 1,
|
||||
JOB = 2
|
||||
}
|
||||
|
||||
public enum M155_TYPE
|
||||
{
|
||||
REAL = 0,
|
||||
MULTIPLE_BUTTONS = 1
|
||||
}
|
||||
|
||||
public static IFormatProvider numberFormat = (NumberFormatInfo)CultureInfo.InvariantCulture.NumberFormat.Clone();
|
||||
|
||||
#region Cms Errors Codes
|
||||
|
||||
public static CmsError NO_ERROR = new CmsError(CMS_ERROR_CODES.OK, "");
|
||||
public static CmsError NOT_CONNECTED_ERROR = new CmsError(CMS_ERROR_CODES.NOT_CONNECTED, "error_not_connected");
|
||||
public static CmsError PROC_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "error_process_not_found");
|
||||
public static CmsError FUNCTION_NOT_ALLOWED_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "error_function_not_allowed");
|
||||
public static CmsError BIT_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BIT_NOT_IN_RANGE, "error_bit_not_in_range");
|
||||
public static CmsError BYTE_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BYTE_NOT_IN_RANGE, "error_byte_not_in_range");
|
||||
public static CmsError INCORRECT_PARAMETERS_ERROR = new CmsError(CMS_ERROR_CODES.INCORRECT_PARAMETERS, "error_incorrect_parameters");
|
||||
public static CmsError INCORRECT_LANGUAGE_ERROR = new CmsError(CMS_ERROR_CODES.NC_LANGUAGE_ERROR, "error_invalid_language");
|
||||
public static CmsError SIEMENS_ENVIRONMENT_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND, "error_siemens_enviroment_not_found_error");
|
||||
public static CmsError SIEMENS_HMI_NOT_RUNNING_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING, "error_siemens_hmi_not_running");
|
||||
public static CmsError MAX_TOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_TOOL_REACHED, "error_max_tool_reached");
|
||||
public static CmsError MAX_EDGES_PER_TOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_EDGES_PER_TOOL_REACHED, "error_max_edges_per_tool_reached");
|
||||
public static CmsError MAX_FAMILY_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_FAMILY_REACHED, "error_max_family_reached");
|
||||
public static CmsError MAX_MULTITOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_MULTITOOL_REACHED, "error_max_multitools_reached");
|
||||
public static CmsError MAX_TOOLS_PER_MULTITOOL_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_TOOLS_PER_MULTITOOL_REACHED, "error_max_tools_per_multitool_reached");
|
||||
public static CmsError MAX_MULTITOOL_LOCATION_REACHED_ERROR = new CmsError(CMS_ERROR_CODES.MAX_MULTITOOL_LOCATION_REACHED, "error_max_multitools_location_reached");
|
||||
public static CmsError MAGAZINE_POSITION_OCCUPIED_ERROR = new CmsError(CMS_ERROR_CODES.MAG_POS_OCCUPIED, "error_magazine_position_occupied");
|
||||
public static CmsError MAGAZINE_BUSY_ERROR = new CmsError(CMS_ERROR_CODES.MAGAZINE_OCCUPIED, "error_magazine_occupied");
|
||||
public static CmsError TOOL_IS_MOUNTED_ERROR = new CmsError(CMS_ERROR_CODES.TOOL_IS_MOUNTED, "error_tool_mounted");
|
||||
public static CmsError TOOL_AND_POSITION_NOT_MATCHING_ERROR = new CmsError(CMS_ERROR_CODES.TOOL_IS_MOUNTED, "error_tool_and_position_not_matching");
|
||||
public static CmsError FILE_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.FILE_NOT_FOUND, "error_file_not_found");
|
||||
public static CmsError PLC_NOT_RUNNING_ERROR = new CmsError(CMS_ERROR_CODES.PLC_NOT_RUNNING, "error_plc_not_running");
|
||||
public static CmsError HMI_NOT_RESPONDING_ERROR = new CmsError(CMS_ERROR_CODES.HMI_NOT_RESPONDING, "error_hmi_not_responding");
|
||||
|
||||
#endregion Cms Errors Codes
|
||||
|
||||
#endregion Constants
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user