Пример #1
0
        //인덱서.
        //public CArray this[ri _eIndex]
        //{
        //    get
        //    {
        //        return ARAY[(int)_eIndex];
        //    }
        //    set
        //    {
        //        ARAY[(int)_eIndex] = value;
        //    }
        //}

        public static void Init()
        {
            for (int i = 0; i < (int)ri.MAX_ARAY; i++)
            {
                ARAY[i] = new CArray();
            }
        }
Пример #2
0
        //HVI-1500i
        //DataMap ini 파일 로드 D:\SpcLog\HVI-1500i\DataMap\20190116\ddddd\1
        public void LoadDataMap(string _sPath, CArray _Array)
        {
            //Read&Write.
            CConfig Config = new CConfig();
            string  sPath  = "";

            sPath = _sPath;

            Config.Load(sPath, CConfig.EN_CONFIG_FILE_TYPE.ftIni);

            _Array.Load(Config, true);
        }
Пример #3
0
        //=====================================================================================================================================================================================
        //퍼블릭....
        //밖에서 Good마스킹 시켜서 돌려야 함.
        //좌,우 비전 같이 한번씩 태워야 한다. 그래서 그럼.
        //Result1~6
        public bool ReadResult(CArray _arAray)
        {
            //Local Var.
            string sPath = "";
            string sData = "";

            //Set Path.
            sPath = OM.EqpOptn.sVisnPath;
            if (!Directory.Exists(sPath))
            {
                Directory.CreateDirectory(sPath);
            }

            sPath = sPath + "\\Result" + ((int)Para.Id + 1).ToString() + ".dat";

            //switch(Para.Id)
            //{
            //    case vi.Vs1L:  break ;
            //    case vi.Vs1R: sPath = sPath + "\\Result"+((int)Para.Id+1).ToString(); break ;
            //    case vi.Vs2L: sPath = sPath + "\\Result"+((int)Para.Id+1).ToString(); break ;
            //    case vi.Vs2R: sPath = sPath + "\\Result"+((int)Para.Id+1).ToString(); break ;
            //    case vi.Vs3L: sPath = sPath + "\\Result"+((int)Para.Id+1).ToString(); break ;
            //    case vi.Vs3R: sPath = sPath + "\\Result"+((int)Para.Id+1).ToString(); break ;
            //}
            if (!File.Exists(sPath))
            {
                Log.Trace("Result Reading Err", sPath + " - is not exist");
                return(false);
            }


            string sLine = "";

            try
            {
                using (FileStream fs = new FileStream(sPath, FileMode.Open))
                {
                    StreamReader sr = new StreamReader(fs, Encoding.Default);
                    while (true)
                    {
                        sLine = sr.ReadLine();
                        if (sLine == null)
                        {
                            break;
                        }
                        sData += sLine;
                    }
                    sr.Close();
                }
            }
            catch (Exception _e)
            {
                sErrMsg = _e.Message;
                return(false);
            }

            string sFailCnt = sData.Substring(0, 3);

            if (!int.TryParse(sFailCnt, out int iFailCnt))
            {
                sErrMsg = Para.Id.ToString() + " : '" + sFailCnt + "'is can't changed to int";
                return(false);
            }
            sData = sData.Remove(0, 3);

            string sRow  = "";
            string sCol  = "";
            string sFail = "";
            cs     Fail  = cs.None;

            for (int i = 0; i < iFailCnt; i++)
            {
                sCol  = sData.Substring(0, 2);
                sData = sData.Remove(0, 2);
                if (!int.TryParse(sCol, out int iCol))
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sCol + "'is can't changed to int";
                    return(false);
                }
                if (_arAray.GetMaxCol() < iCol)
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sCol + "'is RangeOver";
                    return(false);
                }
                if (0 >= iCol)
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sCol + "'is RangeOver";
                    return(false);
                }


                sRow  = sData.Substring(0, 2);
                sData = sData.Remove(0, 2);
                if (!int.TryParse(sRow, out int iRow))
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sRow + "'is can't changed to int";
                    return(false);
                }
                if (_arAray.GetMaxRow() < iRow)
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sRow + "'is RangeOver";
                    return(false);
                }
                if (0 >= iRow)
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sRow + "'is RangeOver";
                    return(false);
                }

                sFail = sData.Substring(0, 1);
                sData = sData.Remove(0, 1);

                if (sFail == "0")
                {
                    Fail = cs.Rslt0;
                }
                else if (sFail == "1")
                {
                    Fail = cs.Rslt1;
                }
                else if (sFail == "2")
                {
                    Fail = cs.Rslt2;
                }
                else if (sFail == "3")
                {
                    Fail = cs.Rslt3;
                }
                else if (sFail == "4")
                {
                    Fail = cs.Rslt4;
                }
                else if (sFail == "5")
                {
                    Fail = cs.Rslt5;
                }
                else if (sFail == "6")
                {
                    Fail = cs.Rslt6;
                }
                else if (sFail == "7")
                {
                    Fail = cs.Rslt7;
                }
                else if (sFail == "8")
                {
                    Fail = cs.Rslt8;
                }
                else if (sFail == "9")
                {
                    Fail = cs.Rslt9;
                }
                else if (sFail == "A")
                {
                    Fail = cs.RsltA;
                }
                else if (sFail == "B")
                {
                    Fail = cs.RsltB;
                }
                else if (sFail == "C")
                {
                    Fail = cs.RsltC;
                }
                else if (sFail == "D")
                {
                    Fail = cs.RsltD;
                }
                else if (sFail == "E")
                {
                    Fail = cs.RsltE;
                }
                else if (sFail == "F")
                {
                    Fail = cs.RsltF;
                }
                else if (sFail == "G")
                {
                    Fail = cs.RsltG;
                }
                else if (sFail == "H")
                {
                    Fail = cs.RsltH;
                }
                else if (sFail == "I")
                {
                    Fail = cs.RsltI;
                }
                else if (sFail == "J")
                {
                    Fail = cs.RsltJ;
                }
                else if (sFail == "K")
                {
                    Fail = cs.RsltK;
                }
                else if (sFail == "L")
                {
                    Fail = cs.RsltL;
                }
                else
                {
                    sErrMsg = Para.Id.ToString() + " : '" + sFail + "' Result is RangeOver";
                    return(false);
                }
                _arAray.SetStat(iCol - 1, iRow - 1, Fail);
            }

            File.Delete(sPath);
            return(true);
        }