ardupilot/Configurator/Configurator.Net/PresentationModels/CalibrationOffsetsDataVm.cs
mandrolic 930b09b286 Configurator.Net: Adding Test project
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1219 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-20 22:14:39 +00:00

65 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace ArducopterConfigurator.PresentationModels
{
public class CalibrationOffsetsDataVm : MonitorVm
{
public CalibrationOffsetsDataVm(IComms sp) : base(sp)
{
PropsInUpdateOrder = new[]
{
"GyroRollOffset",
"GyroPitchOffset",
"GyroYawOffset",
"AccelRollOffset",
"AccelPitchOffset",
"AccelZOffset"
};
RefreshCommand = new DelegateCommand(_ => RefreshValues());
UpdateCommand = new DelegateCommand(_ => UpdateValues());
}
public ICommand RefreshCommand { get; private set; }
public ICommand UpdateCommand { get; private set; }
public int GyroRollOffset { get; set; }
public int GyroPitchOffset { get; set; }
public int GyroYawOffset { get; set; }
public int AccelRollOffset { get; set; }
public int AccelPitchOffset { get; set; }
public int AccelZOffset { get; set; }
protected override void OnActivated()
{
RefreshValues();
}
private void RefreshValues()
{
SendString("J");
}
public void UpdateValues()
{
SendPropsWithCommand("I");
}
protected override void OnStringReceived(string strReceived)
{
PopulatePropsFromUpdate(strReceived,true);
}
public override string Name
{
get { return "Calibration"; }
}
}
}