Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

кандидатская

.pdf
Скачиваний:
17
Добавлен:
18.03.2015
Размер:
4.71 Mб
Скачать

this->buttonl = (gcnew System::Windows::Forms::Button()); this->groupBoxl = (gcnew

System::Windows: :Forms: :GroupBox()); this->radioButton8 = (gcnew

System::Windows::Forms::RadioButton()); this->radioButton7 = (gcnew

System::Windows: :Forms::RadioButton()); this->radioButton6 = (gcnew

System::Windows: :Forms: :RadioButton()); this->radioButton5 = (gcnew

System::Windows::Forms::RadioButton()); this->radioButton4 = (gcnew

System::Windows: :Forms: :RadioButton()); this->radioButton3 = (gcnew

System::Windows: :Forms: :RadioButton());

this->label2 = (gcnew System::Windows::Forms::Label()); this->label3 = (gcnew System::Windows::Forms::Label()); this->label4 = (gcnew System::Windows::Forms::Label()); this->label5 = (gcnew System::Windows::Forms::Label()); this->label6 = (gcnew System: :Windows::Forms::Label()); this->label8 = (gcnew System:.'Windows::Forms::Label()); this->labe!7 = (gcnew System::Windows::Forms::Label()); this->label9 = (gcnew System::Windows::Forms::Label()); this->labellO = (gcnew System::Windows::Forms::Label()); this->labell 1 = (gcnew System::Windows::Forms::Label()); this->labell2 = (gcnew System::Windows::Forms::Label()); this->serialPortl = (gcnew System: :IO::Ports::SerialPort(this-

>components));

this->timerl = (gcnew System::Windows::Forms::Timer(this-

>components));

this->panell = (gcnew System::Windows::Forms::Panel()); this->button2 = (gcnew System::Windows::Forms::Button()); (cli: :safe_cast<System: :ComponentModel: :ISupportInitializeA

>(this->numericUpDown 1))->BeginInit(); this->groupBoxl->SuspendLayout(); this->SuspendLayout();

//

// radioButtonl

//

this->radioButtonl->AutoSize = trae; this->radioButtonl->Location = System: :Drawing::Point(680,

68);

this->radioButtonl->Name = U'radioButtonl"; this->radioButtonl->Size = System: .-Drawing: :Size(246, 18); this->radioButtonl->TabIndex = 0;

151

this->radioButtonl->TabStop = true; this->radioButtonl->Text = Ь"Применить цифровую

фильтрацию данных";

this->radioButtonl->UseVisualStyleBackColor = true;

//

// radioButton2

//

this->radioButton2->AutoSize = true; this->radioButton2->Checked = true; this->radioButton2->Location = System: :Drawing::Point(680,

44);

this->radioButton2->Name = L"radioButton2"; this->radioButton2->Size = System: :Drawing::Size(261, 18); this->radioButton2->TabIndex = 1; this->radioButton2->TabStop = true; this->radioButton2->Text = L"He применять цифровую

фильтрацию данных";

this->radioButton2->UseVisualStyleBackColor = true;

//

// numericUpDownl

//

this->numericUpDownl->Location = System: :Drawing::Point(852, 93);

this->numericUpDownl->Name = L"numericUpDownl"; this->numericUpDownl->Size = System: :Drawing::Size(65,

20);

this->numericUpDownl->TabIndex = 2; this->numericUpDownl->Value = System: :Decimal(gcnew

cli::array< System::Int32 >(4) {1, 0, 0, 0});

//

//labell

//

this->labell->AutoSize = true;

this->labell->Location = System: .-Drawing: :Point(698, 97); this->labell->Name = L"labell";

this->labell->Size = System::Drawing::Size(135, 14); this->labell->TabIndex = 3;

this->labell->Text = Ь'Тазмер окна фильтра Y'NY'";

//

//button1

//

this->buttonl->Location = System: :Drawing::Point(680, 145); this->buttonl->Name = L"buttonl";

this->buttonl->Size = System: :Drawing::Size(509, 23); this->buttonl->Tab!ndex = 4;

152

