Exemplo n.º 1
0
 /*--------------------------
 *  컨트롤 초기화해주는 코드
 *  --------------------------*/
 private void ResetControl(LineMonitorControl control)
 {
     try
     {
         control.LabelRequestText              = "0";
         control.LabelImportText               = "0";
         control.LabelProduceText              = "0";
         control.LabelDefectiveText            = "0";
         control.CircleProgress.ProgressColor3 = Color.Violet;
         control.CircleProgress.ProgressColor4 = Color.Red;
         control.LabelStateText = "생산대기";
         control.CircleProgress.Invoke((MethodInvoker) delegate { control.CircleProgress.Decrement((int)control.CircleProgress.Value); });
     }
     catch (AggregateException ex)
     {
         WriteLog(ex);
     }
     catch (Exception ex)
     {
         WriteLog(ex);
     }
 }
Exemplo n.º 2
0
        //msg =  LineID, RequestQty, iTotalCnt, itemQuality, 1 - itemQuality
        private void ReWrite(LineMonitorControl lineMonitor, string[] msg)
        {
            // 불량이 한개도 없는 경우 연두색
            if (lineMonitor.LabelDefectiveText == "0")
            {
                lineMonitor.CircleProgress.ProgressColor3 = Color.AliceBlue;
                lineMonitor.CircleProgress.ProgressColor4 = Color.Green;
            }
            // 불량이 한개라도 있는 경우 주황색
            else
            {
                lineMonitor.CircleProgress.ProgressColor3 = Color.Violet;
                lineMonitor.CircleProgress.ProgressColor4 = Color.Yellow;
            }

            lineMonitor.LabelStateText = "생산 중";
            lineMonitor.CircleProgress.Invoke((MethodInvoker)lineMonitor.CircleProgress.Invalidate);


            lineMonitor.LabelRequestText   = msg[1];
            lineMonitor.LabelImportText    = msg[2];
            lineMonitor.LabelProduceText   = msg[3];
            lineMonitor.LabelDefectiveText = msg[4];


            //lineMonitor.CircleProgress.Increment((int)Math.Truncate((decimal)(int.Parse(lineMonitor.LabelProduceText) / int.Parse(lineMonitor.LabelRequestText)) * 100));
            lineMonitor.CircleProgress.Invoke(
                (MethodInvoker) delegate
            {
                lineMonitor.CircleProgress.Increment((int)Math.Truncate((int.Parse(lineMonitor.LabelProduceText) / decimal.Parse(lineMonitor.LabelRequestText)) * 100));
            }
                );

            if (lineMonitor.LabelProduceText.Equals(lineMonitor.LabelRequestText))
            {
                ResetControl(lineMonitor);
            }
        }
Exemplo n.º 3
0
        private void InitData()
        {
            // DB에서 공장아이디, 라인아이디, 라인이름을 불러옴
            try
            {
                Service            service = new Service();
                List <LineMonitor> list    = service.GetLineInfo();
                lineMonitors = new List <LineMonitorControl>();

                // 공장아이디가 완제품 공장인것은 왼쪽 레이아웃
                // 공장아이디가 반제품 공장인것은 오른쪽 레이아웃
                // 컨트롤 Tag = 라인아이디


                #region 계기판 컨트롤 리스트에 담는 코드

                List <LineMonitor> listSemi    = list.FindAll(elem => elem.Factory_ID == 1);
                List <LineMonitor> listProduct = list.FindAll(elem => elem.Factory_ID == 2);

                // 반제품 공정생성
                for (int i = 0; i < listSemi.Count; i++)
                {
                    LineMonitorControl lineControl = new LineMonitorControl();
                    lineControl.LabelLineNameText = listSemi[i].Line_Name;

                    // 컨트롤 태그에 라인아이디를 지정
                    lineControl.Tag = listSemi[i].Line_ID.ToString();

                    // ProgressColor 3,4 : 게이지
                    // ProgressColor 1,2 : 원 색깔 (Bottom :1, Top : 2)
                    lineControl.CircleProgress.ProgressColor1 = lineControl.panel2.BackColor;
                    lineControl.CircleProgress.ProgressColor2 = lineControl.panel2.BackColor;
                    lineControl.CircleProgress.ProgressColor3 = Color.Violet;
                    lineControl.CircleProgress.ProgressColor4 = Color.Red;

                    lineMonitors.Add(lineControl);
                    flowLayoutSemiProductLine.Controls.Add(lineControl);
                }

                // 완제품 공정 생성
                for (int i = 0; i < listProduct.Count; i++)
                {
                    LineMonitorControl lineControl = new LineMonitorControl();
                    lineControl.LabelLineNameText = listProduct[i].Line_Name;

                    // 컨트롤 태그에 라인아이디를 지정
                    lineControl.Tag = listProduct[i].Line_ID.ToString();

                    // ProgressColor 3,4 : 게이지
                    // ProgressColor 1,2 : 원 색깔 (Bottom :1, Top : 2)
                    lineControl.CircleProgress.ProgressColor1 = lineControl.panel2.BackColor;
                    lineControl.CircleProgress.ProgressColor2 = lineControl.panel2.BackColor;
                    lineControl.CircleProgress.ProgressColor3 = Color.Violet;
                    lineControl.CircleProgress.ProgressColor4 = Color.Red;

                    lineMonitors.Add(lineControl);
                    flowLayoutProductLine.Controls.Add(lineControl);
                }
            }
            catch (Exception ex)
            {
                WriteLog(ex);
            }

            #endregion
        }