Пример #1
0
        /// <summary>
        /// 初始化方法
        /// </summary>
        public virtual void Init(string _DisplayName, string _Line, string _BU, OleExec DB)
        {
            Inputs.Clear();
            SFCDB = DB;
            Line  = _Line;
            BU    = _BU;
            //加載Station Input
            try
            {
                T_R_Station   T = new T_R_Station(SFCDB, DBType);
                Row_R_Station R = T.GetRowByDisplayName(_DisplayName, SFCDB);
                _StationInfo = R.GetDataObject();

                T_R_Station_Input          T_I      = new T_R_Station_Input(SFCDB, DBType);
                List <Row_R_Station_Input> R_Inputs = T_I.GetRowsByStationID(_StationInfo.ID, SFCDB);

                T_C_Input T_INPUT = new T_C_Input(SFCDB, DBType);
                for (int i = 0; i < R_Inputs.Count; i++)
                {
                    Row_C_Input     R_C_I   = (Row_C_Input)T_INPUT.GetObjByID(R_Inputs[i].INPUT_ID, SFCDB);
                    C_Input         C_Input = R_C_I.GetDataObject();
                    MESStationInput Input   = new MESStationInput();
                    Input.Station = this;
                    Input.Init(C_Input, R_Inputs[i].GetDataObject());
                    Inputs.Add(Input);
                }
                //加載Station OutPut
                T_R_Station_Output          TRSO      = new T_R_Station_Output(SFCDB, DBType);
                List <Row_R_Station_Output> R_Outputs = TRSO.GetStationOutputByStationID(_StationInfo.ID, SFCDB);

                ROutputs = R_Outputs;
                for (int i = 0; i < R_Outputs.Count; i++)
                {
                    R_Station_Output o  = R_Outputs[i].GetDataObject();
                    DisplayOutPut    o1 = new DisplayOutPut();
                    o1.DisplayType = o.DISPLAY_TYPE;
                    o1.Value       = "";
                    o1.Name        = o.NAME;
                    StationOutputs.Add(o);
                    DisplayOutput.Add(o1);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }


            if (_StationInfo.FAIL_STATION_ID != null && _StationInfo.FAIL_STATION_ID.ToString().Trim() != "")
            {
                if (this.FailStation != null)
                {
                    this.FailStation.StationMessages.Clear();
                    this.NextInput = null;
                }
                else
                {
                    this.FailStation = new MESStationBase();
                }
                this.FailStation.LoginUser = LoginUser;
                this.FailStation.Init(_StationInfo.FAIL_STATION_ID, _Line, _BU, DB);
            }
        }