Configurator.Net:

Added new indicator control that is purely drawn, rather than using a progress bar (Mono issues)
Removed old controls based on the winforms progress bar
Started adding some hacks to work around Mono binding bugs


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1558 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
mandrolic 2011-01-25 21:47:18 +00:00
parent 4c8c09edac
commit 557b5c7615
14 changed files with 784 additions and 532 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -49,6 +49,12 @@
<Compile Include="PresentationModels\MonitorVm.cs" /> <Compile Include="PresentationModels\MonitorVm.cs" />
<Compile Include="PresentationModels\MainVm.cs" /> <Compile Include="PresentationModels\MainVm.cs" />
<Compile Include="PresentationModels\FlightDataMonitorVm.cs" /> <Compile Include="PresentationModels\FlightDataMonitorVm.cs" />
<Compile Include="Views\controls\LinearIndicatorControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Views\controls\LinearIndicatorControl.Designer.cs">
<DependentUpon>LinearIndicatorControl.cs</DependentUpon>
</Compile>
<Compile Include="Views\mainForm.cs"> <Compile Include="Views\mainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -71,9 +77,6 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Views\controls\LinearSensorIndicatorControl.resx">
<DependentUpon>LinearSensorIndicatorControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Views\AcroConfigView.resx"> <EmbeddedResource Include="Views\AcroConfigView.resx">
<DependentUpon>AcroConfigView.cs</DependentUpon> <DependentUpon>AcroConfigView.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -121,12 +124,6 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<Compile Include="Views\controls\LinearSensorIndicatorControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Views\controls\VerticalProgressBar.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Views\AcroConfigView.cs"> <Compile Include="Views\AcroConfigView.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>

View File

@ -48,16 +48,16 @@ namespace ArducopterConfigurator.PresentationModels
} }
LoopTime = ints[0]; LoopTime = ints[0];
GyroRoll = ints[1] + 500; GyroRoll = ints[1];
GyroPitch = ints[2] + 500; GyroPitch = ints[2];
GyroYaw = ints[3] + 500; GyroYaw = ints[3];
MotorFront = ints[8]; MotorFront = ints[8];
MotorRear = ints[9]; MotorRear = ints[9];
MotorRight = ints[10]; MotorRight = ints[10];
MotorLeft = ints[11]; MotorLeft = ints[11];
AccelRoll = ints[12] + 500; AccelRoll = ints[12];
AccelPitch = ints[13] + 500; AccelPitch = ints[13];
AccelZ = ints[14] + 500; AccelZ = ints[14];
} }

View File

@ -7,6 +7,8 @@ namespace ArducopterConfigurator
{ {
static class Program static class Program
{ {
public static bool IsMonoRuntime;
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
@ -16,12 +18,14 @@ namespace ArducopterConfigurator
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
//var session = new CommsSession(); var t = Type.GetType("Mono.Runtime");
var session = new FakeCommsSession(); IsMonoRuntime = (t != null);
var session = new CommsSession();
//var session = new FakeCommsSession();
var mainVm = new MainVm(session); var mainVm = new MainVm(session);
Application.Run(new mainForm(mainVm)); Application.Run(new mainForm(mainVm));
} }
} }

View File

@ -12,10 +12,11 @@ namespace ArducopterConfiguratorTest
public event Action<string> LineOfDataReceived; public event Action<string> LineOfDataReceived;
public string CommPort { get; set; } public string CommPort { get; set; }
public List<string> SentItems = new List<string>(); public List<string> SentItems = new List<string>();
private bool _isConnected;
public bool IsConnected public bool IsConnected
{ {
get { throw new NotImplementedException(); } get { return _isConnected; }
} }
public IEnumerable<string> ListCommPorts() public IEnumerable<string> ListCommPorts()
@ -30,11 +31,13 @@ namespace ArducopterConfiguratorTest
public bool Connect() public bool Connect()
{ {
_isConnected = true;
return true; return true;
} }
public bool DisConnect() public bool DisConnect()
{ {
_isConnected = false;
return true; return true;
} }

View File

