示例#1
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;

        zero           = new Vector3(0, 0, 0);
        containerGame  = GameObject.FindGameObjectWithTag("GameController");
        gameController = containerGame.GetComponent <GameController>();

        containerScriptMove = GameObject.FindGameObjectWithTag("Player");
        scriptMove          = containerScriptMove.GetComponent <MoveController>();

        containerScriptAudioAlert = GameObject.FindGameObjectWithTag("GameController");
        ScriptAuidoAlert          = containerScriptAudioAlert.GetComponent <AudioAlert>();

        agent         = gameObject.GetComponent <NavMeshAgent>();
        ponto_1       = true;
        ponto_2       = false;
        ponto_central = false;

        if (PatrolPoints[0] == null)
        {
            ponto_1       = false;
            ponto_2       = false;
            ponto_central = true;
            anim.SetBool("iddle", true);
        }

        Patrol();
    }
示例#2
0
        public void NewMessageArrived()
        {
            //string r3 = rmu900Helper.CheckWriteEpc();
            //if (r3 != string.Empty)
            //{

            //    Debug.WriteLine("写入标签成功 " + r3);
            //}
            //string r2 = rmu900Helper.CheckInventory();
            //if (r2 != string.Empty)
            //{
            //    this.UpdateEpcList(r2);
            //    //AudioAlert.PlayAlert();
            //    Debug.WriteLine("读取到标签 " + r2);

            //}
            string r1 = rmu900Helper.ChekcInventoryOnce();

            if (r1 != string.Empty)
            {
                Debug.WriteLine("读取到标签 " + r1);
                AudioAlert.PlayAlert();
                this.UpdateEpcList(r1);
            }
            string r = rmu900Helper.CheckRmuStatus();

            if (r == "ok")
            {
                MessageBox.Show("设备状态良好!");
            }
        }
示例#3
0
        void LinkEPCToProduct(object o)
        {
            deleControlInvoke dele = delegate(object oEpc)
            {
                string epc = oEpc as string;
                DataGridViewRowCollection rows = this.dgvNotStoragedPInfo.Rows;
                foreach (DataGridViewRow vr in rows)
                {
                    DataGridViewCell cepc = (DataGridViewCell)vr.Cells[1];
                    if (((string)cepc.Value) == epc)
                    {
                        DataGridViewCheckBoxCell cbc = (DataGridViewCheckBoxCell)vr.Cells[0];
                        if (cbc.Value == null || ((string)cbc.Value) == Boolean.FalseString)
                        {
                            cbc.Value = Boolean.TrueString;
                            AudioAlert.PlayAlert();
                        }

                        break;
                    }
                }
            };

            this.Invoke(dele, o);
        }
示例#4
0
 public void new_message(string code)
 {
     //if (r1 != string.Empty)
     {
         //Debug.WriteLine("读取到标签 " + r1);
         AudioAlert.PlayAlert();
         this.UpdateEPCtxtBox(code);
     }
 }
示例#5
0
 public void new_message(string code)
 {
     //string r2 = rmu900Helper.CheckInventory();
     //if (r2 != string.Empty)
     //{
     //    Debug.WriteLine("读取到标签 " + r2);
     AudioAlert.PlayAlert();
     this.LinkEPCToProduct(code);
     //}
 }
        public void NewMessageArrived()
        {
            string r1 = rmu900Helper.ChekcInventoryOnce();

            if (r1 != string.Empty)
            {
                // Debug.WriteLine("读取到标签 " + r1);
                AudioAlert.PlayAlert();
                this.CheckToRemoteServer(r1);
                // this.UpdateEpcList(r1);
            }
            //string r = rmu900Helper.CheckRmuStatus();
            //if (r == "ok")
            //{
            //    MessageBox.Show("设备状态良好!");
            //}
        }
