

#include "stdafx.h"


#include "Cam_Lib.h"
#include "Img_lib.h"
#include "USB_Com.h"
#include "Slot_Ctrl.h"
#include "ini.h"

//#include <thread>

#pragma once
#pragma comment(lib, "PvAPI.lib")
Cameras* cams;						//Vector of classes including all informations about cameras
usb_dev_handle *handle = NULL;		//USB handle used for communication with model
unsigned int overview_done[6]={0,0,0,0,0,0};		//Bool preventing meaningless conversion of img to bmp
semafors *semaf = NULL;
digpot *pots = NULL;



namespace GUI_Kamery {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Button^  b_init;
	private: System::Windows::Forms::NumericUpDown^  camNumber;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Timer^  CameraSearch;

	private: System::Windows::Forms::Label^  label_CamNumber;
	private: System::Windows::Forms::ListBox^  list_Cameras;
	private: System::Windows::Forms::NumericUpDown^  numUD_height;
	private: System::Windows::Forms::NumericUpDown^  numUD_Width;


	private: System::Windows::Forms::Label^  label_Cam1;
	private: System::Windows::Forms::CheckBox^  check_disp;
	private: System::Windows::Forms::CheckBox^  check_save;



	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::NumericUpDown^  numUD_expo;


	private: System::Windows::Forms::NumericUpDown^  numUD_regx;
	private: System::Windows::Forms::NumericUpDown^  numUD_regy;


	private: System::Windows::Forms::Label^  label5;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::Label^  label7;
	private: System::Windows::Forms::Label^  label8;
	private: System::Windows::Forms::NumericUpDown^  numUD_Biny;

	private: System::Windows::Forms::NumericUpDown^  numUD_Binx;



	private: System::Windows::Forms::Button^  button_saveand;
	private: System::Windows::Forms::Button^  button_save;
	private: System::Windows::Forms::Button^  button_discrad;
	private: System::Windows::Forms::Timer^  CamStream;

	private: System::Windows::Forms::Button^  button_stop;
	private: System::Windows::Forms::Label^  label_framescapt;
	private: System::Windows::Forms::PictureBox^  pictureBox1;
	private: System::Windows::Forms::PictureBox^  pictureBox2;
	private: System::Windows::Forms::PictureBox^  pictureBox3;
	private: System::Windows::Forms::PictureBox^  pictureBox4;
	private: System::Windows::Forms::PictureBox^  pictureBox5;
	private: System::Windows::Forms::PictureBox^  pictureBox6;
	private: System::Windows::Forms::Label^  label_disp1;
	private: System::Windows::Forms::Label^  label_disp2;
	private: System::Windows::Forms::Label^  label_disp3;
	private: System::Windows::Forms::Label^  label_disp4;
	private: System::Windows::Forms::Label^  label_disp5;
	private: System::Windows::Forms::Label^  label_disp6;
	private: System::Windows::Forms::Timer^  timer_overview;
	private: System::Windows::Forms::TextBox^  textBox1;
	private: System::Windows::Forms::TextBox^  textBox2;
	private: System::Windows::Forms::TabControl^  tabControl1;
	private: System::Windows::Forms::TabPage^  tabPage1;
	private: System::Windows::Forms::TabPage^  tabPage2;

	private: System::Windows::Forms::Label^  label10;


	private: System::Windows::Forms::Label^  label6;
	private: System::Windows::Forms::Label^  label11;
	private: System::Windows::Forms::Label^  label12;
	private: System::Windows::Forms::Label^  label13;
	private: System::Windows::Forms::Label^  label14;
	private: System::Windows::Forms::Label^  label15;
	private: System::Windows::Forms::Label^  label16;




	private: System::Windows::Forms::ComboBox^  comboBox1;
	private: System::Windows::Forms::Label^  label17;
	private: System::Windows::Forms::Label^  label18;
	private: Microsoft::VisualBasic::PowerPacks::ShapeContainer^  shapeContainer1;
	private: Microsoft::VisualBasic::PowerPacks::RectangleShape^  rectangleShape6;
	private: Microsoft::VisualBasic::PowerPacks::RectangleShape^  rectangleShape5;
	private: Microsoft::VisualBasic::PowerPacks::RectangleShape^  rectangleShape4;
	private: Microsoft::VisualBasic::PowerPacks::RectangleShape^  rectangleShape3;
	private: Microsoft::VisualBasic::PowerPacks::RectangleShape^  rectangleShape2;
	private: Microsoft::VisualBasic::PowerPacks::RectangleShape^  rectangleShape1;
	private: System::Windows::Forms::TabPage^  Gain;
	private: System::Windows::Forms::ComboBox^  comboBox2;
	private: System::Windows::Forms::Label^  label19;
	private: System::Windows::Forms::Label^  label20;
	private: System::Windows::Forms::NumericUpDown^  numUD_gain;

	private: System::Windows::Forms::TabPage^  tabPage3;
private: System::Windows::Forms::ComboBox^  cmode_trigger;


	private: System::Windows::Forms::Label^  label9;
private: System::Windows::Forms::ComboBox^  cmode_acq;

	private: System::Windows::Forms::Label^  label22;
	private: System::Windows::Forms::Label^  label21;
	private: System::Windows::Forms::NumericUpDown^  numUD_FrameRate;
	private: System::Windows::Forms::GroupBox^  group_slotcar;


	private: System::Windows::Forms::CheckBox^  checkBox3;
	private: System::Windows::Forms::CheckBox^  checkBox2;
	private: System::Windows::Forms::CheckBox^  checkBox1;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  ovalShape1;
	private: System::Windows::Forms::Label^  label25;
private: System::Windows::Forms::CheckBox^  safe_speed;

	private: System::Windows::Forms::Button^  button4;
	private: System::Windows::Forms::Button^  button3;
	private: System::Windows::Forms::Button^  button2;
	private: System::Windows::Forms::Button^  button1;
	private: System::Windows::Forms::Label^  label24;
	private: System::Windows::Forms::Label^  label23;
	private: System::Windows::Forms::NumericUpDown^  numericUpDown3;
	private: System::Windows::Forms::NumericUpDown^  numericUpDown2;
	private: System::Windows::Forms::NumericUpDown^  numericUpDown1;
	private: System::Windows::Forms::TrackBar^  trackBar3;
	private: System::Windows::Forms::TrackBar^  trackBar2;
	private: System::Windows::Forms::TrackBar^  trackBar1;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  ovalShape6;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  ovalShape5;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  ovalShape4;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  ovalShape3;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  ovalShape2;
	private: System::Windows::Forms::GroupBox^  groupBox2;
	private: System::Windows::Forms::GroupBox^  group_semafor;

	private: System::Windows::Forms::TabControl^  tabControl2;
	private: System::Windows::Forms::TabPage^  Manual;
	private: System::Windows::Forms::Button^  button5;
	private: System::Windows::Forms::Label^  label32;
	private: System::Windows::Forms::NumericUpDown^  numericUpDown4;
	private: System::Windows::Forms::RadioButton^  radio_14;























	private: System::Windows::Forms::RadioButton^  radio_13;

	private: System::Windows::Forms::RadioButton^  radio_12;

	private: System::Windows::Forms::RadioButton^  radio_11;





	private: System::Windows::Forms::PictureBox^  pictureBox7;
	private: System::Windows::Forms::TabPage^  Automatic;
	private: System::Windows::Forms::GroupBox^  group_S6;
	private: System::Windows::Forms::RadioButton^  radio_63;


	private: System::Windows::Forms::RadioButton^  radio_61;
	private: System::Windows::Forms::RadioButton^  radio_62;
	private: System::Windows::Forms::RadioButton^  radio_64;



	private: System::Windows::Forms::GroupBox^  group_S5;
	private: System::Windows::Forms::RadioButton^  radio_53;


	private: System::Windows::Forms::RadioButton^  radio_51;
	private: System::Windows::Forms::RadioButton^  radio_52;
	private: System::Windows::Forms::RadioButton^  radio_54;



	private: System::Windows::Forms::GroupBox^  group_S4;
	private: System::Windows::Forms::RadioButton^  radio_43;


	private: System::Windows::Forms::RadioButton^  radio_41;
	private: System::Windows::Forms::RadioButton^  radio_42;
	private: System::Windows::Forms::RadioButton^  radio_44;



	private: System::Windows::Forms::GroupBox^  group_S3;
	private: System::Windows::Forms::RadioButton^  radio_33;


	private: System::Windows::Forms::RadioButton^  radio_31;
	private: System::Windows::Forms::RadioButton^  radio_32;
	private: System::Windows::Forms::RadioButton^  radio_34;



	private: System::Windows::Forms::GroupBox^  group_S2;
	private: System::Windows::Forms::RadioButton^  radio_23;


	private: System::Windows::Forms::RadioButton^  radio_21;
	private: System::Windows::Forms::RadioButton^  radio_22;
	private: System::Windows::Forms::RadioButton^  radio_24;



	private: System::Windows::Forms::GroupBox^  group_S1;

	private: System::Windows::Forms::Button^  but_usbConnect;
	private: System::Windows::Forms::Button^  but_usbLED;
	private: System::Windows::Forms::Button^  button6;
	private: System::Windows::Forms::Label^  label27;
	private: System::Windows::Forms::NumericUpDown^  numUD_delay;

	private: System::Windows::Forms::RadioButton^  radio_semaf56;

	private: System::Windows::Forms::RadioButton^  radio_semaf34;

	private: System::Windows::Forms::RadioButton^  radio_semaf12;

	private: System::Windows::Forms::Label^  label26;

	private: System::Windows::Forms::NumericUpDown^  numUD_green;

	private: System::Windows::Forms::NumericUpDown^  numUD_yellow;

	private: System::Windows::Forms::NumericUpDown^  numUD_red;

	private: System::Windows::Forms::NumericUpDown^  numUD_orange;

	private: System::Windows::Forms::CheckBox^  check_semafauto;

	private: System::Windows::Forms::Button^  button7;
	private: System::Windows::Forms::Timer^  SemaforCycle;
	private: System::Windows::Forms::Label^  label_TL6;
	private: System::Windows::Forms::Label^  label_TL5;
	private: System::Windows::Forms::Label^  label_TL4;
	private: System::Windows::Forms::Label^  label_TL3;
	private: System::Windows::Forms::Label^  label_TL2;
	private: System::Windows::Forms::Label^  label_TL1;
	private: Microsoft::VisualBasic::PowerPacks::ShapeContainer^  shapeContainer2;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  oval_TL6;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  oval_TL5;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  oval_TL4;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  oval_TL3;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  oval_TL2;
	private: Microsoft::VisualBasic::PowerPacks::OvalShape^  oval_TL1;
	private: System::Windows::Forms::Label^  label_stg;
private: System::Windows::Forms::Label^  label28;
private: System::Windows::Forms::Button^  button8;
private: System::Windows::Forms::Label^  label29;
private: System::Windows::Forms::NumericUpDown^  numUD_framect;
private: System::Windows::Forms::PictureBox^  pictureBox11;
private: System::Windows::Forms::PictureBox^  pictureBox10;
private: System::Windows::Forms::PictureBox^  pictureBox9;
private: System::Windows::Forms::Label^  label34;
private: System::Windows::Forms::Label^  label33;
private: System::Windows::Forms::Label^  label31;
private: System::Windows::Forms::Label^  label30;
private: System::Windows::Forms::PictureBox^  pictureBox8;
private: System::Windows::Forms::PictureBox^  pictureBox12;
private: System::Windows::Forms::PictureBox^  pictureBox13;
private: System::Windows::Forms::PictureBox^  pictureBox14;


private: System::Windows::Forms::Button^  button9;














