Exemple #1
0
        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);
        }
Exemple #2
0
        public void getAllSensorsByDate(string date)
        {
            ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient();
            String xml = client.GetValuesByDate(date);

            populateCharts(xml);
        }
Exemple #3
0
        public void getAllSensorsByDateHour(string date, string hour)
        {
            ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient();
            String xml = client.GetValuesByDateAndHour(date, hour);

            populateCharts(xml);
        }
Exemple #4
0
        public void getAllInfoSensors()
        {
            ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient();
            String xml = client.GetAllValues();

            populateCharts(xml);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        private void getAllAlarmsByDate(string date)
        {
            ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient();
            string xml = client.GetAlarmsByDate(date);

            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);
        }
Exemple #7
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            ServiceH2O.ServiceLogClient client = new ServiceH2O.ServiceLogClient();
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                getAllInfoSensors();
                break;

            case 1:
                if (timePicker1.Text.Length < 5 || datePicker1.Text.Length < 5)
                {
                    MessageBox.Show("Error");
                    return;
                }
                getAllSensorsByDateHour(datePicker1.Value.ToString("dd/MM/yyyy"), timePicker1.Value.ToString("hh"));
                break;

            case 2:
                if (datePicker1.Text.Length < 5)
                {
                    MessageBox.Show("Error");
                    return;
                }
                getAllSensorsByDate(datePicker1.Value.ToString("dd/MM/yyyy"));
                break;

            case 3:
                if (datePicker2.Text.Length < 5 || datePicker1.Text.Length < 5)
                {
                    MessageBox.Show("Error");
                    return;
                }
                getAllSensorsBetweenDate(datePicker1.Value.ToString("dd/MM/yyyy"), datePicker2.Value.ToString("dd/MM/yyyy"));
                break;
            }
        }