mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
Tools: remove old XPlane plugin
This commit is contained in:
parent
429217f392
commit
3cb543f17c
@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C# Express 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SerialProxy", "SerialProxy\SerialProxy.csproj", "{5337375B-6393-49B2-A544-B53AAFD1C4F9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5337375B-6393-49B2-A544-B53AAFD1C4F9}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{5337375B-6393-49B2-A544-B53AAFD1C4F9}.Debug|x86.Build.0 = Debug|x86
|
||||
{5337375B-6393-49B2-A544-B53AAFD1C4F9}.Release|x86.ActiveCfg = Release|x86
|
||||
{5337375B-6393-49B2-A544-B53AAFD1C4F9}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Binary file not shown.
235
Tools/SerialProxy/SerialProxy/Form1.Designer.cs
generated
235
Tools/SerialProxy/SerialProxy/Form1.Designer.cs
generated
@ -1,235 +0,0 @@
|
||||
namespace SerialProxy
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <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.CHK_reset = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.baudrate = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.Comports = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.ConnectComPort = new System.Windows.Forms.Button();
|
||||
this.tcpport = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.outputlog = new System.Windows.Forms.RichTextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.StatusCom = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.StatusTCP = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertCRLF = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// CHK_reset
|
||||
//
|
||||
this.CHK_reset.Checked = true;
|
||||
this.CHK_reset.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.CHK_reset.Name = "CHK_reset";
|
||||
this.CHK_reset.Size = new System.Drawing.Size(276, 22);
|
||||
this.CHK_reset.Text = "Reset Arduino on first new connection";
|
||||
this.CHK_reset.Click += new System.EventHandler(this.CHK_reset_Click);
|
||||
//
|
||||
// baudrate
|
||||
//
|
||||
this.baudrate.Items.AddRange(new object[] {
|
||||
"2400",
|
||||
"4800",
|
||||
"9600",
|
||||
"19200",
|
||||
"38400",
|
||||
"57600",
|
||||
"115200 "});
|
||||
this.baudrate.Name = "baudrate";
|
||||
this.baudrate.Size = new System.Drawing.Size(121, 23);
|
||||
this.baudrate.Text = "38400";
|
||||
//
|
||||
// Comports
|
||||
//
|
||||
this.Comports.Name = "Comports";
|
||||
this.Comports.Size = new System.Drawing.Size(121, 23);
|
||||
this.Comports.Text = "Com Port";
|
||||
this.Comports.SelectedIndexChanged += new System.EventHandler(this.Comports_SelectedIndexChanged);
|
||||
this.Comports.Click += new System.EventHandler(this.Comports_Click);
|
||||
//
|
||||
// ConnectComPort
|
||||
//
|
||||
this.ConnectComPort.Location = new System.Drawing.Point(12, 27);
|
||||
this.ConnectComPort.Name = "ConnectComPort";
|
||||
this.ConnectComPort.Size = new System.Drawing.Size(128, 23);
|
||||
this.ConnectComPort.TabIndex = 5;
|
||||
this.ConnectComPort.Text = "Connect";
|
||||
this.ConnectComPort.UseVisualStyleBackColor = true;
|
||||
this.ConnectComPort.Click += new System.EventHandler(this.ConnectComPort_Click);
|
||||
//
|
||||
// tcpport
|
||||
//
|
||||
this.tcpport.Name = "tcpport";
|
||||
this.tcpport.Size = new System.Drawing.Size(100, 23);
|
||||
this.tcpport.Text = "5001";
|
||||
//
|
||||
// outputlog
|
||||
//
|
||||
this.outputlog.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.outputlog.Location = new System.Drawing.Point(13, 56);
|
||||
this.outputlog.Name = "outputlog";
|
||||
this.outputlog.ReadOnly = true;
|
||||
this.outputlog.Size = new System.Drawing.Size(379, 171);
|
||||
this.outputlog.TabIndex = 31;
|
||||
this.outputlog.Text = "";
|
||||
this.outputlog.TextChanged += new System.EventHandler(this.outputlog_TextChanged);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.StatusCom,
|
||||
this.StatusTCP});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 230);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(405, 22);
|
||||
this.statusStrip1.TabIndex = 32;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// StatusCom
|
||||
//
|
||||
this.StatusCom.Name = "StatusCom";
|
||||
this.StatusCom.Size = new System.Drawing.Size(108, 17);
|
||||
this.StatusCom.Text = "Com Disconnected";
|
||||
//
|
||||
// StatusTCP
|
||||
//
|
||||
this.StatusTCP.Name = "StatusTCP";
|
||||
this.StatusTCP.Size = new System.Drawing.Size(104, 17);
|
||||
this.StatusTCP.Text = "TCP Disconnected";
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.optionsToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(405, 24);
|
||||
this.menuStrip1.TabIndex = 33;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// optionsToolStripMenuItem
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItem1,
|
||||
this.toolStripMenuItem2});
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.optionsToolStripMenuItem.Text = "Options";
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.Comports,
|
||||
this.toolStripMenuItem4,
|
||||
this.baudrate,
|
||||
this.CHK_reset,
|
||||
this.convertCRLF});
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
|
||||
this.toolStripMenuItem1.Text = "Serial Options";
|
||||
//
|
||||
// toolStripMenuItem4
|
||||
//
|
||||
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(253, 22);
|
||||
this.toolStripMenuItem4.Text = "Baud Rate";
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItem5,
|
||||
this.tcpport});
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(152, 22);
|
||||
this.toolStripMenuItem2.Text = "TCP Options";
|
||||
//
|
||||
// toolStripMenuItem5
|
||||
//
|
||||
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
|
||||
this.toolStripMenuItem5.Size = new System.Drawing.Size(160, 22);
|
||||
this.toolStripMenuItem5.Text = "TCP Port";
|
||||
//
|
||||
// convertCRLF
|
||||
//
|
||||
this.convertCRLF.Name = "convertCRLF";
|
||||
this.convertCRLF.Size = new System.Drawing.Size(253, 22);
|
||||
this.convertCRLF.Text = "Convert CR LF to nil";
|
||||
this.convertCRLF.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(405, 252);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Controls.Add(this.ConnectComPort);
|
||||
this.Controls.Add(this.outputlog);
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "Form1";
|
||||
this.Text = "SerialProxy by Michael Oborne";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button ConnectComPort;
|
||||
private System.Windows.Forms.ToolStripTextBox tcpport;
|
||||
private System.Windows.Forms.RichTextBox outputlog;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel StatusCom;
|
||||
private System.Windows.Forms.ToolStripStatusLabel StatusTCP;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripComboBox Comports;
|
||||
private System.Windows.Forms.ToolStripComboBox baudrate;
|
||||
private System.Windows.Forms.ToolStripMenuItem CHK_reset;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertCRLF;
|
||||
}
|
||||
}
|
||||
|
@ -1,260 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO.Ports;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SerialProxy
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
static SerialPort comPort = new SerialPort();
|
||||
static int runthreads = 0;
|
||||
static TcpListener listener;
|
||||
static List<NetworkStream> clients = new List<NetworkStream>();
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Control.CheckForIllegalCrossThreadCalls = false; // so can update display from another thread
|
||||
|
||||
Comports.Items.AddRange(SerialPort.GetPortNames());
|
||||
if (Comports.Items.Count > 0)
|
||||
{
|
||||
Comports.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ConnectComPort_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!comPort.IsOpen)
|
||||
{
|
||||
outputlog.Clear();
|
||||
outputlog.ClearUndo();
|
||||
|
||||
comPort.BaudRate = int.Parse(baudrate.Text.ToString());
|
||||
comPort.DataBits = 8;
|
||||
comPort.StopBits = (StopBits)Enum.Parse(typeof(StopBits), "1");
|
||||
comPort.Parity = (Parity)Enum.Parse(typeof(Parity), "None");
|
||||
|
||||
try
|
||||
{
|
||||
comPort.PortName = Comports.Text.ToString();
|
||||
comPort.DtrEnable = false; // don't reset yet
|
||||
comPort.Open();
|
||||
StatusCom.Text = "Com Connected";
|
||||
ConnectComPort.Text = "Disconnect";
|
||||
}
|
||||
catch (Exception) { outputlog.AppendText("Cant open serial port\r\n"); return; }
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
listener = new TcpListener(IPAddress.Any, int.Parse(tcpport.Text.ToString()));
|
||||
|
||||
|
||||
StatusTCP.Text = "TCP Waiting";
|
||||
|
||||
runthreads = 1;
|
||||
|
||||
System.Threading.Thread t11 = new System.Threading.Thread(delegate() { try { mainloop(); } catch (Exception) { } }); // process serial data and send to clients
|
||||
t11.Start();
|
||||
|
||||
System.Threading.Thread t12 = new System.Threading.Thread(delegate() { try { listernforclients(); } catch (Exception) { } }); // wait for tcp connections
|
||||
t12.Start();
|
||||
|
||||
|
||||
}
|
||||
catch (SocketException ex)
|
||||
{
|
||||
outputlog.AppendText("SocketException: " + ex+ "\n");
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop listening for new clients.
|
||||
listener.Stop();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
runthreads = 0;
|
||||
System.Threading.Thread.Sleep(100); // make sure thread closes
|
||||
comPort.Close();
|
||||
StatusCom.Text = "Com Disconnected";
|
||||
ConnectComPort.Text = "Connect";
|
||||
foreach (NetworkStream client in clients)
|
||||
{
|
||||
try
|
||||
{
|
||||
client.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
clients.Clear();
|
||||
StatusTCP.Text = "TCP Disconnected";
|
||||
}
|
||||
}
|
||||
|
||||
void listernforclients()
|
||||
{
|
||||
listener.Start();
|
||||
// Enter the listening loop.
|
||||
|
||||
while (runthreads == 1)
|
||||
{
|
||||
|
||||
// Perform a blocking call to accept requests.
|
||||
// You could also user server.AcceptSocket() here.
|
||||
TcpClient client = listener.AcceptTcpClient();
|
||||
StatusTCP.Text = "TCP " + (clients.Count +1) + " Clients";
|
||||
|
||||
comPort.DtrEnable = CHK_reset.Checked;
|
||||
|
||||
// Get a stream object for reading and writing
|
||||
NetworkStream stream = client.GetStream();
|
||||
|
||||
clients.Add(stream);
|
||||
|
||||
System.Threading.Thread.Sleep(100);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void mainloop()
|
||||
{
|
||||
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
|
||||
List<NetworkStream> clientscopy = new List<NetworkStream>(clients);
|
||||
byte[] data = new byte[1024 * 4];
|
||||
|
||||
while (runthreads == 1)
|
||||
{
|
||||
System.Threading.Thread.Sleep(1);
|
||||
// do serial
|
||||
if (comPort.BytesToRead > 0)
|
||||
{
|
||||
string line = comPort.ReadExisting();
|
||||
|
||||
if (convertCRLF.Checked)
|
||||
{
|
||||
Regex regex = new Regex("\r\n", RegexOptions.IgnoreCase);
|
||||
|
||||
line = regex.Replace(line, "\0");
|
||||
}
|
||||
|
||||
outputlog.AppendText(line);
|
||||
|
||||
clientscopy = new List<NetworkStream>(clients);
|
||||
|
||||
foreach (NetworkStream client in clientscopy)
|
||||
{
|
||||
byte[] temp = encoding.GetBytes(line);
|
||||
try
|
||||
{
|
||||
client.Write(temp, 0, temp.Length);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
clients.Remove(client);
|
||||
StatusTCP.Text = "TCP " + clients.Count + " Clients";
|
||||
}
|
||||
}
|
||||
}
|
||||
// do tcp
|
||||
clientscopy = new List<NetworkStream>(clients);
|
||||
|
||||
foreach (NetworkStream client in clientscopy)
|
||||
{
|
||||
//byte[] temp = encoding.GetBytes(data);
|
||||
if (client.DataAvailable)
|
||||
{
|
||||
try
|
||||
{
|
||||
int size = client.Read(data, 0, data.Length);
|
||||
comPort.Write(data, 0, size);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
clients.Remove(client);
|
||||
StatusTCP.Text = "TCP " + clients.Count + " Clients";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Comports_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Comports_Click(object sender, EventArgs e)
|
||||
{
|
||||
Comports.Items.Clear();
|
||||
Comports.Items.AddRange(SerialPort.GetPortNames());
|
||||
}
|
||||
|
||||
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
runthreads = 0;
|
||||
System.Threading.Thread.Sleep(100);
|
||||
if (comPort.IsOpen)
|
||||
comPort.Close();
|
||||
try
|
||||
{
|
||||
listener.Stop();
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
private void CHK_reset_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CHK_reset.Checked)
|
||||
{
|
||||
CHK_reset.Checked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
CHK_reset.Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void toolStripMenuItem3_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (convertCRLF.Checked)
|
||||
{
|
||||
convertCRLF.Checked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
convertCRLF.Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void outputlog_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (outputlog.Text.Length > 10000)
|
||||
{
|
||||
outputlog.Text = outputlog.Text.Remove(0, 5000); // half size
|
||||
}
|
||||
|
||||
// auto scroll
|
||||
outputlog.SelectionStart = outputlog.Text.Length;
|
||||
|
||||
outputlog.ScrollToCaret();
|
||||
|
||||
outputlog.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
<?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="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>133, 17</value>
|
||||
</metadata>
|
||||
</root>
|
@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SerialProxy
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
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("SerialProxy")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("SerialProxy")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
|
||||
[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("261ae7c6-ab75-4f17-9ea6-cf2794aa860c")]
|
||||
|
||||
// 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("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SerialProxy.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <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", "4.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 (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SerialProxy.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
<?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>
|
@ -1,26 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SerialProxy.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?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>
|
@ -1,86 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{5337375B-6393-49B2-A544-B53AAFD1C4F9}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SerialProxy</RootNamespace>
|
||||
<AssemblyName>SerialProxy</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<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|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<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="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<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>
|
||||
</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>
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
|
Binary file not shown.
@ -1,418 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Heavily modified and adapted by Jason Short
|
||||
# from http://www.perl.com - Autopilots in Perl
|
||||
# By Jeffrey Goff on July 12, 2004
|
||||
|
||||
use strict;
|
||||
use IO::Socket;
|
||||
use IO::Select;
|
||||
$| = 1;
|
||||
|
||||
use constant DATA_num_channels => 113;
|
||||
use constant DATA_num_elements => 8;
|
||||
use constant DATA_header_size => 5;
|
||||
use constant DATA_packet_size => DATA_num_channels * DATA_num_elements + DATA_header_size;
|
||||
use constant DATA_max_element => 7;
|
||||
use constant DATA_element_size => (DATA_num_elements + 1) * 4; # 4-byte elements
|
||||
use constant DATA_inbound_pack => "A4c";
|
||||
use constant DATA_inbound_header => ('DATA',0);
|
||||
|
||||
my $rh;
|
||||
my $x_plane_ip = '127.0.0.1';
|
||||
my $ser_port = 5331;
|
||||
my $receive_port = 49005;
|
||||
my $transmit_port = 49000;
|
||||
my $throttle_test = 0;
|
||||
my $check_a = 0;
|
||||
my $check_b = 0;
|
||||
my $count = 0;
|
||||
|
||||
my $roll_out = 0;
|
||||
my $pitch_out = 0;
|
||||
my $throttle_out = 0;
|
||||
my $rudder_out = 0;
|
||||
my $wp_distance = 0;
|
||||
my $wp_index = 0;
|
||||
my $control_mode = 0;
|
||||
my $control_mode_alpha;
|
||||
my $bearing_error = 0;
|
||||
my $alt_error = 0;
|
||||
my $energy_error = 0;
|
||||
|
||||
my $extraInt = 0; # for debugging
|
||||
my $int_1 = 0;
|
||||
my $int_2 = 0;
|
||||
my $int_3 = 0;
|
||||
my $int_4 = 0;
|
||||
|
||||
my $diyd_header = "DIYd";
|
||||
|
||||
my $Xplane_in_sock = IO::Socket::INET->new(
|
||||
LocalPort => $receive_port,
|
||||
LocalAddr => $x_plane_ip,
|
||||
Proto => 'udp')
|
||||
or die "error creating receive port for $x_plane_ip: $@\n";
|
||||
|
||||
my $receive = IO::Select->new();
|
||||
|
||||
|
||||
my $Xplane_out_sock = IO::Socket::INET->new(
|
||||
PeerPort => $transmit_port,
|
||||
PeerAddr => $x_plane_ip,
|
||||
Proto => 'udp')
|
||||
or die "error creating transmit port for $x_plane_ip: $@\n";
|
||||
|
||||
my $transmit = IO::Select->new();
|
||||
|
||||
|
||||
|
||||
#open sockets on 7070
|
||||
my $arduSocket = IO::Socket::INET->new( Proto => 'tcp',
|
||||
PeerAddr => '127.0.0.1',
|
||||
PeerPort => $ser_port
|
||||
) or die print "Can not connect to Serial $!";
|
||||
#,Type = 'SOCK_STREAM'
|
||||
|
||||
|
||||
$receive->add($Xplane_in_sock);
|
||||
$receive->add($arduSocket);
|
||||
$transmit->add($Xplane_out_sock);
|
||||
$arduSocket->autoflush(1);
|
||||
|
||||
|
||||
|
||||
|
||||
my $DATA_buffer = {};
|
||||
|
||||
# These formats are represented by X-Plane as floating point
|
||||
my @float_formats = qw( f deg mph pct );
|
||||
|
||||
|
||||
my $DATA_packet = {
|
||||
# The outer hash reference contains a sparse array of data frames
|
||||
0 => {
|
||||
# The inner hash reference contains a sparse array of data elements
|
||||
0 => { type => 'f', label => 'Frame Rate'},
|
||||
},
|
||||
|
||||
3 => {
|
||||
6 => { type => 'f', label => 'Air Speed'},
|
||||
7 => { type => 'f', label => 'Ground Speed'},
|
||||
},
|
||||
|
||||
8 => {
|
||||
0 => { type => 'deg', label => 'Pitch'},
|
||||
1 => { type => 'deg', label => 'Roll'},
|
||||
2 => { type => 'deg', label => 'heading'},
|
||||
},
|
||||
|
||||
11 => {
|
||||
0 => { type => 'f', label => 'elev'},
|
||||
1 => { type => 'f', label => 'aileron'},
|
||||
},
|
||||
|
||||
18 => {
|
||||
0 => { type => 'deg', label => 'Pitch'},
|
||||
1 => { type => 'deg', label => 'Roll'},
|
||||
2 => { type => 'deg', label => 'heading'},
|
||||
},
|
||||
|
||||
20 => {
|
||||
0 => { type => 'deg', label => 'Latitude'},
|
||||
1 => { type => 'deg', label => 'Longitude'},
|
||||
2 => { type => 'f', label => 'Altitude'},
|
||||
},
|
||||
|
||||
25 => {
|
||||
0 => { type => 'deg', label => 'Throttle cmd'},
|
||||
},
|
||||
|
||||
26 => {
|
||||
0 => { type => 'deg', label => 'Throttle'},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
# X-Plane uniformly sends 4-byte floats outbound,
|
||||
# but accepts a mixture of floats and integers inbound.
|
||||
|
||||
sub create_pack_strings {
|
||||
for my $row (values %$DATA_packet) {
|
||||
$row->{unpack} = 'x4';
|
||||
$row->{pack} = 'l';
|
||||
for my $j (0..DATA_max_element) {
|
||||
if(exists $row->{$j}) {
|
||||
my $col = $row->{$j};
|
||||
$row->{pack} .= (grep { $col->{type} eq $_ } @float_formats) ? 'f' : 'l';
|
||||
$row->{unpack} .= 'f';
|
||||
}
|
||||
else {
|
||||
$row->{pack} .= 'f';
|
||||
$row->{unpack} .= 'x4';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# {{{ Transmit a message
|
||||
sub transmit_message {
|
||||
my ($socket,$pack_format,@message) = @_;
|
||||
my ($server) = $socket->can_write(60);
|
||||
$server->send(pack($pack_format,@message));
|
||||
}
|
||||
|
||||
|
||||
sub receive_DATA {
|
||||
my ($message) = @_;
|
||||
$DATA_buffer = { };
|
||||
for (my $i = 0; $i < (length($message) - &DATA_header_size - 1) / DATA_element_size; $i++) {
|
||||
my $channel = substr($message, $i * DATA_element_size + DATA_header_size, DATA_element_size);
|
||||
|
||||
my $index = unpack "l", $channel;
|
||||
next unless exists $DATA_packet->{$index};
|
||||
|
||||
my $row = $DATA_packet->{$index};
|
||||
my @element = unpack $row->{unpack}, $channel;
|
||||
my $ctr = 0;
|
||||
for my $j (0..DATA_max_element) {
|
||||
next unless exists $row->{$j};
|
||||
my $col = $row->{$j};
|
||||
$DATA_buffer->{$index}{$j} = $element[$ctr];
|
||||
$ctr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# {{{ transmit_DATA
|
||||
sub transmit_DATA {
|
||||
my ($socket, @message) = @_;
|
||||
my $pack_str = DATA_inbound_pack;
|
||||
for(my $packet = 0;
|
||||
$packet < @message;
|
||||
$packet += (DATA_num_elements + 1)) {
|
||||
$pack_str .= $DATA_packet->{$message[$packet]}{pack};
|
||||
}
|
||||
transmit_message($socket,$pack_str,DATA_inbound_header,@message,0);
|
||||
}
|
||||
|
||||
|
||||
# {{{ Fill in a DATA channel
|
||||
sub _fill_channel {
|
||||
my ($packet) = @_;
|
||||
my @buffer = (-999) x DATA_num_elements;
|
||||
for(0..7) {
|
||||
$buffer[$_] = $packet->{$_} if defined $packet->{$_};
|
||||
}
|
||||
return @buffer;
|
||||
}
|
||||
|
||||
|
||||
# {{{ Send outbound messages if there are any
|
||||
sub transmit_socket {
|
||||
my ($socket,$ch) = @_;
|
||||
if($ch eq 'g') {
|
||||
transmit_DATA($socket, 12, $DATA_buffer->{12}{0} ? 0 : 1,(-999) x 7);
|
||||
|
||||
}elsif($ch eq 't') {
|
||||
transmit_DATA($socket, 25, $throttle_out,$throttle_out,$throttle_out,$throttle_out,(-999) x 4);
|
||||
|
||||
}elsif($ch eq 'c') {
|
||||
transmit_DATA($socket, 11, $pitch_out, $roll_out, $rudder_out, (-999), ($roll_out * 5) , -999, -999, -999 );
|
||||
|
||||
}elsif($ch eq 'j') {
|
||||
transmit_DATA($socket, 8, $pitch_out, $roll_out, $rudder_out , (-999) x 5);
|
||||
|
||||
}elsif($ch eq 'i') {
|
||||
my @engine = map { $_ != -999 ? $_ + 0.1 : -999 } _fill_channel($DATA_buffer->{23});
|
||||
transmit_DATA( $socket, 23, @engine );
|
||||
|
||||
}elsif($ch eq 'k') {
|
||||
my @engine =
|
||||
map { $_ != -999 ? $_-0.1 : -999 }
|
||||
_fill_channel($DATA_buffer->{23});
|
||||
transmit_DATA( $socket, 23, @engine );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub parseXplane {
|
||||
|
||||
#convert data
|
||||
my $lat = int($DATA_buffer->{20}{0} * 10000000);
|
||||
my $lng = int($DATA_buffer->{20}{1} * 10000000);
|
||||
my $altitude = int($DATA_buffer->{20}{2} * 3.048); # altitude to meters
|
||||
my $speed = int($DATA_buffer->{3}{7} * 044.704); # spped to m/s * 100
|
||||
my $airspeed = int($DATA_buffer->{3}{6} * 044.704); # speed to m/s * 100
|
||||
my $pitch = int($DATA_buffer->{18}{0} * 100);
|
||||
my $roll = int($DATA_buffer->{18}{1} * 100);
|
||||
my $heading = int($DATA_buffer->{18}{2} * 100);
|
||||
|
||||
# format and publish the IMU style data to the Ardupilot
|
||||
my $outgoing = pack("CCs<4", 8,4, $roll, $pitch, $heading, $airspeed);
|
||||
$check_a = $check_b = 0;
|
||||
for( split(//,$outgoing) )
|
||||
{
|
||||
$check_a += ord;
|
||||
$check_a %= 256;
|
||||
$check_b += $check_a;
|
||||
$check_b %= 256;
|
||||
#print ord . "\n";
|
||||
}
|
||||
$outgoing = pack("a4CCs<4CC","DIYd", 8,4, $roll, $pitch, $heading, $airspeed, $check_a,$check_b);
|
||||
$arduSocket->send($outgoing);
|
||||
|
||||
$count++;
|
||||
if ($count == 10){
|
||||
# count of 10 = 5 hz, 50 = 1hz
|
||||
$count = 0;
|
||||
$outgoing = pack("CCl<2s<3", 14,3, $lng, $lat, $altitude, $speed, $heading);
|
||||
$check_a = $check_b = 0;
|
||||
for( split(//,$outgoing) )
|
||||
{
|
||||
$check_a += ord;
|
||||
$check_a %= 256;
|
||||
$check_b += $check_a;
|
||||
$check_b %= 256;
|
||||
#print ord . "\n";
|
||||
}
|
||||
$outgoing = pack("a4CCl<2s<3CC","DIYd", 14,3, $lng, $lat, $altitude, $speed, $heading, $check_a, $check_b);
|
||||
$arduSocket->send($outgoing);
|
||||
}
|
||||
#print "lat = $lat, long = $lng, alt = $altitude, ASpeed = $airspeed, $heading\n";
|
||||
#print "alt = $altitude,speed = $speed \n";
|
||||
|
||||
$count = 0 if ($count > 50);
|
||||
}
|
||||
|
||||
sub parseMessage
|
||||
{
|
||||
my ($data) = @_;
|
||||
my @out = unpack("s8C2",$data);
|
||||
|
||||
$roll_out = $out[0] *1 / 4500 if (defined $out[0]);
|
||||
$roll_out = 1 if($roll_out > 1);
|
||||
$roll_out = -1 if($roll_out < -1);
|
||||
|
||||
$pitch_out = $out[1] *1 / 4500 if (defined $out[1]);
|
||||
$pitch_out = 1 if($pitch_out > 1);
|
||||
$pitch_out = -1 if($pitch_out < -1);
|
||||
|
||||
|
||||
$throttle_out = $out[2] / 100 if (defined $out[2]);
|
||||
|
||||
|
||||
$rudder_out = $out[3] * 1 / 4500 if (defined $out[3]);
|
||||
$rudder_out = 1 if($rudder_out > 1);
|
||||
$rudder_out = -1 if($rudder_out < -1);
|
||||
|
||||
# normal reading
|
||||
$wp_distance = $out[4] if (defined $out[4]);
|
||||
$bearing_error = $out[5] / 100 if (defined $out[5]);
|
||||
$alt_error = $out[6] if (defined $out[6]);
|
||||
$energy_error = $out[7] if (defined $out[7]);
|
||||
$wp_index = $out[8] if (defined $out[8]);
|
||||
$control_mode = $out[9] if (defined $out[9]);
|
||||
|
||||
#debugging - send any three ints for debugging!
|
||||
$int_1 = $out[4] * 1 if (defined $out[4]);
|
||||
$int_2 = $out[5] * 1 if (defined $out[5]);
|
||||
$int_3 = $out[6] * 1 if (defined $out[6]);
|
||||
$int_4 = $out[7] * 1 if (defined $out[7]);
|
||||
|
||||
#output_int((int)airspeed); // 4 bytes 8,9
|
||||
#output_int((int)airspeed_error); // 5 bytes 10,11
|
||||
#output_int((int)altitude_error); // 6 bytes 12,13
|
||||
#output_int((int)energy_error); // 7 bytes 14,15
|
||||
|
||||
SWITCH: {
|
||||
$control_mode == 0 && do { $control_mode_alpha = "Manual"; last SWITCH; };
|
||||
$control_mode == 1 && do { $control_mode_alpha = "CIRCLE"; last SWITCH; };
|
||||
$control_mode == 2 && do { $control_mode_alpha = "STABILIZE"; last SWITCH; };
|
||||
$control_mode == 5 && do { $control_mode_alpha = "FLY_BY_WIRE_A"; last SWITCH; };
|
||||
$control_mode == 6 && do { $control_mode_alpha = "FLY_BY_WIRE_B"; last SWITCH; };
|
||||
$control_mode == 10 && do { $control_mode_alpha = "AUTO"; last SWITCH; };
|
||||
$control_mode == 11 && do { $control_mode_alpha = "RTL"; last SWITCH; };
|
||||
$control_mode == 12 && do { $control_mode_alpha = "LOITER"; last SWITCH; };
|
||||
$control_mode == 13 && do { $control_mode_alpha = "TAKEOFF"; last SWITCH; };
|
||||
$control_mode == 14 && do { $control_mode_alpha = "LAND"; last SWITCH; };
|
||||
}
|
||||
|
||||
$bearing_error = sprintf("%.1f", $bearing_error);
|
||||
if ($count){
|
||||
#printf("roll: %.3f, pitch: %.3f, thr: %.3f, rud: %.3f \n", $roll_out,$pitch_out,$throttle_out,$rudder_out);
|
||||
print "wp_dist:$wp_distance \tbearing_err:$bearing_error \talt_error:$alt_error \tenergy_err:$energy_error \tWP:$wp_index \tmode:$control_mode_alpha\r";
|
||||
#print "wp_dist:$wp_distance \tbearing_err:$bearing_error \tloiter_sum:$int_3 \tLoiter total:$int_4 \tWP:$wp_index \tmode:$control_mode_alpha\r";
|
||||
|
||||
#print "next_WP.alt:$int_1 \toffset_altitude:$int_2 \talt_error:$alt_error \ttarget_altitude:$int_4 \tWP:$wp_index \tmode:$control_mode_alpha\n";
|
||||
#print "test_alt:$int_1 \ttarget_altitude:$int_2 \tnext_wp.alt:$int_3 \toffset_altitude:$int_4 \tWP:$wp_index \tmode:$control_mode_alpha\n";
|
||||
#print "throttle_cruise: $int_1, landing_pitch: $int_2, throttle: $throttle_out, altitude_error: $int_3, WP: $wp_index, mode: $control_mode\n";
|
||||
}
|
||||
transmit_socket($transmit,'t');
|
||||
transmit_socket($transmit,'j');
|
||||
transmit_socket($transmit,'c');
|
||||
}
|
||||
|
||||
sub readline {
|
||||
my ($rh) = @_;
|
||||
my $temp = "";
|
||||
my $step = 0;
|
||||
my $message = "";
|
||||
|
||||
while (1) {
|
||||
$rh->recv($message,1);
|
||||
$temp .= $message;
|
||||
|
||||
if ($temp =~ /^AAA/) {
|
||||
$step++;
|
||||
if ($temp =~ "\n" && $step >= 19) { last; } # data
|
||||
}
|
||||
if ($temp =~ /\n/ && $step == 0) { # normal message
|
||||
last;
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
sub main_loop {
|
||||
my ($receive,$transmit) = @_;
|
||||
my $recv_data = "";
|
||||
|
||||
while(1) {
|
||||
my ($rh_set) = IO::Select->select($receive, undef, undef, .1);
|
||||
|
||||
|
||||
foreach $rh (@$rh_set) {
|
||||
if ($rh == $Xplane_in_sock) {
|
||||
my $message;
|
||||
$rh->recv($message,DATA_packet_size);
|
||||
receive_DATA($message);
|
||||
parseXplane();
|
||||
|
||||
}elsif ($rh == $arduSocket) {
|
||||
my $message = '';
|
||||
|
||||
$message = &readline($rh);
|
||||
|
||||
if($message =~ '^AAA'){
|
||||
$message = substr $message, 3, 18;
|
||||
parseMessage($message);
|
||||
}elsif($message =~ '^MSG'){
|
||||
print "$message\n";
|
||||
}else{
|
||||
#print "er:$message \n";
|
||||
}
|
||||
$rh->flush();
|
||||
#print "$message \n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
create_pack_strings();
|
||||
main_loop($receive, $transmit);
|
@ -1,55 +0,0 @@
|
||||
Using Wiring with Flash (via serproxy)
|
||||
--------------------------------------
|
||||
Connect the Wiring board to a USB port. Take note of which USB port you use, as different ones have different identifiers.
|
||||
|
||||
Launch Wiring. Look in the Tools | Serial Port menu and take note of the identifier corresponding to the serial device for the USB port to which the Wiring board is connected (look for something WITHOUT "modem" in its name).
|
||||
|
||||
Open serproxy.cfg in TextEdit.
|
||||
|
||||
The serproxy can handle multiple serial devices (each of which corresponds to a USB or serial port). For example:
|
||||
|
||||
comm_ports=1,2
|
||||
|
||||
tells serproxy to use two comm ports, numbered 1 and 2. To tell serproxy which serial device (from the Wiring menu) corresponds to each comm port, use a line like this:
|
||||
|
||||
serial_device1=/dev/tty.usbserial-1B1
|
||||
|
||||
This tells serproxy that comm port 1 uses serial device /dev/tty.usbserial-1B1. Change this to the identifier from the Wiring menu.
|
||||
|
||||
Then, you assign a network port the comm port:
|
||||
|
||||
net_port1=5331
|
||||
|
||||
This tells serproxy to listen for connections on port 5331. Set this to whatever port you wish to connect to from Flash (on host "localhost").
|
||||
|
||||
To configure another port, repeat the above instructions, plugging the Wiring board into a different USB port (you'll have to quit Wiring, plug into the new USB port, and then relaunch Wiring). Then add the appropriate lines to the serproxy.cfg. For example:
|
||||
|
||||
serial_device2=/dev/tty.usbserial-3B1
|
||||
net_port2=5332
|
||||
|
||||
Will configure comm port 2 to use serial device /dev/tty.usbserial-3B1 and listen for connections from Flash on port 5332.
|
||||
|
||||
Each serial device will always correspond to the same network port, so if you plug the Wiring board into a different USB port, you'll need to connect to a different network port from Flash.
|
||||
|
||||
If you need more than two comm ports, you'll need to change the comm_ports line. For example:
|
||||
|
||||
comm_ports=1,2,3,4
|
||||
|
||||
allocates four comm ports numbered 1 through 4.
|
||||
|
||||
You need to make sure that the baud rate specified by your Wiring code:
|
||||
|
||||
beginSerial(19200);
|
||||
|
||||
matches the baud rate specified in serproxy.cfg:
|
||||
|
||||
comm_baud=19200
|
||||
|
||||
Finally, Flash will not process any incoming data (i.e. call the onData() function of your XMLSocket) until it receives a nil (ASCII code 0, '\0'). If your Wiring code uses newlines (ASCII code 10, '\n') to delimit data (so that, for example, it's easier to read in the Wiring serial monitor, HyperTerminal, zterm, Terminal, etc), you can tell serproxy to convert them into nils:
|
||||
|
||||
newlines_to_nils=true
|
||||
|
||||
To launch serproxy, simply double-click it. (This version does not require a .command file.)
|
||||
--
|
||||
David A. Mellis
|
||||
7 June 2005
|
Binary file not shown.
@ -1,36 +0,0 @@
|
||||
# Config file for serproxy
|
||||
# See serproxy's README file for documentation
|
||||
|
||||
# Transform newlines coming from the serial port into nils
|
||||
# true (e.g. if using Flash) or false
|
||||
newlines_to_nils=false
|
||||
|
||||
# Comm ports used
|
||||
comm_ports=1
|
||||
|
||||
# Default settings
|
||||
#comm_baud=57600
|
||||
comm_baud=38400
|
||||
comm_databits=8
|
||||
comm_stopbits=1
|
||||
comm_parity=none
|
||||
|
||||
|
||||
#serial_device1=/dev/cu.usbserial-FTDO5RNM
|
||||
serial_device1=/dev/cu.usbserial-A600dZ2l
|
||||
|
||||
# Idle time out in seconds
|
||||
timeout=3000
|
||||
|
||||
# Port 1 settings (ttyS0)
|
||||
net_port1=5331
|
||||
|
||||
# Port 2 settings (ttyS1)
|
||||
#net_port2=5332
|
||||
|
||||
# Port 3 settings (ttyS2)
|
||||
#net_port3=5333
|
||||
|
||||
# Port 4 settings (ttyS3)
|
||||
#net_port4=5334
|
||||
|
@ -1,31 +0,0 @@
|
||||
# Config file for serproxy
|
||||
# See serproxy's README file for documentation
|
||||
|
||||
# Transform newlines coming from the serial port into nils
|
||||
# true (e.g. if using Flash) or false
|
||||
newlines_to_nils=true
|
||||
|
||||
# Comm ports used
|
||||
comm_ports=1,2,3,4
|
||||
|
||||
# Default settings
|
||||
comm_baud=19200
|
||||
comm_databits=8
|
||||
comm_stopbits=1
|
||||
comm_parity=none
|
||||
|
||||
# Idle time out in seconds
|
||||
timeout=300
|
||||
|
||||
# Port 1 settings (ttyS0)
|
||||
net_port1=5331
|
||||
|
||||
# Port 2 settings (ttyS1)
|
||||
net_port2=5332
|
||||
|
||||
# Port 3 settings (ttyS2)
|
||||
net_port3=5333
|
||||
|
||||
# Port 4 settings (ttyS3)
|
||||
net_port4=5334
|
||||
|
Loading…
Reference in New Issue
Block a user