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); }
public PipettingUI(double w, double h, int wellsPerLabware, ProgressController prgController) : base(w, h) { this.prgController = prgController; this.wellsPerLabware = wellsPerLabware; runResult = RunResultReader.Read(); //smpInfos = RunResultReader.Read(); pipettingSettings = Utility.LoadPipettingSettings(); layoutInfo = new LayoutInfo(pipettingSettings); }
internal void ExecuteCommand(string sCommand) { sCommand = sCommand.ToLower(); log.Info(sCommand); runResult = RunResultReader.Read(); if (sCommand.Contains("shutdown")) { this.Close(); return; } string[] strs = sCommand.Split(';'); string stage = strs[0]; if (stage == Stage.Measure.ToString().ToLower()) { bool bFinished = bool.Parse(strs[1]); if (bFinished) { workTableUI.FinishedMeasure(); return; } int smpID = int.Parse(strs[2]); bool bGo2MeasurePos = bool.Parse(strs[3]); workTableUI.MoveTube(smpID, bGo2MeasurePos); } else if (stage == Stage.Pipetting.ToString().ToLower()) { if (stageInfo.curStage == Stage.Measure) { InitPipettingUI(); stageInfo.farthestStage = Stage.Pipetting; stageInfo.curStage = Stage.Pipetting; lstSteps.SelectedIndex = 1; workTableUI.CurStage = Stage.Pipetting; } bool bFinished = false; bool isBool = bool.TryParse(strs[1], out bFinished); if (isBool && bFinished) { pipettingUI.FinishedPipetting(); workTableUI.FinishedPipetting(); return; } int rackIndex = int.Parse(strs[1]); int batchIndex = int.Parse(strs[2]); int sliceIndex = int.Parse(strs[3]); pipettingUI.UpdatePipettingProgress(rackIndex, batchIndex, sliceIndex); } }