Exemplo 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");
 }
Exemplo 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 = "";
 }
Exemplo 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;
 }