140 lines
5.2 KiB
C#
140 lines
5.2 KiB
C#
namespace CMS_CORE_Library
|
|
{
|
|
public static class DataStructures
|
|
{
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#region Data structor models
|
|
|
|
public struct PreAndPostPowerOnModel
|
|
{
|
|
public PrePowerOnModel PrePowerOn;
|
|
public PostPowerOnModel PostPowerOn;
|
|
}
|
|
|
|
public struct PowerOnDataModel
|
|
{
|
|
public uint Id;
|
|
public bool Active;
|
|
public bool Clickable;
|
|
}
|
|
|
|
public class PrePowerOnModel
|
|
{
|
|
public PowerOnDataModel PowerOn;
|
|
public PowerOnDataModel AirPressure;
|
|
public PowerOnDataModel ProtectionStatus;
|
|
public PowerOnDataModel EmergencyButtons;
|
|
public PowerOnDataModel SettingMode;
|
|
public PowerOnDataModel StartingKey;
|
|
}
|
|
|
|
public class PostPowerOnModel
|
|
{
|
|
public PowerOnDataModel AxisReset;
|
|
public PowerOnDataModel WaterjetPump;
|
|
}
|
|
|
|
public class AlarmModel
|
|
{
|
|
public uint Id;
|
|
public string Message;
|
|
public bool IsWarning;
|
|
public int Process;
|
|
}
|
|
|
|
public class ProcessDataModel
|
|
{
|
|
public ushort Id;
|
|
public string Type;
|
|
public bool IsInAlarm;
|
|
public string PartProgramName;
|
|
public string Status;
|
|
public bool Visible;
|
|
public byte Reps;
|
|
}
|
|
|
|
public struct FunctionalityModel
|
|
{
|
|
public uint Id;
|
|
public bool IsActive;
|
|
}
|
|
|
|
public struct StrobeModel
|
|
{
|
|
public uint Id;
|
|
public bool IsActive;
|
|
}
|
|
|
|
public struct AxisResetDataModel
|
|
{
|
|
public bool IsActive;
|
|
public int Percentage;
|
|
}
|
|
|
|
#endregion Data structor models
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#region Cms Errors Codes
|
|
|
|
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
|
|
}
|
|
|
|
public class CmsError
|
|
{
|
|
public CMS_ERROR_CODES errorCode;
|
|
public string message;
|
|
|
|
public CmsError(CMS_ERROR_CODES errorCode, string message)
|
|
{
|
|
this.errorCode = errorCode;
|
|
this.message = 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);
|
|
}
|
|
}
|
|
|
|
internal static CmsError NO_ERROR = new CmsError(CMS_ERROR_CODES.OK, "");
|
|
internal static CmsError NOT_CONNECTED_ERROR = new CmsError(CMS_ERROR_CODES.NOT_CONNECTED, "CMS-Core-Error: Nc not Connected");
|
|
internal static CmsError PROC_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "CMS-Core-Error: Function not allowed for this type of NC");
|
|
internal static CmsError FUNCTION_NOT_ALLOWED_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "CMS-Core-Error: Function not allowed for this type of NC");
|
|
internal static CmsError BIT_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BIT_NOT_IN_RANGE, "CMS-Core-Error: Bit - number must be between 0 and 7");
|
|
internal static CmsError BYTE_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BYTE_NOT_IN_RANGE, "CMS-Core-Error: Byte - number must be between 0 and 1");
|
|
internal static CmsError INCORRECT_PARAMETERS_ERROR = new CmsError(CMS_ERROR_CODES.INCORRECT_PARAMETERS, "CMS-Core-Error: Incorrect Parameters error");
|
|
internal static CmsError LANGUAGE_ERROR = new CmsError(CMS_ERROR_CODES.NC_LANGUAGE_ERROR, "CMS-Core-Error: Incorrect Language");
|
|
internal static CmsError SIEMENS_ENVIRONMENT_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND, "CMS-Core-Error: Siemens Environment not found");
|
|
internal static CmsError SIEMENS_HMI_NOT_RUNNING_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING, "CMS-Core-Error: Siemens HMI is not Running / Ready");
|
|
|
|
#endregion Cms Errors Codes
|
|
}
|
|
} |