Esempio n. 1
0
        public static void LoadDevInfo(string _sJobName)
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sDevInfoPath = sExeFolder + "JobFile\\" + _sJobName + "\\DevInfo.ini";

            CAutoIniFile.LoadStruct <CDevInfo>(sDevInfoPath, "DevInfo", ref DevInfo);
        }
Esempio n. 2
0
        public static void SaveDevOptn(string _sJobName)
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sDevOptnPath = sExeFolder + "JobFile\\" + _sJobName + "\\DevOptn.ini";

            CAutoIniFile.SaveStruct <CDevOptn>(sDevOptnPath, "DevOptn", ref DevOptn);
        }
Esempio n. 3
0
        public void SaveData(double _dStartTime, string _sLotNo, TLotData _LotData)
        {
            try
            {
                string sSpcFd = System.IO.Directory.GetParent(SPC.LOT.Folder).Parent.FullName.ToString();
                string sSttDt = DateTime.FromOADate(_dStartTime).ToString("yyyyMMdd");//DateTime.Now.ToString("yyyyMMdd");

                string        sPath = SPC.LOT.Folder + sSttDt + "\\" + _sLotNo + ".ini";
                DirectoryInfo di    = new DirectoryInfo(Path.GetDirectoryName(sPath));
                //DirectoryInfo di = new DirectoryInfo(sPath);
                if (!di.Exists)
                {
                    di.Create();
                }

                //몬가 마음에 안드는데 ... 시간상 패스 대충 쓸라고 만든거임
                //카운트 저장.
                int      iCnt   = 0;
                CIniFile IniCnt = new CIniFile(sPath);
                IniCnt.Load("ETC", "DataCnt", ref iCnt);//이거 여기서 저장하는데 Datamap에서도 가져다가 쓴다.
                IniCnt.Save("ETC", "DataCnt", iCnt + 1);

                //데이터 저장.
                CAutoIniFile.SaveStruct(sPath, "LotData" + (iCnt).ToString(), ref _LotData);
            }
            catch (Exception _e)
            {
                Log.Trace("Data Save Fail" + _e.Message);
            }
        }
Esempio n. 4
0
        public static void SaveMstOptn()
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sMstOptnPath = sExeFolder + "Util\\MstOptn.ini";

            CAutoIniFile.SaveStruct <CMstOptn>(sMstOptnPath, "MstOptn", ref MstOptn);
        }
Esempio n. 5
0
        public static void LoadEqpOptn()
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sEqpOptnPath = sExeFolder + "Util\\EqpOptn.ini";

            CAutoIniFile.LoadStruct <CEqpOptn>(sEqpOptnPath, "EqpOptn", ref EqpOptn);
        }
Esempio n. 6
0
        public static void SaveEqpStat()
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sEqpOptnPath = sExeFolder + "Util\\EqpStat.ini";

            CAutoIniFile.SaveStruct <CEqpStat>(sEqpOptnPath, "EqpStat", ref EqpStat);
        }
Esempio n. 7
0
        public static void SaveCmnOptn()
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sCmnOptnPath = sExeFolder + "Util\\CmnOptn.ini";

            CAutoIniFile.SaveStruct(sCmnOptnPath, "CmnOptn", ref CmnOptn);
        }
Esempio n. 8
0
        public static void SaveInfo()
        {
            string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            string sInfoPath  = sExeFolder + @"Util\CamInfo.ini";

            //string sInfoPath = LogInfo.sLogPath + "Option\\LogInfo.ini";
            CAutoIniFile.SaveStruct <CCamInfo>(sInfoPath, "CamInfo", ref CamInfo);
        }
Esempio n. 9
0
        public static void LoadEqpStat()
        {
            //string sModelName = "PMK-100";
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sEqpOptnPath = sExeFolder + "Util\\EqpStat.ini";

            CAutoIniFile.LoadStruct <CEqpStat>(sEqpOptnPath, "EqpStat", ref EqpStat);
        }
Esempio n. 10
0
        public static void LoadLogInfo()
        {
            string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            string sInfoPath  = sExeFolder + @"Log\LogInfo.ini";

            //string sInfoPath = LogInfo.sLogPath + "Option\\LogInfo.ini";
            CAutoIniFile.LoadStruct <CLogInfo>(sInfoPath, "LogInfo", ref LogInfo);
        }
