Example #1
0
        public void carryOut(string name)
        {
            name = name.Replace("_", "");
            Dictionary <string, int> keys = new Dictionary <string, int>();

            keys.Add("RX09EMPTYOUT", 7);
            keys.Add("RX09FINOUT", 18);

            keys.Add("RX08EMPTYOUT", 10);
            keys.Add("RX08FINOUT", 17);

            keys.Add("RX07EMPTYOUT", 12);

            foreach (var item in keys)
            {
                if (name.Contains(item.Key))
                {
                    TestRightCarryService <AllenBradleyControlDevice> carry = new TestRightCarryService <AllenBradleyControlDevice>(new AllenBradleyControlDevice());
                    var ret = carry.CarryIn("1", keys[item.Key].ToString());
                    break;
                }
            }
        }
Example #2
0
        private void OnReq_Command()
        {
            Task.Factory.StartNew(() =>
            {
                if (Req_Fin == 1)
                {
                    return;
                }

                Req_Fin = 1;

                TestRightCarryService <AllenBradleyControlDevice> carry = new TestRightCarryService <AllenBradleyControlDevice>(carryDevice);
                carry.SendRightCarryServiceStateMessageEvent           += (s) => {
                    DispatcherHelper.CheckBeginInvokeOnUI(() =>
                    {
                        Messages.Add(new MessageItem {
                            State = s.State, Message = s.Message, CreateDateTime = DateTime.Now
                        });
                    });
                };

                if (In_Out == false)
                {
                    var ret = carry.CarryIn(Prod_Type.ToString(), Mate_Type.ToString());
                    Req_Fin = ret == true ? 2 : 3;
                }
                else
                {
                    int qty = 0;
                    var ret = carry.CarryOut(Prod_Type.ToString(), Mate_Type.ToString(), ref qty);
                    Req_Fin = ret == true ? 2 : 3;
                }

                carry.ReleaseLock();
            });
        }
Example #3
0
        //料库执行入库
        private bool WareHouseInMission(AgvInMissonModel mission)
        {
            if (missionContext.carryDevice as RightCarryService.TestControlDevice != null)
            {
                mission.CarryProcess = CarryMissonProcessEnum.FINISHED;
                return(true);
            }

            TestRightCarryService <IControlDevice> carry = new TestRightCarryService <IControlDevice>(missionContext.carryDevice);

            var ret = carry.CarryIn(mission.ProductId, mission.MaterialId);

            if (ret == false)
            {
                mission.Process      = AgvMissonProcessEnum.CANCEL;
                mission.CarryProcess = CarryMissonProcessEnum.CANCEL;
                carry.ReleaseLock();
                return(false);
            }

            mission.CarryProcess = CarryMissonProcessEnum.FINISHED;
            carry.ReleaseLock();
            return(true);
        }