Beispiel #1
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled  = false;
            lbCrntDevice.Text = OM.GetCrntDev();

            //Download 버튼 활성화 조건(나중에 확인 진섭)
            if (SEQ._iSeqStat == EN_SEQ_STAT.Stop || SEQ._iSeqStat == EN_SEQ_STAT.Error)
            {
                btDownload.Enabled = true;
            }

            //접근레벨에 따른 Setting 버튼 활성화
            int iLevel = (int)FormPassword.GetLevel();

            switch (iLevel)
            {
            case (int)EN_LEVEL.Operator: btSetting.Enabled = false; break;

            case (int)EN_LEVEL.Engineer: btSetting.Enabled = true; break;

            case (int)EN_LEVEL.Master: btSetting.Enabled = true; break;

            default: break;
            }

            tmUpdate.Enabled = true;
        }
Beispiel #2
0
        private void tcDeviceSet_SelectedIndexChanged(object sender, EventArgs e)
        {
            int iSeletedIndex;

            iSeletedIndex = tcDeviceSet.SelectedIndex;

            switch (iSeletedIndex)
            {
            default: break;

            case 1: gbJogUnit.Parent = pnJog1;                       break;

            case 2: gbJogUnit.Parent = pnJog2;                       break;

            case 3: gbJogUnit.Parent = pnJog3;                       break;

            case 4: gbJogUnit.Parent = pnJog4;                       break;

            case 5: gbJogUnit.Parent = pnJog5;                       break;
            }

            UpdateDevInfo(true);
            UpdateDevOptn(true);
            //LoadTrayMask(OM.GetCrntDev());

            PM.UpdatePstn(true);
            PM.Load(OM.GetCrntDev());
        }
Beispiel #3
0
        private void SaveJobFile(string _sDevice)
        {
            string   sCommandPath   = "C:\\Data\\VisnJobChange.ini";
            CIniFile IniCommandSave = new CIniFile(sCommandPath);

            IniCommandSave.Save("JobChange", "Device", OM.GetCrntDev());
        }
Beispiel #4
0
        public void ShowPage(int _iPageIdx)
        {
            FrmDeviceSet.UpdateDevInfo(true);
            FrmDeviceSet.UpdateDevOptn(true);
            PM.UpdatePstn(true);
            PM.Load(OM.GetCrntDev());

            switch (_iPageIdx)
            {
            case 0: FrmOperation.Show();          break;

            case 1:                               break;

            case 2: FrmDevice.Show();          break;

            case 3: FrmOption.Show();          break;

            case 4: FrmSPC.FormInit();
                FrmSPC.Show();          break;

            case 5: SML.SetDllMainWin(ref pnBase); break;

            default: FrmOperation.Show();         break;
            }
        }
Beispiel #5
0
        public void ShowPage(int _iPageIdx)
        {
            FrmDeviceSet.UpdateDevInfo(true);
            PM.UpdatePstn(true);
            PM.Load(OM.GetCrntDev());

            switch (_iPageIdx)
            {
            case 0: FrmOperation.Show();          break;

            case 1: FrmDevice.Show();          break;

            case 2: /*FrmMacro    .Show();*/ break;

            case 3: FrmOption.Show();
                FrmOption.bUpdate = true;     break;

            case 4: FrmSPC.Show();          break;

            //FrmSPC      .ShowUpdate();    break;
            case 5: SM.SetDllMainWin(ref pnBase); break;

            default: FrmOperation.Show();         break;
            }
        }
Beispiel #6
0
        public FormLotOpen()
        {
            InitializeComponent();

            tbSelDevice.Text = OM.GetCrntDev();
            tbLotNo.Text     = "";

            tbLotNo.Focus();
        }
Beispiel #7
0
        private void btSetting_Click(object sender, EventArgs e)    //DeviceSet Form 띄움
        {
            this.Hide();
            FrmMain.FrmDeviceSet.Show();
            FrmMain.FrmDeviceSet.UpdateDevOptn(true);
            FrmMain.FrmDeviceSet.UpdateDevInfo(true);
            PM.UpdatePstn(true);

            PM.Load(OM.GetCrntDev());
        }
Beispiel #8
0
        public FormLotOpen()
        {
            InitializeComponent();



            tbSelDevice.Text  = OM.GetCrntDev();
            tbLotNo.Text      = "";
            tbEmployeeID.Text = SM.FrmLogOn.GetId();

            tbLotNo.Focus();
        }
Beispiel #9
0
        private void btSetting_Click(object sender, EventArgs e)    //DeviceSet Form 띄움
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ti.Frm);

            this.Hide();
            FrmMain.FrmDeviceSet.Show();
            FrmMain.FrmDeviceSet.UpdateDevInfo(true);
            PM.UpdatePstn(true);

            PM.Load(OM.GetCrntDev());
        }
Beispiel #10
0
        public FormLotOpen()
        {
            InitializeComponent();


            tbSelDevice.Text  = OM.GetCrntDev();
            tbLotNo.Text      = "";
            tbEmployeeID.Text = ""; //20180125 SML.FrmLogOn.GetId();
            tbMaterialNo.Text = "";
            tbLotAlias.Text   = "";

            tbLotNo.Focus();
        }
Beispiel #11
0
        private void FormLotOpen_VisibleChanged(object sender, EventArgs e)
        {
            this.Left         = 0;
            this.Top          = 0;
            tbSelDevice.Text  = OM.GetCrntDev();
            tbEmployeeID.Text = ""; //LOT.CrntLotData.sEmployeeID ; //20180125 SML.FrmLogOn.GetId();
            tbLotNo.Text      = ""; //"HZ7170CU.98";
            tbMaterialNo.Text = ""; //"11082611";
            tbLotAlias.Text   = ""; //"5R-ebxD68-0";

            tbLotNo.Focus();

            lbConDB.Visible = false;
        }
Beispiel #12
0
        private void btSave_Click(object sender, EventArgs e)
        {
            Log.Trace("SAVE", "Clicked");

            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }

            UpdateDevInfo(false);
            UpdateNodePos(false);
            UpdateDevOptn(false);
            if (WorkDistanceCal() > 200)
            {
                Log.ShowMessage("Warring", "작업길이 최대치를 넘어갔습니다.");
                return;
            }
            if (WorkDistanceCal() > OM.MstOptn.dMAXWorkDist && !OM.DevOptn.bShiftWork)
            {
                if (Log.ShowMessageModal("Warring", "Used ShiftWork ?") != DialogResult.Yes)
                {
                    return;
                }
                cbshiftWork.Checked = true;
                Refresh();
            }



            OM.SaveDevInfo(OM.GetCrntDev().ToString());


            OM.SaveNodePos(OM.GetCrntDev().ToString());


            OM.SaveDevOptn(OM.GetCrntDev().ToString());

            pbLine.Refresh();

            PM.UpdatePstn(false);
            PM.Save(OM.GetCrntDev());

            tbWorkDist.Text  = OM.DevOptn.dWorkDist.ToString();
            tbWorkDist2.Text = OM.DevOptn.dWorkDist.ToString();

            //DM.ARAY[(int)ri.REAR ].SetMaxColRow(OM.DevInfo.iRearColCnt , OM.DevInfo.iRearRowCnt );
            //DM.ARAY[(int)ri.FRNT ].SetMaxColRow(OM.DevInfo.iFrntColCnt , OM.DevInfo.iFrntRowCnt );

            OM.SaveEqpOptn();
        }