示例#7
0
    // Use this for initialization
    void Start()
    {
        vazio = false;
        containerScriptAudioAlert = GameObject.FindGameObjectWithTag("GameController");
        ScriptAuidoAlert          = containerScriptAudioAlert.GetComponent <AudioAlert> ();

        agent = gameObject.GetComponent <NavMeshAgent> ();
        anim  = gameObject.GetComponent <Animator> ();

        atirando = false;

        rdm = Random.Range(0, 9);
        if (CasasViking [rdm] == null)
        {
            RandomNewHouse();
        }
        else
        {
            agent.SetDestination(PosicaoDeAtack [rdm].transform.position);
        }

        life = Random.Range(40, 80);
    }
示例#8
0
        public void NewMessageArrived()
        {
            if (this.alreadyWriteSuccess == true)
            {
                return;
            }
            string r3 = rmu900Helper.CheckWriteEpc();

            if (r3 != string.Empty)
            {
                this.alreadyWriteSuccess = true;
                AudioAlert.PlayAlert();
                Debug.WriteLine("写入标签成功 " + r3);
                addTieBiao();
            }
            string r1 = rmu900Helper.ChekcInventoryOnce();

            if (r1 != string.Empty)
            {
                Debug.WriteLine("读取到标签 " + r1);
                AudioAlert.PlayAlert();
                this.UpdateEpcList(r1);
            }
        }
        void LinkEPCToProduct(object o)
        {
            deleControlInvoke dele = delegate(object oEpc)
            {
                string epc = oEpc as string;
                //根据传入的id按照以下思路处理
                // 首先在当前列表中查找是否含有该id,如果有,则账物相符加1,盘亏减1
                // 如果未在列表中找到该id,说明是盘盈,需要在列表中添加该产品信息,并且盘盈加1
                DataGridViewRowCollection rows = this.dgvProductInfo.Rows;
                bool bFind = false;
                foreach (DataGridViewRow vr in rows)
                {
                    DataGridViewCell cepc = (DataGridViewCell)vr.Cells[1];
                    if (((string)cepc.Value) == epc)
                    {
                        DataGridViewCheckBoxCell cbc = (DataGridViewCheckBoxCell)vr.Cells[0];
                        if (cbc.Value == null)
                        {
                            AudioAlert.PlayAlert();
                        }
                        if ((LightStatus)cbc.Value == LightStatus.TurnedOff)
                        {
                            cbc.Value = LightStatus.TurnedOn;
                            int ncrtEqul = int.Parse(this.lblEqual.Text);
                            int ncrtLess = int.Parse(this.lblLess.Text);
                            this.lblLess.Text  = (ncrtLess - 1).ToString();
                            this.lblEqual.Text = (ncrtEqul + 1).ToString();
                        }

                        bFind = true;
                        break;
                    }
                }
                if (bFind == false)
                {
                    //获取具有该id的产品信息
                    Product        p1         = new Product(epc, string.Empty, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), string.Empty, string.Empty);
                    string         jsonString = fastJSON.JSON.Instance.ToJSON(p1);
                    HttpWebConnect helper     = new HttpWebConnect();
                    helper.RequestCompleted += new deleGetRequestObject(helper_RequestCompleted_getProduct);
                    string url = RestUrl.getProduct;
                    helper.TryPostData(url, jsonString);
                }
            };

            this.Invoke(dele, o);
            //DataTable dt1 = ctlInventory.GetProductInfoTable(epc);
            //if (dt1.Rows.Count > 0)
            //{
            //    //将具体的产品信息添加到详细列表里面
            //    if (this.dgvProductInfo.DataSource != null)
            //    {
            //        DataTable dt = (DataTable)this.dgvProductInfo.DataSource;

            //        //首先检查该产品是否已经扫描过
            //        bool alreadyAdded = false;
            //        foreach (DataRow dr in dt.Rows)
            //        {
            //            if (dr.ItemArray[0].ToString() == epc)
            //            {
            //                alreadyAdded = true;
            //                break;
            //            }
            //        }
            //        //如果尚未扫描过
            //        if (!alreadyAdded)
            //        {
            //            DataRow dr = dt.NewRow();
            //            dr.ItemArray = dt1.Rows[0].ItemArray;
            //            dt.Rows.Add(dr);
            //        }
            //    }
            //}
        }