#pragma once
#include "Kalibrace.h"
namespace Bakalarska_prace {

	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 Form4
	/// </summary>
	public ref class Form4 : public System::Windows::Forms::Form
	{
	public:
		Form4(Kalibrace* K)
		{
			InitializeComponent();
			Kali = K;
			TxtFxMin->Text = Kali->GetMez(0,0).ToString("0.00");
			TxtFxMax->Text = Kali->GetMez(0,1).ToString("0.00");
			TxtFyMin->Text = Kali->GetMez(1,0).ToString("0.00");
			TxtFyMax->Text = Kali->GetMez(1,1).ToString("0.00");
			TxtAlfaMin->Text = Kali->GetMez(2,0).ToString("0.00");
			TxtAlfaMax->Text = Kali->GetMez(2,1).ToString("0.00");
			TxtBetaMin->Text = Kali->GetMez(3,0).ToString("0.00");
			TxtBetaMax->Text = Kali->GetMez(3,1).ToString("0.00");
			TxtGamaMin->Text = Kali->GetMez(4,0).ToString("0.00");
			TxtGamaMax->Text = Kali->GetMez(4,1).ToString("0.00");
			TxtXMin->Text = Kali->GetMez(5,0).ToString("0.00");
			TxtXMax->Text = Kali->GetMez(5,1).ToString("0.00");
			TxtYMin->Text = Kali->GetMez(6,0).ToString("0.00");
			TxtYMax->Text = Kali->GetMez(6,1).ToString("0.00");
			TxtZMin->Text = Kali->GetMez(7,0).ToString("0.00");
			TxtZMax->Text = Kali->GetMez(7,1).ToString("0.00");
			TxtF->Text = Kali->GetF().ToString("0.00");
			TxtCR->Text = Kali->GetCR().ToString("0.00");
			TxtNP->Text = Kali->GetNP().ToString();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form4()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::TextBox^  TxtFxMin;
	private: System::Windows::Forms::TextBox^  TxtFxMax;
	protected: 
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::TextBox^  TxtFyMin;
	private: System::Windows::Forms::TextBox^  TxtFyMax;
	private: System::Windows::Forms::TextBox^  TxtAlfaMin;
	private: System::Windows::Forms::TextBox^  TxtAlfaMax;
	private: System::Windows::Forms::TextBox^  TxtBetaMin;
	private: System::Windows::Forms::TextBox^  TxtBetaMax;
	private: System::Windows::Forms::TextBox^  TxtGamaMax;
	private: System::Windows::Forms::TextBox^  TxtGamaMin;
	private: System::Windows::Forms::TextBox^  TxtXMax;
	private: System::Windows::Forms::TextBox^  TxtXMin;
	private: System::Windows::Forms::TextBox^  TxtYMax;
	private: System::Windows::Forms::TextBox^  TxtYMin;
	private: System::Windows::Forms::TextBox^  TxtZMax;
	private: System::Windows::Forms::TextBox^  TxtZMin;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::Label^  label5;
	private: System::Windows::Forms::Label^  label6;
	private: System::Windows::Forms::Label^  label7;
	private: System::Windows::Forms::Label^  label8;
	private: System::Windows::Forms::Label^  label9;
	private: System::Windows::Forms::Label^  label10;
	private: System::Windows::Forms::TextBox^  TxtF;
	private: System::Windows::Forms::TextBox^  TxtCR;
	private: System::Windows::Forms::TextBox^  TxtNP;



	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::Button^  button1;
	private: System::Windows::Forms::Button^  button2;
	protected: 


	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		Kalibrace* Kali;
		System::ComponentModel::Container ^components;

#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->TxtFxMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtFxMax = (gcnew System::Windows::Forms::TextBox());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->TxtFyMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtFyMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtAlfaMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtAlfaMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtBetaMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtBetaMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtGamaMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtGamaMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtXMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtXMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtYMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtYMin = (gcnew System::Windows::Forms::TextBox());
			this->TxtZMax = (gcnew System::Windows::Forms::TextBox());
			this->TxtZMin = (gcnew System::Windows::Forms::TextBox());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->label5 = (gcnew System::Windows::Forms::Label());
			this->label6 = (gcnew System::Windows::Forms::Label());
			this->label7 = (gcnew System::Windows::Forms::Label());
			this->label8 = (gcnew System::Windows::Forms::Label());
			this->label9 = (gcnew System::Windows::Forms::Label());
			this->label10 = (gcnew System::Windows::Forms::Label());
			this->TxtF = (gcnew System::Windows::Forms::TextBox());
			this->TxtCR = (gcnew System::Windows::Forms::TextBox());
			this->TxtNP = (gcnew System::Windows::Forms::TextBox());
			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->button1 = (gcnew System::Windows::Forms::Button());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->SuspendLayout();
			// 
			// TxtFxMin
			// 
			this->TxtFxMin->Location = System::Drawing::Point(66, 26);
			this->TxtFxMin->Name = L"TxtFxMin";
			this->TxtFxMin->Size = System::Drawing::Size(100, 20);
			this->TxtFxMin->TabIndex = 0;
			// 
			// TxtFxMax
			// 
			this->TxtFxMax->Location = System::Drawing::Point(172, 26);
			this->TxtFxMax->Name = L"TxtFxMax";
			this->TxtFxMax->Size = System::Drawing::Size(100, 20);
			this->TxtFxMax->TabIndex = 1;
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(101, 9);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(24, 13);
			this->label1->TabIndex = 2;
			this->label1->Text = L"Min";
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Location = System::Drawing::Point(201, 9);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(27, 13);
			this->label2->TabIndex = 3;
			this->label2->Text = L"Max";
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->Location = System::Drawing::Point(12, 29);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(26, 13);
			this->label3->TabIndex = 4;
			this->label3->Text = L"f/px";
			// 
			// TxtFyMin
			// 
			this->TxtFyMin->Location = System::Drawing::Point(66, 52);
			this->TxtFyMin->Name = L"TxtFyMin";
			this->TxtFyMin->Size = System::Drawing::Size(100, 20);
			this->TxtFyMin->TabIndex = 5;
			// 
			// TxtFyMax
			// 
			this->TxtFyMax->Location = System::Drawing::Point(172, 52);
			this->TxtFyMax->Name = L"TxtFyMax";
			this->TxtFyMax->Size = System::Drawing::Size(100, 20);
			this->TxtFyMax->TabIndex = 6;
			// 
			// TxtAlfaMin
			// 
			this->TxtAlfaMin->Location = System::Drawing::Point(66, 78);
			this->TxtAlfaMin->Name = L"TxtAlfaMin";
			this->TxtAlfaMin->Size = System::Drawing::Size(100, 20);
			this->TxtAlfaMin->TabIndex = 7;
			// 
			// TxtAlfaMax
			// 
			this->TxtAlfaMax->Location = System::Drawing::Point(172, 78);
			this->TxtAlfaMax->Name = L"TxtAlfaMax";
			this->TxtAlfaMax->Size = System::Drawing::Size(100, 20);
			this->TxtAlfaMax->TabIndex = 8;
			// 
			// TxtBetaMin
			// 
			this->TxtBetaMin->Location = System::Drawing::Point(66, 104);
			this->TxtBetaMin->Name = L"TxtBetaMin";
			this->TxtBetaMin->Size = System::Drawing::Size(100, 20);
			this->TxtBetaMin->TabIndex = 9;
			// 
			// TxtBetaMax
			// 
			this->TxtBetaMax->Location = System::Drawing::Point(172, 104);
			this->TxtBetaMax->Name = L"TxtBetaMax";
			this->TxtBetaMax->Size = System::Drawing::Size(100, 20);
			this->TxtBetaMax->TabIndex = 10;
			// 
			// TxtGamaMax
			// 
			this->TxtGamaMax->Location = System::Drawing::Point(172, 130);
			this->TxtGamaMax->Name = L"TxtGamaMax";
			this->TxtGamaMax->Size = System::Drawing::Size(100, 20);
			this->TxtGamaMax->TabIndex = 11;
			// 
			// TxtGamaMin
			// 
			this->TxtGamaMin->Location = System::Drawing::Point(66, 130);
			this->TxtGamaMin->Name = L"TxtGamaMin";
			this->TxtGamaMin->Size = System::Drawing::Size(100, 20);
			this->TxtGamaMin->TabIndex = 12;
			// 
			// TxtXMax
			// 
			this->TxtXMax->Location = System::Drawing::Point(172, 156);
			this->TxtXMax->Name = L"TxtXMax";
			this->TxtXMax->Size = System::Drawing::Size(100, 20);
			this->TxtXMax->TabIndex = 13;
			// 
			// TxtXMin
			// 
			this->TxtXMin->Location = System::Drawing::Point(66, 156);
			this->TxtXMin->Name = L"TxtXMin";
			this->TxtXMin->Size = System::Drawing::Size(100, 20);
			this->TxtXMin->TabIndex = 14;
			// 
			// TxtYMax
			// 
			this->TxtYMax->Location = System::Drawing::Point(172, 182);
			this->TxtYMax->Name = L"TxtYMax";
			this->TxtYMax->Size = System::Drawing::Size(100, 20);
			this->TxtYMax->TabIndex = 15;
			// 
			// TxtYMin
			// 
			this->TxtYMin->Location = System::Drawing::Point(66, 182);
			this->TxtYMin->Name = L"TxtYMin";
			this->TxtYMin->Size = System::Drawing::Size(100, 20);
			this->TxtYMin->TabIndex = 16;
			// 
			// TxtZMax
			// 
			this->TxtZMax->Location = System::Drawing::Point(172, 208);
			this->TxtZMax->Name = L"TxtZMax";
			this->TxtZMax->Size = System::Drawing::Size(100, 20);
			this->TxtZMax->TabIndex = 17;
			// 
			// TxtZMin
			// 
			this->TxtZMin->Location = System::Drawing::Point(66, 208);
			this->TxtZMin->Name = L"TxtZMin";
			this->TxtZMin->Size = System::Drawing::Size(100, 20);
			this->TxtZMin->TabIndex = 18;
			// 
			// label4
			// 
			this->label4->AutoSize = true;
			this->label4->Location = System::Drawing::Point(12, 55);
			this->label4->Name = L"label4";
			this->label4->Size = System::Drawing::Size(26, 13);
			this->label4->TabIndex = 19;
			this->label4->Text = L"f/py";
			// 
			// label5
			// 
			this->label5->AutoSize = true;
			this->label5->Location = System::Drawing::Point(12, 81);
			this->label5->Name = L"label5";
			this->label5->Size = System::Drawing::Size(25, 13);
			this->label5->TabIndex = 20;
			this->label5->Text = L"Alfa";
			// 
			// label6
			// 
			this->label6->AutoSize = true;
			this->label6->Location = System::Drawing::Point(12, 107);
			this->label6->Name = L"label6";
			this->label6->Size = System::Drawing::Size(29, 13);
			this->label6->TabIndex = 21;
			this->label6->Text = L"Beta";
			// 
			// label7
			// 
			this->label7->AutoSize = true;
			this->label7->Location = System::Drawing::Point(12, 133);
			this->label7->Name = L"label7";
			this->label7->Size = System::Drawing::Size(35, 13);
			this->label7->TabIndex = 22;
			this->label7->Text = L"Gama";
			// 
			// label8
			// 
			this->label8->AutoSize = true;
			this->label8->Location = System::Drawing::Point(12, 159);
			this->label8->Name = L"label8";
			this->label8->Size = System::Drawing::Size(14, 13);
			this->label8->TabIndex = 23;
			this->label8->Text = L"X";
			// 
			// label9
			// 
			this->label9->AutoSize = true;
			this->label9->Location = System::Drawing::Point(12, 185);
			this->label9->Name = L"label9";
			this->label9->Size = System::Drawing::Size(14, 13);
			this->label9->TabIndex = 24;
			this->label9->Text = L"Y";
			// 
			// label10
			// 
			this->label10->AutoSize = true;
			this->label10->Location = System::Drawing::Point(12, 211);
			this->label10->Name = L"label10";
			this->label10->Size = System::Drawing::Size(14, 13);
			this->label10->TabIndex = 25;
			this->label10->Text = L"Z";
			// 
			// TxtF
			// 
			this->TxtF->Location = System::Drawing::Point(376, 26);
			this->TxtF->Name = L"TxtF";
			this->TxtF->Size = System::Drawing::Size(100, 20);
			this->TxtF->TabIndex = 26;
			// 
			// TxtCR
			// 
			this->TxtCR->Location = System::Drawing::Point(376, 52);
			this->TxtCR->Name = L"TxtCR";
			this->TxtCR->Size = System::Drawing::Size(100, 20);
			this->TxtCR->TabIndex = 27;
			// 
			// TxtNP
			// 
			this->TxtNP->Location = System::Drawing::Point(376, 78);
			this->TxtNP->Name = L"TxtNP";
			this->TxtNP->Size = System::Drawing::Size(100, 20);
			this->TxtNP->TabIndex = 28;
			// 
			// label11
			// 
			this->label11->AutoSize = true;
			this->label11->Location = System::Drawing::Point(373, 9);
			this->label11->Name = L"label11";
			this->label11->Size = System::Drawing::Size(95, 13);
			this->label11->TabIndex = 30;
			this->label11->Text = L"Parametry evoluce";
			// 
			// label12
			// 
			this->label12->AutoSize = true;
			this->label12->Location = System::Drawing::Point(348, 29);
			this->label12->Name = L"label12";
			this->label12->Size = System::Drawing::Size(13, 13);
			this->label12->TabIndex = 31;
			this->label12->Text = L"F";
			// 
			// label13
			// 
			this->label13->AutoSize = true;
			this->label13->Location = System::Drawing::Point(348, 55);
			this->label13->Name = L"label13";
			this->label13->Size = System::Drawing::Size(22, 13);
			this->label13->TabIndex = 32;
			this->label13->Text = L"CR";
			// 
			// label14
			// 
			this->label14->AutoSize = true;
			this->label14->Location = System::Drawing::Point(348, 81);
			this->label14->Name = L"label14";
			this->label14->Size = System::Drawing::Size(22, 13);
			this->label14->TabIndex = 33;
			this->label14->Text = L"NP";
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(336, 205);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(75, 23);
			this->button1->TabIndex = 34;
			this->button1->Text = L"Ok";
			this->button1->UseVisualStyleBackColor = true;
			this->button1->Click += gcnew System::EventHandler(this, &Form4::button1_Click);
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(417, 205);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(75, 23);
			this->button2->TabIndex = 35;
			this->button2->Text = L"Storno";
			this->button2->UseVisualStyleBackColor = true;
			this->button2->Click += gcnew System::EventHandler(this, &Form4::button2_Click);
			// 
			// Form4
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(531, 236);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->button1);
			this->Controls->Add(this->label14);
			this->Controls->Add(this->label13);
			this->Controls->Add(this->label12);
			this->Controls->Add(this->label11);
			this->Controls->Add(this->TxtNP);
			this->Controls->Add(this->TxtCR);
			this->Controls->Add(this->TxtF);
			this->Controls->Add(this->label10);
			this->Controls->Add(this->label9);
			this->Controls->Add(this->label8);
			this->Controls->Add(this->label7);
			this->Controls->Add(this->label6);
			this->Controls->Add(this->label5);
			this->Controls->Add(this->label4);
			this->Controls->Add(this->TxtZMin);
			this->Controls->Add(this->TxtZMax);
			this->Controls->Add(this->TxtYMin);
			this->Controls->Add(this->TxtYMax);
			this->Controls->Add(this->TxtXMin);
			this->Controls->Add(this->TxtXMax);
			this->Controls->Add(this->TxtGamaMin);
			this->Controls->Add(this->TxtGamaMax);
			this->Controls->Add(this->TxtBetaMax);
			this->Controls->Add(this->TxtBetaMin);
			this->Controls->Add(this->TxtAlfaMax);
			this->Controls->Add(this->TxtAlfaMin);
			this->Controls->Add(this->TxtFyMax);
			this->Controls->Add(this->TxtFyMin);
			this->Controls->Add(this->label3);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->TxtFxMax);
			this->Controls->Add(this->TxtFxMin);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
			this->Name = L"Form4";
			this->Text = L"Nastavení";
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 try 
			 {
				 Kali->SetMez(0,0,Convert::ToDouble(TxtFxMin->Text));
				 Kali->SetMez(0,1,Convert::ToDouble(TxtFxMax->Text));
				 Kali->SetMez(1,0,Convert::ToDouble(TxtFyMin->Text));
				 Kali->SetMez(1,1,Convert::ToDouble(TxtFyMax->Text));
				 Kali->SetMez(2,0,Convert::ToDouble(TxtAlfaMin->Text));
				 Kali->SetMez(2,1,Convert::ToDouble(TxtAlfaMax->Text));
				 Kali->SetMez(3,0,Convert::ToDouble(TxtBetaMin->Text));
				 Kali->SetMez(3,1,Convert::ToDouble(TxtBetaMax->Text));
				 Kali->SetMez(4,0,Convert::ToDouble(TxtGamaMin->Text));
				 Kali->SetMez(4,1,Convert::ToDouble(TxtGamaMax->Text));
				 Kali->SetMez(5,0,Convert::ToDouble(TxtXMin->Text));
				 Kali->SetMez(5,1,Convert::ToDouble(TxtXMax->Text));
				 Kali->SetMez(6,0,Convert::ToDouble(TxtYMin->Text));
				 Kali->SetMez(6,1,Convert::ToDouble(TxtYMax->Text));
				 Kali->SetMez(7,0,Convert::ToDouble(TxtZMin->Text));
				 Kali->SetMez(7,1,Convert::ToDouble(TxtZMax->Text));
				 Kali->SetF(Convert::ToDouble(TxtF->Text));
				 Kali->SetCR(Convert::ToDouble(TxtCR->Text));
				 Kali->SetNP(Convert::ToInt16(TxtNP->Text));
				 DialogResult = System::Windows::Forms::DialogResult::OK;
			 }
			 catch(...)
			 {
				 MessageBox::Show("patně zadané hodnoty");
			 }
		 }
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
			DialogResult = System::Windows::Forms::DialogResult::Cancel;
		 }
};
}
