Configurator.Net: Tx calibration changes

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1711 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
mandrolic 2011-02-21 21:54:22 +00:00
parent 3121f943c0
commit 50e427fa95
5 changed files with 87 additions and 36 deletions

View File

@ -20,9 +20,45 @@ namespace ArducopterConfigurator.PresentationModels
PropsInUpdateOrder = new[] {"P", "I", "D",}; PropsInUpdateOrder = new[] {"P", "I", "D",};
} }
public float P { get; set; }
public float I { get; set; } private float _p;
public float D { get; set; } public float P
{
get { return _p; }
set
{
if (_p == value) return;
_p = value;
FirePropertyChanged("P");
}
}
private float _i;
public float I
{
get { return _i; }
set
{
if (_i == value) return;
_i = value;
FirePropertyChanged("I");
}
}
private float _d;
public float D
{
get { return _d; }
set
{
if (_d == value) return;
_d = value;
FirePropertyChanged("D");
}
}
public override string Name public override string Name
{ {

View File

@ -19,7 +19,6 @@ namespace ArducopterConfigurator.PresentationModels
get { return _isCalibrating; } get { return _isCalibrating; }
set set
{ {
if (_isCalibrating == value) return;
_isCalibrating = value; _isCalibrating = value;
FirePropertyChanged("IsCalibrating"); FirePropertyChanged("IsCalibrating");
} }
@ -129,11 +128,11 @@ namespace ArducopterConfigurator.PresentationModels
); );
sendString("1" + vals);
IsCalibrating = false; IsCalibrating = false;
HideWatermarks(); HideWatermarks();
// save // save
//sendString(WRITE_TO_EEPROM); //sendString(WRITE_TO_EEPROM);
} }
@ -176,6 +175,7 @@ namespace ArducopterConfigurator.PresentationModels
public void Activate() public void Activate()
{ {
IsCalibrating = false; IsCalibrating = false;
HideWatermarks();
sendString(START_UPDATES); sendString(START_UPDATES);
} }
@ -204,6 +204,8 @@ namespace ArducopterConfigurator.PresentationModels
if (_roll == value) return; if (_roll == value) return;
_roll = value; _roll = value;
FirePropertyChanged("Roll"); FirePropertyChanged("Roll");
if (!_isCalibrating) return;
if (value > RollMax) if (value > RollMax)
RollMax = value; RollMax = value;
if (value < RollMin) if (value < RollMin)
@ -244,6 +246,8 @@ namespace ArducopterConfigurator.PresentationModels
if (_pitch == value) return; if (_pitch == value) return;
_pitch = value; _pitch = value;
FirePropertyChanged("Pitch"); FirePropertyChanged("Pitch");
if (!_isCalibrating) return;
if (value > PitchMax) if (value > PitchMax)
PitchMax = value; PitchMax = value;
if (value < PitchMin) if (value < PitchMin)
@ -264,7 +268,6 @@ namespace ArducopterConfigurator.PresentationModels
} }
private int _pitchMin; private int _pitchMin;
public int PitchMin public int PitchMin
{ {
get { return _pitchMin; } get { return _pitchMin; }
@ -286,6 +289,8 @@ namespace ArducopterConfigurator.PresentationModels
if (_yaw == value) return; if (_yaw == value) return;
_yaw = value; _yaw = value;
FirePropertyChanged("Yaw"); FirePropertyChanged("Yaw");
if (!_isCalibrating) return;
if (value > YawMax) if (value > YawMax)
YawMax = value; YawMax = value;
if (value < YawMin) if (value < YawMin)
@ -326,6 +331,7 @@ namespace ArducopterConfigurator.PresentationModels
if (_throttle == value) return; if (_throttle == value) return;
_throttle = value; _throttle = value;
FirePropertyChanged("Throttle"); FirePropertyChanged("Throttle");
if (!_isCalibrating) return;
if (value > ThrottleMax) if (value > ThrottleMax)
ThrottleMax = value; ThrottleMax = value;
if (value < ThrottleMin) if (value < ThrottleMin)
@ -366,6 +372,7 @@ namespace ArducopterConfigurator.PresentationModels
if (_mode == value) return; if (_mode == value) return;
_mode = value; _mode = value;
FirePropertyChanged("Mode"); FirePropertyChanged("Mode");
if (!_isCalibrating) return;
if (value > ModeMax) if (value > ModeMax)
ModeMax = value; ModeMax = value;
if (value < ModeMin) if (value < ModeMin)
@ -406,6 +413,8 @@ namespace ArducopterConfigurator.PresentationModels
if (_aux == value) return; if (_aux == value) return;
_aux = value; _aux = value;
FirePropertyChanged("Aux"); FirePropertyChanged("Aux");
if (!_isCalibrating) return;
if (value > AuxMax) if (value > AuxMax)
AuxMax = value; AuxMax = value;
if (value < AuxMin) if (value < AuxMin)

View File

@ -21,8 +21,8 @@ namespace ArducopterConfigurator
var t = Type.GetType("Mono.Runtime"); var t = Type.GetType("Mono.Runtime");
IsMonoRuntime = (t != null); IsMonoRuntime = (t != null);
//var session = new CommsSession(); var session = new CommsSession();
var session = new FakeCommsSession(); //var session = new FakeCommsSession();
var mainVm = new MainVm(session); var mainVm = new MainVm(session);

View File

@ -90,12 +90,13 @@
// //
// textBox6 // textBox6
// //
this.textBox6.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Yaw", true)); this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Yaw", true));
this.textBox6.Enabled = false; this.textBox6.Enabled = false;
this.textBox6.Location = new System.Drawing.Point(206, 26); this.textBox6.Location = new System.Drawing.Point(206, 26);
this.textBox6.Name = "textBox6"; this.textBox6.Name = "textBox6";
this.textBox6.ReadOnly = true; this.textBox6.ReadOnly = true;
this.textBox6.Size = new System.Drawing.Size(35, 20); this.textBox6.Size = new System.Drawing.Size(35, 13);
this.textBox6.TabIndex = 29; this.textBox6.TabIndex = 29;
// //
// label3 // label3
@ -109,42 +110,46 @@
// //
// textBox1 // textBox1
// //
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Roll", true)); this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Roll", true));
this.textBox1.Enabled = false; this.textBox1.Enabled = false;
this.textBox1.Location = new System.Drawing.Point(206, 76); this.textBox1.Location = new System.Drawing.Point(206, 76);
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true; this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(35, 20); this.textBox1.Size = new System.Drawing.Size(35, 13);
this.textBox1.TabIndex = 32; this.textBox1.TabIndex = 32;
// //
// textBox2 // textBox2
// //
this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Throttle", true)); this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Throttle", true));
this.textBox2.Enabled = false; this.textBox2.Enabled = false;
this.textBox2.Location = new System.Drawing.Point(13, 141); this.textBox2.Location = new System.Drawing.Point(13, 141);
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.ReadOnly = true; this.textBox2.ReadOnly = true;
this.textBox2.Size = new System.Drawing.Size(35, 20); this.textBox2.Size = new System.Drawing.Size(35, 13);
this.textBox2.TabIndex = 35; this.textBox2.TabIndex = 35;
// //
// textBox3 // textBox3
// //
this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Pitch", true)); this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Pitch", true));
this.textBox3.Enabled = false; this.textBox3.Enabled = false;
this.textBox3.Location = new System.Drawing.Point(65, 141); this.textBox3.Location = new System.Drawing.Point(65, 141);
this.textBox3.Name = "textBox3"; this.textBox3.Name = "textBox3";
this.textBox3.ReadOnly = true; this.textBox3.ReadOnly = true;
this.textBox3.Size = new System.Drawing.Size(35, 20); this.textBox3.Size = new System.Drawing.Size(35, 13);
this.textBox3.TabIndex = 36; this.textBox3.TabIndex = 36;
// //
// textBox4 // textBox4
// //
this.textBox4.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Mode", true)); this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Mode", true));
this.textBox4.Enabled = false; this.textBox4.Enabled = false;
this.textBox4.Location = new System.Drawing.Point(118, 182); this.textBox4.Location = new System.Drawing.Point(118, 182);
this.textBox4.Name = "textBox4"; this.textBox4.Name = "textBox4";
this.textBox4.ReadOnly = true; this.textBox4.ReadOnly = true;
this.textBox4.Size = new System.Drawing.Size(35, 20); this.textBox4.Size = new System.Drawing.Size(35, 13);
this.textBox4.TabIndex = 39; this.textBox4.TabIndex = 39;
// //
// label4 // label4
@ -158,12 +163,13 @@
// //
// textBox5 // textBox5
// //
this.textBox5.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Aux", true)); this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Aux", true));
this.textBox5.Enabled = false; this.textBox5.Enabled = false;
this.textBox5.Location = new System.Drawing.Point(176, 182); this.textBox5.Location = new System.Drawing.Point(176, 182);
this.textBox5.Name = "textBox5"; this.textBox5.Name = "textBox5";
this.textBox5.ReadOnly = true; this.textBox5.ReadOnly = true;
this.textBox5.Size = new System.Drawing.Size(35, 20); this.textBox5.Size = new System.Drawing.Size(35, 13);
this.textBox5.TabIndex = 42; this.textBox5.TabIndex = 42;
// //
// label5 // label5
@ -395,7 +401,7 @@
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Name = "TransmitterChannelsView"; this.Name = "TransmitterChannelsView";
this.Size = new System.Drawing.Size(465, 244); this.Size = new System.Drawing.Size(399, 244);
((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -123,31 +123,31 @@
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <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"> <data name="button3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
R0lGODlhFgAVAPMAADJ/x+/3/5rA40qOzrPP6v///1mX0sHY7lGT0PT4/LfS68bb70qUzgAAAAAAAAAA R0lGODlhFgAVAIMAADJ/x+/3/5rA40qOzrPP6v///1mX0sHY7lGT0PT4/LfS68bb70qUzgAAAAAAAAAA
ACwAAAAAFgAVAAAEU7DISQuoOM+r+/YgB2riiJVmkQgIgAhJmhjGASyIEY+CIV0zgWlw+EkUiBNgyWw6 ACH/C05FVFNDQVBFMi4wAwEBAAAh+QQAAAAAACwAAAAAFgAVAAAIdAALCBxIsACAgggTDjyosOFChxAZ
nxmisYA09WLAgXA0QygAhNyOy3LBUhQU2rKuqNHvVNw0L0QAADs= QlQocSLCihYLJBCAAAACAQkyJjBg4ACABQgMhJwowIDAgyMFWBxw4KVABQguAtjJs6fPnwlp2iyA02LL
kDAHyJw4EoECAARSrmTK0SPIjAQxYjW4taBWrF8zhrU4tkBAADs=
</value> </value>
</data> </data>
<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
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCwAA YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgA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