public DataService(EnvironmentConfig enviConfig, LotInfo LotInfo, Recipe Recipe = null, string subcon = "") { lotInfo = LotInfo; lotInfo.SETUP_T = DateTime.Now; lotInfo.START_T = DateTime.Now; transferMode = enviConfig.TransferMode; ftpUpload = new FtpWeb(enviConfig.ServerDataIP.IP, string.Empty, enviConfig.ServerDataIP.User, enviConfig.ServerDataIP.Password); if (subcon == "JCET" && Recipe != null) { string tc = ConvertTestCode(lotInfo.TestCode.ToString(), Recipe.TestCodeConvertConfiguration.dictTestCode); string prefixDir = ApplyNameRule(Recipe.DatalogConfiguration.datalog_name_rule_1, subcon, tc); string prefixDirLocal = enviConfig.LocalDlogDir + prefixDir; string csvDirLocal = prefixDirLocal + "\\csvdir\\"; CreateLocalDir(csvDirLocal); string singlefileDirLocal = prefixDirLocal + "\\SingleFile\\"; CreateLocalDir(singlefileDirLocal); string fulllotfileDirLocal = prefixDirLocal + "\\FullLotFile\\"; CreateLocalDir(fulllotfileDirLocal); string stdtxtDirLocal = prefixDirLocal + "\\STD_TXT\\"; CreateLocalDir(stdtxtDirLocal); CreateServerDir(enviConfig.ServerDlogDir, prefixDir); string logname = ApplyNameRule(Recipe.DatalogConfiguration.datalog_name_rule_2, subcon, tc); stdfPath = singlefileDirLocal + logname + ".stdf"; csvPath = csvDirLocal + logname + ".csv"; configPath = csvDirLocal + lotInfo.ModeCode.ToString() + "_" + lotInfo.TesterID.ToString() + "_config.txt"; htmlPath = fulllotfileDirLocal + logname + "_" + lotInfo.ModeCode.ToString() + ".html"; csvsumPath = fulllotfileDirLocal + logname + "_" + lotInfo.ModeCode.ToString() + ".csv"; mtcsvPath = singlefileDirLocal + logname + ".csv"; } else { string dirLocal = Path.Combine(enviConfig.LocalDlogDir, lotInfo.ProgramName.ToString()); CreateLocalDir(dirLocal); string dirLocalFullLot = Path.Combine(dirLocal, "FullLot"); CreateLocalDir(dirLocalFullLot); string logname = lotInfo.ProgramName.ToString() + "_" + lotInfo.SubLotNo.ToString() + "_" + lotInfo.TestCode.ToString() + "_" + string.Format("{0:yyyyMMddHHmmss}", lotInfo.START_T); string logname_sum = lotInfo.ProgramName.ToString() + "_" + lotInfo.SubLotNo.ToString() + "_" + lotInfo.TestCode.ToString() + "_SUM_" + string.Format("{0:yyyyMMddHHmmss}", lotInfo.START_T); stdfPath = Path.Combine(dirLocal, logname + ".stdf"); mtcsvPath = Path.Combine(dirLocal, logname + ".csv"); csvPath = Path.Combine(dirLocal, logname_sum + ".csv"); configPath = Path.Combine(dirLocal, lotInfo.TesterID.ToString() + "_sum_history.txt"); htmlPath = Path.Combine(dirLocalFullLot, logname + ".html"); csvsumPath = Path.Combine(dirLocalFullLot, logname + ".csv"); } stdfService = new STDFService(stdfPath); }
public UIService() { try { enviConfig = GetEnviConfig(); } catch { throw new FileLoadException(string.Format("Invalid environment config file '{0}', please contact the developer!", FileStructure.ENVIRONMENT_CONFIG_FILE_PATH)); } uiLogPath = Path.Combine(enviConfig.ProductionWorkspace, "UILog", string.Format("{0:yyyyMMddHHmmss}", DateTime.Now) + ".log"); CreateDir(Path.GetDirectoryName(uiLogPath)); ftpDownload = new FtpWeb(enviConfig.ServerProgIP.IP, string.Empty, enviConfig.ServerProgIP.User, enviConfig.ServerProgIP.Password); }