private static void funSetComPort(clsIniFile IniFile) { //string strSection = string.Empty; //string strKey = string.Empty; //string strValues = string.Empty; //strSection = "Weight Config"; //strKey = "WT_A_2L"; //clsSystem.gstrWT_A_2L = IniFile.funReadValue(strSection, strKey, "COM4"); //strKey = "WT_A_4L"; //clsSystem.gstrWT_A_4L = IniFile.funReadValue(strSection, strKey, "COM5"); }
/// <summary> /// 讀取Ini中SystemConfig區塊相關設定 /// </summary> /// <param name="IniFile">IniFile物件</param> private static void funSetSystemConfig(clsIniFile IniFile) { string strSection = "System Config"; string strKey = string.Empty; string strValues = string.Empty; strKey = "CompressDay"; clsSystem.gintTxtLogCompressDay = IniFile.funReadValue(strSection, strKey, 30); strKey = "DeleteDay"; clsSystem.gintTxtLogDeleteDay = IniFile.funReadValue(strSection, strKey, 180); strKey = "RMQty"; clsSystem.gintRMQty = IniFile.funReadValue(strSection, strKey, 3); }
/// <summary> /// 讀取Ini中PLC區塊相關設定 /// </summary> /// <param name="IniFile">IniFile物件</param> private static void funSetPLC(clsIniFile IniFile) { string strSection = string.Empty; string strKey = string.Empty; strSection = "PLC Info"; #region PLC1---For 遠紡 strKey = "ActLogicalStationNo_1"; clsSystem.gintActLogicalStationNumber_1 = IniFile.funReadValue(strSection, strKey, 1); strKey = "PLC2PCTotalWord_1"; clsSystem.gintPLC2PCTotalWord_1 = IniFile.funReadValue(strSection, strKey, 450); strKey = "PLC2PCBufferTotalWord"; clsSystem.gintPLC2PCBufferTotalWord_1 = IniFile.funReadValue(strSection, strKey, 10); strKey = "PLC2PCWordAddressStart"; clsSystem.gstrPLC2PCWordAddressStart_1 = IniFile.funReadValue(strSection, strKey, "D1000"); strKey = "PC2PLCTotalWord_1"; clsSystem.gintPC2PLCTotalWord_1 = IniFile.funReadValue(strSection, strKey, 450); strKey = "PC2PLCBufferTotalWord"; clsSystem.gintPC2PLCBufferTotalWord_1 = IniFile.funReadValue(strSection, strKey, 10); strKey = "PC2PLCWordAddressStart"; clsSystem.gstrPC2PLCWordAddressStart_1 = IniFile.funReadValue(strSection, strKey, "D3000"); #endregion #region PLC2---For 大立光 strKey = "ActLogicalStationNo_2"; clsSystem.gintActLogicalStationNumber_2 = IniFile.funReadValue(strSection, strKey, 2); strKey = "PLC2PCTotalWord_2"; clsSystem.gintPLC2PCTotalWord_2 = IniFile.funReadValue(strSection, strKey, 723); strKey = "PC2PLCTotalWord_2"; clsSystem.gintPC2PLCTotalWord_2 = IniFile.funReadValue(strSection, strKey, 363); #endregion #region PLC3---For大立光 strKey = "ActLogicalStationNo_3"; clsSystem.gintActLogicalStationNumber_3 = IniFile.funReadValue(strSection, strKey, 3); strKey = "PLC2PCTotalWord_3"; clsSystem.gintPLC2PCTotalWord_3 = IniFile.funReadValue(strSection, strKey, 723); strKey = "PC2PLCTotalWord_3"; clsSystem.gintPC2PLCTotalWord_3 = IniFile.funReadValue(strSection, strKey, 363); #endregion strKey = "BufferQty"; clsSystem.gintBufferQty_1 = IniFile.funReadValue(strSection, strKey, 72); strKey = "StnQty"; clsSystem.gintStnQty = IniFile.funReadValue(strSection, strKey, 10); }
/// <summary> /// 讀取Ini中Data Base區塊相關設定 /// </summary> /// <param name="IniFile">IniFile物件</param> private static void funSetDB(clsIniFile IniFile) { string strSection = string.Empty; string strKey = string.Empty; string strValues = string.Empty; strSection = "Data Base"; strKey = "DBMS"; strValues = IniFile.funReadValue(strSection, strKey, "MSSQL"); clsSystem.gobjDB.DBType = clsTool.funGetEnumValue <DB.enuDatabaseType>(strValues); strKey = "DbServer"; clsSystem.gobjDB.DBServer = IniFile.funReadValue(strSection, strKey, "."); strKey = "FODbServer"; clsSystem.gobjDB.FODBServer = IniFile.funReadValue(strSection, strKey, "."); strKey = "DataBase"; clsSystem.gobjDB.DBName = IniFile.funReadValue(strSection, strKey, ""); strKey = "DbUser"; clsSystem.gobjDB.DBUser = IniFile.funReadValue(strSection, strKey, ""); strKey = "DbPswd"; clsSystem.gobjDB.DBPassword = IniFile.funReadValue(strSection, strKey, ""); }
private static void funSetRepairLoc(clsIniFile IniFile) { string strSection = string.Empty; string strKey = string.Empty; string strValues = string.Empty; strSection = "RepairLoc"; strKey = "COUNT"; clsSystem.gintRepairLocCount = IniFile.funReadValue(strSection, strKey, 6); strKey = "RepairLoc1"; clsSystem.gstrRepairLoc1 = IniFile.funReadValue(strSection, strKey, "010203"); strKey = "RepairLoc2"; clsSystem.gstrRepairLoc2 = IniFile.funReadValue(strSection, strKey, "020203"); strKey = "RepairLoc3"; clsSystem.gstrRepairLoc3 = IniFile.funReadValue(strSection, strKey, "050203"); strKey = "RepairLoc4"; clsSystem.gstrRepairLoc4 = IniFile.funReadValue(strSection, strKey, "060203"); strKey = "RepairLoc5"; clsSystem.gstrRepairLoc5 = IniFile.funReadValue(strSection, strKey, "090203"); strKey = "RepairLoc6"; clsSystem.gstrRepairLoc6 = IniFile.funReadValue(strSection, strKey, "100203"); }