@ -47,19 +47,19 @@
this.textBox6 = new System.Windows.Forms.TextBox(); this.textBox6 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.textBox7 = new System.Windows.Forms.TextBox(); this.textBox7 = new System.Windows.Forms.TextBox();
this.sensorRollGyro = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.sensorRollAcc = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.progressBar3 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.verticalProgressBar8 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.verticalProgressBar6 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.sensorPitchGyro = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.verticalProgressBar4 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.verticalProgressBar3 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.verticalProgressBar2 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.verticalProgressBar1 = new ArducopterConfigurator.LinearSensorIndicatorControl();
this.textBox8 = new System.Windows.Forms.TextBox(); this.textBox8 = new System.Windows.Forms.TextBox();
this.textBox9 = new System.Windows.Forms.TextBox(); this.textBox9 = new System.Windows.Forms.TextBox();
this.textBox10 = new System.Windows.Forms.TextBox(); this.textBox10 = new System.Windows.Forms.TextBox();
this.indicatorRollGyro = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.indicatorRollAccel = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl1 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl2 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl3 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl4 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl5 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl6 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl7 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl8 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
((System.ComponentModel.ISupportInitialize)(this.FlightDataVmBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.FlightDataVmBindingSource)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -133,7 +133,7 @@
// textBox3 // textBox3
// //
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "AccelRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0")); this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "AccelRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0"));
this.textBox3.Location = new System.Drawing.Point(124, 68); this.textBox3.Location = new System.Drawing.Point(124, 78);
this.textBox3.Name = "textBox3"; this.textBox3.Name = "textBox3";
this.textBox3.ReadOnly = true; this.textBox3.ReadOnly = true;
this.textBox3.Size = new System.Drawing.Size(47, 20); this.textBox3.Size = new System.Drawing.Size(47, 20);
@ -142,7 +142,7 @@
// label6 // label6
// //
this.label6.AutoSize = true; this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(9, 52); this.label6.Location = new System.Drawing.Point(12, 62);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(57, 13); this.label6.Size = new System.Drawing.Size(57, 13);
this.label6.TabIndex = 15; this.label6.TabIndex = 15;
@ -220,128 +220,6 @@
this.textBox7.Size = new System.Drawing.Size(47, 20); this.textBox7.Size = new System.Drawing.Size(47, 20);
this.textBox7.TabIndex = 23; this.textBox7.TabIndex = 23;
// //
// sensorRollGyro
//
this.sensorRollGyro.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.sensorRollGyro.Location = new System.Drawing.Point(12, 25);
this.sensorRollGyro.Maximum = 1000;
this.sensorRollGyro.Name = "sensorRollGyro";
this.sensorRollGyro.Size = new System.Drawing.Size(100, 23);
this.sensorRollGyro.TabIndex = 9;
//
// sensorRollAcc
//
this.sensorRollAcc.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.sensorRollAcc.Location = new System.Drawing.Point(12, 68);
this.sensorRollAcc.Maximum = 1000;
this.sensorRollAcc.Name = "sensorRollAcc";
this.sensorRollAcc.Size = new System.Drawing.Size(100, 23);
this.sensorRollAcc.TabIndex = 14;
//
// progressBar3
//
this.progressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroYaw", true));
this.progressBar3.Location = new System.Drawing.Point(234, 157);
this.progressBar3.Maximum = 1000;
this.progressBar3.Name = "progressBar3";
this.progressBar3.Size = new System.Drawing.Size(100, 23);
this.progressBar3.TabIndex = 28;
//
// verticalProgressBar8
//
this.verticalProgressBar8.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelZ", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.verticalProgressBar8.IsVertical = true;
this.verticalProgressBar8.Location = new System.Drawing.Point(354, 21);
this.verticalProgressBar8.Maximum = 1000;
this.verticalProgressBar8.Name = "verticalProgressBar8";
this.verticalProgressBar8.Size = new System.Drawing.Size(24, 82);
this.verticalProgressBar8.Step = 1;
this.verticalProgressBar8.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.verticalProgressBar8.TabIndex = 22;
this.verticalProgressBar8.Value = 500;
//
// verticalProgressBar6
//
this.verticalProgressBar6.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelPitch", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.verticalProgressBar6.IsVertical = true;
this.verticalProgressBar6.Location = new System.Drawing.Point(258, 21);
this.verticalProgressBar6.Maximum = 1000;
this.verticalProgressBar6.Name = "verticalProgressBar6";
this.verticalProgressBar6.Size = new System.Drawing.Size(24, 82);
this.verticalProgressBar6.Step = 1;
this.verticalProgressBar6.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.verticalProgressBar6.TabIndex = 19;
this.verticalProgressBar6.Value = 500;
//
// sensorPitchGyro
//
this.sensorPitchGyro.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroPitch", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.sensorPitchGyro.IsVertical = true;
this.sensorPitchGyro.Location = new System.Drawing.Point(198, 21);
this.sensorPitchGyro.Maximum = 1000;
this.sensorPitchGyro.Name = "sensorPitchGyro";
this.sensorPitchGyro.Size = new System.Drawing.Size(24, 82);
this.sensorPitchGyro.Step = 1;
this.sensorPitchGyro.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.sensorPitchGyro.TabIndex = 16;
this.sensorPitchGyro.Value = 500;
//
// verticalProgressBar4
//
this.verticalProgressBar4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRight", true));
this.verticalProgressBar4.IsVertical = true;
this.verticalProgressBar4.Location = new System.Drawing.Point(176, 157);
this.verticalProgressBar4.Maximum = 2000;
this.verticalProgressBar4.Minimum = 1000;
this.verticalProgressBar4.Name = "verticalProgressBar4";
this.verticalProgressBar4.Size = new System.Drawing.Size(24, 84);
this.verticalProgressBar4.Step = 1;
this.verticalProgressBar4.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.verticalProgressBar4.TabIndex = 6;
this.verticalProgressBar4.Value = 1000;
//
// verticalProgressBar3
//
this.verticalProgressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRear", true));
this.verticalProgressBar3.IsVertical = true;
this.verticalProgressBar3.Location = new System.Drawing.Point(124, 157);
this.verticalProgressBar3.Maximum = 2000;
this.verticalProgressBar3.Minimum = 1000;
this.verticalProgressBar3.Name = "verticalProgressBar3";
this.verticalProgressBar3.Size = new System.Drawing.Size(24, 84);
this.verticalProgressBar3.Step = 1;
this.verticalProgressBar3.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.verticalProgressBar3.TabIndex = 4;
this.verticalProgressBar3.Value = 1000;
//
// verticalProgressBar2
//
this.verticalProgressBar2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorFront", true));
this.verticalProgressBar2.IsVertical = true;
this.verticalProgressBar2.Location = new System.Drawing.Point(68, 157);
this.verticalProgressBar2.Maximum = 2000;
this.verticalProgressBar2.Minimum = 1000;
this.verticalProgressBar2.Name = "verticalProgressBar2";
this.verticalProgressBar2.Size = new System.Drawing.Size(24, 84);
this.verticalProgressBar2.Step = 1;
this.verticalProgressBar2.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.verticalProgressBar2.TabIndex = 2;
this.verticalProgressBar2.Value = 1000;
//
// verticalProgressBar1
//
this.verticalProgressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorLeft", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.verticalProgressBar1.IsVertical = true;
this.verticalProgressBar1.Location = new System.Drawing.Point(12, 157);
this.verticalProgressBar1.Maximum = 2000;
this.verticalProgressBar1.Minimum = 1000;
this.verticalProgressBar1.Name = "verticalProgressBar1";
this.verticalProgressBar1.Size = new System.Drawing.Size(24, 84);
this.verticalProgressBar1.Step = 1;
this.verticalProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.verticalProgressBar1.TabIndex = 0;
this.verticalProgressBar1.Value = 1000;
//
// textBox8 // textBox8
// //
this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "MotorFront", true)); this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "MotorFront", true));
@ -369,40 +247,230 @@
this.textBox10.Size = new System.Drawing.Size(47, 20); this.textBox10.Size = new System.Drawing.Size(47, 20);
this.textBox10.TabIndex = 31; this.textBox10.TabIndex = 31;
// //
// indicatorRollGyro
//
this.indicatorRollGyro.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.indicatorRollGyro.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.indicatorRollGyro.BarBorderColor = System.Drawing.Color.Maroon;
this.indicatorRollGyro.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.indicatorRollGyro.BarDividersCount = 20;
this.indicatorRollGyro.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.indicatorRollGyro.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.indicatorRollGyro.IsVertical = false;
this.indicatorRollGyro.Location = new System.Drawing.Point(12, 28);
this.indicatorRollGyro.Max = 500;
this.indicatorRollGyro.Min = -500;
this.indicatorRollGyro.Name = "indicatorRollGyro";
this.indicatorRollGyro.Offset = 0;
this.indicatorRollGyro.Size = new System.Drawing.Size(109, 20);
this.indicatorRollGyro.TabIndex = 32;
this.indicatorRollGyro.Value = 100;
//
// indicatorRollAccel
//
this.indicatorRollAccel.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.indicatorRollAccel.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.indicatorRollAccel.BarBorderColor = System.Drawing.Color.Maroon;
this.indicatorRollAccel.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.indicatorRollAccel.BarDividersCount = 20;
this.indicatorRollAccel.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.indicatorRollAccel.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelRoll", true));
this.indicatorRollAccel.IsVertical = false;
this.indicatorRollAccel.Location = new System.Drawing.Point(12, 78);
this.indicatorRollAccel.Max = 500;
this.indicatorRollAccel.Min = -500;
this.indicatorRollAccel.Name = "indicatorRollAccel";
this.indicatorRollAccel.Offset = 0;
this.indicatorRollAccel.Size = new System.Drawing.Size(109, 20);
this.indicatorRollAccel.TabIndex = 33;
this.indicatorRollAccel.Value = 100;
//
// linearIndicatorControl1
//
this.linearIndicatorControl1.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl1.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl1.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl1.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl1.BarDividersCount = 20;
this.linearIndicatorControl1.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroPitch", true));
this.linearIndicatorControl1.IsVertical = true;
this.linearIndicatorControl1.Location = new System.Drawing.Point(199, 21);
this.linearIndicatorControl1.Max = 500;
this.linearIndicatorControl1.Min = -500;
this.linearIndicatorControl1.Name = "linearIndicatorControl1";
this.linearIndicatorControl1.Offset = 0;
this.linearIndicatorControl1.Size = new System.Drawing.Size(20, 82);
this.linearIndicatorControl1.TabIndex = 34;
this.linearIndicatorControl1.Value = 100;
//
// linearIndicatorControl2
//
this.linearIndicatorControl2.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl2.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl2.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl2.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl2.BarDividersCount = 20;
this.linearIndicatorControl2.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelPitch", true));
this.linearIndicatorControl2.IsVertical = true;
this.linearIndicatorControl2.Location = new System.Drawing.Point(264, 21);
this.linearIndicatorControl2.Max = 500;
this.linearIndicatorControl2.Min = -500;
this.linearIndicatorControl2.Name = "linearIndicatorControl2";
this.linearIndicatorControl2.Offset = 0;
this.linearIndicatorControl2.Size = new System.Drawing.Size(20, 82);
this.linearIndicatorControl2.TabIndex = 35;
this.linearIndicatorControl2.Value = 100;
//
// linearIndicatorControl3
//
this.linearIndicatorControl3.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl3.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl3.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl3.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl3.BarDividersCount = 20;
this.linearIndicatorControl3.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorLeft", true));
this.linearIndicatorControl3.IsVertical = true;
this.linearIndicatorControl3.Location = new System.Drawing.Point(15, 157);
this.linearIndicatorControl3.Max = 1000;
this.linearIndicatorControl3.Min = 0;
this.linearIndicatorControl3.Name = "linearIndicatorControl3";
this.linearIndicatorControl3.Offset = 0;
this.linearIndicatorControl3.Size = new System.Drawing.Size(20, 84);
this.linearIndicatorControl3.TabIndex = 36;
this.linearIndicatorControl3.Value = 100;
//
// linearIndicatorControl4
//
this.linearIndicatorControl4.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl4.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl4.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl4.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl4.BarDividersCount = 20;
this.linearIndicatorControl4.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorFront", true));
this.linearIndicatorControl4.IsVertical = true;
this.linearIndicatorControl4.Location = new System.Drawing.Point(71, 157);
this.linearIndicatorControl4.Max = 1000;
this.linearIndicatorControl4.Min = 0;
this.linearIndicatorControl4.Name = "linearIndicatorControl4";
this.linearIndicatorControl4.Offset = 0;
this.linearIndicatorControl4.Size = new System.Drawing.Size(20, 84);
this.linearIndicatorControl4.TabIndex = 37;
this.linearIndicatorControl4.Value = 100;
//
// linearIndicatorControl5
//
this.linearIndicatorControl5.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl5.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl5.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl5.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl5.BarDividersCount = 20;
this.linearIndicatorControl5.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl5.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRear", true));
this.linearIndicatorControl5.IsVertical = true;
this.linearIndicatorControl5.Location = new System.Drawing.Point(124, 157);
this.linearIndicatorControl5.Max = 1000;
this.linearIndicatorControl5.Min = 0;
this.linearIndicatorControl5.Name = "linearIndicatorControl5";
this.linearIndicatorControl5.Offset = 0;
this.linearIndicatorControl5.Size = new System.Drawing.Size(20, 84);
this.linearIndicatorControl5.TabIndex = 38;
this.linearIndicatorControl5.Value = 100;
//
// linearIndicatorControl6
//
this.linearIndicatorControl6.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl6.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl6.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl6.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl6.BarDividersCount = 20;
this.linearIndicatorControl6.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl6.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRear", true));
this.linearIndicatorControl6.IsVertical = true;
this.linearIndicatorControl6.Location = new System.Drawing.Point(179, 157);
this.linearIndicatorControl6.Max = 1000;
this.linearIndicatorControl6.Min = 0;
this.linearIndicatorControl6.Name = "linearIndicatorControl6";
this.linearIndicatorControl6.Offset = 0;
this.linearIndicatorControl6.Size = new System.Drawing.Size(20, 84);
this.linearIndicatorControl6.TabIndex = 39;
this.linearIndicatorControl6.Value = 100;
//
// linearIndicatorControl7
//
this.linearIndicatorControl7.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl7.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl7.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl7.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl7.BarDividersCount = 20;
this.linearIndicatorControl7.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl7.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroYaw", true));
this.linearIndicatorControl7.IsVertical = false;
this.linearIndicatorControl7.Location = new System.Drawing.Point(225, 157);
this.linearIndicatorControl7.Max = 500;
this.linearIndicatorControl7.Min = -500;
this.linearIndicatorControl7.Name = "linearIndicatorControl7";
this.linearIndicatorControl7.Offset = 0;
this.linearIndicatorControl7.Size = new System.Drawing.Size(109, 20);
this.linearIndicatorControl7.TabIndex = 40;
this.linearIndicatorControl7.Value = 100;
//
// linearIndicatorControl8
//
this.linearIndicatorControl8.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl8.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl8.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl8.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl8.BarDividersCount = 20;
this.linearIndicatorControl8.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl8.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelZ", true));
this.linearIndicatorControl8.IsVertical = true;
this.linearIndicatorControl8.Location = new System.Drawing.Point(353, 21);
this.linearIndicatorControl8.Max = 500;
this.linearIndicatorControl8.Min = -500;
this.linearIndicatorControl8.Name = "linearIndicatorControl8";
this.linearIndicatorControl8.Offset = 0;
this.linearIndicatorControl8.Size = new System.Drawing.Size(20, 82);
this.linearIndicatorControl8.TabIndex = 41;
this.linearIndicatorControl8.Value = 100;
//
// FlightDataView // FlightDataView
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.linearIndicatorControl8);
this.Controls.Add(this.linearIndicatorControl7);
this.Controls.Add(this.linearIndicatorControl6);
this.Controls.Add(this.linearIndicatorControl5);
this.Controls.Add(this.linearIndicatorControl4);
this.Controls.Add(this.linearIndicatorControl3);
this.Controls.Add(this.linearIndicatorControl2);
this.Controls.Add(this.linearIndicatorControl1);
this.Controls.Add(this.indicatorRollAccel);
this.Controls.Add(this.indicatorRollGyro);
this.Controls.Add(this.textBox10); this.Controls.Add(this.textBox10);
this.Controls.Add(this.textBox9); this.Controls.Add(this.textBox9);
this.Controls.Add(this.textBox8); this.Controls.Add(this.textBox8);
this.Controls.Add(this.progressBar3);
this.Controls.Add(this.label9); this.Controls.Add(this.label9);
this.Controls.Add(this.textBox6); this.Controls.Add(this.textBox6);
this.Controls.Add(this.label10); this.Controls.Add(this.label10);
this.Controls.Add(this.textBox7); this.Controls.Add(this.textBox7);
this.Controls.Add(this.verticalProgressBar8);
this.Controls.Add(this.label8); this.Controls.Add(this.label8);
this.Controls.Add(this.textBox5); this.Controls.Add(this.textBox5);
this.Controls.Add(this.verticalProgressBar6);
this.Controls.Add(this.label7); this.Controls.Add(this.label7);
this.Controls.Add(this.textBox4); this.Controls.Add(this.textBox4);
this.Controls.Add(this.sensorPitchGyro);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.sensorRollAcc);
this.Controls.Add(this.textBox3); this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox2);
this.Controls.Add(this.label5); this.Controls.Add(this.label5);
this.Controls.Add(this.sensorRollGyro);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
this.Controls.Add(this.label4); this.Controls.Add(this.label4);
this.Controls.Add(this.verticalProgressBar4);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.verticalProgressBar3);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.verticalProgressBar2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.verticalProgressBar1);
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.Name = "FlightDataView"; this.Name = "FlightDataView";
this.Size = new System.Drawing.Size(402, 275); this.Size = new System.Drawing.Size(402, 275);
@ -416,17 +484,6 @@
private System.Windows.Forms.BindingSource FlightDataVmBindingSource; private System.Windows.Forms.BindingSource FlightDataVmBindingSource;
private LinearSensorIndicatorControl sensorRollGyro;
private LinearSensorIndicatorControl verticalProgressBar1;
private LinearSensorIndicatorControl verticalProgressBar2;
private LinearSensorIndicatorControl verticalProgressBar3;
private LinearSensorIndicatorControl verticalProgressBar4;
private LinearSensorIndicatorControl sensorPitchGyro;
private LinearSensorIndicatorControl verticalProgressBar6;
private LinearSensorIndicatorControl verticalProgressBar8;
private LinearSensorIndicatorControl sensorRollAcc;
private LinearSensorIndicatorControl progressBar3;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
@ -449,5 +506,15 @@
private System.Windows.Forms.TextBox textBox8; private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.TextBox textBox9; private System.Windows.Forms.TextBox textBox9;
private System.Windows.Forms.TextBox textBox10; private System.Windows.Forms.TextBox textBox10;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl indicatorRollGyro;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl indicatorRollAccel;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl1;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl2;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl3;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl4;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl5;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl6;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl7;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl8;
} }
} }