Beispiel #13
0
        //public static List<double> lstTime ;
        //static FileStream   fs;
        //static StreamWriter sw;
        //static bool bFst ;
        //static double dPreTime2;
        //static public void SaveCsv(ref List<double> _lst,string _sPath = "")
        //{
        //    string sPath1 = @"D:\" + _sPath + ".csv";
        //    string sPath2 = @"D:\TimeCheck.csv" ;

        //    if(!bFst)
        //    {
        //        fs = new FileStream(sPath1, FileMode.Append, FileAccess.Write);
        //        sw = new StreamWriter(fs, Encoding.UTF8);
        //        bFst = true;
        //    }
        //    string line = "";

        //    for(int i=0; i<_lst.Count; i++) {
        //        line += string.Format("{0:0.0000}",_lst[i]) + ",";
        //    }
        //    sw.WriteLine(line);
        //}
        //public static double GetTime()
        //{
        //    double dCrntTime = CTimer.GetTime_us();
        //    double dTime = (dCrntTime - dPreTime2) / 1000.0;
        //    dPreTime2 = dCrntTime;
        //    return dTime;
        //}
        //SaveCsv(ref lstTime,sPath);
        public static void Update()
        {
            //lstTime = new List<double>();
            //string sPath = DateTime.Now.ToString("HHmmss");
            double dPreTime = CTimer.GetTime_us();
            double dCrntTime;

            while (true)
            {
                dCrntTime = CTimer.GetTime_us();
                m_dMainThreadCycleTime = (dCrntTime - dPreTime) / 1000.0;
                dPreTime = dCrntTime;
                Thread.Sleep(0);

                //Motion Dll Update
                SM.Update(m_iSeqStat);

                //Part
                for (int i = 0; i < (int)pi.MAX_PART; i++)
                {
                    m_Part[i].Update();
                }

                //Inspection
                InspectMainAir();
                InspectEmergency();
                InspectActuator();
                InspectMotor();
                InspectCrash();
                InspectTemp();

                //Update ErrorProc.
                UpdateButton();

                //Check Button.
                UpdateSeqState();

                //Update Motor State (Input)
                MM.Update();

                //SPC
                SPC.Update(LOT.CrntLotData.sLotNo, OM.GetCrntDev(), m_iSeqStat, OM.EqpStat.bMaint);

                //Vision Communication
                VC.Update();

                //SEQ.BarcordPrnt.Update();
            }
        }
Beispiel #14
0
        public static void Update()
        {
            double dPreTime = CTimer.GetTime_us();
            double dCrntTime;

            while (true)
            {
                dCrntTime = CTimer.GetTime_us();
                m_dMainThreadCycleTime = (dCrntTime - dPreTime) / 1000.0;
                if (m_dMainThreadCycleTime > 2)
                {
                    Log.Trace(m_dMainThreadCycleTime.ToString());
                }
                dPreTime = dCrntTime;
                Thread.Sleep(1);

                //Motion Dll Update
                SM.Update(m_iSeqStat);

                //Part
                for (int i = 0; i < (int)pi.MAX_PART; i++)
                {
                    m_Part[i].Update();
                }

                //Inspection
                InspectMainAir();
                InspectEmergency();
                InspectActuator();
                InspectMotor();
                InspectCrash();
                InspectTemp();
                InspectLightGrid();

                //Update ErrorProc.
                UpdateButton();

                //Check Button.
                UpdateSeqState();

                //Update Motor State (Input)
                MM.Update();

                //SPC
                SPC.Update(LOT.GetLotNo(), OM.GetCrntDev(), m_iSeqStat, OM.EqpStat.bMaint);
            }
        }
Beispiel #15
0
        private void btDelete_Click(object sender, EventArgs e)
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ForContext.Frm);

            //Check None Name.
            if (tbFromName.Text == "")
            {   //아무것도 선택되지 않은 경우.
                //Log.ShowMessage("Error", "선택된 JOB FILE 이름이 없습니다." );
                Log.ShowMessage("Error", "The selected JOB FILE name is missing.");
                return;
            }

            string sPath;

            sPath = Application.StartupPath + "\\JobFile\\" + tbFromName.Text;

            DirectoryInfo di = new DirectoryInfo(sPath);

            if (di.Exists == true)
            {
                //if (Log.ShowMessageModal("Confirm", "선택된 JOB FILE을 삭제하시겠습니까?") != DialogResult.Yes) return;
                if (Log.ShowMessageModal("Confirm", "Do you want to delete the selected JOB FILE?") != DialogResult.Yes)
                {
                    return;
                }
                DeleteFolder(sPath);
            }

            if (tbFromName.Text == OM.GetCrntDev())
            {
                //Log.ShowMessage("Warning", "현재 사용중인 JOB FILE은 삭제할 수 없습니다." );
                Log.ShowMessage("Warning", "JOB FILE currently in use cannot be deleted.");
                return;
            }

            DispDevice();

            //Trace Log.
            //Log.Trace("JobFile", (tbFromName.Text + " is Deleted"));
            SaveDeviceLog(4, tbFromName.Text);

            //pbStatus.Minimum = 0;
            //UserFile.GridSearchDir(ExtractFilePath(Application->ExeName) + "JobFile", sgDevice, 1, true);     // 디렉토리 읽어와서 날짜와 알파벳 순으로 정렬
            //sgDevice->Row = 0;
        }
Beispiel #16
0
        private void btSavePosition_Click(object sender, EventArgs e)
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ForContext.Frm);

            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }

            PM.UpdatePstn(false);
            PM.Save(OM.GetCrntDev());
            PM.UpdatePstn(true);

            Refresh();
        }
Beispiel #17
0
        public static void Update()
        {
            double dPreTime = CTimer.GetTime_us();
            double dCrntTime;

            while (true)
            {
                dCrntTime = CTimer.GetTime_us();
                m_dMainThreadCycleTime = (dCrntTime - dPreTime) / 1000.0;
                dPreTime = dCrntTime;
                Thread.Sleep(0);
                SML.Update(m_iSeqStat);

                //Part
                for (int i = 0; i < (int)pi.MAX_PART; i++)
                {
                    m_Part[i].Update();
                }

                //Inspection
                InspectMainAir();
                InspectEmergency();
                InspectActuator();
                InspectMotor();
                InspectCrash();
                InspectTemp();
                InspectFlowMeter();

                //Update ErrorProc.
                UpdateButton();

                //Check Button.
                UpdateSeqState();

                //Update Motor State (Input)
                MM.Update();

                //SPC
                SPC.Update(LOT.CrntLotData.sEmployeeID, LOT.CrntLotData.sLotNo, OM.GetCrntDev(), m_iSeqStat, OM.EqpStat.bMaint);

                //Vision Communication
                Visn.Update();

                SEQ.BarcordPrnt.Update();
            }
        }
