/// <summary> /// 讀取Ini中System Config區塊相關設定 /// </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); }
/// <summary> /// 讀取Ini中BCR Config區塊相關設定 /// </summary> /// <param name="IniFile"></param> private static void funSetBCR(clsIniFile IniFile) { string strSection = "BCR Config"; string strKey = string.Empty; string strValues = string.Empty; strKey = clsSystem.cstrStnNo + "_L"; clsSystem.gstrLeftBCRPortName = IniFile.funReadValue(strSection, strKey, ""); strKey = clsSystem.cstrStnNo + "_R"; clsSystem.gstrRightBCRPortName = IniFile.funReadValue(strSection, strKey, ""); }
/// <summary> /// 讀取Ini中Weight Config區塊相關設定 /// </summary> /// <param name="IniFile"></param> private static void funSetWT(clsIniFile IniFile) { string strSection = "WT Config"; string strKey = string.Empty; string strValues = string.Empty; strKey = "WTQty"; clsSystem.gintWTQty = IniFile.funReadValue(strSection, strKey, 3); strKey = "WTID"; clsSystem.gstrarrWTID = IniFile.funReadValue(strSection, strKey, "").Split(','); strKey = "WTPort"; clsSystem.gstrarrWTPortName = IniFile.funReadValue(strSection, strKey, "").Split(','); for (int intCount = 0; intCount < clsSystem.gintWTQty; intCount++) { clsWTSerialPort WTSerialPort = new clsWTSerialPort(clsSystem.gstrarrWTID[intCount], clsSystem.gstrarrWTPortName[intCount]); clsSystem.glstWTMap.Add(WTSerialPort); } }
/// <summary> /// 讀取Ini中BCR Config區塊相關設定 /// </summary> /// <param name="IniFile"></param> private static void funSetBCR(clsIniFile IniFile) { string strSection = "BCR Config"; string strKey = string.Empty; string strValues = string.Empty; strKey = "BCRQty"; clsSystem.gintBCRQty = IniFile.funReadValue(strSection, strKey, 8); strKey = "BCRID"; clsSystem.gstrarrBCRID = IniFile.funReadValue(strSection, strKey, "").Split(','); strKey = "BCRPort"; clsSystem.gstrarrPortName = IniFile.funReadValue(strSection, strKey, "").Split(','); for (int intCount = 0; intCount < clsSystem.gintBCRQty; intCount++) { clsCustomSerialPort CustomSerialPort = new clsCustomSerialPort(clsSystem.gstrarrBCRID[intCount], clsSystem.gstrarrPortName[intCount]); clsSystem.glstBCRMap.Add(CustomSerialPort); } }
/// <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 = 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, ""); }