Example #1
0
        //CONSOLE
        /////////////
        public Robot1()
        {
            //ACCELEROMETER
            this.usrCtrlAxis2D = new UsrCtrlAxis2D();
            this.usrCtrlAxis2D.Size = new Size(350, 350);
            this.usrCtrlAxis2D.Location = new Point(0, 0);
            this.usrCtrlAxis2D.BackColor = Color.AliceBlue;
            //this.tabPage19.Controls.Add(this.usrCtrlAxis2D);

            InitializeComponent();

            batt.aktualne_nap = 0.1f; //initial value for battery monitor
            SetMap();
            Robot1.CheckForIllegalCrossThreadCalls = false;
            comboBox1.SelectedItem = "nothing";
            comboBox2.SelectedItem = "nothing";
            comboBox3.SelectedItem = "nothing";
            comboBox4.SelectedItem = "nothing";
            comboBox5.SelectedItem = "nothing";
            comboBox6.SelectedItem = "nothing";
            comboBox7.SelectedItem = "nothing";
            comboBox8.SelectedItem = "nothing";
            comboBox9.SelectedItem = "nothing";
            comboBox10.SelectedItem = "nothing";
            //Trajectory activation
            button12.Enabled = true;
            button14.Enabled = false;
            button17.Enabled = false;
            button13.Enabled = false;
            button18.Enabled = false;
            button15.Enabled = false;
            //Audio stream
            foreach (IPAddress ip in System.Net.Dns.GetHostAddresses(""))
            {
                m_pLocalIP.Items.Add(ip.ToString());
            }
            m_pLocalIP.SelectedIndex = m_pLocalIP.Items.Count-2;
            //m_pLocalIP.SelectedIndex = 0;
            m_pCodec.Items.Add("G711 a-law");
            m_pCodec.Items.Add("G711 u-law");
            m_pCodec.Enabled = false;
            LoadWaveDevices();
            m_pActiveCodec = new PCMA();
            //Bootloader
            comboBoxport.SelectedIndex = 0;
            comboBoxMCU.SelectedIndex = 0;
            //Inicialize TCP Client
            groupDirectionAndMotion.Enabled = false;
            groupCameraRotation.Enabled = false;
            groupCameraRot2.Enabled = false;
            groupComPortSettings.Enabled = false;
            groupComPortDefault.Enabled = false;
            groupTcpClientServerSettings.Enabled = true;
            groupTcpClientServerDefault.Enabled = true;
            textTCPClientServerIPAddress.ReadOnly = false;
            textTCPCommunicationType.Text = "CLIENT";
            labelCommunicationType.Text = "TCP Client";
            toolStripconnect.Enabled = true;
            ThreadCheckStat = new Thread(CheckStatus);
            ThreadCheckStat.Start();
            //Small Cam
            o = new Options();
            combo_streams.SelectedText = "1";
            //AUDIO DELEGATE
            m_DelegateAddString = new DelegateAddString(this.AddString);
            m_DelegateAddString1 = new DelegateAddString1(this.AddString1);

            //ACCELEROMETER
            //this.usrCtrlAxis3D = new UsrCtrlAxis3D();
            //this.usrCtrlAxis3D.Size = new Size(350, 350);
            //this.usrCtrlAxis3D.Location = new Point(0, 0);
            //this.Controls.Add(this.usrCtrlAxis3D);
            this.mySerialPort = new SerialPort("COM4", 9600, Parity.None, 8, StopBits.One);
            this.mySerialPort.Handshake = Handshake.None;
            this.mySerialPort.RtsEnable = true;
            this.mySerialPort.DataReceived += new SerialDataReceivedEventHandler(MySerialPort_DataReceived);
        }