this->buttonl->Text = L"Активизировать систему контроля и регистрации параметров геомагнитных возмущений";

this->buttonl->UseVisualStyleBackColor = true; this->buttonl->Click += gcnew System: :EventHandler(this,

&Form 1::button l_Click);

//

// groupBoxl

//

this->groupBoxl->Controls->Add(this->radioButton8); this->groupBoxl->Controls->Add(this->radioButton7); this->groupBoxl->Controls->Add(this->radioButton6); this->groupBoxl->Controls->Add(this->radioButton5); this->groupBoxl->Controls->Add(this->radioButton4); this->groupBoxl->Controls->Add(this->radioButton3); this->groupBoxl->Location = System: :Drawing::Point(984,

25);

this->groupBoxl->Name = L"groupBoxl"; this->groupBoxl->Size = System::Drawing::Size(205, 102); this->groupBoxl->TabIndex = 5; this->groupBoxl->TabStop = false;

this->groupBoxl->Text = Ь"Частота регистрации данных";

//

// radioButton8

//

this->radioButton8->AutoSize = true; this->radioButton8->Location = System: .-Drawing: :Point( 106,

67);

this->radioButton8->Name = L"radioButton8"; this->radioButton8->Size = System::Drawing::Size(72, 18); this->radioButton8->TabIndex = 5; this->radioButton8->TabStop = true; this->radioButton8->Text = L"30 минут"; this->radioButton8->UseVisualStyleBackColor = true;

//

// radioButton7

//

this->radioButton7->AutoSize = true; this->radioButton7->Location = System: :Drawing::Point( 106,

43);

this->radioButton7->Name = L"radioButton7"; this->radioButton7->Size = System: :Drawing::Size(72, 18); this->radioButton7->TabIndex = 4; this->radioButton7->TabStop = true; this->radioButton7->Text = L"10 минут"; this->radioButton7->UseVisualStyleBackColor = true;

153

//

// radioButton6

//

