using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.Serialization; using System.Xml.Serialization; namespace Aitex.Core.Util { //Some common data structure are defined here for data transfer between server and client //via serialization and deserialization /// /// Analog device data /// [DataContract] [Serializable] public class AnalogDeviceData { [DataMember] public string TechnicalName { get; set; } [DataMember] public string DeviceName { get; set; } [DataMember] public string DeviceId { get; set; } [DataMember] public string Unit { get; set; } [DataMember] public string Description { get; set; } /// /// 量程 /// [DataMember] public double Scale { get; set; } /// /// 设定值 /// [DataMember] public double SetPoint { get; set; } /// /// 实际反馈值 /// [DataMember] public double FeedBack { get; set; } /// /// 默认值 /// [DataMember] public double DefaultValue { get; set; } /// /// 是否有报警 /// [DataMember] public bool IsWarning { get; set; } /// /// alarm或是erro时显示的信息 /// [DataMember] public string ErroMessage { get; set; } private double _factor = 1.0; [DataMember] public double Factor { get { return _factor; } set { _factor = value; } } public override string ToString() { return FeedBack.ToString(); } /// /// Default constructor. /// public AnalogDeviceData() { } /// /// Copy constructor of this object. /// /// public AnalogDeviceData(AnalogDeviceData deviceData) { TechnicalName = deviceData.TechnicalName; DeviceName = deviceData.DeviceName; DeviceId = deviceData.DeviceId; Unit = deviceData.Unit; Description = deviceData.Description; Scale = deviceData.Scale; SetPoint = deviceData.SetPoint; FeedBack = deviceData.FeedBack; DefaultValue = deviceData.DefaultValue; IsWarning = deviceData.IsWarning; ErroMessage = deviceData.ErroMessage; } } //public interface IAnalogData //{ // AnalogDeviceData GetData(string deviceId); //} /// /// Digital device data /// [DataContract] [Serializable] public class DigitalDeviceData { [DataMember] public string TechnicalName { get; set; } [DataMember] public string DeviceName { get; set; } [DataMember] public string DeviceId { get; set; } /// /// 当前设定值 /// [DataMember] public bool SetValue { get; set; } /// /// 默认值 /// [DataMember] public bool DefaultValue { get; set; } /// /// 实际反馈值 /// [DataMember] public bool Feedback { get; set; } public override string ToString() { return Feedback.ToString(); } } //public interface IDigitalData //{ // DigitalDeviceData GetData(string deviceId); //} ///// ///// Reactor data ///// //[DataContract] //[Serializable] //public class ReactorData //{ // public ReactorData() // { // MFC = new SerializableDictionary(); // PC = new SerializableDictionary(); // Valve = new SerializableDictionary(); // ProcessData = new SerializableDictionary(); // } // /// // /// Class members // /// // public SerializableDictionary MFC; // /// // /// Class members // /// // public SerializableDictionary PC; // /// // /// Class members // /// // public SerializableDictionary Valve; // /// // /// Class members // /// // public SerializableDictionary ProcessData; //} ///// ///// Heater data ///// //[DataContract] //[Serializable] //public class HeaterData //{ // public bool Enable; // public bool PsuEnable; // public HeaterMode Mode; // public double[] ZoneTempFeedback; // public double[] ZoneCurrentFeedback; // public double[] ZonePowerFeedback; // public double[] ZoneTcFeedback; // //public double[] PSU_Current_Read; // public double[] Zone_Voltage_Read; // public double[] Current_SetPoint; //} ///// ///// Pressure data ///// //[DataContract] //[Serializable] //public class PressureData //{ // public bool ThrottleValveEnable; // public bool MainPumpEnable; // public PressureControlMode Mode; // /// // /// pres real data // /// // public double TVPresFeedback; //throttle valve pressure feedback // public double TVPresSetPoint; // public double PT1Feedback; // public double PT2Feedback; // public double ThrottleValveOpenRate; // public int TV_Status; //} ///// ///// System monitor view data ///// //[DataContract] //[Serializable] //public class SystemMonitorViewData //{ // /// // /// Susceptor infors // /// // public SerializableDictionary ChamberSusceptorInfos // { // get; // set; // } // public SerializableDictionary ChamberCommStates; // /// // /// IsServiceModeA // /// // public bool IsServiceModeA // { // get; // set; // } // /// // /// IsServiceModeB // /// // public bool IsServiceModeB // { // get; // set; // } // /// // /// IsServiceModeC // /// // public bool IsServiceModeC // { // get; // set; // } // /// // /// IsServiceModeD // /// // public bool IsServiceModeD // { // get; // set; // } // /// // /// IsServiceRunningLoadlock // /// // public bool IsServiceRunningLoadlock // { // get; // set; // } // /// // /// IsServiceRunningTransfer // /// // public bool IsServiceRunningTransfer // { // get; // set; // } // /// // /// Is reactor processing? // /// // public bool IsProcessingA // { // get; // set; // } // /// // /// Is reactor processing? // /// // public bool IsProcessingB // { // get; // set; // } // /// // /// Is reactor processing? // /// // public bool IsProcessingC // { // get; // set; // } // /// // /// Is reactor processing? // /// // public bool IsProcessingD // { // get; // set; // } // /// // /// Is reactor susceptor rotation? // /// // public bool IsRotatingA // { // get; // set; // } // /// // /// Is reactor susceptor rotation? // /// // public bool IsRotatingB // { // get; // set; // } // /// // /// Is reactor susceptor rotation? // /// // public bool IsRotatingC // { // get; // set; // } // /// // /// Is reactor susceptor rotation? // /// // public bool IsRotatingD // { // get; // set; // } // /// // /// Robot data // /// // public double RobotTheta // { // get; // set; // } // /// // /// Robot data // /// // public double RobotRadius // { // get; // set; // } // /// // /// Is sequencer running // /// // public bool SequencerRunning // { // get; // set; // } // /// // /// Chamber information // /// // public string PMA_Info // { // get; // set; // } // /// // /// Chamber information // /// // public string PMB_Info // { // get; // set; // } // /// // /// Chamber information // /// // public string PMC_Info // { // get; // set; // } // /// // /// Chamber information // /// // public string PMD_Info // { // get; // set; // } // /// // /// chamber door state // /// // public int IsPMADoorOpen // { // get; // set; // } // /// // /// chamber door state // /// // public int IsPMBDoorOpen // { // get; // set; // } // /// // /// chamber door state // /// // public int IsPMCDoorOpen // { // get; // set; // } // /// // /// chamber door state // /// // public int IsPMDDoorOpen // { // get; // set; // } // /// // /// LL door state // /// // public int IsLLDoorOpen // { // get; // set; // } // public bool IsLLDoorEverOpened // { // get; // set; // } // /// // /// Loadlock door latch state // /// // public int IsLLDoorLatched // { // get; // set; // } // /// // /// PMA pressure // /// // public double PMA_Pres // { // get; // set; // } // /// // /// PMB pressure // /// // public double PMB_Pres // { // get; // set; // } // /// // /// PMC pressure // /// // public double PMC_Pres // { // get; // set; // } // /// // /// PMD pressure // /// // public double PMD_Pres // { // get; // set; // } // /// // /// TM pressure // /// // public double TM_Pres // { // get; // set; // } // /// // /// LL pressure // /// // public double LL_Pres // { // get; // set; // } // /// // /// PMA temperature // /// // public double PMA_Temp // { // get; // set; // } // /// // /// PMB temperature // /// // public double PMB_Temp // { // get; // set; // } // /// // /// PMC temperature // /// // public double PMC_Temp // { // get; // set; // } // /// // /// PMD temperature // /// // public double PMD_Temp // { // get; // set; // } // /// // /// Cooldown temperature // /// // public double CoolDown_Temp // { // get; // set; // } // /// // /// LL temperature // /// // public double LL_Temp // { // get; // set; // } // /// // /// current cycle // /// // public int TheIthCycle { get; set; } // public int CycleCount { get; set; } // public bool IsCycleMode { get; set; } //} ///// ///// Config data structure ///// //[DataContract] //[Serializable] //public class ConfigEntry //{ // public ChamberSet ChamId { get; set; } // public string SectionName { get; set; } // public string EntryName { get; set; } // public string Description { get; set; } // public string Type { get; set; } // public string Unit { get; set; } // public string Value { get; set; } // public string Default { get; set; } // public string RangeLowLimit { get; set; } // public string RangeUpLimit { get; set; } // public string XPath { get; set; } //} ///// ///// 显示数据只包含时间和数值 ///// //[DataContract] //[Serializable] //public class ChartShowInfo //{ // public string TimeString { get; set; } // public DateTime Time { get; set; } // public double Value { get; set; } //} //[DataContract] //[Serializable] //public class TransferData //{ // public bool DorDPressSwitch; // public bool DorCPressSwitch; // public bool DorBPressSwitch; // public bool DorAPressSwitch; // public bool TubePressSwitch; // public bool DoubleOringPump; // public bool TmDryPump; // public bool? TmPumpRun; // public bool TmPumpAlarm; // public bool TransferFastPumpClose; // public bool TransferSlowPumpClose; //} //[DataContract] //[Serializable] //public class LoadLockData //{ // public bool LoadLockFastPumpClose; // public bool LoadLockSlowPumpClose; // public bool GateIsOpen; // public bool DoorClose; // public double Temperature; // public double Pressure; // public bool AtAtm; // public bool UnderVacuum; //} ///// ///// Reactor's bubbler data ///// //[DataContract] //[Serializable] //public class BubblerData //{ // /// // /// 名称 // /// // public string MoName { get; set; } // /// // /// 总量 // /// // public double TotalWeight { get; set; } // /// // /// 计算使用量 // /// // public double IntegralUsedWeight { get; set; } // /// // /// 计算因子 // /// // public double MoCalcFactor { get; set; } // /// // /// 报警阈值 // /// // public double MoAlarmLimit { get; set; } // /// // /// 实际使用量 // /// // public double MoUsedWeight { get; set; } // /// // /// 实际剩余量 // /// // public double MoRemainedWeight { get; set; } // /// // /// MO剩余百分比 // /// // public string MoRemainedPercentage { get; set; } // /// // /// Bubble温度 // /// // public double BubbleTemp { get; set; } // /// // /// 平均每分钟的MO消耗质量 // /// // public double AveragedMoWeightLostPerMin { get; set; } //} ///// ///// 模块监控单元的状态定义 ///// //[DataContract] //[Serializable] //public enum ModuleMonitorItemStatus //{ // Alarm, // NoAlarm, // Active, // NoActive //} ///// ///// 模块监控单元 ///// //[DataContract] //[Serializable] //public class ModuleMonitorItem //{ // public string ModuleName { get; set; } // public string Description { get; set; } // public ModuleMonitorItemStatus Status { get; set; } //} ///// ///// ///// //[DataContract] //[Serializable] //public class ChartSaveData //{ // public DateTime RecordTime; // public double tvPresData; // public double ZoneA_TC_Read, ZoneB_TC_Read, ZoneC_TC_Read, ZoneD_TC_Read; // public double ZoneA_Current_Read, ZoneB_Current_Read, ZoneC_Current_Read, ZoneD_Current_Read; //} //[DataContract] //[Serializable] //public enum ServerRoutineState //{ // NotRun, // ZhenKong, // Vent, // CyclePurge, // LeakCheck, //} [Serializable] public class DataItem { public string DataName { get; set; } //public bool IsPreLoaded { get; set; } public List TimeStamp { get; set; } public List RawData { get; set; } } /// /// archived data format /// [Serializable] public class ArchivedFile { public string ChamId { get; set; } public string Description { get; set; } public DateTime BeginTime { get; set; } public DateTime EndTime { get; set; } public Dictionary Datas { get; set; } public Dictionary> AliasList { get; set; } public List> RecipeSteps { get; set; } } #region PM data /// /// 标识不需要数据库记录的数据类型 /// [AttributeUsageAttribute(AttributeTargets.Property | AttributeTargets.Field)] public class DatabaseSaveIgnoreAttribute : Attribute { } [Serializable] [DataContract] public class BathData { [XmlAttribute] public string BathName; public bool IsCommErr; public bool IsOutofTempRange; [DatabaseSaveIgnore] public bool IsTempSignalAlarm; [DatabaseSaveIgnore] public bool IsCutoffAlarm; [DatabaseSaveIgnore] public bool IsLevelWarning; public double TemperatureReading; } [Serializable] [DataContract] public class MoLine { [XmlAttribute] public string MoName; [DatabaseSaveIgnore] public bool IsDummyMo; //public bool IsBathTempAbnormal; //public double BathTemperatureReading; [DatabaseSaveIgnore] public double MoAlarmLimit; public double MoTotalWeight; [DatabaseSaveIgnore] public double MoWeightCalFactor; public double IntegralUsedWeight; public bool IsMoRemainedWeightAlarm; [DatabaseSaveIgnore] public double MoRemainedPercentage; [DatabaseSaveIgnore] public double MoRemainedWeight; public double MoUsedWeight; public double ToChamFlowRate; [DatabaseSaveIgnore] public double AveragedMoWeightLostPerMin;/*平均每分钟的MO消耗量计算值*/ [DatabaseSaveIgnore] public BathData Bath; public override string ToString() { return MoName; } } #endregion }