예제 #1
0
        public override void beginOperation()
        {
            base.beginOperation();
            smartPonds = new SmartPonds(PondSize.SMALL);
            collectTempData();
            collectPHData();
            Console.WriteLine("Average Temp is " + smartPonds.getTempAverage());
            // Console.WriteLine("Average Ph is " + smartPonds.getPhAverage());
            ////call method to collect temparature data
            //collectTempData();
            ////call method to collect Ph data
            //collectPHData();
            ////now display the data
            ////use for loop to print temp data and get temp average
            ////please do remember - temp data may not be sequential
            //double data_total_temp = 0.0,data_total_ph = 0.0;
            //for (int i = 0; i < TOTAL_SENSORS; i++)
            //{
            //    //use for loop to print temp data
            //    if (sensor_data_arr[i].sensor_type == sensortypes.TEMP)
            //    {
            //        Console.WriteLine("Temp data-> id:" + sensor_data_arr[i].sensor_id + "-" + sensor_data_arr[i].sensor_type
            //                        + " Date & time=" + sensor_data_arr[i].date_time + " Temp=" + sensor_data_arr[i].data_value);
            //        data_total_temp += sensor_data_arr[i].data_value;
            //    }


            //}
            ////now we have total of all temp and we can average
            //Console.WriteLine("Average temp is " + (data_total_temp / TOTAL_TEMP_SENSORS));

            //for (int i = 0; i < TOTAL_PH_SENSORS; i++)
            //{
            //    if (sensor_data_arr[i].sensor_type == sensortypes.PH)
            //    {
            //        Console.WriteLine("Ph data-> id:" + sensor_data_arr[i].sensor_id + "-" + sensor_data_arr[i].sensor_type
            //                  + " Date & time=" + sensor_data_arr[i].date_time + " Ph=" + sensor_data_arr[i].data_value);
            //        data_total_ph += sensor_data_arr[i].data_value;
            //    }
            //}
            ////now we have total of all temp and we can average
            //Console.WriteLine("Average ph is " + (data_total_ph / TOTAL_PH_SENSORS));
        }
예제 #2
0
        public override void beginOperation()
        {
            base.beginOperation();
            pond = new SmartPonds(PondSize.SMALL);//need to define size of the pond.
            //call method to collect temparature data
            collectTempData();
            //call method to collect Ph data
            collectPHData();
            //now display the data

            ////now we have total of all temp and we can average
            Console.WriteLine("Average temp is " + pond.getTempAverage());

            //use for loop to print ph data and get average
            //but reset data_total first
            //data_total = 0.0;
            //for (??ki hobe tumi ber koro)
            //{

            //}
        }