this->radioButton6->AutoSize = true; this->radioButton6->Location = System: :Drawing::Point( 106,

this->radioButton6->Name = L"radioButton6"; this->radioButton6->Size = System: .-Drawing: :Size(72, 18); this->radioButton6->TabIndex = 3; this->radioButton6->TabStop = true; this->radioButton6->Text = L"l минута"; this->radioButton6->UseVisualStyleBackColor = true;

//

// radioButton5

//

this->radioButton5->AutoSize = true; this->radioButton5->Location = System::Drawing::Point(15,

this->radioButton5->Name = L"radioButton5"; this->radioButton5->Size = System: :Drawing::Size(75, 18); this->radioButton5->TabIndex = 2; this->radioButton5->TabStop = true; this->radioButton5->Text = L"30 секунд"; this->radioButton5->UseVisualStyleBackColor = true;

//

// radioButton4

//

this->radioButton4->AutoSize = true; this->radioButton4->Location = System: :Drawing::Point( 15,

this->radioButton4->Name = L"radioButton4"; this->radioButton4->Size = System: :Drawing::Size(75, 18); this->radioButton4->TabIndex = 1; this->radioButton4->TabStop = true; this->radioButton4->Text = L"10 секунд"; this->radioButton4->UseVisualStyleBackColor = true;

//

// radioButton3

//

this->radioButton3->AutoSize = true; this->radioButton3->Checked = true; this->radioButton3->Location = System: :Drawing::Point( 15,

this->radioButton3->Name = L"radioButton3"; this->radioButton3->Size = System::Drawing::Size(75, 18);

154

this->radioButton3->TabIndex = 0; this->radioButton3->TabStop = true; this->radioButton3->Text = L"l секунда"; this->radioButton3->UseVisualStyleBackColor = true;

//

//label2

//

this->label2->AutoSize = true; this->label2->ForeColor =

System: :Drawing: :SystemColors: :HotTrack;

this->label2->Location = System::Drawing::Point( 104, 44); this->label2->Name = L"label2";

this->label2->Size = System::Drawing::Size(0, 14); this->label2->TabIndex = 7;

//

//label3

//

this->label3->AutoSize = true; this->label3->ForeColor =

System::Drawing::SystemColors::HotTrack;

this->label3->Location = System::Drawing::Point( 149, 25); this->label3->Name = L"label3";

this->label3->Size = System: :Drawing::Size(211, 14); this->label3->TabIndex = 8;

this->label3->Text = Ь"Федеральное агенство по

образованию";

//

//label4

//

this->label4->AutoSize = true; this->label4->ForeColor =

System: :Drawing: :SystemColors: :HotTrack;

this->label4->Location = System::Drawing::Point(33, 48); this->label4->Name = L"label4";

this->label4->Size = System::Drawing::Size(483, 14); this->label4->TabIndex = 9;

this->label4->Text = Ь'ТОУ ВПО УФИМСКИЙ ГОСУДАРСТВЕННЫЙ АВИАЦИОННЫЙ ТЕХНИЧЕСКИЙ УНИВЕРСИТЕТ";

//

//1аЬе15

//

this->label5->AutoSize = true; this->label5->ForeColor =

System: :Drawing: :SystemColors::HotTrack;

155

this->label5->Location = System: :Drawing::Point(309, 73); this->label5->Name = L"label5";

this->label5->Size = System: :Drawing::Size(207, 14); this->label5->TabIndex = 10;

this->label5->Text = Ь"кафедра У'Промышленная

электроника\"";

//

// label6

//

this->label6->AutoSize = trae;

this->label6->Font = (gcnew System:.-Drawing::Font(L"Arial", 9.75F, System::Drawing::FontStyle::Bold, System: :Drawing::GraphicsUnit::Point,

static_cast<System::Byte>(204))); this->label6->ForeColor =

System::Drawing::SystemColors::HotTrack;

this->label6->Location = System::Drawing::Point(33, 97); this->label6->Name = L"label6";

this->label6->Size = System: :Drawing::Size(490, 16); this->label6->TabIndex =11;

this->label6->Text = Ь"Система контроля и регистрации параметров геомагнитных возмущений";

//

// 1аЬе18

//

this->label8->AutoSize = true;

this->labe!8->Location = System: :Drawing::Point(33, 520); this->label8->Name = L"label8";

this->label8->Size = System: :Drawing::Size(368, 14); this->label8->TabIndex = 13;

this->label8->Text = ^Разработчик: Воробьев А. В. Научный руководитель Миловзоров Г.В.";

//

// label7

//

this->label7->AutoSize = true;

this->label7->Location = System::Drawing::Point(33, 129); this->label7->Name = L"label7";

this->label7->Size = System: :Drawing::Size(252, 14); this->label7->TabIndex = 14;

this->label7->Text = Ь"Текущее значение вектора магнитной

индукции";

//

// label9

//

this->label9->AutoSize = true;

}56

this->label9->Location = System::Drawing::Point(130, 154); this->label9->Name = L"label9";

this->label9->Size = System::Drawing::Size( 155, 14); this->label9->TabIndex = 15;

this->label9->Text = Ь'Текущее значение К-индекса";

//

//label 10

//

this->labellO->AutoSize = true;

this->labellO->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System: :Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

static_cast<System::Byte>(204))); this->labellO->Location = System: :Drawing::Point(291, 126); this->labellO->Name = L"labell0";

this->labellO->Size = System: :Drawing::Size( 16, 18); this->labellO->TabIndex= 16;

this->labellO->Text = L"0H;

//

//labelll

//

this->labell l->AutoSize = true;

this->labelll->Location = System::Drawing::Point(335, 129); this->labell l->Name = L"labell 1";

this->labell l->Size = System: :Drawing::Size(25, 14); this->labell l->TabIndex = 17;

this->labell l->Text = Ь"нТл";

//

// labell2

//

this->labell2->AutoSize = true;

this->labell2->Font = (gcnew System:.'Drawing::Font(L"Arial", 11.25F, System: :Drawing::FontStyle::Bold,

System: :Drawing: :GraphicsUnit: :Point, static_cast<System::Byte>(204)));

this->labell2->Location = System: :Drawing::Point(291, 154); this->labell2->Name = L"labell2";