Example #2
0
        public Robot1()
        {
            //ACCELEROMETER
            this.usrCtrlAxis2D = new UsrCtrlAxis2D();
            this.usrCtrlAxis2D.Size = new Size(350, 350);
            this.usrCtrlAxis2D.Location = new Point(0, 0);
            this.usrCtrlAxis2D.BackColor = Color.AliceBlue;
            this.usrCtrlAxis3D = new UsrCtrlAxis3D();
            this.usrCtrlAxis3D.Size = new Size(350, 350);
            this.usrCtrlAxis3D.Location = new Point(0, 0);

            InitializeComponent();

            //VERSION UPDATE PUBLISH
            Version version2 = new Version();
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                version2 = ad.CurrentVersion;
            }

            //VERSION UPDATE BUILD
            Version vrs = new Version(Application.ProductVersion);
            this.Text = "CONTROL APPLICATION  ORCS ROBOT G4 (SECURITY GUARD ROBOT) / AssemblyBuid " + vrs.Major + "." + vrs.Minor + "." + vrs.Build + "." + vrs.Revision + " / Publish Version ClickOnce " + PublishVersion().ToString() + " / RC" + version2.Revision.ToString(); //String.Format("ClickOnce Version {0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build);

            //BATTERY
            batt.aktualne_nap = 0.1f; //initial value for battery monitor
            SetMap();
            Robot1.CheckForIllegalCrossThreadCalls = false;
            comboBox1.SelectedItem = "nothing";
            comboBox2.SelectedItem = "nothing";
            comboBox3.SelectedItem = "nothing";
            comboBox4.SelectedItem = "nothing";
            comboBox5.SelectedItem = "nothing";
            comboBox6.SelectedItem = "nothing";
            comboBox7.SelectedItem = "nothing";
            comboBox8.SelectedItem = "nothing";
            comboBox9.SelectedItem = "nothing";
            comboBox10.SelectedItem = "nothing";
            //Trajectory activation
            button12.Enabled = true;
            button14.Enabled = false;
            button17.Enabled = false;
            button13.Enabled = false;
            button18.Enabled = false;
            button15.Enabled = false;
            //Audio stream
            foreach (IPAddress ip in System.Net.Dns.GetHostAddresses(""))
            {
                m_pLocalIP.Items.Add(ip.ToString());
            }
            m_pLocalIP.SelectedIndex = m_pLocalIP.Items.Count-2;
            //m_pLocalIP.SelectedIndex = 0;
            m_pCodec.Items.Add("G711 a-law");
            m_pCodec.Items.Add("G711 u-law");
            m_pCodec.Enabled = false;
            LoadWaveDevices();
            m_pActiveCodec = new PCMA();
            //Bootloader
            comboBoxport.SelectedIndex = 0;
            comboBoxMCU.SelectedIndex = 0;
            //Inicialize TCP Client
            groupDirectionAndMotion.Enabled = false;
            groupCameraRotation.Enabled = false;
            groupCameraRot2.Enabled = false;
            textTCPClientServerIPAddress.ReadOnly = false;
            textTCPCommunicationType.Text = "CLIENT";
            labelCommunicationType.Text = "TCP Client";
            toolStripconnect.Enabled = true;
            ThreadCheckStat = new Thread(CheckStatus);
            ThreadCheckStat.Start();
            //Small Cam
            o = new Options();
            combo_streams.SelectedText = "1";
            //AUDIO DELEGATE
            m_DelegateAddString = new DelegateAddString(this.AddString);
            m_DelegateAddString1 = new DelegateAddString1(this.AddString1);

            //ACCELEROMETER
            //this.usrCtrlAxis3D = new UsrCtrlAxis3D();
            //this.usrCtrlAxis3D.Size = new Size(350, 350);
            //this.usrCtrlAxis3D.Location = new Point(0, 0);
            //this.Controls.Add(this.usrCtrlAxis3D);
            this.panelMEMS.Controls.Add(this.usrCtrlAxis2D);
            this.panelMEMS.Controls.Add(this.usrCtrlAxis3D);
            CreateGraph(); //MEMS Create Graph

            this.mySerialPort = new SerialPort("COM5", 9600, Parity.None, 8, StopBits.One);
            this.mySerialPort.Handshake = Handshake.None;
            this.mySerialPort.RtsEnable = true;
            this.mySerialPort.DataReceived += new SerialDataReceivedEventHandler(MySerialPort_DataReceived);

            //GPS
            GPS.GPSFileLogCreate();
        }