コード例 #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");
 }
コード例 #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 = "";
 }
コード例 #3
0
 private void btnUser_Click(object sender, EventArgs e)
 {
     if (P6.Visible == true)
     {
         P6.Hide();
     }
     else
     {
         P6.Show();
         P6.BringToFront();
     }
 }
コード例 #4
0
 private void panel1_MouseClick(object sender, MouseEventArgs e)
 {
     P6.Hide();
 }
コード例 #5
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();
 }