Refactor models
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
namespace CMS_CORE_Library.Models
|
||||
{
|
||||
public class CmsError
|
||||
{
|
||||
public CMS_ERROR_CODES errorCode;
|
||||
public string localizationKey;
|
||||
|
||||
public CmsError(CMS_ERROR_CODES errorCode, string message)
|
||||
{
|
||||
this.errorCode = errorCode;
|
||||
this.localizationKey = message;
|
||||
}
|
||||
|
||||
public bool IsError()
|
||||
{
|
||||
if (errorCode == CMS_ERROR_CODES.OK)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
public static CmsError InternalError(string message)
|
||||
{
|
||||
return new CmsError(CMS_ERROR_CODES.INTERNAL_ERROR, message);
|
||||
}
|
||||
|
||||
public static CmsError NcError(string message)
|
||||
{
|
||||
return new CmsError(CMS_ERROR_CODES.NC_PROD_ERROR, message);
|
||||
}
|
||||
}
|
||||
|
||||
public enum CMS_ERROR_CODES : uint
|
||||
{
|
||||
OK = 0,
|
||||
NC_PROD_ERROR = 1,
|
||||
NOT_CONNECTED = 2,
|
||||
PROC_NOT_FOUND = 3,
|
||||
FUNCTION_NOT_ALLOWED = 4,
|
||||
BIT_NOT_IN_RANGE = 5,
|
||||
BYTE_NOT_IN_RANGE = 6,
|
||||
INTERNAL_ERROR = 7,
|
||||
INCORRECT_PARAMETERS = 8,
|
||||
NC_LANGUAGE_ERROR = 9,
|
||||
SIEMENS_ENVIRONMENT_NOT_FOUND = 10,
|
||||
SIEMENS_HMI_NOT_RUNNING = 11,
|
||||
MAX_TOOL_REACHED = 12,
|
||||
MAX_EDGES_PER_TOOL_REACHED = 13,
|
||||
MAX_FAMILY_REACHED = 14,
|
||||
MAX_MULTITOOL_REACHED = 15,
|
||||
MAX_TOOLS_PER_MULTITOOL_REACHED = 16,
|
||||
MAX_MULTITOOL_LOCATION_REACHED = 17,
|
||||
MAG_POS_OCCUPIED = 18,
|
||||
MAGAZINE_OCCUPIED = 19,
|
||||
TOOL_IS_MOUNTED = 20,
|
||||
TOOL_AND_POSITION_NOT_MATCHING = 21,
|
||||
FILE_NOT_FOUND = 22
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user