public MonitorWindow() { log.Info("Monitorwindow"); InitializeComponent(); try { lblVersion.Content = Monitor.Properties.stringRes.version; lstSteps.DataContext = stepViewModel.StepsModel; CreateNamedPipeServer(); string sLabwareSettingFileName = Helper.GetExeFolder() + "\\labwareSettings.xml"; if (!File.Exists(sLabwareSettingFileName)) { MessageBox.Show("LabwareSettings xml does not exist! at : " + sLabwareSettingFileName); return; } string s = File.ReadAllText(sLabwareSettingFileName); labwareSettings = Utility.Deserialize <LabwareSettings>(s); runResult = RunResultReader.Read(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } this.Loaded += new RoutedEventHandler(MainWindow_Loaded); this.Closing += new System.ComponentModel.CancelEventHandler(MonitorWindow_Closing); }
//const string plasmaName = "Plasma"; //const string redCellName = "RedCell"; public BarcodeTracker(PipettingSettings pipettingSettings,LabwareSettings labwareSettings,List<PatientInfo> patientInfos) { this.patientInfos = patientInfos; this.pipettingSettings = pipettingSettings; ExcelReader excelReader = new ExcelReader(); correspondingbarcodes = excelReader.ReadBarcodes(labwareSettings, pipettingSettings, barcode_plateBarcodes, barcode_Position); if(patientInfos.Count > correspondingbarcodes.Count) { throw new Exception("source barcodes' count > dest barcodes' count"); } }
public List<List<string>> ReadBarcodes(LabwareSettings labwareSettings, PipettingSettings pipettingSettings, Dictionary<string, string> barcode_plateBarcode, Dictionary<string,string> barcode_Position) { startIndex = 0; this.labwareSettings = labwareSettings; this.pipettingSettings = pipettingSettings; string sFolder = GlobalVars.Instance.DstBarcodeFolder; var di = new DirectoryInfo(sFolder); var files = di.EnumerateFiles("*.csv").ToList(); files = files.OrderBy(x => x.CreationTime).ToList(); List<List<string>> correspondingbarcodes = new List<List<string>>(); files.ForEach(x => ReadBarcode(correspondingbarcodes, barcode_plateBarcode,barcode_Position, x.FullName)); return correspondingbarcodes; }
static private void ConfigureToolSettings(string config, string sourcePath) { Dictionary <string, string> currentSettings = new Dictionary <string, string>(); Setting settings = new Setting(); currentSettings = settings.LoadConfigSettings(); if (config.Substring(0, 1) == "b") { currentSettings["2DBarcodeVendor"] = "baiquan"; } currentSettings["reportPath"] = sourcePath + "\\ProjectTest\\depends\\biobanking\\data" + config.Substring(10, 2) + ".txt"; //currentSettings["reportPath"] = @"C:\biobanking\data" + config.Substring(10, 2) + ".txt"; settings.SaveConfigSettings(currentSettings); string sLabwareSettingFileName = sourcePath + "\\Biobanking\\bin\\Debug\\labwareSettings.xml"; //string sLabwareSettingFileName = "E:\\projects\\biobanking\\trunk\\Biobanking\\bin\\Debug\\labwareSettings.xml"; string s = File.ReadAllText(sLabwareSettingFileName); LabwareSettings labwareSettings = new LabwareSettings(); labwareSettings = Utility.Deserialize <LabwareSettings>(s); currentSettings = settings.GetSetting(labwareSettings); currentSettings["tipCount"] = config.Substring(1, 1); settings.SetSetting(labwareSettings, currentSettings); Utility.SaveSettings(labwareSettings, sLabwareSettingFileName); string sPipettingFileName = sourcePath + "\\Biobanking\\bin\\Debug\\pipettingSettings.xml"; s = File.ReadAllText(sPipettingFileName); PipettingSettings pipettingSettings = new PipettingSettings(); pipettingSettings = Utility.Deserialize <PipettingSettings>(s); currentSettings = settings.GetSetting(pipettingSettings); currentSettings["dstPlasmaSlice"] = config.Substring(2, 1); currentSettings["dstbuffySlice"] = config.Substring(3, 1); currentSettings["buffyVolume"] = config.Substring(4, 3); currentSettings["plasmaGreedyVolume"] = config.Substring(7, 3); currentSettings["buffyStandalone"] = Convert.ToBoolean(Convert.ToInt16(config.Substring(12, 1))) ? "True" : "False"; settings.SetSetting(pipettingSettings, currentSettings); Utility.SaveSettings(pipettingSettings, sPipettingFileName); }
public Dictionary <string, string> Load(bool isConfigSettings, bool isLabwareSettings, bool isPipettingSettings) { if (isConfigSettings) { return(LoadConfigSettings()); } string s = File.ReadAllText(sPipettingFileName); pipettingSettings = Utility.Deserialize <PipettingSettings>(s); s = File.ReadAllText(sLabwareSettingFileName); labwareSettings = Utility.Deserialize <LabwareSettings>(s); if (isLabwareSettings) { return(GetSetting(labwareSettings)); } if (isPipettingSettings) { return(GetSetting(pipettingSettings)); } throw new Exception("不支持的设置!"); }
public MainWindow() { InitializeComponent(); sLabwareSettingFileName = xmlFolder + "\\labwareSettings.xml"; sPipettingFileName = xmlFolder + "\\pipettingSettings.xml"; //sTubeSettingsFileName = xmlFolder + stringRes.tubeSettingFileName; string exePath = Utility.GetExeFolder() + "Biobanking.exe"; Configuration config = ConfigurationManager.OpenExeConfiguration(exePath); maxSampleCount = int.Parse(config.AppSettings.Settings[stringRes.maxSampleCount].Value); string s = ""; plasmaMaxCount = int.Parse(config.AppSettings.Settings["PlasmaMaxCount"].Value); buffyMaxCount = int.Parse(config.AppSettings.Settings["BuffyMaxCount"].Value); if (!File.Exists(sLabwareSettingFileName)) { SetInfo("LabwareSettings xml does not exist! at : " + sLabwareSettingFileName, Colors.Red); return; } if (!File.Exists(sPipettingFileName)) { SetInfo("PipettingSettings xml does not exist! at : " + sPipettingFileName, Colors.Red); return; } try { s = File.ReadAllText(sPipettingFileName); pipettingSettings = Utility.Deserialize<PipettingSettings>(s); s = File.ReadAllText(sLabwareSettingFileName); labwareSettings = Utility.Deserialize<LabwareSettings>(s); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public PositionGenerator(PipettingSettings pSettings, LabwareSettings lSettings, int nSample) { pipettingSettings = pSettings; labwareSettings = lSettings; totalSample = nSample; }