2010-12-18 18:23:09 -04:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace ArducopterConfigurator.PresentationModels
|
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
public class AcroModeConfigVm : ConfigWithPidsBase, IPresentationModel, ItalksToApm
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
public AcroModeConfigVm()
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
|
|
|
PropsInUpdateOrder = new[]
|
|
|
|
{
|
|
|
|
"RollP",
|
|
|
|
"RollI",
|
|
|
|
"RollD",
|
|
|
|
"PitchP",
|
|
|
|
"PitchI",
|
|
|
|
"PitchD",
|
|
|
|
"YawP",
|
|
|
|
"YawI",
|
|
|
|
"YawD",
|
|
|
|
"TransmitterFactor",
|
|
|
|
};
|
|
|
|
|
|
|
|
RefreshCommand = new DelegateCommand(_ => RefreshValues());
|
|
|
|
UpdateCommand = new DelegateCommand(_ => UpdateValues());
|
|
|
|
}
|
|
|
|
|
2010-12-22 02:42:16 -04:00
|
|
|
public float TransmitterFactor { get; set; }
|
2010-12-18 18:23:09 -04:00
|
|
|
|
|
|
|
public ICommand RefreshCommand { get; private set; }
|
|
|
|
|
|
|
|
public ICommand UpdateCommand { get; private set; }
|
2011-02-13 05:25:54 -04:00
|
|
|
|
2010-12-18 18:23:09 -04:00
|
|
|
|
2011-02-13 05:25:54 -04:00
|
|
|
public void UpdateValues()
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
if (sendTextToApm != null)
|
|
|
|
sendTextToApm(this, new sendTextToApmEventArgs(ComposePropsWithCommand("O")));
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
|
|
|
|
2011-02-13 05:25:54 -04:00
|
|
|
public void RefreshValues()
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
if (sendTextToApm != null)
|
|
|
|
sendTextToApm(this, new sendTextToApmEventArgs("P"));
|
|
|
|
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
|
|
|
|
2011-02-13 05:25:54 -04:00
|
|
|
public string Name
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
get { return "Acro Mode"; }
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
|
|
|
|
2011-02-13 05:25:54 -04:00
|
|
|
public void Activate()
|
2010-12-18 18:23:09 -04:00
|
|
|
{
|
2011-02-13 05:25:54 -04:00
|
|
|
RefreshValues();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DeActivate()
|
|
|
|
{
|
|
|
|
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
2011-02-13 05:25:54 -04:00
|
|
|
|
|
|
|
public event EventHandler updatedByApm;
|
|
|
|
|
|
|
|
public void handleLineOfText(string strRx)
|
|
|
|
{
|
|
|
|
PopulatePropsFromUpdate(strRx,true);
|
|
|
|
if (updatedByApm != null)
|
|
|
|
updatedByApm(this, EventArgs.Empty);
|
|
|
|
}
|
|
|
|
|
|
|
|
public event EventHandler<sendTextToApmEventArgs> sendTextToApm;
|
2010-12-18 18:23:09 -04:00
|
|
|
}
|
|
|
|
}
|