	private: System::ComponentModel::IContainer^  components;
	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>


#pragma 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>
		void InitializeComponent(void)
		{
			this->components = (gcnew System::ComponentModel::Container());
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
			this->b_init = (gcnew System::Windows::Forms::Button());
			this->camNumber = (gcnew System::Windows::Forms::NumericUpDown());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->CameraSearch = (gcnew System::Windows::Forms::Timer(this->components));
			this->label_CamNumber = (gcnew System::Windows::Forms::Label());
			this->list_Cameras = (gcnew System::Windows::Forms::ListBox());
			this->numUD_height = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_Width = (gcnew System::Windows::Forms::NumericUpDown());
			this->label_Cam1 = (gcnew System::Windows::Forms::Label());
			this->check_disp = (gcnew System::Windows::Forms::CheckBox());
			this->check_save = (gcnew System::Windows::Forms::CheckBox());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->numUD_expo = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_regx = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_regy = (gcnew System::Windows::Forms::NumericUpDown());
			this->label5 = (gcnew System::Windows::Forms::Label());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->label7 = (gcnew System::Windows::Forms::Label());
			this->label8 = (gcnew System::Windows::Forms::Label());
			this->numUD_Biny = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_Binx = (gcnew System::Windows::Forms::NumericUpDown());
			this->button_saveand = (gcnew System::Windows::Forms::Button());
			this->button_save = (gcnew System::Windows::Forms::Button());
			this->button_discrad = (gcnew System::Windows::Forms::Button());
			this->CamStream = (gcnew System::Windows::Forms::Timer(this->components));
			this->button_stop = (gcnew System::Windows::Forms::Button());
			this->label_framescapt = (gcnew System::Windows::Forms::Label());
			this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox2 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox3 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox4 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox5 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox6 = (gcnew System::Windows::Forms::PictureBox());
			this->label_disp1 = (gcnew System::Windows::Forms::Label());
			this->label_disp2 = (gcnew System::Windows::Forms::Label());
			this->label_disp3 = (gcnew System::Windows::Forms::Label());
			this->label_disp4 = (gcnew System::Windows::Forms::Label());
			this->label_disp5 = (gcnew System::Windows::Forms::Label());
			this->label_disp6 = (gcnew System::Windows::Forms::Label());
			this->timer_overview = (gcnew System::Windows::Forms::Timer(this->components));
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->textBox2 = (gcnew System::Windows::Forms::TextBox());
			this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
			this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
			this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
			this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
			this->label10 = (gcnew System::Windows::Forms::Label());
			this->label6 = (gcnew System::Windows::Forms::Label());
			this->Gain = (gcnew System::Windows::Forms::TabPage());
			this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
			this->label19 = (gcnew System::Windows::Forms::Label());
			this->label20 = (gcnew System::Windows::Forms::Label());
			this->numUD_gain = (gcnew System::Windows::Forms::NumericUpDown());
			this->tabPage3 = (gcnew System::Windows::Forms::TabPage());
			this->label29 = (gcnew System::Windows::Forms::Label());
			this->numUD_framect = (gcnew System::Windows::Forms::NumericUpDown());
			this->label21 = (gcnew System::Windows::Forms::Label());
			this->numUD_FrameRate = (gcnew System::Windows::Forms::NumericUpDown());
			this->cmode_acq = (gcnew System::Windows::Forms::ComboBox());
			this->label22 = (gcnew System::Windows::Forms::Label());
			this->cmode_trigger = (gcnew System::Windows::Forms::ComboBox());
			this->label9 = (gcnew System::Windows::Forms::Label());
			this->label11 = (gcnew System::Windows::Forms::Label());
			this->label12 = (gcnew System::Windows::Forms::Label());
			this->label13 = (gcnew System::Windows::Forms::Label());
			this->label14 = (gcnew System::Windows::Forms::Label());
			this->label15 = (gcnew System::Windows::Forms::Label());
			this->label16 = (gcnew System::Windows::Forms::Label());
			this->label17 = (gcnew System::Windows::Forms::Label());
			this->label18 = (gcnew System::Windows::Forms::Label());
			this->shapeContainer1 = (gcnew Microsoft::VisualBasic::PowerPacks::ShapeContainer());
			this->ovalShape6 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->ovalShape5 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->ovalShape4 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->ovalShape3 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->ovalShape2 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->ovalShape1 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->rectangleShape6 = (gcnew Microsoft::VisualBasic::PowerPacks::RectangleShape());
			this->rectangleShape5 = (gcnew Microsoft::VisualBasic::PowerPacks::RectangleShape());
			this->rectangleShape4 = (gcnew Microsoft::VisualBasic::PowerPacks::RectangleShape());
			this->rectangleShape3 = (gcnew Microsoft::VisualBasic::PowerPacks::RectangleShape());
			this->rectangleShape2 = (gcnew Microsoft::VisualBasic::PowerPacks::RectangleShape());
			this->rectangleShape1 = (gcnew Microsoft::VisualBasic::PowerPacks::RectangleShape());
			this->group_slotcar = (gcnew System::Windows::Forms::GroupBox());
			this->button8 = (gcnew System::Windows::Forms::Button());
			this->label25 = (gcnew System::Windows::Forms::Label());
			this->safe_speed = (gcnew System::Windows::Forms::CheckBox());
			this->button4 = (gcnew System::Windows::Forms::Button());
			this->button3 = (gcnew System::Windows::Forms::Button());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->button1 = (gcnew System::Windows::Forms::Button());
			this->label24 = (gcnew System::Windows::Forms::Label());
			this->label23 = (gcnew System::Windows::Forms::Label());
			this->numericUpDown3 = (gcnew System::Windows::Forms::NumericUpDown());
			this->numericUpDown2 = (gcnew System::Windows::Forms::NumericUpDown());
			this->numericUpDown1 = (gcnew System::Windows::Forms::NumericUpDown());
			this->trackBar3 = (gcnew System::Windows::Forms::TrackBar());
			this->trackBar2 = (gcnew System::Windows::Forms::TrackBar());
			this->trackBar1 = (gcnew System::Windows::Forms::TrackBar());
			this->checkBox3 = (gcnew System::Windows::Forms::CheckBox());
			this->checkBox2 = (gcnew System::Windows::Forms::CheckBox());
			this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
			this->group_semafor = (gcnew System::Windows::Forms::GroupBox());
			this->tabControl2 = (gcnew System::Windows::Forms::TabControl());
			this->Manual = (gcnew System::Windows::Forms::TabPage());
			this->pictureBox11 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox10 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox9 = (gcnew System::Windows::Forms::PictureBox());
			this->label28 = (gcnew System::Windows::Forms::Label());
			this->label32 = (gcnew System::Windows::Forms::Label());
			this->group_S6 = (gcnew System::Windows::Forms::GroupBox());
			this->radio_63 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_61 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_62 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_64 = (gcnew System::Windows::Forms::RadioButton());
			this->group_S5 = (gcnew System::Windows::Forms::GroupBox());
			this->radio_53 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_51 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_52 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_54 = (gcnew System::Windows::Forms::RadioButton());
			this->group_S4 = (gcnew System::Windows::Forms::GroupBox());
			this->radio_43 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_41 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_42 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_44 = (gcnew System::Windows::Forms::RadioButton());
			this->group_S3 = (gcnew System::Windows::Forms::GroupBox());
			this->radio_33 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_31 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_32 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_34 = (gcnew System::Windows::Forms::RadioButton());
			this->pictureBox7 = (gcnew System::Windows::Forms::PictureBox());
			this->group_S2 = (gcnew System::Windows::Forms::GroupBox());
			this->radio_23 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_21 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_22 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_24 = (gcnew System::Windows::Forms::RadioButton());
			this->group_S1 = (gcnew System::Windows::Forms::GroupBox());
			this->radio_13 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_11 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_12 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_14 = (gcnew System::Windows::Forms::RadioButton());
			this->button5 = (gcnew System::Windows::Forms::Button());
			this->numericUpDown4 = (gcnew System::Windows::Forms::NumericUpDown());
			this->Automatic = (gcnew System::Windows::Forms::TabPage());
			this->label34 = (gcnew System::Windows::Forms::Label());
			this->label33 = (gcnew System::Windows::Forms::Label());
			this->label31 = (gcnew System::Windows::Forms::Label());
			this->label30 = (gcnew System::Windows::Forms::Label());
			this->pictureBox8 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox12 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox13 = (gcnew System::Windows::Forms::PictureBox());
			this->pictureBox14 = (gcnew System::Windows::Forms::PictureBox());
			this->label_TL6 = (gcnew System::Windows::Forms::Label());
			this->label_TL5 = (gcnew System::Windows::Forms::Label());
			this->label_TL4 = (gcnew System::Windows::Forms::Label());
			this->label_TL3 = (gcnew System::Windows::Forms::Label());
			this->label_TL2 = (gcnew System::Windows::Forms::Label());
			this->label_TL1 = (gcnew System::Windows::Forms::Label());
			this->button7 = (gcnew System::Windows::Forms::Button());
			this->button6 = (gcnew System::Windows::Forms::Button());
			this->label27 = (gcnew System::Windows::Forms::Label());
			this->numUD_delay = (gcnew System::Windows::Forms::NumericUpDown());
			this->radio_semaf56 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_semaf34 = (gcnew System::Windows::Forms::RadioButton());
			this->radio_semaf12 = (gcnew System::Windows::Forms::RadioButton());
			this->label26 = (gcnew System::Windows::Forms::Label());
			this->numUD_green = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_yellow = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_red = (gcnew System::Windows::Forms::NumericUpDown());
			this->numUD_orange = (gcnew System::Windows::Forms::NumericUpDown());
			this->check_semafauto = (gcnew System::Windows::Forms::CheckBox());
			this->shapeContainer2 = (gcnew Microsoft::VisualBasic::PowerPacks::ShapeContainer());
			this->oval_TL6 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->oval_TL5 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->oval_TL4 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->oval_TL3 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->oval_TL2 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->oval_TL1 = (gcnew Microsoft::VisualBasic::PowerPacks::OvalShape());
			this->label_stg = (gcnew System::Windows::Forms::Label());
			this->but_usbConnect = (gcnew System::Windows::Forms::Button());
			this->but_usbLED = (gcnew System::Windows::Forms::Button());
			this->SemaforCycle = (gcnew System::Windows::Forms::Timer(this->components));
			this->button9 = (gcnew System::Windows::Forms::Button());
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->camNumber))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_height))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_Width))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_expo))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_regx))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_regy))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_Biny))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_Binx))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox2))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox3))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox4))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox5))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox6))->BeginInit();
			this->tabControl1->SuspendLayout();
			this->tabPage1->SuspendLayout();
			this->tabPage2->SuspendLayout();
			this->Gain->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_gain))->BeginInit();
			this->tabPage3->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_framect))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_FrameRate))->BeginInit();
			this->group_slotcar->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown3))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown2))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown1))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar3))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar2))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar1))->BeginInit();
			this->groupBox2->SuspendLayout();
			this->group_semafor->SuspendLayout();
			this->tabControl2->SuspendLayout();
			this->Manual->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox11))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox10))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox9))->BeginInit();
			this->group_S6->SuspendLayout();
			this->group_S5->SuspendLayout();
			this->group_S4->SuspendLayout();
			this->group_S3->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox7))->BeginInit();
			this->group_S2->SuspendLayout();
			this->group_S1->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown4))->BeginInit();
			this->Automatic->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox8))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox12))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox13))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox14))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_delay))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_green))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_yellow))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_red))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_orange))->BeginInit();
			this->SuspendLayout();
			// 
			// b_init
			// 
			this->b_init->Location = System::Drawing::Point(73, 32);
			this->b_init->Name = L"b_init";
			this->b_init->Size = System::Drawing::Size(142, 24);
			this->b_init->TabIndex = 0;
			this->b_init->Text = L"Find and initialize cameras ";
			this->b_init->UseVisualStyleBackColor = true;
			this->b_init->Click += gcnew System::EventHandler(this, &Form1::b_init_Click);
			// 
			// camNumber
			// 
			this->camNumber->Location = System::Drawing::Point(12, 36);
			this->camNumber->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {6, 0, 0, 0});
			this->camNumber->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->camNumber->Name = L"camNumber";
			this->camNumber->Size = System::Drawing::Size(48, 20);
			this->camNumber->TabIndex = 2;
			this->camNumber->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(9, 3);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(227, 26);
			this->label1->TabIndex = 3;
			this->label1->Text = L"Select number of cameras connected to model\r\nthen press Init Cameras. (max 6) Fou" 
				L"nd:";
			this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
			// 
			// CameraSearch
			// 
			this->CameraSearch->Interval = 200;
			this->CameraSearch->Tick += gcnew System::EventHandler(this, &Form1::CameraSearch_Tick);
			// 
			// label_CamNumber
			// 
			this->label_CamNumber->AutoSize = true;
			this->label_CamNumber->Location = System::Drawing::Point(199, 17);
			this->label_CamNumber->Name = L"label_CamNumber";
			this->label_CamNumber->Size = System::Drawing::Size(13, 13);
			this->label_CamNumber->TabIndex = 4;
			this->label_CamNumber->Text = L"0";
			// 
			// list_Cameras
			// 
			this->list_Cameras->FormattingEnabled = true;
			this->list_Cameras->Location = System::Drawing::Point(4, 32);
			this->list_Cameras->Name = L"list_Cameras";
			this->list_Cameras->Size = System::Drawing::Size(98, 82);
			this->list_Cameras->TabIndex = 5;
			this->list_Cameras->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::list_Cameras_SelectedIndexChanged);
			// 
			// numUD_height
			// 
			this->numUD_height->Location = System::Drawing::Point(72, 20);
			this->numUD_height->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {964, 0, 0, 0});
			this->numUD_height->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_height->Name = L"numUD_height";
			this->numUD_height->Size = System::Drawing::Size(60, 20);
			this->numUD_height->TabIndex = 6;
			this->numUD_height->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			// 
			// numUD_Width
			// 
			this->numUD_Width->Location = System::Drawing::Point(6, 20);
			this->numUD_Width->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1292, 0, 0, 0});
			this->numUD_Width->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_Width->Name = L"numUD_Width";
			this->numUD_Width->Size = System::Drawing::Size(60, 20);
			this->numUD_Width->TabIndex = 7;
			this->numUD_Width->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			// 
			// label_Cam1
			// 
			this->label_Cam1->AllowDrop = true;
			this->label_Cam1->AutoSize = true;
			this->label_Cam1->Location = System::Drawing::Point(6, 117);
			this->label_Cam1->Name = L"label_Cam1";
			this->label_Cam1->Size = System::Drawing::Size(79, 13);
			this->label_Cam1->TabIndex = 8;
			this->label_Cam1->Text = L"Camera Setting";
			this->label_Cam1->Click += gcnew System::EventHandler(this, &Form1::label_Cam1_Click);
			// 
			// check_disp
			// 
			this->check_disp->AutoSize = true;
			this->check_disp->Location = System::Drawing::Point(242, 152);
			this->check_disp->Name = L"check_disp";
			this->check_disp->Size = System::Drawing::Size(102, 17);
			this->check_disp->TabIndex = 9;
			this->check_disp->Text = L"Full size window";
			this->check_disp->UseVisualStyleBackColor = true;
			this->check_disp->CheckedChanged += gcnew System::EventHandler(this, &Form1::check_disp_CheckedChanged);
			// 
			// check_save
			// 
			this->check_save->AutoSize = true;
			this->check_save->Location = System::Drawing::Point(242, 133);
			this->check_save->Name = L"check_save";
			this->check_save->Size = System::Drawing::Size(79, 17);
			this->check_save->TabIndex = 10;
			this->check_save->Text = L"Save to file";
			this->check_save->UseVisualStyleBackColor = true;
			this->check_save->CheckedChanged += gcnew System::EventHandler(this, &Form1::check_save_CheckedChanged);
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Location = System::Drawing::Point(73, 4);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(58, 13);
			this->label2->TabIndex = 11;
			this->label2->Text = L"Height [px]";
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->Location = System::Drawing::Point(6, 4);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(55, 13);
			this->label3->TabIndex = 12;
			this->label3->Text = L"Width [px]";
			// 
			// numUD_expo
			// 
			this->numUD_expo->Enabled = false;
			this->numUD_expo->Location = System::Drawing::Point(6, 64);
			this->numUD_expo->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60000000, 0, 0, 0});
			this->numUD_expo->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {21, 0, 0, 0});
			this->numUD_expo->Name = L"numUD_expo";
			this->numUD_expo->Size = System::Drawing::Size(73, 20);
			this->numUD_expo->TabIndex = 17;
			this->numUD_expo->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {60000000, 0, 0, 0});
			// 
			// numUD_regx
			// 
			this->numUD_regx->Location = System::Drawing::Point(6, 60);
			this->numUD_regx->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {963, 0, 0, 0});
			this->numUD_regx->Name = L"numUD_regx";
			this->numUD_regx->Size = System::Drawing::Size(60, 20);
			this->numUD_regx->TabIndex = 13;
			this->numUD_regx->ValueChanged += gcnew System::EventHandler(this, &Form1::numUD_regx_ValueChanged);
			// 
			// numUD_regy
			// 
			this->numUD_regy->Location = System::Drawing::Point(72, 60);
			this->numUD_regy->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1291, 0, 0, 0});
			this->numUD_regy->Name = L"numUD_regy";
			this->numUD_regy->Size = System::Drawing::Size(60, 20);
			this->numUD_regy->TabIndex = 14;
			this->numUD_regy->ValueChanged += gcnew System::EventHandler(this, &Form1::numUD_regy_ValueChanged);
			// 
			// label5
			// 
			this->label5->AutoSize = true;
			this->label5->Location = System::Drawing::Point(3, 43);
			this->label5->Name = L"label5";
			this->label5->Size = System::Drawing::Size(49, 13);
			this->label5->TabIndex = 15;
			this->label5->Text = L"Region x";
			// 
			// label4
			// 
			this->label4->AutoSize = true;
			this->label4->Location = System::Drawing::Point(69, 44);
			this->label4->Name = L"label4";
			this->label4->Size = System::Drawing::Size(49, 13);
			this->label4->TabIndex = 16;
			this->label4->Text = L"Region y";
			// 
			// label7
			// 
			this->label7->AutoSize = true;
			this->label7->Location = System::Drawing::Point(69, 84);
			this->label7->Name = L"label7";
			this->label7->Size = System::Drawing::Size(50, 13);
			this->label7->TabIndex = 22;
			this->label7->Text = L"Binning y";
			// 
			// label8
			// 
			this->label8->AutoSize = true;
			this->label8->Location = System::Drawing::Point(3, 83);
			this->label8->Name = L"label8";
			this->label8->Size = System::Drawing::Size(50, 13);
			this->label8->TabIndex = 21;
			this->label8->Text = L"Binning x";
			// 
			// numUD_Biny
			// 
			this->numUD_Biny->Location = System::Drawing::Point(72, 100);
			this->numUD_Biny->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {14, 0, 0, 0});
			this->numUD_Biny->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_Biny->Name = L"numUD_Biny";
			this->numUD_Biny->Size = System::Drawing::Size(60, 20);
			this->numUD_Biny->TabIndex = 20;
			this->numUD_Biny->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_Biny->ValueChanged += gcnew System::EventHandler(this, &Form1::numUD_Biny_ValueChanged);
			// 
			// numUD_Binx
			// 
			this->numUD_Binx->Location = System::Drawing::Point(6, 100);
			this->numUD_Binx->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {8, 0, 0, 0});
			this->numUD_Binx->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_Binx->Name = L"numUD_Binx";
			this->numUD_Binx->Size = System::Drawing::Size(60, 20);
			this->numUD_Binx->TabIndex = 19;
			this->numUD_Binx->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_Binx->ValueChanged += gcnew System::EventHandler(this, &Form1::numUD_Binx_ValueChanged);
			// 
			// button_saveand
			// 
			this->button_saveand->Location = System::Drawing::Point(242, 239);
			this->button_saveand->Name = L"button_saveand";
			this->button_saveand->Size = System::Drawing::Size(122, 23);
			this->button_saveand->TabIndex = 25;
			this->button_saveand->Text = L"Save and  Capture";
			this->button_saveand->UseVisualStyleBackColor = true;
			this->button_saveand->Click += gcnew System::EventHandler(this, &Form1::button_saveand_Click);
			// 
			// button_save
			// 
			this->button_save->Location = System::Drawing::Point(242, 212);
			this->button_save->Name = L"button_save";
			this->button_save->Size = System::Drawing::Size(60, 23);
			this->button_save->TabIndex = 26;
			this->button_save->Text = L"Save ";
			this->button_save->UseVisualStyleBackColor = true;
			this->button_save->Click += gcnew System::EventHandler(this, &Form1::button_save_Click);
			// 
			// button_discrad
			// 
			this->button_discrad->Location = System::Drawing::Point(304, 212);
			this->button_discrad->Name = L"button_discrad";
			this->button_discrad->Size = System::Drawing::Size(60, 23);
			this->button_discrad->TabIndex = 27;
			this->button_discrad->Text = L"Discard";
			this->button_discrad->UseVisualStyleBackColor = true;
			this->button_discrad->Click += gcnew System::EventHandler(this, &Form1::button_discrad_Click);
			// 
			// CamStream
			// 
			this->CamStream->Interval = 10;
			this->CamStream->Tick += gcnew System::EventHandler(this, &Form1::timer_camera1_Tick);
			// 
			// button_stop
			// 
			this->button_stop->Location = System::Drawing::Point(242, 270);
			this->button_stop->Name = L"button_stop";
			this->button_stop->Size = System::Drawing::Size(122, 23);
			this->button_stop->TabIndex = 28;
			this->button_stop->Text = L"Stop Capture";
			this->button_stop->UseVisualStyleBackColor = true;
			this->button_stop->Click += gcnew System::EventHandler(this, &Form1::button_stop_Click);
			// 
			// label_framescapt
			// 
			this->label_framescapt->AutoSize = true;
			this->label_framescapt->Location = System::Drawing::Point(22, 253);
			this->label_framescapt->Name = L"label_framescapt";
			this->label_framescapt->Size = System::Drawing::Size(0, 13);
			this->label_framescapt->TabIndex = 29;
			// 
			// pictureBox1
			// 
			this->pictureBox1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->pictureBox1->Location = System::Drawing::Point(387, 17);
			this->pictureBox1->Name = L"pictureBox1";
			this->pictureBox1->Size = System::Drawing::Size(480, 360);
			this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox1->TabIndex = 30;
			this->pictureBox1->TabStop = false;
			this->pictureBox1->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click);
			// 
			// pictureBox2
			// 
			this->pictureBox2->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->pictureBox2->Location = System::Drawing::Point(873, 17);
			this->pictureBox2->Name = L"pictureBox2";
			this->pictureBox2->Size = System::Drawing::Size(480, 360);
			this->pictureBox2->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox2->TabIndex = 31;
			this->pictureBox2->TabStop = false;
			this->pictureBox2->Click += gcnew System::EventHandler(this, &Form1::pictureBox2_Click);
			// 
			// pictureBox3
			// 
			this->pictureBox3->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->pictureBox3->Location = System::Drawing::Point(1359, 17);
			this->pictureBox3->Name = L"pictureBox3";
			this->pictureBox3->Size = System::Drawing::Size(480, 360);
			this->pictureBox3->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox3->TabIndex = 32;
			this->pictureBox3->TabStop = false;
			this->pictureBox3->Click += gcnew System::EventHandler(this, &Form1::pictureBox3_Click);
			// 
			// pictureBox4
			// 
			this->pictureBox4->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->pictureBox4->Location = System::Drawing::Point(1359, 396);
			this->pictureBox4->Name = L"pictureBox4";
			this->pictureBox4->Size = System::Drawing::Size(480, 360);
			this->pictureBox4->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox4->TabIndex = 35;
			this->pictureBox4->TabStop = false;
			this->pictureBox4->Click += gcnew System::EventHandler(this, &Form1::pictureBox4_Click);
			// 
			// pictureBox5
			// 
			this->pictureBox5->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->pictureBox5->Location = System::Drawing::Point(873, 396);
			this->pictureBox5->Name = L"pictureBox5";
			this->pictureBox5->Size = System::Drawing::Size(480, 360);
			this->pictureBox5->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox5->TabIndex = 34;
			this->pictureBox5->TabStop = false;
			this->pictureBox5->Click += gcnew System::EventHandler(this, &Form1::pictureBox5_Click);
			// 
			// pictureBox6
			// 
			this->pictureBox6->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
			this->pictureBox6->Location = System::Drawing::Point(387, 396);
			this->pictureBox6->Name = L"pictureBox6";
			this->pictureBox6->Size = System::Drawing::Size(480, 360);
			this->pictureBox6->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox6->TabIndex = 33;
			this->pictureBox6->TabStop = false;
			this->pictureBox6->Click += gcnew System::EventHandler(this, &Form1::pictureBox6_Click);
			// 
			// label_disp1
			// 
			this->label_disp1->AutoSize = true;
			this->label_disp1->Location = System::Drawing::Point(384, 1);
			this->label_disp1->Name = L"label_disp1";
			this->label_disp1->Size = System::Drawing::Size(90, 13);
			this->label_disp1->TabIndex = 36;
			this->label_disp1->Text = L"Measured track 1";
			this->label_disp1->Visible = false;
			// 
			// label_disp2
			// 
			this->label_disp2->AutoSize = true;
			this->label_disp2->Location = System::Drawing::Point(870, 1);
			this->label_disp2->Name = L"label_disp2";
			this->label_disp2->Size = System::Drawing::Size(90, 13);
			this->label_disp2->TabIndex = 37;
			this->label_disp2->Text = L"Measured track 2";
			this->label_disp2->Visible = false;
			// 
			// label_disp3
			// 
			this->label_disp3->AutoSize = true;
			this->label_disp3->Location = System::Drawing::Point(1356, 1);
			this->label_disp3->Name = L"label_disp3";
			this->label_disp3->Size = System::Drawing::Size(42, 13);
			this->label_disp3->TabIndex = 38;
			this->label_disp3->Text = L"Cross 1";
			this->label_disp3->Visible = false;
			// 
			// label_disp4
			// 
			this->label_disp4->AutoSize = true;
			this->label_disp4->Location = System::Drawing::Point(384, 380);
			this->label_disp4->Name = L"label_disp4";
			this->label_disp4->Size = System::Drawing::Size(42, 13);
			this->label_disp4->TabIndex = 39;
			this->label_disp4->Text = L"Cross 2";
			this->label_disp4->Visible = false;
			// 
			// label_disp5
			// 
			this->label_disp5->AutoSize = true;
			this->label_disp5->Location = System::Drawing::Point(870, 380);
			this->label_disp5->Name = L"label_disp5";
			this->label_disp5->Size = System::Drawing::Size(42, 13);
			this->label_disp5->TabIndex = 40;
			this->label_disp5->Text = L"Cross 4";
			this->label_disp5->Visible = false;
			// 
			// label_disp6
			// 
			this->label_disp6->AutoSize = true;
			this->label_disp6->Location = System::Drawing::Point(1356, 380);
			this->label_disp6->Name = L"label_disp6";
			this->label_disp6->Size = System::Drawing::Size(42, 13);
			this->label_disp6->TabIndex = 41;
			this->label_disp6->Text = L"Cross 3";
			this->label_disp6->Visible = false;
			// 
			// timer_overview
			// 
			this->timer_overview->Interval = 30;
			this->timer_overview->Tick += gcnew System::EventHandler(this, &Form1::timer_overview_Tick);
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(345, 3);
			this->textBox1->Name = L"textBox1";
			this->textBox1->Size = System::Drawing::Size(21, 20);
			this->textBox1->TabIndex = 42;
			this->textBox1->Visible = false;
			// 
			// textBox2
			// 
			this->textBox2->Location = System::Drawing::Point(266, 29);
			this->textBox2->Name = L"textBox2";
			this->textBox2->Size = System::Drawing::Size(100, 20);
			this->textBox2->TabIndex = 43;
			this->textBox2->Visible = false;
			// 
			// tabControl1
			// 
			this->tabControl1->Controls->Add(this->tabPage1);
			this->tabControl1->Controls->Add(this->tabPage2);
			this->tabControl1->Controls->Add(this->Gain);
			this->tabControl1->Controls->Add(this->tabPage3);
			this->tabControl1->Location = System::Drawing::Point(8, 133);
			this->tabControl1->Name = L"tabControl1";
			this->tabControl1->SelectedIndex = 0;
			this->tabControl1->Size = System::Drawing::Size(228, 160);
			this->tabControl1->TabIndex = 44;
			// 
			// tabPage1
			// 
			this->tabPage1->Controls->Add(this->label2);
			this->tabPage1->Controls->Add(this->numUD_height);
			this->tabPage1->Controls->Add(this->numUD_Width);
			this->tabPage1->Controls->Add(this->label3);
			this->tabPage1->Controls->Add(this->numUD_regx);
			this->tabPage1->Controls->Add(this->numUD_regy);
			this->tabPage1->Controls->Add(this->label5);
			this->tabPage1->Controls->Add(this->label4);
			this->tabPage1->Controls->Add(this->numUD_Binx);
			this->tabPage1->Controls->Add(this->numUD_Biny);
			this->tabPage1->Controls->Add(this->label8);
			this->tabPage1->Controls->Add(this->label7);
			this->tabPage1->Location = System::Drawing::Point(4, 22);
			this->tabPage1->Name = L"tabPage1";
			this->tabPage1->Padding = System::Windows::Forms::Padding(3);
			this->tabPage1->Size = System::Drawing::Size(220, 134);
			this->tabPage1->TabIndex = 0;
			this->tabPage1->Text = L"ROI";
			this->tabPage1->UseVisualStyleBackColor = true;
			// 
			// tabPage2
			// 
			this->tabPage2->Controls->Add(this->comboBox1);
			this->tabPage2->Controls->Add(this->label10);
			this->tabPage2->Controls->Add(this->label6);
			this->tabPage2->Controls->Add(this->numUD_expo);
			this->tabPage2->Location = System::Drawing::Point(4, 22);
			this->tabPage2->Name = L"tabPage2";
			this->tabPage2->Padding = System::Windows::Forms::Padding(3);
			this->tabPage2->Size = System::Drawing::Size(220, 134);
			this->tabPage2->TabIndex = 1;
			this->tabPage2->Text = L"Exposure";
			this->tabPage2->UseVisualStyleBackColor = true;
			// 
			// comboBox1
			// 
			this->comboBox1->FormattingEnabled = true;
			this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^  >(3) {L"Auto - continuous", L"Auto - once", L"Manual"});
			this->comboBox1->Location = System::Drawing::Point(6, 19);
			this->comboBox1->Name = L"comboBox1";
			this->comboBox1->Size = System::Drawing::Size(167, 21);
			this->comboBox1->TabIndex = 50;
			this->comboBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox1_SelectedIndexChanged);
			// 
			// label10
			// 
			this->label10->AutoSize = true;
			this->label10->Location = System::Drawing::Point(6, 3);
			this->label10->Name = L"label10";
			this->label10->Size = System::Drawing::Size(80, 13);
			this->label10->TabIndex = 48;
			this->label10->Text = L"Exposure mode";
			// 
			// label6
			// 
			this->label6->AutoSize = true;
			this->label6->Location = System::Drawing::Point(6, 48);
			this->label6->Name = L"label6";
			this->label6->Size = System::Drawing::Size(93, 13);
			this->label6->TabIndex = 45;
			this->label6->Text = L"Exposure time [us]";
			// 
			// Gain
			// 
			this->Gain->Controls->Add(this->comboBox2);
			this->Gain->Controls->Add(this->label19);
			this->Gain->Controls->Add(this->label20);
			this->Gain->Controls->Add(this->numUD_gain);
			this->Gain->Location = System::Drawing::Point(4, 22);
			this->Gain->Name = L"Gain";
			this->Gain->Padding = System::Windows::Forms::Padding(3);
			this->Gain->Size = System::Drawing::Size(220, 134);
			this->Gain->TabIndex = 2;
			this->Gain->Text = L"Gain";
			this->Gain->UseVisualStyleBackColor = true;
			// 
			// comboBox2
			// 
			this->comboBox2->FormattingEnabled = true;
			this->comboBox2->Items->AddRange(gcnew cli::array< System::Object^  >(3) {L"Auto - continuous", L"Auto - once", L"Manual"});
			this->comboBox2->Location = System::Drawing::Point(6, 19);
			this->comboBox2->Name = L"comboBox2";
			this->comboBox2->Size = System::Drawing::Size(92, 21);
			this->comboBox2->TabIndex = 54;
			this->comboBox2->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox2_SelectedIndexChanged);
			// 
			// label19
			// 
			this->label19->AutoSize = true;
			this->label19->Location = System::Drawing::Point(6, 3);
			this->label19->Name = L"label19";
			this->label19->Size = System::Drawing::Size(58, 13);
			this->label19->TabIndex = 53;
			this->label19->Text = L"Gain mode";
			// 
			// label20
			// 
			this->label20->AutoSize = true;
			this->label20->Location = System::Drawing::Point(6, 48);
			this->label20->Name = L"label20";
			this->label20->Size = System::Drawing::Size(51, 13);
			this->label20->TabIndex = 52;
			this->label20->Text = L"Gain [dB]";
			// 
			// numUD_gain
			// 
			this->numUD_gain->Enabled = false;
			this->numUD_gain->Location = System::Drawing::Point(6, 64);
			this->numUD_gain->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60000000, 0, 0, 0});
			this->numUD_gain->Name = L"numUD_gain";
			this->numUD_gain->Size = System::Drawing::Size(73, 20);
			this->numUD_gain->TabIndex = 51;
			// 
			// tabPage3
			// 
			this->tabPage3->Controls->Add(this->label29);
			this->tabPage3->Controls->Add(this->numUD_framect);
			this->tabPage3->Controls->Add(this->label21);
			this->tabPage3->Controls->Add(this->numUD_FrameRate);
			this->tabPage3->Controls->Add(this->cmode_acq);
			this->tabPage3->Controls->Add(this->label22);
			this->tabPage3->Controls->Add(this->cmode_trigger);
			this->tabPage3->Controls->Add(this->label9);
			this->tabPage3->Location = System::Drawing::Point(4, 22);
			this->tabPage3->Name = L"tabPage3";
			this->tabPage3->Size = System::Drawing::Size(220, 134);
			this->tabPage3->TabIndex = 3;
			this->tabPage3->Text = L"Camera mode";
			this->tabPage3->UseVisualStyleBackColor = true;
			// 
			// label29
			// 
			this->label29->AutoSize = true;
			this->label29->Location = System::Drawing::Point(105, 48);
			this->label29->Name = L"label29";
			this->label29->Size = System::Drawing::Size(79, 13);
			this->label29->TabIndex = 62;
			this->label29->Text = L"Frame Count [-]";
			// 
			// numUD_framect
			// 
			this->numUD_framect->Enabled = false;
			this->numUD_framect->Location = System::Drawing::Point(105, 64);
			this->numUD_framect->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {65535, 0, 0, 0});
			this->numUD_framect->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_framect->Name = L"numUD_framect";
			this->numUD_framect->Size = System::Drawing::Size(92, 20);
			this->numUD_framect->TabIndex = 61;
			this->numUD_framect->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_framect->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown5_ValueChanged_1);
			// 
			// label21
			// 
			this->label21->AutoSize = true;
			this->label21->Location = System::Drawing::Point(6, 48);
			this->label21->Name = L"label21";
			this->label21->Size = System::Drawing::Size(83, 13);
			this->label21->TabIndex = 60;
			this->label21->Text = L"Trigger Freq[Hz]";
			// 
			// numUD_FrameRate
			// 
			this->numUD_FrameRate->DecimalPlaces = 3;
			this->numUD_FrameRate->Enabled = false;
			this->numUD_FrameRate->Location = System::Drawing::Point(6, 64);
			this->numUD_FrameRate->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {3075, 0, 0, 131072});
			this->numUD_FrameRate->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 131072});
			this->numUD_FrameRate->Name = L"numUD_FrameRate";
			this->numUD_FrameRate->Size = System::Drawing::Size(92, 20);
			this->numUD_FrameRate->TabIndex = 59;
			this->numUD_FrameRate->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 131072});
			this->numUD_FrameRate->ValueChanged += gcnew System::EventHandler(this, &Form1::numUD_FrameRate_ValueChanged);
			// 
			// cmode_acq
			// 
			this->cmode_acq->FormattingEnabled = true;
			this->cmode_acq->Items->AddRange(gcnew cli::array< System::Object^  >(3) {L"Continuous", L"SingleFrame", L"MultiFrame"});
			this->cmode_acq->Location = System::Drawing::Point(104, 19);
			this->cmode_acq->Name = L"cmode_acq";
			this->cmode_acq->Size = System::Drawing::Size(84, 21);
			this->cmode_acq->TabIndex = 58;
			this->cmode_acq->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::cmode_acq_SelectedIndexChanged);
			// 
			// label22
			// 
			this->label22->AutoSize = true;
			this->label22->Location = System::Drawing::Point(102, 3);
			this->label22->Name = L"label22";
			this->label22->Size = System::Drawing::Size(87, 13);
			this->label22->TabIndex = 57;
			this->label22->Text = L"Acquisition mode";
			// 
			// cmode_trigger
			// 
			this->cmode_trigger->FormattingEnabled = true;
			this->cmode_trigger->Items->AddRange(gcnew cli::array< System::Object^  >(3) {L"Freerun", L"FixedRate", L"Software"});
			this->cmode_trigger->Location = System::Drawing::Point(6, 19);
			this->cmode_trigger->Name = L"cmode_trigger";
			this->cmode_trigger->Size = System::Drawing::Size(92, 21);
			this->cmode_trigger->TabIndex = 56;
			this->cmode_trigger->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::cmode_trigger_SelectedIndexChanged);
			// 
			// label9
			// 
			this->label9->AutoSize = true;
			this->label9->Location = System::Drawing::Point(6, 3);
			this->label9->Name = L"label9";
			this->label9->Size = System::Drawing::Size(97, 13);
			this->label9->TabIndex = 55;
			this->label9->Text = L"Frame Start Trigger";
			// 
			// label11
			// 
			this->label11->AutoSize = true;
			this->label11->Location = System::Drawing::Point(109, 32);
			this->label11->Name = L"label11";
			this->label11->Size = System::Drawing::Size(41, 13);
			this->label11->TabIndex = 45;
			this->label11->Text = L"label11";
			this->label11->Visible = false;
			// 
			// label12
			// 
			this->label12->AutoSize = true;
			this->label12->Location = System::Drawing::Point(109, 45);
			this->label12->Name = L"label12";
			this->label12->Size = System::Drawing::Size(41, 13);
			this->label12->TabIndex = 46;
			this->label12->Text = L"label12";
			this->label12->Visible = false;
			// 
			// label13
			// 
			this->label13->AutoSize = true;
			this->label13->Location = System::Drawing::Point(109, 58);
			this->label13->Name = L"label13";
			this->label13->Size = System::Drawing::Size(41, 13);
			this->label13->TabIndex = 47;
			this->label13->Text = L"label13";
			this->label13->Visible = false;
			// 
			// label14
			// 
			this->label14->AutoSize = true;
			this->label14->Location = System::Drawing::Point(109, 71);
			this->label14->Name = L"label14";
			this->label14->Size = System::Drawing::Size(41, 13);
			this->label14->TabIndex = 48;
			this->label14->Text = L"label14";
			this->label14->Visible = false;
			// 
			// label15
			// 
			this->label15->AutoSize = true;
			this->label15->Location = System::Drawing::Point(109, 84);
			this->label15->Name = L"label15";
			this->label15->Size = System::Drawing::Size(41, 13);
			this->label15->TabIndex = 49;
			this->label15->Text = L"label15";
			this->label15->Visible = false;
			// 
			// label16
			// 
			this->label16->AutoSize = true;
			this->label16->Location = System::Drawing::Point(109, 97);
			this->label16->Name = L"label16";
			this->label16->Size = System::Drawing::Size(41, 13);
			this->label16->TabIndex = 50;
			this->label16->Text = L"label16";
			this->label16->Visible = false;
			// 
			// label17
			// 
			this->label17->AutoSize = true;
			this->label17->Location = System::Drawing::Point(6, 16);
			this->label17->Name = L"label17";
			this->label17->Size = System::Drawing::Size(101, 13);
			this->label17->TabIndex = 51;
			this->label17->Text = L"Unique Camera\'s ID";
			this->label17->Click += gcnew System::EventHandler(this, &Form1::label17_Click);
			// 
			// label18
			// 
			this->label18->AutoSize = true;
			this->label18->Location = System::Drawing::Point(109, 16);
			this->label18->Name = L"label18";
			this->label18->Size = System::Drawing::Size(91, 13);
			this->label18->TabIndex = 52;
			this->label18->Text = L"Camera\'s function";
			// 
			// shapeContainer1
			// 
			this->shapeContainer1->Location = System::Drawing::Point(0, 0);
			this->shapeContainer1->Margin = System::Windows::Forms::Padding(0);
			this->shapeContainer1->Name = L"shapeContainer1";
			this->shapeContainer1->Shapes->AddRange(gcnew cli::array< Microsoft::VisualBasic::PowerPacks::Shape^  >(12) {this->ovalShape6, 
				this->ovalShape5, this->ovalShape4, this->ovalShape3, this->ovalShape2, this->ovalShape1, this->rectangleShape6, this->rectangleShape5, 
				this->rectangleShape4, this->rectangleShape3, this->rectangleShape2, this->rectangleShape1});
			this->shapeContainer1->Size = System::Drawing::Size(1854, 957);
			this->shapeContainer1->TabIndex = 53;
			this->shapeContainer1->TabStop = false;
			// 
			// ovalShape6
			// 
			this->ovalShape6->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape6->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->ovalShape6->FillColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape6->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape6->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->ovalShape6->Location = System::Drawing::Point(1398, 382);
			this->ovalShape6->Name = L"ovalShape6";
			this->ovalShape6->Size = System::Drawing::Size(10, 10);
			this->ovalShape6->Visible = false;
			// 
			// ovalShape5
			// 
			this->ovalShape5->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape5->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->ovalShape5->FillColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape5->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape5->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->ovalShape5->Location = System::Drawing::Point(914, 382);
			this->ovalShape5->Name = L"ovalShape5";
			this->ovalShape5->Size = System::Drawing::Size(10, 10);
			this->ovalShape5->Visible = false;
			// 
			// ovalShape4
			// 
			this->ovalShape4->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape4->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->ovalShape4->FillColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape4->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape4->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->ovalShape4->Location = System::Drawing::Point(430, 382);
			this->ovalShape4->Name = L"ovalShape4";
			this->ovalShape4->Size = System::Drawing::Size(10, 10);
			this->ovalShape4->Visible = false;
			// 
			// ovalShape3
			// 
			this->ovalShape3->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape3->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->ovalShape3->FillColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape3->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape3->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->ovalShape3->Location = System::Drawing::Point(1397, 3);
			this->ovalShape3->Name = L"ovalShape3";
			this->ovalShape3->Size = System::Drawing::Size(10, 10);
			this->ovalShape3->Visible = false;
			// 
			// ovalShape2
			// 
			this->ovalShape2->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape2->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->ovalShape2->FillColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape2->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape2->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->ovalShape2->Location = System::Drawing::Point(962, 2);
			this->ovalShape2->Name = L"ovalShape2";
			this->ovalShape2->Size = System::Drawing::Size(10, 10);
			this->ovalShape2->Visible = false;
			// 
			// ovalShape1
			// 
			this->ovalShape1->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape1->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->ovalShape1->FillColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape1->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->ovalShape1->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->ovalShape1->Location = System::Drawing::Point(477, 3);
			this->ovalShape1->Name = L"ovalShape1";
			this->ovalShape1->Size = System::Drawing::Size(10, 10);
			this->ovalShape1->Visible = false;
			// 
			// rectangleShape6
			// 
			this->rectangleShape6->BackColor = System::Drawing::Color::Blue;
			this->rectangleShape6->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->rectangleShape6->FillColor = System::Drawing::Color::Blue;
			this->rectangleShape6->FillGradientColor = System::Drawing::Color::Blue;
			this->rectangleShape6->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->rectangleShape6->Location = System::Drawing::Point(1356, 393);
			this->rectangleShape6->Name = L"rectangleShape6";
			this->rectangleShape6->Size = System::Drawing::Size(486, 366);
			this->rectangleShape6->Visible = false;
			// 
			// rectangleShape5
			// 
			this->rectangleShape5->BackColor = System::Drawing::Color::Blue;
			this->rectangleShape5->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->rectangleShape5->FillColor = System::Drawing::Color::Blue;
			this->rectangleShape5->FillGradientColor = System::Drawing::Color::Blue;
			this->rectangleShape5->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->rectangleShape5->Location = System::Drawing::Point(870, 393);
			this->rectangleShape5->Name = L"rectangleShape5";
			this->rectangleShape5->Size = System::Drawing::Size(486, 366);
			this->rectangleShape5->Visible = false;
			// 
			// rectangleShape4
			// 
			this->rectangleShape4->BackColor = System::Drawing::Color::Blue;
			this->rectangleShape4->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->rectangleShape4->FillColor = System::Drawing::Color::Blue;
			this->rectangleShape4->FillGradientColor = System::Drawing::Color::Blue;
			this->rectangleShape4->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->rectangleShape4->Location = System::Drawing::Point(384, 393);
			this->rectangleShape4->Name = L"rectangleShape4";
			this->rectangleShape4->Size = System::Drawing::Size(486, 366);
			this->rectangleShape4->Visible = false;
			// 
			// rectangleShape3
			// 
			this->rectangleShape3->BackColor = System::Drawing::Color::Blue;
			this->rectangleShape3->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->rectangleShape3->FillColor = System::Drawing::Color::Blue;
			this->rectangleShape3->FillGradientColor = System::Drawing::Color::Blue;
			this->rectangleShape3->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->rectangleShape3->Location = System::Drawing::Point(1356, 14);
			this->rectangleShape3->Name = L"rectangleShape3";
			this->rectangleShape3->Size = System::Drawing::Size(486, 366);
			this->rectangleShape3->Visible = false;
			// 
			// rectangleShape2
			// 
			this->rectangleShape2->BackColor = System::Drawing::Color::Blue;
			this->rectangleShape2->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->rectangleShape2->FillColor = System::Drawing::Color::Blue;
			this->rectangleShape2->FillGradientColor = System::Drawing::Color::Blue;
			this->rectangleShape2->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->rectangleShape2->Location = System::Drawing::Point(870, 14);
			this->rectangleShape2->Name = L"rectangleShape2";
			this->rectangleShape2->Size = System::Drawing::Size(486, 366);
			this->rectangleShape2->Visible = false;
			// 
			// rectangleShape1
			// 
			this->rectangleShape1->BackColor = System::Drawing::Color::Blue;
			this->rectangleShape1->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->rectangleShape1->FillColor = System::Drawing::Color::Blue;
			this->rectangleShape1->FillGradientColor = System::Drawing::Color::Blue;
			this->rectangleShape1->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->rectangleShape1->Location = System::Drawing::Point(384, 14);
			this->rectangleShape1->Name = L"rectangleShape1";
			this->rectangleShape1->Size = System::Drawing::Size(486, 366);
			this->rectangleShape1->Visible = false;
			// 
			// group_slotcar
			// 
			this->group_slotcar->Controls->Add(this->button8);
			this->group_slotcar->Controls->Add(this->label25);
			this->group_slotcar->Controls->Add(this->safe_speed);
			this->group_slotcar->Controls->Add(this->button4);
			this->group_slotcar->Controls->Add(this->button3);
			this->group_slotcar->Controls->Add(this->button2);
			this->group_slotcar->Controls->Add(this->button1);
			this->group_slotcar->Controls->Add(this->label24);
			this->group_slotcar->Controls->Add(this->label23);
			this->group_slotcar->Controls->Add(this->numericUpDown3);
			this->group_slotcar->Controls->Add(this->numericUpDown2);
			this->group_slotcar->Controls->Add(this->numericUpDown1);
			this->group_slotcar->Controls->Add(this->trackBar3);
			this->group_slotcar->Controls->Add(this->trackBar2);
			this->group_slotcar->Controls->Add(this->trackBar1);
			this->group_slotcar->Controls->Add(this->checkBox3);
			this->group_slotcar->Controls->Add(this->checkBox2);
			this->group_slotcar->Controls->Add(this->checkBox1);
			this->group_slotcar->Enabled = false;
			this->group_slotcar->Location = System::Drawing::Point(8, 391);
			this->group_slotcar->Name = L"group_slotcar";
			this->group_slotcar->Size = System::Drawing::Size(370, 175);
			this->group_slotcar->TabIndex = 54;
			this->group_slotcar->TabStop = false;
			this->group_slotcar->Text = L"Slotcar control";
			// 
			// button8
			// 
			this->button8->BackColor = System::Drawing::Color::Red;
			this->button8->Location = System::Drawing::Point(243, 146);
			this->button8->Name = L"button8";
			this->button8->Size = System::Drawing::Size(106, 23);
			this->button8->TabIndex = 17;
			this->button8->Text = L"Stop and reset";
			this->button8->UseVisualStyleBackColor = false;
			this->button8->Click += gcnew System::EventHandler(this, &Form1::button8_Click);
			// 
			// label25
			// 
			this->label25->AutoSize = true;
			this->label25->Location = System::Drawing::Point(1, 133);
			this->label25->Name = L"label25";
			this->label25->Size = System::Drawing::Size(219, 13);
			this->label25->TabIndex = 16;
			this->label25->Text = L"Unless allowed, you may set only safe values";
			// 
			// safe_speed
			// 
			this->safe_speed->AutoSize = true;
			this->safe_speed->Location = System::Drawing::Point(4, 152);
			this->safe_speed->Name = L"safe_speed";
			this->safe_speed->Size = System::Drawing::Size(101, 17);
			this->safe_speed->TabIndex = 15;
			this->safe_speed->Text = L"Allow all speeds";
			this->safe_speed->TextAlign = System::Drawing::ContentAlignment::BottomCenter;
			this->safe_speed->UseVisualStyleBackColor = true;
			this->safe_speed->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox4_CheckedChanged);
			// 
			// button4
			// 
			this->button4->Location = System::Drawing::Point(274, 118);
			this->button4->Name = L"button4";
			this->button4->Size = System::Drawing::Size(75, 23);
			this->button4->TabIndex = 14;
			this->button4->Text = L"Change All";
			this->button4->UseVisualStyleBackColor = true;
			this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
			// 
			// button3
			// 
			this->button3->Location = System::Drawing::Point(274, 89);
			this->button3->Name = L"button3";
			this->button3->Size = System::Drawing::Size(75, 23);
			this->button3->TabIndex = 13;
			this->button3->Text = L"Change";
			this->button3->UseVisualStyleBackColor = true;
			this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click_1);
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(274, 54);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(75, 23);
			this->button2->TabIndex = 12;
			this->button2->Text = L"Change";
			this->button2->UseVisualStyleBackColor = true;
			this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click_1);
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(274, 19);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(75, 23);
			this->button1->TabIndex = 11;
			this->button1->Text = L"Change";
			this->button1->UseVisualStyleBackColor = true;
			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
			// 
			// label24
			// 
			this->label24->AutoSize = true;
			this->label24->Location = System::Drawing::Point(169, 16);
			this->label24->Name = L"label24";
			this->label24->Size = System::Drawing::Size(38, 13);
			this->label24->TabIndex = 10;
			this->label24->Text = L"Speed";
			// 
			// label23
			// 
			this->label23->AutoSize = true;
			this->label23->Location = System::Drawing::Point(6, 16);
			this->label23->Name = L"label23";
			this->label23->Size = System::Drawing::Size(46, 13);
			this->label23->TabIndex = 9;
			this->label23->Text = L"Enabled";
			// 
			// numericUpDown3
			// 
			this->numericUpDown3->Enabled = false;
			this->numericUpDown3->Location = System::Drawing::Point(224, 104);
			this->numericUpDown3->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 0});
			this->numericUpDown3->Name = L"numericUpDown3";
			this->numericUpDown3->Size = System::Drawing::Size(44, 20);
			this->numericUpDown3->TabIndex = 8;
			this->numericUpDown3->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown3_ValueChanged);
			// 
			// numericUpDown2
			// 
			this->numericUpDown2->Enabled = false;
			this->numericUpDown2->Location = System::Drawing::Point(224, 69);
			this->numericUpDown2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 0});
			this->numericUpDown2->Name = L"numericUpDown2";
			this->numericUpDown2->Size = System::Drawing::Size(44, 20);
			this->numericUpDown2->TabIndex = 7;
			this->numericUpDown2->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown2_ValueChanged);
			// 
			// numericUpDown1
			// 
			this->numericUpDown1->Location = System::Drawing::Point(224, 32);
			this->numericUpDown1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {5, 0, 0, 0});
			this->numericUpDown1->Name = L"numericUpDown1";
			this->numericUpDown1->Size = System::Drawing::Size(44, 20);
			this->numericUpDown1->TabIndex = 6;
			this->numericUpDown1->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown1_ValueChanged_1);
			// 
			// trackBar3
			// 
			this->trackBar3->Enabled = false;
			this->trackBar3->Location = System::Drawing::Point(57, 104);
			this->trackBar3->Maximum = 5;
			this->trackBar3->Name = L"trackBar3";
			this->trackBar3->Size = System::Drawing::Size(161, 42);
			this->trackBar3->TabIndex = 5;
			this->trackBar3->Scroll += gcnew System::EventHandler(this, &Form1::trackBar3_Scroll);
			// 
			// trackBar2
			// 
			this->trackBar2->Enabled = false;
			this->trackBar2->Location = System::Drawing::Point(57, 67);
			this->trackBar2->Maximum = 5;
			this->trackBar2->Name = L"trackBar2";
			this->trackBar2->Size = System::Drawing::Size(161, 42);
			this->trackBar2->TabIndex = 4;
			this->trackBar2->Scroll += gcnew System::EventHandler(this, &Form1::trackBar2_Scroll);
			// 
			// trackBar1
			// 
			this->trackBar1->Location = System::Drawing::Point(57, 32);
			this->trackBar1->Maximum = 5;
			this->trackBar1->Name = L"trackBar1";
			this->trackBar1->Size = System::Drawing::Size(161, 42);
			this->trackBar1->TabIndex = 3;
			this->trackBar1->Scroll += gcnew System::EventHandler(this, &Form1::trackBar1_Scroll);
			// 
			// checkBox3
			// 
			this->checkBox3->AutoSize = true;
			this->checkBox3->Location = System::Drawing::Point(4, 104);
			this->checkBox3->Name = L"checkBox3";
			this->checkBox3->Size = System::Drawing::Size(56, 17);
			this->checkBox3->TabIndex = 2;
			this->checkBox3->Text = L"DPot3";
			this->checkBox3->UseVisualStyleBackColor = true;
			this->checkBox3->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox3_CheckedChanged);
			// 
			// checkBox2
			// 
			this->checkBox2->AutoSize = true;
			this->checkBox2->Location = System::Drawing::Point(6, 69);
			this->checkBox2->Name = L"checkBox2";
			this->checkBox2->Size = System::Drawing::Size(56, 17);
			this->checkBox2->TabIndex = 1;
			this->checkBox2->Text = L"DPot2";
			this->checkBox2->UseVisualStyleBackColor = true;
			this->checkBox2->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox2_CheckedChanged);
			// 
			// checkBox1
			// 
			this->checkBox1->AutoSize = true;
			this->checkBox1->Checked = true;
			this->checkBox1->CheckState = System::Windows::Forms::CheckState::Checked;
			this->checkBox1->Location = System::Drawing::Point(6, 32);
			this->checkBox1->Name = L"checkBox1";
			this->checkBox1->Size = System::Drawing::Size(56, 17);
			this->checkBox1->TabIndex = 0;
			this->checkBox1->Text = L"DPot1";
			this->checkBox1->UseVisualStyleBackColor = true;
			this->checkBox1->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox1_CheckedChanged);
			// 
			// groupBox2
			// 
			this->groupBox2->Controls->Add(this->label18);
			this->groupBox2->Controls->Add(this->label16);
			this->groupBox2->Controls->Add(this->label17);
			this->groupBox2->Controls->Add(this->label15);
			this->groupBox2->Controls->Add(this->tabControl1);
			this->groupBox2->Controls->Add(this->label14);
			this->groupBox2->Controls->Add(this->label13);
			this->groupBox2->Controls->Add(this->label12);
			this->groupBox2->Controls->Add(this->label11);
			this->groupBox2->Controls->Add(this->check_save);
			this->groupBox2->Controls->Add(this->check_disp);
			this->groupBox2->Controls->Add(this->label_Cam1);
			this->groupBox2->Controls->Add(this->button_stop);
			this->groupBox2->Controls->Add(this->list_Cameras);
			this->groupBox2->Controls->Add(this->button_discrad);
			this->groupBox2->Controls->Add(this->button_save);
			this->groupBox2->Controls->Add(this->button_saveand);
			this->groupBox2->Enabled = false;
			this->groupBox2->Location = System::Drawing::Point(8, 60);
			this->groupBox2->Name = L"groupBox2";
			this->groupBox2->Size = System::Drawing::Size(369, 298);
			this->groupBox2->TabIndex = 55;
			this->groupBox2->TabStop = false;
			this->groupBox2->Text = L"Cameras Control";
			// 
			// group_semafor
			// 
			this->group_semafor->Controls->Add(this->tabControl2);
			this->group_semafor->Enabled = false;
			this->group_semafor->Location = System::Drawing::Point(4, 572);
			this->group_semafor->Name = L"group_semafor";
			this->group_semafor->Size = System::Drawing::Size(368, 328);
			this->group_semafor->TabIndex = 56;
			this->group_semafor->TabStop = false;
			this->group_semafor->Text = L"Traffic lights control";
			// 
			// tabControl2
			// 
			this->tabControl2->Controls->Add(this->Manual);
			this->tabControl2->Controls->Add(this->Automatic);
			this->tabControl2->Location = System::Drawing::Point(9, 19);
			this->tabControl2->Name = L"tabControl2";
			this->tabControl2->SelectedIndex = 0;
			this->tabControl2->Size = System::Drawing::Size(353, 299);
			this->tabControl2->TabIndex = 0;
			// 
			// Manual
			// 
			this->Manual->Controls->Add(this->pictureBox11);
			this->Manual->Controls->Add(this->pictureBox10);
			this->Manual->Controls->Add(this->pictureBox9);
			this->Manual->Controls->Add(this->label28);
			this->Manual->Controls->Add(this->label32);
			this->Manual->Controls->Add(this->group_S6);
			this->Manual->Controls->Add(this->group_S5);
			this->Manual->Controls->Add(this->group_S4);
			this->Manual->Controls->Add(this->group_S3);
			this->Manual->Controls->Add(this->pictureBox7);
			this->Manual->Controls->Add(this->group_S2);
			this->Manual->Controls->Add(this->group_S1);
			this->Manual->Controls->Add(this->button5);
			this->Manual->Controls->Add(this->numericUpDown4);
			this->Manual->Location = System::Drawing::Point(4, 22);
			this->Manual->Name = L"Manual";
			this->Manual->Padding = System::Windows::Forms::Padding(3);
			this->Manual->Size = System::Drawing::Size(345, 273);
			this->Manual->TabIndex = 0;
			this->Manual->Text = L"Manual";
			this->Manual->UseVisualStyleBackColor = true;
			// 
			// pictureBox11
			// 
			this->pictureBox11->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox11.Image")));
			this->pictureBox11->Location = System::Drawing::Point(6, 216);
			this->pictureBox11->Name = L"pictureBox11";
			this->pictureBox11->Size = System::Drawing::Size(26, 51);
			this->pictureBox11->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox11->TabIndex = 40;
			this->pictureBox11->TabStop = false;
			// 
			// pictureBox10
			// 
			this->pictureBox10->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox10.Image")));
			this->pictureBox10->Location = System::Drawing::Point(6, 159);
			this->pictureBox10->Name = L"pictureBox10";
			this->pictureBox10->Size = System::Drawing::Size(26, 51);
			this->pictureBox10->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox10->TabIndex = 39;
			this->pictureBox10->TabStop = false;
			// 
			// pictureBox9
			// 
			this->pictureBox9->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox9.Image")));
			this->pictureBox9->Location = System::Drawing::Point(6, 102);
			this->pictureBox9->Name = L"pictureBox9";
			this->pictureBox9->Size = System::Drawing::Size(26, 51);
			this->pictureBox9->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox9->TabIndex = 38;
			this->pictureBox9->TabStop = false;
			// 
			// label28
			// 
			this->label28->AutoSize = true;
			this->label28->Location = System::Drawing::Point(3, 3);
			this->label28->Name = L"label28";
			this->label28->Size = System::Drawing::Size(279, 26);
			this->label28->TabIndex = 17;
			this->label28->Text = L"In manual mode the, traffic lights will retain its setting untill \r\nchanged again" 
				L". Upload by pressing Change button";
			// 
			// label32
			// 
			this->label32->AutoSize = true;
			this->label32->Location = System::Drawing::Point(270, 37);
			this->label32->Name = L"label32";
			this->label32->Size = System::Drawing::Size(76, 13);
			this->label32->TabIndex = 32;
			this->label32->Text = L"Lights enabled";
			// 
			// group_S6
			// 
			this->group_S6->Controls->Add(this->radio_63);
			this->group_S6->Controls->Add(this->radio_61);
			this->group_S6->Controls->Add(this->radio_62);
			this->group_S6->Controls->Add(this->radio_64);
			this->group_S6->Enabled = false;
			this->group_S6->Location = System::Drawing::Point(238, 37);
			this->group_S6->Name = L"group_S6";
			this->group_S6->Size = System::Drawing::Size(34, 230);
			this->group_S6->TabIndex = 37;
			this->group_S6->TabStop = false;
			this->group_S6->Text = L"6";
			// 
			// radio_63
			// 
			this->radio_63->AutoSize = true;
			this->radio_63->Location = System::Drawing::Point(10, 122);
			this->radio_63->Name = L"radio_63";
			this->radio_63->Size = System::Drawing::Size(14, 13);
			this->radio_63->TabIndex = 3;
			this->radio_63->UseVisualStyleBackColor = true;
			// 
			// radio_61
			// 
			this->radio_61->AutoSize = true;
			this->radio_61->Checked = true;
			this->radio_61->Location = System::Drawing::Point(10, 12);
			this->radio_61->Name = L"radio_61";
			this->radio_61->Size = System::Drawing::Size(14, 13);
			this->radio_61->TabIndex = 1;
			this->radio_61->TabStop = true;
			this->radio_61->UseVisualStyleBackColor = true;
			// 
			// radio_62
			// 
			this->radio_62->AutoSize = true;
			this->radio_62->Location = System::Drawing::Point(10, 65);
			this->radio_62->Name = L"radio_62";
			this->radio_62->Size = System::Drawing::Size(14, 13);
			this->radio_62->TabIndex = 2;
			this->radio_62->UseVisualStyleBackColor = true;
			// 
			// radio_64
			// 
			this->radio_64->AutoSize = true;
			this->radio_64->Location = System::Drawing::Point(6, 179);
			this->radio_64->Name = L"radio_64";
			this->radio_64->Size = System::Drawing::Size(14, 13);
			this->radio_64->TabIndex = 4;
			this->radio_64->UseVisualStyleBackColor = true;
			// 
			// group_S5
			// 
			this->group_S5->Controls->Add(this->radio_53);
			this->group_S5->Controls->Add(this->radio_51);
			this->group_S5->Controls->Add(this->radio_52);
			this->group_S5->Controls->Add(this->radio_54);
			this->group_S5->Enabled = false;
			this->group_S5->Location = System::Drawing::Point(198, 37);
			this->group_S5->Name = L"group_S5";
			this->group_S5->Size = System::Drawing::Size(34, 230);
			this->group_S5->TabIndex = 36;
			this->group_S5->TabStop = false;
			this->group_S5->Text = L"5";
			// 
			// radio_53
			// 
			this->radio_53->AutoSize = true;
			this->radio_53->Location = System::Drawing::Point(7, 122);
			this->radio_53->Name = L"radio_53";
			this->radio_53->Size = System::Drawing::Size(14, 13);
			this->radio_53->TabIndex = 3;
			this->radio_53->UseVisualStyleBackColor = true;
			// 
			// radio_51
			// 
			this->radio_51->AutoSize = true;
			this->radio_51->Checked = true;
			this->radio_51->Location = System::Drawing::Point(10, 12);
			this->radio_51->Name = L"radio_51";
			this->radio_51->Size = System::Drawing::Size(14, 13);
			this->radio_51->TabIndex = 1;
			this->radio_51->TabStop = true;
			this->radio_51->UseVisualStyleBackColor = true;
			// 
			// radio_52
			// 
			this->radio_52->AutoSize = true;
			this->radio_52->Location = System::Drawing::Point(10, 65);
			this->radio_52->Name = L"radio_52";
			this->radio_52->Size = System::Drawing::Size(14, 13);
			this->radio_52->TabIndex = 2;
			this->radio_52->UseVisualStyleBackColor = true;
			// 
			// radio_54
			// 
			this->radio_54->AutoSize = true;
			this->radio_54->Location = System::Drawing::Point(10, 179);
			this->radio_54->Name = L"radio_54";
			this->radio_54->Size = System::Drawing::Size(14, 13);
			this->radio_54->TabIndex = 4;
			this->radio_54->UseVisualStyleBackColor = true;
			// 
			// group_S4
			// 
			this->group_S4->Controls->Add(this->radio_43);
			this->group_S4->Controls->Add(this->radio_41);
			this->group_S4->Controls->Add(this->radio_42);
			this->group_S4->Controls->Add(this->radio_44);
			this->group_S4->Enabled = false;
			this->group_S4->Location = System::Drawing::Point(158, 37);
			this->group_S4->Name = L"group_S4";
			this->group_S4->Size = System::Drawing::Size(34, 230);
			this->group_S4->TabIndex = 36;
			this->group_S4->TabStop = false;
			this->group_S4->Text = L"4";
			// 
			// radio_43
			// 
			this->radio_43->AutoSize = true;
			this->radio_43->Location = System::Drawing::Point(10, 122);
			this->radio_43->Name = L"radio_43";
			this->radio_43->Size = System::Drawing::Size(14, 13);
			this->radio_43->TabIndex = 3;
			this->radio_43->UseVisualStyleBackColor = true;
			// 
			// radio_41
			// 
			this->radio_41->AutoSize = true;
			this->radio_41->Checked = true;
			this->radio_41->Location = System::Drawing::Point(10, 12);
			this->radio_41->Name = L"radio_41";
			this->radio_41->Size = System::Drawing::Size(14, 13);
			this->radio_41->TabIndex = 1;
			this->radio_41->TabStop = true;
			this->radio_41->UseVisualStyleBackColor = true;
			// 
			// radio_42
			// 
			this->radio_42->AutoSize = true;
			this->radio_42->Location = System::Drawing::Point(10, 65);
			this->radio_42->Name = L"radio_42";
			this->radio_42->Size = System::Drawing::Size(14, 13);
			this->radio_42->TabIndex = 2;
			this->radio_42->UseVisualStyleBackColor = true;
			// 
			// radio_44
			// 
			this->radio_44->AutoSize = true;
			this->radio_44->Location = System::Drawing::Point(10, 179);
			this->radio_44->Name = L"radio_44";
			this->radio_44->Size = System::Drawing::Size(14, 13);
			this->radio_44->TabIndex = 4;
			this->radio_44->UseVisualStyleBackColor = true;
			// 
			// group_S3
			// 
			this->group_S3->Controls->Add(this->radio_33);
			this->group_S3->Controls->Add(this->radio_31);
			this->group_S3->Controls->Add(this->radio_32);
			this->group_S3->Controls->Add(this->radio_34);
			this->group_S3->Enabled = false;
			this->group_S3->Location = System::Drawing::Point(118, 37);
			this->group_S3->Name = L"group_S3";
			this->group_S3->Size = System::Drawing::Size(34, 230);
			this->group_S3->TabIndex = 35;
			this->group_S3->TabStop = false;
			this->group_S3->Text = L"3";
			// 
			// radio_33
			// 
			this->radio_33->AutoSize = true;
			this->radio_33->Location = System::Drawing::Point(10, 122);
			this->radio_33->Name = L"radio_33";
			this->radio_33->Size = System::Drawing::Size(14, 13);
			this->radio_33->TabIndex = 3;
			this->radio_33->UseVisualStyleBackColor = true;
			// 
			// radio_31
			// 
			this->radio_31->AutoSize = true;
			this->radio_31->Checked = true;
			this->radio_31->Location = System::Drawing::Point(10, 12);
			this->radio_31->Name = L"radio_31";
			this->radio_31->Size = System::Drawing::Size(14, 13);
			this->radio_31->TabIndex = 1;
			this->radio_31->TabStop = true;
			this->radio_31->UseVisualStyleBackColor = true;
			// 
			// radio_32
			// 
			this->radio_32->AutoSize = true;
			this->radio_32->Location = System::Drawing::Point(10, 65);
			this->radio_32->Name = L"radio_32";
			this->radio_32->Size = System::Drawing::Size(14, 13);
			this->radio_32->TabIndex = 2;
			this->radio_32->UseVisualStyleBackColor = true;
			// 
			// radio_34
			// 
			this->radio_34->AutoSize = true;
			this->radio_34->Location = System::Drawing::Point(6, 179);
			this->radio_34->Name = L"radio_34";
			this->radio_34->Size = System::Drawing::Size(14, 13);
			this->radio_34->TabIndex = 4;
			this->radio_34->UseVisualStyleBackColor = true;
			// 
			// pictureBox7
			// 
			this->pictureBox7->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox7.Image")));
			this->pictureBox7->Location = System::Drawing::Point(6, 45);
			this->pictureBox7->Name = L"pictureBox7";
			this->pictureBox7->Size = System::Drawing::Size(26, 51);
			this->pictureBox7->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox7->TabIndex = 0;
			this->pictureBox7->TabStop = false;
			// 
			// group_S2
			// 
			this->group_S2->Controls->Add(this->radio_23);
			this->group_S2->Controls->Add(this->radio_21);
			this->group_S2->Controls->Add(this->radio_22);
			this->group_S2->Controls->Add(this->radio_24);
			this->group_S2->Enabled = false;
			this->group_S2->Location = System::Drawing::Point(78, 37);
			this->group_S2->Name = L"group_S2";
			this->group_S2->Size = System::Drawing::Size(34, 233);
			this->group_S2->TabIndex = 34;
			this->group_S2->TabStop = false;
			this->group_S2->Text = L"2";
			// 
			// radio_23
			// 
			this->radio_23->AutoSize = true;
			this->radio_23->Location = System::Drawing::Point(9, 122);
			this->radio_23->Name = L"radio_23";
			this->radio_23->Size = System::Drawing::Size(14, 13);
			this->radio_23->TabIndex = 3;
			this->radio_23->UseVisualStyleBackColor = true;
			// 
			// radio_21
			// 
			this->radio_21->AutoSize = true;
			this->radio_21->Checked = true;
			this->radio_21->Location = System::Drawing::Point(10, 12);
			this->radio_21->Name = L"radio_21";
			this->radio_21->Size = System::Drawing::Size(14, 13);
			this->radio_21->TabIndex = 1;
			this->radio_21->TabStop = true;
			this->radio_21->UseVisualStyleBackColor = true;
			// 
			// radio_22
			// 
			this->radio_22->AutoSize = true;
			this->radio_22->Location = System::Drawing::Point(10, 65);
			this->radio_22->Name = L"radio_22";
			this->radio_22->Size = System::Drawing::Size(14, 13);
			this->radio_22->TabIndex = 2;
			this->radio_22->UseVisualStyleBackColor = true;
			// 
			// radio_24
			// 
			this->radio_24->AutoSize = true;
			this->radio_24->Location = System::Drawing::Point(4, 179);
			this->radio_24->Name = L"radio_24";
			this->radio_24->Size = System::Drawing::Size(14, 13);
			this->radio_24->TabIndex = 4;
			this->radio_24->UseVisualStyleBackColor = true;
			// 
			// group_S1
			// 
			this->group_S1->Controls->Add(this->radio_13);
			this->group_S1->Controls->Add(this->radio_11);
			this->group_S1->Controls->Add(this->radio_12);
			this->group_S1->Controls->Add(this->radio_14);
			this->group_S1->Location = System::Drawing::Point(38, 37);
			this->group_S1->Name = L"group_S1";
			this->group_S1->Size = System::Drawing::Size(34, 230);
			this->group_S1->TabIndex = 33;
			this->group_S1->TabStop = false;
			this->group_S1->Text = L"1";
			// 
			// radio_13
			// 
			this->radio_13->AutoSize = true;
			this->radio_13->Location = System::Drawing::Point(10, 122);
			this->radio_13->Name = L"radio_13";
			this->radio_13->Size = System::Drawing::Size(14, 13);
			this->radio_13->TabIndex = 3;
			this->radio_13->UseVisualStyleBackColor = true;
			// 
			// radio_11
			// 
			this->radio_11->AutoSize = true;
			this->radio_11->Checked = true;
			this->radio_11->Location = System::Drawing::Point(10, 12);
			this->radio_11->Name = L"radio_11";
			this->radio_11->Size = System::Drawing::Size(14, 13);
			this->radio_11->TabIndex = 1;
			this->radio_11->TabStop = true;
			this->radio_11->UseVisualStyleBackColor = true;
			// 
			// radio_12
			// 
			this->radio_12->AutoSize = true;
			this->radio_12->Location = System::Drawing::Point(10, 65);
			this->radio_12->Name = L"radio_12";
			this->radio_12->Size = System::Drawing::Size(14, 13);
			this->radio_12->TabIndex = 2;
			this->radio_12->UseVisualStyleBackColor = true;
			// 
			// radio_14
			// 
			this->radio_14->AutoSize = true;
			this->radio_14->Location = System::Drawing::Point(10, 179);
			this->radio_14->Name = L"radio_14";
			this->radio_14->Size = System::Drawing::Size(14, 13);
			this->radio_14->TabIndex = 4;
			this->radio_14->UseVisualStyleBackColor = true;
			// 
			// button5
			// 
			this->button5->Location = System::Drawing::Point(275, 92);
			this->button5->Name = L"button5";
			this->button5->Size = System::Drawing::Size(64, 23);
			this->button5->TabIndex = 17;
			this->button5->Text = L"Change";
			this->button5->UseVisualStyleBackColor = true;
			this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
			// 
			// numericUpDown4
			// 
			this->numericUpDown4->Location = System::Drawing::Point(275, 53);
			this->numericUpDown4->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {2, 0, 0, 0});
			this->numericUpDown4->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numericUpDown4->Name = L"numericUpDown4";
			this->numericUpDown4->Size = System::Drawing::Size(44, 20);
			this->numericUpDown4->TabIndex = 31;
			this->numericUpDown4->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numericUpDown4->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown4_ValueChanged);
			// 
			// Automatic
			// 
			this->Automatic->Controls->Add(this->label34);
			this->Automatic->Controls->Add(this->label33);
			this->Automatic->Controls->Add(this->label31);
			this->Automatic->Controls->Add(this->label30);
			this->Automatic->Controls->Add(this->pictureBox8);
			this->Automatic->Controls->Add(this->pictureBox12);
			this->Automatic->Controls->Add(this->pictureBox13);
			this->Automatic->Controls->Add(this->pictureBox14);
			this->Automatic->Controls->Add(this->label_TL6);
			this->Automatic->Controls->Add(this->label_TL5);
			this->Automatic->Controls->Add(this->label_TL4);
			this->Automatic->Controls->Add(this->label_TL3);
			this->Automatic->Controls->Add(this->label_TL2);
			this->Automatic->Controls->Add(this->label_TL1);
			this->Automatic->Controls->Add(this->button7);
			this->Automatic->Controls->Add(this->button6);
			this->Automatic->Controls->Add(this->label27);
			this->Automatic->Controls->Add(this->numUD_delay);
			this->Automatic->Controls->Add(this->radio_semaf56);
			this->Automatic->Controls->Add(this->radio_semaf34);
			this->Automatic->Controls->Add(this->radio_semaf12);
			this->Automatic->Controls->Add(this->label26);
			this->Automatic->Controls->Add(this->numUD_green);
			this->Automatic->Controls->Add(this->numUD_yellow);
			this->Automatic->Controls->Add(this->numUD_red);
			this->Automatic->Controls->Add(this->numUD_orange);
			this->Automatic->Controls->Add(this->check_semafauto);
			this->Automatic->Controls->Add(this->shapeContainer2);
			this->Automatic->Location = System::Drawing::Point(4, 22);
			this->Automatic->Name = L"Automatic";
			this->Automatic->Padding = System::Windows::Forms::Padding(3);
			this->Automatic->Size = System::Drawing::Size(345, 273);
			this->Automatic->TabIndex = 1;
			this->Automatic->Text = L"Automatic";
			this->Automatic->UseVisualStyleBackColor = true;
			// 
			// label34
			// 
			this->label34->AutoSize = true;
			this->label34->Location = System::Drawing::Point(286, 47);
			this->label34->Name = L"label34";
			this->label34->Size = System::Drawing::Size(52, 13);
			this->label34->TabIndex = 48;
			this->label34->Text = L"Overview";
			// 
			// label33
			// 
			this->label33->AutoSize = true;
			this->label33->Location = System::Drawing::Point(100, 173);
			this->label33->Name = L"label33";
			this->label33->Size = System::Drawing::Size(176, 13);
			this->label33->TabIndex = 47;
			this->label33->Text = L"What is the time shift between TLs\?";
			// 
			// label31
			// 
			this->label31->AutoSize = true;
			this->label31->Location = System::Drawing::Point(100, 47);
			this->label31->Name = L"label31";
			this->label31->Size = System::Drawing::Size(156, 13);
			this->label31->TabIndex = 46;
			this->label31->Text = L"To what pair will settings apply\?";
			// 
			// label30
			// 
			this->label30->AutoSize = true;
			this->label30->Location = System::Drawing::Point(100, 123);
			this->label30->Name = L"label30";
			this->label30->Size = System::Drawing::Size(177, 13);
			this->label30->TabIndex = 45;
			this->label30->Text = L"Is the length of all periods constant\?";
			// 
			// pictureBox8
			// 
			this->pictureBox8->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox8.Image")));
			this->pictureBox8->Location = System::Drawing::Point(6, 218);
			this->pictureBox8->Name = L"pictureBox8";
			this->pictureBox8->Size = System::Drawing::Size(26, 51);
			this->pictureBox8->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox8->TabIndex = 44;
			this->pictureBox8->TabStop = false;
			// 
			// pictureBox12
			// 
			this->pictureBox12->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox12.Image")));
			this->pictureBox12->Location = System::Drawing::Point(6, 161);
			this->pictureBox12->Name = L"pictureBox12";
			this->pictureBox12->Size = System::Drawing::Size(26, 51);
			this->pictureBox12->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox12->TabIndex = 43;
			this->pictureBox12->TabStop = false;
			// 
			// pictureBox13
			// 
			this->pictureBox13->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox13.Image")));
			this->pictureBox13->Location = System::Drawing::Point(6, 104);
			this->pictureBox13->Name = L"pictureBox13";
			this->pictureBox13->Size = System::Drawing::Size(26, 51);
			this->pictureBox13->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox13->TabIndex = 42;
			this->pictureBox13->TabStop = false;
			// 
			// pictureBox14
			// 
			this->pictureBox14->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"pictureBox14.Image")));
			this->pictureBox14->Location = System::Drawing::Point(6, 47);
			this->pictureBox14->Name = L"pictureBox14";
			this->pictureBox14->Size = System::Drawing::Size(26, 51);
			this->pictureBox14->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
			this->pictureBox14->TabIndex = 41;
			this->pictureBox14->TabStop = false;
			// 
			// label_TL6
			// 
			this->label_TL6->AutoSize = true;
			this->label_TL6->Location = System::Drawing::Point(286, 198);
			this->label_TL6->Name = L"label_TL6";
			this->label_TL6->Size = System::Drawing::Size(26, 13);
			this->label_TL6->TabIndex = 20;
			this->label_TL6->Text = L"TL6";
			// 
			// label_TL5
			// 
			this->label_TL5->AutoSize = true;
			this->label_TL5->Location = System::Drawing::Point(286, 173);
			this->label_TL5->Name = L"label_TL5";
			this->label_TL5->Size = System::Drawing::Size(26, 13);
			this->label_TL5->TabIndex = 19;
			this->label_TL5->Text = L"TL5";
			// 
			// label_TL4
			// 
			this->label_TL4->AutoSize = true;
			this->label_TL4->Location = System::Drawing::Point(286, 148);
			this->label_TL4->Name = L"label_TL4";
			this->label_TL4->Size = System::Drawing::Size(26, 13);
			this->label_TL4->TabIndex = 18;
			this->label_TL4->Text = L"TL4";
			// 
			// label_TL3
			// 
			this->label_TL3->AutoSize = true;
			this->label_TL3->Location = System::Drawing::Point(286, 123);
			this->label_TL3->Name = L"label_TL3";
			this->label_TL3->Size = System::Drawing::Size(26, 13);
			this->label_TL3->TabIndex = 17;
			this->label_TL3->Text = L"TL3";
			// 
			// label_TL2
			// 
			this->label_TL2->AutoSize = true;
			this->label_TL2->Location = System::Drawing::Point(286, 98);
			this->label_TL2->Name = L"label_TL2";
			this->label_TL2->Size = System::Drawing::Size(26, 13);
			this->label_TL2->TabIndex = 16;
			this->label_TL2->Text = L"TL2";
			// 
			// label_TL1
			// 
			this->label_TL1->AutoSize = true;
			this->label_TL1->Location = System::Drawing::Point(286, 73);
			this->label_TL1->Name = L"label_TL1";
			this->label_TL1->Size = System::Drawing::Size(26, 13);
			this->label_TL1->TabIndex = 15;
			this->label_TL1->Text = L"TL1";
			// 
			// button7
			// 
			this->button7->Location = System::Drawing::Point(264, 218);
			this->button7->Name = L"button7";
			this->button7->Size = System::Drawing::Size(75, 23);
			this->button7->TabIndex = 13;
			this->button7->Text = L"Save only";
			this->button7->UseVisualStyleBackColor = true;
			this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click);
			// 
			// button6
			// 
			this->button6->Location = System::Drawing::Point(264, 247);
			this->button6->Name = L"button6";
			this->button6->Size = System::Drawing::Size(75, 23);
			this->button6->TabIndex = 12;
			this->button6->Text = L"Start cycle";
			this->button6->UseVisualStyleBackColor = true;
			this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
			// 
			// label27
			// 
			this->label27->AutoSize = true;
			this->label27->Location = System::Drawing::Point(100, 192);
			this->label27->Name = L"label27";
			this->label27->Size = System::Drawing::Size(48, 13);
			this->label27->TabIndex = 11;
			this->label27->Text = L"Delay[s]:";
			// 
			// numUD_delay
			// 
			this->numUD_delay->Location = System::Drawing::Point(154, 190);
			this->numUD_delay->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {39, 0, 0, 0});
			this->numUD_delay->Name = L"numUD_delay";
			this->numUD_delay->Size = System::Drawing::Size(44, 20);
			this->numUD_delay->TabIndex = 10;
			this->numUD_delay->ValueChanged += gcnew System::EventHandler(this, &Form1::numUD_delay_ValueChanged);
			// 
			// radio_semaf56
			// 
			this->radio_semaf56->AutoSize = true;
			this->radio_semaf56->Enabled = false;
			this->radio_semaf56->Location = System::Drawing::Point(103, 94);
			this->radio_semaf56->Name = L"radio_semaf56";
			this->radio_semaf56->Size = System::Drawing::Size(58, 17);
			this->radio_semaf56->TabIndex = 9;
			this->radio_semaf56->Text = L"TL 5/6";
			this->radio_semaf56->UseVisualStyleBackColor = true;
			this->radio_semaf56->CheckedChanged += gcnew System::EventHandler(this, &Form1::radio_semaf56_CheckedChanged);
			// 
			// radio_semaf34
			// 
			this->radio_semaf34->AutoSize = true;
			this->radio_semaf34->Enabled = false;
			this->radio_semaf34->Location = System::Drawing::Point(103, 80);
			this->radio_semaf34->Name = L"radio_semaf34";
			this->radio_semaf34->Size = System::Drawing::Size(58, 17);
			this->radio_semaf34->TabIndex = 8;
			this->radio_semaf34->Text = L"TL 3/4";
			this->radio_semaf34->UseVisualStyleBackColor = true;
			this->radio_semaf34->CheckedChanged += gcnew System::EventHandler(this, &Form1::radio_semaf34_CheckedChanged);
			// 
			// radio_semaf12
			// 
			this->radio_semaf12->AutoSize = true;
			this->radio_semaf12->Checked = true;
			this->radio_semaf12->Location = System::Drawing::Point(103, 64);
			this->radio_semaf12->Name = L"radio_semaf12";
			this->radio_semaf12->Size = System::Drawing::Size(58, 17);
			this->radio_semaf12->TabIndex = 7;
			this->radio_semaf12->TabStop = true;
			this->radio_semaf12->Text = L"TL 1/2";
			this->radio_semaf12->UseVisualStyleBackColor = true;
			this->radio_semaf12->CheckedChanged += gcnew System::EventHandler(this, &Form1::radio_semaf12_CheckedChanged);
			// 
			// label26
			// 
			this->label26->AutoSize = true;
			this->label26->Location = System::Drawing::Point(9, 3);
			this->label26->Name = L"label26";
			this->label26->Size = System::Drawing::Size(323, 39);
			this->label26->TabIndex = 6;
			this->label26->Text = L"After pressing start the selected traffic lights will cycle through light \r\nstage" 
				L"s. The length of individual stages can be modified. The length\r\nof red period is" 
				L" calculated from other periods.";
			// 
			// numUD_green
			// 
			this->numUD_green->Enabled = false;
			this->numUD_green->Location = System::Drawing::Point(44, 247);
			this->numUD_green->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
			this->numUD_green->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_green->Name = L"numUD_green";
			this->numUD_green->Size = System::Drawing::Size(44, 20);
			this->numUD_green->TabIndex = 4;
			this->numUD_green->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
			// 
			// numUD_yellow
			// 
			this->numUD_yellow->Enabled = false;
			this->numUD_yellow->Location = System::Drawing::Point(44, 192);
			this->numUD_yellow->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
			this->numUD_yellow->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_yellow->Name = L"numUD_yellow";
			this->numUD_yellow->Size = System::Drawing::Size(44, 20);
			this->numUD_yellow->TabIndex = 3;
			this->numUD_yellow->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
			// 
			// numUD_red
			// 
			this->numUD_red->Enabled = false;
			this->numUD_red->Location = System::Drawing::Point(44, 135);
			this->numUD_red->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
			this->numUD_red->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_red->Name = L"numUD_red";
			this->numUD_red->Size = System::Drawing::Size(44, 20);
			this->numUD_red->TabIndex = 2;
			this->numUD_red->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
			// 
			// numUD_orange
			// 
			this->numUD_orange->Location = System::Drawing::Point(44, 78);
			this->numUD_orange->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
			this->numUD_orange->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 0});
			this->numUD_orange->Name = L"numUD_orange";
			this->numUD_orange->Size = System::Drawing::Size(44, 20);
			this->numUD_orange->TabIndex = 1;
			this->numUD_orange->Value = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
			this->numUD_orange->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDown5_ValueChanged);
			// 
			// check_semafauto
			// 
			this->check_semafauto->AutoSize = true;
			this->check_semafauto->Checked = true;
			this->check_semafauto->CheckState = System::Windows::Forms::CheckState::Checked;
			this->check_semafauto->Location = System::Drawing::Point(103, 141);
			this->check_semafauto->Name = L"check_semafauto";
			this->check_semafauto->Size = System::Drawing::Size(100, 17);
			this->check_semafauto->TabIndex = 0;
			this->check_semafauto->Text = L"Constant length";
			this->check_semafauto->UseVisualStyleBackColor = true;
			this->check_semafauto->CheckedChanged += gcnew System::EventHandler(this, &Form1::check_semafauto_CheckedChanged);
			// 
			// shapeContainer2
			// 
			this->shapeContainer2->Location = System::Drawing::Point(3, 3);
			this->shapeContainer2->Margin = System::Windows::Forms::Padding(0);
			this->shapeContainer2->Name = L"shapeContainer2";
			this->shapeContainer2->Shapes->AddRange(gcnew cli::array< Microsoft::VisualBasic::PowerPacks::Shape^  >(6) {this->oval_TL6, 
				this->oval_TL5, this->oval_TL4, this->oval_TL3, this->oval_TL2, this->oval_TL1});
			this->shapeContainer2->Size = System::Drawing::Size(339, 267);
			this->shapeContainer2->TabIndex = 14;
			this->shapeContainer2->TabStop = false;
			// 
			// oval_TL6
			// 
			this->oval_TL6->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL6->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->oval_TL6->FillColor = System::Drawing::Color::Gray;
			this->oval_TL6->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL6->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->oval_TL6->Location = System::Drawing::Point(312, 187);
			this->oval_TL6->Name = L"oval_TL6";
			this->oval_TL6->Size = System::Drawing::Size(20, 20);
			// 
			// oval_TL5
			// 
			this->oval_TL5->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL5->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->oval_TL5->FillColor = System::Drawing::Color::Gray;
			this->oval_TL5->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL5->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->oval_TL5->Location = System::Drawing::Point(312, 162);
			this->oval_TL5->Name = L"oval_TL5";
			this->oval_TL5->Size = System::Drawing::Size(20, 20);
			// 
			// oval_TL4
			// 
			this->oval_TL4->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL4->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->oval_TL4->FillColor = System::Drawing::Color::Gray;
			this->oval_TL4->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL4->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->oval_TL4->Location = System::Drawing::Point(312, 137);
			this->oval_TL4->Name = L"oval_TL4";
			this->oval_TL4->Size = System::Drawing::Size(20, 20);
			// 
			// oval_TL3
			// 
			this->oval_TL3->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL3->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->oval_TL3->FillColor = System::Drawing::Color::Gray;
			this->oval_TL3->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL3->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->oval_TL3->Location = System::Drawing::Point(312, 112);
			this->oval_TL3->Name = L"oval_TL3";
			this->oval_TL3->Size = System::Drawing::Size(20, 20);
			// 
			// oval_TL2
			// 
			this->oval_TL2->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL2->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->oval_TL2->FillColor = System::Drawing::Color::Gray;
			this->oval_TL2->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL2->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->oval_TL2->Location = System::Drawing::Point(312, 87);
			this->oval_TL2->Name = L"oval_TL2";
			this->oval_TL2->Size = System::Drawing::Size(20, 20);
			// 
			// oval_TL1
			// 
			this->oval_TL1->BackColor = System::Drawing::Color::Lime;
			this->oval_TL1->BorderStyle = System::Drawing::Drawing2D::DashStyle::Custom;
			this->oval_TL1->FillColor = System::Drawing::Color::Gray;
			this->oval_TL1->FillGradientColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->oval_TL1->FillStyle = Microsoft::VisualBasic::PowerPacks::FillStyle::Solid;
			this->oval_TL1->Location = System::Drawing::Point(312, 62);
			this->oval_TL1->Name = L"oval_TL1";
			this->oval_TL1->Size = System::Drawing::Size(20, 20);
			// 
			// label_stg
			// 
			this->label_stg->AutoSize = true;
			this->label_stg->Location = System::Drawing::Point(401, 736);
			this->label_stg->Name = L"label_stg";
			this->label_stg->Size = System::Drawing::Size(61, 13);
			this->label_stg->TabIndex = 21;
			this->label_stg->Text = L"label_stage";
			this->label_stg->Visible = false;
			// 
			// but_usbConnect
			// 
			this->but_usbConnect->Location = System::Drawing::Point(8, 364);
			this->but_usbConnect->Name = L"but_usbConnect";
			this->but_usbConnect->Size = System::Drawing::Size(194, 21);
			this->but_usbConnect->TabIndex = 57;
			this->but_usbConnect->Text = L"Establish USB connection with model";
			this->but_usbConnect->UseVisualStyleBackColor = true;
			this->but_usbConnect->Click += gcnew System::EventHandler(this, &Form1::but_usbConnect_Click);
			// 
			// but_usbLED
			// 
			this->but_usbLED->Enabled = false;
			this->but_usbLED->Location = System::Drawing::Point(253, 364);
			this->but_usbLED->Name = L"but_usbLED";
			this->but_usbLED->Size = System::Drawing::Size(125, 23);
			this->but_usbLED->TabIndex = 58;
			this->but_usbLED->Text = L"Toggle status LED";
			this->but_usbLED->UseVisualStyleBackColor = true;
			this->but_usbLED->Click += gcnew System::EventHandler(this, &Form1::but_usbLED_Click);
			// 
			// SemaforCycle
			// 
			this->SemaforCycle->Interval = 1000;
			this->SemaforCycle->Tick += gcnew System::EventHandler(this, &Form1::SemaforCycle_Tick);
			// 
			// button9
			// 
			this->button9->Location = System::Drawing::Point(260, 4);
			this->button9->Name = L"button9";
			this->button9->Size = System::Drawing::Size(75, 23);
			this->button9->TabIndex = 59;
			this->button9->Text = L"button9";
			this->button9->UseVisualStyleBackColor = true;
			this->button9->Visible = false;
			this->button9->Click += gcnew System::EventHandler(this, &Form1::button9_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(1854, 957);
			this->Controls->Add(this->button9);
			this->Controls->Add(this->label_CamNumber);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->b_init);
			this->Controls->Add(this->textBox2);
			this->Controls->Add(this->camNumber);
			this->Controls->Add(this->textBox1);
			this->Controls->Add(this->but_usbLED);
			this->Controls->Add(this->but_usbConnect);
			this->Controls->Add(this->group_semafor);
			this->Controls->Add(this->pictureBox1);
			this->Controls->Add(this->group_slotcar);
			this->Controls->Add(this->label_disp6);
			this->Controls->Add(this->label_disp5);
			this->Controls->Add(this->label_disp4);
			this->Controls->Add(this->label_disp3);
			this->Controls->Add(this->label_disp2);
			this->Controls->Add(this->label_disp1);
			this->Controls->Add(this->pictureBox4);
			this->Controls->Add(this->pictureBox5);
			this->Controls->Add(this->pictureBox6);
			this->Controls->Add(this->pictureBox3);
			this->Controls->Add(this->pictureBox2);
			this->Controls->Add(this->label_framescapt);
			this->Controls->Add(this->groupBox2);
			this->Controls->Add(this->label_stg);
			this->Controls->Add(this->shapeContainer1);
			this->Name = L"Form1";
			this->Text = L"Traffic Situation Model";
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->camNumber))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_height))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_Width))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_expo))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_regx))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_regy))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_Biny))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_Binx))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox2))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox3))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox4))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox5))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox6))->EndInit();
			this->tabControl1->ResumeLayout(false);
			this->tabPage1->ResumeLayout(false);
			this->tabPage1->PerformLayout();
			this->tabPage2->ResumeLayout(false);
			this->tabPage2->PerformLayout();
			this->Gain->ResumeLayout(false);
			this->Gain->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_gain))->EndInit();
			this->tabPage3->ResumeLayout(false);
			this->tabPage3->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_framect))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_FrameRate))->EndInit();
			this->group_slotcar->ResumeLayout(false);
			this->group_slotcar->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown3))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown2))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown1))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar3))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar2))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar1))->EndInit();
			this->groupBox2->ResumeLayout(false);
			this->groupBox2->PerformLayout();
			this->group_semafor->ResumeLayout(false);
			this->tabControl2->ResumeLayout(false);
			this->Manual->ResumeLayout(false);
			this->Manual->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox11))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox10))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox9))->EndInit();
			this->group_S6->ResumeLayout(false);
			this->group_S6->PerformLayout();
			this->group_S5->ResumeLayout(false);
			this->group_S5->PerformLayout();
			this->group_S4->ResumeLayout(false);
			this->group_S4->PerformLayout();
			this->group_S3->ResumeLayout(false);
			this->group_S3->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox7))->EndInit();
			this->group_S2->ResumeLayout(false);
			this->group_S2->PerformLayout();
			this->group_S1->ResumeLayout(false);
			this->group_S1->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDown4))->EndInit();
			this->Automatic->ResumeLayout(false);
			this->Automatic->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox8))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox12))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox13))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox14))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_delay))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_green))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_yellow))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_red))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numUD_orange))->EndInit();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
			 }
			 void dispSelected(unsigned long long i){
				 switch(i){
				 case 5006509:
					 rectangleShape1->Visible = true;
					 rectangleShape2->Visible = false;
					 rectangleShape3->Visible = false;
					 rectangleShape4->Visible = false;
					 rectangleShape5->Visible = false;
					 rectangleShape6->Visible = false;
					 break;

				 case 5006510:
					 rectangleShape1->Visible = false;
					 rectangleShape2->Visible = false;
					 rectangleShape3->Visible = false;
					 rectangleShape4->Visible = true;
					 rectangleShape5->Visible = false;
					 rectangleShape6->Visible = false;
					 break;
				 case 5006511:
					 rectangleShape1->Visible = false;
					 rectangleShape2->Visible = true;
					 rectangleShape3->Visible = false;
					 rectangleShape4->Visible = false;
					 rectangleShape5->Visible = false;
					 rectangleShape6->Visible = false;
					 break;
				 case 5006512:
					 rectangleShape1->Visible = false;
					 rectangleShape2->Visible = false;
					 rectangleShape3->Visible = false;
					 rectangleShape4->Visible = false;
					 rectangleShape5->Visible = true;
					 rectangleShape6->Visible = false;
					 break;
				 case 5006513:
					 rectangleShape1->Visible = false;
					 rectangleShape2->Visible = false;
					 rectangleShape3->Visible = true;
					 rectangleShape4->Visible = false;
					 rectangleShape5->Visible = false;
					 rectangleShape6->Visible = false;
					 break;
				 case 5006514:
					 rectangleShape1->Visible = false;
					 rectangleShape2->Visible = false;
					 rectangleShape3->Visible = false;
					 rectangleShape4->Visible = false;
					 rectangleShape5->Visible = false;
					 rectangleShape6->Visible = true;
					 break;
				 default: // for tesing
					 if(rectangleShape1->Visible == false){
						 rectangleShape1->Visible = true;
						 rectangleShape2->Visible = false;
						 rectangleShape3->Visible = true;
						 rectangleShape4->Visible = false;
						 rectangleShape5->Visible = true;
						 rectangleShape6->Visible = false;
					 }
					 else
					 {
						 rectangleShape1->Visible = false;
						 rectangleShape2->Visible = true;
						 rectangleShape3->Visible = false;
						 rectangleShape4->Visible = true;
						 rectangleShape5->Visible = false;
						 rectangleShape6->Visible = true;
					 }

				 }
			 }

			 unsigned int semaflightSelected(int group){
				 switch(group){
				 case 0:
					 if(radio_11->Checked==true)
						 return ORANGE1;
					 if(radio_12->Checked==true)
						 return RED1;
					 if(radio_13->Checked==true)
						 return YELLOW1;
					 if(radio_14->Checked==true)
						 return GREEN1;
					 break;

				 case 1:
					 if(radio_21->Checked==true)
						 return ORANGE2;
					 if(radio_22->Checked==true)
						 return RED2;
					 if(radio_23->Checked==true)
						 return YELLOW2;
					 if(radio_24->Checked==true)
						 return GREEN2;
					 break;

				 case 2:
					 if(radio_31->Checked==true)
						 return ORANGE;
					 if(radio_32->Checked==true)
						 return RED;
					 if(radio_33->Checked==true)
						 return YELLOW;
					 if(radio_34->Checked==true)
						 return GREEN;
					 break;

				 case 3:
					 if(radio_41->Checked==true)
						 return ORANGE;
					 if(radio_42->Checked==true)
						 return RED;
					 if(radio_43->Checked==true)
						 return YELLOW;
					 if(radio_44->Checked==true)
						 return GREEN;
					 break;
				 case 4:
					 if(radio_51->Checked==true)
						 return ORANGE;
					 if(radio_52->Checked==true)
						 return RED;
					 if(radio_53->Checked==true)
						 return YELLOW;
					 if(radio_54->Checked==true)
						 return GREEN;
					 break;
				 case 5:
					 if(radio_61->Checked==true)
						 return ORANGE;
					 if(radio_62->Checked==true)
						 return RED;
					 if(radio_63->Checked==true)
						 return YELLOW;
					 if(radio_64->Checked==true)
						 return GREEN;
					 break;
				 }
				 return 0;
			 }
			 void usbfailed(void){
				 but_usbConnect->BackColor=Color::Red;
				 group_semafor->Enabled = false;
				 group_slotcar->Enabled = false;
				 but_usbLED->Enabled = false;
				 but_usbConnect->Enabled = true;
				 usb_close(handle);
			 }
			 void semafSave(void){
				 if(radio_semaf12->Checked==true){
					 if((semaf->pocet) < 2)
						 semaf->pocet = 2;
					 semaf->semafor[0].active = 1;
					 semaf->semafor[1].active = 1;
					 semafor_times(&semaf->semafor[0], 
						 System::Convert::ToInt16(numUD_green->Value),
						 System::Convert::ToInt16(numUD_yellow->Value),
						 System::Convert::ToInt16(numUD_red->Value),
						 System::Convert::ToInt16(numUD_orange->Value),
						 System::Convert::ToInt16(numUD_delay->Value));
					 semafor_times(&semaf->semafor[1], 
						 System::Convert::ToInt16(numUD_green->Value),
						 System::Convert::ToInt16(numUD_yellow->Value),
						 System::Convert::ToInt16(numUD_red->Value),
						 System::Convert::ToInt16(numUD_orange->Value),
						 System::Convert::ToInt16(numUD_delay->Value));
				 }
				 else if(radio_semaf34->Checked==true){
					 if((semaf->pocet) < 4)
						 semaf->pocet = 4;
					 semaf->semafor[2].active = 1;
					 semaf->semafor[3].active = 1;
					 semafor_times(&semaf->semafor[2], 
						 System::Convert::ToInt16(numUD_green->Value),
						 System::Convert::ToInt16(numUD_yellow->Value),
						 System::Convert::ToInt16(numUD_red->Value),
						 System::Convert::ToInt16(numUD_orange->Value),
						 System::Convert::ToInt16(numUD_delay->Value));
					 semafor_times(&semaf->semafor[3], 
						 System::Convert::ToInt16(numUD_green->Value),
						 System::Convert::ToInt16(numUD_yellow->Value),
						 System::Convert::ToInt16(numUD_red->Value),
						 System::Convert::ToInt16(numUD_orange->Value),
						 System::Convert::ToInt16(numUD_delay->Value));

				 }
				 else if(radio_semaf56->Checked==true){
					 if((semaf->pocet) < 6)
						 semaf->pocet = 6;
					 semaf->semafor[4].active = 1;
					 semaf->semafor[5].active = 1;
					 semafor_times(&semaf->semafor[4], 
						 System::Convert::ToInt16(numUD_green->Value),
						 System::Convert::ToInt16(numUD_yellow->Value),
						 System::Convert::ToInt16(numUD_red->Value),
						 System::Convert::ToInt16(numUD_orange->Value),
						 System::Convert::ToInt16(numUD_delay->Value));
					 semafor_times(&semaf->semafor[5], 
						 System::Convert::ToInt16(numUD_green->Value),
						 System::Convert::ToInt16(numUD_yellow->Value),
						 System::Convert::ToInt16(numUD_red->Value),
						 System::Convert::ToInt16(numUD_orange->Value),
						 System::Convert::ToInt16(numUD_delay->Value));
				 }

			 }
			 Color semafGraphicC(int pos){
				 Color col;
				 switch(semaf->semafor[pos].state){
				 case GREEN1:
				 case GREEN2:
				 case GREEN:
					 col = Color::Green;
					 break;
				 case YELLOW:
				 case YELLOW1:
				 case YELLOW2:
					 col = Color::Yellow;
					 break;
				 case RED:
				 case RED1:
				 case RED2:
					 col = Color::Red;
					 break;
				 case ORANGE:
				 case ORANGE1:
				 case ORANGE2:
					 col = Color::Orange;
					 break;
				 }
				 return col;
			 }
			 void semafGraphicP(void){
				 label_stg->Text=System::Convert::ToString(semaf->pocet);
				 for(int i = 0; i<6;i++){
					 if(semaf->semafor[i].active==1){
						 switch(i){
						 case 0:
							 oval_TL1->FillColor = semafGraphicC(i);
							 break;
						 case 1:
							 oval_TL2->FillColor = semafGraphicC(i);
							 break;
						 case 2:
							 oval_TL3->FillColor = semafGraphicC(i);
							 break;
						 case 3:
							 oval_TL4->FillColor = semafGraphicC(i);
							 break;
						 case 4:
							 oval_TL5->FillColor = semafGraphicC(i);
							 break;
						 case 5:
							 oval_TL6->FillColor = semafGraphicC(i);
							 break;
						 }
					 }
				 }


			 }
			 void drawform(void){
				 int i, pkamer= cams->celkem;
				 int v1,v2;
				 System::Drawing::Bitmap ^srcBmp;
				 System::Drawing::Imaging::ColorPalette^ pal;

				 for(i = 0; i<pkamer; i++){
					 if(cams->list[i]->img_process.disp_Options[FORM_READY]==TRUE){   //while images stream faster, on form they are displayed only if it was at least 30ms since last refresh

						 v1= cams->list[i]->output_Img.size().width;
						v2 = cams->list[i]->output_Img.size().height;
						 srcBmp = gcnew Bitmap(cams->list[i]->output_Img.size().width,
							 cams->list[i]->output_Img.size().height,
							 cams->list[i]->output_Img.step,
							 System::Drawing::Imaging::PixelFormat::Format8bppIndexed,
							 (System::IntPtr)cams->list[i]->output_Img.data);

						 pal = srcBmp->Palette;
						 for(int j = 0; j <= 255; j++){pal->Entries[j] = Color::FromArgb(j, j, j);}
						 srcBmp->Palette = pal;

						 switch(cams->list[i]->get_Camera_info()->UniqueId){
						 case 5006509:
							 pictureBox1->Image = srcBmp;
							 if(label_disp1->Visible == false){
								 label_disp1->Visible = true;
								 //label_disp1->Text == "Beginning of average speed segment";
							 }
							 break;						
						 case 5006510:
							 pictureBox6->Image = srcBmp;
							 label_disp4->Visible = true;
							 //label_disp6->Text == "Road junction 1B";
							 break;
						 case 5006511:
							 pictureBox2->Image = srcBmp;
							 label_disp2->Visible = true;
							 //label_disp2->Text == "End of average speed segment";
							 break;
						 case 5006512:
							 pictureBox5->Image = srcBmp;
							 label_disp5->Visible = true;
							 // label_disp4->Text == "Road junction 2A";
							 break;
						 case 5006513:
							 pictureBox3->Image = srcBmp;
							 label_disp3->Visible = true;
							 //label_disp3->Text == "Road junction 1A";
							 break;
						 case 5006514:
							 pictureBox4->Image = srcBmp;
							 label_disp6->Visible = true;
							 //label_disp5->Text == "Road junction 2B";
							 break;
						 }
						 cams->list[i]->img_process.disp_Options[FORM_READY]=FALSE;
						 cams->list[i]->set_ready(TRUE);
					 }
				 }
			 }
			 void numuddefault(void){
				 numUD_regx->Maximum = 1291;
				 numUD_Width->Maximum = 1292;
				 numUD_regy->Maximum = 963;
				 numUD_height->Maximum= 964;
			 }
			 void numudcheck(void){
				 numUD_regx->Maximum = Decimal::Subtract(Decimal::Divide(1292,numUD_Binx->Value),2);
				 numUD_Width->Maximum = Decimal::Subtract(Decimal::Subtract(Decimal::Divide(1292,numUD_Binx->Value),2),numUD_regx->Value);
				 numUD_regy->Maximum = Decimal::Subtract(Decimal::Divide(964,numUD_Biny->Value),2);
				 numUD_height->Maximum=Decimal::Subtract(Decimal::Subtract(Decimal::Divide(964,numUD_Biny->Value),2),numUD_regy->Value);
			 }
			 void statuslight(bool state, unsigned long long ID){
				 switch(ID){
				 case 5006509:
					 ovalShape1->Visible = state;
					 break;
				 case 5006510:
					 ovalShape4->Visible = state;
					 break;
				 case 5006511:
					 ovalShape2->Visible = state;
					 break;
				 case 5006512:
					 ovalShape5->Visible = state;
					 break;
				 case 5006513:
					 ovalShape3->Visible = state;
					 break;
				 case 5006514:
					 ovalShape6->Visible = state;
					 break;
				 }
			 }
			 void updateUDGUI(){
				 unsigned int index = list_Cameras->SelectedIndex;
				 if(index>=0 &&index <=6){					//When item from list is selected, the setup informations are loaded.  
					 numuddefault();						//default range of UD lists has to be changed. Current setting may have decreased limits, while the new one does not.
					 //cams->list[index]->Camera_getinfo(0);
					 dispSelected(cams->list[index]->get_Camera_info()->UniqueId);
					 numUD_height->Value =System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_height);
					 numUD_Width->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_width);
					 numUD_expo->Value = System::Convert::ToDecimal((unsigned int)*cams->list[index]->get_exposure());
					 numUD_gain->Value = System::Convert::ToDecimal((unsigned int)*cams->list[index]->get_gain());
					 numUD_regx->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_regX);
					 numUD_regy->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_regY);
					 //numUD_freq->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->freq);
					 numUD_Binx->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->binningX);
					 numUD_Biny->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->binningY);
					 numUD_FrameRate->Value = System::Convert::ToDecimal((cams->list[index]->get_cameraModep()->framerate));
					 numUD_framect->Value = System::Convert::ToDecimal(((unsigned int)cams->list[index]->get_cameraModep()->framect));

					 check_disp->Checked = cams->list[index]->img_process.disp_Options[IMG_WINDOW];
					 numudcheck();

				/*Exposure Tab													*/
				 if(*cams->list[index]->get_exposure_mode() == MANUAL)
				 {
					 comboBox1->SelectedIndex = 2;
					 numUD_expo->Enabled = true;
				 }						
				 if(*cams->list[index]->get_exposure_mode() == AUTO_CONTINOUOUS){
					 comboBox1->SelectedIndex = 0;
					 numUD_expo->Enabled = false;
				 }

				 if(*cams->list[index]->get_exposure_mode() == AUTO_ONCE){
					 comboBox1->SelectedIndex = 1;
					 numUD_expo->Enabled = false;
				 }
				/*Gain Tab													*/
				 if(*cams->list[index]->get_gain_mode() == MANUAL)
				 {
					 comboBox2->SelectedIndex = 2;
					 numUD_gain->Enabled = true;
				 }						
				 if(*cams->list[index]->get_gain_mode() == AUTO_CONTINOUOUS){
					 comboBox2->SelectedIndex = 0;
					 numUD_gain->Enabled = false;
				 }

				 if(*cams->list[index]->get_gain_mode() == AUTO_ONCE){
					 comboBox2->SelectedIndex = 1;
					 numUD_gain->Enabled = false;
				 }
				 /*Camera Mode Tab											*/
				 if(strcmp(cams->list[index]->get_cameraModep()->acqarr, "Continuous")==0){
					 cmode_acq->SelectedIndex = 0;
					 numUD_framect ->Enabled = false;
				 }

				 else if(strcmp(cams->list[index]->get_cameraModep()->acqarr, "SingleFrame")==0){
					 cmode_acq->SelectedIndex = 1;
					 numUD_framect ->Enabled = false;
				 }

				 else if(strcmp(cams->list[index]->get_cameraModep()->acqarr, "MultiFrame")==0){
					 cmode_acq->SelectedIndex = 2;
					 numUD_framect ->Enabled = true;
				 }

				 if(strcmp(cams->list[index]->get_cameraModep()->frametrigarr, "Freerun")==0){
					 cmode_trigger->SelectedIndex = 0;
					 numUD_FrameRate->Enabled = false;
				 }
				 else if(strcmp(cams->list[index]->get_cameraModep()->frametrigarr, "FixedRate")==0){
					 cmode_trigger->SelectedIndex = 1;
					numUD_FrameRate->Enabled = true;
				 }
				 else if(strcmp(cams->list[index]->get_cameraModep()->frametrigarr, "Software")==0){
					 cmode_trigger->SelectedIndex = 2;
					 numUD_FrameRate->Enabled = false;
				 }


				 }
			 }
			 void saveSetting(void){

				 unsigned int index = list_Cameras->SelectedIndex;
//				 regOfInterest roi;
//				 int stat;
				 /*saving roi setting*/
				 cams->list[index]->get_roi()->roi_height = System::Convert::ToUInt32(numUD_height->Value); 
				 cams->list[index]->get_roi()->roi_width = System::Convert::ToUInt32(numUD_Width->Value);
				 cams->list[index]->get_roi()->roi_regX = System::Convert::ToUInt32(numUD_regx->Value);
				 cams->list[index]->get_roi()->roi_regY = System::Convert::ToUInt32(numUD_regy->Value);
				 cams->list[index]->get_roi()->binningX = System::Convert::ToUInt32(numUD_Binx->Value);
				 cams->list[index]->get_roi()->binningY = System::Convert::ToUInt32(numUD_Biny->Value);
	
				 /*saving Exposition setting*/
				 switch(comboBox1->SelectedIndex){
				 case 0:
					 cams->list[index]->set_Exposition_Mode(AUTO_CONTINOUOUS);
					 break;
				 case 1:
					 cams->list[index]->set_Exposition_Mode(AUTO_ONCE);
					 break;
				 case 2:
					 cams->list[index]->set_Exposition_Mode(MANUAL);
					 break;
				 }
				 /*saving Gain setting*/
				 switch(comboBox2->SelectedIndex){
				 case 0:
					 cams->list[index]->set_Gain_Mode(AUTO_CONTINOUOUS);
					 break;
				 case 1:
					 cams->list[index]->set_Gain_Mode(AUTO_ONCE);
					 break;
				 case 2:
					 cams->list[index]->set_Gain_Mode(MANUAL);
					 break;
				 }

				 /*saving Camera mode setting*/
				 switch(cmode_acq->SelectedIndex){
				 case 0:
					 strcpy_s (cams->list[index]->get_cameraModep()->acqarr,"Continuous");
					 break;
				 case 1:
					 strcpy_s (cams->list[index]->get_cameraModep()->acqarr,"SingleFrame");
					 break;
				 case 2:
					 strcpy_s (cams->list[index]->get_cameraModep()->acqarr,"MultiFrame");
					 break;

				 }
				 switch(cmode_trigger->SelectedIndex){
				 case 0:
					 strcpy_s (cams->list[index]->get_cameraModep()->frametrigarr,"Freerun");
					 break;
				 case 1:
					 strcpy_s (cams->list[index]->get_cameraModep()->frametrigarr,"FixedRate");
					 break;
				 case 2:
					 strcpy_s (cams->list[index]->get_cameraModep()->frametrigarr,"Software");
					 break;
				 }
				 cams->list[index]->get_cameraModep()->framerate = (float)System::Convert::ToDouble(numUD_FrameRate->Value);
				 cams->list[index]->get_cameraModep()->framect = System::Convert::ToInt32(numUD_framect->Value);

			 }
	private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: System::Void b_init_Click(System::Object^  sender, System::EventArgs^  e) {

				 CameraSearch->Enabled=true;
				 b_init->BackColor=SystemColors::Control;

			 }
	private: System::Void CameraSearch_Tick(System::Object^  sender, System::EventArgs^  e) {
				 static unsigned int timeout=0;
				 unsigned int assigned=0, pomoc = 0, pocet = 0;
				 unsigned long temp;
				 
				 if (timeout++>=100){
					 CameraSearch->Enabled = false;
					 b_init->BackColor=Color::Red;
					 timeout = 0;
				 }
				 System::String ^mystring;
				 pocet =  PvCameraCount();
				 pomoc = (unsigned int)camNumber->Value;

				 label_CamNumber->Text=System::Convert::ToString(pocet);

				 if(pocet>=pomoc){
					 
					 cams = new Cameras((int)(camNumber->Value));
					 cams->islocked(FALSE);					 
					 Cam_found(cams, pomoc);


					 for(unsigned int i = 0;i<pomoc;i++){
						 cams->list[i]->Camera_getinfo(1);
						 tPvCameraInfoEx ID = *cams->list[i]->get_Camera_info();
						 string str(ID.SerialNumber);
						 temp = ID.UniqueId;

						 mystring= gcnew System::String(Cam_fcn(temp).c_str());

						 list_Cameras->Items->Add(System::Convert::ToString((unsigned long long)ID.UniqueId));

						 switch(i){							
						 case 0:
							 label11->Text = mystring;
							 label11->Visible = true;
							 //label_disp1->Text =  mystring;
							 break;
						 case 1:
							 label12->Text = mystring;
							 label12->Visible = true;
							 //label_disp2->Text =  mystring;
							 break;
						 case 2:
							 label13->Text = mystring;
							 label13->Visible = true;
							 //label_disp3->Text =  mystring;
							 break;
						 case 3:
							 label14->Text = mystring;
							 label14->Visible = true;
							 //label_disp1->Text =  mystring;
							 break;
						 case 4:
							 label15->Text = mystring;
							 label15->Visible = true;
							 //label_disp1->Text =  mystring;
							 break;
						 case 5:
							 label16->Text = mystring;
							 label16->Visible = true;
							 // label_disp1->Text =  mystring;
							 break;

						 }
					 }
					 list_Cameras->SelectedIndex = 0;
					 groupBox2->Enabled = true;
					 camNumber->Enabled = false;
					 b_init->Enabled = false;
					 CameraSearch->Enabled = false;
				 }
			 }

	private: System::Void label_Cam1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: void label_Cam1_DragEnter(System::Object ^  sender, System::Windows::Forms::DragEventArgs ^  e){
				 int i = 0;
			 }
	private: System::Void list_Cameras_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
				 unsigned int index = list_Cameras->SelectedIndex;

				 if((cams->list[index]->roiEnbl)==true){ //If selected camera is currently streaming, the resolution cannot be changed
					 numUD_Width->Enabled = false;
					 numUD_height->Enabled = false;
				 }
				 else{
					 numUD_Width->Enabled =		true;
					 numUD_height->Enabled =	true;
				 }

					 updateUDGUI();

			 }
	private: System::Void button_saveand_Click(System::Object^  sender, System::EventArgs^  e) {
				 
				 numUD_Width->Enabled = false;
				 numUD_height ->Enabled = false;

				 unsigned int index = list_Cameras->SelectedIndex;
				 int stat;
				 
				 saveSetting();

				 if(cams->list[index]->get_opened()!=TRUE)
					 stat = cams->list[index]->Camera_Start();

				 stat = cams->list[index]->set_resolution();
				 stat = cams->list[index]->set_Exposition(System::Convert::ToUInt32(numUD_expo->Value));
				 stat = cams->list[index]->set_Gain(System::Convert::ToUInt32(numUD_gain->Value));
				 stat = cams->list[index]->set_cameraMode();

				 if ((stat = cams->list[index]->Camera_Capture())==1){
					 CamStream->Enabled=true;
					 timer_overview->Enabled=true;
				 }
			 }
	private: System::Void timer_camera1_Tick(System::Object^  sender, System::EventArgs^  e) {
				 int  capturing=0;
				 static int p1,p2;
				 int i, pkamer= cams->celkem;

				 for(i=0;(i<pkamer);i++){				 
					 if(cams->list[i]->get_ready()==TRUE){
						 capturing++;
						 statuslight(true,cams->list[i]->get_Camera_info()->UniqueId);
						 cams->list[i]->Camera_stream();						 
					 }
				 }
				 drawform();
			 }
	private: System::Void button_stop_Click(System::Object^  sender, System::EventArgs^  e) {		 
				 int stat;
				 unsigned int index = list_Cameras->SelectedIndex;
				 numUD_Width->Enabled = true;
				 numUD_height->Enabled = true;

				 stat=cams->list[index]->Camera_stopcapt();

			 }
	private: System::Void timer_overview_Tick(System::Object^  sender, System::EventArgs^  e) {
				 if(ovalShape1->Visible == true){
					 if((overview_done[0]++)>20){
						 ovalShape1->Visible =false;
						 overview_done[0]=0;
					 }
				 }
				 if(ovalShape2->Visible == true){
					 if((overview_done[1]++)>20){
						 ovalShape2->Visible =false;
						 overview_done[1]=0;
					 }
				 }
				 if(ovalShape3->Visible == true){
					 if((overview_done[2]++)>20){
						 ovalShape3->Visible =false;
						 overview_done[2]=0;
					 }
				 }
				 if(ovalShape4->Visible == true){
					 if((overview_done[3]++)>20){
						 ovalShape4->Visible =false;
						 overview_done[3]=0;
					 }
				 }
				 if(ovalShape5->Visible == true){
					 if((overview_done[4]++)>20){
						 ovalShape5->Visible =false;
						 overview_done[4]=0;
					 }
				 }
				 if(ovalShape6->Visible == true){
					 if((overview_done[5]++)>20){
						 ovalShape6->Visible =false;
						 overview_done[5]=0;
					 }
				 }


			 }

	private: System::Void check_disp_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 Camera *temp =cams->list[list_Cameras->SelectedIndex];
				 //temp = cams->list[0];
				 if(check_disp->Checked==false && temp->img_process.disp_Options[IMG_WINDOW]==TRUE){
					 temp->img_process.disp_Options[IMG_WINDOW]=FALSE;		
					 temp->img_process.disp_Options[WINDOW_READY]=FALSE;
					 cvDestroyWindow(temp->get_Camera_info()->SerialNumber);
				 }
				 else if (check_disp->Checked==true){
					 temp->img_process.disp_Options[IMG_WINDOW]=TRUE;
				 }

			 }

	private: System::Void numUD_Binx_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 numudcheck();		
			 }
	private: System::Void numUD_Biny_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 numudcheck();			 
			 }
	private: System::Void numUD_regx_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 numudcheck();
			 }
	private: System::Void numUD_regy_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 numudcheck();
			 }
	private: System::Void comboBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
				 if (comboBox1->SelectedIndex==0||comboBox1->SelectedIndex==1)
					 numUD_expo->Enabled=false;
				 if (comboBox1->SelectedIndex==2)
					 numUD_expo->Enabled=true;
			 }
	private: System::Void comboBox2_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
				 if (comboBox2->SelectedIndex==0||comboBox2->SelectedIndex==1)
					 numUD_gain->Enabled=false;
				 if (comboBox1->SelectedIndex==2)
					 numUD_gain->Enabled=true;
			 }
	private: System::Void numericUpDown1_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: System::Void label18_Click(System::Object^  sender, System::EventArgs^  e) {
				 //			 label18->Text = Convert::ToString(cams->list[list_Cameras->SelectedIndex]->Camera_getExpo());
			 }
	private: System::Void label17_Click(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: System::Void check_save_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 Camera *temp =cams->list[list_Cameras->SelectedIndex];
				 //temp = cams->list[0];
				 if(check_save->Checked==false && temp->img_process.disp_Options[IMG_SAVE]==true){
					 temp->img_process.disp_Options[IMG_SAVE]=false;
				 }
				 else if (check_save->Checked==true){
					 temp->img_process.disp_Options[IMG_SAVE]=true;
				 }
			 }

	private: System::Void button_save_Click(System::Object^  sender, System::EventArgs^  e) {
				 saveSetting();
			 }
	private: System::Void button_discrad_Click(System::Object^  sender, System::EventArgs^  e) {
				 unsigned int index = list_Cameras->SelectedIndex;
				 numUD_height->Value =System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_height);
				 numUD_Width->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_width);
				 numUD_expo->Value = System::Convert::ToDecimal((unsigned int)*cams->list[index]->get_exposure());
				 numUD_gain->Value = System::Convert::ToDecimal((unsigned int)*cams->list[index]->get_gain());
				 numUD_regx->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_regX);
				 numUD_regy->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->roi_regY);
				 // numUD_freq->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->freq);
				 numUD_Binx->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->binningX);
				 numUD_Biny->Value = System::Convert::ToDecimal((unsigned int)cams->list[index]->get_roi()->binningY);
				 check_disp->Checked = cams->list[index]->img_process.disp_Options[IMG_WINDOW];

			 }
	private: System::Void checkBox2_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(checkBox2->Checked==true){
					 trackBar2->Enabled=true;
					 numericUpDown2->Enabled = true;
					 button2->Enabled = true;
				 }
				 else if(checkBox2->Checked == false){
					 trackBar2->Enabled = false;
					 numericUpDown2->Enabled = false;
					 trackBar2->Value = 0;
					 numericUpDown2->Value = 0;
					 button2->Enabled = false;
				 }
			 }
	private: System::Void checkBox3_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(checkBox3->Checked==true){
					 trackBar3->Enabled=true;
					 numericUpDown3->Enabled = true;
					 button3->Enabled = true;
				 }
				 else if(checkBox3->Checked == false){
					 trackBar3->Enabled = false;
					 numericUpDown3->Enabled = false;
					 trackBar3->Value = 0;
					 numericUpDown3->Value = 0;
					 button3->Enabled = false;
				 }
			 }
	private: System::Void checkBox1_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(checkBox1->Checked==true){
					 trackBar1->Enabled=true;
					 numericUpDown1->Enabled = true;
					 button1->Enabled = true;
				 }
				 else if(checkBox1->Checked == false){
					 trackBar1->Enabled = false;
					 numericUpDown1->Enabled = false;
					 trackBar1->Value = 0;
					 numericUpDown1->Value = 0;
					 button1->Enabled = false;
				 }
			 }
	private: System::Void checkBox4_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(safe_speed->Checked == true){
					 numericUpDown1->Maximum = 14;
					 trackBar1->Maximum = 14;

					 numericUpDown2->Maximum = 14;
					 trackBar2->Maximum = 14;

					 numericUpDown3->Maximum = 14;
					 trackBar3->Maximum = 14;
				 }

				 else if(safe_speed->Checked == false){
					 numericUpDown1->Maximum = 5;
					 trackBar1->Maximum = 5;

					 numericUpDown2->Maximum = 5;
					 trackBar2->Maximum = 5;

					 numericUpDown3->Maximum = 5;
					 trackBar3->Maximum = 5;
				 }
			 }
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 //UINT8 *sentValue;
				 //sentValue = oneDpotMsg(1,trackBar1->Value); 
				 char *send;

				 pots->pocet = 1;
				 pots->aktivni = 1;
				 pots->value[0] = dpot_speed2pos(trackBar1->Value,safe_speed->Checked);			 
				 send = dpotData(pots);				 					 
				 if(usbSendMyMsg(handle, USB_DPOT_TEMP, 0, 0, send)<0)
					 usbfailed();
			 }
	private: System::Void button2_Click_1(System::Object^  sender, System::EventArgs^  e) {
				 char *send;

				 pots->pocet = 1;
				 pots->aktivni = 2;
				 pots->value[1] = dpot_speed2pos(trackBar2->Value,safe_speed->Checked);					 
				 send = dpotData(pots);				 					 
				 if(usbSendMyMsg(handle, USB_DPOT_TEMP, 0, 0, send)<0)
					 usbfailed();
			 }
	private: System::Void button3_Click_1(System::Object^  sender, System::EventArgs^  e) {
				 char *send;

				 pots->pocet = 1;
				 pots->aktivni = 3;
				 pots->value[2] = dpot_speed2pos(trackBar3->Value,safe_speed->Checked);	 
				 send = dpotData(pots);				 					 
				 if(usbSendMyMsg(handle, USB_DPOT_TEMP, 0, 0, send)<0)
					 usbfailed();
			 }
	private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) {
				 char *send;

				 pots->pocet = 3;
				 pots->aktivni = 4;
				 pots->value[0] = dpot_speed2pos(trackBar1->Value,safe_speed->Checked);	
				 pots->value[1] = dpot_speed2pos(trackBar2->Value,safe_speed->Checked);
				 pots->value[2] = dpot_speed2pos(trackBar3->Value,safe_speed->Checked);	 
				 send = dpotData(pots);				 					 
				 if(usbSendMyMsg(handle, USB_DPOT_TEMP, 0, 0, send)<0)
					 usbfailed();
			 }
	private: System::Void but_usbConnect_Click(System::Object^  sender, System::EventArgs^  e) {
				 if((handle = usbopenMyDevice())!=NULL){
					 but_usbConnect->BackColor=Color::Green;
					 group_semafor->Enabled = true;
					 group_slotcar->Enabled = true;
					 but_usbLED->Enabled = true;
					 pots= new digpot;
					 pots->value[0] = 0;
					 pots->value[1] = 0;
					 pots->value[2] = 0;
					 semaf= new semafors;
					 semafor_init(semaf);
					 but_usbConnect->Enabled=false;
					 usb_close(handle);
				 }
				 else
					 but_usbConnect->BackColor=Color::Red;

			 }
	private: System::Void but_usbLED_Click(System::Object^  sender, System::EventArgs^  e) {
				 static bool stav = false;
				 if(stav ==false){
					 if(usbSendMyMsg(handle,USB_LED_ON,0,0,0)>=0){
						 stav = true;
					 }
					 else
						 usbfailed();
				 }
				 else{
					 if(usbSendMyMsg(handle,USB_LED_OFF,0,0,0)>=0){
						 stav = false;
					 }
					 else
						 usbfailed();
				 }
			 }
	private: System::Void trackBar1_Scroll(System::Object^  sender, System::EventArgs^  e) {
				 numericUpDown1->Value = trackBar1->Value;
			 }
	private: System::Void numericUpDown1_ValueChanged_1(System::Object^  sender, System::EventArgs^  e) {
				 trackBar1->Value = System::Convert::ToInt16(numericUpDown1->Value);
			 }
	private: System::Void trackBar2_Scroll(System::Object^  sender, System::EventArgs^  e) {
				 numericUpDown2->Value = trackBar2->Value;
			 }
	private: System::Void numericUpDown2_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 trackBar2->Value = System::Convert::ToInt16( numericUpDown2->Value);
			 }
	private: System::Void trackBar3_Scroll(System::Object^  sender, System::EventArgs^  e) {
				 numericUpDown3->Value = trackBar3->Value;
			 }
	private: System::Void numericUpDown3_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 trackBar3->Value = System::Convert::ToInt16(numericUpDown3->Value);
			 }



	private: System::Void numericUpDown4_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 int number = System::Convert::ToInt16(numericUpDown4->Value);
				 for(int i = 0;i<6;i++){
					 if(i<number)
						 semaf->semafor[i].active = 1;
					 else
						 semaf->semafor[i].active = 0;
				 }
				 switch(number){
				 case 1:
					 group_S1->Enabled= true;
					 group_S2->Enabled= false;
					 group_S3->Enabled= false;
					 group_S4->Enabled= false;
					 group_S5->Enabled= false;
					 group_S6->Enabled= false;
					 break;
				 case 2:
					 group_S1->Enabled= true;
					 group_S2->Enabled= true;
					 group_S3->Enabled= false;
					 group_S4->Enabled= false;
					 group_S5->Enabled= false;
					 group_S6->Enabled= false;
					 break;
				 case 3:
					 group_S1->Enabled= true;
					 group_S2->Enabled= true;
					 group_S3->Enabled= true;
					 group_S4->Enabled= false;
					 group_S5->Enabled= false;
					 group_S6->Enabled= false;
					 break;
				 case 4:
					 group_S1->Enabled= true;
					 group_S2->Enabled= true;
					 group_S3->Enabled= true;
					 group_S4->Enabled= true;
					 group_S5->Enabled= false;
					 group_S6->Enabled= false;
					 break;
				 case 5:
					 group_S1->Enabled= true;
					 group_S2->Enabled= true;
					 group_S3->Enabled= true;
					 group_S4->Enabled= true;
					 group_S5->Enabled= true;
					 group_S6->Enabled= false;
					 break;
				 case 6:
					 group_S1->Enabled= true;
					 group_S2->Enabled= true;
					 group_S3->Enabled= true;
					 group_S4->Enabled= true;
					 group_S5->Enabled= true;
					 group_S6->Enabled= true;
					 break;


				 }
			 }
	private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
				 char *send;
				 SemaforCycle->Enabled = false;
				 button6->BackColor = Color::Gray;
				 int no=System::Convert::ToUInt16(numericUpDown4->Value);

				 semaf->pocet=no;

				 for(int i=0;i<no;i++){
					 semaf->semafor[i].state = semaflightSelected(i);
				 }
				 send = semafordata(semaf);

				 if(usbSendMyMsg(handle,USB_SEMAF_STATE,0,0,send)<0)
					 usbfailed();
			 }
	private: System::Void numericUpDown5_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 //numUD_delay->Maximum = numUD_red->Value + numUD_red->Value+numUD_green->Value+numUD_red->yellow+numUD_orange->Value;
				 numUD_delay->Maximum= System::Decimal::Subtract(System::Decimal::Add(System::Decimal::Add(numUD_red->Value, numUD_green->Value),System::Decimal::Add(numUD_yellow->Value,numUD_orange->Value)),1);
				 if(check_semafauto->Checked == true){
					 numUD_red->Value = numUD_orange->Value;
					 numUD_green->Value = numUD_orange->Value;
					 numUD_yellow->Value = numUD_orange->Value;

				 }

			 }
	private: System::Void check_semafauto_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(check_semafauto->Checked == true){
					 numUD_red->Enabled = false;
					 numUD_red->Value = numUD_orange->Value;
					 numUD_green->Enabled = false;
					 numUD_green->Value = numUD_orange->Value;
					 numUD_yellow->Enabled = false;
					 numUD_yellow->Value = numUD_orange->Value;
				 }
				 else{
					 numUD_green->Enabled = true;
					 numUD_yellow->Enabled = true;

				 }
			 }
	private: System::Void button7_Click(System::Object^  sender, System::EventArgs^  e) {
				 semafSave();

			 }
	private: System::Void radio_semaf12_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(radio_semaf12->Checked==true){
					 numUD_green->Value = System::Convert::ToDecimal(semaf->semafor[0].sec_color[GREEN]);
					 numUD_yellow->Value = System::Convert::ToDecimal(semaf->semafor[0].sec_color[YELLOW]);
					 numUD_red->Value = System::Convert::ToDecimal(semaf->semafor[0].sec_color[RED]);
					 numUD_orange->Value = System::Convert::ToDecimal(semaf->semafor[0].sec_color[ORANGE]);
					 numUD_delay->Value = System::Convert::ToDecimal(semaf->semafor[0].delay);
				 }
			 }
	private: System::Void radio_semaf34_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(radio_semaf34->Checked==true){
					 numUD_green->Value = System::Convert::ToDecimal(semaf->semafor[2].sec_color[GREEN]);
					 numUD_yellow->Value = System::Convert::ToDecimal(semaf->semafor[2].sec_color[YELLOW]);
					 numUD_red->Value = System::Convert::ToDecimal(semaf->semafor[2].sec_color[RED]);
					 numUD_orange->Value = System::Convert::ToDecimal(semaf->semafor[2].sec_color[ORANGE]);
					 numUD_delay->Value = System::Convert::ToDecimal(semaf->semafor[2].delay);
				 }
			 }
	private: System::Void radio_semaf56_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
				 if(radio_semaf56->Checked==true){
					 numUD_green->Value = System::Convert::ToDecimal(semaf->semafor[4].sec_color[GREEN]);
					 numUD_yellow->Value = System::Convert::ToDecimal(semaf->semafor[4].sec_color[YELLOW]);
					 numUD_red->Value = System::Convert::ToDecimal(semaf->semafor[4].sec_color[RED]);
					 numUD_orange->Value = System::Convert::ToDecimal(semaf->semafor[4].sec_color[ORANGE]);
					 numUD_delay->Value = System::Convert::ToDecimal(semaf->semafor[4].delay);
				 }
			 }
	private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
				 if(SemaforCycle->Enabled == false){
				 semafSave();
				 delay2stage(semaf);
				 SemaforCycle->Enabled=true;
				 button6->BackColor = Color::Green;
				 }
				 else{
					 SemaforCycle->Enabled=false;
					 button6->BackColor = Color::Gray;
				 }				 
			 }
	private: System::Void numUD_delay_ValueChanged(System::Object^  sender, System::EventArgs^  e) {
				 /*numUD_delay->Maximum= System::Decimal::Subtract(System::Decimal::Add(System::Decimal::Add(System::Decimal::Add(numUD_red->Value,
				 numUD_green->Value),
				 System::Decimal::Add(numUD_yellow->Value,
				 numUD_orange->Value))
				 ,1)));*/
				 numUD_delay->Maximum= System::Decimal::Subtract(System::Decimal::Add(System::Decimal::Add(System::Decimal::Add(numUD_green->Value,numUD_green->Value),
					 System::Decimal::Add(numUD_yellow->Value,numUD_yellow->Value)),
					 System::Decimal::Add(numUD_orange->Value,numUD_orange->Value)),
					 1);

			 }
	private: System::Void SemaforCycle_Tick(System::Object^  sender, System::EventArgs^  e) {
				 // UINT8 *sent1;
				 // UINT8 *sent2;
				 char *send;
//				 UINT8 debug[4];
				 semafor_cycle(semaf);
				 semafGraphicP();
				 //sent1 = semaforMsg1(semaf);
				 // sent2 = semaforMsg2(semaf);
				 send = semafordata(semaf);
				 //debug[0] = sent1[0];
				 //debug[1] = sent1[1];
				 //debug[2] = sent2[0];
				 //debug[3] = sent2[1];
				 if(usbSendMyMsg(handle,USB_SEMAF_STATE,0,0,send)<0)
					 usbfailed();
			 }
	private: System::Void button8_Click(System::Object^  sender, System::EventArgs^  e) {
				 if(usbSendMyMsg(handle,USB_DPOT_RESET,0,0,0)<0)
					 usbfailed();
				 numericUpDown1->Value = 0;
				 numericUpDown2->Value = 0;
				 numericUpDown3->Value = 0;
				 trackBar1->Value = 0;
				 trackBar2->Value = 0;
				 trackBar3->Value = 0;


			 }
