Exemplo n.º 1
0
 /// <summary>
 /// 设定tag的value
 /// </summary>
 /// <param name="tagName">tag名</param>
 /// <param name="tagValue">tag值</param>
 public void setTagValue(string tagName, int tagValue, out string error)
 {
     error = string.Empty;
     try
     {
         tagDataProvider.SetData(tagName, tagValue.ToString());
     }
     catch (Exception er)
     {
         error = er.Message;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 模式切换
 /// </summary>
 /// <param name="theCraneNO">行车号</param>
 /// <param name="cmdFlag">对应模式切换数值</param>
 private void SendShortCmd(string theCraneNO, long cmdFlag)
 {
     try
     {
         string messageBuffer = string.Empty;
         messageBuffer = theCraneNO + "," + cmdFlag.ToString();
         Baosight.iSuperframe.TagService.DataCollection <object> wirteDatas = new Baosight.iSuperframe.TagService.DataCollection <object>();
         wirteDatas[theCraneNO + "_DownLoadShortCommand"] = messageBuffer;
         tagDataProvider.SetData(theCraneNO + "_DownLoadShortCommand", messageBuffer);
     }
     catch (Exception ex)
     {}
 }
Exemplo n.º 3
0
        private void SendShortCmd(string theNO, string  cmdFlag)
        {
            try
            {
                string messageBuffer = string.Empty;
                messageBuffer = theNO + "," + cmdFlag.ToString();
                Baosight.iSuperframe.TagService.DataCollection<object> wirteDatas = new Baosight.iSuperframe.TagService.DataCollection<object>();
                wirteDatas[theNO + "EV_PARKING_CARLEAVE"] = messageBuffer;
                tagDataProvider.SetData(theNO + "EV_PARKING_CARLEAVE", messageBuffer);
            }
            catch (Exception ex)
            {

            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!txtPacking.Text.ToString().Contains('Z') || txtPacking.Text.ToString().Trim() == "请选择")
            {
                MessageBox.Show("请先选择停车位!!", "提示");
                this.Close();
                return;
            }
            //框架车
            if (carType == "框架车")
            {
                txtDirection.Text = "东";
                // txtDirection.Enabled = false ;
                txtDirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
                //txtDirection
                if (txtDirection.Text.Trim() == "东")
                {
                    carDirection = "E";
                }
                else if (txtDirection.Text.Trim() == "西")
                {
                    carDirection = "W";
                }
                else
                {
                    MessageBox.Show("请输入车头方向!", "提示");
                    return;
                }
                if (txtCarNo.Text.Length < 4)
                {
                    MessageBox.Show("请输入四位以上的车牌号!", "提示");
                    return;
                }
                if (txtCarNo.Text.Trim() != "" || txtDirection.Text.Trim() != "" || txtFlag.Text.Trim() != "" || txtPacking.Text.Trim() != "")
                {
                    //操作人|日期|班次|班组|停车位|车号|空满标记|车头方向|载重能力|设备号
                    //车头位置(东:E 西:W 南:S 北:N)
                    StringBuilder sb = new StringBuilder("HMI");
                    sb.Append("|");
                    sb.Append(DateTime.Now.ToString("yyyyMMddHHmmss"));
                    sb.Append("|");
                    sb.Append("1");
                    sb.Append("|");
                    sb.Append("1");
                    sb.Append("|");
                    sb.Append(txtPacking.Text.Trim());
                    sb.Append("|");
                    sb.Append(txtCarNo.Text.ToUpper().Trim());
                    sb.Append("|");
                    sb.Append(carFlag.Trim());
                    sb.Append("|");
                    // sb.Append(carDirection.Trim());
                    sb.Append(txtDirection.SelectedValue.ToString().Trim());
                    sb.Append("|");
                    sb.Append("90");
                    sb.Append("|");
                    sb.Append("1");
                    sb.Append("|");
                    string carTypeValue = cmbCarType.SelectedValue.ToString().Trim();
                    sb.Append(carTypeValue); //100
                    sb.Append("|");
                    sb.Append("0");

                    //DialogResult dResult = MessageBox.Show(sb.ToString(), "调试", MessageBoxButtons.YesNo);
                    //if (dResult == DialogResult.No)
                    //{
                    //    return;
                    //}
                    tagDP.SetData("EV_NEW_PARKING_CARARRIVE", sb.ToString());
                    DialogResult dr = MessageBox.Show("框架车车到位成功,激光扫描开始,请保证车位上方没有行车经过。", "提示", MessageBoxButtons.OK);
                    carTypeValue1550 = Int16.Parse(carTypeValue);
                    UACSDAL.HMILogger.WriteLog(button1.Text, "车到位:" + sb.ToString(), UACSDAL.LogLevel.Info, this.Text);
                    if (dr == DialogResult.OK)
                    {
                        this.Close();
                        return;
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("请填写完整");
                }
            }
            else if (carType == "社会车")
            {
                if (txtDirection.Text.Trim() == "东")
                {
                    carDirection = "E";
                }
                else if (txtDirection.Text.Trim() == "西")
                {
                    carDirection = "W";
                }
                else if (txtDirection.Text.Trim() == "南")
                {
                    carDirection = "S";
                }
                else if (txtDirection.Text.Trim() == "北")
                {
                    carDirection = "N";
                }
                else
                {
                    MessageBox.Show("请输入车头方向!", "提示");
                    return;
                }
                if (txtCarNo.Text.Length < 4)
                {
                    MessageBox.Show("请输入四位以上的车牌号!", "提示");
                    return;
                }
                if (txtCarNo.Text.Trim() != "" || txtDirection.Text.Trim() != "" || txtFlag.Text.Trim() != "" || txtPacking.Text.Trim() != "")
                {
                    //操作人|日期|班次|班组|停车位|车号|空满标记|车头方向|载重能力|设备号|车辆类型
                    //车头位置(东:E 西:W 南:S 北:N)
                    StringBuilder sb = new StringBuilder("HMI");
                    sb.Append("|");
                    sb.Append(DateTime.Now.ToString("yyyyMMddHHmmss"));
                    sb.Append("|");
                    sb.Append("1");
                    sb.Append("|");
                    sb.Append("1");
                    sb.Append("|");
                    sb.Append(txtPacking.Text.Trim());
                    sb.Append("|");
                    sb.Append(txtCarNo.Text.ToUpper().Trim());
                    sb.Append("|");
                    sb.Append(carFlag.Trim());
                    sb.Append("|");
                    //sb.Append(carDirection.Trim());
                    sb.Append(txtDirection.SelectedValue.ToString().Trim());
                    sb.Append("|");
                    sb.Append("90");
                    sb.Append("|");
                    sb.Append("1");
                    sb.Append("|");
                    string carTypeValue = cmbCarType.SelectedValue.ToString().Trim();
                    sb.Append(carTypeValue);
                    //sb.Append("101");
                    sb.Append("|");
                    if (carTypeValue == "102")
                    {
                        sb.Append("1");
                    }
                    else
                    {
                        sb.Append("0");
                    }
                    //DialogResult dResult = MessageBox.Show(sb.ToString(), "调试", MessageBoxButtons.YesNo);
                    //if (dResult == DialogResult.No)
                    //{
                    //    return;
                    //}
                    tagDP.SetData("EV_NEW_PARKING_CARARRIVE", sb.ToString());
                    carTypeValue1550 = Int16.Parse(carTypeValue);
                    DialogResult dr = MessageBox.Show("社会车车到位成功,激光扫描开始,请保证车位上方没有行车经过。", "提示", MessageBoxButtons.OK);
                    UACSDAL.HMILogger.WriteLog(button1.Text, "车到位:" + sb.ToString(), UACSDAL.LogLevel.Info, this.Text);
                    if (dr == DialogResult.OK)
                    {
                        this.Close();
                        return;
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("请填写完整");
                }
            }

            else
            {
                MessageBox.Show("不存在该出库类型!");
            }
        }