Beispiel #18
0
        public FormMain()
        {
            //this.TopMost = true;
            SEQ.Init();
            OM.LoadLastInfo();
            //VC.Init();

            InitializeComponent();

            m_iActivePage = 0;


            FrmOperation = new FormOperation(pnBase);
            FrmVision    = new FormVision(pnBase);
            FrmDevice    = new FormDevice(this);
            FrmDeviceSet = new FormDeviceSet(pnBase);
            FrmSPC       = new FormSPC(pnBase);
            FrmOption    = new FormOption(pnBase);

            FrmMaster = new FormMaster();

            FrmDevice.TopLevel = false;
            FrmDevice.Parent   = pnBase;

            lbDevice.Text = OM.GetCrntDev().ToString();

            lbLotNo.Text = LOT.GetLotNo();
            lbName.Text  = Eqp.sEqpName; //OM.EqpOptn.sModelName;

            ShowPage(0);                 //Operation.

            tmUpdate.Enabled = true;

            //SM.IO.SetY((int)yi.ETC_MainAirSol, true);

            //if (SM.CL.GetCmd((int)ai.IDX_Hold1UpDn) == EN_CYLINDER_POS.cpFwd)
            //{
            //    SM.CL.Move((int)ai.IDX_Hold1UpDn, EN_CYLINDER_POS.cpFwd);
            //}
            //if (SM.CL.GetCmd((int)ai.IDX_Hold2UpDn) != 0)
            //{
            //    SM.CL.Move((int)ai.IDX_Hold2UpDn, EN_CYLINDER_POS.cpFwd);
            //}
        }
Beispiel #19
0
        public FormMain()
        {
            //this.TopMost = true;
            SEQ.Init();
            OM.LoadLastInfo();

            InitializeComponent();

            m_iActivePage = 0;


            FrmOperation = new FormOperation(pnBase);
            FrmDevice    = new FormDevice(this);
            FrmDeviceSet = new FormDeviceSet(pnBase);
            FrmSPC       = new FormSPC(pnBase);
            FrmOption    = new FormOption(pnBase);

            FrmMaster    = new FormMaster();
            FrmVccOption = new FormVccOption();

            FrmVer          = new FormVer();
            FrmVer.TopLevel = true;

            FrmDevice.TopLevel = false;
            FrmDevice.Parent   = pnBase;

            lbDevice.Text = OM.GetCrntDev().ToString();

            lbLotNo.Text = LOT.GetLotNo();
            lbName.Text  = Eqp.sEqpName;

            //파일 버전 보여주는 부분
            string sFileVersion = System.Windows.Forms.Application.ProductVersion;

            lbVer.Text = "Ver " + sFileVersion;

            ShowPage(0);//Operation.

            //MainSol
            //SM.IO.SetY((int)yi.ETC_MainAirSol, true);

            tmUpdate.Enabled = true;
        }
Beispiel #20
0
        //FormMain FrmMain;
        public FrameMotrPosAPT()
        {
            InitializeComponent();

            SM.PM_SetGetCmdPos(mi.LODR_ZLift);
            SM.PM_SetGetCmdPos(mi.TOOL_XRjct);
            SM.PM_SetGetCmdPos(mi.IDXR_XRear);
            SM.PM_SetGetCmdPos(mi.IDXF_XFrnt);
            SM.PM_SetGetCmdPos(mi.TOOL_YTool);
            SM.PM_SetGetCmdPos(mi.TOOL_ZPckr);
            SM.PM_SetGetCmdPos(mi.BARZ_XPckr);
            SM.PM_SetGetCmdPos(mi.BARZ_ZPckr);
            SM.PM_SetGetCmdPos(mi.STCK_ZStck);
            SM.PM_SetGetCmdPos(mi.TOOL_ZVisn);

            PM.Load(OM.GetCrntDev().ToString());

            PM.UpdatePstn(true);
            tmUpdate.Enabled = false;
        }
Beispiel #21
0
        public FormLotOpen()
        {
            InitializeComponent();

            ////Control Scale 변경
            //float widthRatio = 1024f / 1280f;
            //float heightRatio = 607f / 863f;
            //SizeF scale = new SizeF(widthRatio, heightRatio);
            //this.Scale(scale);

            //foreach (Control control in this.Controls)
            //{
            //    control.Font = new Font("Verdana", control.Font.SizeInPoints * heightRatio * widthRatio);
            //}

            tbSelDevice.Text = OM.GetCrntDev();
            tbLotId.Text     = "";

            tbLotId.Focus();
        }
Beispiel #22
0
        private void btDelete_Click(object sender, EventArgs e)
        {
            //Check None Name.
            if (tbFromName.Text == "")
            {   //아무것도 선택되지 않은 경우.
                Log.ShowMessage("Error", "선택된 JOB FILE 이름이 없습니다.");
                return;
            }

            string sPath;

            sPath = Application.StartupPath + "\\JobFile\\" + tbFromName.Text;

            DirectoryInfo di = new DirectoryInfo(sPath);

            if (di.Exists == true)
            {
                if (Log.ShowMessageModal("Confirm", "Do you want to delete the selected JOB FILE?") != DialogResult.Yes)
                {
                    return;
                }
                DeleteFolder(sPath);
            }

            if (tbFromName.Text == OM.GetCrntDev())
            {
                Log.ShowMessage("Warning", "현재 사용중인 JOB FILE은 삭제할 수 없습니다.");
                return;
            }

            DispDevice();

            //Trace Log.
            Log.Trace("JobFile", (tbFromName.Text + " is Deleted"));


            //pbStatus.Minimum = 0;
            //UserFile.GridSearchDir(ExtractFilePath(Application->ExeName) + "JobFile", sgDevice, 1, true);     // 디렉토리 읽어와서 날짜와 알파벳 순으로 정렬
            //sgDevice->Row = 0;
        }
Beispiel #23
0
        private void btSaveDevice_Click(object sender, EventArgs e)
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ti.Frm);

            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }

            UpdateDevInfo(false);

            OM.SaveDevInfo(OM.GetCrntDev().ToString());
            OM.SaveEqpOptn();

            //SaveMask(OM.GetCrntDev());

            DM.ARAY[ri.LODR].SetMaxColRow(1, OM.DevInfo.iLODR_BarCnt);
            DM.ARAY[ri.PLDR].SetMaxColRow(1, 1);
            DM.ARAY[ri.TLDR].SetMaxColRow(1, 1);
            DM.ARAY[ri.TVSN].SetMaxColRow(1, 1);
            DM.ARAY[ri.TMRK].SetMaxColRow(1, 1);
            DM.ARAY[ri.TULD].SetMaxColRow(1, 1);
            DM.ARAY[ri.TRJM].SetMaxColRow(1, 1);
            DM.ARAY[ri.TRJV].SetMaxColRow(1, 1);
            DM.ARAY[ri.PULD].SetMaxColRow(1, 1);
            DM.ARAY[ri.ULDR].SetMaxColRow(1, OM.DevInfo.iULDR_BarCnt);
            DM.ARAY[ri.PICK].SetMaxColRow(1, 1);
            DM.ARAY[ri.PSHR].SetMaxColRow(1, 1);
            //           DM.ARAY[ri.BPCK].SetMaxColRow(1                        , 1                           );

            MM.SetManCycle(mc.MARK_CycleManChage);
            //Refresh();
            Invalidate(true);
        }