View File

@ -20,9 +20,10 @@ namespace ArducopterConfigurator.views
public override void SetDataContext(FlightDataVm model) public override void SetDataContext(FlightDataVm model)
{ {
FlightDataVmBindingSource.DataSource = model; FlightDataVmBindingSource.DataSource = model;
}
if (Program.IsMonoRuntime)
model.PropertyChanged += ((sender, e) => FlightDataVmBindingSource.ResetBindings(false));
}
} }
// Required for VS2008 designer. No functional value // Required for VS2008 designer. No functional value
public class FlightDataViewDesignable : ViewCommon<FlightDataVm> { } public class FlightDataViewDesignable : ViewCommon<FlightDataVm> { }

View File

@ -31,10 +31,9 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.progressBar3 = new System.Windows.Forms.ProgressBar(); this.TransmitterChannelsBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox(); this.textBox6 = new System.Windows.Forms.TextBox();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox();
@ -43,11 +42,12 @@
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox(); this.textBox5 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.TransmitterChannelsBindingSource = new System.Windows.Forms.BindingSource(this.components); this.linearIndicatorControl3 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.verticalProgressBar4 = new ArducopterConfigurator.VerticalProgressBar(); this.linearIndicatorControl1 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.verticalProgressBar3 = new ArducopterConfigurator.VerticalProgressBar(); this.linearIndicatorControl2 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.verticalProgressBar2 = new ArducopterConfigurator.VerticalProgressBar(); this.linearIndicatorControl4 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.verticalProgressBar1 = new ArducopterConfigurator.VerticalProgressBar(); this.linearIndicatorControl5 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl6 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -69,16 +69,9 @@
this.label2.TabIndex = 3; this.label2.TabIndex = 3;
this.label2.Text = "Pitch"; this.label2.Text = "Pitch";
// //
// progressBar3 // TransmitterChannelsBindingSource
// //
this.progressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Yaw", true)); this.TransmitterChannelsBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.TransmitterChannelsVm);
this.progressBar3.Location = new System.Drawing.Point(174, 30);
this.progressBar3.Maximum = 2000;
this.progressBar3.Minimum = 1000;
this.progressBar3.Name = "progressBar3";
this.progressBar3.Size = new System.Drawing.Size(100, 23);
this.progressBar3.TabIndex = 31;
this.progressBar3.Value = 1000;
// //
// label9 // label9
// //
@ -98,17 +91,6 @@
this.textBox6.Size = new System.Drawing.Size(47, 20); this.textBox6.Size = new System.Drawing.Size(47, 20);
this.textBox6.TabIndex = 29; this.textBox6.TabIndex = 29;
// //
// progressBar1
//
this.progressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Roll", true));
this.progressBar1.Location = new System.Drawing.Point(174, 80);
this.progressBar1.Maximum = 2000;
this.progressBar1.Minimum = 1000;
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(100, 23);
this.progressBar1.TabIndex = 34;
this.progressBar1.Value = 1000;
//
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
@ -181,76 +163,142 @@
this.label5.TabIndex = 41; this.label5.TabIndex = 41;
this.label5.Text = "Aux"; this.label5.Text = "Aux";
// //
// TransmitterChannelsBindingSource // linearIndicatorControl3
// //
this.TransmitterChannelsBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.TransmitterChannelsVm); this.linearIndicatorControl3.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl3.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl3.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl3.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl3.BarDividersCount = 20;
this.linearIndicatorControl3.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Throttle", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.linearIndicatorControl3.IsVertical = true;
this.linearIndicatorControl3.Location = new System.Drawing.Point(16, 30);
this.linearIndicatorControl3.Max = 2000;
this.linearIndicatorControl3.Min = 1000;
this.linearIndicatorControl3.Name = "linearIndicatorControl3";
this.linearIndicatorControl3.Offset = 0;
this.linearIndicatorControl3.Size = new System.Drawing.Size(20, 111);
this.linearIndicatorControl3.TabIndex = 43;
this.linearIndicatorControl3.Value = 1000;
// //
// verticalProgressBar4 // linearIndicatorControl1
// //
this.verticalProgressBar4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Aux", true)); this.linearIndicatorControl1.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.verticalProgressBar4.Location = new System.Drawing.Point(205, 131); this.linearIndicatorControl1.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.verticalProgressBar4.Maximum = 2000; this.linearIndicatorControl1.BarBorderColor = System.Drawing.Color.Maroon;
this.verticalProgressBar4.Minimum = 1000; this.linearIndicatorControl1.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.verticalProgressBar4.Name = "verticalProgressBar4"; this.linearIndicatorControl1.BarDividersCount = 20;
this.verticalProgressBar4.Size = new System.Drawing.Size(27, 73); this.linearIndicatorControl1.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.verticalProgressBar4.TabIndex = 40; this.linearIndicatorControl1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Pitch", true));
this.verticalProgressBar4.Value = 1000; this.linearIndicatorControl1.IsVertical = true;
this.linearIndicatorControl1.Location = new System.Drawing.Point(67, 30);
this.linearIndicatorControl1.Max = 2000;
this.linearIndicatorControl1.Min = 1000;
this.linearIndicatorControl1.Name = "linearIndicatorControl1";
this.linearIndicatorControl1.Offset = 0;
this.linearIndicatorControl1.Size = new System.Drawing.Size(20, 111);
this.linearIndicatorControl1.TabIndex = 44;
this.linearIndicatorControl1.Value = 1000;
// //
// verticalProgressBar3 // linearIndicatorControl2
// //
this.verticalProgressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Mode", true)); this.linearIndicatorControl2.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.verticalProgressBar3.Location = new System.Drawing.Point(145, 131); this.linearIndicatorControl2.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.verticalProgressBar3.Maximum = 2000; this.linearIndicatorControl2.BarBorderColor = System.Drawing.Color.Maroon;
this.verticalProgressBar3.Minimum = 1000; this.linearIndicatorControl2.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.verticalProgressBar3.Name = "verticalProgressBar3"; this.linearIndicatorControl2.BarDividersCount = 20;
this.verticalProgressBar3.Size = new System.Drawing.Size(27, 73); this.linearIndicatorControl2.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.verticalProgressBar3.TabIndex = 37; this.linearIndicatorControl2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Mode", true));
this.verticalProgressBar3.Value = 1000; this.linearIndicatorControl2.IsVertical = true;
this.linearIndicatorControl2.Location = new System.Drawing.Point(155, 131);
this.linearIndicatorControl2.Max = 2000;
this.linearIndicatorControl2.Min = 1000;
this.linearIndicatorControl2.Name = "linearIndicatorControl2";
this.linearIndicatorControl2.Offset = 0;
this.linearIndicatorControl2.Size = new System.Drawing.Size(20, 73);
this.linearIndicatorControl2.TabIndex = 45;
this.linearIndicatorControl2.Value = 1000;
// //
// verticalProgressBar2 // linearIndicatorControl4
// //
this.verticalProgressBar2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Pitch", true)); this.linearIndicatorControl4.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.verticalProgressBar2.Location = new System.Drawing.Point(67, 30); this.linearIndicatorControl4.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.verticalProgressBar2.Maximum = 2000; this.linearIndicatorControl4.BarBorderColor = System.Drawing.Color.Maroon;
this.verticalProgressBar2.Minimum = 1000; this.linearIndicatorControl4.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.verticalProgressBar2.Name = "verticalProgressBar2"; this.linearIndicatorControl4.BarDividersCount = 20;
this.verticalProgressBar2.Size = new System.Drawing.Size(27, 111); this.linearIndicatorControl4.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.verticalProgressBar2.TabIndex = 2; this.linearIndicatorControl4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Aux", true));
this.verticalProgressBar2.Value = 1000; this.linearIndicatorControl4.IsVertical = true;
this.linearIndicatorControl4.Location = new System.Drawing.Point(206, 131);
this.linearIndicatorControl4.Max = 2000;
this.linearIndicatorControl4.Min = 1000;
this.linearIndicatorControl4.Name = "linearIndicatorControl4";
this.linearIndicatorControl4.Offset = 0;
this.linearIndicatorControl4.Size = new System.Drawing.Size(20, 73);
this.linearIndicatorControl4.TabIndex = 46;
this.linearIndicatorControl4.Value = 1000;
// //
// verticalProgressBar1 // linearIndicatorControl5
// //
this.verticalProgressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Throttle", true)); this.linearIndicatorControl5.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.verticalProgressBar1.Location = new System.Drawing.Point(15, 30); this.linearIndicatorControl5.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.verticalProgressBar1.Maximum = 2000; this.linearIndicatorControl5.BarBorderColor = System.Drawing.Color.Maroon;
this.verticalProgressBar1.Minimum = 1000; this.linearIndicatorControl5.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.verticalProgressBar1.Name = "verticalProgressBar1"; this.linearIndicatorControl5.BarDividersCount = 20;
this.verticalProgressBar1.Size = new System.Drawing.Size(27, 111); this.linearIndicatorControl5.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.verticalProgressBar1.TabIndex = 0; this.linearIndicatorControl5.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Roll", true));
this.verticalProgressBar1.Value = 1000; this.linearIndicatorControl5.IsVertical = false;
this.linearIndicatorControl5.Location = new System.Drawing.Point(174, 80);
this.linearIndicatorControl5.Max = 2000;
this.linearIndicatorControl5.Min = 1000;
this.linearIndicatorControl5.Name = "linearIndicatorControl5";
this.linearIndicatorControl5.Offset = 0;
this.linearIndicatorControl5.Size = new System.Drawing.Size(100, 20);
this.linearIndicatorControl5.TabIndex = 47;
this.linearIndicatorControl5.Value = 1000;
//
// linearIndicatorControl6
//
this.linearIndicatorControl6.BarBackgroundDark = System.Drawing.Color.FromArgb(((int)(((byte)(199)))), ((int)(((byte)(200)))), ((int)(((byte)(201)))));
this.linearIndicatorControl6.BarBackgroundLight = System.Drawing.Color.WhiteSmoke;
this.linearIndicatorControl6.BarBorderColor = System.Drawing.Color.Maroon;
this.linearIndicatorControl6.BarDark = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(68)))), ((int)(((byte)(202)))));
this.linearIndicatorControl6.BarDividersCount = 20;
this.linearIndicatorControl6.BarLight = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(144)))), ((int)(((byte)(252)))));
this.linearIndicatorControl6.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Yaw", true));
this.linearIndicatorControl6.IsVertical = false;
this.linearIndicatorControl6.Location = new System.Drawing.Point(174, 30);
this.linearIndicatorControl6.Max = 2000;
this.linearIndicatorControl6.Min = 1000;
this.linearIndicatorControl6.Name = "linearIndicatorControl6";
this.linearIndicatorControl6.Offset = 0;
this.linearIndicatorControl6.Size = new System.Drawing.Size(100, 20);
this.linearIndicatorControl6.TabIndex = 48;
this.linearIndicatorControl6.Value = 1000;
// //
// TransmitterChannelsView // TransmitterChannelsView
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.linearIndicatorControl6);
this.Controls.Add(this.linearIndicatorControl5);
this.Controls.Add(this.linearIndicatorControl4);
this.Controls.Add(this.linearIndicatorControl2);
this.Controls.Add(this.linearIndicatorControl1);
this.Controls.Add(this.linearIndicatorControl3);
this.Controls.Add(this.textBox5); this.Controls.Add(this.textBox5);
this.Controls.Add(this.label5); this.Controls.Add(this.label5);
this.Controls.Add(this.verticalProgressBar4);
this.Controls.Add(this.textBox4); this.Controls.Add(this.textBox4);
this.Controls.Add(this.label4); this.Controls.Add(this.label4);
this.Controls.Add(this.verticalProgressBar3);
this.Controls.Add(this.textBox3); this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox2);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
this.Controls.Add(this.progressBar3);
this.Controls.Add(this.label9); this.Controls.Add(this.label9);
this.Controls.Add(this.textBox6); this.Controls.Add(this.textBox6);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.verticalProgressBar2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.verticalProgressBar1);
this.Name = "TransmitterChannelsView"; this.Name = "TransmitterChannelsView";
this.Size = new System.Drawing.Size(369, 244); this.Size = new System.Drawing.Size(369, 244);
((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).EndInit();
@ -261,24 +309,24 @@
#endregion #endregion
private VerticalProgressBar verticalProgressBar1;
private System.Windows.Forms.BindingSource TransmitterChannelsBindingSource; private System.Windows.Forms.BindingSource TransmitterChannelsBindingSource;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private VerticalProgressBar verticalProgressBar2;
private System.Windows.Forms.ProgressBar progressBar3;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox6; private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private VerticalProgressBar verticalProgressBar3;
private System.Windows.Forms.TextBox textBox5; private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private VerticalProgressBar verticalProgressBar4; private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl3;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl1;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl2;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl4;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl5;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl6;
} }
} }

