Exemplo n.º 1
0
 //Draw actor
 public void DrawActor(string mac)
 {
     try
     {
         Database myDatabase = new Database();
         Bitmap icon_true;
         Bitmap icon_false;
         int pixel_x = Convert.ToInt32(myDatabase.getActorPixel_x(mac));
         int pixel_y = Convert.ToInt32(myDatabase.getActorPixel_y(mac));
         icon_true = new Bitmap(path_icon_actor_true);
         icon_false = new Bitmap(path_icon_actor_false);
         string status = myDatabase.getStatusActor(mac);
         if (status == "true" || status == "True")
         {
             gr.DrawImage(icon_true, pixel_x, pixel_y);
         }
         else
         {
             gr.DrawImage(icon_false, pixel_x, pixel_y);
         }
         gr.DrawString(mac, draw_font, draw_brush, pixel_x, pixel_y);
     }
     catch
     {
     }
 }
 private void cbmac_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Database my_Database = new Database();
         int index = cbSelectNode.SelectedIndex;
         if (index == 0)
         {
             if (rbDeleteNode.Checked == true || rdeditnode.Checked == true)
             {
                 string macSensor = cbmac.Text;
                 tbLatitude.Text = my_Database.getSensorPixel_x(macSensor).ToString();
                 tbLongitude.Text = my_Database.getSensorPixel_y(macSensor).ToString();
                 tbActor.Text = my_Database.getVanSensor(macSensor);
             }
         }
         else
         {
             string macActor = cbmac.Text;
             tbLatitude.Text = my_Database.getActorPixel_x(macActor).ToString();
             tbLongitude.Text = my_Database.getActorPixel_y(macActor).ToString();
         }
     }
     catch { }
 }