Example #1
0
        //动作完成事件
        private void Competed_Event(object sender, EventArgs e)
        {
            DsRecord dsRecord = new DsRecord();

            dsRecord.EntryDate = DateTime.Now.ToString("HH:mm:ss");
            //配送动作
            if (sender is WashingMaterialDS)
            {
                Golbal.WashingDSStep  = 2; //助剂配送完成
                dsRecord.ActionName   = "助剂配送";
                dsRecord.MaterialName = washingmaterialDS.CurrentDsMaterial.MaterialName;
                dsRecord.DSQuantity   = decimal.Parse(Golbal.ParamClass.水洗助剂配送实际);
                Golbal.RecordAdd(Golbal.CurrentWashingaModel.Devicetype, Golbal.CurrentWashingaModel.BarCode, Golbal.WashingCurrentPotCode, dsRecord, washingmaterialDS.CurrentDsMaterial);//添加纪录
            }

            //机水动作
            if (sender is WashingCabinetWaterDS)
            {
                Golbal.WashingWaterStep = 2;// 机台放水完成

                dsRecord.ActionName   = "机台放水";
                dsRecord.MaterialName = "水";
                dsRecord.DSQuantity   = decimal.Parse(Golbal.ParamClass.水洗机台放水实际);

                Golbal.RecordAdd(Golbal.CurrentWashingaModel.Devicetype, Golbal.CurrentWashingaModel.BarCode, Golbal.WashingCurrentPotCode, dsRecord, washingcabinetWaterDS.CurrentDsMaterial);//添加纪录
            }


            if (Golbal.WashingDSStep == 2 && Golbal.WashingWaterStep == 2)
            {
                Golbal.WashingEndExcute();
            }
            RecordShow(dsRecord);
        }
Example #2
0
        //动作完成事件
        private void Competed_Event(object sender, EventArgs e)
        {
            DsRecord dsRecord = new DsRecord();

            dsRecord.EntryDate = DateTime.Now.ToString("HH:mm:ss");
            //配送动作
            if (sender is MaterialDS)
            {
                dsRecord.ActionName   = "助剂配送";
                dsRecord.MaterialName = materialDS.CurrentDsMaterial.MaterialName;
                dsRecord.DSQuantity   = decimal.Parse(Golbal.ParamClass.助剂配送实际);
                Golbal.RecordAdd(Golbal.CurrentFormulaModel.DeviceType, Golbal.CurrentFormulaModel.BarCode, Golbal.CurrentPotCode, dsRecord, materialDS.CurrentDsMaterial); //添加纪录

                if (Golbal.DSStep == 1)                                                                                                                                     //助剂配送完成
                {
                    Golbal.DSStep = 2;
                    myPanel.SetFinishLabel(materialDS.CurrentDsMaterial.MaterialId); //设置完成标识
                    DsMaterial dsMaterial = new DsMaterial();
                    dsMaterial.MaterialId       = Golbal.WaterModel.Id.ToString();
                    dsMaterial.MaterialCode     = Golbal.WaterModel.Code;
                    dsMaterial.MaterialName     = "间隔水";
                    dsMaterial.MaterialQuantity = Golbal.IntervalWater;
                    dsMaterial.Unit             = Golbal.WaterModel.Unit;
                    dsMaterial.Price            = Golbal.WaterModel.Price.Value;
                    materialDS.Excute(Golbal.ParamClass, Golbal.CurrentPotCode, dsMaterial); //间隔水
                }

                else if (Golbal.DSStep == 2)//间隔水完成
                {
                    if (Golbal.MaterialQueue.Count > 0)
                    {
                        Golbal.DSStep = 1;
                        DsMaterial dsMaterial = Golbal.MaterialQueue.Dequeue();
                        materialDS.Excute(Golbal.ParamClass, Golbal.CurrentPotCode, dsMaterial);//助剂配送
                    }
                    else
                    {
                        Golbal.DSStep = 3;
                        DsMaterial dsMaterial = new DsMaterial();
                        dsMaterial.MaterialId       = Golbal.WaterModel.Id.ToString();
                        dsMaterial.MaterialCode     = Golbal.WaterModel.Code;
                        dsMaterial.MaterialName     = "清洗水";
                        dsMaterial.MaterialQuantity = Golbal.CleanWater;
                        dsMaterial.Unit             = Golbal.WaterModel.Unit;
                        dsMaterial.Price            = Golbal.WaterModel.Price.Value;
                        materialDS.Excute(Golbal.ParamClass, Golbal.CurrentPotCode, dsMaterial); //管道清洗
                    }
                }
                else if (Golbal.DSStep == 3)//清洗水完成
                {
                    Golbal.DSStep = 4;

                    endWaterDS.Excute(Golbal.ParamClass, Golbal.CurrentPotCode, "99", Golbal.EndWater);
                }
            }

            //末端动作
            if (sender is EndWaterDS) //末端排放完成
            {
                Golbal.DSStep = 5;

                Golbal.CurrentAction = "等待机台放水中";
                if (Golbal.WaterStep == 2)  //当机台放水完成
                {
                    Golbal.EndExcute();
                }
                dsRecord.ActionName   = "末端排放";
                dsRecord.MaterialName = "水";
                dsRecord.DSQuantity   = decimal.Parse(Golbal.ParamClass.助剂配送实际);

                Golbal.RecordAdd(Golbal.CurrentFormulaModel.DeviceType, Golbal.CurrentFormulaModel.BarCode, Golbal.CurrentPotCode, dsRecord, endWaterDS.CurrentDsMaterial);//添加纪录
            }
            //机水动作
            if (sender is CabinetWaterDS)
            {
                Golbal.WaterStep = 2;
                if (Golbal.DSStep == 5)//当末端排放完成
                {
                    Golbal.EndExcute();
                }
                dsRecord.ActionName   = "机台放水";
                dsRecord.MaterialName = "水";
                dsRecord.DSQuantity   = decimal.Parse(Golbal.ParamClass.机台放水实际);

                Golbal.RecordAdd(Golbal.CurrentFormulaModel.DeviceType, Golbal.CurrentFormulaModel.BarCode, Golbal.CurrentPotCode, dsRecord, cabinetWaterDS.CurrentDsMaterial);//添加纪录
            }

            RecordShow(dsRecord);
        }