Beispiel #24
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            //Information
            lbDevice.Text = OM.GetCrntDev().ToString();
            lbLotNo.Text  = LOT.GetLotNo();

            btStart.Enabled  = LOT.GetLotOpen();
            btLotEnd.Enabled = LOT.GetLotOpen();

            bool bRet = false;

            IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, out bRet);
            //if (bRet) label3.Text = "32BIt";
            //else label3.Text = "64BIt";

            //패스워드만 쓰는 방식
            //int iLevel = (int)FormPassword.GetLevel();
            //switch (iLevel)
            //{
            //    case (int)EN_LEVEL.Operator: btOperator.Text = "OPERATOR"; break;
            //    case (int)EN_LEVEL.Engineer: btOperator.Text = "ENGINEER"; break;
            //    case (int)EN_LEVEL.Master  : btOperator.Text = " ADMIN  "; break;
            //    default                    : btOperator.Text = " ERROR  "; break;
            //}

            //로그인/로그아웃 방식
            if (SM.FrmLogOn.GetLevel() == (int)EN_LEVEL.LogOff)
            {
                btOperator.Text = "  LOG IN";

                pnULDR.Enabled = false;
                pnPSHR.Enabled = false;
                pnPICK.Enabled = false;
                pnPULD.Enabled = false;
                pnTULD.Enabled = false;
                pnTMRK.Enabled = false;
                pnTRJM.Enabled = false;
                pnTVSN.Enabled = false;
                pnTLDR.Enabled = false;
                pnTRJV.Enabled = false;
                pnPLDR.Enabled = false;
                pnLODR.Enabled = false;

                //pnDataMap .Enabled = false;
                //pnDayInfo .Enabled = false;
                pnLotInfo.Enabled = false;
                pnError.Enabled   = false;
                pnOperMan.Enabled = false;
                //pnWorkInfo.Enabled = false;
                pnLotOpen.Enabled = false;
                //btStart   .Enabled = LOT.LotList.Count == 0 || !LOT.LotOpened;
                btStart.Enabled    = false;
                btStop.Enabled     = false;
                btReset.Enabled    = false;
                btHome.Enabled     = false;
                btOperator.Enabled = true;
            }
            else
            {
                pnULDR.Enabled = true;
                pnPSHR.Enabled = true;
                pnPICK.Enabled = true;
                pnPULD.Enabled = true;
                pnTULD.Enabled = true;
                pnTMRK.Enabled = true;
                pnTRJM.Enabled = true;
                pnTVSN.Enabled = true;
                pnTLDR.Enabled = true;
                pnTRJV.Enabled = true;
                pnPLDR.Enabled = true;
                pnLODR.Enabled = true;

                btOperator.Text = "  " + SM.FrmLogOn.GetLevel().ToString();

                //pnDataMap .Enabled = true;
                //pnDayInfo .Enabled = true;
                pnLotInfo.Enabled = true;
                pnError.Enabled   = true;
                pnOperMan.Enabled = true;
                //pnWorkInfo.Enabled = true;
                pnLotOpen.Enabled = true;
                //btStart   .Enabled = LOT.LotList.Count != 0 || LOT.LotOpened;
                //btStart   .Enabled = true;
                btStop.Enabled  = true;
                btReset.Enabled = true;
                btHome.Enabled  = true;
            }

            //if (SML.FrmLogOn.GetLevel() != (int)EN_LEVEL.LogOff)
            //{
            //    btStart.Enabled = LOT.GetLotOpen();
            //}

            TimeSpan Span;

            try{
                Span = TimeSpan.FromMilliseconds(SPC.LOT.Data.RunTime);
            }
            catch (Exception ex) {
                Span = TimeSpan.FromMilliseconds(0);
            }

            //SPC.LOT.DispLotInfo(lvLotInfo);
            //SPC.DAY.DispDayInfo(lvDayInfo);

            string Str;
            int    iPreErrCnt  = 0;
            int    iCrntErrCnt = 0;

            for (int i = 0; i < ML.ER_MaxCount(); i++)
            {
                if (ML.ER_GetErr((ei)i))
                {
                    iCrntErrCnt++;
                }
            }
            if (iPreErrCnt != iCrntErrCnt)
            {
                lbErr.Items.Clear();
                int iErrNo = ML.ER_GetLastErr();
                for (int i = 0; i < ML.ER_MaxCount(); i++)
                {
                    if (ML.ER_GetErr((ei)i))
                    {
                        Str  = string.Format("[ERR{0:000}]", i);
                        Str += ML.ER_GetErrName(i) + " " + ML.ER_GetErrSubMsg((ei)i);
                        lbErr.Items.Add(Str);
                    }
                }
            }
            if (SEQ._iSeqStat != EN_SEQ_STAT.Error)
            {
                lbErr.Items.Clear();
            }
            iPreErrCnt = iCrntErrCnt;


            WorkInfo();
            string sCycleTimeSec;
            int    iCycleTimeMs;


            //Door Sensor.  나중에 찾아보자
            //bool isAllCloseDoor = SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorFt) &&
            //                      SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorLt) &&
            //                      SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRt) &&
            //                      SM.IO.GetX((int)EN_INPUT_ID.xETC_DoorRr) ;
            //if (FormPassword.GetLevel() != EN_LEVEL.lvOperator && isAllCloseDoor && CMachine._bRun)
            //{
            //    //FM_SetLevel(lvOperator);
            //}

            if (!ML.MT_GetHomeDoneAll())
            {
                btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red;
            }
            else
            {
                btAllHome.ForeColor = Color.Black;
            }

            SPC.LOT.DispLotInfo(lvLotInfo);

            //Refresh();
            //Invalidate(true);
            pnULDR.Invalidate(true);
            pnPSHR.Invalidate(true);
            pnPICK.Invalidate(true);
            pnPULD.Invalidate(true);
            pnTULD.Invalidate(true);
            pnTMRK.Invalidate(true);
            pnTRJM.Invalidate(true);
            pnTVSN.Invalidate(true);
            pnTLDR.Invalidate(true);
            pnTRJV.Invalidate(true);
            pnPLDR.Invalidate(true);
            pnLODR.Invalidate(true);
            //pnLODR.Update();


            if (ML.IO_GetY(yi.ETC_LightOn))
            {
                btlightOn.Text = " LIGHT ON ";
            }                                                                    //btlightOn.BackColor = Color.Lime;}
            else
            {
                btlightOn.Text = " LIGHT OFF";
            }                                                                    //btlightOn.BackColor = Color.Red ;}

            if (ML.IO_GetY(yi.MARK_Light))
            {
                btMarklightOn.Text = " MARK LIGHT ON ";
            }                                                                         //btlightOn.BackColor = Color.Lime;}
            else
            {
                btMarklightOn.Text = " MARK LIGHT OFF";
            }                                                                         //btlightOn.BackColor = Color.Red ;}


            if (!this.Visible)
            {
                tmUpdate.Enabled = false;
                return;
            }
            tmUpdate.Enabled = true;
        }