Esempio n. 11
0
        public void SaveDataIni(double _dOaSaveDate, ref T _tData)
        {
            string   sPath;
            DateTime tDateTime;

            tDateTime = DateTime.FromOADate(_dOaSaveDate);
            sPath     = Folder + tDateTime.ToString("yyyyMMdd") + ".ini";

            ////기존에 있던것들 지우기.
            //DirectoryInfo di = new DirectoryInfo(Folder);
            //if (!di.Exists) di.Create();
            //foreach (FileInfo fi in di.GetFiles())
            //{
            //    //if (fi.Extension != ".log") continue;
            //    // 12개월 이전 로그를 삭제합니다.
            //    if (fi.CreationTime <= DateTime.Now.AddMonths(-12))
            //    {
            //        fi.Delete();
            //    }
            //}

            //기존에 있던것들 지우기.
            DirectoryInfo di = new DirectoryInfo(Folder);

            if (!di.Exists)
            {
                di.Create();
            }
            foreach (FileInfo fi in di.GetFiles())
            {
                //if (fi.Extension != ".log") continue;
                // 12개월 이전 로그를 삭제합니다.
                if (fi.CreationTime <= DateTime.Now.AddMonths(-12))
                {
                    fi.Delete();
                }
            }

            //카운트 저장.
            int      iCnt         = 0;
            CIniFile IniGetErrCnt = new CIniFile(sPath);

            IniGetErrCnt.Load("ETC", "DataCnt", ref iCnt);//이거 여기서 저장하는데 Datamap에서도 가져다가 쓴다.
            int iAddedCnt = iCnt + 1;

            IniGetErrCnt.Save("ETC", "DataCnt", iAddedCnt);

            //데이터 저장.
            CAutoIniFile.SaveStruct <T>(sPath, iCnt.ToString(), ref _tData);
        }
Esempio n. 12
0
        public void LoadSaveLastData(bool _bLoad)
        {
            //Set Dir.
            //ERR_FOLDER    ;
            string sPath = Folder + "LastWrkData.ini";

            if (_bLoad)
            {
                CAutoIniFile.LoadStruct <T>(sPath, "Data", ref Data);
            }
            else
            {
                CAutoIniFile.SaveStruct <T>(sPath, "Data", ref Data);
            }
        }
Esempio n. 13
0
        ////이거 안쓰고 LoadDataList로 쓴다.
        //public bool LoadDataIni(DateTime _tSttData, DateTime _tEndData, T[] _tData)
        //{
        //    string sPath;

        //    int iDataCnt = 0;
        //    int iMaxDayCnt = 0;

        //    string sTemp;
        //    for (DateTime d = _tSttData; d <= _tEndData; d = d.AddDays(1))
        //    {
        //        DateTime SearchDate = d;
        //        sTemp = d.ToString();
        //        sPath = Folder + d.ToString("yyyyMMdd") + ".ini";
        //        //sPath = "D:\WrkLog\HSM_230DB\20170726.ini";
        //        iMaxDayCnt = GetDataCnt(SearchDate, SearchDate);
        //        //TData Data = new TData() ;
        //        for (int c = 0; c < iMaxDayCnt; c++)
        //        {
        //            CAutoIniFile.LoadStruct<T>(sPath, c.ToString(), ref _tData[iDataCnt]);
        //            //CAutoIniFile.LoadStruct<TData>(sPath , c.ToString(),ref Data);
        //            iDataCnt++;
        //        }
        //    }
        //    return true;
        //}

        public bool LoadDataList(DateTime _tSttData, DateTime _tEndData, ref List <T> _lData)
        {
            string sPath;
            int    iMaxDayCnt = 0;
            string sTemp;
            T      Data = new T();

            for (DateTime d = _tSttData; d <= _tEndData; d = d.AddDays(1))
            {
                DateTime SearchDate = d;
                sTemp      = d.ToString();
                sPath      = Folder + d.ToString("yyyyMMdd") + ".ini";//sPath = "D:\WrkLog\HSM_230DB\20170726.ini";
                iMaxDayCnt = GetDataCnt(SearchDate, SearchDate);
                for (int c = 0; c < iMaxDayCnt; c++)
                {
                    CAutoIniFile.LoadStruct <T>(sPath, c.ToString(), ref Data);
                    _lData.Add(Data);
                }
            }
            return(true);
        }
