Exemplo n.º 1
0
 /// <summary>
 /// 系统配置
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TsbSystemConfig_Click(object sender, EventArgs e)
 {
     if (null == m_formSystemConfig)
     {
         m_formSystemConfig = new CFormSystemConfig();
     }
     m_formSystemConfig.ShowDialog();
 }
Exemplo n.º 2
0
        /// <summary>
        /// 界面布局
        /// </summary>
        private void HandInitalizeComponent()
        {
            InitializeComponent();

            List <struCarPSONLayoutInfo> lstRect = CStaticClass.ConfigLstRectProject();
            int curWidth = 450;

            #region 初始化
            m_formDeviceFault  = new CFormDeviceFault();
            m_formCarLocation  = new CFormCarLocation();
            m_formHall         = new CFormHall(m_formDeviceFault);
            m_formETV          = new CFormETVorTV(m_formDeviceFault);
            m_formSystemConfig = new CFormSystemConfig();
            #endregion

            if (!CStaticClass.ConfigBillingFlag())
            {
                this.TlsManage.Items.Remove(this.TsbTollManage);
            }

            this.LblTitle.Text = m_strTitle;

            #region 添加所有车位颜色说明标签
            // 添加所有车位颜色说明标签
            for (int i = 0; i < 9; i++)
            {
                Label label = new Label();
                label.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                label.Font        = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                label.Name        = "label" + (i + 1);
                label.Size        = new System.Drawing.Size(45, 30);
                label.TextAlign   = System.Drawing.ContentAlignment.MiddleCenter;
                label.Location    = new System.Drawing.Point(curWidth, 12);
                curWidth         += label.Width + 12;
                switch (i)
                {
                case 0:
                {
                    label.BackColor = System.Drawing.Color.LightYellow;
                    label.Text      = "空闲";
                    break;
                }

                case 1:
                {
                    label.BackColor = System.Drawing.Color.Purple;
                    label.ForeColor = System.Drawing.Color.White;
                    label.Text      = "占用";
                    break;
                }

                case 2:
                {
                    label.BackColor = System.Drawing.Color.Violet;
                    label.Text      = "入库";
                    break;
                }

                case 3:
                {
                    label.BackColor = System.Drawing.Color.SkyBlue;
                    label.Text      = "出库";
                    break;
                }

                case 4:
                {
                    label.BackColor = System.Drawing.Color.GreenYellow;
                    label.Text      = "挪移";
                    break;
                }

                case 5:
                {
                    label.BackColor = System.Drawing.Color.Blue;
                    label.Text      = "取物";
                    break;
                }

                case 6:
                {
                    label.BackColor = System.Drawing.Color.DarkKhaki;
                    label.ForeColor = System.Drawing.Color.White;
                    label.Text      = "车厅";
                    break;
                }

                case 7:
                {
                    label.BackColor = System.Drawing.Color.DarkGray;
                    label.ForeColor = System.Drawing.Color.White;
                    label.Text      = "无效";   // 禁用
                    break;
                }

                case 8:
                {
                    label.BackColor = System.Drawing.Color.DimGray;
                    label.ForeColor = System.Drawing.Color.White;
                    label.Text      = "禁用";   // 无效
                    break;
                }

                //case 9:
                //    {
                //        label.BackColor = System.Drawing.Color.DarkSalmon;
                //        label.Text = "旋转";
                //        break;
                //    }
                default:
                {
                    break;
                }
                }

                m_llblDescp.Add(label);
                this.GbColor.Controls.Add(label);
            }
            #endregion

            #region 添加所有库车位状态
            for (int i = 0; i < lstRect.Count; i++)
            {
                string[] strs     = lstRect[i].strPanelName.Split('_');
                string   typeName = string.Empty; //lstRect[i].strPanelName;
                string   strText  = string.Empty; //lstRect[i].strPanelName;
                if (0 < strs.Count())
                {
                    typeName = strs[0];
                }
                if (1 < strs.Count())
                {
                    strText = strs[1];
                }
                object[]        args = new object[] { lstRect[i].rectInfo };
                CWareHousePanel tp   = (CWareHousePanel)Assembly.Load("CarLocationPanelLib").CreateInstance("CarLocationPanelLib." + typeName, false, BindingFlags.Default, null, args, null, null);
                tp.EnmSrcLocAddr             = EnmTxtCarLocationAddr.FormCarLocation;
                tp.CallbackCarLocationEvent += new CallbackCarLocationEventHandler(CWareHousePanel_CallbackCarLocationEvent);
                tp.Text = strText;
                m_ltpWareHouse.Add(tp);

                if (1 < lstRect.Count)
                {
                    tp.Location = this.carLocationStatus.Location;
                    this.carLocationStatus.Visible = false;
                    GroupBox GbTP = new GroupBox();
                    GbTP.Text = tp.Text;
                    GbTP.Controls.Add(tp);
                    this.Controls.Add(GbTP);
                }
                else
                {
                    tp.Location = this.carLocationStatus.Location;
                    this.carLocationStatus.Visible = false;
                    GroupBox GbTP = new GroupBox();
                    GbTP.Text = tp.Text;
                    GbTP.Controls.Add(tp);
                    this.Controls.Add(GbTP);
                }

                // 手动指令根据车位状态获取地址初始化
                CWareHousePanel tpHand = (CWareHousePanel)Assembly.Load("CarLocationPanelLib").CreateInstance("CarLocationPanelLib." + typeName, false, BindingFlags.Default, null, args, null, null);
                tpHand.CallbackCarLocationEvent += new CallbackCarLocationEventHandler(CWareHousePanel_CallbackCarLocationEvent);
                tpHand.Text = strText;
                CStaticClass.myPanelCarLocation.Add(tpHand);
            }
            #endregion
        }