Example #1
0
        public static FurnaceInfo Mapper(BatchProductInfo s)
        {
            FurnaceInfo d = Activator.CreateInstance <FurnaceInfo>();

            try
            {
                var Types = s.GetType();                           //获得类型
                var Typed = typeof(FurnaceInfo);
                foreach (PropertyInfo sp in Types.GetProperties()) //获得类型的属性字段
                {
                    foreach (PropertyInfo dp in Typed.GetProperties())
                    {
                        if (dp.Name == sp.Name)                         //判断属性名是否相同
                        {
                            dp.SetValue(d, sp.GetValue(s, null), null); //获得s对象属性的值复制给d对象的属性
                        }
                    }
                }

                d.PWOs = s.GetPWOsFromXML();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(d);
        }
Example #2
0
        private void InitFurnaceInfo(FurnaceInfo furnace)
        {
            switch (furnace.PrdtStatus)
            {
            case ProductionStatus.Idle:
                if (furnace != null)
                {
                    grdPWOs.DataSource = furnace.PWOs;
                }
                else
                {
                    grdPWOs.DataSource = null;
                }
                grdvPWOs.BestFitColumns();

                edtOperatorCode.Text    = "";
                lblBatchNo.Text         = "";
                lblProductTimeSpan.Text = "";

                GetMethodStandards(0, 0, "");

                break;

            case ProductionStatus.Busy:
                TWaitting.Instance.ShowWaitForm("初始化生产过程参数......");
                try
                {
                    grdPWOs.DataSource = furnace.PWOs;
                    grdvPWOs.BestFitColumns();

                    edtOperatorCode.Text = $"{furnace.OperatorCode}[{furnace.OperatorName}]";
                    lblBatchNo.Text      = furnace.BatchNumber;

                    // 如果当前生产批次号中有工单,则获取生产过程参数
                    if (furnace.PWOs.Count > 0)
                    {
                        GetMethodStandards(0, stationInfo.T216LeafID, furnace.BatchNumber);
                    }
                    else
                    {
                        GetMethodStandards(0, 0, "");
                    }
                }
                finally
                {
                    TWaitting.Instance.CloseWaitForm();
                }
                break;
            }

            Refresh();

            if (edtOperatorCode.Enabled)
            {
                edtOperatorCode.Focus();
            }
        }
Example #3
0
 private void ilstBatchNos_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ilstBatchNos.SelectedItem != null)
     {
         currentFurnace = (ilstBatchNos.SelectedItem as ImageListBoxItem).Value as FurnaceInfo;
         if (currentFurnace.InProduction != 1)
         {
             currentFurnace.PWOs.Clear();
         }
         InitFurnaceInfo(currentFurnace);
     }
 }
Example #4
0
        private void ucPrdtParams_Furnace_Load(object sender, EventArgs e)
        {
            // 获取当前设备正在生产的炉次信息列表
            List <BatchProductInfo> datas = GetWorkUnitProductionInfo();

            // 数据库函数对象集转换成程序对象集
            foreach (BatchProductInfo data in datas)
            {
                if (data.BatchNumber.Trim() != "")
                {
                    batchNos.Add(FurnaceInfo.Mapper(data));
                }
            }

            // 添加到 ImageListBox 控件中
            foreach (FurnaceInfo batch in batchNos)
            {
                ilstBatchNos.Items.Add(batch, -1);
            }
            ilstBatchNos.Items.Add(new FurnaceInfo(), -1);
        }