this->labell2->Size = System::Drawing::Size(16, 18); this->labell2->TabIndex= 18;

this->labell2->Text = L"0";

//

// serialPortl

//

this->serialPortl->BaudRate = 2400; this->serialPortl->PortName = L"COM5";

157

//

//panel1

//

this->panell->AutoScroll = true; this->panell->BorderStyle =

System:: Windows: :Forms: :BorderStyle: :Fixed3D;

this->panell->Location = System::Drawing::Point(36, 223); this->panell->Name = L"panell";

this->panell->Size = System::Drawing::Size(l 153, 281); this->panell->TabIndex = 19;

//

// button2

//

this->button2->Location == System: :Drawing::Point(l 097, 183); this->button2->Name = L"button2";

this->button2->Size = System::Drawing::Size(92, 25); this->button2->TabIndex = 20;

this->button2->Text = Ь"Стоп"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System: :EventHandler(this,

&Form 1: :button2_Click);

//

//Forml

//

this->AutoScaleDimensions = System: :Drawing::SizeF(6, 14); this->AutoScaleMode =

System:: Windows::Forms::AutoScaleMode::Font; this->AutoScroll = true;

this->BackColor = System: :Drawing::Color::LightGray;

this->ClientSize = System::Drawing::Size(1220, 543); this->Controls->Add(th: s->button2);

this->Controls->Add(th s->panel 1); this->Controls->Add(th s->labell2); this->Controls->Add(th s->labelll); this->Controls->Add(th s->labell0); this->Controls->Add(th s->label9); this->Controls->Add(th s->label7); this->Controls->Add(th s->label8); this->Controls->Add(th s->labe!6); this->Controls->Add(th s->label5); this->Controls->Add(th s->label4); this->Controls->Add(th s->label3); this->Controls->Add(th: s->label2); this->Controls->Add(th s->groupBoxl); this->Controls->Add(th s->buttonl);

158

this->Controls->Add(this->label 1); this->Controls->Add(this->numericUpDownl); this->Controls->Add(this->radioButton2); this->Controls->Add(this->radioButton 1);

this->Font = (gcnew System: :Drawing::Font(L"Arial", 8.25F, System: :Drawing: :FontStyle: :Regular, System::Drawing: :GraphicsUnit::Point,

static_cast<System::Byte>(204))); this->FormBorderStyle =

System::Windows::Foirns::FormBorderStyle::FixedSingle; this->Name = L"Forml";

this->Text = Ь"Система контроля и регистрации параметров геомагнитных возмущений";

(cli: :safe_cast<System: :ComponentModel: :ISupportInitializeA >(this->numericUpDown 1 ))->EndInit();

this->groupBoxl->ResumeLayout(false); this->groupBox 1 ->PerformLayout(); this->ResumeLayout(false); this->PerformLayout();

this->serialPortl ->Open();

}

#pragma endregion

private: System::Void buttonl_CHck(System::ObjectA sender, System"EventArgsA e) {

A:Color Acol=gcnew Color();

Pen Apen=gcnew Pen (col->Red);

Graphics Aim=this->panel 1->CreateGraphics(); im->Clear(col->LightGray);

float y2,yl ,xl,x2,Xdata[100],sigma,N,Ydata[100]; xl=0;yl=0;

x2=xl;

int c=0; while (c<12){

for(intj=0;j<100;j++)

{

Xdata[j]=serialPortl ->ReadByte(); x2+=l;

this->timer 1 ->Enabled; this->timerl->Start(); this->timer 1 ->Stop();}

N=3;

sigma=0;

159

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

{

for (int n=0; n<(2*N+l);n++)

{

sigma=sigma+Xdata[n+i];

}

sigma=sigma/(2*N+1);

Ydata[i]=sigma;

sigma=0;

}

for(inti=0;i<100;i++)

{y2=Ydata[i];>

im->DrawLine(pen,x 1 ,y 1 ,x2,y2); xl=x2; yl=y2;

C++;

}

goto A;

}

private: System::Void button2_Click(System::ObjectA sender, System: :EventArgsA e) {

this->serialPortl ->Close();

}

}

}

160