public void SetGraphData(string dataName, List <double> value) { if (GraphData.ContainsKey(dataName)) { GraphData[dataName] = value; } else { GraphData.Add(dataName, value); } chart.Invalidate(); }
public Tracker(Patient patient, string type) { this.Type = type; this.Patient = patient; this.Observations = patient.GetAllObservationsByCodeText(type); Observations.Sort((x, y) => { if (x.Issued == null || y.Issued == null) { return(1); } return(((DateTime)x.Issued).CompareTo((DateTime)y.Issued)); }); this.GraphData = new List <decimal>(); foreach (Observation observation in Observations) { GraphData.Add((decimal)observation.MeasurementResult.Value); } }
void ShowToolInformation() { GraphData.Clear(); int nSelected = nSelectedCount; int nSelectedTool = nSelectedToolNo; int nCurrentPanelCnt = 0; int nCurrentToolCnt = -1; bool saved = false; string[] lines = File.ReadAllLines(OpenedFilePath); string strOldToolName = "empty"; string strToolName = null; int nRefValue = 0; foreach (string lead in lines) { if (lead.Contains("Project")) { saved = false; if (nSelected == nCurrentPanelCnt) { saved = true; } nCurrentPanelCnt++; continue; } if (lead.Contains("-> Value")) { continue; } if (saved) { string tooltag = lead.Split('\t')[0]; string toolname = tooltag.Split(' ')[tooltag.Split(' ').Length - 2] + " " + tooltag.Split(' ')[tooltag.Split(' ').Length - 1]; if (strOldToolName == "empty" || strOldToolName != toolname) { nCurrentToolCnt++; strOldToolName = toolname; } if (nCurrentToolCnt == nSelectedTool) { string strRefValue = lead.Split(' ')[lead.Split(' ').Length - 1]; string strvalue = lead.Split('\t')[lead.Split('\t').Length - 2]; strvalue = strvalue.Replace("Value ", ""); GraphData.Add(Convert.ToInt32(strvalue)); nRefValue = Convert.ToInt32(strRefValue); strToolName = toolname; } else { continue; } } } if (strToolName != null) { ShowGraphData(strToolName, nRefValue); } }