Configurator.Net: Transmitter calibration (In Progress)

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1700 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
mandrolic 2011-02-20 23:01:29 +00:00
parent 8655c01612
commit 747f01769d
17 changed files with 864 additions and 41 deletions

View File

@ -54,6 +54,18 @@
<Compile Include="PresentationModels\MainVm.cs" />
<Compile Include="PresentationModels\SensorsVm.cs" />
<Compile Include="PresentationModels\VmBase.cs" />
<Compile Include="Views\controls\PropControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Views\controls\PropControl.Designer.cs">
<DependentUpon>PropControl.cs</DependentUpon>
</Compile>
<Compile Include="Views\controls\QuadPlanControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Views\controls\QuadPlanControl.Designer.cs">
<DependentUpon>QuadPlanControl.cs</DependentUpon>
</Compile>
<Compile Include="Views\controls\LinearIndicatorControl.cs">
<SubType>UserControl</SubType>
</Compile>
@ -192,6 +204,12 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Views\controls\PropControl.resx">
<DependentUpon>PropControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Views\controls\QuadPlanControl.resx">
<DependentUpon>QuadPlanControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Views\PositionAltitudePidsView.resx">
<DependentUpon>PositionAltitudePidsView.cs</DependentUpon>
</EmbeddedResource>

View File

@ -6,6 +6,26 @@ namespace ArducopterConfigurator.PresentationModels
{
public class TransmitterChannelsVm : NotifyProperyChangedBase, IPresentationModel
{
private const string CALIB_REFRESH = "J";
private const string CALIB_UPDATE = "I";
private const string STOP_UPDATES = "X";
private const string START_UPDATES = "U";
private const string WRITE_TO_EEPROM = "W";
private bool _isCalibrating;
public bool IsCalibrating
{
get { return _isCalibrating; }
set
{
if (_isCalibrating == value) return;
_isCalibrating = value;
FirePropertyChanged("IsCalibrating");
}
}
private readonly string[] _propsInUpdateOrder = new[]
{
"Roll", // Aileron
@ -22,9 +42,105 @@ namespace ArducopterConfigurator.PresentationModels
public TransmitterChannelsVm()
{
StartCalibrationCommand = new DelegateCommand(_ => BeginCalibration(),_=>!IsCalibrating);
SaveCalibrationCommand = new DelegateCommand(_ => SaveCalibration(),_=> IsCalibrating);
// todo: cancel calibration?
CancelCalibrationCommand = new DelegateCommand(_ => CancelCalibration(), _ => IsCalibrating);
ResetCommand = new DelegateCommand(_ => ResetWatermarks());
}
private void sendString(string str)
{
if (sendTextToApm != null)
sendTextToApm(this, new sendTextToApmEventArgs(str));
}
private void BeginCalibration()
{
ResetWatermarks();
IsCalibrating = true;
// send x command to stop jabber
sendString(STOP_UPDATES);
// send command to clear the slope and offsets
// 11;0;1;0;1;0;1;0;1;0;1;0;
sendString("11;0;1;0;1;0;1;0;1;0;1;0;");
// continue the sensor
sendString(START_UPDATES);
}
private void CancelCalibration()
{
IsCalibrating = false;
}
private float GetScale(int min, int max)
{
var span = max - min;
return 1000F / span;
}
private int GetOffset(int min, int max)
{
return 0 - (int) ((min * GetScale(min,max)-1000));
}
private void SaveCalibration()
{
// send values
// eg 1.17,-291.91,1.18,-271.76,1.19,-313.91,1.18,-293.63,1.66,-1009.9
// ch_roll_slope = readFloatSerial();
// ch_roll_offset = readFloatSerial();
// ch_pitch_slope = readFloatSerial();
// ch_pitch_offset = readFloatSerial();
// ch_yaw_slope = readFloatSerial();
// ch_yaw_offset = readFloatSerial();
// ch_throttle_slope = readFloatSerial();
// ch_throttle_offset = readFloatSerial();
// ch_aux_slope = readFloatSerial();
// ch_aux_offset = readFloatSerial();
// ch_aux2_slope = readFloatSerial();
// ch_aux2_offset = readFloatSerial();
// From Configurator:
// 1.20,-331.74,1.20,-296.87,1.21,-350.73,1.19,-315.41,1.76,-1186.95,1.77,-1194.35
var vals = string.Format("{0:0.00};{1};{2:0.00};{3};{4:0.00};{5};{6:0.00};{7};{8:0.00};{9};{10:0.00};{11};",
GetScale(RollMin, RollMax),
GetOffset(RollMin, RollMax),
GetScale(PitchMin, PitchMax),
GetOffset(PitchMin, PitchMax),
GetScale(YawMin, YawMax),
GetOffset(YawMin, YawMax),
GetScale(ThrottleMin, ThrottleMax),
GetOffset(ThrottleMin, ThrottleMax),
GetScale(AuxMin, AuxMax),
GetOffset(AuxMin, AuxMax),
GetScale(ModeMin, ModeMax),
GetOffset(ModeMin, ModeMax) // this correct?
);
IsCalibrating = false;
// save
//sendString(WRITE_TO_EEPROM);
}
private void ResetWatermarks()
{
ThrottleMin = ThrottleMax = Throttle;
@ -36,12 +152,45 @@ namespace ArducopterConfigurator.PresentationModels
}
public ICommand ResetCommand { get; private set; }
public ICommand StartCalibrationCommand { get; private set; }
public ICommand SaveCalibrationCommand { get; private set; }
public ICommand CancelCalibrationCommand { get; private set; }
public int RollMidValue { get; set; }
public int PitchMidValue { get; set; }
public int YawMidValue { get; set; }
public string Name
{
get { return "Transmitter Channels"; }
}
public void Activate()
{
IsCalibrating = false;
sendString(START_UPDATES);
}
public void DeActivate()
{
sendString(STOP_UPDATES);
}
public event EventHandler updatedByApm;
public void handleLineOfText(string strRx)
{
PropertyHelper.PopulatePropsFromUpdate(this, _propsInUpdateOrder, strRx, false);
}
public event EventHandler<sendTextToApmEventArgs> sendTextToApm;
#region bindables
private int _roll;
public int Roll
{
@ -273,6 +422,7 @@ namespace ArducopterConfigurator.PresentationModels
}
private int _auxMin;
public int AuxMin
{
get { return _auxMin; }
@ -284,34 +434,8 @@ namespace ArducopterConfigurator.PresentationModels
}
}
public string Name
{
get { return "Transmitter Channels"; }
}
#endregion
public void Activate()
{
if (sendTextToApm != null)
sendTextToApm(this, new sendTextToApmEventArgs("U"));
}
public void DeActivate()
{
if (sendTextToApm != null)
sendTextToApm(this, new sendTextToApmEventArgs("X"));
}
public event EventHandler updatedByApm;
public void handleLineOfText(string strRx)
{
PropertyHelper.PopulatePropsFromUpdate(this, _propsInUpdateOrder, strRx, false);
}
public event EventHandler<sendTextToApmEventArgs> sendTextToApm;
}
}

