Exemplo n.º 1
0
        private void ColdInformationChange(int Location, string SlotID)
        {
            ThreadSafeHelper.UIThread(this, () =>
            {
                if (SlotID == "")
                {
                    ColdResins[Location - 1].SlotID         = "";
                    ColdResins[Location - 1].ColdType       = 0;
                    ColdResins[Location - 1].ExpiredTime    = "";
                    ColdResins[Location - 1].InColdOperator = "";
                    ColdResins[Location - 1].InColdTime     = "";
                    return;
                }
                else
                {
                    StoreMessage NewStoreMessage = Read(Location, SlotID, 1);
                    if (NewStoreMessage == null)
                    {
                        return;
                    }

                    ColdResins[Location - 1].SlotID                = SlotID;
                    ColdResins[Location - 1].InColdTime            = NewStoreMessage.InColdTime;
                    ColdResins[Location - 1].ExpiredTime           = NewStoreMessage.ExpiredTime;
                    ColdResins[Location - 1].InColdOperator        = NewStoreMessage.InColdOperator;
                    panel2.Controls["TbColdResin" + Location].Text = SlotID;
                }
            });
        }
Exemplo n.º 2
0
        private void WarmTimeEvent(int Store, string Time, int Expired) //0->Warming , 1->Success, 2->Expired 1st, 3->Expired 2rd
        {
            try
            {
                ThreadSafeHelper.UIThread(this, () =>
                {
                    #region 無資料
                    if (Expired == -1)
                    {
                        WarmResins[Store].InWarmOperator = "";
                        WarmResins[Store].WarmType       = 0;
                        WarmResins[Store].InWarmTime     = "";
                        WarmResins[Store].ExpiredTime    = "";
                        WarmResins[Store].SlotID         = "";
                        WarmResins[Store].InColdOperator = "";
                        WarmResins[Store].InColdTime     = "";
                        panel3.Controls["TbWarmResin" + (Store + 1)].Visible = false;
                        panel3.Controls["WarmResin" + (Store + 1)].BackgroundImage.Dispose();
                        panel3.Controls["WarmResin" + (Store + 1)].BackgroundImage = Properties.Resources.BlackCircle;
                        panel3.Controls["LabelWarmNum" + (Store + 1)].BackColor    = Color.FromArgb(100, 100, 100);
                    }
                    #endregion
                    else
                    {
                        var num = Store + 1;
                        StoreMessage Message             = Read(Store + 1, "", 2);
                        WarmResins[Store].InWarmTime     = Message.InWarmTime;
                        WarmResins[Store].SlotID         = Message.SlotID;
                        WarmResins[Store].ExpiredTime    = (Convert.ToDateTime(Message.InWarmTime).AddMinutes(Convert.ToInt32(ATS.SystemConfig.WarmTime))).ToString("MM/dd HH:mm");
                        WarmResins[Store].InWarmOperator = Message.InWarmOperator;

                        panel3.Controls["TbWarmResin" + num].Visible = true;
                        panel3.Controls["TbWarmResin" + num].Text    = Message.SlotID;
                        panel3.Controls["WarmResin" + (Store + 1)].BackgroundImage.Dispose();
                        panel3.Controls["WarmResin" + (Store + 1)].BackgroundImage = Properties.Resources.RedCircle1;
                        panel3.Controls["WarmResin" + (Store + 1)].BackgroundImage.Dispose();
                        panel3.Controls["WarmResin" + (Store + 1)].BackgroundImage = Expired == 0 ?
                                                                                     Properties.Resources.YellowCircle1 : (Expired == 1 ?
                                                                                                                           Properties.Resources.GreenCircle2 : (Expired == 2 ?
                                                                                                                                                                Properties.Resources.OrangeCircle : (Expired == 3 ?
                                                                                                                                                                                                     Properties.Resources.RedCircle1 : Properties.Resources.BlackCircle1)));
                        panel3.Controls["LabelWarmNum" + (Store + 1)].BackColor = Expired == 0 ?
                                                                                  Color.FromArgb(239, 228, 176) : (Expired == 1 ?
                                                                                                                   Color.FromArgb(188, 230, 29) : (Expired == 2 ?
                                                                                                                                                   Color.FromArgb(225, 127, 39) : (Expired == 3 ?
                                                                                                                                                                                   Color.FromArgb(237, 28, 36) : Color.FromArgb(100, 100, 100))));
                    }
                });
            }
            catch (Exception err)
            {
                LCSCommon.WriteRunLog(err.Message);
            }
        }
Exemplo n.º 3
0
        private void WarmTaskSuccessUpdate(string ColdLocation, string WarmLocation)
        {
            try
            {
                ThreadSafeHelper.UIThread(this, () =>
                {
                    StoreMessage Message = Read(Convert.ToInt32(WarmLocation), "", 2);
                    var Location         = Convert.ToInt32(WarmLocation);

                    WarmResins[Location - 1].SlotID      = Message.SlotID;
                    WarmResins[Location - 1].InWarmTime  = Message.InWarmTime;
                    WarmResins[Location - 1].ExpiredTime = (Convert.ToDateTime(Message.InWarmTime).AddMinutes(Convert.ToInt32(ATS.SystemConfig.WarmTime))).ToString("MM/dd HH:mm");
                    panel3.Controls["WarmResin" + Location].BackgroundImage.Dispose();
                    panel3.Controls["WarmResin" + Location].BackgroundImage = Properties.Resources.YellowCircle1;
                    panel3.Controls["LabelWarmNum" + Location].BackColor    = Color.FromArgb(239, 228, 176);
                });
            }
            catch (Exception err)
            {
                LCSCommon.WriteRunLog(err.Message);
            }
        }