public void CreateOptionsFile() { XmlSerializer ser = new XmlSerializer( typeof(Options)); Options o = new Options(); StreamWriter wr = new StreamWriter( options_path ); ser.Serialize(wr,(object)o); wr.Flush(); wr.Close(); }
//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); }
private void Robot_Load(object sender, EventArgs e) { labelCommunicationType.Text = "TCP Client"; labelConnectingStatus.Text = "Closed"; label122.Text = "Not"; groupDirectionAndMotion.Enabled = false; groupCameraRotation.Enabled = false; groupCameraRot2.Enabled = false; labelJoystickName.Text = null; SetMap(); Maps.SelectedItem = "TUKE"; //Full Screen Options op = new Options(); op = op.ReadOptionsFromFile(); this.combo_method.SelectedIndex = op.Scale; this.combo_streams.SelectedIndex = op.Streams; this.textBox1.Text = op.Text; //this.lbl_foreColor.BackColor = ColorTranslator.FromHtml(op.ForeColor); }
private void Robot_Load(object sender, EventArgs e) { //Tracking //pictureBox27.Load(Application.StartupPath + "\\Resources\\image1.jpg"); /////3D lights = new TVLightEngine(); globals = new TVGlobals(); atmosphere = new TVAtmosphere(); maths = new TVMathLibrary(); materialfactory = new TVMaterialFactory(); texturefactory = new TVTextureFactory(); tv = new TVEngine(); physics = new TVPhysics(); //Setup TV tv.SetDebugMode(true, true); tv.SetDebugFile(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\debugfile.txt"); tv.SetAntialiasing(true, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_2_SAMPLES); //Enter Your Beta Username And Password Here //tv.SetBetaKey("", ""); tv.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE); //tv.Init3DWindowed(this.Handle, true); tv.Init3DWindowed(this.pictureBox3D.Handle, true); tv.GetViewport().SetAutoResize(true); tv.DisplayFPS(true); tv.SetVSync(true); scene = new TVScene(); input = new TVInputEngine(); input.Initialize(true, true); camera = new TVCamera(); camera = scene.GetCamera(); camera.SetViewFrustum(45, 1000, 0.1f); camera.SetPosition(0, 5, -20); camera.SetLookAt(0, 3, 0); viewport = new TVViewport(); viewport = tv.CreateViewport(this.Handle, "viewport"); viewport.SetCamera(camera); viewport.SetBackgroundColor(Color.Blue.ToArgb()); bDoLoop = true; InitSound(); InitMaterials(); InitTextures(); InitFonts(); InitShaders(); InitEnvironment(); InitPhysics(); InitLandscape(); InitObjects(); InitLights(); InitPhysicsMaterials(); Init2DText(); this.Show(); this.Focus(); GameLoop(); tv = null; this.Close(); //// /3D groupComPortDefault.Enabled = false; groupComPortSettings.Enabled = false; groupTcpClientServerSettings.Enabled = false; groupTcpClientServerDefault.Enabled = false; groupDirectionAndMotion.Enabled = false; groupCameraRotation.Enabled = false; groupCameraRot2.Enabled = false; groupAdvencedSuppDevices.Enabled = false; groupJoystickInit.Enabled = false; labelCommunicationType.Text = null; labelConnectingStatus.Text = null; labelJoystickName.Text = null; SetMap(); Maps.SelectedItem = "TUKE"; //Full Screen Options op = new Options(); op = op.ReadOptionsFromFile(); this.combo_method.SelectedIndex = op.Scale; this.combo_streams.SelectedIndex = op.Streams; this.textBox1.Text = op.Text; //this.lbl_foreColor.BackColor = ColorTranslator.FromHtml(op.ForeColor); }
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(); }