View File

@ -14,11 +14,12 @@ namespace ArducopterConfigurator.Views
public AcroConfigView()
{
InitializeComponent();
BindButtons();
}
public override void SetDataContext(AcroModeConfigVm vm)
{
BindButtons(vm);
AcroModeConfigVmBindingSource.DataSource = vm;
if (Program.IsMonoRuntime)

View File

@ -14,11 +14,13 @@ namespace ArducopterConfigurator.Views
public AltitudeHoldConfigView()
{
InitializeComponent();
BindButtons();
}
public override void SetDataContext(AltitudeHoldConfigVm vm)
{
BindButtons(vm);
AltitudeHoldConfigBindingSource.DataSource = vm;
if (Program.IsMonoRuntime)

View File

@ -15,11 +15,14 @@ namespace ArducopterConfigurator.views
public FlightDataView()
{
InitializeComponent();
BindButtons();
}
public override void SetDataContext(SensorsVm vm)
{
BindButtons(vm);
FlightDataVmBindingSource.DataSource = vm;
if (Program.IsMonoRuntime)

View File

@ -12,11 +12,14 @@ namespace ArducopterConfigurator.Views
public PositionHoldConfigView()
{
InitializeComponent();
BindButtons();
}
public override void SetDataContext(PositionHoldConfigVm vm)
{
BindButtons(vm);
PositionHoldConfigBindingSource.DataSource = vm;
if (Program.IsMonoRuntime)

View File

@ -14,11 +14,14 @@ namespace ArducopterConfigurator.Views
public StableConfigView()
{
InitializeComponent();
BindButtons();
}
public override void SetDataContext(StableModeConfigVm vm)
{
BindButtons(vm);
StableModeConfigVmBindingSource.DataSource = vm;
if (Program.IsMonoRuntime)

View File

@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TransmitterChannelsView));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.TransmitterChannelsBindingSource = new System.Windows.Forms.BindingSource(this.components);
@ -49,6 +50,12 @@
this.linearIndicatorControl5 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.linearIndicatorControl6 = new ArducopterConfigurator.Views.controls.LinearIndicatorControl();
this.button1 = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.button4 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).BeginInit();
this.SuspendLayout();
//
@ -183,7 +190,7 @@
this.linearIndicatorControl3.MinWatermark = 0;
this.linearIndicatorControl3.Name = "linearIndicatorControl3";
this.linearIndicatorControl3.Offset = 0;
this.linearIndicatorControl3.Size = new System.Drawing.Size(20, 111);
this.linearIndicatorControl3.Size = new System.Drawing.Size(14, 111);
this.linearIndicatorControl3.TabIndex = 43;
this.linearIndicatorControl3.Value = 1600;
this.linearIndicatorControl3.WatermarkLineColor = System.Drawing.Color.Red;
@ -207,7 +214,7 @@
this.linearIndicatorControl1.MinWatermark = 0;
this.linearIndicatorControl1.Name = "linearIndicatorControl1";
this.linearIndicatorControl1.Offset = 0;
this.linearIndicatorControl1.Size = new System.Drawing.Size(20, 111);
this.linearIndicatorControl1.Size = new System.Drawing.Size(14, 111);
this.linearIndicatorControl1.TabIndex = 44;
this.linearIndicatorControl1.Value = 1100;
this.linearIndicatorControl1.WatermarkLineColor = System.Drawing.Color.Red;
@ -231,7 +238,7 @@
this.linearIndicatorControl2.MinWatermark = 0;
this.linearIndicatorControl2.Name = "linearIndicatorControl2";
this.linearIndicatorControl2.Offset = 0;
this.linearIndicatorControl2.Size = new System.Drawing.Size(20, 57);
this.linearIndicatorControl2.Size = new System.Drawing.Size(14, 57);
this.linearIndicatorControl2.TabIndex = 45;
this.linearIndicatorControl2.Value = 1050;
this.linearIndicatorControl2.WatermarkLineColor = System.Drawing.Color.Red;
@ -255,7 +262,7 @@
this.linearIndicatorControl4.MinWatermark = 0;
this.linearIndicatorControl4.Name = "linearIndicatorControl4";
this.linearIndicatorControl4.Offset = 0;
this.linearIndicatorControl4.Size = new System.Drawing.Size(20, 57);
this.linearIndicatorControl4.Size = new System.Drawing.Size(14, 57);
this.linearIndicatorControl4.TabIndex = 46;
this.linearIndicatorControl4.Value = 1900;
this.linearIndicatorControl4.WatermarkLineColor = System.Drawing.Color.Red;
@ -279,7 +286,7 @@
this.linearIndicatorControl5.MinWatermark = 0;
this.linearIndicatorControl5.Name = "linearIndicatorControl5";
this.linearIndicatorControl5.Offset = 0;
this.linearIndicatorControl5.Size = new System.Drawing.Size(100, 20);
this.linearIndicatorControl5.Size = new System.Drawing.Size(100, 14);
this.linearIndicatorControl5.TabIndex = 47;
this.linearIndicatorControl5.Value = 1300;
this.linearIndicatorControl5.WatermarkLineColor = System.Drawing.Color.Red;
@ -303,7 +310,7 @@
this.linearIndicatorControl6.MinWatermark = 0;
this.linearIndicatorControl6.Name = "linearIndicatorControl6";
this.linearIndicatorControl6.Offset = 0;
this.linearIndicatorControl6.Size = new System.Drawing.Size(100, 20);
this.linearIndicatorControl6.Size = new System.Drawing.Size(100, 14);
this.linearIndicatorControl6.TabIndex = 48;
this.linearIndicatorControl6.Value = 1200;
this.linearIndicatorControl6.WatermarkLineColor = System.Drawing.Color.Red;
@ -318,10 +325,73 @@
this.button1.Text = "Reset";
this.button1.UseVisualStyleBackColor = true;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(304, 159);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(84, 13);
this.label12.TabIndex = 53;
this.label12.Text = "Save Calibration";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(304, 130);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(48, 13);
this.label11.TabIndex = 52;
this.label11.Text = "Calibrate";
//
// button3
//
this.button3.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.TransmitterChannelsBindingSource, "StartCalibrationCommand", true));
this.button3.Image = ((System.Drawing.Image)(resources.GetObject("button3.Image")));
this.button3.Location = new System.Drawing.Point(272, 123);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(26, 26);
this.button3.TabIndex = 51;
this.button3.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.TransmitterChannelsBindingSource, "SaveCalibrationCommand", true));
this.button2.Image = ((System.Drawing.Image)(resources.GetObject("button2.Image")));
this.button2.Location = new System.Drawing.Point(272, 152);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(26, 26);
this.button2.TabIndex = 50;
this.button2.UseVisualStyleBackColor = true;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(304, 189);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(40, 13);
this.label6.TabIndex = 55;
this.label6.Text = "Cancel";
//
// button4
//
this.button4.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.TransmitterChannelsBindingSource, "CancelCalibrationCommand", true));
this.button4.Image = ((System.Drawing.Image)(resources.GetObject("button4.Image")));
this.button4.Location = new System.Drawing.Point(272, 182);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(26, 26);
this.button4.TabIndex = 54;
this.button4.UseVisualStyleBackColor = true;
//
// TransmitterChannelsView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label6);
this.Controls.Add(this.button4);
this.Controls.Add(this.label12);
this.Controls.Add(this.label11);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.linearIndicatorControl6);
this.Controls.Add(this.linearIndicatorControl5);
@ -371,5 +441,11 @@
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl5;
private ArducopterConfigurator.Views.controls.LinearIndicatorControl linearIndicatorControl6;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button button4;
}
}

