2011-02-13 05:25:54 -04:00
|
|
|
using System;
|
|
|
|
|
2010-12-18 18:23:09 -04:00
|
|
|
namespace ArducopterConfigurator.PresentationModels
|
|
|
|
{
|
2010-12-22 06:04:16 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Vm for Altitude hold settings
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// Todo: this one is weird because the APM sends and receives the values
|
|
|
|
/// in a different order
|
|
|
|
/// There is a unit test to cover it but it will need fixing.
|
2011-02-14 10:48:47 -04:00
|
|
|
/// TODO: test this
|
2010-12-22 06:04:16 -04:00
|
|
|
/// </remarks>
|
2011-02-16 18:19:32 -04:00
|
|
|
public class AltitudeHoldConfigVm : CrudVm
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
public AltitudeHoldConfigVm()
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-14 10:48:47 -04:00
|
|
|
updateString = "E";
|
|
|
|
refreshString = "F";
|
|
|
|
PropsInUpdateOrder = new[] {"P", "I", "D",};
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
|
|
|
|
2011-02-21 17:54:22 -04:00
|
|
|
|
|
|
|
private float _p;
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-18 18:23:09 -04:00
|
|
|
|
2011-02-14 10:48:47 -04:00
|
|
|
public override string Name
|
2011-02-13 05:25:54 -04:00
|
|
|
{
|
|
|
|
get { return "Altitude Hold"; }
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|