示例#1
0
        public static void SaveMstOptn()
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sMstOptnPath = sExeFolder + "Util\\MstOptn.ini";

            CAutoIniFile.SaveStruct <CMstOptn>(sMstOptnPath, "MstOptn", ref MstOptn);
        }
示例#2
0
        public static void SaveEqpStat()
        {
            string sExeFolder   = System.AppDomain.CurrentDomain.BaseDirectory;
            string sEqpOptnPath = sExeFolder + "Util\\EqpStat.ini";

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

            CAutoIniFile.SaveStruct(sCmnOptnPath, "CmnOptn", ref CmnOptn);
        }
示例#4
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);
        }
示例#5
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);
            }
        }
示例#6
0
        //public static sTag Tag;

        public static void SaveLogInfo()
        {
            string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            string sInfoPath  = sExeFolder + @"Log\LogInfo.ini";

            //string sInfoPath = LogInfo.sLogPath + "Option\\LogInfo.ini";
            CAutoIniFile.SaveStruct <CLogInfo>(sInfoPath, "LogInfo", ref LogInfo);
        }
示例#7
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);
        }
示例#8
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);
            }
        }
示例#9
0
文件: LotUnit.cs 项目: zoro-008/Works
        /*
         * 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);
        }
示例#10
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);
        }