moved libs to the lib directory
This commit is contained in:
84
lib/SDK/examples/cs/e502_eth_svc_browse/Program.cs
Normal file
84
lib/SDK/examples/cs/e502_eth_svc_browse/Program.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using lpcieapi;
|
||||
using x502api;
|
||||
|
||||
/* Данный пример представляет из себя консольную программу на языке C#,
|
||||
демонстрирующую, как можно выполнить поиск устройств E502 в локальной сети.
|
||||
|
||||
Пример запускается и непрерывно отслеживает появление (или исчезновение)
|
||||
устройств в локальной сети, выводя информацию на консоль.
|
||||
|
||||
Поиск выполняется до нажатия любой клавиши. */
|
||||
namespace e502_eth_svc_browse
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
/* функции для поиска представлены в виде методов отдельного класса EthSvcBrowser */
|
||||
E502.EthSvcBrowser sb = new E502.EthSvcBrowser();
|
||||
/* запуск поиска сервисов */
|
||||
lpcie.Errs err = sb.Start();
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
Console.WriteLine("Ошибка запуска поиска устройств в сети {0}: {1}", err, X502.GetErrorString(err));
|
||||
}
|
||||
else
|
||||
{
|
||||
bool end = false;
|
||||
Console.WriteLine("Запущен поиск устройств в локальной сети. Для останова нажмите любую клавишу");
|
||||
|
||||
while (!end && (err == lpcie.Errs.OK))
|
||||
{
|
||||
E502.EthSvcEvent svc_evt;
|
||||
/* Метод EthSvcRecord предоставляет доступ ко функциям для работы с описателем сервиса.
|
||||
* В отличие от С не нужно освобождать память вручную, т.к. освобождение выполняется
|
||||
* в деструкторе */
|
||||
E502.EthSvcRecord svc_rec;
|
||||
err = sb.GetEvent(out svc_rec, out svc_evt, 300);
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
Console.WriteLine("Ошибка получения записи о найденном устройстве {0}: {1}", err, X502.GetErrorString(err));
|
||||
}
|
||||
else if (svc_evt != E502.EthSvcEvent.NONE)
|
||||
{
|
||||
/* Адрес мы можем получить только для присутствующего устройства */
|
||||
if ((svc_evt == E502.EthSvcEvent.ADD) || (svc_evt == E502.EthSvcEvent.CHANGED))
|
||||
{
|
||||
IPAddress addr;
|
||||
lpcie.Errs cur_err = svc_rec.ResolveIPv4Addr(out addr, 2000);
|
||||
if (cur_err != lpcie.Errs.OK)
|
||||
{
|
||||
Console.WriteLine("Ошибка получения IP-адреса устройтсва {0}: {1}", cur_err, X502.GetErrorString(cur_err));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("{0}: {1}, S/N: {2}, Адрес = {3}", svc_evt == E502.EthSvcEvent.ADD ?
|
||||
"Новое устройтсво" : "Изм. параметров", svc_rec.InstanceName, svc_rec.DevSerial, addr.ToString());
|
||||
}
|
||||
}
|
||||
else if (svc_evt == E502.EthSvcEvent.REMOVE)
|
||||
{
|
||||
Console.WriteLine("Устройство отключено: {0}, S/N: {1}", svc_rec.InstanceName, svc_rec.DevSerial);
|
||||
}
|
||||
}
|
||||
|
||||
/* вход по нажатию клавиши */
|
||||
if (Console.KeyAvailable)
|
||||
end = true;
|
||||
}
|
||||
|
||||
lpcie.Errs stop_err = sb.Stop();
|
||||
if (stop_err != lpcie.Errs.OK)
|
||||
{
|
||||
Console.WriteLine("Ошибка останова поиска сервисов {0}: {1}", stop_err, X502.GetErrorString(stop_err));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Останов поиска сервисов выполнен успешно!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("e502_eth_svc_browse")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("e502_eth_svc_browse")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[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("c7548c80-fc0f-4cb6-a4ed-355b7e40c86d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{714093CB-3EAA-464F-9D27-8E91381E0651}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>e502_eth_svc_browse</RootNamespace>
|
||||
<AssemblyName>e502_eth_svc_browse</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="lpcieNet, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lpcieNet\bin\Release\lpcieNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
955
lib/SDK/examples/cs/x502_general/MainForm.Designer.cs
generated
Normal file
955
lib/SDK/examples/cs/x502_general/MainForm.Designer.cs
generated
Normal file
@ -0,0 +1,955 @@
|
||||
namespace x502_example
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnRefreshDeviceList = new System.Windows.Forms.Button();
|
||||
this.cbbSerialList = new System.Windows.Forms.ComboBox();
|
||||
this.btnOpen = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.edtPldaVer = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.edtFpgaVer = new System.Windows.Forms.TextBox();
|
||||
this.chkBfPresent = new System.Windows.Forms.CheckBox();
|
||||
this.chkGalPresent = new System.Windows.Forms.CheckBox();
|
||||
this.chkDacPresent = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.btnSetAdcFreq = new System.Windows.Forms.Button();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.edtDinFreq = new System.Windows.Forms.TextBox();
|
||||
this.edtAdcFreqLch = new System.Windows.Forms.TextBox();
|
||||
this.edtAdcFreq = new System.Windows.Forms.TextBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.chkSyncDin = new System.Windows.Forms.CheckBox();
|
||||
this.edtDin_Result = new System.Windows.Forms.TextBox();
|
||||
this.edtLCh3_Result = new System.Windows.Forms.TextBox();
|
||||
this.edtLCh2_Result = new System.Windows.Forms.TextBox();
|
||||
this.cbbLCh3_Mode = new System.Windows.Forms.ComboBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.cbbLCh3_Range = new System.Windows.Forms.ComboBox();
|
||||
this.cbbLCh2_Mode = new System.Windows.Forms.ComboBox();
|
||||
this.cbbLCh3_Channel = new System.Windows.Forms.ComboBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.cbbLCh2_Range = new System.Windows.Forms.ComboBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.cbbLCh2_Channel = new System.Windows.Forms.ComboBox();
|
||||
this.edtLCh1_Result = new System.Windows.Forms.TextBox();
|
||||
this.cbbLCh1_Mode = new System.Windows.Forms.ComboBox();
|
||||
this.cbbLCh1_Range = new System.Windows.Forms.ComboBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.cbbLCh1_Channel = new System.Windows.Forms.ComboBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.cbbLChCnt = new System.Windows.Forms.ComboBox();
|
||||
this.btnStart = new System.Windows.Forms.Button();
|
||||
this.btnStop = new System.Windows.Forms.Button();
|
||||
this.btnAsyncAdcFrame = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.cbbSyncStartMode = new System.Windows.Forms.ComboBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.cbbSyncMode = new System.Windows.Forms.ComboBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.btnAsyncDigIn = new System.Windows.Forms.Button();
|
||||
this.btnAsyncDigOut = new System.Windows.Forms.Button();
|
||||
this.btnAsyncDac1 = new System.Windows.Forms.Button();
|
||||
this.btnAsyncDac2 = new System.Windows.Forms.Button();
|
||||
this.edtAsyncDigIn = new System.Windows.Forms.TextBox();
|
||||
this.edtAsyncDigOut = new System.Windows.Forms.TextBox();
|
||||
this.edtAsyncDac1 = new System.Windows.Forms.TextBox();
|
||||
this.edtAsyncDac2 = new System.Windows.Forms.TextBox();
|
||||
this.chkEthSupport = new System.Windows.Forms.CheckBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.edtMcuVer = new System.Windows.Forms.TextBox();
|
||||
this.edtIpAddr = new System.Windows.Forms.TextBox();
|
||||
this.btnOpenByIP = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnRefreshDeviceList
|
||||
//
|
||||
this.btnRefreshDeviceList.Location = new System.Drawing.Point(27, 12);
|
||||
this.btnRefreshDeviceList.Name = "btnRefreshDeviceList";
|
||||
this.btnRefreshDeviceList.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnRefreshDeviceList.TabIndex = 0;
|
||||
this.btnRefreshDeviceList.Text = "Обновить список модулей";
|
||||
this.btnRefreshDeviceList.UseVisualStyleBackColor = true;
|
||||
this.btnRefreshDeviceList.Click += new System.EventHandler(this.btnRefreshDeviceList_Click);
|
||||
//
|
||||
// cbbSerialList
|
||||
//
|
||||
this.cbbSerialList.FormattingEnabled = true;
|
||||
this.cbbSerialList.Location = new System.Drawing.Point(258, 14);
|
||||
this.cbbSerialList.Name = "cbbSerialList";
|
||||
this.cbbSerialList.Size = new System.Drawing.Size(139, 21);
|
||||
this.cbbSerialList.TabIndex = 1;
|
||||
//
|
||||
// btnOpen
|
||||
//
|
||||
this.btnOpen.Location = new System.Drawing.Point(27, 55);
|
||||
this.btnOpen.Name = "btnOpen";
|
||||
this.btnOpen.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnOpen.TabIndex = 2;
|
||||
this.btnOpen.Text = "Установить связь с модулем";
|
||||
this.btnOpen.UseVisualStyleBackColor = true;
|
||||
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.label13);
|
||||
this.groupBox1.Controls.Add(this.edtMcuVer);
|
||||
this.groupBox1.Controls.Add(this.chkEthSupport);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Controls.Add(this.edtPldaVer);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Controls.Add(this.edtFpgaVer);
|
||||
this.groupBox1.Controls.Add(this.chkBfPresent);
|
||||
this.groupBox1.Controls.Add(this.chkGalPresent);
|
||||
this.groupBox1.Controls.Add(this.chkDacPresent);
|
||||
this.groupBox1.Location = new System.Drawing.Point(258, 40);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(230, 183);
|
||||
this.groupBox1.TabIndex = 3;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Информация о модуле";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(74, 131);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(128, 13);
|
||||
this.label2.TabIndex = 8;
|
||||
this.label2.Text = "Версия прошивки PLDA";
|
||||
//
|
||||
// edtPldaVer
|
||||
//
|
||||
this.edtPldaVer.Enabled = false;
|
||||
this.edtPldaVer.Location = new System.Drawing.Point(6, 128);
|
||||
this.edtPldaVer.Name = "edtPldaVer";
|
||||
this.edtPldaVer.Size = new System.Drawing.Size(62, 20);
|
||||
this.edtPldaVer.TabIndex = 7;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(74, 105);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(131, 13);
|
||||
this.label1.TabIndex = 6;
|
||||
this.label1.Text = "Версия прошивки ПЛИС";
|
||||
//
|
||||
// edtFpgaVer
|
||||
//
|
||||
this.edtFpgaVer.Enabled = false;
|
||||
this.edtFpgaVer.Location = new System.Drawing.Point(6, 102);
|
||||
this.edtFpgaVer.Name = "edtFpgaVer";
|
||||
this.edtFpgaVer.Size = new System.Drawing.Size(62, 20);
|
||||
this.edtFpgaVer.TabIndex = 5;
|
||||
//
|
||||
// chkBfPresent
|
||||
//
|
||||
this.chkBfPresent.AutoSize = true;
|
||||
this.chkBfPresent.Enabled = false;
|
||||
this.chkBfPresent.Location = new System.Drawing.Point(6, 65);
|
||||
this.chkBfPresent.Name = "chkBfPresent";
|
||||
this.chkBfPresent.Size = new System.Drawing.Size(199, 17);
|
||||
this.chkBfPresent.TabIndex = 4;
|
||||
this.chkBfPresent.Text = "Наличие сигнального процессора";
|
||||
this.chkBfPresent.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkGalPresent
|
||||
//
|
||||
this.chkGalPresent.AutoSize = true;
|
||||
this.chkGalPresent.Enabled = false;
|
||||
this.chkGalPresent.Location = new System.Drawing.Point(6, 42);
|
||||
this.chkGalPresent.Name = "chkGalPresent";
|
||||
this.chkGalPresent.Size = new System.Drawing.Size(167, 17);
|
||||
this.chkGalPresent.TabIndex = 1;
|
||||
this.chkGalPresent.Text = "Наличие гальваноразвязки";
|
||||
this.chkGalPresent.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkDacPresent
|
||||
//
|
||||
this.chkDacPresent.AutoSize = true;
|
||||
this.chkDacPresent.Enabled = false;
|
||||
this.chkDacPresent.Location = new System.Drawing.Point(6, 19);
|
||||
this.chkDacPresent.Name = "chkDacPresent";
|
||||
this.chkDacPresent.Size = new System.Drawing.Size(95, 17);
|
||||
this.chkDacPresent.TabIndex = 0;
|
||||
this.chkDacPresent.Text = "Наличие ЦАП";
|
||||
this.chkDacPresent.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.btnSetAdcFreq);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Controls.Add(this.label3);
|
||||
this.groupBox2.Controls.Add(this.edtDinFreq);
|
||||
this.groupBox2.Controls.Add(this.edtAdcFreqLch);
|
||||
this.groupBox2.Controls.Add(this.edtAdcFreq);
|
||||
this.groupBox2.Location = new System.Drawing.Point(27, 247);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(518, 60);
|
||||
this.groupBox2.TabIndex = 4;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Частоты синхронного сбора";
|
||||
//
|
||||
// btnSetAdcFreq
|
||||
//
|
||||
this.btnSetAdcFreq.Location = new System.Drawing.Point(437, 32);
|
||||
this.btnSetAdcFreq.Name = "btnSetAdcFreq";
|
||||
this.btnSetAdcFreq.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnSetAdcFreq.TabIndex = 10;
|
||||
this.btnSetAdcFreq.Text = "Установить";
|
||||
this.btnSetAdcFreq.UseVisualStyleBackColor = true;
|
||||
this.btnSetAdcFreq.Click += new System.EventHandler(this.btnSetAdcFreq_Click);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(291, 16);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(170, 13);
|
||||
this.label5.TabIndex = 9;
|
||||
this.label5.Text = "Частота синхронного ввода (Гц)";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(159, 15);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(118, 13);
|
||||
this.label4.TabIndex = 8;
|
||||
this.label4.Text = "Частота на канал (Гц)";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(7, 15);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(143, 13);
|
||||
this.label3.TabIndex = 7;
|
||||
this.label3.Text = "Частота сбора данных (Гц)";
|
||||
//
|
||||
// edtDinFreq
|
||||
//
|
||||
this.edtDinFreq.Location = new System.Drawing.Point(294, 34);
|
||||
this.edtDinFreq.Name = "edtDinFreq";
|
||||
this.edtDinFreq.Size = new System.Drawing.Size(126, 20);
|
||||
this.edtDinFreq.TabIndex = 6;
|
||||
this.edtDinFreq.Text = "2000000";
|
||||
//
|
||||
// edtAdcFreqLch
|
||||
//
|
||||
this.edtAdcFreqLch.Location = new System.Drawing.Point(162, 34);
|
||||
this.edtAdcFreqLch.Name = "edtAdcFreqLch";
|
||||
this.edtAdcFreqLch.Size = new System.Drawing.Size(126, 20);
|
||||
this.edtAdcFreqLch.TabIndex = 5;
|
||||
this.edtAdcFreqLch.Text = "2000000";
|
||||
//
|
||||
// edtAdcFreq
|
||||
//
|
||||
this.edtAdcFreq.Location = new System.Drawing.Point(6, 34);
|
||||
this.edtAdcFreq.Name = "edtAdcFreq";
|
||||
this.edtAdcFreq.Size = new System.Drawing.Size(126, 20);
|
||||
this.edtAdcFreq.TabIndex = 0;
|
||||
this.edtAdcFreq.Text = "2000000";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.chkSyncDin);
|
||||
this.groupBox3.Controls.Add(this.edtDin_Result);
|
||||
this.groupBox3.Controls.Add(this.edtLCh3_Result);
|
||||
this.groupBox3.Controls.Add(this.edtLCh2_Result);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh3_Mode);
|
||||
this.groupBox3.Controls.Add(this.label10);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh3_Range);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh2_Mode);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh3_Channel);
|
||||
this.groupBox3.Controls.Add(this.label9);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh2_Range);
|
||||
this.groupBox3.Controls.Add(this.label8);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh2_Channel);
|
||||
this.groupBox3.Controls.Add(this.edtLCh1_Result);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh1_Mode);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh1_Range);
|
||||
this.groupBox3.Controls.Add(this.label7);
|
||||
this.groupBox3.Controls.Add(this.cbbLCh1_Channel);
|
||||
this.groupBox3.Controls.Add(this.label6);
|
||||
this.groupBox3.Controls.Add(this.cbbLChCnt);
|
||||
this.groupBox3.Location = new System.Drawing.Point(27, 377);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(518, 166);
|
||||
this.groupBox3.TabIndex = 5;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Каналы АЦП";
|
||||
//
|
||||
// chkSyncDin
|
||||
//
|
||||
this.chkSyncDin.AutoSize = true;
|
||||
this.chkSyncDin.Location = new System.Drawing.Point(182, 140);
|
||||
this.chkSyncDin.Name = "chkSyncDin";
|
||||
this.chkSyncDin.Size = new System.Drawing.Size(189, 17);
|
||||
this.chkSyncDin.TabIndex = 17;
|
||||
this.chkSyncDin.Text = "Разрешение синхронного ввода";
|
||||
this.chkSyncDin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkSyncDin.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// edtDin_Result
|
||||
//
|
||||
this.edtDin_Result.Location = new System.Drawing.Point(380, 138);
|
||||
this.edtDin_Result.Name = "edtDin_Result";
|
||||
this.edtDin_Result.Size = new System.Drawing.Size(107, 20);
|
||||
this.edtDin_Result.TabIndex = 16;
|
||||
//
|
||||
// edtLCh3_Result
|
||||
//
|
||||
this.edtLCh3_Result.Location = new System.Drawing.Point(380, 112);
|
||||
this.edtLCh3_Result.Name = "edtLCh3_Result";
|
||||
this.edtLCh3_Result.Size = new System.Drawing.Size(107, 20);
|
||||
this.edtLCh3_Result.TabIndex = 15;
|
||||
//
|
||||
// edtLCh2_Result
|
||||
//
|
||||
this.edtLCh2_Result.Location = new System.Drawing.Point(380, 85);
|
||||
this.edtLCh2_Result.Name = "edtLCh2_Result";
|
||||
this.edtLCh2_Result.Size = new System.Drawing.Size(107, 20);
|
||||
this.edtLCh2_Result.TabIndex = 11;
|
||||
//
|
||||
// cbbLCh3_Mode
|
||||
//
|
||||
this.cbbLCh3_Mode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh3_Mode.FormattingEnabled = true;
|
||||
this.cbbLCh3_Mode.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh3_Mode.Items.AddRange(new object[] {
|
||||
"С общей землей",
|
||||
"Дифференциальный",
|
||||
"Измерение нуля"});
|
||||
this.cbbLCh3_Mode.Location = new System.Drawing.Point(182, 111);
|
||||
this.cbbLCh3_Mode.Name = "cbbLCh3_Mode";
|
||||
this.cbbLCh3_Mode.Size = new System.Drawing.Size(175, 21);
|
||||
this.cbbLCh3_Mode.TabIndex = 14;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(386, 41);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(59, 13);
|
||||
this.label10.TabIndex = 10;
|
||||
this.label10.Text = "Результат";
|
||||
//
|
||||
// cbbLCh3_Range
|
||||
//
|
||||
this.cbbLCh3_Range.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh3_Range.FormattingEnabled = true;
|
||||
this.cbbLCh3_Range.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh3_Range.Items.AddRange(new object[] {
|
||||
"10 В",
|
||||
"5 В",
|
||||
"2 В",
|
||||
"1 В",
|
||||
"0.5 В",
|
||||
"0.2 В"});
|
||||
this.cbbLCh3_Range.Location = new System.Drawing.Point(73, 111);
|
||||
this.cbbLCh3_Range.Name = "cbbLCh3_Range";
|
||||
this.cbbLCh3_Range.Size = new System.Drawing.Size(75, 21);
|
||||
this.cbbLCh3_Range.TabIndex = 13;
|
||||
//
|
||||
// cbbLCh2_Mode
|
||||
//
|
||||
this.cbbLCh2_Mode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh2_Mode.FormattingEnabled = true;
|
||||
this.cbbLCh2_Mode.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh2_Mode.Items.AddRange(new object[] {
|
||||
"С общей землей",
|
||||
"Дифференциальный",
|
||||
"Измерение нуля"});
|
||||
this.cbbLCh2_Mode.Location = new System.Drawing.Point(182, 84);
|
||||
this.cbbLCh2_Mode.Name = "cbbLCh2_Mode";
|
||||
this.cbbLCh2_Mode.Size = new System.Drawing.Size(175, 21);
|
||||
this.cbbLCh2_Mode.TabIndex = 10;
|
||||
//
|
||||
// cbbLCh3_Channel
|
||||
//
|
||||
this.cbbLCh3_Channel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh3_Channel.FormattingEnabled = true;
|
||||
this.cbbLCh3_Channel.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh3_Channel.Items.AddRange(new object[] {
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
"31",
|
||||
"32"});
|
||||
this.cbbLCh3_Channel.Location = new System.Drawing.Point(8, 111);
|
||||
this.cbbLCh3_Channel.Name = "cbbLCh3_Channel";
|
||||
this.cbbLCh3_Channel.Size = new System.Drawing.Size(46, 21);
|
||||
this.cbbLCh3_Channel.TabIndex = 12;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(185, 41);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(101, 13);
|
||||
this.label9.TabIndex = 9;
|
||||
this.label9.Text = "Режим измерения";
|
||||
//
|
||||
// cbbLCh2_Range
|
||||
//
|
||||
this.cbbLCh2_Range.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh2_Range.FormattingEnabled = true;
|
||||
this.cbbLCh2_Range.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh2_Range.Items.AddRange(new object[] {
|
||||
"10 В",
|
||||
"5 В",
|
||||
"2 В",
|
||||
"1 В",
|
||||
"0.5 В",
|
||||
"0.2 В"});
|
||||
this.cbbLCh2_Range.Location = new System.Drawing.Point(73, 84);
|
||||
this.cbbLCh2_Range.Name = "cbbLCh2_Range";
|
||||
this.cbbLCh2_Range.Size = new System.Drawing.Size(75, 21);
|
||||
this.cbbLCh2_Range.TabIndex = 9;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(72, 41);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(58, 13);
|
||||
this.label8.TabIndex = 8;
|
||||
this.label8.Text = "Диапазон";
|
||||
//
|
||||
// cbbLCh2_Channel
|
||||
//
|
||||
this.cbbLCh2_Channel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh2_Channel.FormattingEnabled = true;
|
||||
this.cbbLCh2_Channel.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh2_Channel.Items.AddRange(new object[] {
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
"31",
|
||||
"32"});
|
||||
this.cbbLCh2_Channel.Location = new System.Drawing.Point(8, 84);
|
||||
this.cbbLCh2_Channel.Name = "cbbLCh2_Channel";
|
||||
this.cbbLCh2_Channel.Size = new System.Drawing.Size(46, 21);
|
||||
this.cbbLCh2_Channel.TabIndex = 8;
|
||||
//
|
||||
// edtLCh1_Result
|
||||
//
|
||||
this.edtLCh1_Result.Location = new System.Drawing.Point(380, 58);
|
||||
this.edtLCh1_Result.Name = "edtLCh1_Result";
|
||||
this.edtLCh1_Result.Size = new System.Drawing.Size(107, 20);
|
||||
this.edtLCh1_Result.TabIndex = 7;
|
||||
//
|
||||
// cbbLCh1_Mode
|
||||
//
|
||||
this.cbbLCh1_Mode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh1_Mode.FormattingEnabled = true;
|
||||
this.cbbLCh1_Mode.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh1_Mode.Items.AddRange(new object[] {
|
||||
"С общей землей",
|
||||
"Дифференциальный",
|
||||
"Измерение нуля"});
|
||||
this.cbbLCh1_Mode.Location = new System.Drawing.Point(182, 57);
|
||||
this.cbbLCh1_Mode.Name = "cbbLCh1_Mode";
|
||||
this.cbbLCh1_Mode.Size = new System.Drawing.Size(175, 21);
|
||||
this.cbbLCh1_Mode.TabIndex = 6;
|
||||
//
|
||||
// cbbLCh1_Range
|
||||
//
|
||||
this.cbbLCh1_Range.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh1_Range.FormattingEnabled = true;
|
||||
this.cbbLCh1_Range.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh1_Range.Items.AddRange(new object[] {
|
||||
"10 В",
|
||||
"5 В",
|
||||
"2 В",
|
||||
"1 В",
|
||||
"0.5 В",
|
||||
"0.2 В"});
|
||||
this.cbbLCh1_Range.Location = new System.Drawing.Point(73, 57);
|
||||
this.cbbLCh1_Range.Name = "cbbLCh1_Range";
|
||||
this.cbbLCh1_Range.Size = new System.Drawing.Size(75, 21);
|
||||
this.cbbLCh1_Range.TabIndex = 5;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(6, 41);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(38, 13);
|
||||
this.label7.TabIndex = 4;
|
||||
this.label7.Text = "Канал";
|
||||
//
|
||||
// cbbLCh1_Channel
|
||||
//
|
||||
this.cbbLCh1_Channel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLCh1_Channel.FormattingEnabled = true;
|
||||
this.cbbLCh1_Channel.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbLCh1_Channel.Items.AddRange(new object[] {
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
"31",
|
||||
"32"});
|
||||
this.cbbLCh1_Channel.Location = new System.Drawing.Point(8, 57);
|
||||
this.cbbLCh1_Channel.Name = "cbbLCh1_Channel";
|
||||
this.cbbLCh1_Channel.Size = new System.Drawing.Size(46, 21);
|
||||
this.cbbLCh1_Channel.TabIndex = 2;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(25, 22);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(171, 13);
|
||||
this.label6.TabIndex = 1;
|
||||
this.label6.Text = "Количество логических каналов";
|
||||
//
|
||||
// cbbLChCnt
|
||||
//
|
||||
this.cbbLChCnt.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbLChCnt.FormattingEnabled = true;
|
||||
this.cbbLChCnt.Items.AddRange(new object[] {
|
||||
"1",
|
||||
"2",
|
||||
"3"});
|
||||
this.cbbLChCnt.Location = new System.Drawing.Point(211, 14);
|
||||
this.cbbLChCnt.Name = "cbbLChCnt";
|
||||
this.cbbLChCnt.Size = new System.Drawing.Size(49, 21);
|
||||
this.cbbLChCnt.TabIndex = 0;
|
||||
//
|
||||
// btnStart
|
||||
//
|
||||
this.btnStart.Location = new System.Drawing.Point(27, 92);
|
||||
this.btnStart.Name = "btnStart";
|
||||
this.btnStart.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnStart.TabIndex = 6;
|
||||
this.btnStart.Text = "Запуск сбора данных";
|
||||
this.btnStart.UseVisualStyleBackColor = true;
|
||||
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
|
||||
//
|
||||
// btnStop
|
||||
//
|
||||
this.btnStop.Location = new System.Drawing.Point(27, 121);
|
||||
this.btnStop.Name = "btnStop";
|
||||
this.btnStop.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnStop.TabIndex = 7;
|
||||
this.btnStop.Text = "Останов сбора данных";
|
||||
this.btnStop.UseVisualStyleBackColor = true;
|
||||
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
|
||||
//
|
||||
// btnAsyncAdcFrame
|
||||
//
|
||||
this.btnAsyncAdcFrame.Location = new System.Drawing.Point(27, 549);
|
||||
this.btnAsyncAdcFrame.Name = "btnAsyncAdcFrame";
|
||||
this.btnAsyncAdcFrame.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnAsyncAdcFrame.TabIndex = 8;
|
||||
this.btnAsyncAdcFrame.Text = "Асинхронный ввод кадра АЦП";
|
||||
this.btnAsyncAdcFrame.UseVisualStyleBackColor = true;
|
||||
this.btnAsyncAdcFrame.Click += new System.EventHandler(this.btnAsyncAdcFrame_Click);
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.cbbSyncStartMode);
|
||||
this.groupBox4.Controls.Add(this.label12);
|
||||
this.groupBox4.Controls.Add(this.cbbSyncMode);
|
||||
this.groupBox4.Controls.Add(this.label11);
|
||||
this.groupBox4.Location = new System.Drawing.Point(27, 307);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(518, 64);
|
||||
this.groupBox4.TabIndex = 9;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Синхронизация";
|
||||
//
|
||||
// cbbSyncStartMode
|
||||
//
|
||||
this.cbbSyncStartMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbSyncStartMode.FormattingEnabled = true;
|
||||
this.cbbSyncStartMode.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbSyncStartMode.Items.AddRange(new object[] {
|
||||
"Внутренний",
|
||||
"От внешнего мастера",
|
||||
"Фронт сигнала DI_SYN1",
|
||||
"Фронт сигнала DI_SYN2",
|
||||
"Спад сигнала DI_SYN1",
|
||||
"Спад сигнала DI_SYN2"});
|
||||
this.cbbSyncStartMode.Location = new System.Drawing.Point(228, 37);
|
||||
this.cbbSyncStartMode.Name = "cbbSyncStartMode";
|
||||
this.cbbSyncStartMode.Size = new System.Drawing.Size(176, 21);
|
||||
this.cbbSyncStartMode.TabIndex = 11;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(228, 16);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(242, 13);
|
||||
this.label12.TabIndex = 10;
|
||||
this.label12.Text = "Источник запуска синхронного ввода/вывода";
|
||||
//
|
||||
// cbbSyncMode
|
||||
//
|
||||
this.cbbSyncMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbbSyncMode.FormattingEnabled = true;
|
||||
this.cbbSyncMode.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
|
||||
this.cbbSyncMode.Items.AddRange(new object[] {
|
||||
"Внутренний",
|
||||
"От внешнего мастера",
|
||||
"Фронт сигнала DI_SYN1",
|
||||
"Фронт сигнала DI_SYN2",
|
||||
"Спад сигнала DI_SYN1",
|
||||
"Спад сигнала DI_SYN2"});
|
||||
this.cbbSyncMode.Location = new System.Drawing.Point(10, 37);
|
||||
this.cbbSyncMode.Name = "cbbSyncMode";
|
||||
this.cbbSyncMode.Size = new System.Drawing.Size(176, 21);
|
||||
this.cbbSyncMode.TabIndex = 9;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(7, 16);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(179, 13);
|
||||
this.label11.TabIndex = 8;
|
||||
this.label11.Text = "Источник частоты синхронизации";
|
||||
//
|
||||
// btnAsyncDigIn
|
||||
//
|
||||
this.btnAsyncDigIn.Location = new System.Drawing.Point(27, 578);
|
||||
this.btnAsyncDigIn.Name = "btnAsyncDigIn";
|
||||
this.btnAsyncDigIn.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnAsyncDigIn.TabIndex = 10;
|
||||
this.btnAsyncDigIn.Text = "Асинхронный ввод цифровых линий";
|
||||
this.btnAsyncDigIn.UseVisualStyleBackColor = true;
|
||||
this.btnAsyncDigIn.Click += new System.EventHandler(this.btnAsyncDigIn_Click);
|
||||
//
|
||||
// btnAsyncDigOut
|
||||
//
|
||||
this.btnAsyncDigOut.Location = new System.Drawing.Point(27, 607);
|
||||
this.btnAsyncDigOut.Name = "btnAsyncDigOut";
|
||||
this.btnAsyncDigOut.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnAsyncDigOut.TabIndex = 11;
|
||||
this.btnAsyncDigOut.Text = "Асинхронный вывод цифровых линий";
|
||||
this.btnAsyncDigOut.UseVisualStyleBackColor = true;
|
||||
this.btnAsyncDigOut.Click += new System.EventHandler(this.btnAsyncDigOut_Click);
|
||||
//
|
||||
// btnAsyncDac1
|
||||
//
|
||||
this.btnAsyncDac1.Location = new System.Drawing.Point(27, 636);
|
||||
this.btnAsyncDac1.Name = "btnAsyncDac1";
|
||||
this.btnAsyncDac1.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnAsyncDac1.TabIndex = 12;
|
||||
this.btnAsyncDac1.Text = "Асинхронный вывод на ЦАП1 (Вольты)";
|
||||
this.btnAsyncDac1.UseVisualStyleBackColor = true;
|
||||
this.btnAsyncDac1.Click += new System.EventHandler(this.btnAsyncDac1_Click);
|
||||
//
|
||||
// btnAsyncDac2
|
||||
//
|
||||
this.btnAsyncDac2.Location = new System.Drawing.Point(27, 665);
|
||||
this.btnAsyncDac2.Name = "btnAsyncDac2";
|
||||
this.btnAsyncDac2.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnAsyncDac2.TabIndex = 13;
|
||||
this.btnAsyncDac2.Text = "Асинхронный вывод на ЦАП2 (Вольты)";
|
||||
this.btnAsyncDac2.UseVisualStyleBackColor = true;
|
||||
this.btnAsyncDac2.Click += new System.EventHandler(this.btnAsyncDac2_Click);
|
||||
//
|
||||
// edtAsyncDigIn
|
||||
//
|
||||
this.edtAsyncDigIn.Location = new System.Drawing.Point(255, 580);
|
||||
this.edtAsyncDigIn.Name = "edtAsyncDigIn";
|
||||
this.edtAsyncDigIn.Size = new System.Drawing.Size(101, 20);
|
||||
this.edtAsyncDigIn.TabIndex = 14;
|
||||
//
|
||||
// edtAsyncDigOut
|
||||
//
|
||||
this.edtAsyncDigOut.Location = new System.Drawing.Point(255, 610);
|
||||
this.edtAsyncDigOut.Name = "edtAsyncDigOut";
|
||||
this.edtAsyncDigOut.Size = new System.Drawing.Size(101, 20);
|
||||
this.edtAsyncDigOut.TabIndex = 15;
|
||||
this.edtAsyncDigOut.Text = "0x0000";
|
||||
//
|
||||
// edtAsyncDac1
|
||||
//
|
||||
this.edtAsyncDac1.Location = new System.Drawing.Point(255, 639);
|
||||
this.edtAsyncDac1.Name = "edtAsyncDac1";
|
||||
this.edtAsyncDac1.Size = new System.Drawing.Size(58, 20);
|
||||
this.edtAsyncDac1.TabIndex = 16;
|
||||
this.edtAsyncDac1.Text = "5";
|
||||
//
|
||||
// edtAsyncDac2
|
||||
//
|
||||
this.edtAsyncDac2.Location = new System.Drawing.Point(255, 665);
|
||||
this.edtAsyncDac2.Name = "edtAsyncDac2";
|
||||
this.edtAsyncDac2.Size = new System.Drawing.Size(58, 20);
|
||||
this.edtAsyncDac2.TabIndex = 17;
|
||||
this.edtAsyncDac2.Text = "5";
|
||||
//
|
||||
// chkEthSupport
|
||||
//
|
||||
this.chkEthSupport.AutoSize = true;
|
||||
this.chkEthSupport.Enabled = false;
|
||||
this.chkEthSupport.Location = new System.Drawing.Point(6, 85);
|
||||
this.chkEthSupport.Name = "chkEthSupport";
|
||||
this.chkEthSupport.Size = new System.Drawing.Size(182, 17);
|
||||
this.chkEthSupport.TabIndex = 9;
|
||||
this.chkEthSupport.Text = "Наличие сетевого интерфейса";
|
||||
this.chkEthSupport.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label13
|
||||
//
|
||||
this.label13.AutoSize = true;
|
||||
this.label13.Location = new System.Drawing.Point(74, 157);
|
||||
this.label13.Name = "label13";
|
||||
this.label13.Size = new System.Drawing.Size(124, 13);
|
||||
this.label13.TabIndex = 11;
|
||||
this.label13.Text = "Версия прошивки ARM";
|
||||
//
|
||||
// edtMcuVer
|
||||
//
|
||||
this.edtMcuVer.Enabled = false;
|
||||
this.edtMcuVer.Location = new System.Drawing.Point(6, 154);
|
||||
this.edtMcuVer.Name = "edtMcuVer";
|
||||
this.edtMcuVer.Size = new System.Drawing.Size(62, 20);
|
||||
this.edtMcuVer.TabIndex = 10;
|
||||
//
|
||||
// edtIpAddr
|
||||
//
|
||||
this.edtIpAddr.Location = new System.Drawing.Point(27, 203);
|
||||
this.edtIpAddr.Name = "edtIpAddr";
|
||||
this.edtIpAddr.Size = new System.Drawing.Size(212, 20);
|
||||
this.edtIpAddr.TabIndex = 18;
|
||||
this.edtIpAddr.Text = "192.168.0.1";
|
||||
//
|
||||
// btnOpenByIP
|
||||
//
|
||||
this.btnOpenByIP.Location = new System.Drawing.Point(27, 174);
|
||||
this.btnOpenByIP.Name = "btnOpenByIP";
|
||||
this.btnOpenByIP.Size = new System.Drawing.Size(212, 23);
|
||||
this.btnOpenByIP.TabIndex = 19;
|
||||
this.btnOpenByIP.Text = "Установить соединение по IP-адресу";
|
||||
this.btnOpenByIP.UseVisualStyleBackColor = true;
|
||||
this.btnOpenByIP.Click += new System.EventHandler(this.btnOpenByIP_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(553, 736);
|
||||
this.Controls.Add(this.btnOpenByIP);
|
||||
this.Controls.Add(this.edtIpAddr);
|
||||
this.Controls.Add(this.edtAsyncDac2);
|
||||
this.Controls.Add(this.edtAsyncDac1);
|
||||
this.Controls.Add(this.edtAsyncDigOut);
|
||||
this.Controls.Add(this.edtAsyncDigIn);
|
||||
this.Controls.Add(this.btnAsyncDac2);
|
||||
this.Controls.Add(this.btnAsyncDac1);
|
||||
this.Controls.Add(this.btnAsyncDigOut);
|
||||
this.Controls.Add(this.btnAsyncDigIn);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.btnAsyncAdcFrame);
|
||||
this.Controls.Add(this.btnStop);
|
||||
this.Controls.Add(this.btnStart);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.btnOpen);
|
||||
this.Controls.Add(this.cbbSerialList);
|
||||
this.Controls.Add(this.btnRefreshDeviceList);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "L502/E502 example";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnRefreshDeviceList;
|
||||
private System.Windows.Forms.ComboBox cbbSerialList;
|
||||
private System.Windows.Forms.Button btnOpen;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.CheckBox chkBfPresent;
|
||||
private System.Windows.Forms.CheckBox chkGalPresent;
|
||||
private System.Windows.Forms.CheckBox chkDacPresent;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox edtPldaVer;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox edtFpgaVer;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Button btnSetAdcFreq;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox edtDinFreq;
|
||||
private System.Windows.Forms.TextBox edtAdcFreqLch;
|
||||
private System.Windows.Forms.TextBox edtAdcFreq;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.ComboBox cbbLChCnt;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.ComboBox cbbLCh1_Channel;
|
||||
private System.Windows.Forms.ComboBox cbbLCh1_Mode;
|
||||
private System.Windows.Forms.ComboBox cbbLCh1_Range;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.CheckBox chkSyncDin;
|
||||
private System.Windows.Forms.TextBox edtDin_Result;
|
||||
private System.Windows.Forms.TextBox edtLCh3_Result;
|
||||
private System.Windows.Forms.TextBox edtLCh2_Result;
|
||||
private System.Windows.Forms.ComboBox cbbLCh3_Mode;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.ComboBox cbbLCh3_Range;
|
||||
private System.Windows.Forms.ComboBox cbbLCh2_Mode;
|
||||
private System.Windows.Forms.ComboBox cbbLCh3_Channel;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.ComboBox cbbLCh2_Range;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.ComboBox cbbLCh2_Channel;
|
||||
private System.Windows.Forms.TextBox edtLCh1_Result;
|
||||
private System.Windows.Forms.Button btnStart;
|
||||
private System.Windows.Forms.Button btnStop;
|
||||
private System.Windows.Forms.Button btnAsyncAdcFrame;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.ComboBox cbbSyncStartMode;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.ComboBox cbbSyncMode;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.Button btnAsyncDigIn;
|
||||
private System.Windows.Forms.Button btnAsyncDigOut;
|
||||
private System.Windows.Forms.Button btnAsyncDac1;
|
||||
private System.Windows.Forms.Button btnAsyncDac2;
|
||||
private System.Windows.Forms.TextBox edtAsyncDigIn;
|
||||
private System.Windows.Forms.TextBox edtAsyncDigOut;
|
||||
private System.Windows.Forms.TextBox edtAsyncDac1;
|
||||
private System.Windows.Forms.TextBox edtAsyncDac2;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.TextBox edtMcuVer;
|
||||
private System.Windows.Forms.CheckBox chkEthSupport;
|
||||
private System.Windows.Forms.TextBox edtIpAddr;
|
||||
private System.Windows.Forms.Button btnOpenByIP;
|
||||
}
|
||||
}
|
||||
|
||||
592
lib/SDK/examples/cs/x502_general/MainForm.cs
Normal file
592
lib/SDK/examples/cs/x502_general/MainForm.cs
Normal file
@ -0,0 +1,592 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Net;
|
||||
|
||||
using x502api;
|
||||
using lpcieapi;
|
||||
|
||||
namespace x502_example
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
const uint RECV_BUF_SIZE = 8*1024*1024;
|
||||
const uint RECV_TOUT = 250;
|
||||
|
||||
X502.DevRec[] devrecs;
|
||||
|
||||
X502 hnd; /* Описатель модуля с которым работаем (null, если связи нет) */
|
||||
Thread thread; /* Объект потока для синхронного сбора */
|
||||
bool reqStop; /* Запрос на останов потока сбора данных */
|
||||
bool threadRunning; /* Признак, идет ли сбор данных в отдельном потоке */
|
||||
|
||||
UInt32[] rcv_buf; /* буфер для приема сырых данных */
|
||||
double[] adcData; /* буфер для данных АЦП */
|
||||
UInt32[] dinData; /* буфер для отсчетов цифровых входов */
|
||||
UInt32 adcSize, dinSize; /* размер действительных данных в adcData и dinData */
|
||||
UInt32 firstLch; /* номер логического канала, которому соответствует отсчет в adcData[0] */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private delegate void finishThreadDelegate(lpcie.Errs err);
|
||||
private delegate void updateDateDelegate();
|
||||
|
||||
/* Обновление элементов управления, значениями, снятыми при синхронном вводе.
|
||||
* Так работа с интерфейсом может быть только из основного потока, а
|
||||
* фунция вызывается из потока сбора данных, то если мы находимся
|
||||
* в потоке сбора данных, планируем ее выполнение в основном потоке */
|
||||
private void UpdateData()
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new updateDateDelegate(this.UpdateData));
|
||||
}
|
||||
else
|
||||
{
|
||||
TextBox[] lchResEdits = {edtLCh1_Result, edtLCh2_Result, edtLCh3_Result};
|
||||
UInt32 lch_cnt = hnd.LChannelCount;
|
||||
/* устанавливаем в индикаторах значение первого отсчета из массива */
|
||||
for (uint i = 0; (i < lch_cnt) && (i < adcSize); i++)
|
||||
lchResEdits[(firstLch + i) % lch_cnt].Text = adcData[i].ToString("F7");
|
||||
|
||||
/* если есть данные цифрового выхода, то устанавливаем индикатор
|
||||
в соответствии с первым значением */
|
||||
if (dinSize>0)
|
||||
edtDin_Result.Text = dinData[0].ToString("X5");
|
||||
else
|
||||
edtDin_Result.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
/* Функция, вызываемая по завершению потока сбора данных.
|
||||
* Так как она работает с интерфейсом, то при вызове из другого потока,
|
||||
* она планируется на выполнения в основном потоке, как и UpdateData */
|
||||
private void finishThread(lpcie.Errs err)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
this.Invoke(new finishThreadDelegate(this.finishThread), err);
|
||||
else
|
||||
{
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Сбор данных завершен с ошибкой",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
threadRunning = false;
|
||||
updateControls();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Функция синхронного сбора данных. Выполняется в отдельном потоке */
|
||||
private void threadFunc()
|
||||
{
|
||||
reqStop = false;
|
||||
/* запускаем синхронные потоки ввода-вывода*/
|
||||
lpcie.Errs err = hnd.StreamsStart();
|
||||
if (err == lpcie.Errs.OK)
|
||||
{
|
||||
/* выполняем прием пока не произойдет ошибка или
|
||||
не будет запроса на останов от основного приложения */
|
||||
while (!reqStop && (err == lpcie.Errs.OK))
|
||||
{
|
||||
/* принимаем данные синхронного ввода */
|
||||
Int32 rcv_size = hnd.Recv(rcv_buf, RECV_BUF_SIZE, RECV_TOUT);
|
||||
/* значение меньше нуля означает ошибку... */
|
||||
if (rcv_size < 0)
|
||||
err = (lpcie.Errs)rcv_size;
|
||||
else if (rcv_size > 0)
|
||||
{
|
||||
/* если больше нуля - значит приняли новые данные */
|
||||
dinSize = RECV_BUF_SIZE;
|
||||
adcSize = RECV_BUF_SIZE;
|
||||
/* получаем номер лог. какнала, соответствующий первому
|
||||
отсчету АЦП, так как до этого могли обработать
|
||||
некратное количество кадров */
|
||||
firstLch = hnd.NextExpectedLchNum;
|
||||
|
||||
/* разбираем данные на синхронный ввод и отсчеты АЦП и
|
||||
переводим АЦП в Вольты */
|
||||
err = hnd.ProcessData(rcv_buf, (uint)rcv_size, X502.ProcFlags.VOLT,
|
||||
adcData, ref adcSize, dinData, ref dinSize);
|
||||
|
||||
if (err == lpcie.Errs.OK)
|
||||
{
|
||||
/* обновляем значения элементов управления */
|
||||
UpdateData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* по выходу из цикла отсанавливаем поток.
|
||||
Чтобы не сбросить код ошибки (если вышли по ошибке)
|
||||
результат останова сохраняем в отдельную переменную */
|
||||
lpcie.Errs stop_err = hnd.StreamsStop();
|
||||
if (err == lpcie.Errs.OK)
|
||||
err = stop_err;
|
||||
}
|
||||
|
||||
/* завершаем поток */
|
||||
finishThread(err);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* обновление состояния элементов управления (какие разрешены, какие нет) */
|
||||
private void updateControls()
|
||||
{
|
||||
btnRefreshDeviceList.Enabled = hnd==null;
|
||||
cbbSerialList.Enabled = hnd==null;
|
||||
|
||||
btnOpen.Text = hnd==null ? "Установить связь с устройством" :
|
||||
"Разорвать связь с устройством";
|
||||
|
||||
btnOpen.Enabled = (hnd!=null) || (cbbSerialList.SelectedItem != null);
|
||||
btnOpenByIP.Enabled = (hnd == null);
|
||||
edtIpAddr.Enabled = (hnd == null);
|
||||
|
||||
chkSyncDin.Enabled = (hnd != null) && !threadRunning;
|
||||
btnStart.Enabled = (hnd != null) && !threadRunning;
|
||||
btnStop.Enabled = (hnd != null) && threadRunning;
|
||||
|
||||
btnSetAdcFreq.Enabled = (hnd != null) && !threadRunning;
|
||||
|
||||
btnAsyncDigOut.Enabled = (hnd != null);
|
||||
btnAsyncDigIn.Enabled = (hnd != null);
|
||||
btnAsyncDac1.Enabled = (hnd != null) && chkDacPresent.Checked;
|
||||
btnAsyncDac2.Enabled = (hnd != null) && chkDacPresent.Checked;
|
||||
btnAsyncAdcFrame.Enabled = (hnd != null) && !threadRunning;
|
||||
}
|
||||
|
||||
|
||||
private void deviceClose()
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
//останов сбора данных
|
||||
if (threadRunning)
|
||||
{
|
||||
reqStop = true;
|
||||
|
||||
/* ожидаем завершения потока. Так как
|
||||
* поток работает с GUI и планирует выполнение части
|
||||
* функций в основном потоке, то мы не можем сдесь просто
|
||||
* сделать Join, вызываем Application.DoEvents(), чтобы
|
||||
* в нем обработать запланированные UpdateData()/finishThread() */
|
||||
while (threadRunning)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
|
||||
// закрытие связи с модулем
|
||||
hnd.Close();
|
||||
// память освободится диспетчером мусора, т.к. нет больше ссылок
|
||||
hnd = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshDevList()
|
||||
{
|
||||
cbbSerialList.Items.Clear();
|
||||
|
||||
//получаем список серийных номеров
|
||||
X502.DevRec[] pci_devrecs;
|
||||
X502.DevRec[] usb_devrecs;
|
||||
Int32 res = L502.GetDevRecordsList(out pci_devrecs, 0);
|
||||
res = E502.UsbGetDevRecordsList(out usb_devrecs, 0);
|
||||
|
||||
devrecs = new X502.DevRec[pci_devrecs.Length + usb_devrecs.Length];
|
||||
pci_devrecs.CopyTo(devrecs, 0);
|
||||
usb_devrecs.CopyTo(devrecs, pci_devrecs.Length);
|
||||
|
||||
|
||||
/* заполняем полученные серийные номера в ComboBox */
|
||||
for (int i = 0; i < devrecs.Length; i++)
|
||||
cbbSerialList.Items.Add(devrecs[i].DevName + ", " + devrecs[i].Serial);
|
||||
if (devrecs.Length > 0)
|
||||
cbbSerialList.SelectedIndex = 0;
|
||||
|
||||
|
||||
updateControls();
|
||||
}
|
||||
|
||||
/* установка частот сбора данных из элементов управления и обновление их реально
|
||||
* установленными значениями */
|
||||
lpcie.Errs setAdcFreq()
|
||||
{
|
||||
lpcie.Errs err = lpcie.Errs.OK;
|
||||
double f_acq, f_lch, f_din;
|
||||
|
||||
f_acq = Convert.ToDouble(edtAdcFreq.Text);
|
||||
f_lch = Convert.ToDouble(edtAdcFreqLch.Text);
|
||||
f_din = Convert.ToDouble(edtDinFreq.Text);
|
||||
|
||||
// устанавливаем требуемую частоту сбора.
|
||||
err = hnd.SetAdcFreq(ref f_acq, ref f_lch);
|
||||
if (err == lpcie.Errs.OK)
|
||||
{
|
||||
// обновляем значение индикатора, для отображения
|
||||
// реально установившейся частоты
|
||||
edtAdcFreq.Text = f_acq.ToString();
|
||||
edtAdcFreqLch.Text = f_lch.ToString();
|
||||
// Устанавливаем частоту синхронного сбора
|
||||
err = hnd.SetDinFreq(ref f_din);
|
||||
if (err == lpcie.Errs.OK)
|
||||
edtDinFreq.Text = f_din.ToString();
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* настройка параметров модуля значениями из элементов управления */
|
||||
lpcie.Errs setupParams()
|
||||
{
|
||||
lpcie.Errs err = lpcie.Errs.OK;
|
||||
/* таблица соответствия индексов в ComboBox и кодов режима измерения */
|
||||
X502.LchMode[] f_mode_tbl = {X502.LchMode.COMM, X502.LchMode.DIFF, X502.LchMode.ZERO};
|
||||
/* таблица соответствия индексов в ComboBox и кодов диапазонов АЦП */
|
||||
X502.AdcRange[] f_range_tbl = {X502.AdcRange.RANGE_10, X502.AdcRange.RANGE_5, X502.AdcRange.RANGE_2,
|
||||
X502.AdcRange.RANGE_1, X502.AdcRange.RANGE_05, X502.AdcRange.RANGE_02};
|
||||
/* таблица соответствия индексов в ComboBox и кодов источника синхронизации */
|
||||
X502.Sync[] f_sync_tbl = {X502.Sync.INTERNAL, X502.Sync.EXTERNAL_MASTER,
|
||||
X502.Sync.DI_SYN1_RISE, X502.Sync.DI_SYN2_RISE,
|
||||
X502.Sync.DI_SYN1_FALL, X502.Sync.DI_SYN2_FALL};
|
||||
|
||||
UInt32 lch_cnt = Convert.ToUInt32(cbbLChCnt.Text);
|
||||
|
||||
/* Устанавливаем кол-во логических каналов */
|
||||
hnd.LChannelCount = lch_cnt;
|
||||
|
||||
/* Настраниваем таблицу логических каналов */
|
||||
err = hnd.SetLChannel(0, Convert.ToUInt32(cbbLCh1_Channel.Text) - 1,
|
||||
f_mode_tbl[cbbLCh1_Mode.SelectedIndex], f_range_tbl[cbbLCh1_Range.SelectedIndex], 0);
|
||||
if ((err == lpcie.Errs.OK) && (lch_cnt >= 2))
|
||||
{
|
||||
err = hnd.SetLChannel(1, Convert.ToUInt32(cbbLCh2_Channel.Text) - 1,
|
||||
f_mode_tbl[cbbLCh2_Mode.SelectedIndex], f_range_tbl[cbbLCh2_Range.SelectedIndex], 0);
|
||||
}
|
||||
if ((err == lpcie.Errs.OK) && (lch_cnt >= 3))
|
||||
{
|
||||
err = hnd.SetLChannel(2, Convert.ToUInt32(cbbLCh3_Channel.Text) - 1,
|
||||
f_mode_tbl[cbbLCh3_Mode.SelectedIndex], f_range_tbl[cbbLCh3_Range.SelectedIndex], 0);
|
||||
}
|
||||
|
||||
/* Настраиваем источник частоты синхронизации и запуска сбора */
|
||||
if (err == lpcie.Errs.OK)
|
||||
{
|
||||
hnd.SyncMode = f_sync_tbl[cbbSyncMode.SelectedIndex];
|
||||
hnd.SyncStartMode = f_sync_tbl[cbbSyncStartMode.SelectedIndex];
|
||||
}
|
||||
|
||||
/* настраиваем частоту сбора с АЦП */
|
||||
if (err == lpcie.Errs.OK)
|
||||
err = setAdcFreq();
|
||||
|
||||
/* Записываем настройки в модуль */
|
||||
if (err == lpcie.Errs.OK)
|
||||
err = hnd.Configure(0);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
lpcie.Errs setSyncDinStream()
|
||||
{
|
||||
lpcie.Errs err;
|
||||
/* разрешаем или запрещаем поток синхронного ввода
|
||||
с цифровых линий в зависимости от состояния переключателя */
|
||||
if (chkSyncDin.Checked)
|
||||
err = hnd.StreamsEnable(X502.Streams.DIN);
|
||||
else
|
||||
err = hnd.StreamsDisable(X502.Streams.DIN);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
cbbLChCnt.SelectedIndex = 2;
|
||||
cbbLCh1_Channel.SelectedIndex = 0;
|
||||
cbbLCh2_Channel.SelectedIndex = 1;
|
||||
cbbLCh3_Channel.SelectedIndex = 2;
|
||||
|
||||
cbbLCh1_Range.SelectedIndex = 0;
|
||||
cbbLCh2_Range.SelectedIndex = 0;
|
||||
cbbLCh3_Range.SelectedIndex = 0;
|
||||
|
||||
cbbLCh1_Mode.SelectedIndex = 1;
|
||||
cbbLCh2_Mode.SelectedIndex = 1;
|
||||
cbbLCh3_Mode.SelectedIndex = 1;
|
||||
|
||||
cbbSyncMode.SelectedIndex = 0;
|
||||
cbbSyncStartMode.SelectedIndex = 0;
|
||||
|
||||
rcv_buf = new UInt32[RECV_BUF_SIZE];
|
||||
dinData = new UInt32[RECV_BUF_SIZE];
|
||||
adcData = new double[RECV_BUF_SIZE];
|
||||
|
||||
|
||||
threadRunning = false;
|
||||
|
||||
|
||||
refreshDevList();
|
||||
}
|
||||
|
||||
private void btnRefreshDeviceList_Click(object sender, EventArgs e)
|
||||
{
|
||||
refreshDevList();
|
||||
}
|
||||
|
||||
private void showDevInfo()
|
||||
{
|
||||
/* получаем информацию о модуле */
|
||||
X502.Info devinfo = hnd.DevInfo;
|
||||
/* отображаем ее на панели */
|
||||
chkBfPresent.Checked = (devinfo.DevFlags & X502.DevFlags.BF_PRESENT) != 0;
|
||||
chkDacPresent.Checked = (devinfo.DevFlags & X502.DevFlags.DAC_PRESENT) != 0;
|
||||
chkGalPresent.Checked = (devinfo.DevFlags & X502.DevFlags.GAL_PRESENT) != 0;
|
||||
chkEthSupport.Checked = (devinfo.DevFlags & X502.DevFlags.IFACE_SUPPORT_ETH) != 0;
|
||||
|
||||
edtFpgaVer.Text = devinfo.FpgaVerString;
|
||||
edtPldaVer.Text = string.Format("{0}", devinfo.PldaVer);
|
||||
edtMcuVer.Text = devinfo.McuFirmwareVerString;
|
||||
}
|
||||
|
||||
|
||||
private void btnOpen_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd == null)
|
||||
{
|
||||
lpcie.Errs res;
|
||||
|
||||
int idx = cbbSerialList.SelectedIndex;
|
||||
if (idx >= 0)
|
||||
{
|
||||
/* создаем описатель модуля */
|
||||
hnd = X502.Create(devrecs[idx].DevName);
|
||||
/* устанавливаем связь по выбранному серийному номеру */
|
||||
res = hnd.Open(devrecs[idx]);
|
||||
if (res == lpcie.Errs.OK)
|
||||
{
|
||||
showDevInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(res), "Ошибка открытия модуля", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
hnd = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceClose();
|
||||
}
|
||||
|
||||
updateControls();
|
||||
}
|
||||
|
||||
private void btnOpenByIP_Click(object sender, EventArgs e)
|
||||
{
|
||||
/* создаем запись, соответствующую заданному адресу */
|
||||
X502.DevRec rec = E502.MakeDevRecordByIpAddr(IPAddress.Parse(edtIpAddr.Text), 0, 5000);
|
||||
if (rec != null)
|
||||
{
|
||||
/* создание объекта */
|
||||
hnd = X502.Create(rec.DevName);
|
||||
/* станавливаем связь устанавливаем связь по созданной записи */
|
||||
lpcie.Errs res = hnd.Open(rec);
|
||||
if (res == lpcie.Errs.OK)
|
||||
{
|
||||
showDevInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(res), "Ошибка открытия модуля", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
hnd = null;
|
||||
}
|
||||
}
|
||||
updateControls();
|
||||
|
||||
}
|
||||
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
deviceClose();
|
||||
}
|
||||
|
||||
private void btnSetAdcFreq_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
hnd.LChannelCount = Convert.ToUInt32(cbbLChCnt.Text);
|
||||
|
||||
lpcie.Errs err = setAdcFreq();
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка установки частоты сбора",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAsyncAdcFrame_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
/* устанавливаем параметры модуля */
|
||||
lpcie.Errs err = setupParams();
|
||||
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка настройки параметров АЦП",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
if (err == lpcie.Errs.OK)
|
||||
{
|
||||
UInt32 lch_cnt = hnd.LChannelCount;
|
||||
/* Создаем массив для приема количества отсчетов, равному количеству
|
||||
* логических каналов */
|
||||
double[] adc_data = new double[lch_cnt];
|
||||
err = hnd.AsyncGetAdcFrame(X502.ProcFlags.VOLT, 1000, adc_data);
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка приема кадра АЦП",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* выводим результат */
|
||||
edtLCh1_Result.Text = adc_data[0].ToString("F7");
|
||||
if (lch_cnt >= 2)
|
||||
edtLCh2_Result.Text = adc_data[1].ToString("F7");
|
||||
else
|
||||
edtLCh2_Result.Text = "";
|
||||
|
||||
if (lch_cnt >= 3)
|
||||
edtLCh3_Result.Text = adc_data[2].ToString("F7");
|
||||
else
|
||||
edtLCh3_Result.Text = "";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnAsyncDigIn_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
UInt32 din;
|
||||
lpcie.Errs err = hnd.AsyncInDig(out din);
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка асинхронного ввода с цифровых линий",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
edtAsyncDigIn.Text = din.ToString("X5");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAsyncDigOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
UInt32 val = Convert.ToUInt32(edtAsyncDigOut.Text, 16);
|
||||
lpcie.Errs err = hnd.AsyncOutDig(val, 0);
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка асинхронного вывода на цифровые линии",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAsyncDac1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
double val = Convert.ToDouble(edtAsyncDac1.Text); ;
|
||||
lpcie.Errs err = hnd.AsyncOutDac(X502.DacCh.CH1, val, X502.DacOutFlags.CALIBR |
|
||||
X502.DacOutFlags.VOLT);
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка вывода на ЦАП",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnAsyncDac2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hnd != null)
|
||||
{
|
||||
double val = Convert.ToDouble(edtAsyncDac2.Text); ;
|
||||
lpcie.Errs err = hnd.AsyncOutDac(X502.DacCh.CH2, val, X502.DacOutFlags.CALIBR |
|
||||
X502.DacOutFlags.VOLT);
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка вывода на ЦАП",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnStart_Click(object sender, EventArgs e)
|
||||
{
|
||||
/* настраиваем все параметры в соответствии с элементами управления */
|
||||
lpcie.Errs err = setupParams();
|
||||
|
||||
|
||||
/* разрешаем синхронный ввод АЦП */
|
||||
if (err == lpcie.Errs.OK)
|
||||
err = hnd.StreamsEnable(X502.Streams.ADC);
|
||||
/* разрешаем синхронный ввод с цифровых линий в зависимости от переключателя */
|
||||
if (err == lpcie.Errs.OK)
|
||||
err = setSyncDinStream();
|
||||
|
||||
if (err != lpcie.Errs.OK)
|
||||
{
|
||||
MessageBox.Show(X502.GetErrorString(err), "Ошибка настройки параметров модуля",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* создаем новый поток для сбора в нем данных */
|
||||
thread = new Thread(this.threadFunc);
|
||||
threadRunning = true;
|
||||
thread.Start();
|
||||
updateControls();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnStop_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (threadRunning)
|
||||
reqStop = true;
|
||||
btnStop.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
120
lib/SDK/examples/cs/x502_general/MainForm.resx
Normal file
120
lib/SDK/examples/cs/x502_general/MainForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
20
lib/SDK/examples/cs/x502_general/Program.cs
Normal file
20
lib/SDK/examples/cs/x502_general/Program.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace x502_example
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
lib/SDK/examples/cs/x502_general/Properties/AssemblyInfo.cs
Normal file
36
lib/SDK/examples/cs/x502_general/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("l502_example")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("l502_example")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[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("d011dc13-469b-4bd3-9597-97af3ea785db")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
63
lib/SDK/examples/cs/x502_general/Properties/Resources.Designer.cs
generated
Normal file
63
lib/SDK/examples/cs/x502_general/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.269
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace l502_example.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("l502_example.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
lib/SDK/examples/cs/x502_general/Properties/Resources.resx
Normal file
117
lib/SDK/examples/cs/x502_general/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
lib/SDK/examples/cs/x502_general/Properties/Settings.Designer.cs
generated
Normal file
26
lib/SDK/examples/cs/x502_general/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.269
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace l502_example.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
105
lib/SDK/examples/cs/x502_general/x502_general.csproj
Normal file
105
lib/SDK/examples/cs/x502_general/x502_general.csproj
Normal file
@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>x502_example</RootNamespace>
|
||||
<AssemblyName>x502_example</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="lpcieNet, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lpcieNet\bin\Debug\lpcieNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.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>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
26
lib/SDK/examples/cs/x502_general/x502_general.sln
Normal file
26
lib/SDK/examples/cs/x502_general/x502_general.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C# Express 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "x502_general", "x502_general.csproj", "{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Debug|x86.Build.0 = Debug|x86
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Release|x86.ActiveCfg = Release|x86
|
||||
{491BEE22-2D65-4112-B6A8-90FE8F15E5AE}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Reference in New Issue
Block a user