Приложение Г (1094787), страница 2
Текст из файла (страница 2)
//-------------
Form4->Label6->Visible=false; Form4->Edit6->Visible=false;
Form4->Label7->Visible=false; Form4->Edit7->Visible=false;
if (CheckBox3->Checked){
try
{
e3=StrToInt(Edit3->Text);
if (e3==1) {Form4->Label6->Enabled=true; Form4->Edit6->Enabled=true;
Form4->Label6->Visible=true; Form4->Edit6->Visible=true;}
if (e3==2) {Form4->Label6->Enabled=true; Form4->Edit6->Enabled=true;
Form4->Label6->Visible=true; Form4->Edit6->Visible=true;
Form4->Label7->Enabled=true; Form4->Edit7->Enabled=true;
Form4->Label7->Visible=true; Form4->Edit7->Visible=true;}
Form4->Visible=true;
Form3->Visible=false;
}
catch(EConvertError&)
{
Application->MessageBox("Вы ввели ошибочное число, повторите ввод",MB_OK);
} }
//--------------
Form4->Edit8->Visible=false;
if (CheckBox6->Checked){
Form4->Edit8->Visible=true;
Form4->Edit8->Enabled=true;
Form4->Visible=true;
}
//-------------
if (CheckBox4->Checked){
Form3->Visible=false;
Form4->Visible=true;
}
//----------------
Form4->Label8->Visible=false; Form4->Edit9->Visible=false;
Form4->Label9->Visible=false; Form4->Edit10->Visible=false;
if (CheckBox8->Checked){
try
{
e5=StrToInt(Edit5->Text);
if (e5==1) {Form4->Label8->Enabled=true; Form4->Edit9->Enabled=true;
Form4->Label8->Visible=true; Form4->Edit9->Visible=true;}
if (e5==2) {Form4->Label8->Enabled=true; Form4->Edit9->Enabled=true;
Form4->Label8->Visible=true; Form4->Edit9->Visible=true;
Form4->Label9->Enabled=true; Form4->Edit10->Enabled=true;
Form4->Label9->Visible=true; Form4->Edit10->Visible=true;}
Form4->Visible=true;
Form3->Visible=false;
}
catch(EConvertError&)
{
Application->MessageBox("Вы ввели ошибочное число, повторите ввод",MB_OK);
} }
//--------------
Form4->Label10->Visible=false; Form4->Edit11->Visible=false;
if (CheckBox8->Checked){
try
{
e6=StrToInt(Edit6->Text);
if (e6==1) {Form4->Label10->Enabled=true; Form4->Edit11->Enabled=true;
Form4->Label10->Visible=true; Form4->Edit11->Visible=true;}
Form4->Visible=true;
Form3->Visible=false;
}
catch(EConvertError&)
{
Application->MessageBox("Вы ввели ошибочное число, повторите ввод",MB_OK);
} }
//-------------
if (CheckBox9->Checked){
try
{
e7=StrToInt(Edit7->Text);
Form4->Visible=true;
Form3->Visible=false;
}
catch(EConvertError&)
{
Application->MessageBox("Вы ввели ошибочное число, повторите ввод",MB_OK);
} }
//--------------------
if (CheckBox9->Checked){
try
{
e8=StrToInt(Edit8->Text);
Form4->Visible=true;
Form3->Visible=false;
}
catch(EConvertError&)
{
Application->MessageBox("Вы ввели ошибочное число, повторите ввод",MB_OK);
} }
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef Unit3H
#define Unit3H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm3 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMenuItem *N1;
TGroupBox *GroupBox1;
TEdit *Edit1;
TEdit *Edit2;
TEdit *Edit3;
TCheckBox *CheckBox1;
TCheckBox *CheckBox2;
TCheckBox *CheckBox3;
TCheckBox *CheckBox4;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
TCheckBox *CheckBox5;
TEdit *Edit4;
TLabel *Label4;
TCheckBox *CheckBox6;
TCheckBox *CheckBox7;
TCheckBox *CheckBox8;
TCheckBox *CheckBox9;
TEdit *Edit5;
TLabel *Label5;
TEdit *Edit6;
TLabel *Label6;
TEdit *Edit7;
TLabel *Label7;
TEdit *Edit8;
TLabel *Label8;
TPanel *Panel1;
TBitBtn *BitBtn1;
TMenuItem *N2;
TMenuItem *N3;
TMenuItem *N4;
TMenuItem *N5;
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall CheckBox1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox1MouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox2MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox2MouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox3MouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox3MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox5MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox5MouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox8MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox8MouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox9MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall CheckBox9MouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall N5Click(TObject *Sender);
void __fastcall BitBtn1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm3(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm3 *Form3;
//---------------------------------------------------------------------------
#endif
модуль 4
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit3.h"
#include "Unit4.h"
#include "Unit5.h"
#include "math.h"
#include "Math.hpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
double R,tso11,tso1_2,tso1_3;
double tso2_1,tso2_2,tso3_1,tso3_2;
double v_ip,o_d1,o_d2,d_d1;
double P;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm4::BitBtn1Click(TObject *Sender)
{
tso11=StrToFloat(Edit1->Text);
tso1_2=StrToFloat(Edit2->Text);
tso1_3=StrToFloat(Edit3->Text);
tso2_1=StrToFloat(Edit4->Text);
tso2_2=StrToFloat(Edit5->Text);
tso3_1=StrToFloat(Edit6->Text);
tso3_2=StrToFloat(Edit7->Text);
v_ip=StrToFloat(Edit8->Text);
o_d1=StrToFloat(Edit9->Text);
o_d2=StrToFloat(Edit10->Text);
d_d1=StrToFloat(Edit11->Text);
//----------------------------------------------------------------------------
P=tso11*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*o_d1*o_d2*d_d1+
(1-tso11)*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*o_d1*o_d2*d_d1+
tso11*(1-tso1_2)*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*o_d1*o_d2*d_d1+
tso11*tso1_2*(1-tso1_3)*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*o_d1*o_d2*d_d1+
tso11*tso1_2*tso1_3*(1-tso2_1)*tso2_2*tso3_1*tso3_2*v_ip*o_d1*o_d2*d_d1+
tso11*tso1_2*tso1_3*tso2_1*(1-tso2_2)*tso3_1*tso3_2*v_ip*o_d1*o_d2*d_d1+
tso11*tso1_2*tso1_3*tso2_1*tso2_2*(1-tso3_1)*tso3_2*v_ip*o_d1*o_d2*d_d1+
tso11*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*(1-tso3_2)*v_ip*o_d1*o_d2*d_d1+
tso11*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*(1-v_ip)*o_d1*o_d2*d_d1+
tso11*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*(1-o_d1)*o_d2*d_d1+
tso11*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*o_d1*(1-o_d2)*d_d1+
tso11*tso1_2*tso1_3*tso2_1*tso2_2*tso3_1*tso3_2*v_ip*o_d1*o_d2*(1-d_d1)+
(1-tso11)*(1-tso1_2)*(1-tso1_3)*(1-tso2_1)*(1-tso2_2)*(1-tso3_1)*(1-tso3_2)*(1-v_ip)*(1-o_d1)*(1-o_d2)*(1-d_d1);
Form5->Series1->Clear();
Form5->RichEdit1->Lines->Clear();
Form5->RichEdit1->Lines->Add("Надежность функционирования АСО объекта повышенной защищенности составляет:"+FloatToStr(P));
Form5->Series1->Add(P,"",clBlue);
Form5->Visible=true;
Form4->Visible=false;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef Unit4H
#define Unit4H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
//---------------------------------------------------------------------------
class TForm4 : public TForm
{
__published: // IDE-managed Components
TGroupBox *GroupBox1;
TGroupBox *GroupBox2;
TGroupBox *GroupBox3;
TGroupBox *GroupBox4;
TGroupBox *GroupBox5;
TGroupBox *GroupBox6;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
TEdit *Edit1;
TEdit *Edit2;
TEdit *Edit3;
TLabel *Label4;
TLabel *Label5;
TEdit *Edit4;
TEdit *Edit5;
TLabel *Label6;
TLabel *Label7;
TEdit *Edit6;
TEdit *Edit7;
TEdit *Edit8;
TLabel *Label8;
TEdit *Edit9;
TLabel *Label9;
TEdit *Edit10;
TEdit *Edit11;
TBitBtn *BitBtn1;
TLabel *Label10;
void __fastcall BitBtn1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm4(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm4 *Form4;
//---------------------------------------------------------------------------
#endif
модуль 5
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit4.h"
#include "Unit5.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm5 *Form5;
//---------------------------------------------------------------------------
__fastcall TForm5::TForm5(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm5::FormClose(TObject *Sender, TCloseAction &Action)
{
Form5->Visible=false;
Form4->Visible=true;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef Unit5H
#define Unit5H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Chart.hpp>
#include <ExtCtrls.hpp>
#include <TeEngine.hpp>
#include <TeeProcs.hpp>
#include <Series.hpp>
//---------------------------------------------------------------------------
class TForm5 : public TForm
{
__published: // IDE-managed Components
TChart *Chart1;
TRichEdit *RichEdit1;
TBarSeries *Series1;
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private: // User declarations
public: // User declarations
__fastcall TForm5(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm5 *Form5;
//---------------------------------------------------------------------------
#endif