View File

@ -14,11 +14,14 @@ namespace ArducopterConfigurator.Views
public TransmitterChannelsView()
{
InitializeComponent();
BindButtons();
}
public override void SetDataContext(TransmitterChannelsVm vm)
{
BindButtons(vm);
TransmitterChannelsBindingSource.DataSource = vm;
if (Program.IsMonoRuntime)

View File

@ -120,4 +120,143 @@
<metadata name="TransmitterChannelsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="button3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
R0lGODlhFgAVAIMAADJ/x+/3/5rA40qOzrPP6v///1mX0sHY7lGT0PT4/LfS68bb70qUzgAAAAAAAAAA
ACH/C05FVFNDQVBFMi4wAwEBAAAh+QQABwD/ACwAAAAAFgAVAAAIdAALCBxIsACAgggTDjyosOFChxAZ
QlQocSLCihYLJBCAAAACAQkyJjBg4ACABQgMhJwowIDAgyMFWBxw4KVABQguAtjJs6fPnwlp2iyA02LL
kDAHyJw4EoECAARSrmTK0SPIjAQxYjW4taBWrF8zhrU4tkBAADs=
</value>
</data>
<data name="button2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
bGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZE
sRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3P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5igztGNuqx0mr
GScYdvJ0mYWUcguegAMlGEYJLeFVgrgDYZ5RN/Ls4VukHxlFlWtGOnWmj5S8Zl74aAjVx7cJesNsKe0i
teg8YW+EZf8KTk8In+LC5/Og2tHCtkMjgiv42V8jifuRdK23Sd3VhkorCvjcOMMBYd9FRHR1ej34I4/w
B9yERLw180tSBO+pipuk7hEOEgUS50STsKU+iPHcKCbzLYzmQRrahzC1DVLfNkR9+wCGtjHSdurZmlXP
c7uNnGi8xn9S4RHZGLiTUQAAAABJRU5ErkJggg==
</value>
</data>
<data name="button4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
bGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZE
sRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQyhPwgzyc6RGRUXTs
AIABHmCAKQBMVka6X7B7CBDJy82FniFyAl8EAfB6WLwCcNPQM4BOB/+fpFnpfIHomAARm7M5GSwRF4g4
JUuQLrbPipgalyxmGCVmvihBEcuJOWGRDT77LLKjmNmpPLaIxTmns1PZYu4V8bZMIUfEiK+ICzO5nCwR
3xKxRoowlSviN+LYVA4zAwAUSWwXcFiJIjYRMYkfEuQi4uUA4EgJX3HcVyzgZAvEl3JJS8/hcxMSBXQd
li7d1NqaQffkZKVwBALDACYrmcln013SUtOZvBwAFu/8WTLi2tJFRbY0tba0NDQzMv2qUP91829K3NtF
ehn4uWcQrf+L7a/80hoAYMyJarPziy2uCoDOLQDI3fti0zgAgKSobx3Xv7oPTTwviQJBuo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+ImJD4LggxAU+1D3LwU4Hr33+A9Le
oz9RdcVNlcXJCmtJycamVgjjIpNUCyTUIsfGKtre+2gtS5Qdv4FUeqyP97vmqLgYSDZ94P2XwZkAN60x
rt2L0C+HGbaLnC3EootkQY1wW9n7kPzqfqTiqhtUfuOi8oJDdIiKDrGkzc0RErGQxJ8kUNIJ6zHe6/ib
D8z32X9sAKnok2E0ZheadgdrwuJfnjhX70W5Lke4PhukzxblZ1lhdNrDgivGmqj3zrcPeLdlnvxPryCp
K76j+JxM+dkZUX098W52E51Y+ydpOWFm8yR2Eqf47BQfti6Sre1BytZcZl/rAiUtM1y1K4K2klxUcmEC
r4jlJadhmaiYbcD+mDcaZygxybx0QNxCztuXeNk4TaHBwT6TlULdHUrFz4LTMjkmO4UNVor0s+QZJilu
tJNjnCS3aY699XfY+VY3UlbZBfbofydXP4VakLKFUH1yFnWtzO5TVgp0IxTUTZCnnyD/5G/k1N0lq/Yu
ebpJdrzehZRZ1kXWF1Pk1/wpROOMzM2zrISIB7x4gg9ZCiooyiPcvgh/yH627DpNYa0N9WdTZLzSiZRW
0E7mUSsvHpHZXj2KKxwi/VUL6fst+PwhQoEois9JNODE6w6gUhvYXjNGxvEJnk8UyCz5igztGNuqx0mr
GScYdvJ0mYWUcguegAMlGEYJLeFVgrgDYZ5RN/Ls4VukHxlFlWtGOnWmj5S8Zl74aAjVx7cJesNsKe0i
teg8YW+EZf8KTk8In+LC5/Og2tHCtkMjgiv42V8jifuRdK23Sd3VhkorCvjcOMMBYd9FRHR1ej34I4/w
B9yERLw180tSBO+pipuk7hEOEgUS50STsKU+iPHcKCbzLYzmQRrahzC1DVLfNkR9+wCGtjHSdurZmlXP
c7uNnGi8xn9S4RHZGLiTUQAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@ -1,21 +1,24 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
using ArducopterConfigurator.PresentationModels;
namespace ArducopterConfigurator.Views
{
// cannot be abstract due to vs2008 designer
public class ViewCommon<T> : UserControl, IView<T> where T : IPresentationModel
public class ViewCommon<T> : UserControl, IView<T> where T : IPresentationModel, INotifyPropertyChanged
{
public virtual void SetDataContext(T vm)
{
}
protected void BindButtons()
protected void BindButtons(T vm)
{
foreach (var c in this.Controls)
if (c is Button)
(c as Button).Click += btn_Click;
vm.PropertyChanged += CheckCommandStates;
}
protected void btn_Click(object sender, EventArgs e)
@ -27,6 +30,18 @@ namespace ArducopterConfigurator.Views
cmd.Execute(null);
}
void CheckCommandStates(object sender, PropertyChangedEventArgs e)
{
foreach (var c in this.Controls)
{
var btn = c as Button;
if (btn == null) continue;
var cmd = btn.Tag as ICommand;
if (cmd != null)
btn.Enabled = cmd.CanExecute(null);
}
}
public Control Control
{
get { return this; }

View File

@ -0,0 +1,45 @@
namespace ArducopterConfigurator.Views.controls
{
partial class PropControl
{
/// <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();
//
// PropControl
//
// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
// this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "PropControl";
this.Size = new System.Drawing.Size(50, 50);
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -0,0 +1,45 @@
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace ArducopterConfigurator.Views.controls
{
public partial class PropControl : Control
{
public PropControl()
{
InitializeComponent();
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.ResizeRedraw, true);
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
var g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.Clear(BackColor);
// var rect =new RectangleF(x, y + height - (barStart + barSize), width, barSize)
//
// 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);
// }
// var bmp = GenerateProcentBarBitmap(Width, Height, BackColor);
// g.DrawImage(bmp, 0, 0);
}
}
}

View File

@ -0,0 +1,120 @@
<?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>
</root>

View File

@ -0,0 +1,55 @@
namespace ArducopterConfigurator.Views.controls
{
partial class QuadPlanControl
{
/// <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.propControl1 = new ArducopterConfigurator.Views.controls.PropControl();
this.SuspendLayout();
//
// propControl1
//
this.propControl1.Location = new System.Drawing.Point(49, 3);
this.propControl1.Name = "propControl1";
this.propControl1.Size = new System.Drawing.Size(50, 50);
this.propControl1.TabIndex = 0;
//
// QuadPlanControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.propControl1);
this.Name = "QuadPlanControl";
this.ResumeLayout(false);
}
#endregion
private PropControl propControl1;
}
}

View File

@ -0,0 +1,51 @@
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
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 QuadPlanControl : UserControl
{
public QuadPlanControl()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.ResizeRedraw, true);
InitializeComponent();
Width = 50;
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);
}
}
}

View File

@ -0,0 +1,120 @@
<?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>
</root>