private void getAllAlarmsBetweenDate(string date1, string date2) { ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient(); ChartModule chartModule = new ChartModule(); string xml = client.GetAlarmsBetweenDate(chartModule.ConvertToUnixTimestamp(date1, false), chartModule.ConvertToUnixTimestamp(date2, true)); Console.WriteLine(chartModule.ConvertToUnixTimestamp(date2, true) + "ola"); Console.WriteLine(chartModule.ConvertToUnixTimestamp(date1, false) + "adeuas"); XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNodeList xmlnodeList = doc.SelectNodes("/Alarms/Sensor"); if (xmlnodeList.Count < 1) { MessageBox.Show("Info not available"); return; } populateListAlarms(xmlnodeList); }
private void populateCharts(String xml) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNodeList listPH = doc.SelectNodes("/Sensors/Sensor[Name='PH']"); XmlNodeList listCI2 = doc.SelectNodes("/Sensors/Sensor[Name='CI2']"); XmlNodeList listNH3 = doc.SelectNodes("/Sensors/Sensor[Name='NH3']"); if (listPH.Count < 1 || listCI2.Count < 1 || listNH3.Count < 1) { MessageBox.Show("Info not available"); return; } ChartModule chartModule = new ChartModule(); chartModule.drawChart(phChart1, listPH); chartModule.drawChart(ciChart2, listCI2); chartModule.drawChart(nh3Chart1, listNH3); chartModule.populateInfo(listPH, labelMinPh, labelMaxPh, labelAveragePh); chartModule.populateInfo(listCI2, labelMinCI2, labelMaxCI2, label5); chartModule.populateInfo(listNH3, labelMinNH3, labelMaxNH3, labelAvgNH3); }
public void getAllSensorsBetweenDate(string date1, string date2) { ChartModule chartModule = new ChartModule(); ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient(); String xml = client.GetValuesBetweenDate(chartModule.ConvertToUnixTimestamp(date1, false), chartModule.ConvertToUnixTimestamp(date2, true)); populateCharts(xml); }