Beispiel #25
0
        private void btSave_Click(object sender, EventArgs e)
        {
            Log.Trace("SAVE", "Clicked");

            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }

            UpdateDevInfo(false);
            UpdateDevOptn(false);

            OM.SaveDevInfo(OM.GetCrntDev().ToString());
            OM.SaveDevOptn(OM.GetCrntDev().ToString());



            PM.UpdatePstn(false);
            PM.Save(OM.GetCrntDev());

            //SEQ.DispPtrn.Save(OM.GetCrntDev());
            //SEQ.HghtPtrn.Save(OM.GetCrntDev());
            //SEQ.DispPtrn.SavePttColor(OM.GetCrntDev());
            //SEQ.HghtPtrn.SavePttColor(OM.GetCrntDev());



            OM.SaveEqpOptn();

            //OM.TrayMask.SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            SaveTrayMask(OM.GetCrntDev());

            DM.ARAY[ri.SPLR].SetMaxColRow(1, 1);
            DM.ARAY[ri.IDXR].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.IDXF].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.PCKR].SetMaxColRow(1, 1);
            DM.ARAY[ri.TRYF].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.TRYG].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.OUTZ].SetMaxColRow(1, 1);

            //여기부터 하면 됨.
            int iPreGoodCnt = DM.ARAY[ri.STCK].GetCntStat(cs.Good);

            DM.ARAY[ri.STCK].SetMaxColRow(1, OM.DevInfo.iTRAY_StackingCnt);
            DM.ARAY[ri.STCK].SetStat(cs.Empty);
            for (int r = DM.ARAY[ri.STCK].GetMaxRow() - 1; r >= 0; r--)
            {
                if (iPreGoodCnt > 0)
                {
                    DM.ARAY[ri.STCK].SetStat(0, r, cs.Good);
                    iPreGoodCnt--;
                }
            }


            DM.ARAY[ri.BARZ].SetMaxColRow(1, 1);
            DM.ARAY[ri.INSP].SetMaxColRow(1, OM.DevInfo.iTRAY_PcktCntY);
            DM.ARAY[ri.PSTC].SetMaxColRow(1, 1);
            DM.ARAY[ri.MASK].SetMaxColRow(OM.DevInfo.iTRAY_PcktCntX, OM.DevInfo.iTRAY_PcktCntY);
            //         DM.ARAY[ri.BPCK].SetMaxColRow(1                        , 1                           );

            DM.ARAY[ri.IDXR].SetMask(DM.ARAY[ri.MASK]);
            DM.ARAY[ri.IDXF].SetMask(DM.ARAY[ri.MASK]);
            DM.ARAY[ri.TRYF].SetMask(DM.ARAY[ri.MASK]);
            DM.ARAY[ri.TRYG].SetMask(DM.ARAY[ri.MASK]);


            //SEQ.Com[1].SendMsg(OM.DevInfo.sMrkData);
            //SetComboItem();

            Refresh();
        }
