Configurator.Net: Added Fake Arducopter comms, Wrapped progress bar into custom control, improved Mono compatibility
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1237 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
81ba0d36c2
commit
36ade2aaf6
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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>
|
||||
@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ArducopterConfigurator</RootNamespace>
|
||||
<AssemblyName>ArducopterConfigurator</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@ -41,6 +41,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="CommsSession.cs">
|
||||
</Compile>
|
||||
<Compile Include="FakeCommsSession.cs" />
|
||||
<Compile Include="PresentationModels\AcroModeConfigVm.cs" />
|
||||
<Compile Include="PresentationModels\AltitudeHoldConfigVm.cs" />
|
||||
<Compile Include="PresentationModels\ConfigWithPidsBase.cs" />
|
||||
@ -70,8 +71,8 @@
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SensorDisplay.resx">
|
||||
<DependentUpon>SensorDisplay.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Views\controls\LinearSensorIndicatorControl.resx">
|
||||
<DependentUpon>LinearSensorIndicatorControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Views\AcroConfigView.resx">
|
||||
<DependentUpon>AcroConfigView.cs</DependentUpon>
|
||||
@ -120,10 +121,10 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="SensorDisplay.cs">
|
||||
<Compile Include="Views\controls\LinearSensorIndicatorControl.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VerticalProgressBar.cs">
|
||||
<Compile Include="Views\controls\VerticalProgressBar.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Views\AcroConfigView.cs">
|
||||
@ -195,6 +196,7 @@
|
||||
<Content Include="Views\icons\disconnect.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildBinPath)\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">
|
||||
|
@ -12,6 +12,8 @@ namespace ArducopterConfigurator
|
||||
{
|
||||
event Action<string> LineOfDataReceived;
|
||||
string CommPort { get; set; }
|
||||
bool IsConnected { get; }
|
||||
IEnumerable<string> ListCommPorts();
|
||||
void Send(string send);
|
||||
bool Connect();
|
||||
bool DisConnect();
|
||||
@ -101,9 +103,15 @@ namespace ArducopterConfigurator
|
||||
|
||||
private string Error { get; set;}
|
||||
|
||||
public SerialPort SerialPort
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return _sp; }
|
||||
get { return _sp.IsOpen; }
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListCommPorts()
|
||||
{
|
||||
return SerialPort.GetPortNames();
|
||||
}
|
||||
|
||||
public void Send(string send)
|
||||
|
110
Configurator/Configurator.Net/FakeCommsSession.cs
Normal file
110
Configurator/Configurator.Net/FakeCommsSession.cs
Normal file
@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
/// <summary>
|
||||
/// Fake implementation of Comms + APM for testing without a device connected
|
||||
/// </summary>
|
||||
public class FakeCommsSession : IComms
|
||||
{
|
||||
private bool _connected;
|
||||
private string _jabberData;
|
||||
private readonly Timer _jabberTimer;
|
||||
|
||||
#region Implementation of IComms
|
||||
|
||||
public FakeCommsSession()
|
||||
{
|
||||
_jabberTimer = new Timer();
|
||||
_jabberTimer.Interval = 1000;
|
||||
_jabberTimer.Tick += timer_Tick;
|
||||
}
|
||||
|
||||
public event Action<string> LineOfDataReceived;
|
||||
|
||||
public string CommPort { get; set; }
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return _connected; }
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListCommPorts()
|
||||
{
|
||||
return new[] {"FakePort1", "FakePort2"};
|
||||
}
|
||||
|
||||
public void Send(string stringSent)
|
||||
{
|
||||
if (!_connected)
|
||||
throw new InvalidOperationException("Not Connected");
|
||||
|
||||
if (stringSent == "!")
|
||||
ReturnData("Fake");
|
||||
if (stringSent == "S")
|
||||
{
|
||||
// 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
|
||||
|
||||
_jabberData = "2,-10,3,-2,1011,1012,1002,1000,1001,1200,1003,1400,1000,1000,1000";
|
||||
StartJabber();
|
||||
}
|
||||
if (stringSent == "X")
|
||||
StopJabber();
|
||||
}
|
||||
|
||||
private void StopJabber()
|
||||
{
|
||||
_jabberTimer.Stop();
|
||||
}
|
||||
|
||||
private void StartJabber()
|
||||
{
|
||||
_jabberTimer.Start();
|
||||
}
|
||||
|
||||
void timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
ReturnData(_jabberData);
|
||||
}
|
||||
|
||||
|
||||
private void ReturnData(string data)
|
||||
{
|
||||
if (LineOfDataReceived != null)
|
||||
LineOfDataReceived(data + "\n");
|
||||
}
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
if (_connected)
|
||||
throw new InvalidOperationException("Already Connected");
|
||||
_connected = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool DisConnect()
|
||||
{
|
||||
if (!_connected)
|
||||
throw new InvalidOperationException("Already DisConnected");
|
||||
_connected = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,15 +1,12 @@
|
||||
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 IComms _session;
|
||||
private readonly IComms _comms;
|
||||
private bool _isConnected;
|
||||
private MonitorVm _selectedVm;
|
||||
private string _selectedPort;
|
||||
@ -21,8 +18,8 @@ namespace ArducopterConfigurator.PresentationModels
|
||||
|
||||
public MainVm(IComms session)
|
||||
{
|
||||
_session = session;
|
||||
_session.LineOfDataReceived += _session_LineOfDataReceived;
|
||||
_comms = session;
|
||||
_comms.LineOfDataReceived += _session_LineOfDataReceived;
|
||||
|
||||
MonitorVms = new BindingList<MonitorVm>
|
||||
{
|
||||
@ -53,9 +50,8 @@ namespace ArducopterConfigurator.PresentationModels
|
||||
private void RefreshPorts()
|
||||
{
|
||||
AvailablePorts.Clear();
|
||||
foreach (var c in SerialPort.GetPortNames())
|
||||
foreach (var c in _comms.ListCommPorts())
|
||||
AvailablePorts.Add(c);
|
||||
|
||||
}
|
||||
|
||||
void _session_LineOfDataReceived(string strRx)
|
||||
@ -131,10 +127,10 @@ namespace ArducopterConfigurator.PresentationModels
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
_session.CommPort = SelectedPort;
|
||||
_comms.CommPort = SelectedPort;
|
||||
|
||||
// Todo: check the status of this call success/failure
|
||||
_session.Connect();
|
||||
_comms.Connect();
|
||||
|
||||
ConnectionState = SessionStates.Connecting;
|
||||
|
||||
@ -151,16 +147,16 @@ namespace ArducopterConfigurator.PresentationModels
|
||||
_connectionAttemptsTimer.Stop();
|
||||
return;
|
||||
}
|
||||
_session.Send("X");
|
||||
_comms.Send("X");
|
||||
|
||||
// once we connected, then get the version string
|
||||
_session.Send("!");
|
||||
_comms.Send("!");
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
_session.Send("X");
|
||||
_session.DisConnect();
|
||||
_comms.Send("X");
|
||||
_comms.DisConnect();
|
||||
ConnectionState = SessionStates.Disconnected;
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,7 @@ namespace ArducopterConfigurator
|
||||
/// </summary>
|
||||
protected void SendString(string strToSend)
|
||||
{
|
||||
if (_sp.IsConnected)
|
||||
_sp.Send(strToSend);
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,11 @@ namespace ArducopterConfigurator
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
var session = new CommsSession();
|
||||
//var session = new CommsSession();
|
||||
var session = new FakeCommsSession();
|
||||
|
||||
var mainVm = new MainVm(session);
|
||||
|
||||
|
||||
|
||||
Application.Run(new mainForm(mainVm));
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ namespace ArducopterConfiguratorTest
|
||||
getCommand = "P";
|
||||
setCommand = "O";
|
||||
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new AcroModeConfigVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new AcroModeConfigVm(_mockComms);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -33,8 +33,8 @@ namespace ArducopterConfiguratorTest
|
||||
|
||||
_vm.UpdateCommand.Execute(null);
|
||||
|
||||
Assert.AreEqual(1, _fakeComms.SentItems.Count);
|
||||
Assert.AreEqual("O5;6;7;1;2;3;8;9;10;4", _fakeComms.SentItems[0]);
|
||||
Assert.AreEqual(1, _mockComms.SentItems.Count);
|
||||
Assert.AreEqual("O5;6;7;1;2;3;8;9;10;4", _mockComms.SentItems[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,8 @@ namespace ArducopterConfiguratorTest
|
||||
getCommand = "F";
|
||||
setCommand = "E";
|
||||
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new AltitudeHoldConfigVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new AltitudeHoldConfigVm(_mockComms);
|
||||
}
|
||||
|
||||
|
||||
@ -30,8 +30,8 @@ namespace ArducopterConfiguratorTest
|
||||
|
||||
_vm.UpdateCommand.Execute(null);
|
||||
|
||||
Assert.AreEqual(1, _fakeComms.SentItems.Count);
|
||||
Assert.AreEqual("E1;3;2", _fakeComms.SentItems[0]);
|
||||
Assert.AreEqual(1, _mockComms.SentItems.Count);
|
||||
Assert.AreEqual("E1;3;2", _mockComms.SentItems[0]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -40,7 +40,7 @@ namespace ArducopterConfiguratorTest
|
||||
public void UpdateStringReceivedPopulatesValuesCorrectly()
|
||||
{
|
||||
_vm.Activate();
|
||||
_fakeComms.FireLineRecieve(sampleLineOfData);
|
||||
_mockComms.FireLineRecieve(sampleLineOfData);
|
||||
|
||||
Assert.AreEqual(0.8f, _vm.P);
|
||||
Assert.AreEqual(0.2f, _vm.I);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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>
|
||||
@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ArducopterConfiguratorTest</RootNamespace>
|
||||
<AssemblyName>ArducopterConfiguratorTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@ -31,13 +31,13 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Lib3\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Lib3\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AcroModeConfigVmTest.cs" />
|
||||
@ -57,6 +57,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildBinPath)\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">
|
||||
|
@ -14,8 +14,8 @@ namespace ArducopterConfiguratorTest
|
||||
getCommand = "J";
|
||||
setCommand = "I";
|
||||
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new CalibrationOffsetsDataVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new CalibrationOffsetsDataVm(_mockComms);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,12 +7,22 @@ using NUnit.Framework;
|
||||
|
||||
namespace ArducopterConfiguratorTest
|
||||
{
|
||||
public class FakeComms : IComms
|
||||
public class MockComms : IComms
|
||||
{
|
||||
public event Action<string> LineOfDataReceived;
|
||||
public string CommPort { get; set; }
|
||||
public List<string> SentItems = new List<string>();
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListCommPorts()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Send(string send)
|
||||
{
|
||||
SentItems.Add(send);
|
||||
@ -38,14 +48,14 @@ namespace ArducopterConfiguratorTest
|
||||
[TestFixture]
|
||||
public class MainVmTests
|
||||
{
|
||||
private FakeComms _fakeComms;
|
||||
private MockComms _mockComms;
|
||||
private MainVm _vm;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new MainVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new MainVm(_mockComms);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -6,14 +6,14 @@ namespace ArducopterConfiguratorTest
|
||||
[TestFixture]
|
||||
public class MotorCommandsVmTest
|
||||
{
|
||||
private FakeComms _fakeComms;
|
||||
private MockComms _mockComms;
|
||||
private MotorCommandsVm _vm;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new MotorCommandsVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new MotorCommandsVm(_mockComms);
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,8 +14,8 @@ namespace ArducopterConfiguratorTest
|
||||
getCommand = "D";
|
||||
setCommand = "C";
|
||||
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new PositionHoldConfigVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new PositionHoldConfigVm(_mockComms);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ namespace ArducopterConfiguratorTest
|
||||
getCommand = "B";
|
||||
setCommand = "A";
|
||||
|
||||
_fakeComms = new FakeComms();
|
||||
_vm = new StableModeConfigVm(_fakeComms);
|
||||
_mockComms = new MockComms();
|
||||
_vm = new StableModeConfigVm(_mockComms);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -36,13 +36,13 @@ namespace ArducopterConfiguratorTest
|
||||
_vm.UpdateCommand.Execute(null);
|
||||
|
||||
|
||||
Assert.AreEqual(1, _fakeComms.SentItems.Count);
|
||||
Assert.AreEqual(1, _mockComms.SentItems.Count);
|
||||
|
||||
//A[KP Quad Roll];[KI Quad Roll];[KP RATE ROLL];
|
||||
// [KP Quad Pitch];[KI Quad Pitch];[KP RATE PITCH];
|
||||
// [KP Quad Yaw];[KI Quad Yaw];[KP Rate Yaw];
|
||||
// [KP Rate];[Magneto]
|
||||
Assert.AreEqual("A5;6;7;1;2;3;8;9;10;4;1", _fakeComms.SentItems[0]);
|
||||
Assert.AreEqual("A5;6;7;1;2;3;8;9;10;4;1", _mockComms.SentItems[0]);
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ namespace ArducopterConfiguratorTest
|
||||
public void UpdateStringReceivedPopulatesValuesCorrectly()
|
||||
{
|
||||
_vm.Activate();
|
||||
_fakeComms.FireLineRecieve(sampleLineOfData);
|
||||
_mockComms.FireLineRecieve(sampleLineOfData);
|
||||
|
||||
Assert.AreEqual(1.95f, _vm.RollP);
|
||||
Assert.AreEqual(0.1f, _vm.RollI);
|
||||
|
@ -6,7 +6,7 @@ namespace ArducopterConfiguratorTest
|
||||
public abstract class VmTestBase<T> where T : MonitorVm
|
||||
{
|
||||
protected T _vm;
|
||||
protected FakeComms _fakeComms;
|
||||
protected MockComms _mockComms;
|
||||
protected string sampleLineOfData; // should be taken from a real APM if possible
|
||||
protected string getCommand;
|
||||
protected string setCommand;
|
||||
@ -15,8 +15,8 @@ namespace ArducopterConfiguratorTest
|
||||
public void ActivateSendsCorrectCommand()
|
||||
{
|
||||
_vm.Activate();
|
||||
Assert.AreEqual(1, _fakeComms.SentItems.Count);
|
||||
Assert.AreEqual(getCommand, _fakeComms.SentItems[0]);
|
||||
Assert.AreEqual(1, _mockComms.SentItems.Count);
|
||||
Assert.AreEqual(getCommand, _mockComms.SentItems[0]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -25,7 +25,7 @@ namespace ArducopterConfiguratorTest
|
||||
bool inpcFired = false;
|
||||
_vm.PropertyChanged += delegate { inpcFired = true; };
|
||||
|
||||
_fakeComms.FireLineRecieve(sampleLineOfData);
|
||||
_mockComms.FireLineRecieve(sampleLineOfData);
|
||||
Assert.False(inpcFired);
|
||||
}
|
||||
|
||||
@ -33,9 +33,9 @@ namespace ArducopterConfiguratorTest
|
||||
public void ReceivedDataIgnoredAfterDeActive()
|
||||
{
|
||||
_vm.Activate();
|
||||
_fakeComms.FireLineRecieve(sampleLineOfData);
|
||||
_mockComms.FireLineRecieve(sampleLineOfData);
|
||||
_vm.DeActivate();
|
||||
_fakeComms.FireLineRecieve(sampleLineOfData);
|
||||
_mockComms.FireLineRecieve(sampleLineOfData);
|
||||
bool inpcFired = false;
|
||||
_vm.PropertyChanged += delegate { inpcFired = true; };
|
||||
|
||||
@ -49,7 +49,7 @@ namespace ArducopterConfiguratorTest
|
||||
_vm.PropertyChanged += delegate { inpcFired = true; };
|
||||
|
||||
_vm.Activate();
|
||||
_fakeComms.FireLineRecieve(sampleLineOfData);
|
||||
_mockComms.FireLineRecieve(sampleLineOfData);
|
||||
|
||||
Assert.True(inpcFired);
|
||||
}
|
||||
|
@ -34,11 +34,10 @@
|
||||
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.FlightDataVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
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();
|
||||
@ -48,15 +47,16 @@
|
||||
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.sensorRollGyro = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.sensorRollAcc = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.progressBar3 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.verticalProgressBar8 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.verticalProgressBar6 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.sensorPitchGyro = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.verticalProgressBar4 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.verticalProgressBar3 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.verticalProgressBar2 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.verticalProgressBar1 = new ArducopterConfigurator.LinearSensorIndicatorControl();
|
||||
this.textBox8 = new System.Windows.Forms.TextBox();
|
||||
this.textBox9 = new System.Windows.Forms.TextBox();
|
||||
this.textBox10 = new System.Windows.Forms.TextBox();
|
||||
@ -108,14 +108,9 @@
|
||||
this.textBox1.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox1.TabIndex = 8;
|
||||
//
|
||||
// progressBar1
|
||||
// FlightDataVmBindingSource
|
||||
//
|
||||
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;
|
||||
this.FlightDataVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.FlightDataVm);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
@ -144,15 +139,6 @@
|
||||
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;
|
||||
@ -234,6 +220,24 @@
|
||||
this.textBox7.Size = new System.Drawing.Size(47, 20);
|
||||
this.textBox7.TabIndex = 23;
|
||||
//
|
||||
// sensorRollGyro
|
||||
//
|
||||
this.sensorRollGyro.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.sensorRollGyro.Location = new System.Drawing.Point(12, 25);
|
||||
this.sensorRollGyro.Maximum = 1000;
|
||||
this.sensorRollGyro.Name = "sensorRollGyro";
|
||||
this.sensorRollGyro.Size = new System.Drawing.Size(100, 23);
|
||||
this.sensorRollGyro.TabIndex = 9;
|
||||
//
|
||||
// sensorRollAcc
|
||||
//
|
||||
this.sensorRollAcc.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelRoll", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.sensorRollAcc.Location = new System.Drawing.Point(12, 68);
|
||||
this.sensorRollAcc.Maximum = 1000;
|
||||
this.sensorRollAcc.Name = "sensorRollAcc";
|
||||
this.sensorRollAcc.Size = new System.Drawing.Size(100, 23);
|
||||
this.sensorRollAcc.TabIndex = 14;
|
||||
//
|
||||
// progressBar3
|
||||
//
|
||||
this.progressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroYaw", true));
|
||||
@ -243,13 +247,10 @@
|
||||
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.IsVertical = true;
|
||||
this.verticalProgressBar8.Location = new System.Drawing.Point(354, 21);
|
||||
this.verticalProgressBar8.Maximum = 1000;
|
||||
this.verticalProgressBar8.Name = "verticalProgressBar8";
|
||||
@ -262,6 +263,7 @@
|
||||
// verticalProgressBar6
|
||||
//
|
||||
this.verticalProgressBar6.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "AccelPitch", true, System.Windows.Forms.DataSourceUpdateMode.Never));
|
||||
this.verticalProgressBar6.IsVertical = true;
|
||||
this.verticalProgressBar6.Location = new System.Drawing.Point(258, 21);
|
||||
this.verticalProgressBar6.Maximum = 1000;
|
||||
this.verticalProgressBar6.Name = "verticalProgressBar6";
|
||||
@ -271,21 +273,23 @@
|
||||
this.verticalProgressBar6.TabIndex = 19;
|
||||
this.verticalProgressBar6.Value = 500;
|
||||
//
|
||||
// verticalProgressBar5
|
||||
// sensorPitchGyro
|
||||
//
|
||||
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;
|
||||
this.sensorPitchGyro.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "GyroPitch", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.sensorPitchGyro.IsVertical = true;
|
||||
this.sensorPitchGyro.Location = new System.Drawing.Point(198, 21);
|
||||
this.sensorPitchGyro.Maximum = 1000;
|
||||
this.sensorPitchGyro.Name = "sensorPitchGyro";
|
||||
this.sensorPitchGyro.Size = new System.Drawing.Size(24, 82);
|
||||
this.sensorPitchGyro.Step = 1;
|
||||
this.sensorPitchGyro.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.sensorPitchGyro.TabIndex = 16;
|
||||
this.sensorPitchGyro.Value = 500;
|
||||
//
|
||||
// verticalProgressBar4
|
||||
//
|
||||
this.verticalProgressBar4.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRight", true));
|
||||
this.verticalProgressBar4.IsVertical = true;
|
||||
this.verticalProgressBar4.Location = new System.Drawing.Point(176, 157);
|
||||
this.verticalProgressBar4.Maximum = 2000;
|
||||
this.verticalProgressBar4.Minimum = 1000;
|
||||
@ -299,6 +303,7 @@
|
||||
// verticalProgressBar3
|
||||
//
|
||||
this.verticalProgressBar3.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorRear", true));
|
||||
this.verticalProgressBar3.IsVertical = true;
|
||||
this.verticalProgressBar3.Location = new System.Drawing.Point(124, 157);
|
||||
this.verticalProgressBar3.Maximum = 2000;
|
||||
this.verticalProgressBar3.Minimum = 1000;
|
||||
@ -312,6 +317,7 @@
|
||||
// verticalProgressBar2
|
||||
//
|
||||
this.verticalProgressBar2.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorFront", true));
|
||||
this.verticalProgressBar2.IsVertical = true;
|
||||
this.verticalProgressBar2.Location = new System.Drawing.Point(68, 157);
|
||||
this.verticalProgressBar2.Maximum = 2000;
|
||||
this.verticalProgressBar2.Minimum = 1000;
|
||||
@ -325,6 +331,7 @@
|
||||
// verticalProgressBar1
|
||||
//
|
||||
this.verticalProgressBar1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.FlightDataVmBindingSource, "MotorLeft", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.verticalProgressBar1.IsVertical = true;
|
||||
this.verticalProgressBar1.Location = new System.Drawing.Point(12, 157);
|
||||
this.verticalProgressBar1.Maximum = 2000;
|
||||
this.verticalProgressBar1.Minimum = 1000;
|
||||
@ -380,13 +387,13 @@
|
||||
this.Controls.Add(this.verticalProgressBar6);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.verticalProgressBar5);
|
||||
this.Controls.Add(this.sensorPitchGyro);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.progressBar2);
|
||||
this.Controls.Add(this.sensorRollAcc);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.sensorRollGyro);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.verticalProgressBar4);
|
||||
@ -408,33 +415,37 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.BindingSource FlightDataVmBindingSource;
|
||||
private VerticalProgressBar verticalProgressBar1;
|
||||
|
||||
private LinearSensorIndicatorControl sensorRollGyro;
|
||||
private LinearSensorIndicatorControl verticalProgressBar1;
|
||||
private LinearSensorIndicatorControl verticalProgressBar2;
|
||||
private LinearSensorIndicatorControl verticalProgressBar3;
|
||||
private LinearSensorIndicatorControl verticalProgressBar4;
|
||||
private LinearSensorIndicatorControl sensorPitchGyro;
|
||||
private LinearSensorIndicatorControl verticalProgressBar6;
|
||||
private LinearSensorIndicatorControl verticalProgressBar8;
|
||||
private LinearSensorIndicatorControl sensorRollAcc;
|
||||
private LinearSensorIndicatorControl progressBar3;
|
||||
|
||||
|
||||
|
||||
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;
|
||||
|
@ -0,0 +1,111 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a custom tweaking of the standard Progress bar
|
||||
/// </summary>
|
||||
[ToolboxBitmap(typeof(ProgressBar))]
|
||||
public class LinearSensorIndicatorControl : ProgressBar
|
||||
{
|
||||
private bool m_IsVertical;
|
||||
|
||||
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;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value<Minimum)
|
||||
{
|
||||
// don't do it
|
||||
value = Minimum;
|
||||
}
|
||||
if (value > Maximum)
|
||||
{
|
||||
// don't do it
|
||||
value = Maximum;
|
||||
}
|
||||
base.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Maximum;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Maximum = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public new int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Minimum ;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Minimum = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Description("Whether the display grows vertically")]
|
||||
[Category("LinearSensorIndicatorControl")]
|
||||
[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("LinearSensorIndicatorControl")]
|
||||
// [DefaultValue(0)]
|
||||
// [RefreshProperties(RefreshProperties.All)]
|
||||
// public int Offset
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_Offset;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_Offset = value;
|
||||
// Invalidate();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -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>
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
namespace ArducopterConfigurator
|
||||
using System;
|
||||
namespace ArducopterConfigurator
|
||||
{
|
||||
partial class mainForm
|
||||
{
|
||||
@ -32,7 +33,7 @@
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
|
||||
this.tabCtrlMonitorVms = new System.Windows.Forms.TabControl();
|
||||
this.mainVmBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.cmboComPorts = 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();
|
||||
@ -61,21 +62,16 @@
|
||||
//
|
||||
this.mainVmBindingSource.DataSource = typeof(ArducopterConfigurator.PresentationModels.MainVm);
|
||||
//
|
||||
// comboBox1
|
||||
// cmboComPorts
|
||||
//
|
||||
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;
|
||||
this.cmboComPorts.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.cmboComPorts.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.mainVmBindingSource, "SelectedPort", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.cmboComPorts.DataSource = this.availablePortsBindingSource;
|
||||
this.cmboComPorts.FormattingEnabled = true;
|
||||
this.cmboComPorts.Location = new System.Drawing.Point(12, 412);
|
||||
this.cmboComPorts.Name = "cmboComPorts";
|
||||
this.cmboComPorts.Size = new System.Drawing.Size(79, 21);
|
||||
this.cmboComPorts.TabIndex = 5;
|
||||
//
|
||||
// btnConnect
|
||||
//
|
||||
@ -134,7 +130,7 @@
|
||||
this.Controls.Add(this.lblConnectionStatus);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.btnConnect);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.cmboComPorts);
|
||||
this.Controls.Add(this.tabCtrlMonitorVms);
|
||||
this.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.mainVmBindingSource, "Name", true));
|
||||
this.Name = "mainForm";
|
||||
@ -151,7 +147,7 @@
|
||||
|
||||
private System.Windows.Forms.TabControl tabCtrlMonitorVms;
|
||||
private System.Windows.Forms.BindingSource mainVmBindingSource;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox cmboComPorts;
|
||||
private System.Windows.Forms.Button btnConnect;
|
||||
private System.Windows.Forms.BindingSource availablePortsBindingSource;
|
||||
private System.Windows.Forms.Button button1;
|
||||
|
@ -93,7 +93,9 @@ namespace ArducopterConfigurator
|
||||
{
|
||||
_vm = model;
|
||||
mainVmBindingSource.DataSource = model;
|
||||
availablePortsBindingSource.DataSource = model.AvailablePorts;
|
||||
|
||||
|
||||
foreach (var monitorVm in _vm.MonitorVms)
|
||||
{
|
||||
var tp = new TabPage(monitorVm.Name) {Tag = monitorVm};
|
||||
|
@ -127,17 +127,18 @@
|
||||
<data name="btnConnect.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJZSURBVDhPlZPdT5JhGMbZ2trczNqiWdnanLnVbNTWhl9I
|
||||
koSoDTFfEzBFVCwTQlQQsECQ1K0wSnwBJV6ciKbZMiszY0ll88Ct7Ougsw76L9qugIN3Y3AQz/bbc5/c
|
||||
133d156HwUjzWEKE0DxHrERvIs1WBsMQEInMswQ+fF/Ao3UjjAFxV0oRvVvA7vNUUf3eKsSI1mSvt1Jk
|
||||
8ImwuRvE+29TiHwNYGD6ElIKqJ08amVrAr/+bMXxvTJB6xJgY8eP1zv3MbPRg35SCPUDXqIDy2LDXo2L
|
||||
H3Ata7G6fQ/+dVWc8JdpRHbn8fSjHZPPO6BynIdytFiTMD0WjnW+EbPhIbRaz8EaEOPhMzmNb+0mHEtN
|
||||
6LAXosV8NrG5YbFhj4kSR3cL4cfvNfheGCExFEDv5mNkvo7G8aQJI5QCV3SnJpJ27yUrowF5otaH8enn
|
||||
LCaX+1CnyYNqvAgmP58m+NYCkTr3b5LADQcXoXc6mvBnD8ZD3ai+loO2ERY0ZFGcHncJhMojyem32dmk
|
||||
0VMN78tOmtVtB8YoJSrkTMiG8tHpZEFy+wR4LQepJAdSU8Gg0l6MsQUCd5caaR5v2mDzNoMrzUKN+jA4
|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kFIRdR6C4cRx6b2kcpeMk
|
||||
lQWR8tXx27Mx++ZWLJwyKGz54KkOUHDOKVlEVSsLFFR9/nJ2bkqBcvkeg7A7Bw2mo+Aq9qJMnslJ64dR
|
||||
l4skTFFJA5MsljATw/kPpX+3FV/8pJwsRgAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
@ -146,36 +147,37 @@
|
||||
<data name="button1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJoSURBVDhPlZNtSFNRGMcHQWBuO/eeu7s73UszEyGxFMKQ
|
||||
FpgKFTYxzAyqD2FUipQWy0rICrEPNTVdSxoy2qiZoDZv84XeoAgzsj6ktYwyyV7sU9DX4N+50y69LKkL
|
||||
P86Bc58fz/k/HI3mP78b4pKNESkxPGDSbl2wVJb0ObJR65eNOij0G3VethZHLBTTZ2oxutkBWdRW/lXS
|
||||
y4pfHtuLrxFfjLEdRQiz4qmmGnw+VYZ3jfsQTuYQV3BN1FeOlG3Ah4ZyvN2dFWO2uQoznhOYqXMiWpaB
|
||||
PqsA5b+4gm6NZnFI4jCal4LJbStUXu9xYKIkHd1miisG3cFfim/RBPOwlNiorMpBQCD5ASOH+7kWPCtK
|
||||
VZkozcTdkgJcNpB2VaAkO2QmiFZvx81UIwYkbYVyeIlJOkUOt7NNGMuzqky6dsInkG8xAWt3kWwimGbh
|
||||
fPFU4aOnHoMpEsLzEi+TdBh4DGaIGFkjzZGbhIv0pwB7RR1mG0rxfv9qfKrbhJmWo5DtEvoMc520MYlH
|
||||
4CCn8b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UQVBA/EOZSbh+ZZ0lcmKdXjVdBhdNhMC
|
||||
BhLrRLnuOY77c3SdVF9/1Z6Mx+tteFq4VGW8PAcvTtYgaDXBp9fTuDPvEIgrkGZH9HQtHrG538mW8JCF
|
||||
9IMnziwMOwvRwZNDcQVeUcD48Wo8WGtHfxrFBRZWyMbCyhJi9CyjaKfE67ZYEuIKWnje5beKLDAOSkgs
|
||||
IEcrx3nZquyh7NsISVnw5bFgit2/J/uPz/w7PYg4GfFdEjIAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="button2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAALVSURBVDhPY2CgGojfz8Hgd0SKIXC/DBiD2CAxYoFW3fnE
|
||||
yHl37sUvufskFogj591+KF92NhGkXzDjqI5GzdlyqawjBjjNk8g6GpK35t7XGeff/p8OxJ0Hn/3RqjyZ
|
||||
yhC4Uyx8xrXDc0++/l+x4cEF3bLjngwM9UyoBlms5LRvOzOncfeT/73HXv7vP/Hqf+GaO+9ks/bbMPiv
|
||||
F/DqPTeza9fDz+uuvv9fs/HeVbA4MpBL2eGTv+rWh66Dz/7Hzrx0r2TN7S+xMy7eYXBbLgtWZzyTSyVr
|
||||
b2Hp6hsf5p569T94wpntDPbzBaBmpLE61R2cWb/94f/U+ZfeiEVv8DMr2VNmVbZ7CoNFLyfCono248Kd
|
||||
rR077/+tWHvzo3zyRg+InFK3mH/HoVPVm+79927av41BvZMXaCMrg8tMfvQAE/Ceq58w/fSr2g13/qsk
|
||||
rS6HyKvUy1iW7bgVMOXCf930NdMZGEKZcYa0Vb+6VdXu54FTzv+XjVjUCHVBsZh6ypoTetVH/qvELVnO
|
||||
wBCPGvcWvUI8t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WJbtuBUw5cJ/
|
||||
3fQ10xkYQplxhrRVv7pV1e7ngVPO/5eNWNQIdUGxmHrKmhN61Uf+q8QtWc7AEI8a9xa9Qjy2XcFAi/jE
|
||||
PCdH6RTt/q5Tuve3iNfUZJhFzPKBMybole7/r5G8+j6nfpUZsguEHLvcjNJXPlPwnzZdKXL+CfWSg/81
|
||||
U1c/5bZo0oWrEzCtttNKWvFKK3/3fznfyQe5VHINYV6RcO6q1crd+V8hdfMfhfTt/9Syd/yX8+oHetWY
|
||||
FckiY1YJh+Y6zeS137SydvzXjZ53R8y0KpCBwZVbJWDqVrHEHf/ZInf8F07Y8V/Rf9otVtUsjBTJyMBv
|
||||
LyBmXtqpHTHvk27IlGt8KuFuDCK2RhrB0x4rJW3+LxmzARjym/7rBE99wqkQY47sTUYghx2IxRgY+I04
|
||||
xW3yWHnUUoB8LwYm7ghuOc+pvCoRy3lUIxfzqcUsEFSPamIV1NOB6gHpBQNQ2gaFPi8QCwKxKBBLArEU
|
||||
EEtA+cJAWgCIuaGawfkBAATBFuWVyulDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user