예제 #1
0
        private void BtnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                BtnLoad.Enabled = false;

                OpenFileDialog openFiledlg = new OpenFileDialog();
                openFiledlg.InitialDirectory = Application.StartupPath + "\\XML";
                openFiledlg.Filter           = "Para files (*.xml)|*.xml";
                if (openFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                if (!LoadXmlPara(openFiledlg.FileName))
                {
                    return;
                }

                txtSerXML.Text = openFiledlg.FileName;

                xmlFile = openFiledlg.FileName;

                CIniFile.WriteToIni("ToolDebug", "Socket_Xml", xmlFile, iniFile);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                BtnLoad.Enabled = true;
            }
        }
예제 #2
0
        private void SaveLotStart(string _sLotNo)
        {
            string   sLotDataPath    = "C:\\Data\\LotName.ini";
            CIniFile IniLotDatadSave = new CIniFile(sLotDataPath);

            IniLotDatadSave.Save("LotName", "LotName", _sLotNo);
        }
예제 #3
0
 private void SaveIniPara()
 {
     CIniFile.WriteToIni("ToolDebug", "Socket_SerIP", txtSerIP.Text, iniFile);
     CIniFile.WriteToIni("ToolDebug", "Socket_SerPort", txtSerPort.Text, iniFile);
     CIniFile.WriteToIni("ToolDebug", "Socket_clientIP", txtClientIP.Text, iniFile);
     CIniFile.WriteToIni("ToolDebug", "Socket_clientPort", txtClientPort.Text, iniFile);
 }
예제 #4
0
파일: Pattern.cs 프로젝트: zoro-008/Works
        public void SavePat(string _sFileName)
        {
            string sPath, sNum;
            int    iNum;

            sPath = _sFileName;

            CIniFile IniPattern = new CIniFile(sPath);

            for (iNum = 0; iNum < MAX_DSP_CMD; iNum++)
            {
                sNum = iNum.ToString();
                IniPattern.Save("PatternPara", "dPosX" + sNum, DspPos[iNum].dPosX);
                IniPattern.Save("PatternPara", "dPosY" + sNum, DspPos[iNum].dPosY);
                IniPattern.Save("PatternPara", "dPosZ" + sNum, DspPos[iNum].dPosZ);
                IniPattern.Save("PatternPara", "bDispOn" + sNum, DspPos[iNum].bDispOn);
            }

            IniPattern.Save("PatternPara", "m_dXScale", m_dXScale);
            IniPattern.Save("PatternPara", "m_dYScale", m_dYScale);

            IniPattern.Save("PatternPara", "m_dXSttOffset", m_dXSttOffset);
            IniPattern.Save("PatternPara", "m_dYSttOffset", m_dYSttOffset);

            IniPattern.Save("PatternPara", "m_dSpeed", m_dSpeed);
            IniPattern.Save("PatternPara", "m_iDispPosCnt", m_iDispPosCnt);

            IniPattern.Save("PatternPara", "m_dAcc", m_dAcc);
            IniPattern.Save("PatternPara", "m_dDec", m_dDec);
        }
예제 #5
0
        private void SaveCommand(int _iIndx)
        {
            string   sCommandPath   = "C:\\Data\\VisnCommand.ini";
            CIniFile IniCommandSave = new CIniFile(sCommandPath);

            IniCommandSave.Save("Command", "Index", _iIndx);
        }
예제 #6
0
        private void FrmYield_Load(object sender, EventArgs e)
        {
            List <string> keyName = new List <string>();

            List <string> keyValue = new List <string>();

            CIniFile.GetIniKeySection("PLCAlarm", out keyName, out keyValue, Application.StartupPath + "\\iniFile.ini");

            cmbStatName.Items.Clear();

            cmbStatName.Items.Add(CLanguage.Lan("所有工位"));

            for (int i = 0; i < keyValue.Count; i++)
            {
                cmbStatName.Items.Add(keyValue[i]);
            }
            cmbStatName.SelectedIndex = 0;

            cmbbAlarm.Items.Clear();
            cmbbAlarm.Items.Add(CLanguage.Lan("全部"));
            cmbbAlarm.Items.Add(CLanguage.Lan("解除"));
            cmbbAlarm.Items.Add(CLanguage.Lan("报警"));
            cmbbAlarm.SelectedIndex = 0;

            cmbFixNumSlotNo.SelectedIndex = 0;

            check_web_status_handler check_web = new check_web_status_handler(check_web_status);

            check_web.BeginInvoke(null, null);
        }
