Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     string[] ports = SerialPort.GetPortNames();
     cbxCom.Items.AddRange(ports);
     UART.ReadTimeout = 2000;
     //UART.DataReceived += new SerialDataReceivedEventHandler(data);
     UART.BaudRate       = 115200;
     UART.Parity         = Parity.None;
     UART.StopBits       = StopBits.One;
     timer1.Interval     = 100;
     cbxlevel.Text       = "Low";
     cbxtime.Text        = "None";
     btnback.Enabled     = false;
     btnleft.Enabled     = false;
     btnstop.Enabled     = false;
     btnright.Enabled    = false;
     btnstraight.Enabled = false;
     btnchay.Enabled     = false;
     btndung.Enabled     = false; btndung.BackColor = Color.FromArgb(33, 42, 52);
     cbx_auto.Enabled    = false;
     cbx_man.Enabled     = false;
     cbxlevel.Enabled    = false;
     cbxtime.Enabled     = false;
     P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide(); P6.Hide(); P5.Show();
     P5.BringToFront(); picturemenu.Hide(); //label1.Text = "tuannguyen";
     //t = TestContext.Out;
     //Console.WriteLine("using TextWriter");
 }
Esempio n. 2
0
 public Form1()
 {
     InitializeComponent();
     map = PMap.CreateGraphics();
     string[] ports = SerialPort.GetPortNames();
     cbxCom.Items.AddRange(ports);
     UART.ReadTimeout = 2000;
     //UART.DataReceived += new SerialDataReceivedEventHandler(data);
     UART.BaudRate   = 115200;
     UART.Parity     = Parity.None;
     UART.StopBits   = StopBits.One;
     timer1.Interval = 300; timerForSentCoordinate.Interval = 400;
     //initial state of settings
     cbxLevel.Text    = "Low"; cbxTime.Text = "None";
     btnChay.Enabled  = false;
     btnDung.Enabled  = false; btnDung.BackColor = Color.FromArgb(33, 42, 52);
     btnTime.Enabled  = false; btnTime.BackColor = Color.FromArgb(33, 42, 52);
     chbxAuto.Enabled = false; chbxMan.Enabled = false;
     cbxLevel.Enabled = false; cbxTime.Enabled = false;
     //initial state of controller
     btnback.Enabled     = false; btnleft.Enabled = false;
     btnstop.Enabled     = false; btnright.Enabled = false;
     btnstraight.Enabled = false;
     //initial state of panel
     P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide(); P6.Hide(); P5.Show(); P8.Hide(); PMap.Hide();
     P5.BringToFront(); picturemenu.Hide();
     startX = PMap.Width / 2; startY = PMap.Height / 2;
     //startTmpX = PMap.Width / 2; startTmpY = PMap.Height / 2;
     //label1.Text = "";
 }
Esempio n. 3
0
 private void btnhome_Click(object sender, EventArgs e)
 {
     P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide();
     P5.Show(); P5.BringToFront();
     lbltab.Text             = "Home Page";
     btnConnecting.BackColor = Color.FromArgb(41, 39, 40); btnConnecting.ForeColor = Color.DimGray;
     btnsetting.BackColor    = Color.FromArgb(41, 39, 40); btnsetting.ForeColor = Color.DimGray;
     btncontroller.BackColor = Color.FromArgb(41, 39, 40); btncontroller.ForeColor = Color.DimGray;
     btnstatus.BackColor     = Color.FromArgb(41, 39, 40); btnstatus.ForeColor = Color.DimGray;
     btnhome.BackColor       = Color.FromArgb(41, 39, 70); btnhome.ForeColor = Color.Aquamarine;
 }
Esempio n. 4
0
 private void btnstatus_Click(object sender, EventArgs e)
 {
     P1.Hide(); P2.Hide(); P3.Hide(); P5.Hide();
     P4.Show(); P4.BringToFront();
     lbltab.Text             = "Status Page";
     btnConnecting.BackColor = Color.FromArgb(41, 39, 40);
     btnsetting.BackColor    = Color.FromArgb(41, 39, 40);
     btncontroller.BackColor = Color.FromArgb(41, 39, 40);
     btnstatus.BackColor     = Color.FromArgb(41, 39, 70);
     btnhome.BackColor       = Color.FromArgb(41, 39, 40);
 }
Esempio n. 5
0
 private void btnHistory_Click(object sender, EventArgs e)
 {
     P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide(); P5.Hide();
     P7.Show(); P7.BringToFront();
     lbltab.Text             = "Report Page";
     btnConnecting.BackColor = Color.FromArgb(41, 39, 40); btnConnecting.ForeColor = Color.DimGray;
     btnSetting.BackColor    = Color.FromArgb(41, 39, 40); btnSetting.ForeColor = Color.DimGray;
     btnController.BackColor = Color.FromArgb(41, 39, 40); btnController.ForeColor = Color.DimGray;
     btnStatus.BackColor     = Color.FromArgb(41, 39, 40); btnStatus.ForeColor = Color.DimGray;
     btnHome.BackColor       = Color.FromArgb(41, 39, 40); btnHome.ForeColor = Color.DimGray;
     btnHistory.BackColor    = Color.FromArgb(41, 39, 70); btnHistory.ForeColor = Color.Aquamarine;
 }
Esempio n. 6
0
 private void bunifuImageButton3_Click(object sender, EventArgs e)
 {
     //Side menu slide-effect
     if (panel2.Width == 222)
     {
         btnMenu.Image = VEGAACABLE.Properties.Resources.icons8_Menu_50px;
         //btnMenu.ImageActive = VEGAACABLE.Properties.Resources.icons8_Menu_50px_2;
         while (panel2.Width > 69)
         {
             panel2.Width = panel2.Width - 3;
         }
         llg.Visible = false;
         lg.Visible  = true;
         dashSide1.Show();
     }
     else if (panel2.Width == 69)
     {
         btnMenu.Image = VEGAACABLE.Properties.Resources.icons8_Delete_50px_2;
         //btnMenu.ImageActive = VEGAACABLE.Properties.Resources.icons8_Delete_50px_1;
         while (panel2.Width < 222)
         {
             P1.Show();
             P2.Show();
             panel2.Width      = panel2.Width + 3;
             indicator.Visible = false;
             P1.BackColor      = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(10)))), ((int)(((byte)(10)))));
             P2.BackColor      = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(10)))), ((int)(((byte)(10)))));
         }
         indicator.Visible = true;
         llg.Visible       = true;
         lg.Visible        = false;
         P1.Hide();
         P2.Hide();
         dashSide1.Hide();
     }
 }
Esempio n. 7
0
 private void btnlogout_Click(object sender, EventArgs e)
 {
     P1.Hide(); P2.Hide(); P3.Hide(); P4.Hide(); P6.Hide();
     P5.Hide(); lbltab.Text = "Login Page";
     this.Close();
 }