Beispiel #26
0
        private void btSaveDevice_Click(object sender, EventArgs e)
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ForContext.Frm);

            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }


            UpdateDevInfo(false);

            OM.SaveJobFile(OM.GetCrntDev());

            //Loader.
            DM.ARAY[ri.LODR].SetMaxColRow(1, OM.DevInfo.iMgzSlotCnt);

            //Prebuffer
            DM.ARAY[ri.PREB].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Vision1
            DM.ARAY[ri.VSN1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.RLT1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.WRK1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Vision2
            DM.ARAY[ri.VSN2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.RLT2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.WRK2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Vision3
            DM.ARAY[ri.VSN3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.RLT3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);
            DM.ARAY[ri.WRK3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //PostBuffer
            DM.ARAY[ri.PSTB].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt);

            //Unloader
            DM.ARAY[ri.ULDR].SetMaxColRow(1, OM.DevInfo.iMgzSlotCnt);



            ArrayPos.TPara PosPara; //= new ArrayPos.TPara();
            PosPara.dColGrGap   = OM.DevInfo.dColGrGap;
            PosPara.iColCnt     = OM.DevInfo.iColCnt;
            PosPara.iRowCnt     = OM.DevInfo.iRowCnt;
            PosPara.dColPitch   = OM.DevInfo.dColPitch;
            PosPara.dRowPitch   = OM.DevInfo.dRowPitch;
            PosPara.iColGrCnt   = OM.DevInfo.iColGrCnt;
            PosPara.iRowGrCnt   = OM.DevInfo.iRowGrCnt;
            PosPara.dColGrGap   = OM.DevInfo.dColGrGap;
            PosPara.dRowGrGap   = OM.DevInfo.dRowGrGap;
            PosPara.iColSbGrCnt = OM.DevInfo.iColSbGrCnt;
            PosPara.iRowSbGrCnt = OM.DevInfo.iRowSbGrCnt;
            PosPara.dRowSbGrGap = OM.DevInfo.dRowSbGrGap;
            PosPara.dColSbGrGap = OM.DevInfo.dColSbGrGap;
            if (!OM.StripPos.SetPara(PosPara))
            {
                Log.ShowMessage("Strip Position Err", OM.StripPos.Error);
            }

            Refresh();
        }
Beispiel #27
0
        public FormDeviceSet(Panel _pnBase)
        {
            InitializeComponent();
            this.Width  = 1272;
            this.Height = 866;

            this.TopLevel = false;
            this.Parent   = _pnBase;

            tbUserUnit.Text = 0.01.ToString();
            PstnDisp();

            OM.LoadLastInfo();
            PM.Load(OM.GetCrntDev().ToString());

            PM.UpdatePstn(true);
            UpdateDevInfo(true);
            UpdateDevOptn(true);

            DM.ARAY[ri.MASK].SetParent(pnTrayMask); DM.ARAY[ri.MASK].Name = "MASK";
            LoadTrayMask(OM.GetCrntDev().ToString());
            DM.ARAY[ri.MASK].SetDisp(cs.Empty, "Empty", Color.Silver);
            DM.ARAY[ri.MASK].SetDisp(cs.None, "None", Color.White);

            FraMotr     = new FraMotr    [(int)mi.MAX_MOTR];
            FraCylinder = new FraCylOneBt[(int)ci.MAX_ACTR];

            //모터 축 수에 맞춰 FrameMotr 생성
            for (int m = 0; m < (int)mi.MAX_MOTR; m++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrJog" + m.ToString(), true);

                MOTION_DIR eDir = SM.MT_GetDirType((mi)m);
                FraMotr[m] = new FraMotr();
                FraMotr[m].SetIdType((mi)m, eDir);
                FraMotr[m].TopLevel = false;
                FraMotr[m].Parent   = Ctrl[0];
                FraMotr[m].Show();
                FraMotr[m].SetUnit(EN_UNIT_TYPE.utJog, 0);
            }

            for (int i = 0; i < (int)mi.MAX_MOTR; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrPos" + i.ToString(), true);

                switch (i)
                {
                default: break;

                case (int)mi.LODR_ZLift: SetMotrPanel((int)pv.MAX_PSTN_MOTR0, Ctrl[0]); break;

                case (int)mi.TOOL_XRjct: SetMotrPanel((int)pv.MAX_PSTN_MOTR1, Ctrl[0]); break;

                case (int)mi.IDXR_XRear: SetMotrPanel((int)pv.MAX_PSTN_MOTR2, Ctrl[0]); break;

                case (int)mi.IDXF_XFrnt: SetMotrPanel((int)pv.MAX_PSTN_MOTR3, Ctrl[0]); break;

                case (int)mi.TOOL_YTool: SetMotrPanel((int)pv.MAX_PSTN_MOTR4, Ctrl[0]); break;

                case (int)mi.TOOL_ZPckr: SetMotrPanel((int)pv.MAX_PSTN_MOTR5, Ctrl[0]); break;

                case (int)mi.BARZ_XPckr: SetMotrPanel((int)pv.MAX_PSTN_MOTR6, Ctrl[0]); break;

                case (int)mi.BARZ_ZPckr: SetMotrPanel((int)pv.MAX_PSTN_MOTR7, Ctrl[0]); break;

                case (int)mi.STCK_ZStck: SetMotrPanel((int)pv.MAX_PSTN_MOTR8, Ctrl[0]); break;

                case (int)mi.TOOL_ZVisn: SetMotrPanel((int)pv.MAX_PSTN_MOTR9, Ctrl[0]); break;
                }
            }

            //여기 AP텍에서만 쓰는거


            FraCylAPT = new FrameCylinderAPT[(int)ci.MAX_ACTR];
            //실린더 버튼 AP텍꺼
            for (int i = 0; i < (int)ci.MAX_ACTR; i++)
            {
                Control[] CtrlAP = tcDeviceSet.Controls.Find("pnActrAP" + i.ToString(), true);

                FraCylAPT[i]          = new FrameCylinderAPT();
                FraCylAPT[i].TopLevel = false;



                switch (i)
                {
                default: break;

                case (int)ci.LODR_ClampClOp: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.LODR_SperatorUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.STCK_RailClOp: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.IDXR_ClampUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.IDXF_ClampUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.IDXR_ClampClOp: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.IDXF_ClampClOp: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.STCK_RailTrayUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.STCK_StackStprUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.STCK_StackOpCl: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.BARZ_BrcdStprUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.BARZ_BrcdTrayUpDn: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;

                case (int)ci.BARZ_YPckrFwBw: FraCylAPT[i].SetConfig((ci)i, SML.CL.GetName(i).ToString(), SML.CL.GetDirType(i), CtrlAP[0]); break;
                }

                FraCylAPT[i].Show();
            }

            //Input Status 생성 AP텍꺼
            const int iInputBtnCnt = 11;

            FraInputAPT = new FrameInputAPT[iInputBtnCnt];
            for (int i = 0; i < iInputBtnCnt; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnInput" + i.ToString(), true);

                int iIOCtrl = Convert.ToInt32(Ctrl[0].Tag);

                FraInputAPT[i]          = new FrameInputAPT();
                FraInputAPT[i].TopLevel = false;

                switch (iIOCtrl)
                {
                default: break;

                case (int)xi.LODR_TrayDtct: FraInputAPT[i].SetConfig(xi.LODR_TrayDtct, SML.IO.GetXName((int)xi.LODR_TrayDtct), Ctrl[0]); break;

                case (int)xi.RAIL_TrayDtct1: FraInputAPT[i].SetConfig(xi.RAIL_TrayDtct1, SML.IO.GetXName((int)xi.RAIL_TrayDtct1), Ctrl[0]); break;

                case (int)xi.IDXR_TrayDtct: FraInputAPT[i].SetConfig(xi.IDXR_TrayDtct, SML.IO.GetXName((int)xi.IDXR_TrayDtct), Ctrl[0]); break;

                case (int)xi.IDXF_TrayDtct: FraInputAPT[i].SetConfig(xi.IDXF_TrayDtct, SML.IO.GetXName((int)xi.IDXF_TrayDtct), Ctrl[0]); break;

                case (int)xi.TOOL_PckrVac: FraInputAPT[i].SetConfig(xi.TOOL_PckrVac, SML.IO.GetXName((int)xi.TOOL_PckrVac), Ctrl[0]); break;

                case (int)xi.STCK_StackTrayDtct: FraInputAPT[i].SetConfig(xi.STCK_StackTrayDtct, SML.IO.GetXName((int)xi.STCK_StackTrayDtct), Ctrl[0]); break;

                case (int)xi.STCK_StackUpDtct: FraInputAPT[i].SetConfig(xi.STCK_StackUpDtct, SML.IO.GetXName((int)xi.STCK_StackUpDtct), Ctrl[0]); break;

                case (int)xi.BARZ_BrcdTrayDtct: FraInputAPT[i].SetConfig(xi.BARZ_BrcdTrayDtct, SML.IO.GetXName((int)xi.BARZ_BrcdTrayDtct), Ctrl[0]); break;

                case (int)xi.BARZ_PckrBrcdDtct: FraInputAPT[i].SetConfig(xi.BARZ_PckrBrcdDtct, SML.IO.GetXName((int)xi.BARZ_PckrBrcdDtct), Ctrl[0]); break;

                case (int)xi.BARZ_TrayOutDtct: FraInputAPT[i].SetConfig(xi.BARZ_TrayOutDtct, SML.IO.GetXName((int)xi.BARZ_TrayOutDtct), Ctrl[0]); break;

                case (int)xi.BARZ_PckrVac: FraInputAPT[i].SetConfig(xi.BARZ_PckrVac, SML.IO.GetXName((int)xi.BARZ_PckrVac), Ctrl[0]); break;
                }

                FraInputAPT[i].Show();
            }

            //Output Status 생성 AP텍꺼
            const int iOutputBtnCnt = 4;

            FraOutputAPT = new FrameOutputAPT[iOutputBtnCnt];
            for (int i = 0; i < iOutputBtnCnt; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnOutput" + i.ToString(), true);

                int iIOCtrl = Convert.ToInt32(Ctrl[0].Tag);

                FraOutputAPT[i]          = new FrameOutputAPT();
                FraOutputAPT[i].TopLevel = false;

                switch (iIOCtrl)
                {
                default: break;

                case (int)yi.TOOL_PckrVac: FraOutputAPT[i].SetConfig(yi.TOOL_PckrVac, SML.IO.GetYName((int)yi.TOOL_PckrVac), Ctrl[0]); break;

                case (int)yi.STCK_StackAC: FraOutputAPT[i].SetConfig(yi.STCK_StackAC, SML.IO.GetYName((int)yi.STCK_StackAC), Ctrl[0]); break;

                case (int)yi.BARZ_PckrVac: FraOutputAPT[i].SetConfig(yi.BARZ_PckrVac, SML.IO.GetYName((int)yi.BARZ_PckrVac), Ctrl[0]); break;

                case (int)yi.BARZ_BrcdAC: FraOutputAPT[i].SetConfig(yi.BARZ_BrcdAC, SML.IO.GetYName((int)yi.BARZ_BrcdAC), Ctrl[0]); break;
                }

                FraOutputAPT[i].Show();
            }

            //모터 포지션 AP텍꺼
            FraMotrPosAPT = new FrameMotrPosAPT[(int)mi.MAX_MOTR];
            for (int i = 0; i < (int)mi.MAX_MOTR; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrPos" + i.ToString(), true);

                FraMotrPosAPT[i]          = new FrameMotrPosAPT();
                FraMotrPosAPT[i].TopLevel = false;
                switch (i)
                {
                default: break;

                case (int)mi.LODR_ZLift: FraMotrPosAPT[i].SetWindow((int)mi.LODR_ZLift, Ctrl[0]); break;

                case (int)mi.TOOL_XRjct: FraMotrPosAPT[i].SetWindow((int)mi.TOOL_XRjct, Ctrl[0]); break;

                case (int)mi.IDXR_XRear: FraMotrPosAPT[i].SetWindow((int)mi.IDXR_XRear, Ctrl[0]); break;

                case (int)mi.IDXF_XFrnt: FraMotrPosAPT[i].SetWindow((int)mi.IDXF_XFrnt, Ctrl[0]); break;

                case (int)mi.TOOL_YTool: FraMotrPosAPT[i].SetWindow((int)mi.TOOL_YTool, Ctrl[0]); break;

                case (int)mi.TOOL_ZPckr: FraMotrPosAPT[i].SetWindow((int)mi.TOOL_ZPckr, Ctrl[0]); break;

                case (int)mi.BARZ_XPckr: FraMotrPosAPT[i].SetWindow((int)mi.BARZ_XPckr, Ctrl[0]); break;

                case (int)mi.BARZ_ZPckr: FraMotrPosAPT[i].SetWindow((int)mi.BARZ_ZPckr, Ctrl[0]); break;

                case (int)mi.STCK_ZStck: FraMotrPosAPT[i].SetWindow((int)mi.STCK_ZStck, Ctrl[0]); break;

                case (int)mi.TOOL_ZVisn: FraMotrPosAPT[i].SetWindow((int)mi.TOOL_ZVisn, Ctrl[0]); break;
                }
                FraMotrPosAPT[i].Show();
            }
        }
Beispiel #28
0
        public FormDeviceSet(Panel _pnBase)
        {
            InitializeComponent();
            this.Width  = 1272;
            this.Height = 866;

            this.TopLevel = false;
            this.Parent   = _pnBase;

            tbUserUnit.Text = 0.01.ToString();
            PstnDisp();

            OM.LoadLastInfo();
            PM.Load(OM.GetCrntDev().ToString());

            PM.UpdatePstn(true);
            UpdateDevInfo(true);

            //모터 축 수에 맞춰 FrameMotr 생성
            FraMotr = new FraMotr[(int)mi.MAX_MOTR];
            for (int m = 0; m < (int)mi.MAX_MOTR; m++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrJog" + m.ToString(), true);

                MOTION_DIR eDir = ML.MT_GetDirType((mi)m);
                FraMotr[m] = new FraMotr();
                FraMotr[m].SetIdType((mi)m, eDir);
                FraMotr[m].TopLevel = false;
                FraMotr[m].Parent   = Ctrl[0];
                FraMotr[m].Show();
                FraMotr[m].SetUnit(EN_UNIT_TYPE.utJog, 0);
            }

            FraCylAPT = new FrameCylinderAPT[(int)ci.MAX_ACTR];
            for (int i = 0; i < (int)ci.MAX_ACTR; i++)
            {
                Control[] CtrlAP = tcDeviceSet.Controls.Find("C" + i.ToString(), true);

                //int iCylCtrl = Convert.ToInt32(CtrlAP[0].Tag);
                int iCylCtrl = Convert.ToInt32(i);
                FraCylAPT[i]          = new FrameCylinderAPT();
                FraCylAPT[i].TopLevel = false;
                FraCylAPT[i].SetConfig((ci)iCylCtrl, ML.CL_GetName(iCylCtrl).ToString(), ML.CL_GetDirType((ci)iCylCtrl), CtrlAP[0]);
                FraCylAPT[i].Show();
            }

            //모터 포지션 AP텍꺼
            FraMotrPosAPT = new FrameMotrPosAPT[(int)mi.MAX_MOTR];
            for (int i = 0; i < (int)mi.MAX_MOTR; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("pnMotrPos" + i.ToString(), true);

                FraMotrPosAPT[i]          = new FrameMotrPosAPT();
                FraMotrPosAPT[i].TopLevel = false;
                FraMotrPosAPT[i].SetWindow(i, Ctrl[0]);
                FraMotrPosAPT[i].Show();
            }

            //Input Status 생성 AP텍꺼
            const int iInputBtnCnt = 17;

            FraInputAPT = new FrameInputAPT[iInputBtnCnt];
            for (int i = 0; i < iInputBtnCnt; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("X" + i.ToString(), true);

                int iIOCtrl = Convert.ToInt32(Ctrl[0].Tag);

                FraInputAPT[i]          = new FrameInputAPT();
                FraInputAPT[i].TopLevel = false;
                FraInputAPT[i].SetConfig((xi)iIOCtrl, ML.IO_GetXName((xi)iIOCtrl), Ctrl[0]);
                FraInputAPT[i].Show();
            }

            //Output Status 생성 AP텍꺼
            const int iOutputBtnCnt = 8;

            FraOutputAPT = new FrameOutputAPT[iOutputBtnCnt];
            for (int i = 0; i < iOutputBtnCnt; i++)
            {
                Control[] Ctrl = tcDeviceSet.Controls.Find("Y" + i.ToString(), true);

                int iIOCtrl = Convert.ToInt32(Ctrl[0].Tag);

                FraOutputAPT[i]          = new FrameOutputAPT();
                FraOutputAPT[i].TopLevel = false;
                FraOutputAPT[i].SetConfig((yi)iIOCtrl, ML.IO_GetYName((yi)iIOCtrl), Ctrl[0]);
                FraOutputAPT[i].Show();

                // FraOutputAPT[i].Show();
            }
        }
Beispiel #29
0
        private void btDownload_Click(object sender, EventArgs e)             //HRM-930B 참고
        {
            string sText = ((Button)sender).Text;

            Log.Trace(sFormText + sText + " Button Clicked", ForContext.Frm);

            if (tbFromName.Text == "")
            {
                return;
            }

            //Check Running Status
            //            bool bAllArayNone = DM.ARAY[(int)ri.SLD].CheckAllStat(cs.None);

            //if (LOT.GetLotOpen())
            //{
            //    //Log.ShowMessage("Error", "자재나 메거진이 남아 있으면 잡파일을 바꿀수 없습니다.");
            //    Log.ShowMessage("Error", "Please check the status of the Lot(Need to Lot End).");
            //    return;
            //}

            //if(OM.DevInfo.sMrkData != "")SEQ.Com[0].SendMsg(OM.DevInfo.sMrkData);
            if (lvDevice.SelectedIndices.Count <= 0)
            {
                return;
            }
            int iDeviceSel = lvDevice.SelectedIndices[0];

            string sName = lvDevice.Items[iDeviceSel].SubItems[1].Text;
            string sTemp = "DOWNLOAD JOB FILE. (" + lbSelDevice.Text + ")";

            if (OM.GetCrntDev() == sName)
            {
                //Log.ShowMessage( "ERROR", "현재 잡파일과 같은 잡파일 입니다.");
                Log.ShowMessage("ERROR", "This is the current file with the same file.");
                return;
            }
            if (Log.ShowMessageModal("Confirm", "Are you Sure?") != DialogResult.Yes)
            {
                return;
            }

            SaveDeviceLog(0, OM.GetCrntDev(), sName);
            //FrmMain.FrmDeviceSet.
            OM.LoadJobFile(sName); pbStatus.Minimum = 0;
            //SEQ.Visn.SendJobChange(sName); pbStatus.Minimum = 30;
            PM.Load(sName); pbStatus.Value = 70;
            CConfig Config = new CConfig();

            //string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            //string sDevOptnPath = sExeFolder + "JobFile\\" + sName + "\\TrayMask.ini";
            //Config.Load(sDevOptnPath, CConfig.EN_CONFIG_FILE_TYPE.ftIni);

            //ArrayPos.TPara PosPara ;//= new ArrayPos.TPara();
            //PosPara.dColGrGap  = OM.DevInfo.dColGrGap  ;
            //PosPara.iColCnt    = OM.DevInfo.iColCnt    ;
            //PosPara.iRowCnt    = OM.DevInfo.iRowCnt    ;
            //PosPara.dColPitch  = OM.DevInfo.dColPitch  ;
            //PosPara.dRowPitch  = OM.DevInfo.dRowPitch  ;
            //PosPara.iColGrCnt  = OM.DevInfo.iColGrCnt  ;
            //PosPara.iRowGrCnt  = OM.DevInfo.iRowGrCnt  ;
            //PosPara.dColGrGap  = OM.DevInfo.dColGrGap  ;
            //PosPara.dRowGrGap  = OM.DevInfo.dRowGrGap  ;
            //PosPara.iColSbGrCnt= OM.DevInfo.iColSbGrCnt;
            //PosPara.iRowSbGrCnt= OM.DevInfo.iRowSbGrCnt;
            //PosPara.dRowSbGrGap= OM.DevInfo.dRowSbGrGap;
            //PosPara.dColSbGrGap= OM.DevInfo.dColSbGrGap;
            //if(!OM .StripPos.SetPara(PosPara))
            //{
            //    Log.ShowMessage("Strip Position Err" , OM .StripPos.Error);
            //}

            pbStatus.Value = 100;

            CDelayTimer TimeOut = new CDelayTimer();

            TimeOut.Clear();
            //while (!SEQ.Visn.GetSendCycleEnd(VisnCom.vs.JobChange))
            //{
            //    Thread.Sleep(1);
            //    if (TimeOut.OnDelay(5000))
            //    {
            //        ML.ER_SetErr(ei.VSN_ComErr, "JobFile Change TimeOut");
            //        break;
            //    }
            //}

            lbSelDevice.Text  = "";
            tbFromName.Text   = "";
            lbCrntDevice.Text = sName;

            PM.UpdatePstn(true);

            ////Loader.
            //DM.ARAY[ri.LODR].SetMaxColRow(1 , OM.DevInfo.iMgzSlotCnt);
            //
            ////Prebuffer
            //DM.ARAY[ri.PREB].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //
            ////Vision1
            //DM.ARAY[ri.VSN1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //DM.ARAY[ri.RLT1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //DM.ARAY[ri.WRK1].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //
            ////Vision2
            //DM.ARAY[ri.VSN2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //DM.ARAY[ri.RLT2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //DM.ARAY[ri.WRK2].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //
            ////Vision3
            //DM.ARAY[ri.VSN3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //DM.ARAY[ri.RLT3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //DM.ARAY[ri.WRK3].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //
            ////PostBuffer
            //DM.ARAY[ri.PSTB].SetMaxColRow(OM.DevInfo.iColCnt, OM.DevInfo.iRowCnt );
            //
            ////Unloader
            //DM.ARAY[ri.ULDR].SetMaxColRow(1 , OM.DevInfo.iMgzSlotCnt);
            //
            //SEQ.VSNZ.JobChange();
            //SEQ.VisnRB.SendJobChange(sName);

            //CDelayTimer TimeOut = new CDelayTimer();
            //TimeOut.Clear();
            //while(!SEQ.VisnRB.GetSendCycleEnd(VisnCom.vs.JobChange  )){
            //    Thread.Sleep(1);
            //    if(TimeOut.OnDelay(5000)) {
            //        SM.ER_SetErr(ei.VSN_ComErr,"잡체인지 비전 통신 타임아웃");
            //        break;
            //    }
            //}

            //프로그램 강제 종료할때 셋팅 안되서 강제 종료 후 다시 켰을때 종료 이전에 다운로드한 디바이스로
            //다시 로딩되서 집어 넣음. 진섭
            OM.SaveLastInfo();
        }
Beispiel #30
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            lbMainThreadTime.Text = string.Format("{0:0.000ms}", SEQ._dMainThreadCycleTime);
            lbDevice.Text         = OM.GetCrntDev().ToString();
            lbLotNo.Text          = LOT.GetLotNo();


            btExit.Enabled = !SEQ._bRun;

            //Set Sequence State.
            if (!OM.MstOptn.bDebugMode)
            {
                switch (SEQ._iSeqStat)
                {
                default:
                    break;

                case EN_SEQ_STAT.Init: lbStat.Text = "INIT"; lbStat.ForeColor = Color.Blue;
                    break;

                case EN_SEQ_STAT.Error: lbStat.Text = "ERROR"; lbStat.ForeColor = SEQ._bFlick ? Color.Yellow : Color.Red;
                    break;

                case EN_SEQ_STAT.Running: lbStat.Text = "RUNNING"; lbStat.ForeColor = Color.Lime;
                    break;

                case EN_SEQ_STAT.Stop: lbStat.Text = "STOP"; lbStat.ForeColor = Color.Black;
                    break;

                case EN_SEQ_STAT.WorkEnd: lbStat.Text = "LOTEND"; lbStat.ForeColor = Color.Gray;
                    break;

                case EN_SEQ_STAT.RunWarn: lbStat.Text = "Run End"; lbStat.ForeColor = Color.Gray;
                    break;
                }
            }
            else
            {
                switch (SEQ._iSeqStat)
                {
                default:                                                                                                  break;

                case EN_SEQ_STAT.Init: lbStat.Text = "DEBUG INIT"; lbStat.ForeColor = Color.Blue; break;

                case EN_SEQ_STAT.Error: lbStat.Text = "DEBUG ERROR"; lbStat.ForeColor = SEQ._bFlick ? Color.Yellow : Color.Red; break;

                case EN_SEQ_STAT.Running: lbStat.Text = "DEBUG RUNNING"; lbStat.ForeColor = Color.Lime; break;

                case EN_SEQ_STAT.Stop: lbStat.Text = "DEBUG STOP"; lbStat.ForeColor = Color.Black; break;

                case EN_SEQ_STAT.WorkEnd: lbStat.Text = "DEBUG LOTEND"; lbStat.ForeColor = Color.Gray; break;
                }
            }

            //접근 레벨 Operator에서 Option/Util 버튼 비활성화
            if (FormPassword.GetLevel() == EN_LEVEL.Operator)
            {
                //btSpc.Enabled    = false;
                btUtil.Enabled   = false;
                btOption.Enabled = false;
            }

            else
            {
                //btSpc.Enabled    = true;
                btUtil.Enabled   = true;
                btOption.Enabled = true;
            }

            tmUpdate.Enabled = true;
        }