예제 #7
0
 private void LoadIniFile()
 {
     _ip             = CIniFile.ReadFromIni("ToolDebug", "Telnet_IP", iniFile, "192.168.0.233");
     _port           = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Telnet_Port", iniFile, "10001"));
     txtSerPort.Text = _ip;
     txtSerPort.Text = _port.ToString();
 }
예제 #8
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);
            }
        }
예제 #9
0
        /// <summary>
        /// New method to parse multitext
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        private int parseMultitext(CIniFile config, List <string> lines, int startLineIdx, string name)
        {
            List <string[]> multitext_lines = new List <string[]>();
            List <int>      Indexes         = new List <int>();

            for (int i = startLineIdx; i < lines.Count; i++)
            {
                List <string> multitextLine = new List <string>();
                int           id            = 0;
                if (lines[i].Length == 0)
                {
                    TextlistDefinition.Add(config, name, multitext_lines, Indexes);
                    return(i);
                }
                else
                {
                    multitextLine = lines[i].Split(Const.separ_semicolon, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList();
                    if (int.TryParse(multitextLine[0], out id) == true)
                    {
                        Indexes.Add(id); // 0 index
                        multitextLine = multitextLine.Skip(1).ToList();
                        multitext_lines.Add(multitextLine.ToArray());
                    }
                }
            }
            string    error = "Multitext Definition doesn't ended!";
            Exception e     = new Exception(error);

            string k = e.Message.ToString() + e.Source.ToString() + e.StackTrace.ToString() + error;
            string controllerName = this.GetType().Name.ToString();

            Error.toFile(k, controllerName);
            return(0);
        }
예제 #10
0
        public void SaveErrIni(TData _tData)
        {
            string sPath;

            string   sCaption;
            DateTime tErrDateTime;

            tErrDateTime = DateTime.FromOADate(_tData.dSttTime);

            sPath = ERR_FOLDER + DateTime.Now.ToString("yyyyMMdd") + ".ini";

            int      iCnt;
            CIniFile IniSaveErr = new CIniFile(sPath);

            IniSaveErr.Load("ETC", "ErrCnt", out iCnt);

            sCaption = iCnt.ToString();

            IniSaveErr.Save(sCaption, "iErrNo  ", _tData.iErrNo);
            IniSaveErr.Save(sCaption, "sErrName", _tData.sErrName);
            IniSaveErr.Save(sCaption, "dSttTime", _tData.dSttTime);
            IniSaveErr.Save(sCaption, "sErrMsg ", _tData.sErrMsg);
            IniSaveErr.Save(sCaption, "sLotId  ", _tData.sLotId);

            iCnt++;
            IniSaveErr.Save("ETC", "ErrCnt", iCnt);
        }
예제 #11
0
파일: LotUnit.cs 프로젝트: zoro-008/Works
        public static bool LoadSave(bool _bLoad)
        {
            string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            string sLotInfo   = sExeFolder + "SeqData\\LotInfo.ini";



            //Current Lot Informations.
            if (_bLoad)
            {
                CIniFile IniLotInfo = new CIniFile(sLotInfo);

                Log.Trace("SEQ", "Lot LoadSave");
                IniLotInfo.Load("Member ", "m_bLotOpen    ", out m_bLotOpen);
                IniLotInfo.Load("Member ", "m_bLotEnded   ", out m_bLotEnded);
                IniLotInfo.Load("Member ", "m_bRqstLotEnd ", out m_bRqstLotEnd);
                IniLotInfo.Load("Member ", "m_sLotNo      ", out m_sLotNo);
                IniLotInfo.Load("Member ", "m_sJobName    ", out m_sJobName);
            }
            else
            {
                CIniFile IniLotInfo = new CIniFile(sLotInfo);

                IniLotInfo.Save("Member ", "m_bLotOpen    ", m_bLotOpen);
                IniLotInfo.Save("Member ", "m_bLotEnded   ", m_bLotEnded);
                IniLotInfo.Save("Member ", "m_bRqstLotEnd ", m_bRqstLotEnd);
                IniLotInfo.Save("Member ", "m_sLotNo      ", m_sLotNo);
                IniLotInfo.Save("Member ", "m_sJobName    ", m_sJobName);
            }
            return(true);
        }
예제 #12
0
        public bool LoadErrIni(DateTime _tSttData, DateTime _tEndData, TData[] _tData)
        {
            string sPath;

            string sCaption;
            int    iErrCnt       = 0;
            int    iMaxErrDayCnt = 0;

            string sTemp;

            for (DateTime d = _tSttData; d <= _tEndData; d = d.AddDays(1))
            {
                DateTime SearchDate = d;
                sTemp         = d.ToString();
                sPath         = ERR_FOLDER + d.ToString("yyyyMMdd") + ".ini";
                iMaxErrDayCnt = GetErrCnt(SearchDate, SearchDate);
                for (int c = 0; c < iMaxErrDayCnt; c++)
                {
                    CIniFile IniLoadErr = new CIniFile(sPath);
                    sCaption = c.ToString();

                    IniLoadErr.Load(sCaption, "iErrNo  ", out _tData[iErrCnt].iErrNo);
                    IniLoadErr.Load(sCaption, "sErrName", out _tData[iErrCnt].sErrName);
                    IniLoadErr.Load(sCaption, "dSttTime", out _tData[iErrCnt].dSttTime);
                    IniLoadErr.Load(sCaption, "sErrMsg ", out _tData[iErrCnt].sErrMsg);
                    IniLoadErr.Load(sCaption, "sLotId  ", out _tData[iErrCnt].sLotId);
                    iErrCnt++;
                }
            }
            return(true);
        }
예제 #13
0
        public void LoadSaveDayIni(bool _bLoad, ref TData _tData)
        {
            //Make Dir.
            string sPath = DAY_FOLDER + "DayInfo.ini";

            if (_bLoad)
            {
                CIniFile IniLoadDayInfo = new CIniFile(sPath);

                IniLoadDayInfo.Load("Data", "dWorkTime ", out _tData.dWorkTime);
                IniLoadDayInfo.Load("Data", "dStopTime ", out _tData.dStopTime);
                IniLoadDayInfo.Load("Data", "dErrTime  ", out _tData.dErrTime);
                IniLoadDayInfo.Load("Data", "dTotalTime", out _tData.dTotalTime);
                IniLoadDayInfo.Load("Data", "dUPEH     ", out _tData.dUPEH);
                IniLoadDayInfo.Load("Data", "dUPH      ", out _tData.dUPH);
                IniLoadDayInfo.Load("Data", "iWorkCnt  ", out _tData.iWorkCnt);
                IniLoadDayInfo.Load("Data", "iLotCnt   ", out _tData.iLotCnt);
            }
            else
            {
                CIniFile IniSaveDayInfo = new CIniFile(sPath);

                IniSaveDayInfo.Save("Data", "dWorkTime ", _tData.dWorkTime);
                IniSaveDayInfo.Save("Data", "dStopTime ", _tData.dStopTime);
                IniSaveDayInfo.Save("Data", "dErrTime  ", _tData.dErrTime);
                IniSaveDayInfo.Save("Data", "dTotalTime", _tData.dTotalTime);
                IniSaveDayInfo.Save("Data", "dUPEH     ", _tData.dUPEH);
                IniSaveDayInfo.Save("Data", "dUPH      ", _tData.dUPH);
                IniSaveDayInfo.Save("Data", "iWorkCnt  ", _tData.iWorkCnt);
                IniSaveDayInfo.Save("Data", "iLotCnt   ", _tData.iLotCnt);
            }
        }
예제 #14
0
 public void Add(string dllName, CIniFile iniFile)
 {
     if (!hIniFile.ContainsKey((string)dllName))
     {
         hIniFile.Add(dllName, iniFile);
     }
 }
        /// <summary>
        /// ComboBox事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (sender == null)
            {
                return;
            }
            ComboBox cbb = (ComboBox)sender;

            cbb.Enabled = false;
            cbb.Focus();
            switch (cbb.Name)
            {
            case "comboBox_VSVersion":
                CIniFile ini = new CIniFile(Application.StartupPath + @"\Config.ini", true);
                if (ini.CIniFileSectionExists("VS版本"))
                {
                    ini.CIniFileEraseSection("VS版本");
                }
                ini.CIniFileWriteInt("VS版本", this.comboBox_VSVersion.Text, this.comboBox_VSVersion.SelectedIndex);
                break;

            default:
                break;
            }
            cbb.Focus();
            cbb.Enabled = true;
        }