private: System::Void numUD_FrameRate_ValueChanged(System::Object^  sender, System::EventArgs^  e) {

		 }
private: System::Void cmode_trigger_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
			 if(cmode_trigger->SelectedIndex == 1)
				 numUD_FrameRate ->Enabled = true;
			 else
				 numUD_FrameRate ->Enabled = false;
		 }
private: System::Void cmode_acq_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
			 if(cmode_acq->SelectedIndex == 2)
				 numUD_framect ->Enabled = true;
			 else
				 numUD_framect ->Enabled = false;

		 }
private: System::Void numericUpDown5_ValueChanged_1(System::Object^  sender, System::EventArgs^  e) {
			 
		 }
private: System::Void button9_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void pictureBox1_Click(System::Object^  sender, System::EventArgs^  e) {
			 unsigned int index = cams->celkem;
			 
			 for(unsigned int i = 0; i<index;i++){
				 if(cams->list[i]->get_Camera_info()->UniqueId==5006509)
				 list_Cameras->SelectedIndex = i;
			 }
		 }
private: System::Void pictureBox2_Click(System::Object^  sender, System::EventArgs^  e) {
			  unsigned int index = cams->celkem;
			 for(unsigned int i = 0; i<index;i++){
				 if(cams->list[i]->get_Camera_info()->UniqueId==5006511)
				 list_Cameras->SelectedIndex = i;
			 }
		 }
