Exemplo n.º 1
0
        private void Frm_Stat_Load(object sender, EventArgs e)
        {
            TxtData.PublicData.Customs = db.GetCustom();
            DE_1.DateTime = DE_3.DateTime = DE_5.DateTime = DateTime.Now.AddDays(-1);
            DE_2.DateTime = DE_4.DateTime = DE_6.DateTime = DateTime.Now.AddDays(1);
            CBE_Product.Properties.Items.Clear();
            TxtData.PublicData.RecipeName = db.GetRecipeName();
            if (TxtData.PublicData.RecipeName != null && TxtData.PublicData.RecipeName.Rank >= 1)
            {
                string[] RecipeName = new string[
                    (TxtData.PublicData.RecipeName[0] == null ? 0 : TxtData.PublicData.RecipeName[0].Length)
                    + (TxtData.PublicData.RecipeName[1] == null ? 0 : TxtData.PublicData.RecipeName[1].Length)
                    + (TxtData.PublicData.RecipeName[2] == null ? 0 : TxtData.PublicData.RecipeName[2].Length)
                    + (TxtData.PublicData.RecipeName[3] == null ? 0 : TxtData.PublicData.RecipeName[3].Length)
                                      ];
                int j = 0;

                for (int i = 0; i < 4; i++)
                {
                    if (TxtData.PublicData.RecipeName[i] != null)
                    {
                        for (int k = 0; k < TxtData.PublicData.RecipeName[i].Length; k++)
                        {
                            RecipeName[j] = TxtData.PublicData.RecipeName[i][k];
                            j++;
                        }
                    }
                }


                CBE_Product.Properties.Items.AddRange((object[])RecipeName);
                CBE_Product.SelectedIndex = 0;
            }

            if (TxtData.PublicData.Customs != null)
            {
                CBE_Customs.Properties.Items.AddRange((object[])TxtData.PublicData.Customs);
                CBE_Customs.SelectedIndex = 0;
            }

            BT_OK1_Click(this, null);

            BT_OK2_Click(this, null);

            BT_OK3_Click(this, null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取四个产品信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Frm_Product_Load(object sender, EventArgs e)
        {
            TxtData.PublicData.Customs = db.GetCustom();
            db.SaveCs8cConfigure();
            // PublicFunc.ReadCs8CConfigure();

            CBE_Triggle.Properties.Items.AddRange((object[])(TxtData.PublicData.TriggleModeText));
            if (TxtData.PublicData.Customs != null)
            {
                CBE_Custom.Properties.Items.AddRange((object[])(TxtData.PublicData.Customs));
            }
            if (TxtData.SoapData.Custom != null)
            {
                CBE_Custom.Text = TxtData.SoapData.Custom;
            }


            CBE_Triggle.SelectedIndex = TxtData.PublicData.TriggleMode;

            SE_Cycle.Value = TxtData.PublicData.CycleCount;
            SE_Home.Value  = (decimal)TxtData.MdbData.HomeSpeed;
            SE_Wait.Value  = (decimal)TxtData.MdbData.IODelay[3];
            SE_Pan.Value   = (decimal)TxtData.MdbData.PresetData[4];

            SE_WorkPlaceCount_ValueChanged(this, null);
            if (TxtData.MdbData.EnableItem[4])
            {
                SE_WorkPlaceCount.Properties.MaxValue = 2;
            }
            else
            {
                if (TxtData.PublicData.ProductCount != null)
                {
                    for (int j = 0; j < TxtData.PublicData.ProductCount.Length - 1; j++)
                    {
                        TxtData.PublicData.ProductCount[j] = 1;
                    }
                }

                SE_WorkPlaceCount.Properties.MaxValue = 4;
            }
            SE_WorkPlaceCount.Value = Math.Min(TxtData.PublicData.WorkPlaceCount, SE_WorkPlaceCount.Properties.MaxValue);
            for (int i = 0; i < 4; i++)
            {
                if (TxtData.PublicData.ProductName.Length > i && TxtData.PublicData.ProductName[i] != null)
                {
                    switch (i)
                    {
                    case 0:
                        LL_WP1.Text = "产品名称:" + TxtData.PublicData.ProductName[i][0];
                        break;

                    case 1:
                        LL_WP2.Text = "产品名称:" + TxtData.PublicData.ProductName[i][0];
                        break;

                    case 2:
                        LL_WP3.Text = "产品名称:" + TxtData.PublicData.ProductName[i][0];
                        break;

                    case 3:
                        LL_WP4.Text = "产品名称:" + TxtData.PublicData.ProductName[i][0];
                        break;
                    }
                }
            }
            //Pic_Main.Left=this.Size.Width - GC_WorkPlace.Size.Width - 10;

            GC_ProductCfg.Enabled = TxtData.PublicData.ScreenEnable[TxtData.XMLConfigure.PopeDom, 14];
            CBE_Triggle.Enabled   = !TxtData.MdbData.EnableItem[4];
            GC_ProductCfg.Text    = "生产配置:" + (TxtData.MdbData.EnableItem[4]?"同工位多产品":"");
        }