예제 #16
0
        /// <summary>
        /// method to parse line with NameDef
        /// </summary>
        /// <param name="config">config structure</param>
        /// <param name="tableName">name of table</param>
        /// <param name="column">name of column in db</param>
        /// <param name="line">a line in names</param>
        /// <param name="nameLine">a line in names</param>
        /// <param name="names">names which will contains name in all langs</param>
        private static void parseNameDefLine(CIniFile config, string tableName, string column, string line, List <string> nameLine, string[] names)
        {
            int           iterator    = 0;                   //for string[] names intaration
            List <string> units       = new List <string>(); //here add units
            string        lineTmp     = line.Substring(line.IndexOf("=") + 1);
            List <string> nameDefLine = lineTmp.Split(Const.separ_names, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList();

            if (nameDefLine.Count <= config.LangEnbList.Count) //magic constant (dbidx + column + space)
            {
                for (int j = 0; j < nameDefLine.Count; j++)
                {
                    names[iterator] = nameDefLine[j];
                    iterator++;
                }
            }
            else
            {
                for (int j = 0; j < nameDefLine.Count; j += 2)
                {
                    names[iterator] = nameDefLine[j];
                    units.Add(nameDefLine[j + 1]);
                    iterator++;
                }
            }
            NameDefinition.Add(config, column, names, units, tableName); //Adds name to names
        }
예제 #17
0
        public void DispMgzAndSlotList(string _sDate, string _sLotId, ListView _lvMgz, ListView _lvSlot)
        {
            int iMgzCnt;
            int iSlotCnt;

            string sPath = LOT_FOLDER + _sDate + "\\" + _sLotId + ".ini";

            DirectoryInfo Info      = new DirectoryInfo(sPath);
            int           FileCount = Info.GetFiles().Length;



            //작업 메거진 카운트 갱신.
            CIniFile IniLoadMgz = new CIniFile(sPath);

            IniLoadMgz.Load("ETC", "MgzCnt", out iMgzCnt);
            IniLoadMgz.Load("ETC", "SlotCnt", out iSlotCnt);

            iMgzCnt  = _lvMgz.Items.Count;
            iSlotCnt = _lvSlot.Items.Count;

            for (int m = 0; m < iMgzCnt; m++)
            {
                _lvMgz.Items[m].SubItems[0].Text = m.ToString();
                _lvMgz.Items[m].SubItems[1].Text = m.ToString();
            }

            for (int s = 0; s < iSlotCnt; s++)
            {
                _lvSlot.Items[s].SubItems[0].Text = s.ToString();
                _lvSlot.Items[s].SubItems[1].Text = s.ToString();
            }
        }
예제 #18
0
        public static void Save(string _sJobName)
        {
            string sExeFolder  = System.AppDomain.CurrentDomain.BaseDirectory;
            string sDevicePath = sExeFolder + "JobFile\\" + _sJobName + "\\MotrPstn.ini";
            string sCommonPath = sExeFolder + "Util\\CommonPstn.ini";

            CIniFile IniDevice = new CIniFile(sDevicePath);
            CIniFile IniCommon = new CIniFile(sCommonPath);

            string sSection;

            //Save Device.
            for (int m = 0; m < m_iMaxMotr; m++)
            {
                //Set Dir.
                sSection = "Motor" + m.ToString();
                for (int i = 0; i < MotrPstn[m].PstnValue.Length; i++)
                {
                    if (MotrPstn[m].PstnValue[i].bCommon)
                    {
                        IniCommon.Save(sSection, MotrPstn[m].PstnValue[i].sName, MotrPstn[m].PstnValue[i].dValue);
                    }
                    else
                    {
                        IniDevice.Save(sSection, MotrPstn[m].PstnValue[i].sName, MotrPstn[m].PstnValue[i].dValue);
                    }
                }
            }
        }
예제 #19
0
        public bool LoadSave(bool _bLoad)
        {
            CConfig Config = new CConfig();

            string sSelLan;
            string sErrNo;


            switch (m_eLangSel)
            {
            default: sSelLan = "E_"; break;

            case EN_LAN_SEL.English: sSelLan = "E_"; break;

            case EN_LAN_SEL.Korean: sSelLan = "K_"; break;

            case EN_LAN_SEL.Chinese: sSelLan = "C_"; break;
            }


            if (_bLoad)
            {
                CIniFile ErrorConfig = new CIniFile(m_sParaFolderPath + "Error.ini");

                for (int i = 0; i < m_iMaxErr; i++)
                {
                    sErrNo = string.Format("ERR({0:000})", i);
                    ErrorConfig.Load("sEnum", sErrNo, out m_aErr[i].Para.sEnum);
                    ErrorConfig.Load(sSelLan + "sName", sErrNo, out m_aErr[i].Para.sName);
                    ErrorConfig.Load(sSelLan + "sAction", sErrNo, out m_aErr[i].Para.sAction);
                    ErrorConfig.Load("sImgPath", sErrNo, out m_aErr[i].Para.sImgPath);


                    ErrorConfig.Load("dRectLeft  ", sErrNo, out m_aErr[i].Para.dRectLeft);
                    ErrorConfig.Load("dRectTop   ", sErrNo, out m_aErr[i].Para.dRectTop);
                    ErrorConfig.Load("dRectWidth ", sErrNo, out m_aErr[i].Para.dRectWidth);
                    ErrorConfig.Load("dRectHeight", sErrNo, out m_aErr[i].Para.dRectHeight);
                }
            }
            else
            {
                CIniFile ErrorConfig = new CIniFile(m_sParaFolderPath + "Error.ini");

                for (int i = 0; i < m_iMaxErr; i++)
                {
                    sErrNo = string.Format("ERR({0:000})", i);
                    ErrorConfig.Save("sEnum", sErrNo, m_aErr[i].Para.sEnum);
                    ErrorConfig.Save(sSelLan + "sName", sErrNo, m_aErr[i].Para.sName);
                    ErrorConfig.Save(sSelLan + "sAction", sErrNo, m_aErr[i].Para.sAction);
                    ErrorConfig.Save("sImgPath", sErrNo, m_aErr[i].Para.sImgPath);


                    ErrorConfig.Save("dRectLeft  ", sErrNo, m_aErr[i].Para.dRectLeft);
                    ErrorConfig.Save("dRectTop   ", sErrNo, m_aErr[i].Para.dRectTop);
                    ErrorConfig.Save("dRectWidth ", sErrNo, m_aErr[i].Para.dRectWidth);
                    ErrorConfig.Save("dRectHeight", sErrNo, m_aErr[i].Para.dRectHeight);
                }
            }
            return(true);
        }
        /// <summary>
        /// 启动初始化
        /// </summary>
        private void StartupInit()
        {
            //---初始化MCU列表
            //this.defaultCMcuFunc.mMcuInfoParam.McuListInfo(this.comboBox_ChipType);
            this.defaultCMcuFunc.McuListInfo(this.comboBox_ChipType);
            //---自动从ini文件中加载配置信息
            CIniFile ini = new CIniFile(Application.StartupPath + @"\Config.ini");

            if (ini.mPathExists)
            {
                NameValueCollection values = null;
                //---设备ID信息
                ini.CIniFileReadSectionValues("ChipID", ref values);
                if ((values != null) && (values.Count > 0))
                {
                    this.comboBox_ChipType.SelectedIndex = Convert.ToInt32(values.GetValues(0)[0]);
                }
            }
            //---初始化MCU类型
            this.McuTypeChanged(this.comboBox_ChipType.Text.ToLower());
            //---初始化通信端口
            this.cCommBaseControl_ChipCOMM.Init(this.defaultCComm, this.cRichTextBoxEx_ChipMsg);
            //---初始化版本信息
            this.toolStripLabel_Version.Text = this.defaultCMcuFunc.mSoftwareVersion[0].ToString("X2") + "-" + this.defaultCMcuFunc.mSoftwareVersion[1].ToString("X2") + "-" +
                                               this.defaultCMcuFunc.mSoftwareVersion[2].ToString("X2") + "-" + this.defaultCMcuFunc.mSoftwareVersion[3].ToString("X2");
            //--- 初始化当前系统时间
            this.toolStripLabel_ChipRTCTimer.Text = DateTime.Now.ToString();
            //---事件注册
            this.RegistrationEventHandler();
            //---刷新功能选择项
            this.defaultCMcuFunc.mMcuInfoParam.mChipFuncMask1 = this.defaultCMcuFunc.mMcuInfoParam.SetFuncMaskCheckedListBox(this.cCheckedListBoxEx_FuncMaskStep1, this.defaultCMcuFunc.mMcuInfoParam.mChipFuncMask1);
            this.defaultCMcuFunc.mMcuInfoParam.mChipFuncMask2 = this.defaultCMcuFunc.mMcuInfoParam.SetFuncMaskCheckedListBox(this.cCheckedListBoxEx_FuncMaskStep2, this.defaultCMcuFunc.mMcuInfoParam.mChipFuncMask2);
        }
예제 #21
0
 private void SaveIniFile()
 {
     _ip   = txtSerIP.Text;
     _port = System.Convert.ToInt32(txtSerPort.Text);
     CIniFile.WriteToIni("ToolDebug", "Telnet_IP", _ip, iniFile);
     CIniFile.WriteToIni("ToolDebug", "Telnet_Port", _port.ToString(), iniFile);
 }
 /// <summary>
 /// MCU的类型变换
 /// </summary>
 /// <param name="chipName"></param>
 private void McuTypeChanged(string chipName, bool isAutoConfig = true)
 {
     //---初始化芯片信息
     //this.defaultCMcuFunc.mMcuInfoParam.McuTypeInfo(chipName, this.comboBox_ChipInterface,this.textBox_ChipID);
     this.defaultCMcuFunc.McuTypeInfo(chipName, this.comboBox_ChipInterface, this.textBox_ChipID);
     //---校验是否需要自动加载配置文件
     if (isAutoConfig)
     {
         //---自动从ini文件中加载配置信息
         CIniFile ini = new CIniFile(Application.StartupPath + @"\Config.ini");
         if (ini.mPathExists)
         {
             NameValueCollection values = null;
             //---设备接口信息
             ini.CIniFileReadSectionValues("Interface", ref values);
             if ((values != null) && (values.Count > 0))
             {
                 this.comboBox_ChipInterface.SelectedIndex = Convert.ToInt32(values.GetValues(0)[0]);
             }
         }
     }
     //---依据芯片的类型进行控件的初始化
     this.cMcuFormAVR8BitsFuseAndLockControl_ChipFuse.Init(this.defaultCMcuFunc, this.cRichTextBoxEx_ChipMsg);
     //-->>>依据芯片进行Memery的信息初始化---开始
     //---初始化Flash信息
     this.cHexBox_Flash.AddData(this.defaultCMcuFunc.mMcuInfoParam.mChipFlashByteSize);
     //---初始化Eeprom信息
     this.cHexBox_Eeprom.AddData(this.defaultCMcuFunc.mMcuInfoParam.mChipEepromByteSize);
     //---初始化ROM信息
     this.cHexBox_ROM.AddData(this.defaultCMcuFunc.mMcuInfoParam.mChipFlashPerPageByteNum);
     //--<<<依据芯片进行Memery的信息初始化---结束
     this.label_EepromSize.Text = "0/" + this.defaultCMcuFunc.mMcuInfoParam.mChipEepromByteSize.ToString();
     this.label_FlashSize.Text  = "0/" + this.defaultCMcuFunc.mMcuInfoParam.mChipFlashByteSize.ToString();
 }
예제 #23
0
파일: Pattern.cs 프로젝트: zoro-008/Works
        public void SavePat(string _sFileName)
        {
            string sPath, sNum;
            int    iNum;

            sPath = _sFileName;

            CIniFile IniPattern = new CIniFile(sPath);

            for (iNum = 0; iNum < MAX_HGHT_CMD; iNum++)
            {
                sNum = iNum.ToString();

                IniPattern.Save("PatternPara", "m_dHghtXPos" + sNum, HghtPos[iNum].dPosX);
                IniPattern.Save("PatternPara", "m_dHghtYPos" + sNum, HghtPos[iNum].dPosY);
                IniPattern.Save("PatternPara", "m_dHghtZPos" + sNum, HghtPos[iNum].dPosZ);
            }

            IniPattern.Save("PatternPara", "m_dXScale", m_dXScale);
            IniPattern.Save("PatternPara", "m_dYScale", m_dYScale);

            IniPattern.Save("PatternPara", "m_dXSttOffset", m_dXSttOffset);
            IniPattern.Save("PatternPara", "m_dYSttOffset", m_dYSttOffset);

            IniPattern.Save("PatternPara", "m_dSpeed", m_dSpeed);
            IniPattern.Save("PatternPara", "m_iHghtPosCnt", m_iHghtPosCnt);


            IniPattern.Save("PatternPara", "m_dAcc", m_dAcc);
            IniPattern.Save("PatternPara", "m_dDec", m_dDec);
        }
예제 #24
0
        public void Load()
        {
            //Set Dir.
            //ERR_FOLDER    ;
            string sExeFolder = System.AppDomain.CurrentDomain.BaseDirectory;
            string sFileName  = string.Format("ComPort_{0:0}", iPortNo);


            string sSerialPath = sExeFolder + sFileName + ".ini";

            string sTitle = string.Format("ComPort_{0:0}", iPortNo);

            CIniFile IniSerialInfo = new CIniFile(sSerialPath);

            IniSerialInfo.Load(sTitle, "PortNo   ", out iPortNo);
            IniSerialInfo.Load(sTitle, "PortName ", out sPortName);
            IniSerialInfo.Load(sTitle, "BaudRate ", out iBaudRate);
            IniSerialInfo.Load(sTitle, "DataBit  ", out iDataBit);
            IniSerialInfo.Load(sTitle, "ParityBit", out iParityBit);
            IniSerialInfo.Load(sTitle, "StopBit  ", out iStopBit);

            //IniSerialInfo.Save(sTitle, "PortNo   ", iPortNo);
            //IniSerialInfo.Save(sTitle, "PortName ", sPortName);
            //IniSerialInfo.Save(sTitle, "BaudRate ", iBaudRate);
            //IniSerialInfo.Save(sTitle, "DataBit  ", iDataBit);
            //IniSerialInfo.Save(sTitle, "ParityBit", iParityBit);
            //IniSerialInfo.Save(sTitle, "StopBit  ", iStopBit);
        }
예제 #25
0
        private void SaveJobFile(string _sDevice)
        {
            string   sCommandPath   = "C:\\Data\\VisnJobChange.ini";
            CIniFile IniCommandSave = new CIniFile(sCommandPath);

            IniCommandSave.Save("JobChange", "Device", OM.GetCrntDev());
        }
예제 #26
0
파일: CKunX.cs 프로젝트: axinken/MyProject
        private void SaveTestData()
        {
            try
            {
                string fileFolder = CIniFile.ReadFromIni("Parameter", "fileFolder", iniFile);

                string fileName = string.Empty;

                string iRet = string.Empty;

                if (orderName != string.Empty)
                {
                    iRet = mesService.SaveTestData2(orderName, serialNo, result, details, fileName);
                }
                else
                {
                    iRet = mesService.SaveTestData(serialNo, result, details, fileName);
                }

                if (iRet != "OK")
                {
                    errCode = "调用上传接口错误";
                    bFlag   = false;
                    return;
                }
                errCode = string.Empty;
                bFlag   = true;
            }
            catch (Exception ex)
            {
                errCode = ex.ToString();
                bFlag   = false;
            }
        }
예제 #27
0
 private void LoadIniPara()
 {
     clientIP   = CIniFile.ReadFromIni("ToolDebug", "Socket_SerIP", iniFile, "127.0.0.1");
     tcpPort    = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Socket_SerPort", iniFile, "8000"));
     clientIP   = CIniFile.ReadFromIni("ToolDebug", "Socket_clientIP", iniFile, "127.0.0.1");
     clientPort = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Socket_clientPort", iniFile, "8000"));
 }
예제 #28
0
        private int parseTextListDefinition(CIniFile config, string[] separators, string[] lines, List <string> separeted_string, int startLineIdx)
        {
            string[]        multitext_line = null, line_with_id = null;
            string          multitext_name = null, line_without_id = null;
            List <string[]> multitext_lines = new List <string[]>();
            List <int>      Idxs            = new List <int>();
            int             position;
            int             id;

            multitext_name = separeted_string[1];

            for (int i = startLineIdx + 1; i < lines.Length; i++)
            {
                if (lines[i].Length == 0)
                {
                    TextlistDefinition.Add(config, multitext_name, multitext_lines, Idxs);
                    return(i);
                }
                else
                {
                    line_with_id = lines[i].Split(separators, StringSplitOptions.RemoveEmptyEntries);
                    if (int.TryParse(line_with_id[0], out id) == true)
                    {
                        Idxs.Add(id);
                        position        = lines[i].IndexOf(';');
                        line_without_id = lines[i].Substring(position + 1); // Because of spliting this string. Before semicolon is first index
                        multitext_line  = line_without_id.Split(Const.separ_semicolon, StringSplitOptions.RemoveEmptyEntries);
                        multitext_lines.Add(multitext_line);
                    }
                }
            }
            return(0);
        }
예제 #29
0
파일: FrmYield.cs 프로젝트: GJSoftware/Tool
        private void btnLoadCSV_Click(object sender, EventArgs e)
        {
            try
            {
                btnLoadCSV.Enabled = false;

                string fileDirectry = string.Empty;

                OpenFileDialog openFiledlg = new OpenFileDialog();

                openFiledlg.InitialDirectory = Application.StartupPath + "\\BURNIN";

                openFiledlg.Filter = "csv files (*.csv)|*.csv";

                if (openFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                txtCSV.Text = openFiledlg.FileName;

                CIniFile.WriteToIni("FrmYield", "CSVFile", txtCSV.Text, iniFile);

                LoadPLCCSV(txtCSV.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Tip", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally
            {
                btnLoadCSV.Enabled = true;
            }
        }
예제 #30
0
        private void btnListen_Click(object sender, EventArgs e)
        {
            try
            {
                btnListen.Enabled = false;

                string er = string.Empty;

                tcpPort = System.Convert.ToInt32(txtSerPort.Text);

                if (serTcp == null)
                {
                    if (!LoadXmlPara(xmlFile))
                    {
                        return;
                    }

                    serTcp = new CAPSocket(0, "TCP服务端", packages);

                    serTcp.OnLogArgs.OnEvent += new COnEvent <CAPSocket.CLogArgs> .OnEventHandler(OnSerLog);

                    serTcp.OnCmdArgs.OnEvent += new COnEvent <CAPSocket.CCmdArgs> .OnEventHandler(OnSerCmd);

                    if (!serTcp.Listen(tcpPort, out er))
                    {
                        labSerStatus.Text      = er;
                        labSerStatus.ForeColor = Color.Red;
                        return;
                    }

                    btnListen.Text     = "停止";
                    btnListen.ImageKey = "Connect";
                }
                else
                {
                    serTcp.Close();

                    serTcp.OnLogArgs.OnEvent -= new COnEvent <CAPSocket.CLogArgs> .OnEventHandler(OnSerLog);

                    serTcp.OnCmdArgs.OnEvent -= new COnEvent <CAPSocket.CCmdArgs> .OnEventHandler(OnSerCmd);

                    serTcp = null;

                    btnListen.Text = "监听";

                    btnListen.ImageKey = "DisConnect";
                }

                CIniFile.WriteToIni("ToolDebug", "Socket_SerTcpPort", tcpPort.ToString(), iniFile);
            }
            catch (Exception ex)
            {
                labSerStatus.Text      = ex.ToString();
                labSerStatus.ForeColor = Color.Red;
            }
            finally
            {
                btnListen.Enabled = true;
            }
        }