mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
Configurator.Net: Initial import
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1153 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
d5cc9946c5
commit
3f9a077dbd
198
Configurator/Configurator.Net/ArducopterConfigurator.csproj
Normal file
198
Configurator/Configurator.Net/ArducopterConfigurator.csproj
Normal file
@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AF26391C-7E45-4401-8984-96139A67FF31}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ArducopterConfigurator</RootNamespace>
|
||||
<AssemblyName>ArducopterConfigurator</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CommsSession.cs">
|
||||
</Compile>
|
||||
<Compile Include="PresentationModels\AcroModeConfigVm.cs" />
|
||||
<Compile Include="PresentationModels\AltitudeHoldConfigVm.cs" />
|
||||
<Compile Include="PresentationModels\ConfigWithPidsBase.cs" />
|
||||
<Compile Include="PresentationModels\DelegateCommand.cs" />
|
||||
<Compile Include="PresentationModels\MonitorVm.cs" />
|
||||
<Compile Include="PresentationModels\MainVm.cs" />
|
||||
<Compile Include="PresentationModels\FlightDataMonitorVm.cs" />
|
||||
<Compile Include="mainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="mainForm.Designer.cs">
|
||||
<DependentUpon>mainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NotifyProperyChangedBase.cs" />
|
||||
<Compile Include="PresentationModels\CalibrationOffsetsDataVm.cs" />
|
||||
<Compile Include="PresentationModels\MotorCommandsVm.cs" />
|
||||
<Compile Include="PresentationModels\PositionHoldConfigVm.cs" />
|
||||
<Compile Include="PresentationModels\StableModeConfigVm.cs" />
|
||||
<Compile Include="PresentationModels\TransmitterChannelsVm.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="mainForm.resx">
|
||||
<DependentUpon>mainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SensorDisplay.resx">
|
||||
<DependentUpon>SensorDisplay.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\AcroConfigView.resx">
|
||||
<DependentUpon>AcroConfigView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\AltitudeHoldConfigView.resx">
|
||||
<DependentUpon>AltitudeHoldConfigView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\CalibrationView.resx">
|
||||
<DependentUpon>CalibrationView.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\PositionHoldConfigView.resx">
|
||||
<DependentUpon>PositionHoldConfigView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\StableConfigView.resx">
|
||||
<DependentUpon>StableConfigView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\FlightDataView.resx">
|
||||
<DependentUpon>FlightDataView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\MotorCommandsView.resx">
|
||||
<DependentUpon>MotorCommandsView.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\SerialMonitorView.resx">
|
||||
<DependentUpon>SerialMonitorView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\TransmitterChannelsView.resx">
|
||||
<DependentUpon>TransmitterChannelsView.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\DataSources\ArducopterConfigurator.PresentationModels.AcroModeConfigVm.datasource" />
|
||||
<None Include="Properties\DataSources\ArducopterConfigurator.PresentationModels.FlightDataVm.datasource" />
|
||||
<None Include="Properties\DataSources\ArducopterConfigurator.PresentationModels.MainVm.datasource" />
|
||||
<None Include="Properties\DataSources\ArducopterConfigurator.PresentationModels.StableModeConfigVm.datasource" />
|
||||
<None Include="Properties\DataSources\SerialMonitorVm.datasource" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="SensorDisplay.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VerticalProgressBar.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\AcroConfigView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\AcroConfigView.Designer.cs">
|
||||
<DependentUpon>AcroConfigView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\AltitudeHoldConfigView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\AltitudeHoldConfigView.Designer.cs">
|
||||
<DependentUpon>AltitudeHoldConfigView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\CalibrationView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\CalibrationView.Designer.cs">
|
||||
<DependentUpon>CalibrationView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Core\IPresentationModel.cs" />
|
||||
<Compile Include="Core\IView.cs" />
|
||||
<Compile Include="Views\PositionHoldConfigView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\PositionHoldConfigView.Designer.cs">
|
||||
<DependentUpon>PositionHoldConfigView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\StableConfigView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\StableConfigView.Designer.cs">
|
||||
<DependentUpon>StableConfigView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\FlightDataView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\FlightDataView.Designer.cs">
|
||||
<DependentUpon>FlightDataView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\MotorCommandsView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\MotorCommandsView.Designer.cs">
|
||||
<DependentUpon>MotorCommandsView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\SerialMonitorView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\SerialMonitorView.Designer.cs">
|
||||
<DependentUpon>SerialMonitorView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PresentationModels\SerialMonitorVm.cs" />
|
||||
<Compile Include="Views\TransmitterChannelsView.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\TransmitterChannelsView.Designer.cs">
|
||||
<DependentUpon>TransmitterChannelsView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ViewCommon.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
20
Configurator/Configurator.Net/ArducopterConfigurator.sln
Normal file
20
Configurator/Configurator.Net/ArducopterConfigurator.sln
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArducopterConfigurator", "ArducopterConfigurator.csproj", "{AF26391C-7E45-4401-8984-96139A67FF31}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AF26391C-7E45-4401-8984-96139A67FF31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AF26391C-7E45-4401-8984-96139A67FF31}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AF26391C-7E45-4401-8984-96139A67FF31}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AF26391C-7E45-4401-8984-96139A67FF31}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
106
Configurator/Configurator.Net/CommsSession.cs
Normal file
106
Configurator/Configurator.Net/CommsSession.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO.Ports;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a session of communication with the Arducopter
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Looks after connection state etc
|
||||
/// </remarks>
|
||||
public class CommsSession
|
||||
{
|
||||
private readonly SerialPort _sp;
|
||||
private BackgroundWorker _bgWorker;
|
||||
|
||||
public event Action<string> LineOfDataReceived;
|
||||
|
||||
public CommsSession()
|
||||
{
|
||||
_sp = new SerialPort();
|
||||
}
|
||||
|
||||
public string CommPort { get; set; }
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
_sp.BaudRate = 115200;
|
||||
_sp.PortName = CommPort;
|
||||
|
||||
try
|
||||
{
|
||||
_sp.Open();
|
||||
_sp.ReadTimeout = 50000;
|
||||
|
||||
// start the reading BG thread
|
||||
_bgWorker = new BackgroundWorker();
|
||||
_bgWorker.DoWork += bgWorker_DoWork;
|
||||
_bgWorker.WorkerReportsProgress = true;
|
||||
_bgWorker.WorkerSupportsCancellation = true;
|
||||
_bgWorker.ProgressChanged += bgWorker_ProgressChanged;
|
||||
_bgWorker.RunWorkerAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error = ex.Message;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public bool DisConnect()
|
||||
{
|
||||
_bgWorker.CancelAsync();
|
||||
|
||||
_sp.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
|
||||
{
|
||||
// Thanks to BG worker, this should be raised on the UI thread
|
||||
var lineReceived = e.UserState as string;
|
||||
if (LineOfDataReceived != null)
|
||||
LineOfDataReceived(lineReceived);
|
||||
}
|
||||
|
||||
void bgWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
while (!_bgWorker.CancellationPending)
|
||||
{
|
||||
try
|
||||
{
|
||||
var line = _sp.ReadLine();
|
||||
_bgWorker.ReportProgress(0, line);
|
||||
}
|
||||
catch(TimeoutException)
|
||||
{
|
||||
// continue
|
||||
}
|
||||
catch(System.IO.IOException) // when the port gets killed
|
||||
{}
|
||||
catch(ObjectDisposedException)
|
||||
{}
|
||||
}
|
||||
}
|
||||
|
||||
private string Error { get; set;}
|
||||
|
||||
public SerialPort SerialPort
|
||||
{
|
||||
get { return _sp; }
|
||||
}
|
||||
|
||||
public void Send(string send)
|
||||
{
|
||||
if (_sp.IsOpen)
|
||||
_sp.Write(send);
|
||||
}
|
||||
}
|
||||
}
|
7
Configurator/Configurator.Net/Core/IPresentationModel.cs
Normal file
7
Configurator/Configurator.Net/Core/IPresentationModel.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
public interface IPresentationModel
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
10
Configurator/Configurator.Net/Core/IView.cs
Normal file
10
Configurator/Configurator.Net/Core/IView.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
public interface IView<Tmodel> where Tmodel : IPresentationModel
|
||||
{
|
||||
void SetDataContext(Tmodel model);
|
||||
Control Control { get; }
|
||||
}
|
||||
}
|
31
Configurator/Configurator.Net/NotifyProperyChangedBase.cs
Normal file
31
Configurator/Configurator.Net/NotifyProperyChangedBase.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
public abstract class NotifyProperyChangedBase : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected bool CheckPropertyChanged<T>(string propertyName, ref T oldValue, ref T newValue)
|
||||
{
|
||||
if (oldValue == null && newValue == null)
|
||||
return false;
|
||||
|
||||
if ((oldValue == null && newValue != null) || !oldValue.Equals((T)newValue))
|
||||
{
|
||||
oldValue = newValue;
|
||||
FirePropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void FirePropertyChanged(string propertyName)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class AcroModeConfigVm : ConfigWithPidsBase
|
||||
{
|
||||
public AcroModeConfigVm(CommsSession sp) : base(sp)
|
||||
{
|
||||
PropsInUpdateOrder = new[]
|
||||
{
|
||||
"RollP",
|
||||
"RollI",
|
||||
"RollD",
|
||||
"PitchP",
|
||||
"PitchI",
|
||||
"PitchD",
|
||||
"YawP",
|
||||
"YawI",
|
||||
"YawD",
|
||||
"TransmitterFactor",
|
||||
};
|
||||
|
||||
RefreshCommand = new DelegateCommand(_ => RefreshValues());
|
||||
UpdateCommand = new DelegateCommand(_ => UpdateValues());
|
||||
}
|
||||
|
||||
public float TransmitterFactor { get; private set; }
|
||||
|
||||
public ICommand RefreshCommand { get; private set; }
|
||||
|
||||
public ICommand UpdateCommand { get; private set; }
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
RefreshValues();
|
||||
}
|
||||
|
||||
private void RefreshValues()
|
||||
{
|
||||
SendString("P");
|
||||
}
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
SendPropsWithCommand("O");
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Acro Mode"; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class AltitudeHoldConfigVm : MonitorVm
|
||||
{
|
||||
public AltitudeHoldConfigVm(CommsSession sp)
|
||||
: base(sp)
|
||||
{
|
||||
PropsInUpdateOrder = new[] { "P", "I", "D", };
|
||||
|
||||
RefreshCommand = new DelegateCommand(_ => RefreshValues());
|
||||
UpdateCommand = new DelegateCommand(_ => UpdateValues());
|
||||
}
|
||||
|
||||
public ICommand RefreshCommand { get; private set; }
|
||||
public ICommand UpdateCommand { get; private set; }
|
||||
|
||||
public float P { get; protected set; }
|
||||
public float I { get; protected set; }
|
||||
public float D { get; protected set; }
|
||||
|
||||
|
||||
private void RefreshValues()
|
||||
{
|
||||
SendString("F");
|
||||
}
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
SendPropsWithCommand("E");
|
||||
}
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
RefreshValues();
|
||||
}
|
||||
|
||||
protected override void OnStringReceived(string strReceived)
|
||||
{
|
||||
PopulatePropsFromUpdate(strReceived,true);
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Altitude Hold"; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class CalibrationOffsetsDataVm : MonitorVm
|
||||
{
|
||||
public CalibrationOffsetsDataVm(CommsSession 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"; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public abstract class ConfigWithPidsBase : MonitorVm
|
||||
{
|
||||
|
||||
public float RollP { get; set; }
|
||||
public float RollI { get; set; }
|
||||
public float RollD { get; set; }
|
||||
|
||||
public float PitchP { get; set; }
|
||||
public float PitchI { get; set; }
|
||||
public float PitchD { get; set; }
|
||||
|
||||
public float YawP { get; set; }
|
||||
public float YawI { get; set; }
|
||||
public float YawD { get; set; }
|
||||
|
||||
|
||||
public ConfigWithPidsBase(CommsSession sp) : base(sp)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnStringReceived(string strRx)
|
||||
{
|
||||
PopulatePropsFromUpdate(strRx,true);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public interface ICommand
|
||||
{
|
||||
void Execute(object parameter);
|
||||
bool CanExecute(object parameter);
|
||||
}
|
||||
|
||||
public class DelegateCommand : ICommand
|
||||
{
|
||||
private readonly Predicate<object> _canExecute;
|
||||
private readonly Action<object> _execute;
|
||||
|
||||
public DelegateCommand(Action<object> execute)
|
||||
: this(execute, null)
|
||||
{
|
||||
}
|
||||
|
||||
public DelegateCommand(Action<object> execute, Predicate<object> canExecute)
|
||||
{
|
||||
_execute = execute;
|
||||
_canExecute = canExecute;
|
||||
}
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (_canExecute == null)
|
||||
return true;
|
||||
|
||||
return _canExecute(parameter);
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute(parameter);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,212 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO.Ports;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class FlightDataVm : MonitorVm
|
||||
{
|
||||
public FlightDataVm(CommsSession _sp) : base(_sp)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 2,-10,3,-2,1011,1012,1002,1000,1001,1003,1002,1004
|
||||
// Loop Time = 2
|
||||
// Roll Gyro Rate = -10
|
||||
// Pitch Gyro Rate = 3
|
||||
// Yaw Gyro Rate = -2
|
||||
// Throttle Output = 1011
|
||||
// Roll PID Output = 1012
|
||||
// Pitch PID Output = 1002
|
||||
// Yaw PID Output 1000
|
||||
// Front Motor Command = 1001 PWM output sent to right motor (ranges from 1000-2000)
|
||||
// Rear Motor Command 1003
|
||||
// Right Motor Command = 1002
|
||||
// Left Motor Command = 1004
|
||||
// then adc 4,3, and 5
|
||||
protected override void OnStringReceived(string data)
|
||||
{
|
||||
var strs = data.Split(',');
|
||||
var ints = new List<int>();
|
||||
foreach (var s in strs)
|
||||
{
|
||||
int val;
|
||||
if (!int.TryParse(s, out val))
|
||||
{
|
||||
Debug.WriteLine("Could not parse expected integer: " + s);
|
||||
return;
|
||||
}
|
||||
ints.Add(val);
|
||||
}
|
||||
|
||||
if (ints.Count!=15)
|
||||
{
|
||||
Debug.WriteLine("Flight Data seentence expected, but only got one of size: " + ints.Count);
|
||||
return;
|
||||
}
|
||||
|
||||
LoopTime = ints[0];
|
||||
GyroRoll = ints[1] + 500;
|
||||
GyroPitch = ints[2] + 500;
|
||||
GyroYaw = ints[3] + 500;
|
||||
MotorFront = ints[8];
|
||||
MotorRear = ints[9];
|
||||
MotorRight = ints[10];
|
||||
MotorLeft = ints[11];
|
||||
AccelRoll = ints[12] + 500;
|
||||
AccelPitch = ints[13] + 500;
|
||||
AccelZ = ints[14] + 500;
|
||||
}
|
||||
|
||||
|
||||
private int _loopTime;
|
||||
public int LoopTime
|
||||
{
|
||||
get { return _loopTime; }
|
||||
set
|
||||
{
|
||||
if (_loopTime == value) return;
|
||||
_loopTime = value;
|
||||
FirePropertyChanged("LoopTime");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int motorFront;
|
||||
public int MotorFront
|
||||
{
|
||||
get { return motorFront; }
|
||||
set {
|
||||
if (motorFront == value) return;
|
||||
motorFront = value;
|
||||
FirePropertyChanged("MotorFront");
|
||||
}
|
||||
}
|
||||
|
||||
private int motorRear;
|
||||
public int MotorRear
|
||||
{
|
||||
get { return motorRear; }
|
||||
set
|
||||
{
|
||||
if (motorRear == value) return;
|
||||
motorRear = value;
|
||||
FirePropertyChanged("MotorRear");
|
||||
}
|
||||
}
|
||||
|
||||
private int motorLeft;
|
||||
public int MotorLeft
|
||||
{
|
||||
get { return motorLeft; }
|
||||
set
|
||||
{
|
||||
if (motorLeft == value) return;
|
||||
motorLeft = value;
|
||||
FirePropertyChanged("MotorLeft");
|
||||
}
|
||||
}
|
||||
|
||||
private int motorRight;
|
||||
public int MotorRight
|
||||
{
|
||||
get { return motorRight; }
|
||||
set
|
||||
{
|
||||
if (motorRight == value) return;
|
||||
motorRight = value;
|
||||
FirePropertyChanged("MotorRight");
|
||||
}
|
||||
}
|
||||
|
||||
private int gyroPitch;
|
||||
public int GyroPitch
|
||||
{
|
||||
get { return gyroPitch; }
|
||||
set
|
||||
{
|
||||
if (gyroPitch == value) return;
|
||||
gyroPitch = value;
|
||||
FirePropertyChanged("GyroPitch");
|
||||
}
|
||||
}
|
||||
|
||||
private int gyroRoll;
|
||||
public int GyroRoll
|
||||
{
|
||||
get { return gyroRoll; }
|
||||
set
|
||||
{
|
||||
if (gyroRoll == value) return;
|
||||
gyroRoll = value;
|
||||
FirePropertyChanged("GyroRoll");
|
||||
}
|
||||
}
|
||||
|
||||
private int gyroYaw;
|
||||
public int GyroYaw
|
||||
{
|
||||
get { return gyroYaw; }
|
||||
set
|
||||
{
|
||||
if (gyroYaw == value) return;
|
||||
gyroYaw = value;
|
||||
FirePropertyChanged("GyroYaw");
|
||||
}
|
||||
}
|
||||
|
||||
private int accelPitch;
|
||||
public int AccelPitch
|
||||
{
|
||||
get { return accelPitch; }
|
||||
set
|
||||
{
|
||||
if (accelPitch == value) return;
|
||||
accelPitch = value;
|
||||
FirePropertyChanged("AccelPitch");
|
||||
}
|
||||
}
|
||||
|
||||
private int accelRoll;
|
||||
public int AccelRoll
|
||||
{
|
||||
get { return accelRoll; }
|
||||
set
|
||||
{
|
||||
if (accelRoll == value) return;
|
||||
accelRoll = value;
|
||||
FirePropertyChanged("AccelRoll");
|
||||
}
|
||||
}
|
||||
|
||||
private int accelZ;
|
||||
public int AccelZ
|
||||
{
|
||||
get { return accelZ; }
|
||||
set
|
||||
{
|
||||
if (accelZ == value) return;
|
||||
accelZ = value;
|
||||
FirePropertyChanged("AccelZ");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDeactivated()
|
||||
{
|
||||
SendString("X");
|
||||
}
|
||||
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
SendString("S");
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Flight Data"; }
|
||||
}
|
||||
}
|
||||
}
|
200
Configurator/Configurator.Net/PresentationModels/MainVm.cs
Normal file
200
Configurator/Configurator.Net/PresentationModels/MainVm.cs
Normal file
@ -0,0 +1,200 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO.Ports;
|
||||
using System.Threading;
|
||||
using Timer=System.Windows.Forms.Timer;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class MainVm : NotifyProperyChangedBase, IPresentationModel
|
||||
{
|
||||
private readonly CommsSession _session;
|
||||
private bool _isConnected;
|
||||
private MonitorVm _selectedVm;
|
||||
private string _selectedPort;
|
||||
private string _apmVersion;
|
||||
private System.Windows.Forms.Timer _connectionAttemptsTimer;
|
||||
|
||||
private SessionStates _connectionState;
|
||||
|
||||
|
||||
public MainVm(CommsSession session)
|
||||
{
|
||||
_session = session;
|
||||
_session.LineOfDataReceived += _session_LineOfDataReceived;
|
||||
|
||||
MonitorVms = new BindingList<MonitorVm>
|
||||
{
|
||||
new FlightDataVm(session),
|
||||
new TransmitterChannelsVm(session),
|
||||
new MotorCommandsVm(session),
|
||||
new CalibrationOffsetsDataVm(session),
|
||||
new AcroModeConfigVm(session),
|
||||
new StableModeConfigVm(session),
|
||||
new PositionHoldConfigVm(session),
|
||||
new AltitudeHoldConfigVm(session),
|
||||
new SerialMonitorVm(session)
|
||||
};
|
||||
|
||||
ConnectCommand = new DelegateCommand(
|
||||
_ => Connect(),
|
||||
_ => _connectionState==SessionStates.Disconnected && AvailablePorts.Contains(SelectedPort));
|
||||
|
||||
DisconnectCommand = new DelegateCommand(_ => Disconnect(), _ => IsConnected);
|
||||
|
||||
RefreshPortListCommand = new DelegateCommand(_ => RefreshPorts());
|
||||
|
||||
ConnectionState = SessionStates.Disconnected;
|
||||
|
||||
AvailablePorts = new BindingList<string>();
|
||||
}
|
||||
|
||||
private void RefreshPorts()
|
||||
{
|
||||
AvailablePorts.Clear();
|
||||
foreach (var c in SerialPort.GetPortNames())
|
||||
AvailablePorts.Add(c);
|
||||
|
||||
}
|
||||
|
||||
void _session_LineOfDataReceived(string strRx)
|
||||
{
|
||||
// If we are waiting for the version string
|
||||
if (ConnectionState==SessionStates.Connecting)
|
||||
{
|
||||
// then assume that this is the version string received
|
||||
ApmVersion = strRx;
|
||||
ConnectionState = SessionStates.Connected;
|
||||
_selectedVm.Activate();
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand ConnectCommand { get; private set; }
|
||||
|
||||
public ICommand DisconnectCommand { get; private set; }
|
||||
|
||||
public ICommand RefreshPortListCommand { get; private set; }
|
||||
|
||||
public BindingList<string> AvailablePorts { get; private set; }
|
||||
|
||||
public enum SessionStates
|
||||
{
|
||||
Disconnected,
|
||||
Connecting,
|
||||
Connected,
|
||||
}
|
||||
|
||||
public SessionStates ConnectionState
|
||||
{
|
||||
get { return _connectionState; }
|
||||
set
|
||||
{
|
||||
if (_connectionState != value)
|
||||
{
|
||||
_connectionState = value;
|
||||
IsConnected = _connectionState == SessionStates.Connected;
|
||||
FirePropertyChanged("ConnectionState");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// provided for convenience for binding set from the session state prop
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return _isConnected; }
|
||||
private set
|
||||
{
|
||||
if (_isConnected != value)
|
||||
{
|
||||
_isConnected = value;
|
||||
FirePropertyChanged("IsConnected");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string SelectedPort
|
||||
{
|
||||
get { return _selectedPort; }
|
||||
set
|
||||
{
|
||||
if (_selectedPort != value)
|
||||
{
|
||||
_selectedPort = value;
|
||||
FirePropertyChanged("SelectedPort");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
_session.CommPort = SelectedPort;
|
||||
|
||||
// Todo: check the status of this call success/failure
|
||||
_session.Connect();
|
||||
|
||||
ConnectionState = SessionStates.Connecting;
|
||||
|
||||
_connectionAttemptsTimer = new Timer();
|
||||
_connectionAttemptsTimer.Tick += _connectionAttemptsTimer_Tick;
|
||||
_connectionAttemptsTimer.Interval = 1000; //milliseconds
|
||||
_connectionAttemptsTimer.Start();
|
||||
}
|
||||
|
||||
void _connectionAttemptsTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (_connectionState != SessionStates.Connecting)
|
||||
{
|
||||
_connectionAttemptsTimer.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
// once we connected, then get the version string
|
||||
_session.Send("!");
|
||||
}
|
||||
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
_session.Send("X");
|
||||
_session.DisConnect();
|
||||
ConnectionState = SessionStates.Disconnected;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public string ApmVersion
|
||||
{
|
||||
get { return _apmVersion; }
|
||||
private set
|
||||
{
|
||||
if (_apmVersion != value)
|
||||
{
|
||||
_apmVersion = value;
|
||||
FirePropertyChanged("ApmVersion");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BindingList<MonitorVm> MonitorVms { get; private set; }
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Arducopter Config"; }
|
||||
}
|
||||
|
||||
public void Select(MonitorVm vm)
|
||||
{
|
||||
if (_selectedVm==vm)
|
||||
return;
|
||||
|
||||
if (_selectedVm!=null)
|
||||
_selectedVm.DeActivate();
|
||||
|
||||
_selectedVm = vm;
|
||||
|
||||
_selectedVm.Activate();
|
||||
}
|
||||
}
|
||||
}
|
160
Configurator/Configurator.Net/PresentationModels/MonitorVm.cs
Normal file
160
Configurator/Configurator.Net/PresentationModels/MonitorVm.cs
Normal file
@ -0,0 +1,160 @@
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
/// <summary>
|
||||
/// Monitor VM base class
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Common base for some factored out things like only passing data to an active
|
||||
/// Monitor, etc
|
||||
/// </remarks>
|
||||
public abstract class MonitorVm : NotifyProperyChangedBase, IPresentationModel
|
||||
{
|
||||
private CommsSession _sp;
|
||||
protected bool isActive;
|
||||
protected string[] PropsInUpdateOrder;
|
||||
|
||||
protected MonitorVm(CommsSession sp)
|
||||
{
|
||||
_sp = sp;
|
||||
_sp.LineOfDataReceived += sp_LineOfDataReceived;
|
||||
}
|
||||
|
||||
void sp_LineOfDataReceived(string obj)
|
||||
{
|
||||
if (isActive)
|
||||
OnStringReceived(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the mode is selected
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Any initialising commands should be sent to the serial port
|
||||
/// when this method is called.
|
||||
/// </remarks>
|
||||
public void Activate()
|
||||
{
|
||||
isActive = true;
|
||||
OnActivated();
|
||||
}
|
||||
|
||||
public void DeActivate()
|
||||
{
|
||||
isActive = false;
|
||||
OnDeactivated();
|
||||
}
|
||||
|
||||
protected virtual void OnDeactivated()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnActivated()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send raw text to the Arducopter
|
||||
/// </summary>
|
||||
protected void SendString(string strToSend)
|
||||
{
|
||||
_sp.Send(strToSend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call-back for text sent back from the Arducopter
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is called when a full line of text is received from the APM
|
||||
/// This will not be called when the mode is not selected
|
||||
/// </remarks>
|
||||
protected abstract void OnStringReceived(string strReceived);
|
||||
|
||||
#region Implementation of IPresentationModel
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// Common method for populating properties, using a hardcoded
|
||||
// property update order, and reflection to get the property type
|
||||
protected void PopulatePropsFromUpdate(string strRx, bool fireInpc)
|
||||
{
|
||||
var strs = strRx.Split(',');
|
||||
|
||||
if (PropsInUpdateOrder.Length!=strs.Length)
|
||||
{
|
||||
Debug.WriteLine("Processing update with only " + strs.Length
|
||||
+ " values, but have " + PropsInUpdateOrder.Length
|
||||
+ " properties to populate. Ignoring this update");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < PropsInUpdateOrder.Length; i++)
|
||||
{
|
||||
var prop = this.GetType().GetProperty(PropsInUpdateOrder[i]);
|
||||
var s = strs[i];
|
||||
object value = null;
|
||||
|
||||
if (prop.PropertyType == typeof(float))
|
||||
{
|
||||
float val;
|
||||
if (!float.TryParse(s, out val))
|
||||
{
|
||||
Debug.WriteLine("Error parsing float: " + s);
|
||||
break;
|
||||
}
|
||||
value = val;
|
||||
}
|
||||
if (prop.PropertyType == typeof(bool))
|
||||
{
|
||||
float val;
|
||||
if (!float.TryParse(s, out val))
|
||||
{
|
||||
Debug.WriteLine("Error parsing float (bool): " + s);
|
||||
break;
|
||||
}
|
||||
value = val != 0.0;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
int val;
|
||||
if (!int.TryParse(s, out val))
|
||||
{
|
||||
Debug.WriteLine("Error parsing float: " + s);
|
||||
break;
|
||||
}
|
||||
value = val;
|
||||
}
|
||||
|
||||
prop.SetValue(this, value, null);
|
||||
|
||||
if (fireInpc)
|
||||
FirePropertyChanged(PropsInUpdateOrder[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Common method for sending/updating data
|
||||
// sentence sent to APM is the commandChar followed by the property
|
||||
// vals in the correct order, seperated by semicolons
|
||||
protected void SendPropsWithCommand(string commandChar)
|
||||
{
|
||||
var strings = new string[PropsInUpdateOrder.Length];
|
||||
for (int i = 0; i < PropsInUpdateOrder.Length; i++)
|
||||
{
|
||||
var prop = this.GetType().GetProperty(PropsInUpdateOrder[i]);
|
||||
strings[i] = prop.GetValue(this, null).ToString();
|
||||
|
||||
}
|
||||
|
||||
var sentence = commandChar + string.Join(";", strings);
|
||||
SendString(sentence);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class MotorCommandsVm : MonitorVm
|
||||
{
|
||||
public MotorCommandsVm(CommsSession _sp)
|
||||
: base(_sp)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Motor Commands"; }
|
||||
}
|
||||
|
||||
public int MotorFront { get; set; }
|
||||
public int MotorRear { get; set; }
|
||||
public int MotorLeft { get; set; }
|
||||
public int MotorRight { get; set; }
|
||||
|
||||
public void SendCommand()
|
||||
{
|
||||
}
|
||||
|
||||
public void StopCommand()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected override void OnDeactivated()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnStringReceived(string strReceived)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class PositionHoldConfigVm : ConfigWithPidsBase
|
||||
{
|
||||
public PositionHoldConfigVm(CommsSession sp)
|
||||
: base(sp)
|
||||
{
|
||||
PropsInUpdateOrder = new[]
|
||||
{
|
||||
"RollP",
|
||||
"RollI",
|
||||
"RollD",
|
||||
"PitchP",
|
||||
"PitchI",
|
||||
"PitchD",
|
||||
"MaximumAngle",
|
||||
"GeoCorrectionFactor",
|
||||
};
|
||||
|
||||
RefreshCommand = new DelegateCommand(_ => RefreshValues());
|
||||
UpdateCommand = new DelegateCommand(_ => UpdateValues());
|
||||
}
|
||||
|
||||
public float MaximumAngle { get; set; }
|
||||
|
||||
public float GeoCorrectionFactor { get; set; }
|
||||
|
||||
public ICommand RefreshCommand { get; private set; }
|
||||
|
||||
public ICommand UpdateCommand { get; private set; }
|
||||
|
||||
//Send an 'C' followed by numeric values to transmit user defined roll and pitch PID values for gyro stabilized flight control. Each value is separated by a semi-colon in the form:
|
||||
//C[P GPS ROLL];[I GPS ROLL];[D GPS ROLL];[P GPS PITCH];[I GPS PITCH];[D GPS PITCH];[GPS MAX ANGLE];[GEOG Correction factor]
|
||||
public void UpdateValues()
|
||||
{
|
||||
SendPropsWithCommand("C");
|
||||
}
|
||||
|
||||
public void RefreshValues()
|
||||
{
|
||||
SendString("D");
|
||||
}
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
RefreshValues();
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Position Hold"; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.IO.Ports;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class SerialMonitorVm : MonitorVm
|
||||
{
|
||||
private string _text;
|
||||
|
||||
public SerialMonitorVm(CommsSession _sp) : base(_sp)
|
||||
{
|
||||
_sp.LineOfDataReceived += new Action<string>(_sp_DataReceived);
|
||||
|
||||
}
|
||||
|
||||
void _sp_DataReceived(string obj)
|
||||
{
|
||||
_text += obj;
|
||||
FirePropertyChanged("ReceviedText");
|
||||
}
|
||||
|
||||
public string ReceviedText { get { return _text; } }
|
||||
|
||||
public string SendText { get; set; }
|
||||
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
|
||||
SendString("X");
|
||||
_text = string.Empty;
|
||||
FirePropertyChanged("ReceviedText");
|
||||
}
|
||||
|
||||
|
||||
protected override void OnStringReceived(string strReceived)
|
||||
{
|
||||
_text += strReceived;
|
||||
FirePropertyChanged("ReceviedText");
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Serial Monitor"; }
|
||||
}
|
||||
|
||||
public void SendTextCommand()
|
||||
{
|
||||
SendString(SendText);
|
||||
SendText = "";
|
||||
FirePropertyChanged("SendText");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class StableModeConfigVm : ConfigWithPidsBase
|
||||
{
|
||||
public StableModeConfigVm(CommsSession sp)
|
||||
: base(sp)
|
||||
{
|
||||
PropsInUpdateOrder = new[]
|
||||
{
|
||||
"RollP",
|
||||
"RollI",
|
||||
"RollD",
|
||||
"PitchP",
|
||||
"PitchI",
|
||||
"PitchD",
|
||||
"YawP",
|
||||
"YawI",
|
||||
"YawD",
|
||||
"KPrate",
|
||||
"MagnetometerEnable",
|
||||
};
|
||||
|
||||
RefreshCommand = new DelegateCommand(_ => RefreshValues());
|
||||
UpdateCommand = new DelegateCommand(_ => UpdateValues());
|
||||
}
|
||||
|
||||
public ICommand RefreshCommand { get; private set; }
|
||||
|
||||
public ICommand UpdateCommand { get; private set; }
|
||||
|
||||
public float KPrate { get; private set; }
|
||||
|
||||
public bool MagnetometerEnable { get; private set; }
|
||||
|
||||
private void RefreshValues()
|
||||
{
|
||||
SendString("B");
|
||||
}
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
SendPropsWithCommand("A");
|
||||
}
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
RefreshValues();
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Stable Mode"; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,198 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ArducopterConfigurator.PresentationModels
|
||||
{
|
||||
public class TransmitterChannelsVm : MonitorVm
|
||||
{
|
||||
public TransmitterChannelsVm(CommsSession sp) : base(sp)
|
||||
{
|
||||
PropsInUpdateOrder = new[]
|
||||
{
|
||||
"Roll", // Aileron
|
||||
"Pitch", // Elevator
|
||||
"Yaw",
|
||||
"Throttle",
|
||||
"Mode", // AUX1 (Mode)
|
||||
"Aux", // AUX2
|
||||
"RollMidValue",
|
||||
"PitchMidValue",
|
||||
"YawMidValue",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private int _roll;
|
||||
public int Roll
|
||||
{
|
||||
get { return _roll; }
|
||||
set
|
||||
{
|
||||
if (_roll == value) return;
|
||||
_roll = value;
|
||||
FirePropertyChanged("Roll");
|
||||
}
|
||||
}
|
||||
|
||||
private int _pitch;
|
||||
public int Pitch
|
||||
{
|
||||
get { return _pitch; }
|
||||
set
|
||||
{
|
||||
if (_pitch == value) return;
|
||||
_pitch = value;
|
||||
FirePropertyChanged("Pitch");
|
||||
}
|
||||
}
|
||||
|
||||
private int _yaw;
|
||||
public int Yaw
|
||||
{
|
||||
get { return _yaw; }
|
||||
set
|
||||
{
|
||||
if (_yaw == value) return;
|
||||
_yaw = value;
|
||||
FirePropertyChanged("Yaw");
|
||||
}
|
||||
}
|
||||
|
||||
private int _throttle;
|
||||
public int Throttle
|
||||
{
|
||||
get { return _throttle; }
|
||||
set
|
||||
{
|
||||
if (_throttle == value) return;
|
||||
_throttle = value;
|
||||
FirePropertyChanged("Throttle");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private int _mode;
|
||||
public int Mode
|
||||
{
|
||||
get { return _mode; }
|
||||
set
|
||||
{
|
||||
if (_mode == value) return;
|
||||
_mode = value;
|
||||
FirePropertyChanged("Mode");
|
||||
}
|
||||
}
|
||||
|
||||
private int _aux;
|
||||
public int Aux
|
||||
{
|
||||
get { return _aux; }
|
||||
set
|
||||
{
|
||||
if (_aux == value) return;
|
||||
_aux = value;
|
||||
FirePropertyChanged("Aux");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private int _rollmid;
|
||||
public int RollMidValue
|
||||
{
|
||||
get { return _rollmid; }
|
||||
set
|
||||
{
|
||||
if (_rollmid == value) return;
|
||||
_rollmid = value;
|
||||
FirePropertyChanged("RollMidValue");
|
||||
}
|
||||
}
|
||||
|
||||
private int _pitchMid;
|
||||
public int PitchMidValue
|
||||
{
|
||||
get { return _pitchMid; }
|
||||
set
|
||||
{
|
||||
if (_pitchMid == value) return;
|
||||
_pitchMid = value;
|
||||
FirePropertyChanged("PitchMidValue");
|
||||
}
|
||||
}
|
||||
|
||||
private int _yawMid;
|
||||
public int YawMidValue
|
||||
{
|
||||
get { return _yawMid; }
|
||||
set
|
||||
{
|
||||
if (_yawMid == value) return;
|
||||
_yawMid = value;
|
||||
FirePropertyChanged("YawMidValue");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnActivated()
|
||||
{
|
||||
SendString("U");
|
||||
}
|
||||
|
||||
protected override void OnDeactivated()
|
||||
{
|
||||
SendString("X");
|
||||
}
|
||||
|
||||
protected override void OnStringReceived(string strReceived)
|
||||
{
|
||||
PopulatePropsFromUpdate(strReceived,false);
|
||||
}
|
||||
|
||||
|
||||
private void manualPropset(string strReceived)
|
||||
{
|
||||
// PopulatePropsFromUpdate(strReceived,false);
|
||||
var strs = strReceived.Split(',');
|
||||
var ints = new List<int>();
|
||||
foreach (var s in strs)
|
||||
{
|
||||
int val;
|
||||
if (!int.TryParse(s, out val))
|
||||
{
|
||||
Debug.WriteLine("Could not parse expected integer: " + s);
|
||||
return;
|
||||
}
|
||||
ints.Add(val);
|
||||
}
|
||||
|
||||
if (ints.Count != 9)
|
||||
{
|
||||
Debug.WriteLine("Tx Data sentence expected, but only got one of size: " + ints.Count);
|
||||
return;
|
||||
}
|
||||
|
||||
Roll = ints[0];
|
||||
// Pitch = ints[1];
|
||||
// Yaw = ints[2];
|
||||
Throttle = ints[3];
|
||||
// Mode = ints[4];
|
||||
// Aux = ints[5];
|
||||
// RollMidValue = ints[6];
|
||||
// PitchMidValue = ints[7];
|
||||
// YawMidValue = ints[8];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Transmitter Channels"; }
|
||||
}
|
||||
}
|
||||
}
|
26
Configurator/Configurator.Net/Program.cs
Normal file
26
Configurator/Configurator.Net/Program.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
var session = new CommsSession();
|
||||
var mainVm = new MainVm(session);
|
||||
|
||||
|
||||
Application.Run(new mainForm(mainVm));
|
||||
}
|
||||
}
|
||||
}
|
36
Configurator/Configurator.Net/Properties/AssemblyInfo.cs
Normal file
36
Configurator/Configurator.Net/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ArducopterConfigurator")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ArducopterConfigurator")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("4bba5a30-abac-4fe7-8e48-84c668f09753")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="AcroModeConfigVm" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ArducopterConfigurator.PresentationModels.AcroModeConfigVm, ArducopterConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="FlightDataVm" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ArducopterConfigurator.PresentationModels.FlightDataVm, ArducopterConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="MainVm" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ArducopterConfigurator.PresentationModels.MainVm, ArducopterConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="StableModeConfigVm" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ArducopterConfigurator.PresentationModels.StableModeConfigVm, ArducopterConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="SerialMonitorVm" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ArducopterConfigurator.PresentationModels.SerialMonitorVm, ArducopterConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
71
Configurator/Configurator.Net/Properties/Resources.Designer.cs
generated
Normal file
71
Configurator/Configurator.Net/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4952
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ArducopterConfigurator.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ArducopterConfigurator.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
Configurator/Configurator.Net/Properties/Resources.resx
Normal file
117
Configurator/Configurator.Net/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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>
|
30
Configurator/Configurator.Net/Properties/Settings.Designer.cs
generated
Normal file
30
Configurator/Configurator.Net/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4952
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ArducopterConfigurator.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
105
Configurator/Configurator.Net/SensorDisplay.cs
Normal file
105
Configurator/Configurator.Net/SensorDisplay.cs
Normal file
@ -0,0 +1,105 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a custom tweaking of the standard Progress bar
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
[ToolboxBitmap(typeof(ProgressBar))]
|
||||
public class SensorDisplay : ProgressBar
|
||||
{
|
||||
private bool m_IsVertical;
|
||||
private int m_Offset;
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
CreateParams cp = base.CreateParams;
|
||||
if (m_IsVertical)
|
||||
cp.Style |= 0x04;
|
||||
return cp;
|
||||
}
|
||||
}
|
||||
|
||||
public new int Value {
|
||||
get
|
||||
{
|
||||
return base.Value - m_Offset;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Value = value + m_Offset;
|
||||
}
|
||||
}
|
||||
|
||||
public new int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Maximum - m_Offset;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Maximum = value + m_Offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public new int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Minimum - m_Offset;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Minimum = value + m_Offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Description("Whether the display grows vertically")]
|
||||
[Category("SensorDisplay")]
|
||||
[DefaultValue(false)]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
public bool IsVertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsVertical;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsVertical = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Description("An offset that will be added to every value applied")]
|
||||
[Category("SensorDisplay")]
|
||||
[DefaultValue(0)]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
public int Offset
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Offset;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Offset = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
126
Configurator/Configurator.Net/SensorDisplay.resx
Normal file
126
Configurator/Configurator.Net/SensorDisplay.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?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>
|
||||
<metadata name="verticalProgressBar1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
24
Configurator/Configurator.Net/VerticalProgressBar.cs
Normal file
24
Configurator/Configurator.Net/VerticalProgressBar.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
[Description("Vertical Progress Bar")]
|
||||
[ToolboxBitmap(typeof(ProgressBar))]
|
||||
public class VerticalProgressBar : ProgressBar
|
||||
{
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
CreateParams cp = base.CreateParams;
|
||||
cp.Style |= 0x04;
|
||||
return cp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
359
Configurator/Configurator.Net/Views/AcroConfigView.Designer.cs
generated
Normal file
359
Configurator/Configurator.Net/Views/AcroConfigView.Designer.cs
generated
Normal file
@ -0,0 +1,359 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class AcroConfigView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.textBox7 = new System.Windows.Forms.TextBox();
|
||||
this.AcroModeConfigVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.textBox8 = new System.Windows.Forms.TextBox();
|
||||
this.textBox9 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.textBox10 = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.groupBox4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.AcroModeConfigVmBindingSource)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.AcroModeConfigVmBindingSource, "RefreshCommand", true));
|
||||
this.button2.Location = new System.Drawing.Point(198, 135);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(74, 23);
|
||||
this.button2.TabIndex = 12;
|
||||
this.button2.Text = "Refresh";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.label7);
|
||||
this.groupBox4.Controls.Add(this.label8);
|
||||
this.groupBox4.Controls.Add(this.label9);
|
||||
this.groupBox4.Controls.Add(this.textBox7);
|
||||
this.groupBox4.Controls.Add(this.textBox8);
|
||||
this.groupBox4.Controls.Add(this.textBox9);
|
||||
this.groupBox4.Location = new System.Drawing.Point(234, 6);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox4.TabIndex = 11;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Yaw";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(7, 74);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(15, 13);
|
||||
this.label7.TabIndex = 5;
|
||||
this.label7.Text = "D";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(7, 48);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(10, 13);
|
||||
this.label8.TabIndex = 4;
|
||||
this.label8.Text = "I";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(7, 22);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(14, 13);
|
||||
this.label9.TabIndex = 3;
|
||||
this.label9.Text = "P";
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "YawD", true));
|
||||
this.textBox7.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox7.TabIndex = 2;
|
||||
//
|
||||
// AcroModeConfigVmBindingSource
|
||||
//
|
||||
this.AcroModeConfigVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.AcroModeConfigVm);
|
||||
//
|
||||
// textBox8
|
||||
//
|
||||
this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "YawI", true));
|
||||
this.textBox8.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox8.Name = "textBox8";
|
||||
this.textBox8.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox8.TabIndex = 1;
|
||||
//
|
||||
// textBox9
|
||||
//
|
||||
this.textBox9.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "YawP", true));
|
||||
this.textBox9.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox9.Name = "textBox9";
|
||||
this.textBox9.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox9.TabIndex = 0;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.label6);
|
||||
this.groupBox2.Controls.Add(this.textBox4);
|
||||
this.groupBox2.Controls.Add(this.textBox5);
|
||||
this.groupBox2.Controls.Add(this.textBox6);
|
||||
this.groupBox2.Location = new System.Drawing.Point(120, 6);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox2.TabIndex = 10;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Pitch";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(7, 74);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(15, 13);
|
||||
this.label4.TabIndex = 5;
|
||||
this.label4.Text = "D";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(7, 48);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(10, 13);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = "I";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(7, 22);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(14, 13);
|
||||
this.label6.TabIndex = 3;
|
||||
this.label6.Text = "P";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "PitchD", true));
|
||||
this.textBox4.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox4.TabIndex = 2;
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "PitchI", true));
|
||||
this.textBox5.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "PitchP", true));
|
||||
this.textBox6.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox6.TabIndex = 0;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Controls.Add(this.label2);
|
||||
this.groupBox3.Controls.Add(this.label1);
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.textBox2);
|
||||
this.groupBox3.Controls.Add(this.textBox1);
|
||||
this.groupBox3.Location = new System.Drawing.Point(6, 5);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox3.TabIndex = 9;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Roll";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(7, 74);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(15, 13);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "D";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(7, 48);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(10, 13);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "I";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(7, 22);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(14, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "P";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "RollD", true));
|
||||
this.textBox3.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox3.TabIndex = 2;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "RollI", true));
|
||||
this.textBox2.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "RollP", true));
|
||||
this.textBox1.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.AcroModeConfigVmBindingSource, "UpdateCommand", true));
|
||||
this.button1.Location = new System.Drawing.Point(278, 135);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(74, 23);
|
||||
this.button1.TabIndex = 8;
|
||||
this.button1.Text = "Update";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox10
|
||||
//
|
||||
this.textBox10.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AcroModeConfigVmBindingSource, "TransmitterFactor", true));
|
||||
this.textBox10.Location = new System.Drawing.Point(70, 128);
|
||||
this.textBox10.Name = "textBox10";
|
||||
this.textBox10.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox10.TabIndex = 6;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(13, 130);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(55, 13);
|
||||
this.label10.TabIndex = 6;
|
||||
this.label10.Text = "Tx Factor:";
|
||||
//
|
||||
// AcroConfigView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.textBox10);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "AcroConfigView";
|
||||
this.Size = new System.Drawing.Size(355, 161);
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.AcroModeConfigVmBindingSource)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox textBox7;
|
||||
private System.Windows.Forms.TextBox textBox8;
|
||||
private System.Windows.Forms.TextBox textBox9;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.TextBox textBox10;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.BindingSource AcroModeConfigVmBindingSource;
|
||||
}
|
||||
}
|
29
Configurator/Configurator.Net/Views/AcroConfigView.cs
Normal file
29
Configurator/Configurator.Net/Views/AcroConfigView.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class AcroConfigView : AcroControlDesignable
|
||||
{
|
||||
public AcroConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindButtons();
|
||||
}
|
||||
|
||||
public override void SetDataContext(AcroModeConfigVm model)
|
||||
{
|
||||
AcroModeConfigVmBindingSource.DataSource = model;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class AcroControlDesignable : ViewCommon<AcroModeConfigVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/AcroConfigView.resx
Normal file
123
Configurator/Configurator.Net/Views/AcroConfigView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="AcroModeConfigVmBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
154
Configurator/Configurator.Net/Views/AltitudeHoldConfigView.Designer.cs
generated
Normal file
154
Configurator/Configurator.Net/Views/AltitudeHoldConfigView.Designer.cs
generated
Normal file
@ -0,0 +1,154 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class AltitudeHoldConfigView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.AltitudeHoldConfigBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.AltitudeHoldConfigBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(11, 67);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(15, 13);
|
||||
this.label4.TabIndex = 16;
|
||||
this.label4.Text = "D";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(11, 41);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(10, 13);
|
||||
this.label5.TabIndex = 15;
|
||||
this.label5.Text = "I";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(11, 15);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(14, 13);
|
||||
this.label6.TabIndex = 14;
|
||||
this.label6.Text = "P";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AltitudeHoldConfigBindingSource, "D", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.textBox4.Location = new System.Drawing.Point(27, 64);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox4.TabIndex = 13;
|
||||
//
|
||||
// AltitudeHoldConfigBindingSource
|
||||
//
|
||||
this.AltitudeHoldConfigBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.AltitudeHoldConfigVm);
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AltitudeHoldConfigBindingSource, "I", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.textBox5.Location = new System.Drawing.Point(27, 38);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox5.TabIndex = 12;
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.AltitudeHoldConfigBindingSource, "P", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.textBox6.Location = new System.Drawing.Point(27, 12);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox6.TabIndex = 11;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.AltitudeHoldConfigBindingSource, "RefreshCommand", true));
|
||||
this.button2.Location = new System.Drawing.Point(119, 96);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(74, 23);
|
||||
this.button2.TabIndex = 18;
|
||||
this.button2.Text = "Refresh";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.AltitudeHoldConfigBindingSource, "UpdateCommand", true));
|
||||
this.button1.Location = new System.Drawing.Point(199, 96);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(74, 23);
|
||||
this.button1.TabIndex = 17;
|
||||
this.button1.Text = "Update";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// AltitudeHoldConfigView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.textBox5);
|
||||
this.Controls.Add(this.textBox6);
|
||||
this.Name = "AltitudeHoldConfigView";
|
||||
this.Size = new System.Drawing.Size(276, 122);
|
||||
((System.ComponentModel.ISupportInitialize)(this.AltitudeHoldConfigBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.BindingSource AltitudeHoldConfigBindingSource;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class AltitudeHoldConfigView : AltitudeControlDesignable
|
||||
{
|
||||
public AltitudeHoldConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindButtons();
|
||||
}
|
||||
|
||||
public override void SetDataContext(AltitudeHoldConfigVm model)
|
||||
{
|
||||
AltitudeHoldConfigBindingSource.DataSource = model;
|
||||
}
|
||||
}
|
||||
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class AltitudeControlDesignable : ViewCommon<AltitudeHoldConfigVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/AltitudeHoldConfigView.resx
Normal file
123
Configurator/Configurator.Net/Views/AltitudeHoldConfigView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="AltitudeHoldConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
251
Configurator/Configurator.Net/Views/CalibrationView.Designer.cs
generated
Normal file
251
Configurator/Configurator.Net/Views/CalibrationView.Designer.cs
generated
Normal file
@ -0,0 +1,251 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class CalibrationView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.calibrationOffsetsDataVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.calibrationOffsetsDataVmBindingSource)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.label3);
|
||||
this.groupBox1.Controls.Add(this.textBox3);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Controls.Add(this.textBox2);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Controls.Add(this.textBox1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 3);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(141, 107);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Gyro Offset";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(6, 84);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(28, 13);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "Yaw";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.calibrationOffsetsDataVmBindingSource, "GyroYawOffset", true));
|
||||
this.textBox3.Location = new System.Drawing.Point(59, 77);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(71, 20);
|
||||
this.textBox3.TabIndex = 4;
|
||||
//
|
||||
// calibrationOffsetsDataVmBindingSource
|
||||
//
|
||||
this.calibrationOffsetsDataVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.CalibrationOffsetsDataVm);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(6, 58);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(31, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Pitch";
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.calibrationOffsetsDataVmBindingSource, "GyroPitchOffset", true));
|
||||
this.textBox2.Location = new System.Drawing.Point(59, 51);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(71, 20);
|
||||
this.textBox2.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(6, 32);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(25, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Roll";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.calibrationOffsetsDataVmBindingSource, "GyroRollOffset", true));
|
||||
this.textBox1.Location = new System.Drawing.Point(59, 25);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(71, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(6, 84);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(14, 13);
|
||||
this.label4.TabIndex = 5;
|
||||
this.label4.Text = "Z";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Controls.Add(this.textBox4);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.textBox5);
|
||||
this.groupBox2.Controls.Add(this.label6);
|
||||
this.groupBox2.Controls.Add(this.textBox6);
|
||||
this.groupBox2.Location = new System.Drawing.Point(150, 3);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(141, 107);
|
||||
this.groupBox2.TabIndex = 6;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Accel Offset";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.calibrationOffsetsDataVmBindingSource, "AccelZOffset", true));
|
||||
this.textBox4.Location = new System.Drawing.Point(59, 77);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(71, 20);
|
||||
this.textBox4.TabIndex = 4;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(6, 58);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(31, 13);
|
||||
this.label5.TabIndex = 3;
|
||||
this.label5.Text = "Pitch";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.calibrationOffsetsDataVmBindingSource, "AccelPitchOffset", true));
|
||||
this.textBox5.Location = new System.Drawing.Point(59, 51);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(71, 20);
|
||||
this.textBox5.TabIndex = 2;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(6, 32);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(25, 13);
|
||||
this.label6.TabIndex = 1;
|
||||
this.label6.Text = "Roll";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.calibrationOffsetsDataVmBindingSource, "AccelRollOffset", true));
|
||||
this.textBox6.Location = new System.Drawing.Point(59, 25);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(71, 20);
|
||||
this.textBox6.TabIndex = 0;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.calibrationOffsetsDataVmBindingSource, "RefreshCommand", true));
|
||||
this.button2.Location = new System.Drawing.Point(143, 117);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(74, 23);
|
||||
this.button2.TabIndex = 14;
|
||||
this.button2.Text = "Refresh";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.calibrationOffsetsDataVmBindingSource, "UpdateCommand", true));
|
||||
this.button1.Location = new System.Drawing.Point(223, 117);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(74, 23);
|
||||
this.button1.TabIndex = 13;
|
||||
this.button1.Text = "Update";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// CalibrationView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "CalibrationView";
|
||||
this.Size = new System.Drawing.Size(300, 143);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.calibrationOffsetsDataVmBindingSource)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.BindingSource calibrationOffsetsDataVmBindingSource;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
28
Configurator/Configurator.Net/Views/CalibrationView.cs
Normal file
28
Configurator/Configurator.Net/Views/CalibrationView.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class CalibrationView : CalibrationViewDesignable
|
||||
{
|
||||
public CalibrationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindButtons();
|
||||
}
|
||||
|
||||
public override void SetDataContext(CalibrationOffsetsDataVm model)
|
||||
{
|
||||
calibrationOffsetsDataVmBindingSource.DataSource = model;
|
||||
}
|
||||
}
|
||||
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class CalibrationViewDesignable : ViewCommon<CalibrationOffsetsDataVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/CalibrationView.resx
Normal file
123
Configurator/Configurator.Net/Views/CalibrationView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="calibrationOffsetsDataVmBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
442
Configurator/Configurator.Net/Views/FlightDataView.Designer.cs
generated
Normal file
442
Configurator/Configurator.Net/Views/FlightDataView.Designer.cs
generated
Normal file
@ -0,0 +1,442 @@
|
||||
namespace ArducopterConfigurator.views
|
||||
{
|
||||
partial class FlightDataView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.progressBar2 = new System.Windows.Forms.ProgressBar();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.textBox7 = new System.Windows.Forms.TextBox();
|
||||
this.progressBar3 = new System.Windows.Forms.ProgressBar();
|
||||
this.FlightDataVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.verticalProgressBar8 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar6 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar5 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar4 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar3 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar2 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar1 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.textBox8 = new System.Windows.Forms.TextBox();
|
||||
this.textBox9 = new System.Windows.Forms.TextBox();
|
||||
this.textBox10 = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.FlightDataVmBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 138);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(25, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Left";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(68, 138);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(31, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Front";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(124, 138);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(30, 13);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "Rear";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(176, 138);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(32, 13);
|
||||
this.label4.TabIndex = 7;
|
||||
this.label4.Text = "Right";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "MotorLeft", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, null, "N0"));
|
||||
this.textBox1.Location = new System.Drawing.Point(2, 247);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.ReadOnly = true;
|
||||
this.textBox1.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox1.TabIndex = 8;
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.progressBar1.Location = new System.Drawing.Point(12, 25);
|
||||
this.progressBar1.Maximum = 1000;
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(100, 23);
|
||||
this.progressBar1.TabIndex = 9;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(9, 9);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(50, 13);
|
||||
this.label5.TabIndex = 10;
|
||||
this.label5.Text = "Roll Gyro";
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "GyroRoll", true));
|
||||
this.textBox2.Location = new System.Drawing.Point(124, 28);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.ReadOnly = true;
|
||||
this.textBox2.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox2.TabIndex = 12;
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "AccelRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0"));
|
||||
this.textBox3.Location = new System.Drawing.Point(124, 68);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.ReadOnly = true;
|
||||
this.textBox3.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox3.TabIndex = 13;
|
||||
//
|
||||
// progressBar2
|
||||
//
|
||||
this.progressBar2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.progressBar2.Location = new System.Drawing.Point(12, 68);
|
||||
this.progressBar2.Maximum = 1000;
|
||||
this.progressBar2.Name = "progressBar2";
|
||||
this.progressBar2.Size = new System.Drawing.Size(100, 23);
|
||||
this.progressBar2.TabIndex = 14;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(9, 52);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(57, 13);
|
||||
this.label6.TabIndex = 15;
|
||||
this.label6.Text = "Roll Accell";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "GyroPitch", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0"));
|
||||
this.textBox4.Location = new System.Drawing.Point(187, 109);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.ReadOnly = true;
|
||||
this.textBox4.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox4.TabIndex = 17;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(184, 5);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(56, 13);
|
||||
this.label7.TabIndex = 18;
|
||||
this.label7.Text = "Pitch Gyro";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(244, 5);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(61, 13);
|
||||
this.label8.TabIndex = 21;
|
||||
this.label8.Text = "Pitch Accel";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "AccelPitch", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0"));
|
||||
this.textBox5.Location = new System.Drawing.Point(247, 109);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.ReadOnly = true;
|
||||
this.textBox5.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox5.TabIndex = 20;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(231, 141);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(53, 13);
|
||||
this.label9.TabIndex = 27;
|
||||
this.label9.Text = "Yaw Gyro";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "GyroYaw", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0"));
|
||||
this.textBox6.Location = new System.Drawing.Point(340, 157);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.ReadOnly = true;
|
||||
this.textBox6.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox6.TabIndex = 26;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(340, 5);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(44, 13);
|
||||
this.label10.TabIndex = 24;
|
||||
this.label10.Text = "Accel Z";
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "AccelZ", true, System.Windows.Forms.DataSourceUpdateMode.Never, null, "N0"));
|
||||
this.textBox7.Location = new System.Drawing.Point(343, 109);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.ReadOnly = true;
|
||||
this.textBox7.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox7.TabIndex = 23;
|
||||
//
|
||||
// progressBar3
|
||||
//
|
||||
this.progressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroYaw", true));
|
||||
this.progressBar3.Location = new System.Drawing.Point(234, 157);
|
||||
this.progressBar3.Maximum = 1000;
|
||||
this.progressBar3.Name = "progressBar3";
|
||||
this.progressBar3.Size = new System.Drawing.Size(100, 23);
|
||||
this.progressBar3.TabIndex = 28;
|
||||
//
|
||||
// FlightDataVmBindingSource
|
||||
//
|
||||
this.FlightDataVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.FlightDataVm);
|
||||
//
|
||||
// verticalProgressBar8
|
||||
//
|
||||
this.verticalProgressBar8.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelZ", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.verticalProgressBar8.Location = new System.Drawing.Point(354, 21);
|
||||
this.verticalProgressBar8.Maximum = 1000;
|
||||
this.verticalProgressBar8.Name = "verticalProgressBar8";
|
||||
this.verticalProgressBar8.Size = new System.Drawing.Size(24, 82);
|
||||
this.verticalProgressBar8.Step = 1;
|
||||
this.verticalProgressBar8.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar8.TabIndex = 22;
|
||||
this.verticalProgressBar8.Value = 500;
|
||||
//
|
||||
// verticalProgressBar6
|
||||
//
|
||||
this.verticalProgressBar6.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelPitch", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.verticalProgressBar6.Location = new System.Drawing.Point(258, 21);
|
||||
this.verticalProgressBar6.Maximum = 1000;
|
||||
this.verticalProgressBar6.Name = "verticalProgressBar6";
|
||||
this.verticalProgressBar6.Size = new System.Drawing.Size(24, 82);
|
||||
this.verticalProgressBar6.Step = 1;
|
||||
this.verticalProgressBar6.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar6.TabIndex = 19;
|
||||
this.verticalProgressBar6.Value = 500;
|
||||
//
|
||||
// verticalProgressBar5
|
||||
//
|
||||
this.verticalProgressBar5.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroPitch", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.verticalProgressBar5.Location = new System.Drawing.Point(198, 21);
|
||||
this.verticalProgressBar5.Maximum = 1000;
|
||||
this.verticalProgressBar5.Name = "verticalProgressBar5";
|
||||
this.verticalProgressBar5.Size = new System.Drawing.Size(24, 82);
|
||||
this.verticalProgressBar5.Step = 1;
|
||||
this.verticalProgressBar5.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar5.TabIndex = 16;
|
||||
this.verticalProgressBar5.Value = 500;
|
||||
//
|
||||
// verticalProgressBar4
|
||||
//
|
||||
this.verticalProgressBar4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRight", true));
|
||||
this.verticalProgressBar4.Location = new System.Drawing.Point(176, 157);
|
||||
this.verticalProgressBar4.Maximum = 2000;
|
||||
this.verticalProgressBar4.Minimum = 1000;
|
||||
this.verticalProgressBar4.Name = "verticalProgressBar4";
|
||||
this.verticalProgressBar4.Size = new System.Drawing.Size(24, 84);
|
||||
this.verticalProgressBar4.Step = 1;
|
||||
this.verticalProgressBar4.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar4.TabIndex = 6;
|
||||
this.verticalProgressBar4.Value = 1000;
|
||||
//
|
||||
// verticalProgressBar3
|
||||
//
|
||||
this.verticalProgressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRear", true));
|
||||
this.verticalProgressBar3.Location = new System.Drawing.Point(124, 157);
|
||||
this.verticalProgressBar3.Maximum = 2000;
|
||||
this.verticalProgressBar3.Minimum = 1000;
|
||||
this.verticalProgressBar3.Name = "verticalProgressBar3";
|
||||
this.verticalProgressBar3.Size = new System.Drawing.Size(24, 84);
|
||||
this.verticalProgressBar3.Step = 1;
|
||||
this.verticalProgressBar3.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar3.TabIndex = 4;
|
||||
this.verticalProgressBar3.Value = 1000;
|
||||
//
|
||||
// verticalProgressBar2
|
||||
//
|
||||
this.verticalProgressBar2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorFront", true));
|
||||
this.verticalProgressBar2.Location = new System.Drawing.Point(68, 157);
|
||||
this.verticalProgressBar2.Maximum = 2000;
|
||||
this.verticalProgressBar2.Minimum = 1000;
|
||||
this.verticalProgressBar2.Name = "verticalProgressBar2";
|
||||
this.verticalProgressBar2.Size = new System.Drawing.Size(24, 84);
|
||||
this.verticalProgressBar2.Step = 1;
|
||||
this.verticalProgressBar2.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar2.TabIndex = 2;
|
||||
this.verticalProgressBar2.Value = 1000;
|
||||
//
|
||||
// verticalProgressBar1
|
||||
//
|
||||
this.verticalProgressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorLeft", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.verticalProgressBar1.Location = new System.Drawing.Point(12, 157);
|
||||
this.verticalProgressBar1.Maximum = 2000;
|
||||
this.verticalProgressBar1.Minimum = 1000;
|
||||
this.verticalProgressBar1.Name = "verticalProgressBar1";
|
||||
this.verticalProgressBar1.Size = new System.Drawing.Size(24, 84);
|
||||
this.verticalProgressBar1.Step = 1;
|
||||
this.verticalProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.verticalProgressBar1.TabIndex = 0;
|
||||
this.verticalProgressBar1.Value = 1000;
|
||||
//
|
||||
// textBox8
|
||||
//
|
||||
this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "MotorFront", true));
|
||||
this.textBox8.Location = new System.Drawing.Point(55, 247);
|
||||
this.textBox8.Name = "textBox8";
|
||||
this.textBox8.ReadOnly = true;
|
||||
this.textBox8.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox8.TabIndex = 29;
|
||||
//
|
||||
// textBox9
|
||||
//
|
||||
this.textBox9.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "MotorRear", true));
|
||||
this.textBox9.Location = new System.Drawing.Point(108, 247);
|
||||
this.textBox9.Name = "textBox9";
|
||||
this.textBox9.ReadOnly = true;
|
||||
this.textBox9.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox9.TabIndex = 30;
|
||||
//
|
||||
// textBox10
|
||||
//
|
||||
this.textBox10.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlightDataVmBindingSource, "MotorRight", true));
|
||||
this.textBox10.Location = new System.Drawing.Point(161, 247);
|
||||
this.textBox10.Name = "textBox10";
|
||||
this.textBox10.ReadOnly = true;
|
||||
this.textBox10.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox10.TabIndex = 31;
|
||||
//
|
||||
// FlightDataView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.textBox10);
|
||||
this.Controls.Add(this.textBox9);
|
||||
this.Controls.Add(this.textBox8);
|
||||
this.Controls.Add(this.progressBar3);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.textBox6);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.textBox7);
|
||||
this.Controls.Add(this.verticalProgressBar8);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.textBox5);
|
||||
this.Controls.Add(this.verticalProgressBar6);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.verticalProgressBar5);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.progressBar2);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.verticalProgressBar4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.verticalProgressBar3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.verticalProgressBar2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.verticalProgressBar1);
|
||||
this.DoubleBuffered = true;
|
||||
this.Name = "FlightDataView";
|
||||
this.Size = new System.Drawing.Size(402, 275);
|
||||
((System.ComponentModel.ISupportInitialize)(this.FlightDataVmBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.BindingSource FlightDataVmBindingSource;
|
||||
private VerticalProgressBar verticalProgressBar1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private VerticalProgressBar verticalProgressBar2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private VerticalProgressBar verticalProgressBar3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private VerticalProgressBar verticalProgressBar4;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.ProgressBar progressBar2;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private VerticalProgressBar verticalProgressBar5;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private VerticalProgressBar verticalProgressBar6;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.TextBox textBox7;
|
||||
private VerticalProgressBar verticalProgressBar8;
|
||||
private System.Windows.Forms.ProgressBar progressBar3;
|
||||
private System.Windows.Forms.TextBox textBox8;
|
||||
private System.Windows.Forms.TextBox textBox9;
|
||||
private System.Windows.Forms.TextBox textBox10;
|
||||
}
|
||||
}
|
29
Configurator/Configurator.Net/Views/FlightDataView.cs
Normal file
29
Configurator/Configurator.Net/Views/FlightDataView.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
using ArducopterConfigurator.Views;
|
||||
|
||||
namespace ArducopterConfigurator.views
|
||||
{
|
||||
public partial class FlightDataView : FlightDataViewDesignable
|
||||
{
|
||||
public FlightDataView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override void SetDataContext(FlightDataVm model)
|
||||
{
|
||||
FlightDataVmBindingSource.DataSource = model;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class FlightDataViewDesignable : ViewCommon<FlightDataVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/FlightDataView.resx
Normal file
123
Configurator/Configurator.Net/Views/FlightDataView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="FlightDataVmBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>20, 28</value>
|
||||
</metadata>
|
||||
</root>
|
147
Configurator/Configurator.Net/Views/MotorCommandsView.Designer.cs
generated
Normal file
147
Configurator/Configurator.Net/Views/MotorCommandsView.Designer.cs
generated
Normal file
@ -0,0 +1,147 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class MotorCommandsView
|
||||
{
|
||||
/// <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.trckBarLeft = new System.Windows.Forms.TrackBar();
|
||||
this.btnStop = new System.Windows.Forms.Button();
|
||||
this.btnSend = new System.Windows.Forms.Button();
|
||||
this.trackBar1 = new System.Windows.Forms.TrackBar();
|
||||
this.trackBar2 = new System.Windows.Forms.TrackBar();
|
||||
this.trackBar3 = new System.Windows.Forms.TrackBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trckBarLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// trckBarLeft
|
||||
//
|
||||
this.trckBarLeft.LargeChange = 50;
|
||||
this.trckBarLeft.Location = new System.Drawing.Point(3, 52);
|
||||
this.trckBarLeft.Maximum = 1500;
|
||||
this.trckBarLeft.Minimum = 1000;
|
||||
this.trckBarLeft.Name = "trckBarLeft";
|
||||
this.trckBarLeft.Orientation = System.Windows.Forms.Orientation.Vertical;
|
||||
this.trckBarLeft.Size = new System.Drawing.Size(45, 104);
|
||||
this.trckBarLeft.SmallChange = 10;
|
||||
this.trckBarLeft.TabIndex = 0;
|
||||
this.trckBarLeft.TickFrequency = 50;
|
||||
this.trckBarLeft.Value = 1000;
|
||||
//
|
||||
// btnStop
|
||||
//
|
||||
this.btnStop.Location = new System.Drawing.Point(54, 52);
|
||||
this.btnStop.Name = "btnStop";
|
||||
this.btnStop.Size = new System.Drawing.Size(107, 92);
|
||||
this.btnStop.TabIndex = 4;
|
||||
this.btnStop.Text = "Stop";
|
||||
this.btnStop.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnSend
|
||||
//
|
||||
this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnSend.Enabled = false;
|
||||
this.btnSend.Location = new System.Drawing.Point(202, 203);
|
||||
this.btnSend.Name = "btnSend";
|
||||
this.btnSend.Size = new System.Drawing.Size(57, 27);
|
||||
this.btnSend.TabIndex = 5;
|
||||
this.btnSend.Text = "Send";
|
||||
this.btnSend.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// trackBar1
|
||||
//
|
||||
this.trackBar1.LargeChange = 50;
|
||||
this.trackBar1.Location = new System.Drawing.Point(180, 52);
|
||||
this.trackBar1.Maximum = 1500;
|
||||
this.trackBar1.Minimum = 1000;
|
||||
this.trackBar1.Name = "trackBar1";
|
||||
this.trackBar1.Orientation = System.Windows.Forms.Orientation.Vertical;
|
||||
this.trackBar1.Size = new System.Drawing.Size(45, 104);
|
||||
this.trackBar1.SmallChange = 10;
|
||||
this.trackBar1.TabIndex = 6;
|
||||
this.trackBar1.TickFrequency = 50;
|
||||
this.trackBar1.Value = 1000;
|
||||
//
|
||||
// trackBar2
|
||||
//
|
||||
this.trackBar2.LargeChange = 50;
|
||||
this.trackBar2.Location = new System.Drawing.Point(57, 150);
|
||||
this.trackBar2.Maximum = 1500;
|
||||
this.trackBar2.Minimum = 1000;
|
||||
this.trackBar2.Name = "trackBar2";
|
||||
this.trackBar2.Size = new System.Drawing.Size(104, 45);
|
||||
this.trackBar2.SmallChange = 10;
|
||||
this.trackBar2.TabIndex = 7;
|
||||
this.trackBar2.TickFrequency = 50;
|
||||
this.trackBar2.Value = 1000;
|
||||
//
|
||||
// trackBar3
|
||||
//
|
||||
this.trackBar3.LargeChange = 50;
|
||||
this.trackBar3.Location = new System.Drawing.Point(54, 3);
|
||||
this.trackBar3.Maximum = 1500;
|
||||
this.trackBar3.Minimum = 1000;
|
||||
this.trackBar3.Name = "trackBar3";
|
||||
this.trackBar3.Size = new System.Drawing.Size(104, 45);
|
||||
this.trackBar3.SmallChange = 10;
|
||||
this.trackBar3.TabIndex = 8;
|
||||
this.trackBar3.TickFrequency = 50;
|
||||
this.trackBar3.Value = 1000;
|
||||
//
|
||||
// MotorCommandsView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.trackBar3);
|
||||
this.Controls.Add(this.trackBar2);
|
||||
this.Controls.Add(this.trackBar1);
|
||||
this.Controls.Add(this.btnSend);
|
||||
this.Controls.Add(this.btnStop);
|
||||
this.Controls.Add(this.trckBarLeft);
|
||||
this.Name = "MotorCommandsView";
|
||||
this.Size = new System.Drawing.Size(262, 233);
|
||||
((System.ComponentModel.ISupportInitialize)(this.trckBarLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TrackBar trckBarLeft;
|
||||
private System.Windows.Forms.Button btnStop;
|
||||
private System.Windows.Forms.Button btnSend;
|
||||
private System.Windows.Forms.TrackBar trackBar1;
|
||||
private System.Windows.Forms.TrackBar trackBar2;
|
||||
private System.Windows.Forms.TrackBar trackBar3;
|
||||
}
|
||||
}
|
28
Configurator/Configurator.Net/Views/MotorCommandsView.cs
Normal file
28
Configurator/Configurator.Net/Views/MotorCommandsView.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class MotorCommandsView : MotorCommandsViewDesignable
|
||||
{
|
||||
public MotorCommandsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override void SetDataContext(MotorCommandsVm model)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class MotorCommandsViewDesignable : ViewCommon<MotorCommandsVm> { }
|
||||
}
|
120
Configurator/Configurator.Net/Views/MotorCommandsView.resx
Normal file
120
Configurator/Configurator.Net/Views/MotorCommandsView.resx
Normal 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>
|
299
Configurator/Configurator.Net/Views/PositionHoldConfigView.Designer.cs
generated
Normal file
299
Configurator/Configurator.Net/Views/PositionHoldConfigView.Designer.cs
generated
Normal file
@ -0,0 +1,299 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class PositionHoldConfigView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.PositionHoldConfigBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox7 = new System.Windows.Forms.TextBox();
|
||||
this.textBox8 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.btnRefresh = new System.Windows.Forms.Button();
|
||||
this.btnUpdate = new System.Windows.Forms.Button();
|
||||
this.groupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.PositionHoldConfigBindingSource)).BeginInit();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.label6);
|
||||
this.groupBox2.Controls.Add(this.textBox4);
|
||||
this.groupBox2.Controls.Add(this.textBox5);
|
||||
this.groupBox2.Controls.Add(this.textBox6);
|
||||
this.groupBox2.Location = new System.Drawing.Point(117, 4);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox2.TabIndex = 12;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Pitch";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(7, 74);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(15, 13);
|
||||
this.label4.TabIndex = 5;
|
||||
this.label4.Text = "D";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(7, 48);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(10, 13);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = "I";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(7, 22);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(14, 13);
|
||||
this.label6.TabIndex = 3;
|
||||
this.label6.Text = "P";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "PitchD", true));
|
||||
this.textBox4.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox4.TabIndex = 2;
|
||||
//
|
||||
// PositionHoldConfigBindingSource
|
||||
//
|
||||
this.PositionHoldConfigBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.PositionHoldConfigVm);
|
||||
this.PositionHoldConfigBindingSource.Sort = "";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "PitchI", true));
|
||||
this.textBox5.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "PitchP", true));
|
||||
this.textBox6.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox6.TabIndex = 0;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Controls.Add(this.label2);
|
||||
this.groupBox3.Controls.Add(this.label1);
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.textBox2);
|
||||
this.groupBox3.Controls.Add(this.textBox1);
|
||||
this.groupBox3.Location = new System.Drawing.Point(3, 3);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox3.TabIndex = 11;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Roll";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(7, 74);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(15, 13);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "D";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(7, 48);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(10, 13);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "I";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(7, 22);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(14, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "P";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "RollD", true));
|
||||
this.textBox3.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox3.TabIndex = 2;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "RollI", true));
|
||||
this.textBox2.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "RollP", true));
|
||||
this.textBox1.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "MaximumAngle", true));
|
||||
this.textBox7.Location = new System.Drawing.Point(238, 22);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox7.TabIndex = 13;
|
||||
//
|
||||
// textBox8
|
||||
//
|
||||
this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.PositionHoldConfigBindingSource, "GeoCorrectionFactor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.textBox8.Location = new System.Drawing.Point(238, 78);
|
||||
this.textBox8.Name = "textBox8";
|
||||
this.textBox8.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox8.TabIndex = 14;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(251, 6);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(60, 13);
|
||||
this.label7.TabIndex = 15;
|
||||
this.label7.Text = "Max Angle:";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(235, 62);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(114, 13);
|
||||
this.label8.TabIndex = 16;
|
||||
this.label8.Text = "Geo Correction Factor:";
|
||||
//
|
||||
// btnRefresh
|
||||
//
|
||||
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnRefresh.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.PositionHoldConfigBindingSource, "RefreshCommand", true));
|
||||
this.btnRefresh.Location = new System.Drawing.Point(195, 126);
|
||||
this.btnRefresh.Name = "btnRefresh";
|
||||
this.btnRefresh.Size = new System.Drawing.Size(74, 23);
|
||||
this.btnRefresh.TabIndex = 18;
|
||||
this.btnRefresh.Text = "Refresh";
|
||||
this.btnRefresh.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
this.btnUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnUpdate.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.PositionHoldConfigBindingSource, "UpdateCommand", true));
|
||||
this.btnUpdate.Location = new System.Drawing.Point(275, 126);
|
||||
this.btnUpdate.Name = "btnUpdate";
|
||||
this.btnUpdate.Size = new System.Drawing.Size(74, 23);
|
||||
this.btnUpdate.TabIndex = 17;
|
||||
this.btnUpdate.Text = "Update";
|
||||
this.btnUpdate.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PositionHoldConfigView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btnRefresh);
|
||||
this.Controls.Add(this.btnUpdate);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.textBox8);
|
||||
this.Controls.Add(this.textBox7);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Name = "PositionHoldConfigView";
|
||||
this.Size = new System.Drawing.Size(352, 152);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.PositionHoldConfigBindingSource)).EndInit();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox7;
|
||||
private System.Windows.Forms.TextBox textBox8;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.BindingSource PositionHoldConfigBindingSource;
|
||||
private System.Windows.Forms.Button btnRefresh;
|
||||
private System.Windows.Forms.Button btnUpdate;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class PositionHoldConfigView : PositionHoldConfigViewDesignable
|
||||
{
|
||||
public PositionHoldConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindButtons();
|
||||
}
|
||||
|
||||
public override void SetDataContext(PositionHoldConfigVm model)
|
||||
{
|
||||
PositionHoldConfigBindingSource.DataSource = model;
|
||||
_vm = model;
|
||||
}
|
||||
}
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class PositionHoldConfigViewDesignable : ViewCommon<PositionHoldConfigVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/PositionHoldConfigView.resx
Normal file
123
Configurator/Configurator.Net/Views/PositionHoldConfigView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="PositionHoldConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
115
Configurator/Configurator.Net/Views/SerialMonitorView.Designer.cs
generated
Normal file
115
Configurator/Configurator.Net/Views/SerialMonitorView.Designer.cs
generated
Normal file
@ -0,0 +1,115 @@
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
partial class SerialMonitorView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.txtSend = new System.Windows.Forms.TextBox();
|
||||
this.txtBoxRx = new System.Windows.Forms.TextBox();
|
||||
this.serialMonitorVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.txtBoxTx = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.serialMonitorVmBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtSend
|
||||
//
|
||||
this.txtSend.Location = new System.Drawing.Point(-167, 167);
|
||||
this.txtSend.Name = "txtSend";
|
||||
this.txtSend.Size = new System.Drawing.Size(10, 20);
|
||||
this.txtSend.TabIndex = 4;
|
||||
//
|
||||
// txtBoxRx
|
||||
//
|
||||
this.txtBoxRx.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtBoxRx.CausesValidation = false;
|
||||
this.txtBoxRx.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.serialMonitorVmBindingSource, "ReceviedText", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.txtBoxRx.Location = new System.Drawing.Point(3, 3);
|
||||
this.txtBoxRx.Multiline = true;
|
||||
this.txtBoxRx.Name = "txtBoxRx";
|
||||
this.txtBoxRx.ReadOnly = true;
|
||||
this.txtBoxRx.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.txtBoxRx.Size = new System.Drawing.Size(469, 356);
|
||||
this.txtBoxRx.TabIndex = 3;
|
||||
//
|
||||
// serialMonitorVmBindingSource
|
||||
//
|
||||
this.serialMonitorVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.SerialMonitorVm);
|
||||
//
|
||||
// txtBoxTx
|
||||
//
|
||||
this.txtBoxTx.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtBoxTx.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.serialMonitorVmBindingSource, "SendText", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.txtBoxTx.Location = new System.Drawing.Point(4, 365);
|
||||
this.txtBoxTx.Name = "txtBoxTx";
|
||||
this.txtBoxTx.Size = new System.Drawing.Size(357, 20);
|
||||
this.txtBoxTx.TabIndex = 5;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.Location = new System.Drawing.Point(367, 365);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(104, 23);
|
||||
this.button1.TabIndex = 6;
|
||||
this.button1.Text = "Send Command";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// SerialMonitorView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.txtBoxTx);
|
||||
this.Controls.Add(this.txtSend);
|
||||
this.Controls.Add(this.txtBoxRx);
|
||||
this.Name = "SerialMonitorView";
|
||||
this.Size = new System.Drawing.Size(475, 388);
|
||||
((System.ComponentModel.ISupportInitialize)(this.serialMonitorVmBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox txtSend;
|
||||
private System.Windows.Forms.TextBox txtBoxRx;
|
||||
private System.Windows.Forms.TextBox txtBoxTx;
|
||||
private System.Windows.Forms.BindingSource serialMonitorVmBindingSource;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
38
Configurator/Configurator.Net/Views/SerialMonitorView.cs
Normal file
38
Configurator/Configurator.Net/Views/SerialMonitorView.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
public partial class SerialMonitorView : UserControl, IView<SerialMonitorVm>
|
||||
{
|
||||
private IPresentationModel _vm;
|
||||
|
||||
public SerialMonitorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetDataContext(SerialMonitorVm mode)
|
||||
{
|
||||
serialMonitorVmBindingSource.DataSource = mode;
|
||||
_vm = mode;
|
||||
}
|
||||
|
||||
|
||||
public Control Control
|
||||
{
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
(_vm as SerialMonitorVm).SendTextCommand();
|
||||
}
|
||||
}
|
||||
}
|
123
Configurator/Configurator.Net/Views/SerialMonitorView.resx
Normal file
123
Configurator/Configurator.Net/Views/SerialMonitorView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="serialMonitorVmBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
350
Configurator/Configurator.Net/Views/StableConfigView.Designer.cs
generated
Normal file
350
Configurator/Configurator.Net/Views/StableConfigView.Designer.cs
generated
Normal file
@ -0,0 +1,350 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class StableConfigView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.textBox7 = new System.Windows.Forms.TextBox();
|
||||
this.StableModeConfigVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.textBox8 = new System.Windows.Forms.TextBox();
|
||||
this.textBox9 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.StableModeConfigVmBindingSource)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.StableModeConfigVmBindingSource, "RefreshCommand", true));
|
||||
this.button2.Location = new System.Drawing.Point(187, 134);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(74, 23);
|
||||
this.button2.TabIndex = 12;
|
||||
this.button2.Text = "Refresh";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.label7);
|
||||
this.groupBox4.Controls.Add(this.label8);
|
||||
this.groupBox4.Controls.Add(this.label9);
|
||||
this.groupBox4.Controls.Add(this.textBox7);
|
||||
this.groupBox4.Controls.Add(this.textBox8);
|
||||
this.groupBox4.Controls.Add(this.textBox9);
|
||||
this.groupBox4.Location = new System.Drawing.Point(234, 6);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox4.TabIndex = 11;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Yaw";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(7, 74);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(15, 13);
|
||||
this.label7.TabIndex = 5;
|
||||
this.label7.Text = "D";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(7, 48);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(10, 13);
|
||||
this.label8.TabIndex = 4;
|
||||
this.label8.Text = "I";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(7, 22);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(14, 13);
|
||||
this.label9.TabIndex = 3;
|
||||
this.label9.Text = "P";
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "YawD", true));
|
||||
this.textBox7.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox7.TabIndex = 2;
|
||||
//
|
||||
// StableModeConfigVmBindingSource
|
||||
//
|
||||
this.StableModeConfigVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.StableModeConfigVm);
|
||||
//
|
||||
// textBox8
|
||||
//
|
||||
this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "YawI", true));
|
||||
this.textBox8.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox8.Name = "textBox8";
|
||||
this.textBox8.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox8.TabIndex = 1;
|
||||
//
|
||||
// textBox9
|
||||
//
|
||||
this.textBox9.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "YawP", true));
|
||||
this.textBox9.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox9.Name = "textBox9";
|
||||
this.textBox9.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox9.TabIndex = 0;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.label6);
|
||||
this.groupBox2.Controls.Add(this.textBox4);
|
||||
this.groupBox2.Controls.Add(this.textBox5);
|
||||
this.groupBox2.Controls.Add(this.textBox6);
|
||||
this.groupBox2.Location = new System.Drawing.Point(120, 6);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox2.TabIndex = 10;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Pitch";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(7, 74);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(15, 13);
|
||||
this.label4.TabIndex = 5;
|
||||
this.label4.Text = "D";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(7, 48);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(10, 13);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = "I";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(7, 22);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(14, 13);
|
||||
this.label6.TabIndex = 3;
|
||||
this.label6.Text = "P";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "PitchD", true));
|
||||
this.textBox4.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox4.TabIndex = 2;
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "PitchI", true));
|
||||
this.textBox5.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "PitchP", true));
|
||||
this.textBox6.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox6.TabIndex = 0;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Controls.Add(this.label2);
|
||||
this.groupBox3.Controls.Add(this.label1);
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.textBox2);
|
||||
this.groupBox3.Controls.Add(this.textBox1);
|
||||
this.groupBox3.Location = new System.Drawing.Point(6, 5);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(108, 101);
|
||||
this.groupBox3.TabIndex = 9;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Roll";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(7, 74);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(15, 13);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "D";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(7, 48);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(10, 13);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "I";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(7, 22);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(14, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "P";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "RollD", true));
|
||||
this.textBox3.Location = new System.Drawing.Point(23, 71);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox3.TabIndex = 2;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "RollI", true));
|
||||
this.textBox2.Location = new System.Drawing.Point(23, 45);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.StableModeConfigVmBindingSource, "RollP", true));
|
||||
this.textBox1.Location = new System.Drawing.Point(23, 19);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(78, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.StableModeConfigVmBindingSource, "UpdateCommand", true));
|
||||
this.button1.Location = new System.Drawing.Point(267, 134);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(74, 23);
|
||||
this.button1.TabIndex = 8;
|
||||
this.button1.Text = "Update";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.StableModeConfigVmBindingSource, "MagnetometerEnable", true));
|
||||
this.checkBox1.Location = new System.Drawing.Point(14, 112);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(100, 17);
|
||||
this.checkBox1.TabIndex = 13;
|
||||
this.checkBox1.Text = "Magnetomoeter";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// StableConfigView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "StableConfigView";
|
||||
this.Size = new System.Drawing.Size(344, 160);
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.StableModeConfigVmBindingSource)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox textBox7;
|
||||
private System.Windows.Forms.TextBox textBox8;
|
||||
private System.Windows.Forms.TextBox textBox9;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.BindingSource StableModeConfigVmBindingSource;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
}
|
||||
}
|
29
Configurator/Configurator.Net/Views/StableConfigView.cs
Normal file
29
Configurator/Configurator.Net/Views/StableConfigView.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class StableConfigView : StableConfigViewDesignable
|
||||
{
|
||||
public StableConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindButtons();
|
||||
}
|
||||
|
||||
public override void SetDataContext(StableModeConfigVm model)
|
||||
{
|
||||
StableModeConfigVmBindingSource.DataSource = model;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class StableConfigViewDesignable : ViewCommon<StableModeConfigVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/StableConfigView.resx
Normal file
123
Configurator/Configurator.Net/Views/StableConfigView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="StableModeConfigVmBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
284
Configurator/Configurator.Net/Views/TransmitterChannelsView.Designer.cs
generated
Normal file
284
Configurator/Configurator.Net/Views/TransmitterChannelsView.Designer.cs
generated
Normal file
@ -0,0 +1,284 @@
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
partial class TransmitterChannelsView
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.progressBar3 = new System.Windows.Forms.ProgressBar();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.TransmitterChannelsBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.verticalProgressBar4 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar3 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar2 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
this.verticalProgressBar1 = new ArducopterConfigurator.VerticalProgressBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(4, 11);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(43, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Throttle";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(56, 11);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(31, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Pitch";
|
||||
//
|
||||
// progressBar3
|
||||
//
|
||||
this.progressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Yaw", true));
|
||||
this.progressBar3.Location = new System.Drawing.Point(174, 30);
|
||||
this.progressBar3.Maximum = 2000;
|
||||
this.progressBar3.Minimum = 1000;
|
||||
this.progressBar3.Name = "progressBar3";
|
||||
this.progressBar3.Size = new System.Drawing.Size(100, 23);
|
||||
this.progressBar3.TabIndex = 31;
|
||||
this.progressBar3.Value = 1000;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(171, 14);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(28, 13);
|
||||
this.label9.TabIndex = 30;
|
||||
this.label9.Text = "Yaw";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Yaw", true));
|
||||
this.textBox6.Location = new System.Drawing.Point(280, 30);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.ReadOnly = true;
|
||||
this.textBox6.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox6.TabIndex = 29;
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Roll", true));
|
||||
this.progressBar1.Location = new System.Drawing.Point(174, 80);
|
||||
this.progressBar1.Maximum = 2000;
|
||||
this.progressBar1.Minimum = 1000;
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(100, 23);
|
||||
this.progressBar1.TabIndex = 34;
|
||||
this.progressBar1.Value = 1000;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(171, 64);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(25, 13);
|
||||
this.label3.TabIndex = 33;
|
||||
this.label3.Text = "Roll";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Roll", true));
|
||||
this.textBox1.Location = new System.Drawing.Point(280, 80);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.ReadOnly = true;
|
||||
this.textBox1.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox1.TabIndex = 32;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Throttle", true));
|
||||
this.textBox2.Location = new System.Drawing.Point(7, 147);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.ReadOnly = true;
|
||||
this.textBox2.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox2.TabIndex = 35;
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Pitch", true));
|
||||
this.textBox3.Location = new System.Drawing.Point(59, 147);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.ReadOnly = true;
|
||||
this.textBox3.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox3.TabIndex = 36;
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Mode", true));
|
||||
this.textBox4.Location = new System.Drawing.Point(137, 210);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.ReadOnly = true;
|
||||
this.textBox4.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox4.TabIndex = 39;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(141, 115);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(34, 13);
|
||||
this.label4.TabIndex = 38;
|
||||
this.label4.Text = "Mode";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.TransmitterChannelsBindingSource, "Aux", true));
|
||||
this.textBox5.Location = new System.Drawing.Point(197, 210);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.ReadOnly = true;
|
||||
this.textBox5.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox5.TabIndex = 42;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(201, 115);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(25, 13);
|
||||
this.label5.TabIndex = 41;
|
||||
this.label5.Text = "Aux";
|
||||
//
|
||||
// TransmitterChannelsBindingSource
|
||||
//
|
||||
this.TransmitterChannelsBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.TransmitterChannelsVm);
|
||||
//
|
||||
// verticalProgressBar4
|
||||
//
|
||||
this.verticalProgressBar4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Aux", true));
|
||||
this.verticalProgressBar4.Location = new System.Drawing.Point(205, 131);
|
||||
this.verticalProgressBar4.Maximum = 2000;
|
||||
this.verticalProgressBar4.Minimum = 1000;
|
||||
this.verticalProgressBar4.Name = "verticalProgressBar4";
|
||||
this.verticalProgressBar4.Size = new System.Drawing.Size(27, 73);
|
||||
this.verticalProgressBar4.TabIndex = 40;
|
||||
this.verticalProgressBar4.Value = 1000;
|
||||
//
|
||||
// verticalProgressBar3
|
||||
//
|
||||
this.verticalProgressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Mode", true));
|
||||
this.verticalProgressBar3.Location = new System.Drawing.Point(145, 131);
|
||||
this.verticalProgressBar3.Maximum = 2000;
|
||||
this.verticalProgressBar3.Minimum = 1000;
|
||||
this.verticalProgressBar3.Name = "verticalProgressBar3";
|
||||
this.verticalProgressBar3.Size = new System.Drawing.Size(27, 73);
|
||||
this.verticalProgressBar3.TabIndex = 37;
|
||||
this.verticalProgressBar3.Value = 1000;
|
||||
//
|
||||
// verticalProgressBar2
|
||||
//
|
||||
this.verticalProgressBar2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Pitch", true));
|
||||
this.verticalProgressBar2.Location = new System.Drawing.Point(67, 30);
|
||||
this.verticalProgressBar2.Maximum = 2000;
|
||||
this.verticalProgressBar2.Minimum = 1000;
|
||||
this.verticalProgressBar2.Name = "verticalProgressBar2";
|
||||
this.verticalProgressBar2.Size = new System.Drawing.Size(27, 111);
|
||||
this.verticalProgressBar2.TabIndex = 2;
|
||||
this.verticalProgressBar2.Value = 1000;
|
||||
//
|
||||
// verticalProgressBar1
|
||||
//
|
||||
this.verticalProgressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.TransmitterChannelsBindingSource, "Throttle", true));
|
||||
this.verticalProgressBar1.Location = new System.Drawing.Point(15, 30);
|
||||
this.verticalProgressBar1.Maximum = 2000;
|
||||
this.verticalProgressBar1.Minimum = 1000;
|
||||
this.verticalProgressBar1.Name = "verticalProgressBar1";
|
||||
this.verticalProgressBar1.Size = new System.Drawing.Size(27, 111);
|
||||
this.verticalProgressBar1.TabIndex = 0;
|
||||
this.verticalProgressBar1.Value = 1000;
|
||||
//
|
||||
// TransmitterChannelsView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.textBox5);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.verticalProgressBar4);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.verticalProgressBar3);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.progressBar3);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.textBox6);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.verticalProgressBar2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.verticalProgressBar1);
|
||||
this.Name = "TransmitterChannelsView";
|
||||
this.Size = new System.Drawing.Size(369, 244);
|
||||
((System.ComponentModel.ISupportInitialize)(this.TransmitterChannelsBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private VerticalProgressBar verticalProgressBar1;
|
||||
private System.Windows.Forms.BindingSource TransmitterChannelsBindingSource;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private VerticalProgressBar verticalProgressBar2;
|
||||
private System.Windows.Forms.ProgressBar progressBar3;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private VerticalProgressBar verticalProgressBar3;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private VerticalProgressBar verticalProgressBar4;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
|
||||
namespace ArducopterConfigurator.Views
|
||||
{
|
||||
public partial class TransmitterChannelsView : TransmitterChannelsViewDesignable
|
||||
{
|
||||
public TransmitterChannelsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override void SetDataContext(TransmitterChannelsVm model)
|
||||
{
|
||||
TransmitterChannelsBindingSource.DataSource = model;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Required for VS2008 designer. No functional value
|
||||
public class TransmitterChannelsViewDesignable : ViewCommon<TransmitterChannelsVm> { }
|
||||
}
|
123
Configurator/Configurator.Net/Views/TransmitterChannelsView.resx
Normal file
123
Configurator/Configurator.Net/Views/TransmitterChannelsView.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="TransmitterChannelsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
37
Configurator/Configurator.Net/Views/ViewCommon.cs
Normal file
37
Configurator/Configurator.Net/Views/ViewCommon.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
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
|
||||
{
|
||||
protected T _vm;
|
||||
|
||||
public virtual void SetDataContext(T model)
|
||||
{
|
||||
}
|
||||
|
||||
protected void BindButtons()
|
||||
{
|
||||
foreach (var c in this.Controls)
|
||||
if (c is Button)
|
||||
(c as Button).Click += btn_Click;
|
||||
}
|
||||
|
||||
protected void btn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cmd = (sender as Button).Tag as ICommand;
|
||||
|
||||
if (cmd != null)
|
||||
if (cmd.CanExecute(null))
|
||||
cmd.Execute(null);
|
||||
}
|
||||
|
||||
public Control Control
|
||||
{
|
||||
get { return this; }
|
||||
}
|
||||
}
|
||||
}
|
157
Configurator/Configurator.Net/mainForm.Designer.cs
generated
Normal file
157
Configurator/Configurator.Net/mainForm.Designer.cs
generated
Normal file
@ -0,0 +1,157 @@
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
partial class mainForm
|
||||
{
|
||||
/// <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 Windows Form 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.components = new System.ComponentModel.Container();
|
||||
this.tabCtrlMonitorVms = new System.Windows.Forms.TabControl();
|
||||
this.mainVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.availablePortsBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.btnConnect = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.lblConnectionStatus = new System.Windows.Forms.Label();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.mainVmBindingSource)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.availablePortsBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabCtrlMonitorVms
|
||||
//
|
||||
this.tabCtrlMonitorVms.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tabCtrlMonitorVms.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.mainVmBindingSource, "IsConnected", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.tabCtrlMonitorVms.HotTrack = true;
|
||||
this.tabCtrlMonitorVms.Location = new System.Drawing.Point(12, 10);
|
||||
this.tabCtrlMonitorVms.Name = "tabCtrlMonitorVms";
|
||||
this.tabCtrlMonitorVms.SelectedIndex = 0;
|
||||
this.tabCtrlMonitorVms.Size = new System.Drawing.Size(530, 396);
|
||||
this.tabCtrlMonitorVms.TabIndex = 3;
|
||||
this.tabCtrlMonitorVms.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabCtrlConfigs_Selected);
|
||||
//
|
||||
// mainVmBindingSource
|
||||
//
|
||||
this.mainVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.MainVm);
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.comboBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.mainVmBindingSource, "SelectedPort", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.comboBox1.DataSource = this.availablePortsBindingSource;
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(12, 412);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(79, 21);
|
||||
this.comboBox1.TabIndex = 5;
|
||||
//
|
||||
// availablePortsBindingSource
|
||||
//
|
||||
this.availablePortsBindingSource.DataMember = "AvailablePorts";
|
||||
this.availablePortsBindingSource.DataSource = this.mainVmBindingSource;
|
||||
//
|
||||
// btnConnect
|
||||
//
|
||||
this.btnConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnConnect.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.btnConnect.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.mainVmBindingSource, "ConnectCommand", true));
|
||||
this.btnConnect.Location = new System.Drawing.Point(139, 412);
|
||||
this.btnConnect.Name = "btnConnect";
|
||||
this.btnConnect.Size = new System.Drawing.Size(70, 23);
|
||||
this.btnConnect.TabIndex = 6;
|
||||
this.btnConnect.Text = "Connect";
|
||||
this.btnConnect.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.button1.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.button1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.mainVmBindingSource, "DisconnectCommand", true));
|
||||
this.button1.Location = new System.Drawing.Point(215, 412);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(70, 23);
|
||||
this.button1.TabIndex = 7;
|
||||
this.button1.Text = "DisConnect";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblConnectionStatus
|
||||
//
|
||||
this.lblConnectionStatus.AutoSize = true;
|
||||
this.lblConnectionStatus.Location = new System.Drawing.Point(307, 417);
|
||||
this.lblConnectionStatus.Name = "lblConnectionStatus";
|
||||
this.lblConnectionStatus.Size = new System.Drawing.Size(35, 13);
|
||||
this.lblConnectionStatus.TabIndex = 8;
|
||||
this.lblConnectionStatus.Text = "label1";
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.button2.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.mainVmBindingSource, "RefreshPortListCommand", true));
|
||||
this.button2.Location = new System.Drawing.Point(97, 410);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(23, 23);
|
||||
this.button2.TabIndex = 9;
|
||||
this.button2.Text = "R";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// mainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(554, 445);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.lblConnectionStatus);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.btnConnect);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.tabCtrlMonitorVms);
|
||||
this.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.mainVmBindingSource, "Name", true));
|
||||
this.Name = "mainForm";
|
||||
this.Load += new System.EventHandler(this.MainFormLoaded);
|
||||
this.SizeChanged += new System.EventHandler(this.mainForm_SizeChanged);
|
||||
((System.ComponentModel.ISupportInitialize)(this.mainVmBindingSource)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.availablePortsBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TabControl tabCtrlMonitorVms;
|
||||
private System.Windows.Forms.BindingSource mainVmBindingSource;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.Button btnConnect;
|
||||
private System.Windows.Forms.BindingSource availablePortsBindingSource;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label lblConnectionStatus;
|
||||
private System.Windows.Forms.Button button2;
|
||||
}
|
||||
}
|
||||
|
171
Configurator/Configurator.Net/mainForm.cs
Normal file
171
Configurator/Configurator.Net/mainForm.cs
Normal file
@ -0,0 +1,171 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using ArducopterConfigurator.PresentationModels;
|
||||
using ArducopterConfigurator.views;
|
||||
using ArducopterConfigurator.Views;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
public partial class mainForm : Form, IView<MainVm>
|
||||
{
|
||||
private MainVm _vm;
|
||||
|
||||
public mainForm(MainVm vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
SetDataContext(vm);
|
||||
}
|
||||
|
||||
// IPresentationModel to IView map
|
||||
private readonly Dictionary<Type, Type> _viewMap = new Dictionary<Type, Type>
|
||||
{
|
||||
{typeof (FlightDataVm), typeof (FlightDataView)},
|
||||
{typeof (TransmitterChannelsVm), typeof (TransmitterChannelsView)},
|
||||
{typeof (CalibrationOffsetsDataVm), typeof (CalibrationView)},
|
||||
{typeof (MotorCommandsVm), typeof (MotorCommandsView)},
|
||||
{typeof (AcroModeConfigVm), typeof (AcroConfigView)},
|
||||
{typeof (StableModeConfigVm), typeof (StableConfigView)},
|
||||
{typeof (PositionHoldConfigVm), typeof (PositionHoldConfigView)},
|
||||
{typeof (AltitudeHoldConfigVm), typeof (AltitudeHoldConfigView)},
|
||||
{typeof (SerialMonitorVm), typeof (SerialMonitorView)},
|
||||
};
|
||||
|
||||
|
||||
private Control CreateAndBindView(IPresentationModel model)
|
||||
{
|
||||
if (_viewMap.ContainsKey(model.GetType()))
|
||||
{
|
||||
var viewtype = _viewMap[model.GetType()];
|
||||
var view = Activator.CreateInstance(viewtype);
|
||||
|
||||
var methodInfo = this.GetType().GetMethod("BindView");
|
||||
var closedBindViewMethod = methodInfo.MakeGenericMethod(model.GetType());
|
||||
return closedBindViewMethod.Invoke(this, new[] { model, view }) as Control;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// called via reflection above to close the T
|
||||
public Control BindView<T>(T model, IView<T> view) where T : IPresentationModel
|
||||
{
|
||||
view.SetDataContext(model);
|
||||
return view.Control;
|
||||
}
|
||||
|
||||
protected void BindButtons(MainVm vm)
|
||||
{
|
||||
foreach (var c in this.Controls)
|
||||
if (c is Button)
|
||||
(c as Button).Click += btn_Click;
|
||||
|
||||
vm.PropertyChanged += CheckCommandStates;
|
||||
CheckCommandStates(this,new PropertyChangedEventArgs(string.Empty));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cmd = (sender as Button).Tag as ICommand;
|
||||
|
||||
if (cmd != null)
|
||||
if (cmd.CanExecute(null))
|
||||
cmd.Execute(null);
|
||||
}
|
||||
|
||||
|
||||
#region Implementation of IView
|
||||
|
||||
public void SetDataContext(MainVm model)
|
||||
{
|
||||
_vm = model;
|
||||
mainVmBindingSource.DataSource = model;
|
||||
|
||||
foreach (var monitorVm in _vm.MonitorVms)
|
||||
{
|
||||
var tp = new TabPage(monitorVm.Name) {Tag = monitorVm};
|
||||
var control = CreateAndBindView(monitorVm);
|
||||
if (control != null)
|
||||
{
|
||||
tp.Controls.Add(control);
|
||||
control.Size = tp.ClientRectangle.Size;
|
||||
}
|
||||
tabCtrlMonitorVms.TabPages.Add(tp);
|
||||
}
|
||||
|
||||
var tabVm = tabCtrlMonitorVms.SelectedTab.Tag as MonitorVm;
|
||||
_vm.Select(tabVm);
|
||||
|
||||
UpdateConnectionStatusLabel();
|
||||
_vm.PropertyChanged += ((sender, e) => UpdateConnectionStatusLabel());
|
||||
|
||||
}
|
||||
|
||||
public Control Control
|
||||
{
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void tabCtrlConfigs_Selected(object sender, TabControlEventArgs e)
|
||||
{
|
||||
var control = e.TabPage.Controls[0];
|
||||
control.Size = e.TabPage.ClientRectangle.Size;
|
||||
var tabVm = e.TabPage.Tag as MonitorVm;
|
||||
_vm.Select(tabVm);
|
||||
}
|
||||
|
||||
|
||||
private void mainForm_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
ResizeChildControls();
|
||||
}
|
||||
|
||||
private void MainFormLoaded(object sender, EventArgs e)
|
||||
{
|
||||
ResizeChildControls();
|
||||
BindButtons(_vm);
|
||||
}
|
||||
|
||||
private void ResizeChildControls()
|
||||
{
|
||||
foreach (TabPage tabPage in tabCtrlMonitorVms.TabPages)
|
||||
{
|
||||
var control = tabPage.Controls[0];
|
||||
control.Size = tabPage.ClientRectangle.Size;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateConnectionStatusLabel()
|
||||
{
|
||||
switch (_vm.ConnectionState)
|
||||
{
|
||||
case MainVm.SessionStates.Disconnected:
|
||||
lblConnectionStatus.Text="Not Connected";
|
||||
break;
|
||||
case MainVm.SessionStates.Connecting:
|
||||
lblConnectionStatus.Text="Connecting...";
|
||||
break;
|
||||
case MainVm.SessionStates.Connected:
|
||||
lblConnectionStatus.Text="Connected - version " + _vm.ApmVersion;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
126
Configurator/Configurator.Net/mainForm.resx
Normal file
126
Configurator/Configurator.Net/mainForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?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>
|
||||
<metadata name="mainVmBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>7, 19</value>
|
||||
</metadata>
|
||||
<metadata name="availablePortsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>170, 20</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user