From 0725bb210d80cd93dde795e2e0eac8e0bbe201fd Mon Sep 17 00:00:00 2001 From: pavel Date: Sun, 25 Jan 2015 06:09:15 +0200 Subject: [PATCH] Cleanup; move commandline makefile to subdir --- commandline/{ => makemake}/Makefile | 27 +- commandline/relay1-pulse.sh | 10 +- windows-vs/VS_GUI_demo/Form1.h | 1367 ++++++++--------- .../{GUIapp.vcproj => GUIapp(vc2008).vcproj} | 0 ...{GUIapp.vcxproj => GUIapp(vc2013).vcxproj} | 0 ...filters => GUIapp(vc2013).vcxproj.filters} | 0 windows-vs/VS_GUI_demo/GUIapp.cpp | 306 ++-- windows-vs/VS_GUI_demo/ReadMe.txt | 3 +- windows-vs/usbrelay(vc2008).sln | 2 +- windows-vs/usbrelay(vc2013).sln | 16 +- 10 files changed, 856 insertions(+), 875 deletions(-) rename commandline/{ => makemake}/Makefile (69%) rename windows-vs/VS_GUI_demo/{GUIapp.vcproj => GUIapp(vc2008).vcproj} (100%) rename windows-vs/VS_GUI_demo/{GUIapp.vcxproj => GUIapp(vc2013).vcxproj} (100%) rename windows-vs/VS_GUI_demo/{GUIapp.vcxproj.filters => GUIapp(vc2013).vcxproj.filters} (100%) diff --git a/commandline/Makefile b/commandline/makemake/Makefile similarity index 69% rename from commandline/Makefile rename to commandline/makemake/Makefile index 0b4d898..cc3b0f1 100644 --- a/commandline/Makefile +++ b/commandline/makemake/Makefile @@ -1,5 +1,5 @@ # Makefile for HID USB relay utility, hidusbrelay-cmd -# pa02 22-apr-2014 +# pa03 24-jan-2015 # # prototype: # Author: Christian Starkjohann @@ -8,16 +8,21 @@ # Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH # License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) +SRCDIR=.. +VPATH = $(SRCDIR) CMD_UTILITY=hidusb-relay-cmd -# For Unix/Linux : +# For Linux # Using old simple version 0.1 of libusb -USBFLAGS= `libusb-config --cflags` -USBLIBS= `libusb-config --libs` +HIDDATA=hiddata_libusb01 +USBFLAGS := $(shell libusb-config --cflags) +USBLIBS := $(shell libusb-config --libs) EXE_SUFFIX= -# Use the following 3 lines on Windows and comment out the 3 above: + +# Use the following lines to build for Windows and comment out the 3 above: +#HIDDATA=hiddata_mswin #USBFLAGS= #USBLIBS= -lhid -lsetupapi #EXE_SUFFIX= .exe @@ -25,15 +30,15 @@ EXE_SUFFIX= #+pa GCC on my ubuntu 12 won't pick this dir by default ?! #USBFLAGS+=-I/usr/include -HIDDATA=hiddata_libusb01 +SRCS = usbrelay-cmd $(HIDDATA) + +PROGRAM= $(CMD_UTILITY)$(EXE_SUFFIX) CC= gcc DEBUGFLAGS= -CFLAGS= -O -Wall $(USBFLAGS) $(DEBUGFLAGS) +CFLAGS= -O -Wall $(USBFLAGS) $(DEBUGFLAGS) -I$(SRCDIR) LIBS= $(USBLIBS) - -OBJ= usbrelay-cmd.o $(HIDDATA).o -PROGRAM= $(CMD_UTILITY)$(EXE_SUFFIX) +OBJ= $(addsuffix .o,$(SRCS)) all: $(PROGRAM) @@ -46,5 +51,5 @@ strip: $(PROGRAM) clean: rm -f $(OBJ) $(PROGRAM) -.c.o: +%.c.o: $(CC) $(ARCH_COMPILE) $(CFLAGS) -c $*.c -o $*.o diff --git a/commandline/relay1-pulse.sh b/commandline/relay1-pulse.sh index df9ff39..8a42b52 100644 --- a/commandline/relay1-pulse.sh +++ b/commandline/relay1-pulse.sh @@ -1,9 +1,11 @@ #!/bin/sh # Pulse USB relay channel for (sec) seconds -# Needs root acccess! run with sudo! -sec=${1} +# If access to the USB device requires root, run with sudo +sec=${1:1} chan=1 SUDO=sudo -$SUDO ./usbrelay-cmd ON $chan +dir="./" + +$SUDO ${dir}hidusbrelay-cmd ON $chan sleep $sec -$SUDO ./usbrelay-cmd OFF $chan +$SUDO ${dir}hidusbrelay-cmd OFF $chan diff --git a/windows-vs/VS_GUI_demo/Form1.h b/windows-vs/VS_GUI_demo/Form1.h index 8919873..50027e3 100644 --- a/windows-vs/VS_GUI_demo/Form1.h +++ b/windows-vs/VS_GUI_demo/Form1.h @@ -1,72 +1,67 @@ #pragma once - namespace GUIapp { - using namespace System; - using namespace System::ComponentModel; - using namespace System::Collections; - using namespace System::Windows::Forms; - using namespace System::Drawing; + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Drawing; + + const int MaxRelaysNum = 8; -// const int MaxRelaysNum = 8; + /// + /// Main form for the demo app + /// + /// WARNING: If you change the name of this class, you will need to change the + /// 'Resource File Name' property for the managed resource compiler tool + /// associated with all .resx files this class depends on. Otherwise, + /// the designers will not be able to interact properly with localized + /// resources associated with this form. + /// + public ref class Form1 : public System::Windows::Forms::Form + { + public: + Form1(void) + { + InitializeComponent(); - /// - /// Main form for the demo app - /// - /// WARNING: If you change the name of this class, you will need to change the - /// 'Resource File Name' property for the managed resource compiler tool - /// associated with all .resx files this class depends on. Otherwise, - /// the designers will not be able to interact properly with localized - /// resources associated with this form. - /// - public ref class Form1 : public System::Windows::Forms::Form - { - public: - Form1(void) - { - InitializeComponent(); + // + // >>> Added constructor code + // + txtMsg->Visible = false; - // - // >>> Added constructor code - // - //++++++++++++++++++++++++++++++++++++++ - txtMsg->Visible = false; arrayFill(aIndicators, IndOn1, IndOn2, IndOn3, IndOn4, IndOn5, IndOn6, IndOn7, IndOn8); - arrayFill(aRNames, Rname1, Rname2, Rname3, Rname4, Rname5, Rname6, Rname7, Rname8); - arrayFill(aButtonsOpen, Ropen1, Ropen2, Ropen3, Ropen4, Ropen5, Ropen6, Ropen7, Ropen8); - arrayFill(aButtonsClose, Rclose1, Rclose2, Rclose3, Rclose4, Rclose5, Rclose6, Rclose7, Rclose8); + arrayFill(aRNames, Rname1, Rname2, Rname3, Rname4, Rname5, Rname6, Rname7, Rname8); + arrayFill(aButtonsOpen, Ropen1, Ropen2, Ropen3, Ropen4, Ropen5, Ropen6, Ropen7, Ropen8); + arrayFill(aButtonsClose, Rclose1, Rclose2, Rclose3, Rclose4, Rclose5, Rclose6, Rclose7, Rclose8); - for ( int i = 0; i < MaxRelaysNum; i++ ) { - System::Windows::Forms::Button^ b; - b = static_cast(aButtonsOpen->GetValue(i)); - b->Text = L"Open"; - b->Click += gcnew System::EventHandler(this, &Form1::Ropen1_Click); - b = static_cast(aButtonsClose->GetValue(i)); - b->Text = L"Close"; - b->Click += gcnew System::EventHandler(this, &Form1::Rclose1_Click); - System::Windows::Forms::TextBox^ t; - t = static_cast(aRNames->GetValue(i)); - t->Text = L"Relay " + i.ToString(); - t = static_cast(aIndicators->GetValue(i)); - } - //------------------------------------- - } + for ( int i = 0; i < MaxRelaysNum; i++ ) { + System::Windows::Forms::Button^ b; + b = static_cast(aButtonsOpen->GetValue(i)); + b->Text = L"Open"; + b->Click += gcnew System::EventHandler(this, &Form1::Ropen1_Click); + b = static_cast(aButtonsClose->GetValue(i)); + b->Text = L"Close"; + b->Click += gcnew System::EventHandler(this, &Form1::Rclose1_Click); + System::Windows::Forms::TextBox^ t; + t = static_cast(aRNames->GetValue(i)); + t->Text = L"Relay " + i.ToString(); + t = static_cast(aIndicators->GetValue(i)); + } + } - //+++++++++++++++++++++++ - //array^ aButtonsOpen; - Array^ aButtonsOpen; - Array^ aButtonsClose; - Array^ aRNames; - private: System::Windows::Forms::Label^ txtMsg; - public: + private: + Array^ aButtonsOpen; + Array^ aButtonsClose; + Array^ aRNames; + Array^ aIndicators; - public: - Array^ aIndicators; + System::Windows::Forms::Label^ txtMsg; - template void arrayFill( Array^% aa, Ty t0, Ty t1, Ty t2, Ty t3, Ty t4, Ty t5, Ty t6, Ty t7) - { - aa = Array::CreateInstance(Ty::typeid, MaxRelaysNum); + template void arrayFill( Array^% aa, Ty t0, Ty t1, Ty t2, Ty t3, Ty t4, Ty t5, Ty t6, Ty t7) + { + aa = Array::CreateInstance(Ty::typeid, MaxRelaysNum); aa->SetValue(t0, 0); aa->SetValue(t1, 1); aa->SetValue(t2, 2); @@ -76,657 +71,659 @@ namespace GUIapp { aa->SetValue(t6, 6); aa->SetValue(t7, 7); - t0->Tag = gcnew System::Int16(0); - t1->Tag = gcnew System::Int16(1); - t2->Tag = gcnew System::Int16(2); - t3->Tag = gcnew System::Int16(3); - t4->Tag = gcnew System::Int16(4); - t5->Tag = gcnew System::Int16(5); - t6->Tag = gcnew System::Int16(6); - t7->Tag = gcnew System::Int16(7); - } + t0->Tag = gcnew System::Int16(0); + t1->Tag = gcnew System::Int16(1); + t2->Tag = gcnew System::Int16(2); + t3->Tag = gcnew System::Int16(3); + t4->Tag = gcnew System::Int16(4); + t5->Tag = gcnew System::Int16(5); + t6->Tag = gcnew System::Int16(6); + t7->Tag = gcnew System::Int16(7); + } - //------------------------ + //---------- End of added construction code -------------- - protected: - /// - /// Clean up any resources being used. - /// - ~Form1() - { - if (components) - { - delete components; - } - } + protected: + /// + /// Clean up any resources being used. + /// + ~Form1() + { + if (components) + { + delete components; + } + } - private: System::Windows::Forms::Button^ buttonFind; - private: System::Windows::Forms::ComboBox^ comboDevices; - private: System::Windows::Forms::Button^ buttonOpen; - private: System::Windows::Forms::TextBox^ IndOpen; - private: System::Windows::Forms::Button^ buttonClose; - private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel1; + private: System::Windows::Forms::Button^ buttonFind; + private: System::Windows::Forms::ComboBox^ comboDevices; + private: System::Windows::Forms::Button^ buttonOpen; + private: System::Windows::Forms::TextBox^ IndOpen; + private: System::Windows::Forms::Button^ buttonClose; + private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel1; - private: System::Windows::Forms::TextBox^ Rname1; - private: System::Windows::Forms::TextBox^ Rname2; - private: System::Windows::Forms::TextBox^ Rname3; - private: System::Windows::Forms::TextBox^ Rname4; - private: System::Windows::Forms::TextBox^ Rname5; - private: System::Windows::Forms::TextBox^ Rname6; - private: System::Windows::Forms::TextBox^ Rname7; - private: System::Windows::Forms::TextBox^ Rname8; + private: System::Windows::Forms::TextBox^ Rname1; + private: System::Windows::Forms::TextBox^ Rname2; + private: System::Windows::Forms::TextBox^ Rname3; + private: System::Windows::Forms::TextBox^ Rname4; + private: System::Windows::Forms::TextBox^ Rname5; + private: System::Windows::Forms::TextBox^ Rname6; + private: System::Windows::Forms::TextBox^ Rname7; + private: System::Windows::Forms::TextBox^ Rname8; - private: System::Windows::Forms::TextBox^ IndOn1; - private: System::Windows::Forms::TextBox^ IndOn2; - private: System::Windows::Forms::TextBox^ IndOn3; - private: System::Windows::Forms::TextBox^ IndOn4; - private: System::Windows::Forms::TextBox^ IndOn5; - private: System::Windows::Forms::TextBox^ IndOn6; - private: System::Windows::Forms::TextBox^ IndOn7; - private: System::Windows::Forms::TextBox^ IndOn8; + private: System::Windows::Forms::TextBox^ IndOn1; + private: System::Windows::Forms::TextBox^ IndOn2; + private: System::Windows::Forms::TextBox^ IndOn3; + private: System::Windows::Forms::TextBox^ IndOn4; + private: System::Windows::Forms::TextBox^ IndOn5; + private: System::Windows::Forms::TextBox^ IndOn6; + private: System::Windows::Forms::TextBox^ IndOn7; + private: System::Windows::Forms::TextBox^ IndOn8; - private: System::Windows::Forms::Button^ Rclose8; - private: System::Windows::Forms::Button^ Rclose7; - private: System::Windows::Forms::Button^ Rclose6; - private: System::Windows::Forms::Button^ Rclose5; - private: System::Windows::Forms::Button^ Rclose4; - private: System::Windows::Forms::Button^ Rclose3; - private: System::Windows::Forms::Button^ Rclose2; - private: System::Windows::Forms::Button^ Rclose1; + private: System::Windows::Forms::Button^ Rclose8; + private: System::Windows::Forms::Button^ Rclose7; + private: System::Windows::Forms::Button^ Rclose6; + private: System::Windows::Forms::Button^ Rclose5; + private: System::Windows::Forms::Button^ Rclose4; + private: System::Windows::Forms::Button^ Rclose3; + private: System::Windows::Forms::Button^ Rclose2; + private: System::Windows::Forms::Button^ Rclose1; - private: System::Windows::Forms::Button^ Ropen1; - private: System::Windows::Forms::Button^ Ropen2; - private: System::Windows::Forms::Button^ Ropen3; - private: System::Windows::Forms::Button^ Ropen4; - private: System::Windows::Forms::Button^ Ropen5; - private: System::Windows::Forms::Button^ Ropen6; - private: System::Windows::Forms::Button^ Ropen7; - private: System::Windows::Forms::Button^ Ropen8; + private: System::Windows::Forms::Button^ Ropen1; + private: System::Windows::Forms::Button^ Ropen2; + private: System::Windows::Forms::Button^ Ropen3; + private: System::Windows::Forms::Button^ Ropen4; + private: System::Windows::Forms::Button^ Ropen5; + private: System::Windows::Forms::Button^ Ropen6; + private: System::Windows::Forms::Button^ Ropen7; + private: System::Windows::Forms::Button^ Ropen8; - private: System::Windows::Forms::Button^ RopenAll; - private: System::Windows::Forms::Button^ RcloseAll; + private: System::Windows::Forms::Button^ RopenAll; + private: System::Windows::Forms::Button^ RcloseAll; - private: - /// - /// Required designer variable. - /// - System::ComponentModel::Container ^components; + private: + /// + /// Required designer variable. + /// + System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - void InitializeComponent(void) - { - this->buttonFind = (gcnew System::Windows::Forms::Button()); - this->comboDevices = (gcnew System::Windows::Forms::ComboBox()); - this->buttonOpen = (gcnew System::Windows::Forms::Button()); - this->IndOpen = (gcnew System::Windows::Forms::TextBox()); - this->buttonClose = (gcnew System::Windows::Forms::Button()); - this->tableLayoutPanel1 = (gcnew System::Windows::Forms::TableLayoutPanel()); - this->Rclose8 = (gcnew System::Windows::Forms::Button()); - this->Rclose7 = (gcnew System::Windows::Forms::Button()); - this->Rclose6 = (gcnew System::Windows::Forms::Button()); - this->Rclose5 = (gcnew System::Windows::Forms::Button()); - this->Rclose4 = (gcnew System::Windows::Forms::Button()); - this->Rclose3 = (gcnew System::Windows::Forms::Button()); - this->Rclose2 = (gcnew System::Windows::Forms::Button()); - this->Rname1 = (gcnew System::Windows::Forms::TextBox()); - this->Rname2 = (gcnew System::Windows::Forms::TextBox()); - this->Rname3 = (gcnew System::Windows::Forms::TextBox()); - this->Rname4 = (gcnew System::Windows::Forms::TextBox()); - this->Rname5 = (gcnew System::Windows::Forms::TextBox()); - this->Rname6 = (gcnew System::Windows::Forms::TextBox()); - this->Rname7 = (gcnew System::Windows::Forms::TextBox()); - this->Rname8 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn2 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn3 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn4 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn5 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn6 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn7 = (gcnew System::Windows::Forms::TextBox()); - this->IndOn8 = (gcnew System::Windows::Forms::TextBox()); - this->Ropen1 = (gcnew System::Windows::Forms::Button()); - this->Ropen2 = (gcnew System::Windows::Forms::Button()); - this->Ropen3 = (gcnew System::Windows::Forms::Button()); - this->Ropen4 = (gcnew System::Windows::Forms::Button()); - this->Ropen5 = (gcnew System::Windows::Forms::Button()); - this->Ropen6 = (gcnew System::Windows::Forms::Button()); - this->Ropen7 = (gcnew System::Windows::Forms::Button()); - this->Ropen8 = (gcnew System::Windows::Forms::Button()); - this->IndOn1 = (gcnew System::Windows::Forms::TextBox()); - this->Rclose1 = (gcnew System::Windows::Forms::Button()); - this->RopenAll = (gcnew System::Windows::Forms::Button()); - this->RcloseAll = (gcnew System::Windows::Forms::Button()); - this->txtMsg = (gcnew System::Windows::Forms::Label()); - this->tableLayoutPanel1->SuspendLayout(); - this->SuspendLayout(); - // - // buttonFind - // - this->buttonFind->Location = System::Drawing::Point(7, 9); - this->buttonFind->Name = L"buttonFind"; - this->buttonFind->Size = System::Drawing::Size(104, 24); - this->buttonFind->TabIndex = 0; - this->buttonFind->Tag = L"99"; - this->buttonFind->Text = L"Find device"; - this->buttonFind->UseVisualStyleBackColor = true; - this->buttonFind->Click += gcnew System::EventHandler(this, &Form1::buttonFind_Click); - // - // comboDevices - // - this->comboDevices->FormattingEnabled = true; - this->comboDevices->ItemHeight = 13; - this->comboDevices->Location = System::Drawing::Point(137, 11); - this->comboDevices->Name = L"comboDevices"; - this->comboDevices->Size = System::Drawing::Size(167, 21); - this->comboDevices->TabIndex = 1; - // - // buttonOpen - // - this->buttonOpen->Location = System::Drawing::Point(7, 67); - this->buttonOpen->Name = L"buttonOpen"; - this->buttonOpen->Size = System::Drawing::Size(104, 24); - this->buttonOpen->TabIndex = 2; - this->buttonOpen->Text = L"Open device"; - this->buttonOpen->UseVisualStyleBackColor = true; - this->buttonOpen->Click += gcnew System::EventHandler(this, &Form1::buttonOpen_Click); - // - // IndOpen - // - this->IndOpen->BackColor = System::Drawing::Color::Red; - this->IndOpen->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOpen->Location = System::Drawing::Point(126, 71); - this->IndOpen->Name = L"IndOpen"; - this->IndOpen->Size = System::Drawing::Size(42, 20); - this->IndOpen->TabIndex = 3; - this->IndOpen->TabStop = false; - // - // buttonClose - // - this->buttonClose->Location = System::Drawing::Point(187, 68); - this->buttonClose->Name = L"buttonClose"; - this->buttonClose->Size = System::Drawing::Size(116, 24); - this->buttonClose->TabIndex = 4; - this->buttonClose->Text = L"Close device"; - this->buttonClose->UseVisualStyleBackColor = true; - this->buttonClose->Click += gcnew System::EventHandler(this, &Form1::buttonClose_Click); - // - // tableLayoutPanel1 - // - this->tableLayoutPanel1->ColumnCount = 4; - this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, - 30))); - this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, - 25))); - this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, - 20))); - this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, - 25))); - this->tableLayoutPanel1->Controls->Add(this->Rclose8, 3, 7); - this->tableLayoutPanel1->Controls->Add(this->Rclose7, 3, 6); - this->tableLayoutPanel1->Controls->Add(this->Rclose6, 3, 5); - this->tableLayoutPanel1->Controls->Add(this->Rclose5, 3, 4); - this->tableLayoutPanel1->Controls->Add(this->Rclose4, 3, 3); - this->tableLayoutPanel1->Controls->Add(this->Rclose3, 3, 2); - this->tableLayoutPanel1->Controls->Add(this->Rclose2, 3, 1); - this->tableLayoutPanel1->Controls->Add(this->Rname1, 0, 0); - this->tableLayoutPanel1->Controls->Add(this->Rname2, 0, 1); - this->tableLayoutPanel1->Controls->Add(this->Rname3, 0, 2); - this->tableLayoutPanel1->Controls->Add(this->Rname4, 0, 3); - this->tableLayoutPanel1->Controls->Add(this->Rname5, 0, 4); - this->tableLayoutPanel1->Controls->Add(this->Rname6, 0, 5); - this->tableLayoutPanel1->Controls->Add(this->Rname7, 0, 6); - this->tableLayoutPanel1->Controls->Add(this->Rname8, 0, 7); - this->tableLayoutPanel1->Controls->Add(this->IndOn2, 2, 1); - this->tableLayoutPanel1->Controls->Add(this->IndOn3, 2, 2); - this->tableLayoutPanel1->Controls->Add(this->IndOn4, 2, 3); - this->tableLayoutPanel1->Controls->Add(this->IndOn5, 2, 4); - this->tableLayoutPanel1->Controls->Add(this->IndOn6, 2, 5); - this->tableLayoutPanel1->Controls->Add(this->IndOn7, 2, 6); - this->tableLayoutPanel1->Controls->Add(this->IndOn8, 2, 7); - this->tableLayoutPanel1->Controls->Add(this->Ropen1, 1, 0); - this->tableLayoutPanel1->Controls->Add(this->Ropen2, 1, 1); - this->tableLayoutPanel1->Controls->Add(this->Ropen3, 1, 2); - this->tableLayoutPanel1->Controls->Add(this->Ropen4, 1, 3); - this->tableLayoutPanel1->Controls->Add(this->Ropen5, 1, 4); - this->tableLayoutPanel1->Controls->Add(this->Ropen6, 1, 5); - this->tableLayoutPanel1->Controls->Add(this->Ropen7, 1, 6); - this->tableLayoutPanel1->Controls->Add(this->Ropen8, 1, 7); - this->tableLayoutPanel1->Controls->Add(this->IndOn1, 2, 0); - this->tableLayoutPanel1->Controls->Add(this->Rclose1, 3, 0); - this->tableLayoutPanel1->Location = System::Drawing::Point(11, 101); - this->tableLayoutPanel1->Name = L"tableLayoutPanel1"; - this->tableLayoutPanel1->RowCount = 8; - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); - this->tableLayoutPanel1->Size = System::Drawing::Size(292, 291); - this->tableLayoutPanel1->TabIndex = 5; - // - // Rclose8 - // - this->Rclose8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose8->Location = System::Drawing::Point(221, 261); - this->Rclose8->Name = L"Rclose8"; - this->Rclose8->Size = System::Drawing::Size(68, 20); - this->Rclose8->TabIndex = 30; - this->Rclose8->Text = L"button19"; - this->Rclose8->UseVisualStyleBackColor = true; - // - // Rclose7 - // - this->Rclose7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose7->Location = System::Drawing::Point(221, 224); - this->Rclose7->Name = L"Rclose7"; - this->Rclose7->Size = System::Drawing::Size(68, 20); - this->Rclose7->TabIndex = 29; - this->Rclose7->Text = L"button18"; - this->Rclose7->UseVisualStyleBackColor = true; - // - // Rclose6 - // - this->Rclose6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose6->Location = System::Drawing::Point(221, 188); - this->Rclose6->Name = L"Rclose6"; - this->Rclose6->Size = System::Drawing::Size(68, 20); - this->Rclose6->TabIndex = 28; - this->Rclose6->Text = L"button17"; - this->Rclose6->UseVisualStyleBackColor = true; - // - // Rclose5 - // - this->Rclose5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose5->Location = System::Drawing::Point(221, 152); - this->Rclose5->Name = L"Rclose5"; - this->Rclose5->Size = System::Drawing::Size(68, 20); - this->Rclose5->TabIndex = 27; - this->Rclose5->Text = L"button16"; - this->Rclose5->UseVisualStyleBackColor = true; - // - // Rclose4 - // - this->Rclose4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose4->Location = System::Drawing::Point(221, 116); - this->Rclose4->Name = L"Rclose4"; - this->Rclose4->Size = System::Drawing::Size(68, 20); - this->Rclose4->TabIndex = 26; - this->Rclose4->Text = L"button15"; - this->Rclose4->UseVisualStyleBackColor = true; - // - // Rclose3 - // - this->Rclose3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose3->Location = System::Drawing::Point(221, 80); - this->Rclose3->Name = L"Rclose3"; - this->Rclose3->Size = System::Drawing::Size(68, 20); - this->Rclose3->TabIndex = 25; - this->Rclose3->Text = L"button14"; - this->Rclose3->UseVisualStyleBackColor = true; - // - // Rclose2 - // - this->Rclose2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose2->Location = System::Drawing::Point(221, 44); - this->Rclose2->Name = L"Rclose2"; - this->Rclose2->Size = System::Drawing::Size(68, 20); - this->Rclose2->TabIndex = 24; - this->Rclose2->Text = L"button13"; - this->Rclose2->UseVisualStyleBackColor = true; - // - // Rname1 - // - this->Rname1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname1->Location = System::Drawing::Point(3, 8); - this->Rname1->MaxLength = 64; - this->Rname1->Name = L"Rname1"; - this->Rname1->Size = System::Drawing::Size(81, 20); - this->Rname1->TabIndex = 0; - // - // Rname2 - // - this->Rname2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname2->Location = System::Drawing::Point(3, 44); - this->Rname2->MaxLength = 64; - this->Rname2->Name = L"Rname2"; - this->Rname2->Size = System::Drawing::Size(81, 20); - this->Rname2->TabIndex = 1; - // - // Rname3 - // - this->Rname3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname3->Location = System::Drawing::Point(3, 80); - this->Rname3->MaxLength = 64; - this->Rname3->Name = L"Rname3"; - this->Rname3->Size = System::Drawing::Size(81, 20); - this->Rname3->TabIndex = 2; - // - // Rname4 - // - this->Rname4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname4->Location = System::Drawing::Point(3, 116); - this->Rname4->MaxLength = 64; - this->Rname4->Name = L"Rname4"; - this->Rname4->Size = System::Drawing::Size(81, 20); - this->Rname4->TabIndex = 3; - // - // Rname5 - // - this->Rname5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname5->Location = System::Drawing::Point(3, 152); - this->Rname5->MaxLength = 64; - this->Rname5->Name = L"Rname5"; - this->Rname5->Size = System::Drawing::Size(81, 20); - this->Rname5->TabIndex = 4; - // - // Rname6 - // - this->Rname6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname6->Location = System::Drawing::Point(3, 188); - this->Rname6->MaxLength = 64; - this->Rname6->Name = L"Rname6"; - this->Rname6->Size = System::Drawing::Size(81, 20); - this->Rname6->TabIndex = 5; - // - // Rname7 - // - this->Rname7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname7->Location = System::Drawing::Point(3, 224); - this->Rname7->MaxLength = 64; - this->Rname7->Name = L"Rname7"; - this->Rname7->Size = System::Drawing::Size(81, 20); - this->Rname7->TabIndex = 6; - // - // Rname8 - // - this->Rname8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rname8->Location = System::Drawing::Point(3, 261); - this->Rname8->MaxLength = 64; - this->Rname8->Name = L"Rname8"; - this->Rname8->Size = System::Drawing::Size(81, 20); - this->Rname8->TabIndex = 7; - // - // IndOn2 - // - this->IndOn2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn2->BackColor = System::Drawing::Color::Red; - this->IndOn2->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn2->Location = System::Drawing::Point(163, 44); - this->IndOn2->Name = L"IndOn2"; - this->IndOn2->ReadOnly = true; - this->IndOn2->Size = System::Drawing::Size(52, 20); - this->IndOn2->TabIndex = 8; - this->IndOn2->TabStop = false; - // - // IndOn3 - // - this->IndOn3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn3->BackColor = System::Drawing::Color::Red; - this->IndOn3->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn3->Location = System::Drawing::Point(163, 80); - this->IndOn3->Name = L"IndOn3"; - this->IndOn3->ReadOnly = true; - this->IndOn3->Size = System::Drawing::Size(52, 20); - this->IndOn3->TabIndex = 9; - this->IndOn3->TabStop = false; - // - // IndOn4 - // - this->IndOn4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn4->BackColor = System::Drawing::Color::Red; - this->IndOn4->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn4->Location = System::Drawing::Point(163, 116); - this->IndOn4->Name = L"IndOn4"; - this->IndOn4->ReadOnly = true; - this->IndOn4->Size = System::Drawing::Size(52, 20); - this->IndOn4->TabIndex = 10; - this->IndOn4->TabStop = false; - // - // IndOn5 - // - this->IndOn5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn5->BackColor = System::Drawing::Color::Red; - this->IndOn5->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn5->Location = System::Drawing::Point(163, 152); - this->IndOn5->Name = L"IndOn5"; - this->IndOn5->ReadOnly = true; - this->IndOn5->Size = System::Drawing::Size(52, 20); - this->IndOn5->TabIndex = 11; - this->IndOn5->TabStop = false; - // - // IndOn6 - // - this->IndOn6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn6->BackColor = System::Drawing::Color::Red; - this->IndOn6->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn6->Location = System::Drawing::Point(163, 188); - this->IndOn6->Name = L"IndOn6"; - this->IndOn6->ReadOnly = true; - this->IndOn6->Size = System::Drawing::Size(52, 20); - this->IndOn6->TabIndex = 12; - this->IndOn6->TabStop = false; - // - // IndOn7 - // - this->IndOn7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn7->BackColor = System::Drawing::Color::Red; - this->IndOn7->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn7->Location = System::Drawing::Point(163, 224); - this->IndOn7->Name = L"IndOn7"; - this->IndOn7->ReadOnly = true; - this->IndOn7->Size = System::Drawing::Size(52, 20); - this->IndOn7->TabIndex = 13; - this->IndOn7->TabStop = false; - // - // IndOn8 - // - this->IndOn8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn8->BackColor = System::Drawing::Color::Red; - this->IndOn8->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn8->Location = System::Drawing::Point(163, 261); - this->IndOn8->Name = L"IndOn8"; - this->IndOn8->ReadOnly = true; - this->IndOn8->Size = System::Drawing::Size(52, 20); - this->IndOn8->TabIndex = 14; - this->IndOn8->TabStop = false; - // - // Ropen1 - // - this->Ropen1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen1->Location = System::Drawing::Point(90, 8); - this->Ropen1->Name = L"Ropen1"; - this->Ropen1->Size = System::Drawing::Size(67, 20); - this->Ropen1->TabIndex = 15; - this->Ropen1->Text = L"button4"; - this->Ropen1->UseVisualStyleBackColor = true; - // - // Ropen2 - // - this->Ropen2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen2->Location = System::Drawing::Point(90, 44); - this->Ropen2->Name = L"Ropen2"; - this->Ropen2->Size = System::Drawing::Size(67, 20); - this->Ropen2->TabIndex = 16; - this->Ropen2->Text = L"button5"; - this->Ropen2->UseVisualStyleBackColor = true; - // - // Ropen3 - // - this->Ropen3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen3->Location = System::Drawing::Point(90, 80); - this->Ropen3->Name = L"Ropen3"; - this->Ropen3->Size = System::Drawing::Size(67, 20); - this->Ropen3->TabIndex = 17; - this->Ropen3->Text = L"button6"; - this->Ropen3->UseVisualStyleBackColor = true; - // - // Ropen4 - // - this->Ropen4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen4->Location = System::Drawing::Point(90, 116); - this->Ropen4->Name = L"Ropen4"; - this->Ropen4->Size = System::Drawing::Size(67, 20); - this->Ropen4->TabIndex = 18; - this->Ropen4->Text = L"button7"; - this->Ropen4->UseVisualStyleBackColor = true; - // - // Ropen5 - // - this->Ropen5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen5->Location = System::Drawing::Point(90, 152); - this->Ropen5->Name = L"Ropen5"; - this->Ropen5->Size = System::Drawing::Size(67, 20); - this->Ropen5->TabIndex = 19; - this->Ropen5->Text = L"button8"; - this->Ropen5->UseVisualStyleBackColor = true; - // - // Ropen6 - // - this->Ropen6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen6->Location = System::Drawing::Point(90, 188); - this->Ropen6->Name = L"Ropen6"; - this->Ropen6->Size = System::Drawing::Size(67, 20); - this->Ropen6->TabIndex = 20; - this->Ropen6->Text = L"button9"; - this->Ropen6->UseVisualStyleBackColor = true; - // - // Ropen7 - // - this->Ropen7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen7->Location = System::Drawing::Point(90, 224); - this->Ropen7->Name = L"Ropen7"; - this->Ropen7->Size = System::Drawing::Size(67, 20); - this->Ropen7->TabIndex = 21; - this->Ropen7->Text = L"button10"; - this->Ropen7->UseVisualStyleBackColor = true; - // - // Ropen8 - // - this->Ropen8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Ropen8->Location = System::Drawing::Point(90, 261); - this->Ropen8->Name = L"Ropen8"; - this->Ropen8->Size = System::Drawing::Size(67, 20); - this->Ropen8->TabIndex = 22; - this->Ropen8->Text = L"button11"; - this->Ropen8->UseVisualStyleBackColor = true; - // - // IndOn1 - // - this->IndOn1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->IndOn1->BackColor = System::Drawing::Color::Red; - this->IndOn1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; - this->IndOn1->Location = System::Drawing::Point(163, 8); - this->IndOn1->Name = L"IndOn1"; - this->IndOn1->ReadOnly = true; - this->IndOn1->Size = System::Drawing::Size(52, 20); - this->IndOn1->TabIndex = 6; - this->IndOn1->TabStop = false; - // - // Rclose1 - // - this->Rclose1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); - this->Rclose1->Location = System::Drawing::Point(221, 8); - this->Rclose1->Name = L"Rclose1"; - this->Rclose1->Size = System::Drawing::Size(68, 20); - this->Rclose1->TabIndex = 23; - this->Rclose1->Text = L"button12"; - this->Rclose1->UseVisualStyleBackColor = true; - // - // RopenAll - // - this->RopenAll->Location = System::Drawing::Point(11, 398); - this->RopenAll->Name = L"RopenAll"; - this->RopenAll->Size = System::Drawing::Size(108, 35); - this->RopenAll->TabIndex = 6; - this->RopenAll->Text = L"Open All"; - this->RopenAll->UseVisualStyleBackColor = true; - this->RopenAll->Click += gcnew System::EventHandler(this, &Form1::RopenAll_Click); - // - // RcloseAll - // - this->RcloseAll->Location = System::Drawing::Point(191, 398); - this->RcloseAll->Name = L"RcloseAll"; - this->RcloseAll->Size = System::Drawing::Size(108, 35); - this->RcloseAll->TabIndex = 7; - this->RcloseAll->Text = L"Close All"; - this->RcloseAll->UseVisualStyleBackColor = true; - this->RcloseAll->Click += gcnew System::EventHandler(this, &Form1::RcloseAll_Click); - // - // txtMsg - // - this->txtMsg->AutoSize = true; - this->txtMsg->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, - static_cast(0))); - this->txtMsg->ForeColor = System::Drawing::Color::White; - this->txtMsg->Location = System::Drawing::Point(12, 41); - this->txtMsg->Name = L"txtMsg"; - this->txtMsg->Size = System::Drawing::Size(46, 17); - this->txtMsg->TabIndex = 8; - this->txtMsg->Text = L"label1"; - this->txtMsg->Click += gcnew System::EventHandler(this, &Form1::txtMsg_Click); - // - // Form1 - // - this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); - this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; - this->ClientSize = System::Drawing::Size(318, 448); - this->Controls->Add(this->txtMsg); - this->Controls->Add(this->RcloseAll); - this->Controls->Add(this->RopenAll); - this->Controls->Add(this->tableLayoutPanel1); - this->Controls->Add(this->buttonClose); - this->Controls->Add(this->IndOpen); - this->Controls->Add(this->buttonOpen); - this->Controls->Add(this->comboDevices); - this->Controls->Add(this->buttonFind); - this->Name = L"Form1"; - this->Text = L"USB Relay Manager"; - this->tableLayoutPanel1->ResumeLayout(false); - this->tableLayoutPanel1->PerformLayout(); - this->ResumeLayout(false); - this->PerformLayout(); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + void InitializeComponent(void) + { + this->buttonFind = (gcnew System::Windows::Forms::Button()); + this->comboDevices = (gcnew System::Windows::Forms::ComboBox()); + this->buttonOpen = (gcnew System::Windows::Forms::Button()); + this->IndOpen = (gcnew System::Windows::Forms::TextBox()); + this->buttonClose = (gcnew System::Windows::Forms::Button()); + this->tableLayoutPanel1 = (gcnew System::Windows::Forms::TableLayoutPanel()); + this->Rclose8 = (gcnew System::Windows::Forms::Button()); + this->Rclose7 = (gcnew System::Windows::Forms::Button()); + this->Rclose6 = (gcnew System::Windows::Forms::Button()); + this->Rclose5 = (gcnew System::Windows::Forms::Button()); + this->Rclose4 = (gcnew System::Windows::Forms::Button()); + this->Rclose3 = (gcnew System::Windows::Forms::Button()); + this->Rclose2 = (gcnew System::Windows::Forms::Button()); + this->Rname1 = (gcnew System::Windows::Forms::TextBox()); + this->Rname2 = (gcnew System::Windows::Forms::TextBox()); + this->Rname3 = (gcnew System::Windows::Forms::TextBox()); + this->Rname4 = (gcnew System::Windows::Forms::TextBox()); + this->Rname5 = (gcnew System::Windows::Forms::TextBox()); + this->Rname6 = (gcnew System::Windows::Forms::TextBox()); + this->Rname7 = (gcnew System::Windows::Forms::TextBox()); + this->Rname8 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn2 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn3 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn4 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn5 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn6 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn7 = (gcnew System::Windows::Forms::TextBox()); + this->IndOn8 = (gcnew System::Windows::Forms::TextBox()); + this->Ropen1 = (gcnew System::Windows::Forms::Button()); + this->Ropen2 = (gcnew System::Windows::Forms::Button()); + this->Ropen3 = (gcnew System::Windows::Forms::Button()); + this->Ropen4 = (gcnew System::Windows::Forms::Button()); + this->Ropen5 = (gcnew System::Windows::Forms::Button()); + this->Ropen6 = (gcnew System::Windows::Forms::Button()); + this->Ropen7 = (gcnew System::Windows::Forms::Button()); + this->Ropen8 = (gcnew System::Windows::Forms::Button()); + this->IndOn1 = (gcnew System::Windows::Forms::TextBox()); + this->Rclose1 = (gcnew System::Windows::Forms::Button()); + this->RopenAll = (gcnew System::Windows::Forms::Button()); + this->RcloseAll = (gcnew System::Windows::Forms::Button()); + this->txtMsg = (gcnew System::Windows::Forms::Label()); + this->tableLayoutPanel1->SuspendLayout(); + this->SuspendLayout(); + // + // buttonFind + // + this->buttonFind->Location = System::Drawing::Point(7, 9); + this->buttonFind->Name = L"buttonFind"; + this->buttonFind->Size = System::Drawing::Size(104, 24); + this->buttonFind->TabIndex = 0; + this->buttonFind->Tag = L"99"; + this->buttonFind->Text = L"Find device"; + this->buttonFind->UseVisualStyleBackColor = true; + this->buttonFind->Click += gcnew System::EventHandler(this, &Form1::buttonFind_Click); + // + // comboDevices + // + this->comboDevices->FormattingEnabled = true; + this->comboDevices->ItemHeight = 13; + this->comboDevices->Location = System::Drawing::Point(137, 11); + this->comboDevices->Name = L"comboDevices"; + this->comboDevices->Size = System::Drawing::Size(167, 21); + this->comboDevices->TabIndex = 1; + // + // buttonOpen + // + this->buttonOpen->Location = System::Drawing::Point(7, 67); + this->buttonOpen->Name = L"buttonOpen"; + this->buttonOpen->Size = System::Drawing::Size(104, 24); + this->buttonOpen->TabIndex = 2; + this->buttonOpen->Text = L"Open device"; + this->buttonOpen->UseVisualStyleBackColor = true; + this->buttonOpen->Click += gcnew System::EventHandler(this, &Form1::buttonOpen_Click); + // + // IndOpen + // + this->IndOpen->BackColor = System::Drawing::Color::Red; + this->IndOpen->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOpen->Location = System::Drawing::Point(126, 71); + this->IndOpen->Name = L"IndOpen"; + this->IndOpen->Size = System::Drawing::Size(42, 20); + this->IndOpen->TabIndex = 3; + this->IndOpen->TabStop = false; + // + // buttonClose + // + this->buttonClose->Location = System::Drawing::Point(187, 68); + this->buttonClose->Name = L"buttonClose"; + this->buttonClose->Size = System::Drawing::Size(116, 24); + this->buttonClose->TabIndex = 4; + this->buttonClose->Text = L"Close device"; + this->buttonClose->UseVisualStyleBackColor = true; + this->buttonClose->Click += gcnew System::EventHandler(this, &Form1::buttonClose_Click); + // + // tableLayoutPanel1 + // + this->tableLayoutPanel1->ColumnCount = 4; + this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, + 30))); + this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, + 25))); + this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, + 20))); + this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, + 25))); + this->tableLayoutPanel1->Controls->Add(this->Rclose8, 3, 7); + this->tableLayoutPanel1->Controls->Add(this->Rclose7, 3, 6); + this->tableLayoutPanel1->Controls->Add(this->Rclose6, 3, 5); + this->tableLayoutPanel1->Controls->Add(this->Rclose5, 3, 4); + this->tableLayoutPanel1->Controls->Add(this->Rclose4, 3, 3); + this->tableLayoutPanel1->Controls->Add(this->Rclose3, 3, 2); + this->tableLayoutPanel1->Controls->Add(this->Rclose2, 3, 1); + this->tableLayoutPanel1->Controls->Add(this->Rname1, 0, 0); + this->tableLayoutPanel1->Controls->Add(this->Rname2, 0, 1); + this->tableLayoutPanel1->Controls->Add(this->Rname3, 0, 2); + this->tableLayoutPanel1->Controls->Add(this->Rname4, 0, 3); + this->tableLayoutPanel1->Controls->Add(this->Rname5, 0, 4); + this->tableLayoutPanel1->Controls->Add(this->Rname6, 0, 5); + this->tableLayoutPanel1->Controls->Add(this->Rname7, 0, 6); + this->tableLayoutPanel1->Controls->Add(this->Rname8, 0, 7); + this->tableLayoutPanel1->Controls->Add(this->IndOn2, 2, 1); + this->tableLayoutPanel1->Controls->Add(this->IndOn3, 2, 2); + this->tableLayoutPanel1->Controls->Add(this->IndOn4, 2, 3); + this->tableLayoutPanel1->Controls->Add(this->IndOn5, 2, 4); + this->tableLayoutPanel1->Controls->Add(this->IndOn6, 2, 5); + this->tableLayoutPanel1->Controls->Add(this->IndOn7, 2, 6); + this->tableLayoutPanel1->Controls->Add(this->IndOn8, 2, 7); + this->tableLayoutPanel1->Controls->Add(this->Ropen1, 1, 0); + this->tableLayoutPanel1->Controls->Add(this->Ropen2, 1, 1); + this->tableLayoutPanel1->Controls->Add(this->Ropen3, 1, 2); + this->tableLayoutPanel1->Controls->Add(this->Ropen4, 1, 3); + this->tableLayoutPanel1->Controls->Add(this->Ropen5, 1, 4); + this->tableLayoutPanel1->Controls->Add(this->Ropen6, 1, 5); + this->tableLayoutPanel1->Controls->Add(this->Ropen7, 1, 6); + this->tableLayoutPanel1->Controls->Add(this->Ropen8, 1, 7); + this->tableLayoutPanel1->Controls->Add(this->IndOn1, 2, 0); + this->tableLayoutPanel1->Controls->Add(this->Rclose1, 3, 0); + this->tableLayoutPanel1->Location = System::Drawing::Point(11, 101); + this->tableLayoutPanel1->Name = L"tableLayoutPanel1"; + this->tableLayoutPanel1->RowCount = 8; + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); + this->tableLayoutPanel1->Size = System::Drawing::Size(292, 291); + this->tableLayoutPanel1->TabIndex = 5; + // + // Rclose8 + // + this->Rclose8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose8->Location = System::Drawing::Point(221, 261); + this->Rclose8->Name = L"Rclose8"; + this->Rclose8->Size = System::Drawing::Size(68, 20); + this->Rclose8->TabIndex = 30; + this->Rclose8->Text = L"button19"; + this->Rclose8->UseVisualStyleBackColor = true; + // + // Rclose7 + // + this->Rclose7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose7->Location = System::Drawing::Point(221, 224); + this->Rclose7->Name = L"Rclose7"; + this->Rclose7->Size = System::Drawing::Size(68, 20); + this->Rclose7->TabIndex = 29; + this->Rclose7->Text = L"button18"; + this->Rclose7->UseVisualStyleBackColor = true; + // + // Rclose6 + // + this->Rclose6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose6->Location = System::Drawing::Point(221, 188); + this->Rclose6->Name = L"Rclose6"; + this->Rclose6->Size = System::Drawing::Size(68, 20); + this->Rclose6->TabIndex = 28; + this->Rclose6->Text = L"button17"; + this->Rclose6->UseVisualStyleBackColor = true; + // + // Rclose5 + // + this->Rclose5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose5->Location = System::Drawing::Point(221, 152); + this->Rclose5->Name = L"Rclose5"; + this->Rclose5->Size = System::Drawing::Size(68, 20); + this->Rclose5->TabIndex = 27; + this->Rclose5->Text = L"button16"; + this->Rclose5->UseVisualStyleBackColor = true; + // + // Rclose4 + // + this->Rclose4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose4->Location = System::Drawing::Point(221, 116); + this->Rclose4->Name = L"Rclose4"; + this->Rclose4->Size = System::Drawing::Size(68, 20); + this->Rclose4->TabIndex = 26; + this->Rclose4->Text = L"button15"; + this->Rclose4->UseVisualStyleBackColor = true; + // + // Rclose3 + // + this->Rclose3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose3->Location = System::Drawing::Point(221, 80); + this->Rclose3->Name = L"Rclose3"; + this->Rclose3->Size = System::Drawing::Size(68, 20); + this->Rclose3->TabIndex = 25; + this->Rclose3->Text = L"button14"; + this->Rclose3->UseVisualStyleBackColor = true; + // + // Rclose2 + // + this->Rclose2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose2->Location = System::Drawing::Point(221, 44); + this->Rclose2->Name = L"Rclose2"; + this->Rclose2->Size = System::Drawing::Size(68, 20); + this->Rclose2->TabIndex = 24; + this->Rclose2->Text = L"button13"; + this->Rclose2->UseVisualStyleBackColor = true; + // + // Rname1 + // + this->Rname1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname1->Location = System::Drawing::Point(3, 8); + this->Rname1->MaxLength = 64; + this->Rname1->Name = L"Rname1"; + this->Rname1->Size = System::Drawing::Size(81, 20); + this->Rname1->TabIndex = 0; + // + // Rname2 + // + this->Rname2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname2->Location = System::Drawing::Point(3, 44); + this->Rname2->MaxLength = 64; + this->Rname2->Name = L"Rname2"; + this->Rname2->Size = System::Drawing::Size(81, 20); + this->Rname2->TabIndex = 1; + // + // Rname3 + // + this->Rname3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname3->Location = System::Drawing::Point(3, 80); + this->Rname3->MaxLength = 64; + this->Rname3->Name = L"Rname3"; + this->Rname3->Size = System::Drawing::Size(81, 20); + this->Rname3->TabIndex = 2; + // + // Rname4 + // + this->Rname4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname4->Location = System::Drawing::Point(3, 116); + this->Rname4->MaxLength = 64; + this->Rname4->Name = L"Rname4"; + this->Rname4->Size = System::Drawing::Size(81, 20); + this->Rname4->TabIndex = 3; + // + // Rname5 + // + this->Rname5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname5->Location = System::Drawing::Point(3, 152); + this->Rname5->MaxLength = 64; + this->Rname5->Name = L"Rname5"; + this->Rname5->Size = System::Drawing::Size(81, 20); + this->Rname5->TabIndex = 4; + // + // Rname6 + // + this->Rname6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname6->Location = System::Drawing::Point(3, 188); + this->Rname6->MaxLength = 64; + this->Rname6->Name = L"Rname6"; + this->Rname6->Size = System::Drawing::Size(81, 20); + this->Rname6->TabIndex = 5; + // + // Rname7 + // + this->Rname7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname7->Location = System::Drawing::Point(3, 224); + this->Rname7->MaxLength = 64; + this->Rname7->Name = L"Rname7"; + this->Rname7->Size = System::Drawing::Size(81, 20); + this->Rname7->TabIndex = 6; + // + // Rname8 + // + this->Rname8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rname8->Location = System::Drawing::Point(3, 261); + this->Rname8->MaxLength = 64; + this->Rname8->Name = L"Rname8"; + this->Rname8->Size = System::Drawing::Size(81, 20); + this->Rname8->TabIndex = 7; + // + // IndOn2 + // + this->IndOn2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn2->BackColor = System::Drawing::Color::Red; + this->IndOn2->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn2->Location = System::Drawing::Point(163, 44); + this->IndOn2->Name = L"IndOn2"; + this->IndOn2->ReadOnly = true; + this->IndOn2->Size = System::Drawing::Size(52, 20); + this->IndOn2->TabIndex = 8; + this->IndOn2->TabStop = false; + // + // IndOn3 + // + this->IndOn3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn3->BackColor = System::Drawing::Color::Red; + this->IndOn3->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn3->Location = System::Drawing::Point(163, 80); + this->IndOn3->Name = L"IndOn3"; + this->IndOn3->ReadOnly = true; + this->IndOn3->Size = System::Drawing::Size(52, 20); + this->IndOn3->TabIndex = 9; + this->IndOn3->TabStop = false; + // + // IndOn4 + // + this->IndOn4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn4->BackColor = System::Drawing::Color::Red; + this->IndOn4->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn4->Location = System::Drawing::Point(163, 116); + this->IndOn4->Name = L"IndOn4"; + this->IndOn4->ReadOnly = true; + this->IndOn4->Size = System::Drawing::Size(52, 20); + this->IndOn4->TabIndex = 10; + this->IndOn4->TabStop = false; + // + // IndOn5 + // + this->IndOn5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn5->BackColor = System::Drawing::Color::Red; + this->IndOn5->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn5->Location = System::Drawing::Point(163, 152); + this->IndOn5->Name = L"IndOn5"; + this->IndOn5->ReadOnly = true; + this->IndOn5->Size = System::Drawing::Size(52, 20); + this->IndOn5->TabIndex = 11; + this->IndOn5->TabStop = false; + // + // IndOn6 + // + this->IndOn6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn6->BackColor = System::Drawing::Color::Red; + this->IndOn6->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn6->Location = System::Drawing::Point(163, 188); + this->IndOn6->Name = L"IndOn6"; + this->IndOn6->ReadOnly = true; + this->IndOn6->Size = System::Drawing::Size(52, 20); + this->IndOn6->TabIndex = 12; + this->IndOn6->TabStop = false; + // + // IndOn7 + // + this->IndOn7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn7->BackColor = System::Drawing::Color::Red; + this->IndOn7->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn7->Location = System::Drawing::Point(163, 224); + this->IndOn7->Name = L"IndOn7"; + this->IndOn7->ReadOnly = true; + this->IndOn7->Size = System::Drawing::Size(52, 20); + this->IndOn7->TabIndex = 13; + this->IndOn7->TabStop = false; + // + // IndOn8 + // + this->IndOn8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn8->BackColor = System::Drawing::Color::Red; + this->IndOn8->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn8->Location = System::Drawing::Point(163, 261); + this->IndOn8->Name = L"IndOn8"; + this->IndOn8->ReadOnly = true; + this->IndOn8->Size = System::Drawing::Size(52, 20); + this->IndOn8->TabIndex = 14; + this->IndOn8->TabStop = false; + // + // Ropen1 + // + this->Ropen1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen1->Location = System::Drawing::Point(90, 8); + this->Ropen1->Name = L"Ropen1"; + this->Ropen1->Size = System::Drawing::Size(67, 20); + this->Ropen1->TabIndex = 15; + this->Ropen1->Text = L"button4"; + this->Ropen1->UseVisualStyleBackColor = true; + // + // Ropen2 + // + this->Ropen2->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen2->Location = System::Drawing::Point(90, 44); + this->Ropen2->Name = L"Ropen2"; + this->Ropen2->Size = System::Drawing::Size(67, 20); + this->Ropen2->TabIndex = 16; + this->Ropen2->Text = L"button5"; + this->Ropen2->UseVisualStyleBackColor = true; + // + // Ropen3 + // + this->Ropen3->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen3->Location = System::Drawing::Point(90, 80); + this->Ropen3->Name = L"Ropen3"; + this->Ropen3->Size = System::Drawing::Size(67, 20); + this->Ropen3->TabIndex = 17; + this->Ropen3->Text = L"button6"; + this->Ropen3->UseVisualStyleBackColor = true; + // + // Ropen4 + // + this->Ropen4->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen4->Location = System::Drawing::Point(90, 116); + this->Ropen4->Name = L"Ropen4"; + this->Ropen4->Size = System::Drawing::Size(67, 20); + this->Ropen4->TabIndex = 18; + this->Ropen4->Text = L"button7"; + this->Ropen4->UseVisualStyleBackColor = true; + // + // Ropen5 + // + this->Ropen5->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen5->Location = System::Drawing::Point(90, 152); + this->Ropen5->Name = L"Ropen5"; + this->Ropen5->Size = System::Drawing::Size(67, 20); + this->Ropen5->TabIndex = 19; + this->Ropen5->Text = L"button8"; + this->Ropen5->UseVisualStyleBackColor = true; + // + // Ropen6 + // + this->Ropen6->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen6->Location = System::Drawing::Point(90, 188); + this->Ropen6->Name = L"Ropen6"; + this->Ropen6->Size = System::Drawing::Size(67, 20); + this->Ropen6->TabIndex = 20; + this->Ropen6->Text = L"button9"; + this->Ropen6->UseVisualStyleBackColor = true; + // + // Ropen7 + // + this->Ropen7->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen7->Location = System::Drawing::Point(90, 224); + this->Ropen7->Name = L"Ropen7"; + this->Ropen7->Size = System::Drawing::Size(67, 20); + this->Ropen7->TabIndex = 21; + this->Ropen7->Text = L"button10"; + this->Ropen7->UseVisualStyleBackColor = true; + // + // Ropen8 + // + this->Ropen8->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Ropen8->Location = System::Drawing::Point(90, 261); + this->Ropen8->Name = L"Ropen8"; + this->Ropen8->Size = System::Drawing::Size(67, 20); + this->Ropen8->TabIndex = 22; + this->Ropen8->Text = L"button11"; + this->Ropen8->UseVisualStyleBackColor = true; + // + // IndOn1 + // + this->IndOn1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->IndOn1->BackColor = System::Drawing::Color::Red; + this->IndOn1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; + this->IndOn1->Location = System::Drawing::Point(163, 8); + this->IndOn1->Name = L"IndOn1"; + this->IndOn1->ReadOnly = true; + this->IndOn1->Size = System::Drawing::Size(52, 20); + this->IndOn1->TabIndex = 6; + this->IndOn1->TabStop = false; + // + // Rclose1 + // + this->Rclose1->Anchor = static_cast((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); + this->Rclose1->Location = System::Drawing::Point(221, 8); + this->Rclose1->Name = L"Rclose1"; + this->Rclose1->Size = System::Drawing::Size(68, 20); + this->Rclose1->TabIndex = 23; + this->Rclose1->Text = L"button12"; + this->Rclose1->UseVisualStyleBackColor = true; + // + // RopenAll + // + this->RopenAll->Location = System::Drawing::Point(11, 398); + this->RopenAll->Name = L"RopenAll"; + this->RopenAll->Size = System::Drawing::Size(108, 35); + this->RopenAll->TabIndex = 6; + this->RopenAll->Text = L"Open All"; + this->RopenAll->UseVisualStyleBackColor = true; + this->RopenAll->Click += gcnew System::EventHandler(this, &Form1::RopenAll_Click); + // + // RcloseAll + // + this->RcloseAll->Location = System::Drawing::Point(191, 398); + this->RcloseAll->Name = L"RcloseAll"; + this->RcloseAll->Size = System::Drawing::Size(108, 35); + this->RcloseAll->TabIndex = 7; + this->RcloseAll->Text = L"Close All"; + this->RcloseAll->UseVisualStyleBackColor = true; + this->RcloseAll->Click += gcnew System::EventHandler(this, &Form1::RcloseAll_Click); + // + // txtMsg + // + this->txtMsg->AutoSize = true; + this->txtMsg->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, + static_cast(0))); + this->txtMsg->ForeColor = System::Drawing::Color::White; + this->txtMsg->Location = System::Drawing::Point(12, 41); + this->txtMsg->Name = L"txtMsg"; + this->txtMsg->Size = System::Drawing::Size(46, 17); + this->txtMsg->TabIndex = 8; + this->txtMsg->Text = L"label1"; + this->txtMsg->Click += gcnew System::EventHandler(this, &Form1::txtMsg_Click); + // + // Form1 + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(318, 448); + this->Controls->Add(this->txtMsg); + this->Controls->Add(this->RcloseAll); + this->Controls->Add(this->RopenAll); + this->Controls->Add(this->tableLayoutPanel1); + this->Controls->Add(this->buttonClose); + this->Controls->Add(this->IndOpen); + this->Controls->Add(this->buttonOpen); + this->Controls->Add(this->comboDevices); + this->Controls->Add(this->buttonFind); + this->Name = L"Form1"; + this->Text = L"USB Relay Manager"; + this->tableLayoutPanel1->ResumeLayout(false); + this->tableLayoutPanel1->PerformLayout(); + this->ResumeLayout(false); + this->PerformLayout(); - } + } #pragma endregion - + private: System::Void buttonFind_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void buttonOpen_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void buttonClose_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void RopenAll_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void RcloseAll_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void Ropen1_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void Rclose1_Click(System::Object^ sender, System::EventArgs^ e); - + private: System::Void txtMsg_Click(System::Object^ sender, System::EventArgs^ e) { - txtMsg->Visible = false; - } + txtMsg->Visible = false; + } public: - System::Void setMsg(System::String^ msg, bool err) - { - if (!msg) { - txtMsg->Visible = false; - return; - } - System::Drawing::Color color = err ? System::Drawing::Color::Red : System::Drawing::Color::Green; - txtMsg->Text = msg; - txtMsg->BackColor = color; - txtMsg->Visible = true; - } - + // Show a message in txtMsg field + // The message is green or green, depending on param err + // Hide txtMsg field if msg is null + System::Void setMsg(System::String^ msg, bool err) + { + if (!msg) { + txtMsg->Visible = false; + } else { + System::Drawing::Color color = err ? System::Drawing::Color::Red : System::Drawing::Color::Green; + txtMsg->Text = msg; + txtMsg->BackColor = color; + txtMsg->Visible = true; + } + } }; -} +} diff --git a/windows-vs/VS_GUI_demo/GUIapp.vcproj b/windows-vs/VS_GUI_demo/GUIapp(vc2008).vcproj similarity index 100% rename from windows-vs/VS_GUI_demo/GUIapp.vcproj rename to windows-vs/VS_GUI_demo/GUIapp(vc2008).vcproj diff --git a/windows-vs/VS_GUI_demo/GUIapp.vcxproj b/windows-vs/VS_GUI_demo/GUIapp(vc2013).vcxproj similarity index 100% rename from windows-vs/VS_GUI_demo/GUIapp.vcxproj rename to windows-vs/VS_GUI_demo/GUIapp(vc2013).vcxproj diff --git a/windows-vs/VS_GUI_demo/GUIapp.vcxproj.filters b/windows-vs/VS_GUI_demo/GUIapp(vc2013).vcxproj.filters similarity index 100% rename from windows-vs/VS_GUI_demo/GUIapp.vcxproj.filters rename to windows-vs/VS_GUI_demo/GUIapp(vc2013).vcxproj.filters diff --git a/windows-vs/VS_GUI_demo/GUIapp.cpp b/windows-vs/VS_GUI_demo/GUIapp.cpp index 7fa6c10..5c29975 100644 --- a/windows-vs/VS_GUI_demo/GUIapp.cpp +++ b/windows-vs/VS_GUI_demo/GUIapp.cpp @@ -1,11 +1,5 @@ // GUIapp.cpp : main project file -//#include "stdafx.h" - -namespace GUIapp { - const int MaxRelaysNum = 8; -} - #include "Form1.h" #include "../../lib/usb_relay_device.h" @@ -17,194 +11,190 @@ static intptr_t g_dev = 0; static int g_chanNum = 0; static pusb_relay_device_info_t g_enumlist = nullptr; +#define GREEN Drawing::Color::LimeGreen +#define RED Drawing::Color::Red +#define GREY Drawing::Color::Gray + [STAThreadAttribute] int main(array ^args) { - g_dev = 0; - g_enumlist = nullptr; + g_dev = 0; + g_enumlist = nullptr; - // Enabling Windows XP visual effects before any controls are created - Application::EnableVisualStyles(); - Application::SetCompatibleTextRenderingDefault(false); + // Enabling Windows XP visual effects before any controls are created + Application::EnableVisualStyles(); + Application::SetCompatibleTextRenderingDefault(false); - // Create the main window and run it - Application::Run(gcnew Form1()); - return 0; + // Create the main window and run it + Application::Run(gcnew Form1()); + return 0; } - -System::Void Form1::buttonFind_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::buttonFind_Click(System::Object^ sender, System::EventArgs^ e) { - if (g_enumlist) { - usb_relay_device_free_enumerate(g_enumlist); - g_enumlist = nullptr; - } - - comboDevices->Items->Clear(); - - g_enumlist = usb_relay_device_enumerate(); - pusb_relay_device_info_t q = g_enumlist; - while(q) { - System::String^ s = ""; - for (char const *p = q->serial_number; *p; p++) - s += (wchar_t)(*p); - comboDevices->Items->Add(s); - q = q->next; - } - - if ( comboDevices->Items->Count != 0 ) { - comboDevices->SelectedIndex = 0; - setMsg( "Found:" + (comboDevices->Items->Count).ToString() + " device(s)", false ); - } else { - setMsg( "No devices found", true ); - } + if (g_enumlist) { + usb_relay_device_free_enumerate(g_enumlist); + g_enumlist = nullptr; + } + + comboDevices->Items->Clear(); + + g_enumlist = usb_relay_device_enumerate(); + pusb_relay_device_info_t q = g_enumlist; + while(q) { + System::String^ s = ""; + for (char const *p = q->serial_number; *p; p++) + s += (wchar_t)(*p); + comboDevices->Items->Add(s); + q = q->next; + } + + if ( comboDevices->Items->Count != 0 ) { + comboDevices->SelectedIndex = 0; + setMsg( "Found:" + (comboDevices->Items->Count).ToString() + " device(s)", false ); + } else { + setMsg( "No devices found", true ); + } } // Open device -System::Void Form1::buttonOpen_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::buttonOpen_Click(System::Object^ sender, System::EventArgs^ e) { - System::String^ s = comboDevices->Text; - if ( !s ) return; - char id[16]; - int i; - for (i = 0; i < s->Length && i < (sizeof(id) - 1); i++ ) { - id[i] = (char)s[i]; - } - id[i] = 0; - // Only one device can be open. TODO: allow multiple devices open, save&restore state? - if (g_dev) { - setMsg( "Closing the opened device", false ); - buttonClose_Click(sender, e); - } - - intptr_t dh = usb_relay_device_open_with_serial_number(id, (int)strlen(id)); - if ( dh ) { - g_dev = dh; - IndOpen->BackColor = Drawing::Color::LimeGreen; - - // Get and show state: + System::String^ s = comboDevices->Text; + if ( !s ) return; + char id[16]; + int i; + for (i = 0; i < s->Length && i < (sizeof(id) - 1); i++ ) { + id[i] = (char)s[i]; + } + id[i] = 0; + // Only one device can be open. TODO: allow multiple devices open, save&restore state? + if (g_dev) { + setMsg( "Closing the opened device", false ); + buttonClose_Click(sender, e); + } + + intptr_t dh = usb_relay_device_open_with_serial_number(id, (int)strlen(id)); + if ( dh ) { + g_dev = dh; + IndOpen->BackColor = GREEN; + + // Get and show state: //BUGBUG g_dev is not usb_relay_device_info* in the orig library! use my new f() ?? use only info in the list? - struct usb_relay_device_info* di = (struct usb_relay_device_info*)g_dev; - int numChannels = (unsigned char)di->type; + struct usb_relay_device_info* di = (struct usb_relay_device_info*)g_dev; + int numChannels = (unsigned char)di->type; if ( numChannels > MaxRelaysNum || numChannels == 0) { // oops? numChannels = MaxRelaysNum; } - g_chanNum = numChannels; - unsigned st = 0; - int r = usb_relay_device_get_status( g_dev, &st); - if ( r != 0 ) { - setMsg("Error reading device state", true); - } else { - for (int i = 0; i < MaxRelaysNum; i++ ) { - System::Windows::Forms::TextBox^ t; - t = static_cast(aIndicators->GetValue(i)); - Drawing::Color c = st & (1 << i) ? Drawing::Color::LimeGreen : Drawing::Color::Red; - if ( ((i + 1) > numChannels) && (c == Drawing::Color::Red) ) - c = Drawing::Color::Gray; - t->BackColor = c; - } - } - - } else { - setMsg("Error opening the device", true); - } + g_chanNum = numChannels; + unsigned st = 0; + int r = usb_relay_device_get_status( g_dev, &st); + if ( r != 0 ) { + setMsg("Error reading device state", true); + } else { + for (int i = 0; i < MaxRelaysNum; i++ ) { + System::Windows::Forms::TextBox^ t; + t = static_cast(aIndicators->GetValue(i)); + Drawing::Color c = st & (1 << i) ? GREEN : RED; + if ( ((i + 1) > numChannels) && (c == RED) ) + c = GREY; + t->BackColor = c; + } + } + + } else { + setMsg("Error opening the device", true); + IndOpen->BackColor = RED; + } } // Close device -System::Void Form1::buttonClose_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::buttonClose_Click(System::Object^ sender, System::EventArgs^ e) { - if (g_dev) { - usb_relay_device_close(g_dev); - IndOpen->BackColor = Drawing::Color::Red; - - // All indicators -> gray, but leave relays as is. - System::Windows::Forms::TextBox^ t; - usb_relay_device_close(g_dev); - { - for (int i = 0; i < MaxRelaysNum; i++ ) { - t = static_cast(aIndicators->GetValue(i)); - t->BackColor = Drawing::Color::Gray; - } - } - - g_dev = 0; - } + if (g_dev) { + usb_relay_device_close(g_dev); + IndOpen->BackColor = RED; + + // All indicators -> gray, but leave relays as is. + System::Windows::Forms::TextBox^ t; + usb_relay_device_close(g_dev); + { + for (int i = 0; i < MaxRelaysNum; i++ ) { + t = static_cast(aIndicators->GetValue(i)); + t->BackColor = GREY; + } + } + + g_dev = 0; + } } // Open all channels -System::Void Form1::RopenAll_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::RopenAll_Click(System::Object^ sender, System::EventArgs^ e) { - if (!g_dev) { - setMsg("No relay device is open!", true); - return; - } - - System::Windows::Forms::TextBox^ t; - int r = usb_relay_device_open_all_relay_channel(g_dev); - if ( r == 0 ) { - for (int i=0; i < MaxRelaysNum; i++ ) { - t = static_cast(aIndicators->GetValue(i)); - t->BackColor = (i <= g_chanNum - 1) ? Drawing::Color::LimeGreen : Drawing::Color::Gray; - } - } + if (!g_dev) { + setMsg("No relay device is open!", true); + return; + } + + System::Windows::Forms::TextBox^ t; + int r = usb_relay_device_open_all_relay_channel(g_dev); + if ( r == 0 ) { + for (int i=0; i < MaxRelaysNum; i++ ) { + t = static_cast(aIndicators->GetValue(i)); + t->BackColor = (i <= g_chanNum - 1) ? GREEN : GREY; + } + } } // Close all channels -System::Void Form1::RcloseAll_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::RcloseAll_Click(System::Object^ sender, System::EventArgs^ e) { - if (!g_dev) { - setMsg("No relay device is open!", true); - return; - } - - System::Windows::Forms::TextBox^ t; - int r = usb_relay_device_close_all_relay_channel(g_dev); - if (r == 0) { - for (int i=0; i < MaxRelaysNum; i++ ) { - t = static_cast(aIndicators->GetValue(i)); - t->BackColor = (i <= g_chanNum - 1) ? Drawing::Color::Red : Drawing::Color::Gray; - } - } + if (!g_dev) { + setMsg("No relay device is open!", true); + return; + } + + System::Windows::Forms::TextBox^ t; + int r = usb_relay_device_close_all_relay_channel(g_dev); + if (r == 0) { + for (int i=0; i < MaxRelaysNum; i++ ) { + t = static_cast(aIndicators->GetValue(i)); + t->BackColor = (i <= g_chanNum - 1) ? RED : GREY; + } + } } // Open one channel -System::Void Form1::Ropen1_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::Ropen1_Click(System::Object^ sender, System::EventArgs^ e) { - if (!g_dev) { - setMsg("No relay device is open!", true); - return; - } - - int i; - System::Windows::Forms::Button^ b = safe_cast(sender); - System::Int16^ n = safe_cast(b->Tag); - i = *n; - System::Windows::Forms::TextBox^ t = static_cast(aIndicators->GetValue(i)); - - int r = usb_relay_device_open_one_relay_channel(g_dev, i+1); - if (r == 0) { - t->BackColor = Drawing::Color::LimeGreen; - } + if (!g_dev) { + setMsg("No relay device is open!", true); + return; + } + + System::Windows::Forms::Control^ b = safe_cast(sender); + int i = *(safe_cast(b->Tag)); + System::Windows::Forms::TextBox^ t = static_cast(aIndicators->GetValue(i)); + + int r = usb_relay_device_open_one_relay_channel(g_dev, i+1); + t->BackColor = (r == 0) ? GREEN : GREY; } // Close one channel -System::Void Form1::Rclose1_Click(System::Object^ sender, System::EventArgs^ e) +void Form1::Rclose1_Click(System::Object^ sender, System::EventArgs^ e) { - if (!g_dev) { - setMsg("No relay device is open!", true); - return; - } - - int i; - System::Windows::Forms::Button^ b = safe_cast(sender); - System::Int16^ n = safe_cast(b->Tag); - i = *n; - System::Windows::Forms::TextBox^ t = static_cast(aIndicators->GetValue(i)); - - int r = usb_relay_device_close_one_relay_channel(g_dev, i+1); - if (r == 0) { - t->BackColor = Drawing::Color::Red; - } + if (!g_dev) { + setMsg("No relay device is open!", true); + return; + } + + System::Windows::Forms::Control^ b = safe_cast(sender); + int i = *(safe_cast(b->Tag)); + System::Windows::Forms::TextBox^ t = static_cast(aIndicators->GetValue(i)); + + int r = usb_relay_device_close_one_relay_channel(g_dev, i+1); + t->BackColor = (r == 0) ? RED : GREY; } diff --git a/windows-vs/VS_GUI_demo/ReadMe.txt b/windows-vs/VS_GUI_demo/ReadMe.txt index 2fb3dd2..e79c958 100644 --- a/windows-vs/VS_GUI_demo/ReadMe.txt +++ b/windows-vs/VS_GUI_demo/ReadMe.txt @@ -1,4 +1,5 @@ Windows GUI application demo for the USB HID relay library -Written for VC++ 2008, .NET 3.5 +Written initially with VC++ 2008, .NET 3.5. +Upgradable to VC2013.4 diff --git a/windows-vs/usbrelay(vc2008).sln b/windows-vs/usbrelay(vc2008).sln index 0491ea8..ed03abc 100644 --- a/windows-vs/usbrelay(vc2008).sln +++ b/windows-vs/usbrelay(vc2008).sln @@ -5,7 +5,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hidusb-relay-cmd", "..\comm EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usb-relay-dll", "..\lib\usb-relay-dll\usb-relay-dll(vc2008).vcproj", "{0E07152A-666D-4EB4-9049-BDE08C35A86D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIapp", "VS_GUI_demo\GUIapp.vcproj", "{59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIapp", "VS_GUI_demo\GUIapp(vc2008).vcproj", "{59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}" ProjectSection(ProjectDependencies) = postProject {0E07152A-666D-4EB4-9049-BDE08C35A86D} = {0E07152A-666D-4EB4-9049-BDE08C35A86D} EndProjectSection diff --git a/windows-vs/usbrelay(vc2013).sln b/windows-vs/usbrelay(vc2013).sln index 07972cf..28fb5da 100644 --- a/windows-vs/usbrelay(vc2013).sln +++ b/windows-vs/usbrelay(vc2013).sln @@ -7,52 +7,38 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hidusb-relay-cmd", "..\comm EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usb-relay-dll", "..\lib\usb-relay-dll\usb-relay-dll(vc2013).vcxproj", "{0E07152A-666D-4EB4-9049-BDE08C35A86D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIapp", "VS_GUI_demo\GUIapp.vcxproj", "{59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIapp", "VS_GUI_demo\GUIapp(vc2013).vcxproj", "{59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}" ProjectSection(ProjectDependencies) = postProject {0E07152A-666D-4EB4-9049-BDE08C35A86D} = {0E07152A-666D-4EB4-9049-BDE08C35A86D} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Debug|Win32.ActiveCfg = Debug|Win32 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Debug|Win32.Build.0 = Debug|Win32 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Debug|x64.ActiveCfg = Debug|x64 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Debug|x64.Build.0 = Debug|x64 - {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Release|Mixed Platforms.Build.0 = Release|Win32 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Release|Win32.ActiveCfg = Release|Win32 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Release|Win32.Build.0 = Release|Win32 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Release|x64.ActiveCfg = Release|x64 {CF9B07CB-509D-43B5-94FC-2BA43427C093}.Release|x64.Build.0 = Release|x64 - {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Debug|Win32.ActiveCfg = Debug|Win32 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Debug|Win32.Build.0 = Debug|Win32 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Debug|x64.ActiveCfg = Debug|x64 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Debug|x64.Build.0 = Debug|x64 - {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Release|Mixed Platforms.Build.0 = Release|Win32 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Release|Win32.ActiveCfg = Release|Win32 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Release|Win32.Build.0 = Release|Win32 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Release|x64.ActiveCfg = Release|x64 {0E07152A-666D-4EB4-9049-BDE08C35A86D}.Release|x64.Build.0 = Release|x64 - {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Debug|Win32.ActiveCfg = Debug|Win32 {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Debug|Win32.Build.0 = Debug|Win32 {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Debug|x64.ActiveCfg = Debug|x64 - {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Release|Mixed Platforms.Build.0 = Release|Win32 {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Release|Win32.ActiveCfg = Release|Win32 {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Release|Win32.Build.0 = Release|Win32 {59CCF7A0-C46F-4699-9A55-3A7DFA3333D8}.Release|x64.ActiveCfg = Release|x64 -- 2.25.1