View File

@ -0,0 +1,44 @@
namespace ArducopterConfigurator.Views.controls
{
partial class LinearIndicatorControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UserControl1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(422, 50);
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -0,0 +1,345 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;
/*
* Starting point for this control:
* http://www.codeproject.com/KB/progress/iTunes_Bar.aspx
*
*/
namespace ArducopterConfigurator.Views.controls
{
/// <summary>
/// </summary>
[ToolboxBitmap(typeof(System.Windows.Forms.ProgressBar))]
public partial class LinearIndicatorControl : UserControl
{
/// <summary>
/// This enum represents the diffrent states the control can take.
/// Animation for ex. makes the procent bar "Rubber band" to the new procent value
/// </summary>
public enum BarType
{
Static, // Plain and simple bar with procent display
Progressbar, // This makes the control act as a progressbar
Animated // This makes the control "Rubber band" to new procent values (Animated).
};
#region Static Members
public static readonly Color PreBarBaseDark = Color.FromArgb(199, 200, 201);
public static readonly Color PreBarBaseLight = Color.WhiteSmoke;
public static readonly Color PreBarLight = Color.FromArgb(102, 144, 252);
public static readonly Color PreBarDark = Color.FromArgb(40, 68, 202);
public static readonly Color PreBorderColor = Color.DarkGray;
#endregion
#region Private Members
/// <summary>
/// The Light background color
/// </summary>
private Color _barBgLightColour = PreBarBaseLight;
/// <summary>
/// The Dark background color
/// </summary>
private Color _barBgDarkColor = PreBarBaseDark;
/// <summary>
/// The Light bar color
/// </summary>
private Color _barLightColour = PreBarLight;
/// <summary>
/// The Dark bar color
/// </summary>
private Color _barDarkColour = PreBarDark;
/// <summary>
/// The Border color for the control
/// </summary>
private Color _borderColor = PreBorderColor;
/// <summary>
/// The border width
/// </summary>
private float _borderWidth = 1.0F;
private int _min = 0;
private int _max = 100;
private int _val = 50;
private int _offset = 0;
/// <summary>
/// The number of dividers to draw in the bar
/// </summary>
private int iNumDividers = 10;
private bool _isVertical = false;
#endregion
public LinearIndicatorControl()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.ResizeRedraw, true);
InitializeComponent();
this.Width = 300;
this.Height = 50;
}
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
/// </summary>
/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
protected override void OnPaint(PaintEventArgs e)
{
var g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.Clear(BackColor);
var bmp = GenerateProcentBarBitmap(Width, Height, BackColor);
g.DrawImage(bmp, 0, 0);
}
// Generate the bar image on graphics g
// g is the graphics of the whole control
private void GenerateBar(Graphics g, float x, float y, float width, float height, bool isVertical)
{
float totalWidth = width;
var rect = new RectangleF(x, y, width, height);
// Fill the background
using (var white = new LinearGradientBrush(rect, _barBgLightColour, _barBgDarkColor, isVertical ? 0 : 90.0F, false))
g.FillRectangle(white, rect);
// Border around the whole thing
using (Pen p = new Pen(_borderColor, _borderWidth * 2))
{
p.Alignment = PenAlignment.Outset;
p.LineJoin = LineJoin.Round;
g.DrawRectangle(p, x, y, width, height);
}
// Now do the progress bar that represents the value
var barSize = (float)Math.Abs(_val - _offset) / (_max - _min) * (isVertical ? height : width);
var barStart = (float)(Math.Min(_offset, _val) - _min) / (_max - _min) * (isVertical ? height : width);
if (barSize > 0.10F)
{
rect = isVertical
? new RectangleF(x, y + height - ( barStart + barSize), width, barSize)
: new RectangleF(x + barStart, y, barSize, height);
using (var bg = new LinearGradientBrush(rect, _barLightColour, _barDarkColour, isVertical ? 0 : 90.0F, false))
g.FillRectangle(bg, rect);
using (Pen p = new Pen(_borderColor, _borderWidth))
{
p.Alignment = PenAlignment.Inset;
p.LineJoin = LineJoin.Round;
g.DrawLine(p, width, y, width, height);
}
}
// using (Pen p = new Pen(_barDarkColour, _borderWidth))
// {
// p.Alignment = PenAlignment.Inset;
// p.LineJoin = LineJoin.Round;
// using (Pen p2 = new Pen(_barLightColour, _borderWidth))
// {
// p2.Alignment = PenAlignment.Inset;
// p2.LineJoin = LineJoin.Round;
//
// float procentMarkerWidth = (width / iNumDividers);
//
// for (float i = procentMarkerWidth; i < totalWidth; i += procentMarkerWidth)
// {
// if (i >= width)
// {
// p.Color = _barBgLightColour;
// p2.Color = _barBgDarkColor;
// }
//
// g.DrawLine(p, i, 0, i, height);
// g.DrawLine(p2, i + _borderWidth, 0, i + _borderWidth, height);
//
// }
// }
// }
}
private Bitmap GenerateProcentBarBitmap(int width, int height,Color bgColor)
{
var theImage = new Bitmap(width, height);
using (var g = Graphics.FromImage(theImage))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.Clear(bgColor);
//int height1 = height - (height / 3);
int height1 = height;
var bmp1 = new Bitmap(width, height1);
var g1 = Graphics.FromImage(bmp1);
GenerateBar(g1, 0.0F, 0.0F, width, height1, _isVertical);
g1.Dispose();
var bmp = bmp1;
g.DrawImage(bmp, 0, 0);
g.Dispose();
bmp.Dispose();
}
return theImage;
}
/// <summary>
/// Gets or sets the number of bar dividers to display.
/// </summary>
/// <value>The num bar dividers.</value>
[System.ComponentModel.Description("Gets or sets how many dividers to display on the bar")]
[System.ComponentModel.DefaultValue(10)]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public int BarDividersCount
{
get { return iNumDividers; }
set { iNumDividers = value; Refresh(); }
}
/// <summary>
/// Gets or sets the width of the border.
/// </summary>
/// <value>The width of the border.</value>
[System.ComponentModel.Description("Gets or sets the with of the borders")]
[System.ComponentModel.DefaultValue(1.0f)]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public float BarBorderWidth
{
get { return _borderWidth; }
set { _borderWidth = value; Refresh(); }
}
/// <summary>
/// Gets or sets the bar background light.
/// </summary>
/// <value>The bar background light.</value>
[System.ComponentModel.Description("Gets or sets the lighter background color")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public Color BarBackgroundLight
{
get { return _barBgLightColour; }
set { _barBgLightColour = value; Refresh(); }
}
/// <summary>
/// Gets or sets the bar background dark.
/// </summary>
/// <value>The bar background dark.</value>
[System.ComponentModel.Description("Gets or sets the darker background color")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public Color BarBackgroundDark
{
get { return _barBgDarkColor; }
set { _barBgDarkColor = value; Refresh(); }
}
/// <summary>
/// Gets or sets the bar light.
/// </summary>
/// <value>The bar light.</value>
[System.ComponentModel.Description("Gets or sets the light bar color")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public Color BarLight
{
get { return _barLightColour; }
set { _barLightColour = value; Refresh(); }
}
/// <summary>
/// Gets or sets the bar dark.
/// </summary>
/// <value>The bar dark.</value>
[System.ComponentModel.Description("Gets or sets the dark bar color")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public Color BarDark
{
get { return _barDarkColour; }
set { _barDarkColour = value; Refresh(); }
}
/// <summary>
/// Gets or sets the color of the border.
/// </summary>
/// <value>The color of the border.</value>
[System.ComponentModel.Description("Gets or sets the border color")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public Color BarBorderColor
{
get { return _borderColor; }
set { _borderColor = value; Refresh(); }
}
[System.ComponentModel.Description("Gets or sets the Minimum Value")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public int Min
{
get { return _min; }
set { _min = value; Refresh(); }
}
[System.ComponentModel.Description("Gets or sets the Minimum Value")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public int Max
{
get { return _max; }
set { _max = value; Refresh(); }
}
[System.ComponentModel.Description("Gets or sets the Offset Value")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public int Offset
{
get { return _offset; }
set { _offset = value; Refresh(); }
}
[System.ComponentModel.Description("Gets or sets the Value")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public int Value
{
get { return _val; }
set { _val = value; Refresh(); }
}
[System.ComponentModel.Description("Gets or sets whether the indicator is vertical")]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public bool IsVertical
{
get { return _isVertical; }
set { _isVertical = value; Refresh(); }
}
}
}

View File

@ -1,111 +0,0 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace ArducopterConfigurator
{
/// <summary>
/// This is a custom tweaking of the standard Progress bar
/// </summary>
[ToolboxBitmap(typeof(ProgressBar))]
public class LinearSensorIndicatorControl : ProgressBar
{
private bool m_IsVertical;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
if (m_IsVertical)
cp.Style |= 0x04;
return cp;
}
}
public new int Value {
get
{
return base.Value;
}
set
{
if (value<Minimum)
{
// don't do it
value = Minimum;
}
if (value > Maximum)
{
// don't do it
value = Maximum;
}
base.Value = value;
}
}
public new int Maximum
{
get
{
return base.Maximum;
}
set
{
base.Maximum = value;
}
}
public new int Minimum
{
get
{
return base.Minimum ;
}
set
{
base.Minimum = value;
}
}
[Description("Whether the display grows vertically")]
[Category("LinearSensorIndicatorControl")]
[DefaultValue(false)]
[RefreshProperties(RefreshProperties.All)]
public bool IsVertical
{
get
{
return m_IsVertical;
}
set
{
m_IsVertical = value;
Invalidate();
}
}
// [Description("An offset that will be added to every value applied")]
// [Category("LinearSensorIndicatorControl")]
// [DefaultValue(0)]
// [RefreshProperties(RefreshProperties.All)]
// public int Offset
// {
// get
// {
// return m_Offset;
// }
// set
// {
// m_Offset = value;
// Invalidate();
// }
// }
}
}

View File

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="verticalProgressBar1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@ -1,24 +0,0 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace ArducopterConfigurator
{
[Description("Vertical Progress Bar")]
[ToolboxBitmap(typeof(ProgressBar))]
public class VerticalProgressBar : ProgressBar
{
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style |= 0x04;
return cp;
}
}
}
}

View File

@ -95,7 +95,6 @@ namespace ArducopterConfigurator
mainVmBindingSource.DataSource = model; mainVmBindingSource.DataSource = model;
availablePortsBindingSource.DataSource = model.AvailablePorts; availablePortsBindingSource.DataSource = model.AvailablePorts;
foreach (var monitorVm in _vm.MonitorVms) foreach (var monitorVm in _vm.MonitorVms)
{ {
var tp = new TabPage(monitorVm.Name) {Tag = monitorVm}; var tp = new TabPage(monitorVm.Name) {Tag = monitorVm};
@ -114,6 +113,10 @@ namespace ArducopterConfigurator
UpdateConnectionStatusLabel(); UpdateConnectionStatusLabel();
_vm.PropertyChanged += ((sender, e) => UpdateConnectionStatusLabel()); _vm.PropertyChanged += ((sender, e) => UpdateConnectionStatusLabel());
// hack for INPC subscribe bug in Mono
if (Program.IsMonoRuntime)
model.PropertyChanged += ((sender, e) => mainVmBindingSource.ResetBindings(false));
} }
public Control Control public Control Control
@ -125,6 +128,7 @@ namespace ArducopterConfigurator
private void tabCtrlConfigs_Selected(object sender, TabControlEventArgs e) private void tabCtrlConfigs_Selected(object sender, TabControlEventArgs e)
{ {
Console.WriteLine("Tab click");
var control = e.TabPage.Controls[0]; var control = e.TabPage.Controls[0];
control.Size = e.TabPage.ClientRectangle.Size; control.Size = e.TabPage.ClientRectangle.Size;
var tabVm = e.TabPage.Tag as MonitorVm; var tabVm = e.TabPage.Tag as MonitorVm;

View File

@ -127,18 +127,18 @@
<data name="btnConnect.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnConnect.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwAAA YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvAAA
DsABataJCQAAAl5JREFUOE+Vk91PkmEYxnFtbWxmbdGsbG3O3Go2a2vDLyRNQpSGmJCAKaJimRCigoAF DrwBlbxySQAAAllJREFUOE+Vk91PkmEYxtna2tzM2qJZ2dqcudVs1NaGX0iShKgNMV8TMEVULBNCVBCw
goRuhVnqCyTx4jA0P1plZWQurWgeuJV9HXTWQf9F2xUvB+/G4CCe7bfdB8993dd97XkyGGkeW1giABhd QJDUrTBKfAElXpyIptkyKzNjSWXzwK3s66CzDvov2q6Ag3djcBDP9ttzn9zXfd3XnofBSPNYQoTQPEes
GRmMkF2xtJRWuykoEllDEnz4Po+HETPMQXFXSgGjh8/u89aQ/b4aUMRqotdXLTL5RdjYmcX7bw+w+TWI RG8izVYGwxAQicyzBD58X8CjdSOMAXFXShG9W8Du81RR/d4qxIjWZK+3UmTwibC5G8T7b1OIfA1gYPoS
gekLSCmgHa8kn0Un8OtPNI7/lQX6ST7WtgN4vX0XM2s96CcE0N6rTHRgW5Du1k3ygpPLeqxs3UEgoomz UgqonTxqZWsCv/5sxfG9MkHrEmBjx4/XO/cxs9GDflII9QNeogPLYsNejYsfcC1rsbp9D/51VZzwl2lE
/mUamztzePLRiannHdC4z0I9UqJLmE6FY59rRGh9CK32M7AHxbj/VEnjX70O92ITOpxFaLGeTmyWLkh3 dufx9KMdk887oHKch3K0WJMwPRaOdb4Rs+EhtFrPwRoQ4+EzOY1v7SYcS03osBeixXw2sblhsWGPiRJH
WUhxbLcwfvxehf+FGTJTAYweHlxz9TTupSa4SBUuGU5MJO3eS1THAvLGrA/j088Qppb7UK/Lg2asGJYA dwvhx+81+F4YITEUQO/mY2S+jsbxpAkjlAJXdKcmknbvJSujAXmi1ofx6ecsJpf7UKfJg2q8CCY/nyb4
j2b2rQ0ibe7fJIFrbi7C7ww065+9GAt3o/ZKDtpchdARxXF6PKUQqA8lp9/mZBNmby18LztpVrbcGCXV 1gKROvdvksANBxehdzqa8GcPxkPdqL6Wg7YRFjRkUZwedwmEyiPJ6bfZ2aTRUw3vy06a1W0HxiglKuRM
qFKyoBjKR+d4IWQ3j6GyZT+Z5EBuKRhUO0swOi/B7cVGmscbDjh8zeDKsyDUHgRHlkmWy7PYCQIXe/MG yIby0elkQXL7BHgtB6kkB1JTwaDSXoyxBQJ3lxppHm/aYPM2gyvNQo36MDiSTKpMmsVOELjcmzeoMLOx
VVY2VqJTGH5UB4OnAtYZAQ0ZGYBxvA4Vzft8SZNrrx42KIyFWNx0wxzgo33kFIRdR6C4cRx6b2kcpeMk ujWJ4bla6NzlMM8Iaaj1AeidtShvPuBNmlx9/ahOpmdhKeKA0S9A++gZ1HQdg+zWSWg9JXHkttOxLMiU
lQWR8tXx27Mx++ZWLJwyKGz54KkOUHDOKVlEVSsLFFR9/nJ2bkqBcvkeg7A7Bw2mo+Aq9qJMnslJ64dR r07Qno3gmzvRcEohs+SDrzgUg3NBziQrWpmIEasvXs3OTSlQJt2nq+nOQb3hOLiy/SiVZnLS/mWFRIao
l4skTFFJA5MsljATw/kPpX+3FV/8pJwsRgAAAABJRU5ErkJggg== uD6DKiIyEsP5D6V/yZResf187DwAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@ -147,8 +147,8 @@
<data name="button1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="button1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwAAA YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvAAA
DsABataJCQAAAmhJREFUOE+Vk21IU1EYxwdBYG479567uzvdSzMTIbEUwpAWmAoVNjHMDKoPYVSKlBbL DrwBlbxySQAAAmhJREFUOE+Vk21IU1EYxwdBYG479567uzvdSzMTIbEUwpAWmAoVNjHMDKoPYVSKlBbL
SsgKsQ81NV1LGjLaqJmgNm/zhd6gCDOyPqS1jDLJXuxT0Nfg37nTLr0sqQs/zoFznx/P+T8cjeY/vxvi SsgKsQ81NV1LGjLaqJmgNm/zhd6gCDOyPqS1jDLJXuxT0Nfg37nTLr0sqQs/zoFznx/P+T8cjeY/vxvi
ko0RKTE8YNJuXbBUlvQ5slHrl406KPQbdV62FkcsFNNnajG62QFZ1Fb+VdLLil8e24uvEV+MsR1FCLPi ko0RKTE8YNJuXbBUlvQ5slHrl406KPQbdV62FkcsFNNnajG62QFZ1Fb+VdLLil8e24uvEV+MsR1FCLPi
qaYafD5VhneN+xBO5hBXcE3UV46UbcCHhnK83Z0VY7a5CjOeE5ipcyJaloE+qwDlv7iCbo1mcUjiMJqX qaYafD5VhneN+xBO5hBXcE3UV46UbcCHhnK83Z0VY7a5CjOeE5ipcyJaloE+qwDlv7iCbo1mcUjiMJqX
@ -164,8 +164,8 @@
<data name="button2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="button2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvwAA YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvAAA
Dr8BOAVTJAAAAtVJREFUOE9jYKAaiN/PweB3RIohcL8MGIPYIDFigVbd+cTIeXfuxS+5+yQWiCPn3X4o DrwBlbxySQAAAtVJREFUOE9jYKAaiN/PweB3RIohcL8MGIPYIDFigVbd+cTIeXfuxS+5+yQWiCPn3X4o
X3Y2EaRfMOOojkbN2XKprCMGOM2TyDoakrfm3tcZ59/+nw7EnQef/dGqPJnKELhTLHzGtcNzT77+X7Hh X3Y2EaRfMOOojkbN2XKprCMGOM2TyDoakrfm3tcZ59/+nw7EnQef/dGqPJnKELhTLHzGtcNzT77+X7Hh
wQXdsuOeDAz1TKgGWazktG87M6dx95P/vcde/u8/8ep/4Zo772Sz9tsw+K8X8Oo9N7Nr18PP666+/1+z wQXdsuOeDAz1TKgGWazktG87M6dx95P/vcde/u8/8ep/4Zo772Sz9tsw+K8X8Oo9N7Nr18PP666+/1+z
8d5VsDgykEvZ4ZO/6taHroPP/sfOvHSvZM3tL7EzLt5hcFsuC1ZnPJNLJWtvYenqGx/mnnr1P3jCme0M 8d5VsDgykEvZ4ZO/6taHroPP/sfOvHSvZM3tL7EzLt5hcFsuC1ZnPJNLJWtvYenqGx/mnnr1P3jCme0M