atualizado firmware e controle de movimentacao
This commit is contained in:
parent
0223058948
commit
cf028c6c4e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -50,6 +50,14 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\Microsoft.DirectX.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\Microsoft.DirectX.DirectInput.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
|
|
@ -58,6 +66,8 @@
|
|||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
|
@ -88,9 +98,16 @@
|
|||
<Compile Include="Forms\frmJoystick.Designer.cs">
|
||||
<DependentUpon>frmJoystick.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmPlotMovimentacao.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmPlotMovimentacao.Designer.cs">
|
||||
<DependentUpon>frmPlotMovimentacao.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\DispositivosBaseModel.cs" />
|
||||
<Compile Include="Models\Enuns.cs" />
|
||||
<Compile Include="Models\Joystick.cs" />
|
||||
<Compile Include="Models\JoystickGeneric.cs" />
|
||||
<Compile Include="Models\MovimentacaoModel.cs" />
|
||||
<Compile Include="Services\DispositivosService.cs" />
|
||||
<Compile Include="Forms\frmPrincipal.cs">
|
||||
|
|
@ -105,6 +122,9 @@
|
|||
<EmbeddedResource Include="Forms\frmDiagnosticos.resx">
|
||||
<DependentUpon>frmDiagnosticos.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\frmPlotMovimentacao.resx">
|
||||
<DependentUpon>frmPlotMovimentacao.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\frmPrincipal.resx">
|
||||
<DependentUpon>frmPrincipal.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ namespace AgroBase.Forms
|
|||
{
|
||||
public static frmPrincipal frmPrincipal = new frmPrincipal();
|
||||
public static frmJoystick frmJoystick = new frmJoystick();
|
||||
public static frmPlotMovimentacao frmPlotMovimentacao = new frmPlotMovimentacao();
|
||||
|
||||
public frmInstancial()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,194 @@
|
|||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
partial class frmPlotMovimentacao
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend9 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea10 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend10 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea11 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend11 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series11 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea12 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend12 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series12 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
this.chartET = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
this.txaET = new System.Windows.Forms.RichTextBox();
|
||||
this.chartEF = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
this.chartDT = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
this.chartDF = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
this.txaEF = new System.Windows.Forms.RichTextBox();
|
||||
this.txaDT = new System.Windows.Forms.RichTextBox();
|
||||
this.txaDF = new System.Windows.Forms.RichTextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartET)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartEF)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartDT)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartDF)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// chartET
|
||||
//
|
||||
chartArea9.Name = "ChartArea1";
|
||||
this.chartET.ChartAreas.Add(chartArea9);
|
||||
legend9.Name = "Legend1";
|
||||
this.chartET.Legends.Add(legend9);
|
||||
this.chartET.Location = new System.Drawing.Point(248, 12);
|
||||
this.chartET.Name = "chartET";
|
||||
series9.ChartArea = "ChartArea1";
|
||||
series9.Legend = "Legend1";
|
||||
series9.Name = "Series1";
|
||||
this.chartET.Series.Add(series9);
|
||||
this.chartET.Size = new System.Drawing.Size(589, 374);
|
||||
this.chartET.TabIndex = 1;
|
||||
this.chartET.Text = "chart1";
|
||||
//
|
||||
// txaET
|
||||
//
|
||||
this.txaET.Location = new System.Drawing.Point(12, 12);
|
||||
this.txaET.Name = "txaET";
|
||||
this.txaET.Size = new System.Drawing.Size(230, 374);
|
||||
this.txaET.TabIndex = 2;
|
||||
this.txaET.Text = "RPM SP - RPM - POTENCIA";
|
||||
//
|
||||
// chartEF
|
||||
//
|
||||
this.chartEF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
chartArea10.Name = "ChartArea1";
|
||||
this.chartEF.ChartAreas.Add(chartArea10);
|
||||
legend10.Name = "Legend1";
|
||||
this.chartEF.Legends.Add(legend10);
|
||||
this.chartEF.Location = new System.Drawing.Point(248, 396);
|
||||
this.chartEF.Name = "chartEF";
|
||||
series10.ChartArea = "ChartArea1";
|
||||
series10.Legend = "Legend1";
|
||||
series10.Name = "Series1";
|
||||
this.chartEF.Series.Add(series10);
|
||||
this.chartEF.Size = new System.Drawing.Size(589, 374);
|
||||
this.chartEF.TabIndex = 3;
|
||||
this.chartEF.Text = "chart1";
|
||||
//
|
||||
// chartDT
|
||||
//
|
||||
this.chartDT.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
chartArea11.Name = "ChartArea1";
|
||||
this.chartDT.ChartAreas.Add(chartArea11);
|
||||
legend11.Name = "Legend1";
|
||||
this.chartDT.Legends.Add(legend11);
|
||||
this.chartDT.Location = new System.Drawing.Point(1092, 12);
|
||||
this.chartDT.Name = "chartDT";
|
||||
series11.ChartArea = "ChartArea1";
|
||||
series11.Legend = "Legend1";
|
||||
series11.Name = "Series1";
|
||||
this.chartDT.Series.Add(series11);
|
||||
this.chartDT.Size = new System.Drawing.Size(589, 374);
|
||||
this.chartDT.TabIndex = 4;
|
||||
this.chartDT.Text = "chart1";
|
||||
//
|
||||
// chartDF
|
||||
//
|
||||
this.chartDF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
chartArea12.Name = "ChartArea1";
|
||||
this.chartDF.ChartAreas.Add(chartArea12);
|
||||
legend12.Name = "Legend1";
|
||||
this.chartDF.Legends.Add(legend12);
|
||||
this.chartDF.Location = new System.Drawing.Point(1092, 396);
|
||||
this.chartDF.Name = "chartDF";
|
||||
series12.ChartArea = "ChartArea1";
|
||||
series12.Legend = "Legend1";
|
||||
series12.Name = "Series1";
|
||||
this.chartDF.Series.Add(series12);
|
||||
this.chartDF.Size = new System.Drawing.Size(589, 374);
|
||||
this.chartDF.TabIndex = 5;
|
||||
this.chartDF.Text = "chart1";
|
||||
//
|
||||
// txaEF
|
||||
//
|
||||
this.txaEF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.txaEF.Location = new System.Drawing.Point(12, 396);
|
||||
this.txaEF.Name = "txaEF";
|
||||
this.txaEF.Size = new System.Drawing.Size(230, 374);
|
||||
this.txaEF.TabIndex = 6;
|
||||
this.txaEF.Text = "RPM SP - RPM - POTENCIA";
|
||||
//
|
||||
// txaDT
|
||||
//
|
||||
this.txaDT.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txaDT.Location = new System.Drawing.Point(856, 12);
|
||||
this.txaDT.Name = "txaDT";
|
||||
this.txaDT.Size = new System.Drawing.Size(230, 374);
|
||||
this.txaDT.TabIndex = 7;
|
||||
this.txaDT.Text = "RPM SP - RPM - POTENCIA";
|
||||
//
|
||||
// txaDF
|
||||
//
|
||||
this.txaDF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txaDF.Location = new System.Drawing.Point(856, 396);
|
||||
this.txaDF.Name = "txaDF";
|
||||
this.txaDF.Size = new System.Drawing.Size(230, 374);
|
||||
this.txaDF.TabIndex = 8;
|
||||
this.txaDF.Text = "RPM SP - RPM - POTENCIA";
|
||||
//
|
||||
// frmPlotMovimentacao
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1693, 782);
|
||||
this.Controls.Add(this.txaDF);
|
||||
this.Controls.Add(this.txaDT);
|
||||
this.Controls.Add(this.txaEF);
|
||||
this.Controls.Add(this.chartDF);
|
||||
this.Controls.Add(this.chartDT);
|
||||
this.Controls.Add(this.chartEF);
|
||||
this.Controls.Add(this.txaET);
|
||||
this.Controls.Add(this.chartET);
|
||||
this.Name = "frmPlotMovimentacao";
|
||||
this.Text = "Plot - Módulo Movimentação";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmPlotMovimentacao_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartET)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartEF)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartDT)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartDF)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
public System.Windows.Forms.DataVisualization.Charting.Chart chartET;
|
||||
private System.Windows.Forms.RichTextBox txaET;
|
||||
public System.Windows.Forms.DataVisualization.Charting.Chart chartEF;
|
||||
public System.Windows.Forms.DataVisualization.Charting.Chart chartDT;
|
||||
public System.Windows.Forms.DataVisualization.Charting.Chart chartDF;
|
||||
private System.Windows.Forms.RichTextBox txaEF;
|
||||
private System.Windows.Forms.RichTextBox txaDT;
|
||||
private System.Windows.Forms.RichTextBox txaDF;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
using AgroBase.Comum;
|
||||
using AgroBase.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
public partial class frmPlotMovimentacao : Form
|
||||
{
|
||||
private DispositivosService DispMov;
|
||||
|
||||
public frmPlotMovimentacao()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmPlotMovimentacao_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
public void AtualizaGrafico()
|
||||
{
|
||||
DispMov = frmPrincipal.Dispositivos.FirstOrDefault(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Mov);
|
||||
if (chartET.InvokeRequired)
|
||||
{
|
||||
chartET.Invoke(new Action(AtualizaGrafico));
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var Motor in ((MovimentacaoModel)DispMov.Dados).Motores.Where(x => x.Conectado))
|
||||
{
|
||||
Chart chart = (Chart)(this.Controls.Find("chart" + Motor.ID, false).First());
|
||||
chart.Titles.Clear();
|
||||
chart.Titles.Add(Motor.Descricao);
|
||||
var Logs = (Motor.LogPID.Count > 60 ? Motor.LogPID.Skip(Math.Max(0, Motor.LogPID.Count - 60)).Take(60).ToList() : Motor.LogPID).Where(log => log.Componente == Motor.ID).ToList();
|
||||
chart.Series.Clear();
|
||||
List<string> Momentos = Logs.Select(x => x.Momento.ToString("mm:ss:fff")).ToList();
|
||||
var serieRPMsp = new Series("RPM SP");
|
||||
serieRPMsp.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_SP).ToList());
|
||||
serieRPMsp.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieRPMsp);
|
||||
var serieRPM = new Series("RPM");
|
||||
serieRPM.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM).ToList());
|
||||
serieRPM.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieRPM);
|
||||
var seriePotencia = new Series("Potencia");
|
||||
seriePotencia.Points.DataBindXY(Momentos, Logs.Select(x => x.Potencia).ToList());
|
||||
seriePotencia.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(seriePotencia);
|
||||
|
||||
foreach (var legend in chart.Legends)
|
||||
{
|
||||
legend.Docking = Docking.Bottom;
|
||||
}
|
||||
|
||||
if (Motor.LogPID.Count > 0)
|
||||
{
|
||||
var Log = Motor.LogPID[Motor.LogPID.Count - 1];
|
||||
RichTextBox txtHistorico = (RichTextBox)(this.Controls.Find("txa" + Motor.ID, false).First());
|
||||
txtHistorico.Text += Environment.NewLine +
|
||||
Log.RPM_SP.ToString("0000") +
|
||||
" - " + Log.RPM.ToString("0000") +
|
||||
" - " + Log.Potencia.ToString("000");
|
||||
//txtHistorico.SelectionStart = txtHistorico.Text.Length;
|
||||
//txtHistorico.ScrollToCaret();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -48,6 +48,7 @@ namespace AgroBase
|
|||
this.btnNovoDispositivo = new System.Windows.Forms.Button();
|
||||
this.joystickStrip = new System.Windows.Forms.StatusStrip();
|
||||
this.lblStripJoystick = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.lblStripJoystickComando = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.gpbJoysticks = new System.Windows.Forms.GroupBox();
|
||||
this.lblRPM = new System.Windows.Forms.Label();
|
||||
this.trkRPM = new System.Windows.Forms.TrackBar();
|
||||
|
|
@ -66,6 +67,16 @@ namespace AgroBase
|
|||
this.lblSenMotores = new System.Windows.Forms.Label();
|
||||
this.gridSenMotores = new System.Windows.Forms.DataGridView();
|
||||
this.btnDiagnosticos = new System.Windows.Forms.Button();
|
||||
this.joystickTimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.btnPlotMov = new System.Windows.Forms.Button();
|
||||
this.lblKp = new System.Windows.Forms.Label();
|
||||
this.txtKp = new System.Windows.Forms.TextBox();
|
||||
this.txtKi = new System.Windows.Forms.TextBox();
|
||||
this.lblKi = new System.Windows.Forms.Label();
|
||||
this.txtKd = new System.Windows.Forms.TextBox();
|
||||
this.lblKd = new System.Windows.Forms.Label();
|
||||
this.btnSalvarPID = new System.Windows.Forms.Button();
|
||||
this.lblPID = new System.Windows.Forms.Label();
|
||||
this.gpbAcoes.SuspendLayout();
|
||||
this.erroStrip.SuspendLayout();
|
||||
this.pnlLateral.SuspendLayout();
|
||||
|
|
@ -88,7 +99,7 @@ namespace AgroBase
|
|||
this.gpbAcoes.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.gpbAcoes.Location = new System.Drawing.Point(582, 0);
|
||||
this.gpbAcoes.Name = "gpbAcoes";
|
||||
this.gpbAcoes.Size = new System.Drawing.Size(829, 677);
|
||||
this.gpbAcoes.Size = new System.Drawing.Size(829, 763);
|
||||
this.gpbAcoes.TabIndex = 0;
|
||||
this.gpbAcoes.TabStop = false;
|
||||
this.gpbAcoes.Text = "Conexão";
|
||||
|
|
@ -98,7 +109,7 @@ namespace AgroBase
|
|||
this.erroStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.erroStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.lblStripErro});
|
||||
this.erroStrip.Location = new System.Drawing.Point(3, 648);
|
||||
this.erroStrip.Location = new System.Drawing.Point(3, 734);
|
||||
this.erroStrip.Name = "erroStrip";
|
||||
this.erroStrip.Size = new System.Drawing.Size(823, 26);
|
||||
this.erroStrip.TabIndex = 1;
|
||||
|
|
@ -122,7 +133,7 @@ namespace AgroBase
|
|||
this.pnlLateral.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlLateral.Location = new System.Drawing.Point(3, 18);
|
||||
this.pnlLateral.Name = "pnlLateral";
|
||||
this.pnlLateral.Size = new System.Drawing.Size(823, 656);
|
||||
this.pnlLateral.Size = new System.Drawing.Size(823, 742);
|
||||
this.pnlLateral.TabIndex = 0;
|
||||
//
|
||||
// gpbDispositivos
|
||||
|
|
@ -246,8 +257,9 @@ namespace AgroBase
|
|||
//
|
||||
this.joystickStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.joystickStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.lblStripJoystick});
|
||||
this.joystickStrip.Location = new System.Drawing.Point(0, 651);
|
||||
this.lblStripJoystick,
|
||||
this.lblStripJoystickComando});
|
||||
this.joystickStrip.Location = new System.Drawing.Point(0, 737);
|
||||
this.joystickStrip.Name = "joystickStrip";
|
||||
this.joystickStrip.Size = new System.Drawing.Size(582, 26);
|
||||
this.joystickStrip.TabIndex = 1;
|
||||
|
|
@ -259,8 +271,22 @@ namespace AgroBase
|
|||
this.lblStripJoystick.Size = new System.Drawing.Size(161, 20);
|
||||
this.lblStripJoystick.Text = "Joystick: Desconectado";
|
||||
//
|
||||
// lblStripJoystickComando
|
||||
//
|
||||
this.lblStripJoystickComando.Name = "lblStripJoystickComando";
|
||||
this.lblStripJoystickComando.Size = new System.Drawing.Size(18, 20);
|
||||
this.lblStripJoystickComando.Text = "...";
|
||||
//
|
||||
// gpbJoysticks
|
||||
//
|
||||
this.gpbJoysticks.Controls.Add(this.lblPID);
|
||||
this.gpbJoysticks.Controls.Add(this.btnSalvarPID);
|
||||
this.gpbJoysticks.Controls.Add(this.txtKd);
|
||||
this.gpbJoysticks.Controls.Add(this.lblKd);
|
||||
this.gpbJoysticks.Controls.Add(this.txtKi);
|
||||
this.gpbJoysticks.Controls.Add(this.lblKi);
|
||||
this.gpbJoysticks.Controls.Add(this.txtKp);
|
||||
this.gpbJoysticks.Controls.Add(this.lblKp);
|
||||
this.gpbJoysticks.Controls.Add(this.lblRPM);
|
||||
this.gpbJoysticks.Controls.Add(this.trkRPM);
|
||||
this.gpbJoysticks.Controls.Add(this.lblPrecisao);
|
||||
|
|
@ -275,7 +301,7 @@ namespace AgroBase
|
|||
this.gpbJoysticks.Controls.Add(this.cmbJoysticks);
|
||||
this.gpbJoysticks.Location = new System.Drawing.Point(12, 12);
|
||||
this.gpbJoysticks.Name = "gpbJoysticks";
|
||||
this.gpbJoysticks.Size = new System.Drawing.Size(372, 408);
|
||||
this.gpbJoysticks.Size = new System.Drawing.Size(372, 490);
|
||||
this.gpbJoysticks.TabIndex = 2;
|
||||
this.gpbJoysticks.TabStop = false;
|
||||
this.gpbJoysticks.Text = "Controle";
|
||||
|
|
@ -409,9 +435,9 @@ namespace AgroBase
|
|||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.gpbSensoriamento.Controls.Add(this.lblSenMotores);
|
||||
this.gpbSensoriamento.Controls.Add(this.gridSenMotores);
|
||||
this.gpbSensoriamento.Location = new System.Drawing.Point(12, 426);
|
||||
this.gpbSensoriamento.Location = new System.Drawing.Point(12, 508);
|
||||
this.gpbSensoriamento.Name = "gpbSensoriamento";
|
||||
this.gpbSensoriamento.Size = new System.Drawing.Size(564, 222);
|
||||
this.gpbSensoriamento.Size = new System.Drawing.Size(564, 226);
|
||||
this.gpbSensoriamento.TabIndex = 13;
|
||||
this.gpbSensoriamento.TabStop = false;
|
||||
this.gpbSensoriamento.Text = "Sensoriamento";
|
||||
|
|
@ -435,7 +461,7 @@ namespace AgroBase
|
|||
this.gridSenMotores.Name = "gridSenMotores";
|
||||
this.gridSenMotores.RowHeadersWidth = 51;
|
||||
this.gridSenMotores.RowTemplate.Height = 24;
|
||||
this.gridSenMotores.Size = new System.Drawing.Size(552, 173);
|
||||
this.gridSenMotores.Size = new System.Drawing.Size(552, 177);
|
||||
this.gridSenMotores.TabIndex = 0;
|
||||
//
|
||||
// btnDiagnosticos
|
||||
|
|
@ -448,11 +474,99 @@ namespace AgroBase
|
|||
this.btnDiagnosticos.UseVisualStyleBackColor = true;
|
||||
this.btnDiagnosticos.Click += new System.EventHandler(this.btnDiagnosticos_Click);
|
||||
//
|
||||
// joystickTimer
|
||||
//
|
||||
this.joystickTimer.Tick += new System.EventHandler(this.joystickTimer_Tick);
|
||||
//
|
||||
// btnPlotMov
|
||||
//
|
||||
this.btnPlotMov.Location = new System.Drawing.Point(390, 72);
|
||||
this.btnPlotMov.Name = "btnPlotMov";
|
||||
this.btnPlotMov.Size = new System.Drawing.Size(112, 25);
|
||||
this.btnPlotMov.TabIndex = 15;
|
||||
this.btnPlotMov.Text = "Plot MOV";
|
||||
this.btnPlotMov.UseVisualStyleBackColor = true;
|
||||
this.btnPlotMov.Click += new System.EventHandler(this.btnPlotMov_Click);
|
||||
//
|
||||
// lblKp
|
||||
//
|
||||
this.lblKp.AutoSize = true;
|
||||
this.lblKp.Location = new System.Drawing.Point(12, 434);
|
||||
this.lblKp.Name = "lblKp";
|
||||
this.lblKp.Size = new System.Drawing.Size(25, 17);
|
||||
this.lblKp.TabIndex = 22;
|
||||
this.lblKp.Text = "Kp";
|
||||
//
|
||||
// txtKp
|
||||
//
|
||||
this.txtKp.Location = new System.Drawing.Point(15, 454);
|
||||
this.txtKp.Name = "txtKp";
|
||||
this.txtKp.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKp.TabIndex = 23;
|
||||
this.txtKp.Text = "0,2";
|
||||
this.txtKp.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// txtKi
|
||||
//
|
||||
this.txtKi.Location = new System.Drawing.Point(98, 454);
|
||||
this.txtKi.Name = "txtKi";
|
||||
this.txtKi.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKi.TabIndex = 25;
|
||||
this.txtKi.Text = "0,2";
|
||||
this.txtKi.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKi
|
||||
//
|
||||
this.lblKi.AutoSize = true;
|
||||
this.lblKi.Location = new System.Drawing.Point(95, 434);
|
||||
this.lblKi.Name = "lblKi";
|
||||
this.lblKi.Size = new System.Drawing.Size(20, 17);
|
||||
this.lblKi.TabIndex = 24;
|
||||
this.lblKi.Text = "Ki";
|
||||
//
|
||||
// txtKd
|
||||
//
|
||||
this.txtKd.Location = new System.Drawing.Point(182, 454);
|
||||
this.txtKd.Name = "txtKd";
|
||||
this.txtKd.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKd.TabIndex = 27;
|
||||
this.txtKd.Text = "0,005";
|
||||
this.txtKd.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKd
|
||||
//
|
||||
this.lblKd.AutoSize = true;
|
||||
this.lblKd.Location = new System.Drawing.Point(179, 434);
|
||||
this.lblKd.Name = "lblKd";
|
||||
this.lblKd.Size = new System.Drawing.Size(25, 17);
|
||||
this.lblKd.TabIndex = 26;
|
||||
this.lblKd.Text = "Kd";
|
||||
//
|
||||
// btnSalvarPID
|
||||
//
|
||||
this.btnSalvarPID.Location = new System.Drawing.Point(265, 453);
|
||||
this.btnSalvarPID.Name = "btnSalvarPID";
|
||||
this.btnSalvarPID.Size = new System.Drawing.Size(84, 25);
|
||||
this.btnSalvarPID.TabIndex = 28;
|
||||
this.btnSalvarPID.Text = "Salvar";
|
||||
this.btnSalvarPID.UseVisualStyleBackColor = true;
|
||||
this.btnSalvarPID.Click += new System.EventHandler(this.btnSalvarPID_Click);
|
||||
//
|
||||
// lblPID
|
||||
//
|
||||
this.lblPID.AutoSize = true;
|
||||
this.lblPID.Location = new System.Drawing.Point(12, 407);
|
||||
this.lblPID.Name = "lblPID";
|
||||
this.lblPID.Size = new System.Drawing.Size(116, 17);
|
||||
this.lblPID.TabIndex = 29;
|
||||
this.lblPID.Text = "PID - Parâmetros";
|
||||
//
|
||||
// frmPrincipal
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1411, 677);
|
||||
this.ClientSize = new System.Drawing.Size(1411, 763);
|
||||
this.Controls.Add(this.btnPlotMov);
|
||||
this.Controls.Add(this.btnDiagnosticos);
|
||||
this.Controls.Add(this.gpbJoysticks);
|
||||
this.Controls.Add(this.gpbSensoriamento);
|
||||
|
|
@ -526,6 +640,17 @@ namespace AgroBase
|
|||
private System.Windows.Forms.Label lblRPM;
|
||||
private System.Windows.Forms.Button btnDiagnosticos;
|
||||
public System.Windows.Forms.TrackBar trkRPM;
|
||||
private System.Windows.Forms.Timer joystickTimer;
|
||||
private System.Windows.Forms.ToolStripStatusLabel lblStripJoystickComando;
|
||||
private System.Windows.Forms.Button btnPlotMov;
|
||||
private System.Windows.Forms.Label lblPID;
|
||||
private System.Windows.Forms.Button btnSalvarPID;
|
||||
private System.Windows.Forms.TextBox txtKd;
|
||||
private System.Windows.Forms.Label lblKd;
|
||||
private System.Windows.Forms.TextBox txtKi;
|
||||
private System.Windows.Forms.Label lblKi;
|
||||
private System.Windows.Forms.TextBox txtKp;
|
||||
private System.Windows.Forms.Label lblKp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,18 +4,12 @@ using AgroBase.Models;
|
|||
using AgroBase.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Windows.Gaming.Input;
|
||||
using static AgroBase.Models.Enuns;
|
||||
using Timer = System.Windows.Forms.Timer;
|
||||
|
||||
namespace AgroBase
|
||||
{
|
||||
|
|
@ -32,6 +26,8 @@ namespace AgroBase
|
|||
{
|
||||
timerDispositivos.Enabled = true;
|
||||
btnJoyAtt_Click(sender, e);
|
||||
|
||||
//InstanciaJoystick();
|
||||
}
|
||||
|
||||
private void btnNovoDispositivo_Click(object sender, EventArgs e)
|
||||
|
|
@ -77,7 +73,6 @@ namespace AgroBase
|
|||
private void btnJoyAtt_Click(object sender, EventArgs e)
|
||||
{
|
||||
Joystick.AtualizaDispositivo();
|
||||
|
||||
}
|
||||
|
||||
private void btnJoyEdt_Click(object sender, EventArgs e)
|
||||
|
|
@ -146,5 +141,275 @@ namespace AgroBase
|
|||
lblRPM.Text = "RPM: " + Joystick.RPM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region JOYSTICK
|
||||
|
||||
JoystickGeneric joystick;
|
||||
|
||||
public void InstanciaJoystick(bool ConexaoAutomatica = true, int IndexJoystick = 0)
|
||||
{
|
||||
JoystickGeneric.JoystickExist = true;
|
||||
joystick = new JoystickGeneric(this.Handle);
|
||||
connectToJoystick(joystick, ConexaoAutomatica, IndexJoystick);
|
||||
}
|
||||
|
||||
private void connectToJoystick(JoystickGeneric joystick, bool ConexaoAutomatica = true, int IndexJoystick = 0)
|
||||
{
|
||||
while (JoystickGeneric.JoystickExist)
|
||||
{
|
||||
string sticks = "";
|
||||
if (ConexaoAutomatica)
|
||||
sticks = joystick.FindJoysticks();
|
||||
else if (JoystickGeneric.ListaDeJoysticksNomes.Count > 0)
|
||||
sticks = JoystickGeneric.ListaDeJoysticksNomes[IndexJoystick];
|
||||
|
||||
if (sticks != null)
|
||||
{
|
||||
if (joystick.AcquireJoystick(sticks))
|
||||
{
|
||||
enableTimer();
|
||||
lblStripJoystick.Text = "Joystick: " + sticks + " Conectado";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
JoystickGeneric.JoystickExist = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void enableTimer()
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
BeginInvoke(new ThreadStart(delegate ()
|
||||
{
|
||||
joystickTimer.Enabled = true;
|
||||
}));
|
||||
}
|
||||
else
|
||||
joystickTimer.Enabled = true;
|
||||
}
|
||||
|
||||
private void joystickTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool Apertou = false;
|
||||
bool ApertouDirecao = false;
|
||||
bool ApertouDirecaoCamera = false;
|
||||
int X0 = 2500;
|
||||
int Y0 = 2500;
|
||||
|
||||
joystick.UpdateStatus();
|
||||
|
||||
var LXaxis = (JoystickGeneric.InverteAnalogicoLX) ? joystick.LYaxis : joystick.LXaxis;
|
||||
var LYaxis = (JoystickGeneric.InverteAnalogicoLY) ? joystick.LXaxis : joystick.LYaxis;
|
||||
var RXaxis = (JoystickGeneric.InverteAnalogicoRX) ? joystick.RYaxis : joystick.RXaxis;
|
||||
var RYaxis = (JoystickGeneric.InverteAnalogicoRY) ? joystick.RXaxis : joystick.RYaxis;
|
||||
|
||||
if (JoystickGeneric.PossuiAnalogico)
|
||||
{
|
||||
// DIAGONAIS
|
||||
if (LXaxis < X0 && LYaxis < Y0)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Esquerda)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.EsquerdaCima;
|
||||
AtualziaConsoleControle("Esquerda/Cima");
|
||||
}
|
||||
}
|
||||
else if (LXaxis < X0 && LYaxis > Y0)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Esquerda)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.EsquerdaBaixo;
|
||||
AtualziaConsoleControle("Esquerda/Baixo");
|
||||
}
|
||||
}
|
||||
else if (LXaxis > X0 && LYaxis < Y0)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Esquerda)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.DireitaCima;
|
||||
AtualziaConsoleControle("Direita/Cima");
|
||||
}
|
||||
}
|
||||
else if (LXaxis > X0 && LYaxis > Y0)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Esquerda)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.DireitaBaixo;
|
||||
AtualziaConsoleControle("Direita/Baixo");
|
||||
}
|
||||
}
|
||||
// DIRECIONAIS
|
||||
else if (LXaxis == 0)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Esquerda)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.Esquerda;
|
||||
AtualziaConsoleControle("Esquerda");
|
||||
}
|
||||
}
|
||||
else if (LXaxis > 50000)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Direita)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.Direita;
|
||||
AtualziaConsoleControle("Direita");
|
||||
}
|
||||
}
|
||||
else if (LYaxis < 500)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Cima)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.Cima;
|
||||
AtualziaConsoleControle("Cima");
|
||||
}
|
||||
}
|
||||
else if (LYaxis > 50000)
|
||||
{
|
||||
ApertouDirecao = true;
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Baixo)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.Baixo;
|
||||
AtualziaConsoleControle("Baixo");
|
||||
}
|
||||
}
|
||||
else if (LXaxis == X0 && joystick.LYaxis == Y0)
|
||||
{
|
||||
if (JoystickGeneric.UltimaDirecaoJoystick != Direcao.Parado)
|
||||
{
|
||||
JoystickGeneric.UltimaDirecaoJoystick = Direcao.Parado;
|
||||
AtualziaConsoleControle("Parado");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ANALOGICO DIREITO
|
||||
//Console.WriteLine("X: " + joystick.RXaxis + "; Y: " + joystick.RYaxis);
|
||||
|
||||
if (RYaxis == 0)
|
||||
{
|
||||
ApertouDirecaoCamera = true;
|
||||
if (JoystickGeneric.UltimaDirecaoCamera != Direcao.Cima)
|
||||
{
|
||||
AtualziaConsoleControle("Câmera para cima");
|
||||
JoystickGeneric.UltimaDirecaoCamera = Direcao.Cima;
|
||||
}
|
||||
}
|
||||
if (RYaxis > (X0 * 2))
|
||||
{
|
||||
ApertouDirecaoCamera = true;
|
||||
if (JoystickGeneric.UltimaDirecaoCamera != Direcao.Baixo)
|
||||
{
|
||||
AtualziaConsoleControle("Câmera para baixo");
|
||||
JoystickGeneric.UltimaDirecaoCamera = Direcao.Baixo;
|
||||
}
|
||||
}
|
||||
if (RXaxis == 0)
|
||||
{
|
||||
ApertouDirecaoCamera = true;
|
||||
if (JoystickGeneric.UltimaDirecaoCamera != Direcao.Esquerda)
|
||||
{
|
||||
AtualziaConsoleControle("Câmera para esquerda");
|
||||
JoystickGeneric.UltimaDirecaoCamera = Direcao.Esquerda;
|
||||
}
|
||||
}
|
||||
if (RXaxis > (X0 * 2))
|
||||
{
|
||||
ApertouDirecaoCamera = true;
|
||||
if (JoystickGeneric.UltimaDirecaoCamera != Direcao.Direita)
|
||||
{
|
||||
AtualziaConsoleControle("Câmera para direita");
|
||||
JoystickGeneric.UltimaDirecaoCamera = Direcao.Direita;
|
||||
}
|
||||
}
|
||||
else if (RXaxis == X0 && RYaxis == Y0)
|
||||
{
|
||||
ApertouDirecaoCamera = true;
|
||||
if (JoystickGeneric.UltimaDirecaoCamera != Direcao.Parado)
|
||||
{
|
||||
AtualziaConsoleControle("Câmera parada");
|
||||
JoystickGeneric.UltimaDirecaoCamera = Direcao.Parado;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Console.WriteLine("RX: " + joystick.RXaxis + "; RY: " + joystick.RYaxis);
|
||||
|
||||
for (int i = 0; i < joystick.buttons.Length; i++)
|
||||
{
|
||||
if (joystick.buttons[i] == true)
|
||||
{
|
||||
Apertou = true;
|
||||
if (JoystickGeneric.UltimoComando != i)
|
||||
{
|
||||
AtualziaConsoleControle("Botão " + i.ToString("00") + " (" + (BotoesJoystick)i + ") pressionado");
|
||||
|
||||
|
||||
JoystickGeneric.UltimoComando = i;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
joystickTimer.Enabled = false;
|
||||
connectToJoystick(joystick);
|
||||
}
|
||||
|
||||
JoystickGeneric.IndexComando++;
|
||||
if (JoystickGeneric.IndexComando > 5)
|
||||
{
|
||||
JoystickGeneric.UltimoComando = -10;
|
||||
JoystickGeneric.IndexComando = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void AtualziaConsoleControle(string TextoConsole)
|
||||
{
|
||||
lblStripJoystickComando.Text = TextoConsole;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void btnPlotMov_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmInstancial.frmPlotMovimentacao.Show();
|
||||
}
|
||||
|
||||
private void btnSalvarPID_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (double.TryParse(txtKp.Text, out double kp))
|
||||
{
|
||||
MovimentacaoModel.Kp = kp;
|
||||
}
|
||||
if (double.TryParse(txtKi.Text, out double ki))
|
||||
{
|
||||
MovimentacaoModel.Ki = ki;
|
||||
}
|
||||
if (double.TryParse(txtKd.Text, out double kd))
|
||||
{
|
||||
MovimentacaoModel.Kd = kd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,16 +118,16 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="erroStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>14, 13</value>
|
||||
</metadata>
|
||||
<metadata name="erroStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>14, 13</value>
|
||||
<value>11, 10</value>
|
||||
</metadata>
|
||||
<metadata name="joystickStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>116, 13</value>
|
||||
<value>93, 10</value>
|
||||
</metadata>
|
||||
<metadata name="timerDispositivos.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>284, 16</value>
|
||||
<value>227, 12</value>
|
||||
</metadata>
|
||||
<metadata name="joystickTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>458, 16</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>59</value>
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -11,6 +11,7 @@ namespace AgroBase.Models
|
|||
void RecebeProtocoloSerial(string Protocolo);
|
||||
string GetTaxaAmostragem();
|
||||
void SetTaxaAmostragem(int TaxaAmostragem);
|
||||
bool GetStatusConexao();
|
||||
string ProtocoloConfiguracao(bool Conectar);
|
||||
void PopulaGridSensoriamento();
|
||||
void AtualizaGridSensoriamento();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,37 @@ namespace AgroBase.Models
|
|||
public enum S_Code
|
||||
{
|
||||
sRPM,
|
||||
sTST
|
||||
sTST,
|
||||
sCfg,
|
||||
}
|
||||
|
||||
public enum BotoesJoystick
|
||||
{
|
||||
Triangulo,
|
||||
Bolinha,
|
||||
Xis,
|
||||
Quadrado,
|
||||
L1,
|
||||
R1,
|
||||
L2,
|
||||
R2,
|
||||
Select,
|
||||
Start,
|
||||
L3,
|
||||
R3,
|
||||
SCima,
|
||||
SDireita,
|
||||
SBaixo,
|
||||
SEsquerda,
|
||||
AECima,
|
||||
AEDireita,
|
||||
AEBaixo,
|
||||
AEEsquerda,
|
||||
ADCima,
|
||||
ADDireita,
|
||||
ADBaixo,
|
||||
ADEsquerda,
|
||||
Vazio
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
using Microsoft.DirectX.DirectInput;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models
|
||||
{
|
||||
class JoystickGeneric
|
||||
{
|
||||
List<DeviceInstance> ListaDeJoysticks;
|
||||
public static List<string> ListaDeJoysticksNomes;
|
||||
public static bool JoystickExist = false;
|
||||
|
||||
#region param
|
||||
|
||||
private Device joystickDevice;
|
||||
private JoystickState state;
|
||||
public int Xaxis; // X-axis movement
|
||||
public int Yaxis; //Y-axis movement
|
||||
public int RXaxis;
|
||||
public int RYaxis;
|
||||
public int LXaxis;
|
||||
public int LYaxis;
|
||||
private IntPtr hWnd;
|
||||
public bool[] buttons;
|
||||
private string systemJoysticks;
|
||||
|
||||
public static bool PossuiAnalogico = false;
|
||||
public static bool InverteAnalogicoLX = false;
|
||||
public static bool InverteAnalogicoLY = false;
|
||||
public static bool InverteAnalogicoRX = false;
|
||||
public static bool InverteAnalogicoRY = false;
|
||||
public static int UltimoComando = -10;
|
||||
public static int IndexComando = 0;
|
||||
public static Direcao UltimaDirecaoJoystick = Direcao.Parado;
|
||||
public static Direcao UltimaDirecaoCamera = Direcao.Parado;
|
||||
|
||||
#endregion
|
||||
|
||||
public JoystickGeneric(IntPtr window_handle)
|
||||
{
|
||||
hWnd = window_handle;
|
||||
Xaxis = -1;
|
||||
}
|
||||
|
||||
public string FindJoysticks()
|
||||
{
|
||||
systemJoysticks = null;
|
||||
|
||||
ListaDeJoysticks = new List<DeviceInstance>();
|
||||
ListaDeJoysticksNomes = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
// Find all the GameControl devices that are attached.
|
||||
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
|
||||
|
||||
// check that we have at least one device.
|
||||
if (gameControllerList.Count > 0)
|
||||
{
|
||||
foreach (DeviceInstance deviceInstance in gameControllerList)
|
||||
{
|
||||
// create a device from this controller so we can retrieve info.
|
||||
joystickDevice = new Device(deviceInstance.InstanceGuid);
|
||||
joystickDevice.SetCooperativeLevel(hWnd, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);
|
||||
|
||||
systemJoysticks = joystickDevice.DeviceInformation.InstanceName;
|
||||
|
||||
ListaDeJoysticks.Add(deviceInstance);
|
||||
ListaDeJoysticksNomes.Add(systemJoysticks);
|
||||
|
||||
//break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (systemJoysticks != null)
|
||||
{
|
||||
JoystickExist = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
JoystickExist = false;
|
||||
}
|
||||
|
||||
string Selecionado = null;
|
||||
if (ListaDeJoysticksNomes.Count > 0)
|
||||
Selecionado = ListaDeJoysticksNomes[0];
|
||||
|
||||
return Selecionado;
|
||||
}
|
||||
|
||||
public bool AcquireJoystick(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
|
||||
foreach (DeviceInstance deviceInstance in gameControllerList)
|
||||
{
|
||||
if (deviceInstance.InstanceName == name)
|
||||
{
|
||||
found = true;
|
||||
joystickDevice = new Device(deviceInstance.InstanceGuid);
|
||||
joystickDevice.SetCooperativeLevel(hWnd, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return false;
|
||||
|
||||
joystickDevice.SetDataFormat(DeviceDataFormat.Joystick);
|
||||
|
||||
joystickDevice.Acquire();
|
||||
|
||||
UpdateStatus();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ReleaseJoystick()
|
||||
{
|
||||
joystickDevice.Unacquire();
|
||||
}
|
||||
|
||||
public void UpdateStatus()
|
||||
{
|
||||
Poll();
|
||||
|
||||
int[] extraAxis = state.GetSlider();
|
||||
|
||||
LXaxis = state.X;
|
||||
LYaxis = state.Y;
|
||||
|
||||
RXaxis = state.Z;
|
||||
RYaxis = state.Rz;
|
||||
|
||||
byte[] jsButtons = state.GetButtons();
|
||||
buttons = new bool[jsButtons.Length];
|
||||
|
||||
int i = 0;
|
||||
foreach (byte button in jsButtons)
|
||||
{
|
||||
buttons[i] = button >= 128;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
private void Poll()
|
||||
{
|
||||
try
|
||||
{
|
||||
// poll the joystick
|
||||
joystickDevice.Poll();
|
||||
// update the joystick state field
|
||||
state = joystickDevice.CurrentJoystickState;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw (null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,11 @@ namespace AgroBase.Models
|
|||
public class MovimentacaoModel : DispositivosBaseModel
|
||||
{
|
||||
public int _TaxaAmostragem { get; set; }
|
||||
public static double Kp { get; set; } = 0.2;
|
||||
public static double Ki { get; set; } = 0.2;
|
||||
public static double Kd { get; set; } = 0.005;
|
||||
public double DiametroRoda { get; set; } = 0.3556;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public List<SensoriamentoMotor> Motores = new List<SensoriamentoMotor>()
|
||||
{
|
||||
new SensoriamentoMotor() {
|
||||
|
|
@ -66,7 +70,10 @@ namespace AgroBase.Models
|
|||
return ((int)F_Code.Cfg).ToString() +
|
||||
(Conectar ? "1" : "0") + ";" +
|
||||
GetTaxaAmostragem() + ";" +
|
||||
string.Join(";", Motores.OrderBy(x => x.Canal).Select(x => x.Conectado ? "1" : "1").ToArray());
|
||||
string.Join(";", Motores.OrderBy(x => x.Canal).Select(x => x.Conectado ? "1" : "1").ToArray()) + ";" +
|
||||
Kp.ToString("0.000").Replace(",", ".") + ";" +
|
||||
Ki.ToString("0.000").Replace(",", ".") + ";" +
|
||||
Kd.ToString("0.000").Replace(",", ".");
|
||||
}
|
||||
|
||||
public void RecebeProtocoloSerial(string Protocolo)
|
||||
|
|
@ -96,9 +103,23 @@ namespace AgroBase.Models
|
|||
double rpm = 0;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out rpm);
|
||||
Motor.RPM = rpm;
|
||||
int potencia = 0;
|
||||
int.TryParse(Dados[4], out potencia);
|
||||
double potencia = 0;
|
||||
double.TryParse(Dados[4].Replace(".", ","), out potencia);
|
||||
Motor.Potencia = potencia;
|
||||
|
||||
Motor.LogPID.Add(new SensorimanetoPID()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
Componente = Dados[0],
|
||||
RPM_SP = Motor.RPM_SP,
|
||||
RPM = Motor.RPM,
|
||||
Potencia = Motor.Potencia,
|
||||
Kp = Kp,
|
||||
Ki = Ki,
|
||||
Kd = Kd,
|
||||
});
|
||||
|
||||
frmInstancial.frmPlotMovimentacao.AtualizaGrafico();
|
||||
break;
|
||||
}
|
||||
case S_Code.sTST:
|
||||
|
|
@ -127,6 +148,11 @@ namespace AgroBase.Models
|
|||
}
|
||||
break;
|
||||
}
|
||||
case S_Code.sCfg:
|
||||
{
|
||||
Conectado = Dados[1] == "1";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -150,6 +176,10 @@ namespace AgroBase.Models
|
|||
_TaxaAmostragem = TaxaAmostragem;
|
||||
}
|
||||
|
||||
public bool GetStatusConexao()
|
||||
{
|
||||
return Conectado;
|
||||
}
|
||||
|
||||
public void PopulaGridSensoriamento()
|
||||
{
|
||||
|
|
@ -200,7 +230,7 @@ namespace AgroBase.Models
|
|||
public bool Conectado { get; set; }
|
||||
public bool Inicializado { get; set; }
|
||||
public int RPM_SP { get; set; } = 0;
|
||||
public int Potencia { get; set; } = 0;
|
||||
public double Potencia { get; set; } = 0;
|
||||
public int Rampa { get; set; } = 0;
|
||||
public int Precisao { get; set; } = 0;
|
||||
public Sentido Sentido { get; set; }
|
||||
|
|
@ -211,6 +241,8 @@ namespace AgroBase.Models
|
|||
public ConfiguracaoSentidoMotor ConfigSentidos { get; set; }
|
||||
public bool Testando { get; set; } = false;
|
||||
public List<SensoriamentoMotorTestes> LogTestes { get; set; } = new List<SensoriamentoMotorTestes>();
|
||||
public List<SensorimanetoPID> LogPID { get; set; } = new List<SensorimanetoPID>();
|
||||
|
||||
|
||||
public string ProtocoloComando(Direcao UltimaDirecao)
|
||||
{
|
||||
|
|
@ -220,7 +252,7 @@ namespace AgroBase.Models
|
|||
Potencia = Joystick.Potencia;
|
||||
Rampa = Joystick.Rampa;
|
||||
Precisao = Joystick.Precisao;
|
||||
RPM_SP = Joystick.RPM;
|
||||
RPM_SP = UltimaDirecao == Direcao.Parado ? 0 : Joystick.RPM;
|
||||
|
||||
switch (UltimaDirecao)
|
||||
{
|
||||
|
|
@ -248,7 +280,10 @@ namespace AgroBase.Models
|
|||
((int)Sentido).ToString() + ";" +
|
||||
Rampa.ToString("000") + ";" +
|
||||
Precisao.ToString("000") + ";" +
|
||||
RPM_SP.ToString("000");
|
||||
RPM_SP.ToString("000") + ";" +
|
||||
MovimentacaoModel.Kp.ToString("0.000").Replace(",", ".") + ";" +
|
||||
MovimentacaoModel.Ki.ToString("0.000").Replace(",", ".") + ";" +
|
||||
MovimentacaoModel.Kd.ToString("0.000").Replace(",", ".");
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
|
|
@ -293,4 +328,16 @@ namespace AgroBase.Models
|
|||
public string Leitura { get; set; }
|
||||
}
|
||||
|
||||
public class SensorimanetoPID
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Componente { get; set; }
|
||||
public int RPM_SP { get; set; }
|
||||
public double RPM { get; set; }
|
||||
public double Potencia { get; set; }
|
||||
public double Kp { get; set; }
|
||||
public double Ki { get; set; }
|
||||
public double Kd { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,16 +21,18 @@ namespace AgroBase.Comum
|
|||
public GroupBox gpbItem { get; set; }
|
||||
public ComboBox cmbPorta { get; set; }
|
||||
public ComboBox cmbBaudRate { get; set; }
|
||||
public NumericUpDown nudAmostragem { get; set; }
|
||||
public Label lblStatus { get; set; }
|
||||
public Button btnConectar { get; set; }
|
||||
public Button btnAtualizar { get; set; }
|
||||
public TextBox txtEnvios { get; set; }
|
||||
public RichTextBox txaConsole { get; set; }
|
||||
public Timer tmrConexao { get; set; }
|
||||
public int _index { get; set; }
|
||||
public List<string> DadosEnviados { get; set; } = new List<string>();
|
||||
public List<string> DadosRecebidos { get; set; } = new List<string>();
|
||||
public DispositivosBaseModel Dados { get; set; } = default(DispositivosBaseModel);
|
||||
|
||||
|
||||
|
||||
public int BaudRate()
|
||||
{
|
||||
|
|
@ -169,6 +171,7 @@ namespace AgroBase.Comum
|
|||
break;
|
||||
}
|
||||
|
||||
_Porta.DataReceived -= _Porta_DataReceived;
|
||||
_Porta.DataReceived += _Porta_DataReceived;
|
||||
|
||||
gpbItem = new GroupBox()
|
||||
|
|
@ -218,7 +221,7 @@ namespace AgroBase.Comum
|
|||
Location = new System.Drawing.Point() { X = 31, Y = 124 },
|
||||
Size = new System.Drawing.Size() { Height = 17, Width = 100 }
|
||||
};
|
||||
NumericUpDown nudAmostragem = new NumericUpDown()
|
||||
nudAmostragem = new NumericUpDown()
|
||||
{
|
||||
Name = "nud" + _Nome + "Amo",
|
||||
Minimum = 0,
|
||||
|
|
@ -311,6 +314,13 @@ namespace AgroBase.Comum
|
|||
Size = new System.Drawing.Size() { Height = 141, Width = 300 },
|
||||
ReadOnly = true
|
||||
};
|
||||
tmrConexao = new Timer()
|
||||
{
|
||||
Interval = 3000,
|
||||
Enabled = false
|
||||
};
|
||||
tmrConexao.Tick -= TmrConexao_Tick;
|
||||
tmrConexao.Tick += TmrConexao_Tick;
|
||||
|
||||
|
||||
gpbItem.Controls.Add(lblPorta);
|
||||
|
|
@ -333,6 +343,12 @@ namespace AgroBase.Comum
|
|||
return gpbItem;
|
||||
}
|
||||
|
||||
private void TmrConexao_Tick(object sender, EventArgs e)
|
||||
{
|
||||
AcaoConexao();
|
||||
tmrConexao.Enabled = false;
|
||||
}
|
||||
|
||||
private void clbMotores_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
((CheckedListBox)sender).ItemCheck -= clbMotores_ItemCheck;
|
||||
|
|
@ -414,16 +430,6 @@ namespace AgroBase.Comum
|
|||
{
|
||||
EnviarDadosSerial(ProtocoloConfiguracao);
|
||||
}
|
||||
|
||||
if (DesconectarPortaSerial())
|
||||
{
|
||||
cmbPorta.Enabled = true;
|
||||
cmbBaudRate.Enabled = true;
|
||||
btnAtualizar.Enabled = true;
|
||||
txtEnvios.ReadOnly = true;
|
||||
txtEnvios.Text = "";
|
||||
btnConectar.Text = "Conectar";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -434,15 +440,37 @@ namespace AgroBase.Comum
|
|||
{
|
||||
EnviarDadosSerial(ProtocoloConfiguracao);
|
||||
}
|
||||
|
||||
cmbPorta.Enabled = false;
|
||||
cmbBaudRate.Enabled = false;
|
||||
btnAtualizar.Enabled = false;
|
||||
txtEnvios.ReadOnly = false;
|
||||
txtEnvios.Focus();
|
||||
btnConectar.Text = "Desconectar";
|
||||
}
|
||||
}
|
||||
tmrConexao.Enabled = true;
|
||||
}
|
||||
|
||||
public void AcaoConexao()
|
||||
{
|
||||
if (!Dados.GetStatusConexao())
|
||||
{
|
||||
if (DesconectarPortaSerial())
|
||||
{
|
||||
cmbPorta.Enabled = true;
|
||||
cmbBaudRate.Enabled = true;
|
||||
btnAtualizar.Enabled = true;
|
||||
nudAmostragem.Enabled = true;
|
||||
txtEnvios.ReadOnly = true;
|
||||
txtEnvios.Text = "";
|
||||
btnConectar.Text = "Conectar";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbPorta.Enabled = false;
|
||||
cmbBaudRate.Enabled = false;
|
||||
btnAtualizar.Enabled = false;
|
||||
nudAmostragem.Enabled = false;
|
||||
txtEnvios.ReadOnly = false;
|
||||
txtEnvios.Text = "";
|
||||
txtEnvios.Focus();
|
||||
btnConectar.Text = "Desconectar";
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAtualizar_Click(object sender, EventArgs e)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
40b85b555fb13fca6b2ce43b2b7651dd44597212
|
||||
b4f57dddbf750ed782de6ee72b86251665a4eb9c
|
||||
|
|
|
|||
|
|
@ -11,3 +11,21 @@ C:\Agro\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmJoystick.resources
|
|||
C:\Agro\AgroBase\AgroBase\obj\Debug\AgroBase.frmPrincipal.resources
|
||||
C:\Agro\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmInstancial.resources
|
||||
C:\Agro\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmDiagnosticos.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.exe.config
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.exe
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.pdb
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.AssemblyReference.cache
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmDiagnosticos.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.frmPrincipal.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmInstancial.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmJoystick.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Properties.Resources.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.GenerateResource.cache
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CoreCompileInputs.cache
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.exe
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.pdb
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.DirectX.DirectInput.dll
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.DirectX.dll
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.DirectX.xml
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CopyComplete
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmPlotMovimentacao.resources
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||
<Font Name="Tahoma" Size="8.25" />
|
||||
<Class Name="JoystickInterface.Joystick">
|
||||
<Position X="0.5" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<FileName>Joystick.cs</FileName>
|
||||
<HashCode>AEAAAAAEAAAgAABAIAAAYAAgFAAAaJIEKEACAAhAAAg=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
</ClassDiagram>
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
/******************************************************************************
|
||||
* C# Joystick Library - Copyright (c) 2006 Mark Harris - MarkH@rris.com.au
|
||||
******************************************************************************
|
||||
* You may use this library in your application, however please do give credit
|
||||
* to me for writing it and supplying it. If you modify this library you must
|
||||
* leave this notice at the top of this file. I'd love to see any changes you
|
||||
* do make, so please email them to me :)
|
||||
*****************************************************************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.DirectX.DirectInput;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace JoystickInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to interface with a joystick device.
|
||||
/// </summary>
|
||||
public class Joystick
|
||||
{
|
||||
private Device joystickDevice;
|
||||
private JoystickState state;
|
||||
|
||||
private int axisCount;
|
||||
/// <summary>
|
||||
/// Number of axes on the joystick.
|
||||
/// </summary>
|
||||
public int AxisCount
|
||||
{
|
||||
get { return axisCount; }
|
||||
}
|
||||
|
||||
private int axisA;
|
||||
/// <summary>
|
||||
/// The first axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisA
|
||||
{
|
||||
get { return axisA; }
|
||||
}
|
||||
|
||||
private int axisB;
|
||||
/// <summary>
|
||||
/// The second axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisB
|
||||
{
|
||||
get { return axisB; }
|
||||
}
|
||||
|
||||
private int axisC;
|
||||
/// <summary>
|
||||
/// The third axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisC
|
||||
{
|
||||
get { return axisC; }
|
||||
}
|
||||
|
||||
private int axisD;
|
||||
/// <summary>
|
||||
/// The fourth axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisD
|
||||
{
|
||||
get { return axisD; }
|
||||
}
|
||||
|
||||
private int axisE;
|
||||
/// <summary>
|
||||
/// The fifth axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisE
|
||||
{
|
||||
get { return axisE; }
|
||||
}
|
||||
|
||||
private int axisF;
|
||||
/// <summary>
|
||||
/// The sixth axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisF
|
||||
{
|
||||
get { return axisF; }
|
||||
}
|
||||
private IntPtr hWnd;
|
||||
|
||||
private bool[] buttons;
|
||||
/// <summary>
|
||||
/// Array of buttons availiable on the joystick. This also includes PoV hats.
|
||||
/// </summary>
|
||||
public bool[] Buttons
|
||||
{
|
||||
get { return buttons; }
|
||||
}
|
||||
|
||||
private string[] systemJoysticks;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the class.
|
||||
/// </summary>
|
||||
/// <param name="window_handle">Handle of the window which the joystick will be "attached" to.</param>
|
||||
public Joystick(IntPtr window_handle)
|
||||
{
|
||||
hWnd = window_handle;
|
||||
axisA = -1;
|
||||
axisB = -1;
|
||||
axisC = -1;
|
||||
axisD = -1;
|
||||
axisE = -1;
|
||||
axisF = -1;
|
||||
axisCount = 0;
|
||||
}
|
||||
|
||||
private void Poll()
|
||||
{
|
||||
try
|
||||
{
|
||||
// poll the joystick
|
||||
joystickDevice.Poll();
|
||||
// update the joystick state field
|
||||
state = joystickDevice.CurrentJoystickState;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
// we probably lost connection to the joystick
|
||||
// was it unplugged or locked by another application?
|
||||
Debug.WriteLine("Poll()");
|
||||
Debug.WriteLine(err.Message);
|
||||
Debug.WriteLine(err.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a list of joysticks attached to the computer.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// [C#]
|
||||
/// <code>
|
||||
/// JoystickInterface.Joystick jst = new JoystickInterface.Joystick(this.Handle);
|
||||
/// string[] sticks = jst.FindJoysticks();
|
||||
/// </code>
|
||||
/// </example>
|
||||
/// <returns>A list of joysticks as an array of strings.</returns>
|
||||
public string[] FindJoysticks()
|
||||
{
|
||||
systemJoysticks = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Find all the GameControl devices that are attached.
|
||||
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
|
||||
|
||||
// check that we have at least one device.
|
||||
if (gameControllerList.Count > 0)
|
||||
{
|
||||
systemJoysticks = new string[gameControllerList.Count];
|
||||
int i = 0;
|
||||
// loop through the devices.
|
||||
foreach (DeviceInstance deviceInstance in gameControllerList)
|
||||
{
|
||||
// create a device from this controller so we can retrieve info.
|
||||
joystickDevice = new Device(deviceInstance.InstanceGuid);
|
||||
joystickDevice.SetCooperativeLevel(hWnd,
|
||||
CooperativeLevelFlags.Background |
|
||||
CooperativeLevelFlags.NonExclusive);
|
||||
|
||||
systemJoysticks[i] = joystickDevice.DeviceInformation.InstanceName;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Debug.WriteLine("FindJoysticks()");
|
||||
Debug.WriteLine(err.Message);
|
||||
Debug.WriteLine(err.StackTrace);
|
||||
}
|
||||
|
||||
return systemJoysticks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Acquire the named joystick. You can find this joystick through the <see cref="FindJoysticks"/> method.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the joystick.</param>
|
||||
/// <returns>The success of the connection.</returns>
|
||||
public bool AcquireJoystick(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
// loop through the devices.
|
||||
foreach (DeviceInstance deviceInstance in gameControllerList)
|
||||
{
|
||||
if (deviceInstance.InstanceName == name)
|
||||
{
|
||||
found = true;
|
||||
// create a device from this controller so we can retrieve info.
|
||||
joystickDevice = new Device(deviceInstance.InstanceGuid);
|
||||
joystickDevice.SetCooperativeLevel(hWnd,
|
||||
CooperativeLevelFlags.Background |
|
||||
CooperativeLevelFlags.NonExclusive);
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return false;
|
||||
|
||||
// Tell DirectX that this is a Joystick.
|
||||
joystickDevice.SetDataFormat(DeviceDataFormat.Joystick);
|
||||
|
||||
// Finally, acquire the device.
|
||||
joystickDevice.Acquire();
|
||||
|
||||
// How many axes?
|
||||
// Find the capabilities of the joystick
|
||||
DeviceCaps cps = joystickDevice.Caps;
|
||||
Debug.WriteLine("Joystick Axis: " + cps.NumberAxes);
|
||||
Debug.WriteLine("Joystick Buttons: " + cps.NumberButtons);
|
||||
|
||||
axisCount = cps.NumberAxes;
|
||||
|
||||
UpdateStatus();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Debug.WriteLine("FindJoysticks()");
|
||||
Debug.WriteLine(err.Message);
|
||||
Debug.WriteLine(err.StackTrace);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unaquire a joystick releasing it back to the system.
|
||||
/// </summary>
|
||||
public void ReleaseJoystick()
|
||||
{
|
||||
joystickDevice.Unacquire();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the properties of button and axis positions.
|
||||
/// </summary>
|
||||
public void UpdateStatus()
|
||||
{
|
||||
Poll();
|
||||
|
||||
int[] extraAxis = state.GetSlider();
|
||||
//Rz Rx X Y Axis1 Axis2
|
||||
axisA = state.Rz;
|
||||
axisB = state.Rx;
|
||||
axisC = state.X;
|
||||
axisD = state.Y;
|
||||
axisE = extraAxis[0];
|
||||
axisF = extraAxis[1];
|
||||
|
||||
// not using buttons, so don't take the tiny amount of time it takes to get/parse
|
||||
byte[] jsButtons = state.GetButtons();
|
||||
buttons = new bool[jsButtons.Length];
|
||||
|
||||
int i = 0;
|
||||
foreach (byte button in jsButtons)
|
||||
{
|
||||
buttons[i] = button >= 128;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0D77953E-FD60-4824-A997-AF72E66EF8C1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>JoystickInterface</RootNamespace>
|
||||
<AssemblyName>JoystickInterface</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Debug\JoystickInterface.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\JoystickInterface.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Joystick.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
</ItemGroup>
|
||||
<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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
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("JoystickInterface")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("JoystickInterface")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2006")]
|
||||
[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("5d26dd3c-c2bf-4730-9025-658cca9b563e")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoystickSample", "JoystickSample\JoystickSample.csproj", "{94C0EC44-8BBF-411F-9C86-472CD1472FDD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoystickInterface", "JoystickInterface\JoystickInterface.csproj", "{0D77953E-FD60-4824-A997-AF72E66EF8C1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
namespace JoystickSample
|
||||
{
|
||||
partial class Axis
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblAxisName = new System.Windows.Forms.Label();
|
||||
this.tbAxisPos = new System.Windows.Forms.TrackBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbAxisPos)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblAxisName
|
||||
//
|
||||
this.lblAxisName.AutoSize = true;
|
||||
this.lblAxisName.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.lblAxisName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblAxisName.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblAxisName.Name = "lblAxisName";
|
||||
this.lblAxisName.Size = new System.Drawing.Size(118, 13);
|
||||
this.lblAxisName.TabIndex = 0;
|
||||
this.lblAxisName.Text = "Axis: # Pos: 32767";
|
||||
//
|
||||
// tbAxisPos
|
||||
//
|
||||
this.tbAxisPos.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbAxisPos.LargeChange = 10000;
|
||||
this.tbAxisPos.Location = new System.Drawing.Point(0, 13);
|
||||
this.tbAxisPos.Maximum = 65535;
|
||||
this.tbAxisPos.Name = "tbAxisPos";
|
||||
this.tbAxisPos.Size = new System.Drawing.Size(179, 36);
|
||||
this.tbAxisPos.SmallChange = 5000;
|
||||
this.tbAxisPos.TabIndex = 1;
|
||||
this.tbAxisPos.TickFrequency = 5000;
|
||||
this.tbAxisPos.Value = 32767;
|
||||
//
|
||||
// Axis
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tbAxisPos);
|
||||
this.Controls.Add(this.lblAxisName);
|
||||
this.Name = "Axis";
|
||||
this.Size = new System.Drawing.Size(179, 49);
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbAxisPos)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblAxisName;
|
||||
private System.Windows.Forms.TrackBar tbAxisPos;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
public partial class Axis : UserControl
|
||||
{
|
||||
public Axis()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private int axisPos = 32767;
|
||||
public int AxisPos
|
||||
{
|
||||
set
|
||||
{
|
||||
lblAxisName.Text = "Axis: " + axisId + " Value: " + value;
|
||||
tbAxisPos.Value = value;
|
||||
axisPos = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int axisId = 0;
|
||||
public int AxisId
|
||||
{
|
||||
set
|
||||
{
|
||||
lblAxisName.Text = "Axis: " + value + " Value: " + axisPos;
|
||||
axisId = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return axisId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
namespace JoystickSample
|
||||
{
|
||||
partial class Button
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnStatus = new System.Windows.Forms.RadioButton();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnStatus
|
||||
//
|
||||
this.btnStatus.AutoSize = true;
|
||||
this.btnStatus.Location = new System.Drawing.Point(3, 3);
|
||||
this.btnStatus.Name = "btnStatus";
|
||||
this.btnStatus.Size = new System.Drawing.Size(66, 17);
|
||||
this.btnStatus.TabIndex = 0;
|
||||
this.btnStatus.TabStop = true;
|
||||
this.btnStatus.Text = "Button #";
|
||||
this.btnStatus.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Button
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btnStatus);
|
||||
this.Name = "Button";
|
||||
this.Size = new System.Drawing.Size(123, 27);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RadioButton btnStatus;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
public partial class Button : UserControl
|
||||
{
|
||||
public Button()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private int buttonId;
|
||||
public int ButtonId
|
||||
{
|
||||
get { return buttonId; }
|
||||
set
|
||||
{
|
||||
buttonId = value;
|
||||
btnStatus.Text = "Button " + value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool buttonStatus;
|
||||
public bool ButtonStatus
|
||||
{
|
||||
get { return buttonStatus; }
|
||||
set
|
||||
{
|
||||
buttonStatus = value;
|
||||
btnStatus.Checked = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{94C0EC44-8BBF-411F-9C86-472CD1472FDD}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>JoystickSample</RootNamespace>
|
||||
<AssemblyName>JoystickSample</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Axis.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Axis.Designer.cs">
|
||||
<DependentUpon>Axis.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Button.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Button.Designer.cs">
|
||||
<DependentUpon>Button.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.Designer.cs">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Axis.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>Axis.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Button.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>Button.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmMain.resx">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</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>
|
||||
</Compile>
|
||||
<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>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\JoystickInterface\JoystickInterface.csproj">
|
||||
<Project>{0D77953E-FD60-4824-A997-AF72E66EF8C1}</Project>
|
||||
<Name>JoystickInterface</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new frmMain());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
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("JoystickSample")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("JoystickSample")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2006")]
|
||||
[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("6d777e45-9a56-4669-beb2-e7d53fa83223")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
Exemplos/joystick-src/Backup/JoystickSample/Properties/Resources.Designer.cs
generated
Normal file
71
Exemplos/joystick-src/Backup/JoystickSample/Properties/Resources.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace JoystickSample.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JoystickSample.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
Exemplos/joystick-src/Backup/JoystickSample/Properties/Settings.Designer.cs
generated
Normal file
30
Exemplos/joystick-src/Backup/JoystickSample/Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace JoystickSample.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
namespace JoystickSample
|
||||
{
|
||||
partial class frmMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.flpAxes = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.tmrUpdateStick = new System.Windows.Forms.Timer(this.components);
|
||||
this.flpButtons = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flpAxes
|
||||
//
|
||||
this.flpAxes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.flpAxes.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flpAxes.Location = new System.Drawing.Point(12, 12);
|
||||
this.flpAxes.Name = "flpAxes";
|
||||
this.flpAxes.Size = new System.Drawing.Size(242, 345);
|
||||
this.flpAxes.TabIndex = 0;
|
||||
//
|
||||
// tmrUpdateStick
|
||||
//
|
||||
this.tmrUpdateStick.Tick += new System.EventHandler(this.tmrUpdateStick_Tick);
|
||||
//
|
||||
// flpButtons
|
||||
//
|
||||
this.flpButtons.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.flpButtons.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flpButtons.Location = new System.Drawing.Point(260, 12);
|
||||
this.flpButtons.Name = "flpButtons";
|
||||
this.flpButtons.Size = new System.Drawing.Size(427, 345);
|
||||
this.flpButtons.TabIndex = 1;
|
||||
//
|
||||
// frmMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(699, 369);
|
||||
this.Controls.Add(this.flpButtons);
|
||||
this.Controls.Add(this.flpAxes);
|
||||
this.Name = "frmMain";
|
||||
this.Text = "Joystick Test Form";
|
||||
this.Load += new System.EventHandler(this.frmMain_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flpAxes;
|
||||
private System.Windows.Forms.Timer tmrUpdateStick;
|
||||
private System.Windows.Forms.FlowLayoutPanel flpButtons;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
private JoystickInterface.Joystick jst;
|
||||
|
||||
public frmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
// grab the joystick
|
||||
jst = new JoystickInterface.Joystick(this.Handle);
|
||||
string[] sticks = jst.FindJoysticks();
|
||||
jst.AcquireJoystick(sticks[0]);
|
||||
|
||||
// add the axis controls to the axis container
|
||||
for (int i = 0; i < jst.AxisCount; i++)
|
||||
{
|
||||
Axis ax = new Axis();
|
||||
ax.AxisId = i + 1;
|
||||
flpAxes.Controls.Add(ax);
|
||||
}
|
||||
|
||||
// add the button controls to the button container
|
||||
for (int i = 0; i < jst.Buttons.Length; i++)
|
||||
{
|
||||
JoystickSample.Button btn = new Button();
|
||||
btn.ButtonId = i + 1;
|
||||
btn.ButtonStatus = jst.Buttons[i];
|
||||
flpButtons.Controls.Add(btn);
|
||||
}
|
||||
|
||||
// start updating positions
|
||||
tmrUpdateStick.Enabled = true;
|
||||
}
|
||||
|
||||
private void tmrUpdateStick_Tick(object sender, EventArgs e)
|
||||
{
|
||||
// get status
|
||||
jst.UpdateStatus();
|
||||
|
||||
// update the axes positions
|
||||
foreach (Control ax in flpAxes.Controls)
|
||||
{
|
||||
if (ax is Axis)
|
||||
{
|
||||
switch (((Axis)ax).AxisId)
|
||||
{
|
||||
case 1:
|
||||
((Axis)ax).AxisPos = jst.AxisA;
|
||||
break;
|
||||
case 2:
|
||||
((Axis)ax).AxisPos = jst.AxisB;
|
||||
break;
|
||||
case 3:
|
||||
((Axis)ax).AxisPos = jst.AxisC;
|
||||
break;
|
||||
case 4:
|
||||
((Axis)ax).AxisPos = jst.AxisD;
|
||||
break;
|
||||
case 5:
|
||||
((Axis)ax).AxisPos = jst.AxisE;
|
||||
break;
|
||||
case 6:
|
||||
((Axis)ax).AxisPos = jst.AxisF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update each button status
|
||||
foreach (Control btn in flpButtons.Controls)
|
||||
{
|
||||
if (btn is JoystickSample.Button)
|
||||
{
|
||||
((JoystickSample.Button)btn).ButtonStatus =
|
||||
jst.Buttons[((JoystickSample.Button)btn).ButtonId - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="tmrUpdateStick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||
<Font Name="Tahoma" Size="8.25" />
|
||||
<Class Name="JoystickInterface.Joystick">
|
||||
<Position X="0.5" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<FileName>Joystick.cs</FileName>
|
||||
<HashCode>AEAAAAAEAAAgAABAIAAAYAAgFAAAaJIEKEACAAhAAAg=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
</ClassDiagram>
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
/******************************************************************************
|
||||
* C# Joystick Library - Copyright (c) 2006 Mark Harris - MarkH@rris.com.au
|
||||
******************************************************************************
|
||||
* You may use this library in your application, however please do give credit
|
||||
* to me for writing it and supplying it. If you modify this library you must
|
||||
* leave this notice at the top of this file. I'd love to see any changes you
|
||||
* do make, so please email them to me :)
|
||||
*****************************************************************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.DirectX.DirectInput;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace JoystickInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to interface with a joystick device.
|
||||
/// </summary>
|
||||
public class Joystick
|
||||
{
|
||||
private Device joystickDevice;
|
||||
private JoystickState state;
|
||||
|
||||
private int axisCount;
|
||||
/// <summary>
|
||||
/// Number of axes on the joystick.
|
||||
/// </summary>
|
||||
public int AxisCount
|
||||
{
|
||||
get { return axisCount; }
|
||||
}
|
||||
|
||||
private int axisA;
|
||||
/// <summary>
|
||||
/// The first axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisA
|
||||
{
|
||||
get { return axisA; }
|
||||
}
|
||||
|
||||
private int axisB;
|
||||
/// <summary>
|
||||
/// The second axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisB
|
||||
{
|
||||
get { return axisB; }
|
||||
}
|
||||
|
||||
private int axisC;
|
||||
/// <summary>
|
||||
/// The third axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisC
|
||||
{
|
||||
get { return axisC; }
|
||||
}
|
||||
|
||||
private int axisD;
|
||||
/// <summary>
|
||||
/// The fourth axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisD
|
||||
{
|
||||
get { return axisD; }
|
||||
}
|
||||
|
||||
private int axisE;
|
||||
/// <summary>
|
||||
/// The fifth axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisE
|
||||
{
|
||||
get { return axisE; }
|
||||
}
|
||||
|
||||
private int axisF;
|
||||
/// <summary>
|
||||
/// The sixth axis on the joystick.
|
||||
/// </summary>
|
||||
public int AxisF
|
||||
{
|
||||
get { return axisF; }
|
||||
}
|
||||
private IntPtr hWnd;
|
||||
|
||||
private bool[] buttons;
|
||||
/// <summary>
|
||||
/// Array of buttons availiable on the joystick. This also includes PoV hats.
|
||||
/// </summary>
|
||||
public bool[] Buttons
|
||||
{
|
||||
get { return buttons; }
|
||||
}
|
||||
|
||||
private string[] systemJoysticks;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the class.
|
||||
/// </summary>
|
||||
/// <param name="window_handle">Handle of the window which the joystick will be "attached" to.</param>
|
||||
public Joystick(IntPtr window_handle)
|
||||
{
|
||||
hWnd = window_handle;
|
||||
axisA = -1;
|
||||
axisB = -1;
|
||||
axisC = -1;
|
||||
axisD = -1;
|
||||
axisE = -1;
|
||||
axisF = -1;
|
||||
axisCount = 0;
|
||||
}
|
||||
|
||||
private void Poll()
|
||||
{
|
||||
try
|
||||
{
|
||||
// poll the joystick
|
||||
joystickDevice.Poll();
|
||||
// update the joystick state field
|
||||
state = joystickDevice.CurrentJoystickState;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
// we probably lost connection to the joystick
|
||||
// was it unplugged or locked by another application?
|
||||
Debug.WriteLine("Poll()");
|
||||
Debug.WriteLine(err.Message);
|
||||
Debug.WriteLine(err.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a list of joysticks attached to the computer.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// [C#]
|
||||
/// <code>
|
||||
/// JoystickInterface.Joystick jst = new JoystickInterface.Joystick(this.Handle);
|
||||
/// string[] sticks = jst.FindJoysticks();
|
||||
/// </code>
|
||||
/// </example>
|
||||
/// <returns>A list of joysticks as an array of strings.</returns>
|
||||
public string[] FindJoysticks()
|
||||
{
|
||||
systemJoysticks = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Find all the GameControl devices that are attached.
|
||||
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
|
||||
|
||||
// check that we have at least one device.
|
||||
if (gameControllerList.Count > 0)
|
||||
{
|
||||
systemJoysticks = new string[gameControllerList.Count];
|
||||
int i = 0;
|
||||
// loop through the devices.
|
||||
foreach (DeviceInstance deviceInstance in gameControllerList)
|
||||
{
|
||||
// create a device from this controller so we can retrieve info.
|
||||
joystickDevice = new Device(deviceInstance.InstanceGuid);
|
||||
joystickDevice.SetCooperativeLevel(hWnd,
|
||||
CooperativeLevelFlags.Background |
|
||||
CooperativeLevelFlags.NonExclusive);
|
||||
|
||||
systemJoysticks[i] = joystickDevice.DeviceInformation.InstanceName;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Debug.WriteLine("FindJoysticks()");
|
||||
Debug.WriteLine(err.Message);
|
||||
Debug.WriteLine(err.StackTrace);
|
||||
}
|
||||
|
||||
return systemJoysticks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Acquire the named joystick. You can find this joystick through the <see cref="FindJoysticks"/> method.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the joystick.</param>
|
||||
/// <returns>The success of the connection.</returns>
|
||||
public bool AcquireJoystick(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
// loop through the devices.
|
||||
foreach (DeviceInstance deviceInstance in gameControllerList)
|
||||
{
|
||||
if (deviceInstance.InstanceName == name)
|
||||
{
|
||||
found = true;
|
||||
// create a device from this controller so we can retrieve info.
|
||||
joystickDevice = new Device(deviceInstance.InstanceGuid);
|
||||
joystickDevice.SetCooperativeLevel(hWnd,
|
||||
CooperativeLevelFlags.Background |
|
||||
CooperativeLevelFlags.NonExclusive);
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return false;
|
||||
|
||||
// Tell DirectX that this is a Joystick.
|
||||
joystickDevice.SetDataFormat(DeviceDataFormat.Joystick);
|
||||
|
||||
// Finally, acquire the device.
|
||||
joystickDevice.Acquire();
|
||||
|
||||
// How many axes?
|
||||
// Find the capabilities of the joystick
|
||||
DeviceCaps cps = joystickDevice.Caps;
|
||||
Debug.WriteLine("Joystick Axis: " + cps.NumberAxes);
|
||||
Debug.WriteLine("Joystick Buttons: " + cps.NumberButtons);
|
||||
|
||||
axisCount = cps.NumberAxes;
|
||||
|
||||
UpdateStatus();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Debug.WriteLine("FindJoysticks()");
|
||||
Debug.WriteLine(err.Message);
|
||||
Debug.WriteLine(err.StackTrace);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unaquire a joystick releasing it back to the system.
|
||||
/// </summary>
|
||||
public void ReleaseJoystick()
|
||||
{
|
||||
joystickDevice.Unacquire();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the properties of button and axis positions.
|
||||
/// </summary>
|
||||
public void UpdateStatus()
|
||||
{
|
||||
Poll();
|
||||
|
||||
int[] extraAxis = state.GetSlider();
|
||||
//Rz Rx X Y Axis1 Axis2
|
||||
axisA = state.Rz;
|
||||
axisB = state.Rx;
|
||||
axisC = state.X;
|
||||
axisD = state.Y;
|
||||
axisE = extraAxis[0];
|
||||
axisF = extraAxis[1];
|
||||
|
||||
// not using buttons, so don't take the tiny amount of time it takes to get/parse
|
||||
byte[] jsButtons = state.GetButtons();
|
||||
buttons = new bool[jsButtons.Length];
|
||||
|
||||
int i = 0;
|
||||
foreach (byte button in jsButtons)
|
||||
{
|
||||
buttons[i] = button >= 128;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="Current">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0D77953E-FD60-4824-A997-AF72E66EF8C1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>JoystickInterface</RootNamespace>
|
||||
<AssemblyName>JoystickInterface</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Debug\JoystickInterface.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\JoystickInterface.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CefSharp">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\CefSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Core">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\CefSharp.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.WinForms">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\CefSharp.WinForms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.DirectX">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\Microsoft.DirectX.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\Microsoft.DirectX.DirectInput.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Win32.Primitives">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\Microsoft.Win32.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenCvSharp">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\OpenCvSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenCvSharp.Blob">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\OpenCvSharp.Blob.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenCvSharp.Extensions">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\OpenCvSharp.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenCvSharp.UserInterface">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\OpenCvSharp.UserInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.AppContext">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.AppContext.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Console">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Console.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Device" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Globalization.Calendars">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Globalization.Calendars.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.IO.Compression.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression.ZipFile">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.IO.Compression.ZipFile.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.IO.FileSystem.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.Primitives">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.IO.FileSystem.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Net.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Sockets">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Net.Sockets.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Encoding">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Security.Cryptography.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates">
|
||||
<HintPath>..\..\..\..\oriontardpro\Tardigrado\OrionTardPro\OrionTardPro\bin\Debug\System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Joystick.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
</ItemGroup>
|
||||
<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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
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("JoystickInterface")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("JoystickInterface")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2006")]
|
||||
[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("5d26dd3c-c2bf-4730-9025-658cca9b563e")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>JoystickInterface</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:JoystickInterface.Joystick">
|
||||
<summary>
|
||||
Class to interface with a joystick device.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisCount">
|
||||
<summary>
|
||||
Number of axes on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisA">
|
||||
<summary>
|
||||
The first axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisB">
|
||||
<summary>
|
||||
The second axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisC">
|
||||
<summary>
|
||||
The third axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisD">
|
||||
<summary>
|
||||
The fourth axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisE">
|
||||
<summary>
|
||||
The fifth axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisF">
|
||||
<summary>
|
||||
The sixth axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.Buttons">
|
||||
<summary>
|
||||
Array of buttons availiable on the joystick. This also includes PoV hats.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.#ctor(System.IntPtr)">
|
||||
<summary>
|
||||
Constructor for the class.
|
||||
</summary>
|
||||
<param name="window_handle">Handle of the window which the joystick will be "attached" to.</param>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.FindJoysticks">
|
||||
<summary>
|
||||
Retrieves a list of joysticks attached to the computer.
|
||||
</summary>
|
||||
<example>
|
||||
[C#]
|
||||
<code>
|
||||
JoystickInterface.Joystick jst = new JoystickInterface.Joystick(this.Handle);
|
||||
string[] sticks = jst.FindJoysticks();
|
||||
</code>
|
||||
</example>
|
||||
<returns>A list of joysticks as an array of strings.</returns>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.AcquireJoystick(System.String)">
|
||||
<summary>
|
||||
Acquire the named joystick. You can find this joystick through the <see cref="M:JoystickInterface.Joystick.FindJoysticks"/> method.
|
||||
</summary>
|
||||
<param name="name">Name of the joystick.</param>
|
||||
<returns>The success of the connection.</returns>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.ReleaseJoystick">
|
||||
<summary>
|
||||
Unaquire a joystick releasing it back to the system.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.UpdateStatus">
|
||||
<summary>
|
||||
Update the properties of button and axis positions.
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>JoystickInterface</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:JoystickInterface.Joystick">
|
||||
<summary>
|
||||
Class to interface with a joystick device.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.#ctor(System.IntPtr)">
|
||||
<summary>
|
||||
Constructor for the class.
|
||||
</summary>
|
||||
<param name="window_handle">Handle of the window which the joystick will be "attached" to.</param>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.FindJoysticks">
|
||||
<summary>
|
||||
Retrieves a list of joysticks attached to the computer.
|
||||
</summary>
|
||||
<example>
|
||||
[C#]
|
||||
<code>
|
||||
JoystickInterface.Joystick jst = new JoystickInterface.Joystick(this.Handle);
|
||||
string[] sticks = jst.FindJoysticks();
|
||||
</code>
|
||||
</example>
|
||||
<returns>A list of joysticks as an array of strings.</returns>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.AcquireJoystick(System.String)">
|
||||
<summary>
|
||||
Acquire the named joystick. You can find this joystick through the <see cref="M:JoystickInterface.Joystick.FindJoysticks"/> method.
|
||||
</summary>
|
||||
<param name="name">Name of the joystick.</param>
|
||||
<returns>The success of the connection.</returns>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.ReleaseJoystick">
|
||||
<summary>
|
||||
Unaquire a joystick releasing it back to the system.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:JoystickInterface.Joystick.UpdateStatus">
|
||||
<summary>
|
||||
Update the properties of button and axis positions.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisCount">
|
||||
<summary>
|
||||
Number of axes on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisA">
|
||||
<summary>
|
||||
The first axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisB">
|
||||
<summary>
|
||||
The second axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisC">
|
||||
<summary>
|
||||
The third axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisD">
|
||||
<summary>
|
||||
The fourth axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisE">
|
||||
<summary>
|
||||
The fifth axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.AxisF">
|
||||
<summary>
|
||||
The sixth axis on the joystick.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JoystickInterface.Joystick.Buttons">
|
||||
<summary>
|
||||
Array of buttons availiable on the joystick. This also includes PoV hats.
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
|||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
744bdeb8b47895e9ea5448019523f4884a23e5be
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\obj\Debug\JoystickInterface.csproj.AssemblyReference.cache
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\obj\Debug\JoystickInterface.csproj.CoreCompileInputs.cache
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\JoystickInterface.XML
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\JoystickInterface.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\JoystickInterface.pdb
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\Microsoft.DirectX.DirectInput.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\obj\Debug\JoystickInterface.csproj.CopyComplete
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\obj\Debug\JoystickInterface.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\obj\Debug\JoystickInterface.pdb
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\Microsoft.DirectX.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\Microsoft.DirectX.xml
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\Microsoft.Win32.Primitives.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.AppContext.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Console.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Globalization.Calendars.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.IO.Compression.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.IO.FileSystem.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.IO.FileSystem.Primitives.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Net.Sockets.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Security.Cryptography.Algorithms.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Security.Cryptography.Encoding.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Security.Cryptography.Primitives.dll
|
||||
C:\Zendion Inc\agrobot_base\Exemplos\joystick-src\JoystickInterface\bin\Debug\System.Security.Cryptography.X509Certificates.dll
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32228.343
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoystickSample", "JoystickSample\JoystickSample.csproj", "{94C0EC44-8BBF-411F-9C86-472CD1472FDD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoystickInterface", "JoystickInterface\JoystickInterface.csproj", "{0D77953E-FD60-4824-A997-AF72E66EF8C1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{94C0EC44-8BBF-411F-9C86-472CD1472FDD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0D77953E-FD60-4824-A997-AF72E66EF8C1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E8F3CA20-8308-4024-80AF-F3678496BB5A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
namespace JoystickSample
|
||||
{
|
||||
partial class Axis
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblAxisName = new System.Windows.Forms.Label();
|
||||
this.tbAxisPos = new System.Windows.Forms.TrackBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbAxisPos)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblAxisName
|
||||
//
|
||||
this.lblAxisName.AutoSize = true;
|
||||
this.lblAxisName.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.lblAxisName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblAxisName.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblAxisName.Name = "lblAxisName";
|
||||
this.lblAxisName.Size = new System.Drawing.Size(118, 13);
|
||||
this.lblAxisName.TabIndex = 0;
|
||||
this.lblAxisName.Text = "Axis: # Pos: 32767";
|
||||
//
|
||||
// tbAxisPos
|
||||
//
|
||||
this.tbAxisPos.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbAxisPos.LargeChange = 10000;
|
||||
this.tbAxisPos.Location = new System.Drawing.Point(0, 13);
|
||||
this.tbAxisPos.Maximum = 65535;
|
||||
this.tbAxisPos.Name = "tbAxisPos";
|
||||
this.tbAxisPos.Size = new System.Drawing.Size(179, 36);
|
||||
this.tbAxisPos.SmallChange = 5000;
|
||||
this.tbAxisPos.TabIndex = 1;
|
||||
this.tbAxisPos.TickFrequency = 5000;
|
||||
this.tbAxisPos.Value = 32767;
|
||||
//
|
||||
// Axis
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tbAxisPos);
|
||||
this.Controls.Add(this.lblAxisName);
|
||||
this.Name = "Axis";
|
||||
this.Size = new System.Drawing.Size(179, 49);
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbAxisPos)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblAxisName;
|
||||
private System.Windows.Forms.TrackBar tbAxisPos;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
public partial class Axis : UserControl
|
||||
{
|
||||
public Axis()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private int axisPos = 32767;
|
||||
public int AxisPos
|
||||
{
|
||||
set
|
||||
{
|
||||
lblAxisName.Text = "Axis: " + axisId + " Value: " + value;
|
||||
tbAxisPos.Value = value;
|
||||
axisPos = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int axisId = 0;
|
||||
public int AxisId
|
||||
{
|
||||
set
|
||||
{
|
||||
lblAxisName.Text = "Axis: " + value + " Value: " + axisPos;
|
||||
axisId = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return axisId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
namespace JoystickSample
|
||||
{
|
||||
partial class Button
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnStatus = new System.Windows.Forms.RadioButton();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnStatus
|
||||
//
|
||||
this.btnStatus.AutoSize = true;
|
||||
this.btnStatus.Location = new System.Drawing.Point(3, 3);
|
||||
this.btnStatus.Name = "btnStatus";
|
||||
this.btnStatus.Size = new System.Drawing.Size(66, 17);
|
||||
this.btnStatus.TabIndex = 0;
|
||||
this.btnStatus.TabStop = true;
|
||||
this.btnStatus.Text = "Button #";
|
||||
this.btnStatus.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Button
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btnStatus);
|
||||
this.Name = "Button";
|
||||
this.Size = new System.Drawing.Size(123, 27);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RadioButton btnStatus;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
public partial class Button : UserControl
|
||||
{
|
||||
public Button()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private int buttonId;
|
||||
public int ButtonId
|
||||
{
|
||||
get { return buttonId; }
|
||||
set
|
||||
{
|
||||
buttonId = value;
|
||||
btnStatus.Text = "Button " + value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool buttonStatus;
|
||||
public bool ButtonStatus
|
||||
{
|
||||
get { return buttonStatus; }
|
||||
set
|
||||
{
|
||||
buttonStatus = value;
|
||||
btnStatus.Checked = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
namespace JoystickSample
|
||||
{
|
||||
partial class JoystickAxis
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblAxis = new System.Windows.Forms.Label();
|
||||
this.trkPos = new System.Windows.Forms.TrackBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trkPos)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblAxis
|
||||
//
|
||||
this.lblAxis.AutoSize = true;
|
||||
this.lblAxis.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblAxis.Location = new System.Drawing.Point(3, 0);
|
||||
this.lblAxis.Name = "lblAxis";
|
||||
this.lblAxis.Size = new System.Drawing.Size(43, 13);
|
||||
this.lblAxis.TabIndex = 0;
|
||||
this.lblAxis.Text = "Axis N";
|
||||
//
|
||||
// trkPos
|
||||
//
|
||||
this.trkPos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.trkPos.LargeChange = 3120;
|
||||
this.trkPos.Location = new System.Drawing.Point(3, 16);
|
||||
this.trkPos.Maximum = 65535;
|
||||
this.trkPos.Name = "trkPos";
|
||||
this.trkPos.Size = new System.Drawing.Size(190, 45);
|
||||
this.trkPos.SmallChange = 1500;
|
||||
this.trkPos.TabIndex = 1;
|
||||
this.trkPos.TickFrequency = 3120;
|
||||
this.trkPos.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
|
||||
this.trkPos.Value = 32500;
|
||||
//
|
||||
// JoystickAxis
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.trkPos);
|
||||
this.Controls.Add(this.lblAxis);
|
||||
this.Name = "JoystickAxis";
|
||||
this.Size = new System.Drawing.Size(196, 60);
|
||||
((System.ComponentModel.ISupportInitialize)(this.trkPos)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblAxis;
|
||||
private System.Windows.Forms.TrackBar trkPos;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JoystickSample
|
||||
{
|
||||
public partial class JoystickAxis : UserControl
|
||||
{
|
||||
public JoystickAxis()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="Current">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{94C0EC44-8BBF-411F-9C86-472CD1472FDD}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>JoystickSample</RootNamespace>
|
||||
<AssemblyName>JoystickSample</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Axis.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Axis.Designer.cs">
|
||||
<DependentUpon>Axis.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Button.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Button.Designer.cs">
|
||||
<DependentUpon>Button.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.Designer.cs">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Axis.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>Axis.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Button.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>Button.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmMain.resx">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</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="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>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\JoystickInterface\JoystickInterface.csproj">
|
||||
<Project>{0D77953E-FD60-4824-A997-AF72E66EF8C1}</Project>
|
||||
<Name>JoystickInterface</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue