Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
0
Добавлен:
23.10.2024
Размер:
632.33 Кб
Скачать

4 Текст программы

Main.h

bool flag = false;

private: System::Void timer1_Tick(System::Object^ sender,

System::EventArgs^ e) {

timer1->Stop();

Base_Car::SetX(Base_Car::GetX() + 10);

Base_Car::exitTimer = true;

}

private: System::Void Arrived_Tick(System::Object^ sender,

System::EventArgs^ e) {

Arrived->Stop();

Base_Car::SetX(Base_Car::GetX() + 100);

Base_Car::exitTimer = true;

}

private: System::Void ctimer_Tick(System::Object^ sender,

System::EventArgs^ e) {

ctimer->Stop();

s1->Visible = true;

s2->Visible = false;

Base_Car::exitTimer = true;

}

private: System::Void sstimer_Tick(System::Object^ sender,

System::EventArgs^ e) {

sstimer->Stop();

ss3->Visible = true;

ss2->Visible = false;

Base_Car::exitTimer = true;

}

private: System::Void cctimer_Tick(System::Object^ sender,

System::EventArgs^ e) {

cctimer->Stop();

ss1->Visible = true;

ss2->Visible = false;

Base_Car::exitTimer = true;

}

private: System::Void stimer_Tick(System::Object^ sender,

System::EventArgs^ e) {

stimer->Stop();

s3->Visible = true;

s2->Visible = false;

Base_Car::exitTimer = true;

}

private: System::Void timer2_Tick(System::Object^ sender,

System::EventArgs^ e) {

timer2->Stop();

Base_Car::SetX(Base_Car::GetX() + 40);

Base_Car::exitTimer = true;

}

private: System::Void timer2_3_Tick(System::Object^ sender,

System::EventArgs^ e) {

timer2_3->Stop();

Base_Car::SetX(Base_Car::GetX() + 80);

Base_Car::exitTimer = true;

}

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

timer2_2->Stop();

Base_Car::SetX(Base_Car::GetX() + 60);

Base_Car::exitTimer = true;

}

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

OutTimer->Stop();

Base_Car::SetY(Base_Car::GetY() + 80);

Base_Car::exitTimer = true;

}

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

flag = true;

if ((pictureBox12->Visible == false && pictureBox1->Visible == false) || comboBox1->SelectedIndex == -1) {

MessageBox::Show("Выберите тип машины", "Ошибка",

MessageBoxButtons::OK, MessageBoxIcon::Asterisk);

}

else {

int money = moneybar->Value;

int weight = weightbar->Value;

int height = heightbar->Value;

int park_mesto = 0;

bool e = false;

bool slujba = false;

bool result = false;

bool trigger = false;

if (comboBox1->SelectedIndex != -1) {

if (comboBox1->SelectedIndex == 0) {

Base_Car::Car = gcnew Base_Car(money, height, slujba,

weight);

}

else {

slujba = true;

Base_Car::Car = gcnew Base_Car(money, height, slujba,

weight);

}

}

Shlakhbaum_mozg^ mozg = gcnew Shlakhbaum_mozg;

Base_Car::StartPos(pictureBox12, pictureBox1);

// Метод передвижения автомобиля к шлагбауму

Base_Car::EntranceShlakbaum(timer1, pictureBox12, pictureBox1);

// Проверка, запуск. событие "Авто подъехал на стенд"

Base_Car::Check_Arrive(Base_Car::Car, result, trigger);

// если проезжает

if (result) {

park_mesto = 0;

Shlakhbaum_mozg::proverka_mest(&e, &park_mesto);

if (e == true) {

Random rnd;

int time = 1000 + rnd.Next(1000, 6000);

Shlakhbaum_mozg::otkritie(stimer, s1, s2, s3);

label3->Text = "Оплата произведена";

Shlakhbaum_mozg::da(park_mesto, timer2, timer2_2, timer2_3, pictureBox1, pictureBox12, P1_2, P1_3, P2_2, P2_3, P3_2, P3_3, P4_2, P4_3, P5_2, P5_3, P6_2, P6_3);

this->Siebtimer->Interval = time;

Siebtimer->Start();

Shlakhbaum_mozg::OTKR -= gcnew OTK(Base_Car::zaezd);

//Sieb_2->Start();

}

else {

label3->Text = "Отказано";

Shlakhbaum_mozg::Out = true;

pictureBox12->Visible = false;

pictureBox1->Visible = false;

Base_Car::StartPos(pictureBox12, pictureBox1);

if (comboBox1->SelectedIndex == 1) {

OT2->Visible = true;

OT1->Visible = false;

}

else {

OT1->Visible = true;

OT2->Visible = false;

}

Shlakhbaum_mozg::outEvent(OutTimer, OT1, OT2);

}

label3->Text = "Ожидание";

Shlakhbaum_mozg::zakritie(ctimer, s2, s3);

}

else {

label3->Text = "Отказано";

Shlakhbaum_mozg::Out = true;

pictureBox12->Visible = false;

pictureBox1->Visible = false;

Base_Car::StartPos(pictureBox12, pictureBox1);

if (comboBox1->SelectedIndex == 1) {

OT2->Visible = true;

OT1->Visible = false;

}

else {

OT1->Visible = true;

OT2->Visible = false;

}

Shlakhbaum_mozg::outEvent(OutTimer, OT1, OT2);

}

}

label3->Text = "Ожидание";

flag = false;

}

private: System::Void comboBox1_SelectedIndexChanged(System::Object^ sender,

System::EventArgs^ e) {

if (comboBox1->SelectedIndex == 0) {

pictureBox12->Visible = true;

pictureBox1->Visible = false;

}

if (comboBox1->SelectedIndex == 1) {

pictureBox12->Visible = false;

pictureBox1->Visible = true;

}

}

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

button2->Visible = false;

int park_mesto = 0;

bool res_pr = false;

Shlakhbaum_mozg::Otzed_mest(&res_pr, &park_mesto);

Shlakbaum::otkritie1(sstimer, ss1, ss2, ss3);

if (res_pr == true)

switch (park_mesto) {

case 0:

Base_Car::OutPos(pictureBox1, pictureBox12);

Base_Car::P1_Out(Arrived, pictureBox12, pictureBox1, P1_2, P1_3);

break;

case 1:

Base_Car::OutPos2(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2, pictureBox12, pictureBox1, P4_2, P4_3);

break;

case 2:

Base_Car::OutPos3(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2_2, pictureBox12, pictureBox1, P2_2, P2_3);

break;

case 3:

Base_Car::OutPos(pictureBox1, pictureBox12);

Base_Car::P1_Out(Arrived, pictureBox12, pictureBox1, P4_2, P4_3);//готово

break;

case 4:

Base_Car::OutPos2(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2_3, pictureBox12, pictureBox1, P3_2, P3_3);

break;

case 5:

Base_Car::OutPos3(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2_3, pictureBox12, pictureBox1, P6_2, P6_3);

break;

}

Shlakbaum::zakritie1(cctimer, ss2, ss3);

button2->Visible = true;

button3->Visible = false;

}

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

if (flag == true) {

label3->Text = "нет возможности";

Siebtimer->Stop();

Siebtimer->Start();

}

else {

button2->Visible = false;

label3->Text = "Ожидайте отъезда";

Siebtimer->Stop();

int park_mesto = 0;

bool res_pr = false;

Shlakhbaum_mozg::Otzed_mest(&res_pr, &park_mesto);

if (res_pr == true) {

Shlakbaum::otkritie1(sstimer, ss1, ss2, ss3);

res_pr = false;

Shlakhbaum_mozg::PPP(park_mesto, timer2,Arrived, timer2_2, timer2_3, pictureBox1, pictureBox12, P1_2, P1_3, P2_2, P2_3, P3_2, P3_3, P4_2, P4_3, P5_2, P5_3, P6_2, P6_3);

Shlakbaum::zakritie1(cctimer, ss2, ss3);

Shlakhbaum_mozg::Sieb -= gcnew SS(Base_Car::otzed);

label3->Text = "Ожидание";

button2->Visible = true;

}

}

pp1.cpp

#include "pch.h"

#include "pp1.h"

using namespace System;

namespace pp1 {

Base_Car::Base_Car(int money, int height, bool slujba, int weight) {

Money = money;

Height = height;

Slujebny = slujba;

Weight = weight;

Shlakhbaum_mozg::Move += gcnew ReadyNext(Base_Car::OutShlakbaum);

// TODO: Привязка функции-обработчика стенда к событию машины "Подъехал на стенд"

Shlakhbaum_mozg::OTKR += gcnew OTK(Base_Car::zaezd);

};

void Base_Car::otzed(int mesto, System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ Arrived, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3) {

switch (mesto) {

case 0:

Base_Car::OutPos(pictureBox1, pictureBox12);

Base_Car::P1_Out(Arrived, pictureBox12, pictureBox1, P1_2, P1_3);

break;

case 1:

Base_Car::OutPos2(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2, pictureBox12, pictureBox1, P4_2, P4_3);

break;

case 2:

Base_Car::OutPos3(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2_2, pictureBox12, pictureBox1, P2_2, P2_3);

break;

case 3:

Base_Car::OutPos(pictureBox1, pictureBox12);

Base_Car::P1_Out(Arrived, pictureBox12, pictureBox1, P4_2, P4_3);//готово

break;

case 4:

Base_Car::OutPos2(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2_3, pictureBox12, pictureBox1, P3_2, P3_3);

break;

case 5:

Base_Car::OutPos3(pictureBox1, pictureBox12);

Base_Car::P1_Out(timer2_3, pictureBox12, pictureBox1, P6_2, P6_3);

break;

}

}

void Base_Car::zaezd(int mesto,System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^P5_2 , PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3) {

switch (mesto) {

case 0:

Base_Car::P1_Park(timer2, pictureBox12, pictureBox1, P1_2, P1_3);

break;

case 1:

Base_Car::P1_Park(timer2, pictureBox12, pictureBox1, P4_2, P4_3);

break;

case 2:

Base_Car::P1_Park(timer2_2, pictureBox12, pictureBox1, P2_2, P2_3);

break;

case 3:

Base_Car::P1_Park(timer2_2, pictureBox12, pictureBox1, P5_2, P5_3);

break;

case 4:

Base_Car::P1_Park(timer2_3, pictureBox12, pictureBox1, P3_2, P3_3);

break;

case 5:

Base_Car::P1_Park(timer2_3, pictureBox12, pictureBox1, P6_2, P6_3);

break;

}

}

void Base_Car::SetMoney(int SetEngine) {

Money = SetEngine;

}

void Base_Car::SetHeight(int SetGearbox) {

Height = SetGearbox;

}

void Base_Car::SetSlujebny(bool SetSuspension) {

Slujebny = SetSuspension;

}

void Base_Car::SetWeight(int SetHeadlights) {

Weight = SetHeadlights;

}

int Base_Car::GetMoney() {

return Money;

}

int Base_Car::GetHeight() {

return Height;

}

bool Base_Car::GetSlujebny() {

return Slujebny;

}

int Base_Car::GetWeight() {

return Weight;

}

void Base_Car::SetArriveTrue() {

Base_Car::arrive_car = true;

};

void Base_Car::SetArriveFalse() {

Base_Car::arrive_car = false;

};

bool Base_Car::GetArrive() {

return Base_Car::arrive_car;

};

void Base_Car::SetX(int X) {

Base_Car::X = X;

}

int Base_Car::GetX() {

return Base_Car::X;

}

void Base_Car::SetY(int Y) {

Base_Car::Y = Y;

}

int Base_Car::GetY() {

return Base_Car::Y;

}

void Base_Car::StartPos(PictureBox^ p1, PictureBox^ p2 ) {

Base_Car::SetArriveFalse();

Base_Car::X = 60;

Base_Car::Y = 136;

p1->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

p2->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

}

//отьезд

void Base_Car::OutPos(PictureBox^ p1, PictureBox^ p2) {

Base_Car::SetArriveFalse();

Base_Car::X = 350;

Base_Car::Y = 136;

p1->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

p2->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

}

void Base_Car::OutPos2(PictureBox^ p1, PictureBox^ p2) {

Base_Car::SetArriveFalse();

Base_Car::X = 450;

Base_Car::Y = 136;

p1->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

p2->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

}

void Base_Car::OutPos3(PictureBox^ p1, PictureBox^ p2) {

Base_Car::SetArriveFalse();

Base_Car::X = 550;

Base_Car::Y = 136;

p1->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

p2->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

}

// Метод подъезда машины к шлакдауну

void Base_Car::EntranceShlakbaum(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2) {

for (int i = 0; i < 7; i++) {

timer1->Start();

while (!(Base_Car::exitTimer)) {

Application::DoEvents();

}

p1->Location = System::Drawing::Point(Base_Car::GetX(), 136);

p2->Location = System::Drawing::Point(Base_Car::GetX(), 136);

Base_Car::exitTimer = false;

}

Base_Car::arrive_car = true;

}

void Base_Car::OutShlakbaum(System::Windows::Forms::Timer^ OutTimer, PictureBox^ p1, PictureBox^ p2) {

for (int i = 0; i < 7; i++) {

OutTimer->Start();

while (!(Base_Car::exitTimer)) {

Application::DoEvents();

}

Base_Car::X = 170;

p1->Location = System::Drawing::Point(Base_Car::X, GetY());

p2->Location = System::Drawing::Point(Base_Car::X, GetY());

Base_Car::exitTimer = false;

}

Base_Car::OutStartPos(p1, p2);

}

//Парковка

void Base_Car::P1_Park(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2, PictureBox^ t1, PictureBox^ t2) {

for (int i = 0; i < 7; i++) {

timer1->Start();

while (!(Base_Car::exitTimer)) {

Application::DoEvents();

}

p1->Location = System::Drawing::Point(Base_Car::GetX(), 136);

p2->Location = System::Drawing::Point(Base_Car::GetX(), 136);

Base_Car::exitTimer = false;

}

if (p1->Visible == true) {

p1->Visible = false;

p2->Visible = false;

t1->Visible = true;

}

else {

p1->Visible = false;

p2->Visible = false;

t2->Visible = true;

}

Base_Car::StartPos(p1, p2);

}

void Base_Car::P1_Out(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2, PictureBox^ t1, PictureBox^ t2) {

if (t1->Visible == true) {

t1->Visible = false;

p1->Visible = true;

p2->Visible = false;

}

else {

t2->Visible = false;

p1->Visible = false;

p2->Visible = true;

}

for (int i = 0; i < 7; i++) {

timer1->Start();

while (!(Base_Car::exitTimer)) {

Application::DoEvents();

}

p1->Location = System::Drawing::Point(Base_Car::GetX(), 136);

p2->Location = System::Drawing::Point(Base_Car::GetX(), 136);

Base_Car::exitTimer = false;

}

Base_Car::StartPos(p1, p2);

}

void Base_Car::OutStartPos(PictureBox^ p1, PictureBox^ p2) {

p1->Visible = false;

p2->Visible = false;

Base_Car::X = 170;

Base_Car::Y = 136;

p1->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

p2->Location = System::Drawing::Point(Base_Car::X, Base_Car::Y);

}

// Метод проверки, порождающий событие "автомобиль подъехал"

void Base_Car::Check_Arrive(Object^ obj, bool& result, bool& trigger) {

if (Base_Car::arrive_car)

Base_Car::ArrivedBarrier(obj, result, trigger);

};

void Shlakhbaum_mozg::otkritie(System::Windows::Forms::Timer^ stimer, PictureBox^ s1, PictureBox^ s2, PictureBox^ s3) {

s2->Visible = true;

s1->Visible = false;

stimer->Start();

}

void Shlakhbaum_mozg::zakritie(System::Windows::Forms::Timer^ stimer, PictureBox^ s2, PictureBox^ s3) {

s2->Visible = true;

s3->Visible = false;

stimer->Start();

}

Shlakbaum::Shlakbaum() {

};

void Shlakhbaum_mozg::outEvent(System::Windows::Forms::Timer^ OutTimer, PictureBox^ p1, PictureBox^ p2) {

if (Shlakhbaum_mozg::Out)

Shlakhbaum_mozg::Move(OutTimer, p1, p2);

};

Shlakhbaum_mozg::Shlakhbaum_mozg() {

Base_Car::ArrivedBarrier += gcnew Arrived(Shlakhbaum_mozg::proverka);

};

void Shlakhbaum_mozg::proverka(Object^ obj, bool& result, bool& trigger) {

Base_Car^ car = (Base_Car^)obj;

int Slujebny = car->GetSlujebny();

if (Slujebny == 1)

trigger = 1;

int Money = car->GetMoney();

int Height = car->GetHeight();

int Weight = car->GetWeight();

bool H = (Height <= 60);

bool W = (Weight <= 60);

result = (Money > 65 && H < 70 && W < 90);

};

void Shlakhbaum_mozg::proverka_mest(bool* resuly_p ,int* number){

for (int i = 0; i < 6;i++ )

if (mas[i] == 0) {

mas[i] = 1;

*resuly_p = true;

*number = i;

break;

}

}

void Shlakhbaum_mozg::da(int i,System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3) {

Shlakhbaum_mozg::OTKR(i, timer2, timer2_2, timer2_3, pictureBox1, pictureBox12, P1_2, P1_3, P2_2, P2_3, P3_2, P3_3, P4_2, P4_3, P5_2, P5_3, P6_2, P6_3);

}

void Shlakhbaum_mozg::PPP(int i, System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ Arrived, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3) {

Shlakhbaum_mozg::Sieb += gcnew SS(Base_Car::otzed);

Shlakhbaum_mozg::Sieb(i, timer2,Arrived, timer2_2, timer2_3, pictureBox1, pictureBox12, P1_2, P1_3, P2_2, P2_3, P3_2, P3_3, P4_2, P4_3, P5_2, P5_3, P6_2, P6_3);

}

void Shlakhbaum_mozg::Otzed_mest(bool* resuly_p, int* number) {

for (int i = 0; i < 6; i++)

if (mas[i] == 1) {

mas[i] = 0;

*resuly_p = true;

*number = i;

break;

}

}

void Shlakhbaum_mozg::SetArrivedTrue_Stand() {

arrive_car = true;

}

void Shlakhbaum_mozg::SetArrivedFalse_Stand() {

arrive_car = false;

}

bool Shlakhbaum_mozg::GetArrive() {

return Shlakhbaum_mozg::arrive_car;

};

void Shlakbaum::otkritie1(System::Windows::Forms::Timer^ stimer, PictureBox^ s1, PictureBox^ s2, PictureBox^ s3) {

s2->Visible = true;

s1->Visible = false;

stimer->Start();

}

void Shlakbaum::zakritie1(System::Windows::Forms::Timer^ stimer, PictureBox^ s2, PictureBox^ s3) {

s2->Visible = true;

s3->Visible = false;

stimer->Start();

}

Pp1.h

#pragma once

using namespace System;

#include <iostream>

#include <cmath>

#include <functional>

namespace pp1 {

using namespace System;

using namespace System::Windows::Forms;

using namespace System::Drawing;

using namespace System::Threading;

//static bool exitTimer = false;

// Делегат для события "автомобиль подъехал на стенд"

public delegate void Arrived(Object^ obj, bool& result, bool& trigger);

public ref class Base_Car {

private:

static int X = 60;

static int Y = 136;

int Money;

int Height;

bool Slujebny;

int Weight;

static bool arrive_car = false;

public:

Base_Car(int money, int height, bool slujba, int weight);

// Событие - "автомобиль подъехал"

static event Arrived^ ArrivedBarrier;

void SetMoney(int Set);

void SetHeight(int Set);

void SetSlujebny(bool Set);

void SetWeight(int Set);

int GetMoney();

int GetHeight();

bool GetSlujebny();

int GetWeight();

static void SetArriveTrue();

static void SetArriveFalse();

static bool GetArrive();

static void SetY(int Y);

static void SetX(int X);

static int GetX();

static int GetY();

static void EntranceShlakbaum(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2);

static void OutShlakbaum(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2);

static void StartPos(PictureBox^ p1, PictureBox^ p2);

static void OutStartPos(PictureBox^ p1, PictureBox^ p2);

static void zaezd(int mesto,System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ p1, PictureBox^ p2, PictureBox^ p3, PictureBox^ p4, PictureBox^ p5, PictureBox^ p6, PictureBox^ p7, PictureBox^ p8, PictureBox^ p9, PictureBox^ p10, PictureBox^ p11, PictureBox^ p12, PictureBox^ p13, PictureBox^ p14);

static void otzed(int mesto, System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ Arrived, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ p1, PictureBox^ p2, PictureBox^ p3, PictureBox^ p4, PictureBox^ p5, PictureBox^ p6, PictureBox^ p7, PictureBox^ p8, PictureBox^ p9, PictureBox^ p10, PictureBox^ p11, PictureBox^ p12, PictureBox^ p13, PictureBox^ p14);

static void OutPos(PictureBox^ p1, PictureBox^ p2);

static void OutPos2(PictureBox^ p1, PictureBox^ p2);

static void OutPos3(PictureBox^ p1, PictureBox^ p2);

static void P1_Park(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2, PictureBox^ t1, PictureBox^ t2);

static void P1_Out(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2, PictureBox^ t1, PictureBox^ t2);

// Метод проверки запускающий событие "автомобиль подъехал"

static void Check_Arrive(Object^ obj, bool& result, bool& trigger);

static bool exitTimer = false;

static System::Object^ Car;

};

public ref class Shlakbaum {

private:

static int X = 324;

static int Y = 383;

public:

Shlakbaum();

static void otkritie1(System::Windows::Forms::Timer^ stimer, PictureBox^ s1, PictureBox^ s2, PictureBox^ s3);

static void zakritie1(System::Windows::Forms::Timer^ stimer, PictureBox^ s1, PictureBox^ s2);

};

public delegate void SS(int mesto, System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ Arrived, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3);

public delegate void OTK(int mesto, System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3);

public delegate void ReadyNext(System::Windows::Forms::Timer^ timer1, PictureBox^ p1, PictureBox^ p2);

static int mas[6] = { 0, 0, 0, 0, 0, 0 };

public delegate void proverka1(Object^ obj, bool& result, bool& trigger, bool& H, bool& W);

public ref class Shlakhbaum_mozg : public Shlakbaum {

private:

static int X = 324;

static int Y = 167;

static bool arrive_car = false;

public:

static void otkritie(System::Windows::Forms::Timer^ stimer, PictureBox^ s1, PictureBox^ s2, PictureBox^ s3);

static void zakritie(System::Windows::Forms::Timer^ stimer, PictureBox^ s1, PictureBox^ s2);

static bool Out = false;

static void outEvent(System::Windows::Forms::Timer^ OutTimer, PictureBox^ p1, PictureBox^ p2);

Shlakhbaum_mozg();

// Метод проверки автомобиля

static void proverka(Object^ obj, bool& result, bool& trigger);

static void da(int i,System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3);

static void PPP(int i, System::Windows::Forms::Timer^ timer2, System::Windows::Forms::Timer^ Arrived, System::Windows::Forms::Timer^ timer2_2, System::Windows::Forms::Timer^ timer2_3, PictureBox^ pictureBox1, PictureBox^ pictureBox12, PictureBox^ P1_2, PictureBox^ P1_3, PictureBox^ P2_2, PictureBox^ P2_3, PictureBox^ P3_2, PictureBox^ P3_3, PictureBox^ P4_2, PictureBox^ P4_3, PictureBox^ P5_2, PictureBox^ P5_3, PictureBox^ P6_2, PictureBox^ P6_3);

static void proverka_mest(bool* resuly_p, int* number);

static void Otzed_mest(bool* resuly_p, int* number);

static void SetArrivedTrue_Stand();

static void SetArrivedFalse_Stand();

static bool exitTimer = false;

static bool GetArrive();

// Событие, что автомобиль начал движение далее

static event ReadyNext^ Move;

static event OTK^ OTKR;

static event SS^ Sieb;

};

Соседние файлы в папке Шлагбаум