Ejemplo n.º 1
0
 public static DataTable fillData(DataTable filltable, Sensor[] sensObj)
 {
     int count = 0;
     foreach (Sensor element in sensObj)
     {
       
         DataRow row = filltable.NewRow();
         row["sensorID"] = sensObj[count].GetSensId;
         row["timeStamp"] = DateTime.Now.ToString("HH:mm:sss", new System.Globalization.CultureInfo("en-GB"));
         row["sensorType"] = sensObj[count].getSensType();
         row["sensorValue"] = sensObj[count].GetValue();
         filltable.Rows.Add(row);
         count++;
     }
     return filltable;
 }
Ejemplo n.º 2
0
 public static Sensor[] createSensors()
 {
     Sensor[] senObj = new Sensor[nSen];
     if (nAna != 0 && nDig != 0)
     {
         
         for (int i = 0; i < nAna; i++)
         {
             senObj[i] = new anaSensor();
         }
         for (int j = nAna; j < nAna + nDig; j++)
         {
             senObj[j] = new digSensor();
         }
     }
     return senObj;
 }