private: System::Void pictureBox3_Click(System::Object^  sender, System::EventArgs^  e) {
			  unsigned int index = cams->celkem;
			 for(unsigned int i = 0; i<index;i++){
				 if(cams->list[i]->get_Camera_info()->UniqueId==5006513)
				 list_Cameras->SelectedIndex = i;
			 }
		 }
private: System::Void pictureBox6_Click(System::Object^  sender, System::EventArgs^  e) {
			  unsigned int index = cams->celkem;
			 for(unsigned int i = 0; i<index;i++){
				 if(cams->list[i]->get_Camera_info()->UniqueId==5006510)
				 list_Cameras->SelectedIndex = i;
			 }
		 }
private: System::Void pictureBox5_Click(System::Object^  sender, System::EventArgs^  e) {
			  unsigned int index = cams->celkem;
			  for(unsigned int i = 0; i<index;i++){
				 if(cams->list[i]->get_Camera_info()->UniqueId==5006512)
				 list_Cameras->SelectedIndex = i;
			 }
		 }
private: System::Void pictureBox4_Click(System::Object^  sender, System::EventArgs^  e) {
			  unsigned int index = cams->celkem;
			  for(unsigned int i = 0; i<index;i++){
				 if(cams->list[i]->get_Camera_info()->UniqueId==5006514)
				 list_Cameras->SelectedIndex = i;
			 }
		 }
};
}
