+
This commit is contained in:
18
DroneClient/FormMain.Designer.cs
generated
18
DroneClient/FormMain.Designer.cs
generated
@ -99,7 +99,7 @@
|
||||
groupBox1.Dock = DockStyle.Top;
|
||||
groupBox1.Location = new Point(0, 0);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(357, 80);
|
||||
groupBox1.Size = new Size(446, 80);
|
||||
groupBox1.TabIndex = 3;
|
||||
groupBox1.TabStop = false;
|
||||
groupBox1.Tag = "";
|
||||
@ -175,7 +175,7 @@
|
||||
groupBox2.Controls.Add(label1);
|
||||
groupBox2.Location = new Point(6, 86);
|
||||
groupBox2.Name = "groupBox2";
|
||||
groupBox2.Size = new Size(78, 118);
|
||||
groupBox2.Size = new Size(100, 118);
|
||||
groupBox2.TabIndex = 5;
|
||||
groupBox2.TabStop = false;
|
||||
groupBox2.Text = "Acc";
|
||||
@ -243,9 +243,9 @@
|
||||
groupBox3.Controls.Add(label11);
|
||||
groupBox3.Controls.Add(label_Gyr_X);
|
||||
groupBox3.Controls.Add(label13);
|
||||
groupBox3.Location = new Point(94, 86);
|
||||
groupBox3.Location = new Point(112, 86);
|
||||
groupBox3.Name = "groupBox3";
|
||||
groupBox3.Size = new Size(78, 118);
|
||||
groupBox3.Size = new Size(103, 118);
|
||||
groupBox3.TabIndex = 6;
|
||||
groupBox3.TabStop = false;
|
||||
groupBox3.Text = "Gyr";
|
||||
@ -322,9 +322,9 @@
|
||||
groupBox4.Controls.Add(label10);
|
||||
groupBox4.Controls.Add(label_Pos_X);
|
||||
groupBox4.Controls.Add(label14);
|
||||
groupBox4.Location = new Point(182, 86);
|
||||
groupBox4.Location = new Point(221, 86);
|
||||
groupBox4.Name = "groupBox4";
|
||||
groupBox4.Size = new Size(78, 118);
|
||||
groupBox4.Size = new Size(103, 118);
|
||||
groupBox4.TabIndex = 7;
|
||||
groupBox4.TabStop = false;
|
||||
groupBox4.Text = "Pos";
|
||||
@ -484,9 +484,9 @@
|
||||
groupBox5.Controls.Add(label17);
|
||||
groupBox5.Controls.Add(label_OF_X);
|
||||
groupBox5.Controls.Add(label19);
|
||||
groupBox5.Location = new Point(270, 86);
|
||||
groupBox5.Location = new Point(330, 86);
|
||||
groupBox5.Name = "groupBox5";
|
||||
groupBox5.Size = new Size(78, 118);
|
||||
groupBox5.Size = new Size(104, 118);
|
||||
groupBox5.TabIndex = 24;
|
||||
groupBox5.TabStop = false;
|
||||
groupBox5.Text = "OF";
|
||||
@ -540,7 +540,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(357, 447);
|
||||
ClientSize = new Size(446, 447);
|
||||
Controls.Add(groupBox5);
|
||||
Controls.Add(button_MR);
|
||||
Controls.Add(button_ML);
|
||||
|
26
DroneSimulator/Area.cs
Normal file
26
DroneSimulator/Area.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DroneSimulator
|
||||
{
|
||||
internal class Area
|
||||
{
|
||||
public struct Poisition
|
||||
{
|
||||
public struct Freeze{ public static bool X, Y, Z; }
|
||||
}
|
||||
|
||||
public struct Wind
|
||||
{
|
||||
public static bool Enable;
|
||||
public struct Speed { public static float From, To; }
|
||||
public static float Direction;
|
||||
public static float Density;
|
||||
public static float Resist;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,5 @@
|
||||
using System.CodeDom;
|
||||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using static DroneSimulator.Drone;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Rebar;
|
||||
|
||||
namespace DroneSimulator
|
||||
{
|
||||
@ -26,8 +21,6 @@ namespace DroneSimulator
|
||||
|
||||
public Vector4 Orientation;
|
||||
|
||||
public static bool[] Freeze = new bool[3];
|
||||
|
||||
private uint DataTimer;
|
||||
|
||||
private const float Gravity = 9.8f;
|
||||
@ -196,17 +189,33 @@ namespace DroneSimulator
|
||||
|
||||
SpdPRY += AccPRY * (Dynamic * time / (Mass * Length));
|
||||
|
||||
Quaternion pow = Quaternion.Inverse(Quat) * new Quaternion(0, 0, flow, 0) * Quat;
|
||||
AccXYZ = new Vector3(pow.X, pow.Y, pow.Z) * (Gravity / Mass);
|
||||
float wind_x = 0, wind_y = 0;
|
||||
|
||||
if (Area.Wind.Enable)
|
||||
{
|
||||
Quaternion dir = Quaternion.CreateFromAxisAngle(new Vector3(0, 0, 1), Area.Wind.Direction * TO_RADI * 2);
|
||||
|
||||
//Quaternion win = new Quaternion(0, 1, 0, 0) * dir;
|
||||
|
||||
Quaternion spd = new Quaternion(0, Area.Wind.Speed.From, 0, 0) * dir;
|
||||
|
||||
float spd_x = spd.X - SpdXYZ.X;
|
||||
float spd_y = spd.Y - SpdXYZ.Y;
|
||||
|
||||
wind_x = 0.5f * Area.Wind.Density * Area.Wind.Resist * spd_x;
|
||||
wind_y = 0.5f * Area.Wind.Density * Area.Wind.Resist * spd_y;
|
||||
}
|
||||
|
||||
Quaternion pow = Quaternion.Inverse(Quat) * new Quaternion(0, 0, flow, 0) * Quat;
|
||||
AccXYZ = new Vector3(pow.X + wind_x, pow.Y + wind_y, pow.Z) * (Gravity / Mass);
|
||||
SpdXYZ += (AccXYZ + new Vector3(0, 0, -Gravity)) * time;
|
||||
PosXYZ += SpdXYZ * time;
|
||||
|
||||
AccXYZ /= Gravity; // Вернуть измерения в G
|
||||
|
||||
if (Freeze[0]) { SpdXYZ.X = 0; PosXYZ.X = 0; }
|
||||
if (Freeze[1]) { SpdXYZ.Y = 0; PosXYZ.Y = 0; }
|
||||
if (Freeze[2]) { SpdXYZ.Z = 0; PosXYZ.Z = 5; }
|
||||
if (Area.Poisition.Freeze.X) { SpdXYZ.X = 0; PosXYZ.X = 0; }
|
||||
if (Area.Poisition.Freeze.Y) { SpdXYZ.Y = 0; PosXYZ.Y = 0; }
|
||||
if (Area.Poisition.Freeze.Z) { SpdXYZ.Z = 0; PosXYZ.Z = 5; }
|
||||
|
||||
if (PosXYZ.Z < 0)
|
||||
{
|
||||
@ -248,7 +257,7 @@ namespace DroneSimulator
|
||||
//Active = false; // Перевернулся вверх ногами
|
||||
}
|
||||
|
||||
Quaternion grav = Quat * new Quaternion(0, 0, flow/Mass, 0) * Quaternion.Inverse(Quat);
|
||||
Quaternion grav = Quat * new Quaternion(AccXYZ.X, AccXYZ.Y, AccXYZ.Z, 0) * Quaternion.Inverse(Quat);
|
||||
Acc = new Vector3(grav.X, grav.Y, grav.Z);
|
||||
|
||||
Gyr = SpdPRY;
|
||||
|
329
DroneSimulator/FormMain.Designer.cs
generated
329
DroneSimulator/FormMain.Designer.cs
generated
@ -154,6 +154,26 @@
|
||||
radioButton1 = new RadioButton();
|
||||
radioButton_Real = new RadioButton();
|
||||
tabPage_Area = new TabPage();
|
||||
groupBox4 = new GroupBox();
|
||||
numericUpDown_Area_Wind_Resist = new NumericUpDown();
|
||||
label64 = new Label();
|
||||
label63 = new Label();
|
||||
numericUpDown_Area_Wind_Density = new NumericUpDown();
|
||||
label62 = new Label();
|
||||
label61 = new Label();
|
||||
numericUpDown_Area_Wind_Speed_To = new NumericUpDown();
|
||||
label60 = new Label();
|
||||
label59 = new Label();
|
||||
numericUpDown_Area_Wind_Direction = new NumericUpDown();
|
||||
label58 = new Label();
|
||||
label57 = new Label();
|
||||
numericUpDown_Area_Wind_Speed_From = new NumericUpDown();
|
||||
checkBox_Area_Wind_Enable = new CheckBox();
|
||||
groupBox3 = new GroupBox();
|
||||
checkBox_Area_Freeze_Z = new CheckBox();
|
||||
checkBox_Area_Freeze_Y = new CheckBox();
|
||||
label41 = new Label();
|
||||
checkBox_Area_Freeze_X = new CheckBox();
|
||||
groupBox_Navi = new GroupBox();
|
||||
panel1 = new Panel();
|
||||
listBox_Drones = new ListBox();
|
||||
@ -161,11 +181,6 @@
|
||||
comboBox_Drone_Rotor = new ComboBox();
|
||||
comboBox_Drone = new ComboBox();
|
||||
timer_Test = new System.Windows.Forms.Timer(components);
|
||||
groupBox3 = new GroupBox();
|
||||
checkBox_Area_Freeze_X = new CheckBox();
|
||||
label41 = new Label();
|
||||
checkBox_Area_Freeze_Y = new CheckBox();
|
||||
checkBox_Area_Freeze_Z = new CheckBox();
|
||||
menuStrip_Menu.SuspendLayout();
|
||||
groupBox_Screen.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox_2D).BeginInit();
|
||||
@ -218,9 +233,15 @@
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Acc_Freq).BeginInit();
|
||||
groupBox2.SuspendLayout();
|
||||
tabPage_Area.SuspendLayout();
|
||||
groupBox4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Resist).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Density).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Speed_To).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Direction).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Speed_From).BeginInit();
|
||||
groupBox3.SuspendLayout();
|
||||
groupBox_Navi.SuspendLayout();
|
||||
panel1.SuspendLayout();
|
||||
groupBox3.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// menuStrip_Menu
|
||||
@ -1596,6 +1617,7 @@
|
||||
//
|
||||
// tabPage_Area
|
||||
//
|
||||
tabPage_Area.Controls.Add(groupBox4);
|
||||
tabPage_Area.Controls.Add(groupBox3);
|
||||
tabPage_Area.Location = new Point(4, 24);
|
||||
tabPage_Area.Name = "tabPage_Area";
|
||||
@ -1605,6 +1627,219 @@
|
||||
tabPage_Area.Text = "Area";
|
||||
tabPage_Area.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
groupBox4.Controls.Add(numericUpDown_Area_Wind_Resist);
|
||||
groupBox4.Controls.Add(label64);
|
||||
groupBox4.Controls.Add(label63);
|
||||
groupBox4.Controls.Add(numericUpDown_Area_Wind_Density);
|
||||
groupBox4.Controls.Add(label62);
|
||||
groupBox4.Controls.Add(label61);
|
||||
groupBox4.Controls.Add(numericUpDown_Area_Wind_Speed_To);
|
||||
groupBox4.Controls.Add(label60);
|
||||
groupBox4.Controls.Add(label59);
|
||||
groupBox4.Controls.Add(numericUpDown_Area_Wind_Direction);
|
||||
groupBox4.Controls.Add(label58);
|
||||
groupBox4.Controls.Add(label57);
|
||||
groupBox4.Controls.Add(numericUpDown_Area_Wind_Speed_From);
|
||||
groupBox4.Controls.Add(checkBox_Area_Wind_Enable);
|
||||
groupBox4.Dock = DockStyle.Top;
|
||||
groupBox4.Location = new Point(0, 53);
|
||||
groupBox4.Name = "groupBox4";
|
||||
groupBox4.Size = new Size(210, 150);
|
||||
groupBox4.TabIndex = 1;
|
||||
groupBox4.TabStop = false;
|
||||
groupBox4.Text = "Air and Wind";
|
||||
//
|
||||
// numericUpDown_Area_Wind_Resist
|
||||
//
|
||||
numericUpDown_Area_Wind_Resist.DecimalPlaces = 3;
|
||||
numericUpDown_Area_Wind_Resist.Location = new Point(63, 116);
|
||||
numericUpDown_Area_Wind_Resist.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
|
||||
numericUpDown_Area_Wind_Resist.Name = "numericUpDown_Area_Wind_Resist";
|
||||
numericUpDown_Area_Wind_Resist.Size = new Size(60, 23);
|
||||
numericUpDown_Area_Wind_Resist.TabIndex = 13;
|
||||
numericUpDown_Area_Wind_Resist.Value = new decimal(new int[] { 1, 0, 0, 65536 });
|
||||
numericUpDown_Area_Wind_Resist.ValueChanged += numericUpDown_Area_Wind_Update;
|
||||
//
|
||||
// label64
|
||||
//
|
||||
label64.AutoSize = true;
|
||||
label64.Location = new Point(13, 118);
|
||||
label64.Name = "label64";
|
||||
label64.Size = new Size(40, 15);
|
||||
label64.TabIndex = 12;
|
||||
label64.Text = "Resist:";
|
||||
//
|
||||
// label63
|
||||
//
|
||||
label63.AutoSize = true;
|
||||
label63.Location = new Point(128, 89);
|
||||
label63.Name = "label63";
|
||||
label63.Size = new Size(42, 15);
|
||||
label63.TabIndex = 11;
|
||||
label63.Text = "kg/m3";
|
||||
//
|
||||
// numericUpDown_Area_Wind_Density
|
||||
//
|
||||
numericUpDown_Area_Wind_Density.DecimalPlaces = 3;
|
||||
numericUpDown_Area_Wind_Density.Location = new Point(63, 87);
|
||||
numericUpDown_Area_Wind_Density.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
|
||||
numericUpDown_Area_Wind_Density.Name = "numericUpDown_Area_Wind_Density";
|
||||
numericUpDown_Area_Wind_Density.Size = new Size(60, 23);
|
||||
numericUpDown_Area_Wind_Density.TabIndex = 10;
|
||||
numericUpDown_Area_Wind_Density.Value = new decimal(new int[] { 12, 0, 0, 65536 });
|
||||
numericUpDown_Area_Wind_Density.ValueChanged += numericUpDown_Area_Wind_Update;
|
||||
//
|
||||
// label62
|
||||
//
|
||||
label62.AutoSize = true;
|
||||
label62.Location = new Point(8, 89);
|
||||
label62.Name = "label62";
|
||||
label62.Size = new Size(49, 15);
|
||||
label62.TabIndex = 9;
|
||||
label62.Text = "Density:";
|
||||
//
|
||||
// label61
|
||||
//
|
||||
label61.AutoSize = true;
|
||||
label61.Location = new Point(179, 29);
|
||||
label61.Name = "label61";
|
||||
label61.Size = new Size(28, 15);
|
||||
label61.TabIndex = 8;
|
||||
label61.Text = "m/s";
|
||||
//
|
||||
// numericUpDown_Area_Wind_Speed_To
|
||||
//
|
||||
numericUpDown_Area_Wind_Speed_To.DecimalPlaces = 1;
|
||||
numericUpDown_Area_Wind_Speed_To.Enabled = false;
|
||||
numericUpDown_Area_Wind_Speed_To.Location = new Point(125, 27);
|
||||
numericUpDown_Area_Wind_Speed_To.Name = "numericUpDown_Area_Wind_Speed_To";
|
||||
numericUpDown_Area_Wind_Speed_To.Size = new Size(53, 23);
|
||||
numericUpDown_Area_Wind_Speed_To.TabIndex = 7;
|
||||
//
|
||||
// label60
|
||||
//
|
||||
label60.AutoSize = true;
|
||||
label60.Location = new Point(129, 57);
|
||||
label60.Name = "label60";
|
||||
label60.Size = new Size(27, 15);
|
||||
label60.TabIndex = 6;
|
||||
label60.Text = "deg";
|
||||
//
|
||||
// label59
|
||||
//
|
||||
label59.AutoSize = true;
|
||||
label59.Location = new Point(8, 57);
|
||||
label59.Name = "label59";
|
||||
label59.Size = new Size(58, 15);
|
||||
label59.TabIndex = 5;
|
||||
label59.Text = "Direction:";
|
||||
//
|
||||
// numericUpDown_Area_Wind_Direction
|
||||
//
|
||||
numericUpDown_Area_Wind_Direction.DecimalPlaces = 1;
|
||||
numericUpDown_Area_Wind_Direction.Location = new Point(72, 55);
|
||||
numericUpDown_Area_Wind_Direction.Maximum = new decimal(new int[] { 359, 0, 0, 0 });
|
||||
numericUpDown_Area_Wind_Direction.Name = "numericUpDown_Area_Wind_Direction";
|
||||
numericUpDown_Area_Wind_Direction.Size = new Size(51, 23);
|
||||
numericUpDown_Area_Wind_Direction.TabIndex = 4;
|
||||
numericUpDown_Area_Wind_Direction.ValueChanged += numericUpDown_Area_Wind_Update;
|
||||
//
|
||||
// label58
|
||||
//
|
||||
label58.AutoSize = true;
|
||||
label58.Location = new Point(107, 29);
|
||||
label58.Name = "label58";
|
||||
label58.Size = new Size(12, 15);
|
||||
label58.TabIndex = 3;
|
||||
label58.Text = "-";
|
||||
//
|
||||
// label57
|
||||
//
|
||||
label57.AutoSize = true;
|
||||
label57.Location = new Point(3, 29);
|
||||
label57.Name = "label57";
|
||||
label57.Size = new Size(42, 15);
|
||||
label57.TabIndex = 2;
|
||||
label57.Text = "Speed:";
|
||||
//
|
||||
// numericUpDown_Area_Wind_Speed_From
|
||||
//
|
||||
numericUpDown_Area_Wind_Speed_From.DecimalPlaces = 1;
|
||||
numericUpDown_Area_Wind_Speed_From.Location = new Point(51, 27);
|
||||
numericUpDown_Area_Wind_Speed_From.Name = "numericUpDown_Area_Wind_Speed_From";
|
||||
numericUpDown_Area_Wind_Speed_From.Size = new Size(50, 23);
|
||||
numericUpDown_Area_Wind_Speed_From.TabIndex = 1;
|
||||
numericUpDown_Area_Wind_Speed_From.ValueChanged += numericUpDown_Area_Wind_Update;
|
||||
//
|
||||
// checkBox_Area_Wind_Enable
|
||||
//
|
||||
checkBox_Area_Wind_Enable.AutoSize = true;
|
||||
checkBox_Area_Wind_Enable.Location = new Point(165, 125);
|
||||
checkBox_Area_Wind_Enable.Name = "checkBox_Area_Wind_Enable";
|
||||
checkBox_Area_Wind_Enable.Size = new Size(39, 19);
|
||||
checkBox_Area_Wind_Enable.TabIndex = 0;
|
||||
checkBox_Area_Wind_Enable.Text = "En";
|
||||
checkBox_Area_Wind_Enable.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Wind_Enable.CheckedChanged += numericUpDown_Area_Wind_Update;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
groupBox3.Controls.Add(checkBox_Area_Freeze_Z);
|
||||
groupBox3.Controls.Add(checkBox_Area_Freeze_Y);
|
||||
groupBox3.Controls.Add(label41);
|
||||
groupBox3.Controls.Add(checkBox_Area_Freeze_X);
|
||||
groupBox3.Dock = DockStyle.Top;
|
||||
groupBox3.Location = new Point(0, 0);
|
||||
groupBox3.Name = "groupBox3";
|
||||
groupBox3.Size = new Size(210, 53);
|
||||
groupBox3.TabIndex = 0;
|
||||
groupBox3.TabStop = false;
|
||||
groupBox3.Text = "Position";
|
||||
//
|
||||
// checkBox_Area_Freeze_Z
|
||||
//
|
||||
checkBox_Area_Freeze_Z.AutoSize = true;
|
||||
checkBox_Area_Freeze_Z.Location = new Point(151, 23);
|
||||
checkBox_Area_Freeze_Z.Name = "checkBox_Area_Freeze_Z";
|
||||
checkBox_Area_Freeze_Z.Size = new Size(33, 19);
|
||||
checkBox_Area_Freeze_Z.TabIndex = 3;
|
||||
checkBox_Area_Freeze_Z.Text = "Z";
|
||||
checkBox_Area_Freeze_Z.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Freeze_Z.CheckedChanged += checkBox_Area_Freeze_CheckedChanged;
|
||||
//
|
||||
// checkBox_Area_Freeze_Y
|
||||
//
|
||||
checkBox_Area_Freeze_Y.AutoSize = true;
|
||||
checkBox_Area_Freeze_Y.Location = new Point(103, 23);
|
||||
checkBox_Area_Freeze_Y.Name = "checkBox_Area_Freeze_Y";
|
||||
checkBox_Area_Freeze_Y.Size = new Size(33, 19);
|
||||
checkBox_Area_Freeze_Y.TabIndex = 2;
|
||||
checkBox_Area_Freeze_Y.Text = "Y";
|
||||
checkBox_Area_Freeze_Y.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Freeze_Y.CheckedChanged += checkBox_Area_Freeze_CheckedChanged;
|
||||
//
|
||||
// label41
|
||||
//
|
||||
label41.AutoSize = true;
|
||||
label41.Location = new Point(6, 24);
|
||||
label41.Name = "label41";
|
||||
label41.Size = new Size(43, 15);
|
||||
label41.TabIndex = 1;
|
||||
label41.Text = "Freeze:";
|
||||
//
|
||||
// checkBox_Area_Freeze_X
|
||||
//
|
||||
checkBox_Area_Freeze_X.AutoSize = true;
|
||||
checkBox_Area_Freeze_X.Location = new Point(55, 23);
|
||||
checkBox_Area_Freeze_X.Name = "checkBox_Area_Freeze_X";
|
||||
checkBox_Area_Freeze_X.Size = new Size(33, 19);
|
||||
checkBox_Area_Freeze_X.TabIndex = 0;
|
||||
checkBox_Area_Freeze_X.Text = "X";
|
||||
checkBox_Area_Freeze_X.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Freeze_X.CheckedChanged += checkBox_Area_Freeze_CheckedChanged;
|
||||
//
|
||||
// groupBox_Navi
|
||||
//
|
||||
groupBox_Navi.Controls.Add(panel1);
|
||||
@ -1671,62 +1906,6 @@
|
||||
timer_Test.Interval = 10;
|
||||
timer_Test.Tick += timer_Test_Tick;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
groupBox3.Controls.Add(checkBox_Area_Freeze_Z);
|
||||
groupBox3.Controls.Add(checkBox_Area_Freeze_Y);
|
||||
groupBox3.Controls.Add(label41);
|
||||
groupBox3.Controls.Add(checkBox_Area_Freeze_X);
|
||||
groupBox3.Dock = DockStyle.Top;
|
||||
groupBox3.Location = new Point(0, 0);
|
||||
groupBox3.Name = "groupBox3";
|
||||
groupBox3.Size = new Size(210, 59);
|
||||
groupBox3.TabIndex = 0;
|
||||
groupBox3.TabStop = false;
|
||||
groupBox3.Text = "Position";
|
||||
//
|
||||
// checkBox_Area_Freeze_X
|
||||
//
|
||||
checkBox_Area_Freeze_X.AutoSize = true;
|
||||
checkBox_Area_Freeze_X.Location = new Point(55, 23);
|
||||
checkBox_Area_Freeze_X.Name = "checkBox_Area_Freeze_X";
|
||||
checkBox_Area_Freeze_X.Size = new Size(33, 19);
|
||||
checkBox_Area_Freeze_X.TabIndex = 0;
|
||||
checkBox_Area_Freeze_X.Text = "X";
|
||||
checkBox_Area_Freeze_X.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Freeze_X.CheckedChanged += checkBox_Area_Freeze_CheckedChanged;
|
||||
//
|
||||
// label41
|
||||
//
|
||||
label41.AutoSize = true;
|
||||
label41.Location = new Point(6, 24);
|
||||
label41.Name = "label41";
|
||||
label41.Size = new Size(43, 15);
|
||||
label41.TabIndex = 1;
|
||||
label41.Text = "Freeze:";
|
||||
//
|
||||
// checkBox_Area_Freeze_Y
|
||||
//
|
||||
checkBox_Area_Freeze_Y.AutoSize = true;
|
||||
checkBox_Area_Freeze_Y.Location = new Point(103, 23);
|
||||
checkBox_Area_Freeze_Y.Name = "checkBox_Area_Freeze_Y";
|
||||
checkBox_Area_Freeze_Y.Size = new Size(33, 19);
|
||||
checkBox_Area_Freeze_Y.TabIndex = 2;
|
||||
checkBox_Area_Freeze_Y.Text = "Y";
|
||||
checkBox_Area_Freeze_Y.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Freeze_Y.CheckedChanged += checkBox_Area_Freeze_CheckedChanged;
|
||||
//
|
||||
// checkBox_Area_Freeze_Z
|
||||
//
|
||||
checkBox_Area_Freeze_Z.AutoSize = true;
|
||||
checkBox_Area_Freeze_Z.Location = new Point(151, 23);
|
||||
checkBox_Area_Freeze_Z.Name = "checkBox_Area_Freeze_Z";
|
||||
checkBox_Area_Freeze_Z.Size = new Size(33, 19);
|
||||
checkBox_Area_Freeze_Z.TabIndex = 3;
|
||||
checkBox_Area_Freeze_Z.Text = "Z";
|
||||
checkBox_Area_Freeze_Z.UseVisualStyleBackColor = true;
|
||||
checkBox_Area_Freeze_Z.CheckedChanged += checkBox_Area_Freeze_CheckedChanged;
|
||||
//
|
||||
// Form_Main
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
@ -1805,10 +1984,17 @@
|
||||
groupBox2.ResumeLayout(false);
|
||||
groupBox2.PerformLayout();
|
||||
tabPage_Area.ResumeLayout(false);
|
||||
groupBox_Navi.ResumeLayout(false);
|
||||
panel1.ResumeLayout(false);
|
||||
groupBox4.ResumeLayout(false);
|
||||
groupBox4.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Resist).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Density).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Speed_To).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Direction).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Area_Wind_Speed_From).EndInit();
|
||||
groupBox3.ResumeLayout(false);
|
||||
groupBox3.PerformLayout();
|
||||
groupBox_Navi.ResumeLayout(false);
|
||||
panel1.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@ -1951,5 +2137,20 @@
|
||||
private CheckBox checkBox_Area_Freeze_Z;
|
||||
private CheckBox checkBox_Area_Freeze_Y;
|
||||
private Label label41;
|
||||
private GroupBox groupBox4;
|
||||
private Label label59;
|
||||
private NumericUpDown numericUpDown_Area_Wind_Direction;
|
||||
private Label label58;
|
||||
private Label label57;
|
||||
private NumericUpDown numericUpDown_Area_Wind_Speed_From;
|
||||
private CheckBox checkBox_Area_Wind_Enable;
|
||||
private Label label60;
|
||||
private Label label61;
|
||||
private NumericUpDown numericUpDown_Area_Wind_Speed_To;
|
||||
private Label label63;
|
||||
private NumericUpDown numericUpDown_Area_Wind_Density;
|
||||
private Label label62;
|
||||
private NumericUpDown numericUpDown_Area_Wind_Resist;
|
||||
private Label label64;
|
||||
}
|
||||
}
|
||||
|
@ -294,9 +294,19 @@ namespace DroneSimulator
|
||||
|
||||
private void checkBox_Area_Freeze_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Drone.Freeze[0] = checkBox_Area_Freeze_X.Checked;
|
||||
Drone.Freeze[1] = checkBox_Area_Freeze_Y.Checked;
|
||||
Drone.Freeze[2] = checkBox_Area_Freeze_Z.Checked;
|
||||
Area.Poisition.Freeze.X = checkBox_Area_Freeze_X.Checked;
|
||||
Area.Poisition.Freeze.Y = checkBox_Area_Freeze_Y.Checked;
|
||||
Area.Poisition.Freeze.Z = checkBox_Area_Freeze_Z.Checked;
|
||||
}
|
||||
|
||||
private void numericUpDown_Area_Wind_Update(object sender, EventArgs e)
|
||||
{
|
||||
Area.Wind.Enable = checkBox_Area_Wind_Enable.Checked;
|
||||
Area.Wind.Speed.From = (float)numericUpDown_Area_Wind_Speed_From.Value;
|
||||
Area.Wind.Speed.To = (float)numericUpDown_Area_Wind_Speed_To.Value;
|
||||
Area.Wind.Direction = (float)numericUpDown_Area_Wind_Direction.Value;
|
||||
Area.Wind.Density = (float)numericUpDown_Area_Wind_Density.Value;
|
||||
Area.Wind.Resist = (float)numericUpDown_Area_Wind_Resist.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user