Esempio n. 14
0
        /*
         * public static void LoadEqpStat()
         * {
         *  string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
         *  string sEqpOptnPath = sExeFolder + "Util\\EqpStat.ini";
         *  CAutoIniFile.LoadStruct<CEqpStat>(sEqpOptnPath,"EqpStat",ref EqpStat);
         * }
         * public static void SaveEqpStat()
         * {
         *  string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
         *  string sEqpOptnPath = sExeFolder + "Util\\EqpStat.ini";
         *  CAutoIniFile.SaveStruct<CEqpStat>(sEqpOptnPath,"EqpStat",ref EqpStat);
         * }
         */

        public static bool LoadSave(bool _bLoad)
        {
            string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            string sLotInfo   = sExeFolder + "SeqData\\LotInfo.ini";

            //Current Lot Informations.
            TLot     Data       = new TLot();
            CIniFile IniLotInfo = new CIniFile(sLotInfo);

            //int iCount = LotList.Count ;
            if (_bLoad)
            {
                //IniLotInfo.Load("Total ", "Count"    , out iCount   );
                IniLotInfo.Load("Total ", "LotOpened", out LotOpened);
                IniLotInfo.Load("Total ", "LotEnded", out LotEnded);
                CAutoIniFile.LoadStruct <TLot>(sLotInfo, "CrntLotData", ref CrntLotData);

                //LotList.Clear();
                //for(int i = 0 ; i < iCount ; i++){
                //    CAutoIniFile.LoadStruct<TLot>(sLotInfo,i.ToString(),ref Data);
                //    LotList.Add(Data);
                //}
            }
            else
            {
                //IniLotInfo.Save("Total ", "Count"    , iCount   );
                IniLotInfo.Save("Total ", "LotOpened", LotOpened);
                IniLotInfo.Save("Total ", "LotEnded", LotEnded);
                CAutoIniFile.SaveStruct <TLot>(sLotInfo, "CrntLotData", ref CrntLotData);

                //for(int i = 0 ; i < iCount ; i++){
                //    Data = LotList[i];
                //    CAutoIniFile.SaveStruct<TLot>(sLotInfo,i.ToString(),ref Data);
                //}
            }
            return(true);
        }
Esempio n. 15
0
        public void LoadManRslt(ref TRslt _Rslt)
        {
            string sVisnManPath = "C:\\Data\\Visn.ini";

            CAutoIniFile.LoadStruct <TRslt>(sVisnManPath, "0", ref _Rslt);
        }
Esempio n. 16
0
        public void LoadRslt(int _iIdx, ref TRslt _Rslt)
        {
            string sVisnPath = "C:\\Data\\Visn.ini";

            CAutoIniFile.LoadStruct <TRslt>(sVisnPath, _iIdx.ToString(), ref _Rslt);
        }
Esempio n. 17
0
        //-------------------------------------------------------------------------------------------------------
        //랏에 MGZ넘버가 없는 그냥 랏별 데이터 보여주기용
        //-------------------------------------------------------------------------------------------------------
        public void DispLotData(string sPath, ListView _lvTable)
        {
            if (_lvTable == null)
            {
                return;
            }

            _lvTable.BeginUpdate();

            int      iCnt   = 0;
            CIniFile IniCnt = new CIniFile(sPath);

            IniCnt.Load("ETC", "DataCnt", ref iCnt);

            List <TLotData> Datas = new List <TLotData>();

            for (int c = 0; c < iCnt; c++)
            {
                TLotData LotData = new TLotData();
                CAutoIniFile.LoadStruct(sPath, "LotData" + c.ToString(), ref LotData);
                Datas.Add(LotData);
            }

            _lvTable.Clear();
            _lvTable.View               = View.Details;
            _lvTable.LabelEdit          = true;
            _lvTable.AllowColumnReorder = true;
            _lvTable.FullRowSelect      = true;
            _lvTable.GridLines          = true;
            //_lvTable.Sorting          = SortOrder.Descending;
            _lvTable.Scrollable = true;

            //Type type = typeof(TLotData);
            //int iCntOfItem = type.GetProperties().Length;
            //FieldInfo[] f = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            //
            ////컬럼추가 하고 이름을 넣는다.
            //_lvTable.Columns.Add("No", 100, HorizontalAlignment.Left);
            //for (int c = 0; c < f.Length; c++)
            //{
            //    _lvTable.Columns.Add(f[c].Name, 100, HorizontalAlignment.Left);
            //}

            Type type       = typeof(TLotData);
            int  iCntOfItem = type.GetProperties().Length;

            FieldInfo[] f = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);

            //컬럼추가 하고 이름을 넣는다.
            _lvTable.Columns.Add("No", 100, HorizontalAlignment.Left);

            _lvTable.Columns.Add("작업번호", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("결과", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("NG결과", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 체결토크", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 최대토크", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 후 체결토크1", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 후 최대토크1", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 후 체결토크2", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 후 최대토크2", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 후 체결토크3", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("본체결 후 최대토크3", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("높이측정 데이터1", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("높이측정 데이터2", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("높이측정 데이터3", 100, HorizontalAlignment.Left);
            _lvTable.Columns.Add("높이측정 데이터4", 100, HorizontalAlignment.Left);

            _lvTable.Items.Clear();
            string sValue = "";
            string sName  = "";

            ListViewItem[] liitem = new ListViewItem[Datas.Count];
            for (int r = 0; r < Datas.Count; r++)
            {
                liitem[r] = new ListViewItem(string.Format("{0}", r + 1));
                for (int c = 0; c < f.Length; c++)
                {
                    sName  = f[c].Name;
                    sValue = f[c].GetValue(Datas[r]).ToString();
                    liitem[r].SubItems.Add(sValue);
                }
                liitem[r].UseItemStyleForSubItems = false;
                _lvTable.Items.Add(liitem[r]);
            }
            //_lvTable.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            //if(iCnt == 0) _lvTable.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize   );
            //else          _lvTable.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            _lvTable.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            _lvTable.EndUpdate();
        }
Esempio n. 18
0
        public bool LoadSaveAll(bool _bLoad)
        {
            bool bRet = true;

            string sFilePath;

            if (_bLoad)
            {
                //sFilePath = m_sParaFolderPath + "MotrAxl.xml";
                //object oParaMotrSub = ParaSub ;
                //if (!CXml.LoadXml(sFilePath, ref oParaMotrSub)) { bRet = false; }
                //ParaSub = (object [])oParaMotrSub;
                CAutoIniFile.LoadStruct <TParaAll>(m_sParaFolderPath + "MotrParaAll.ini", "TParaAll", ref ParaAll);
                for (int i = 0; i < m_iMaxMotr; i++)
                {
                    sFilePath = m_sParaFolderPath + "MotrPara" + i.ToString() + ".xml";
                    if (!CXml.LoadXml <CParaMotr>(sFilePath, ref Para[i]))
                    {
                        bRet = false;
                    }
                    if (!Mtr[i].LoadSave(_bLoad, m_sParaFolderPath, i))
                    {
                        bRet = false;
                    }

                    //Special Handling
                    if (Para[i].dSpeedRatio == 0)
                    {
                        Para[i].dSpeedRatio = 100;
                    }
                    else if (Para[i].dSpeedRatio < 10)
                    {
                        Para[i].dSpeedRatio = 10;
                    }
                    else if (Para[i].dSpeedRatio > 100)
                    {
                        Para[i].dSpeedRatio = 100;
                    }
                }
            }
            else
            {
                //sFilePath = m_sParaFolderPath + "MotrAxl.xml";
                //object oParaMotrSub = ParaSub;
                //if (!CXml.SaveXml(sFilePath, ref oParaMotrSub)) { bRet = false; }
                CAutoIniFile.SaveStruct <TParaAll>(m_sParaFolderPath + "MotrParaAll.ini", "TParaAll", ref ParaAll);
                for (int i = 0; i < m_iMaxMotr; i++)
                {
                    //Special Handling
                    if (Para[i].dSpeedRatio == 0)
                    {
                        Para[i].dSpeedRatio = 100;
                    }
                    else if (Para[i].dSpeedRatio < 10)
                    {
                        Para[i].dSpeedRatio = 10;
                    }
                    else if (Para[i].dSpeedRatio > 100)
                    {
                        Para[i].dSpeedRatio = 100;
                    }

                    sFilePath = m_sParaFolderPath + "MotrPara" + i.ToString() + ".xml";
                    if (!CXml.SaveXml <CParaMotr>(sFilePath, ref Para[i]))
                    {
                        bRet = false;
                    }
                    if (!Mtr[i].LoadSave(_bLoad, m_sParaFolderPath, i))
                    {
                        bRet = false;
                    }
                }
            }

            return(bRet);
        }