Tyumen sanoat universiteti


Download 1.14 Mb.
bet20/21
Sana16.12.2020
Hajmi1.14 Mb.
#168750
1   ...   13   14   15   16   17   18   19   20   21
Bog'liq
Tarjimasi


168

// ------------------------------------------------ ---------------------------

void __fastcall TForm1 :: ToolButton1MouseMove (TObject * Sender,

TShiftState Shift, int X, int Y)

{

StatusBar1-> SimpleText = GetLongHint (ToolButton1-> Hint);



}

/ * elementlarning massa koeffitsientlari bilan ishlash shakli * /

# kiritilgan

#pragma hdrstop

# "Unit1.h" ni o'z ichiga oladi

# "Unit2.h" ni o'z ichiga oladi

# "Unit3.h" ni kiriting

# "Unit4.h" ni o'z ichiga oladi

// ------------------------------------------------ ---------------------------

#pragma to'plami (smart_init)

#pragma manbai "* .dfm"

TForm4 * Form4;

// ------------------------------------------------ ---------------------------

__fastcall TForm4 :: TForm4 (TComponent * egasi)

: TForm (Egasi)

{

}



/ * barcha massa assimilyatsiya koeffitsientlari va nurlanish manbalarini tanlash bo'yicha so'rov

niya


void __fastcall TForm4 :: DBGrid1CellClick (TColumn * ustun)

{

ADOQuery1-> Close ();



ADOQuery1-> SQL-> Clear ();

ADOQuery1-> SQL-> Qo'shish ("SELECT source.Name, source.E0, mu.mu");

ADOQuery1-> SQL-> Add ("INFER JOIN manbasidan FROM (elementlar INNER JOIN mu ON el-

ements.ID_element = mu.ID_element) ON source.ID_source = mu.ID_source ");

ADOQuery1-> SQL-> Qo'shish ("QAYERDA (elements.Name = '" + ADOTable1-

> FieldByName ("Ism") -> AsString + "');");

ADOQuery1-> Open ();

}

/ * Ommaviy assimilyatsiya koeffitsientini qo'shing * /



void __fastcall TForm4 :: Button1Click (TObject * Sender)

{

int id_source, id_element;



id_source = ADOTable2-> FieldByName ("ID_source") -> AsInteger;

id_element = ADOTable1-> FieldByName ("ID_element") -> AsInteger;

ADOQuery2-> Active = false;

ADOQuery2-> SQL-> Clear ();

ADOQuery2-> SQL-> Add ("INSERT INTO mu (ID_source, ID_element, mu)");

ADOQuery2-> SQL-> Qo'shish ("VALUES

("+ IntToStr (id_source) +", "+ IntToStr (id_element) +", "+ Edit1-> Text +"); ");

ADOQuery2-> ExecSQL ();





Sahifa 169

169

ADOQuery1-> Active = false;

ADOQuery1-> Active = true;

}

/ * Ommaviy assimilyatsiya koeffitsientini olib tashlang * /



void __fastcall TForm4 :: Button2Click (TObject * Sender)

{

ADOQuery2-> Active = false;



ADOQuery2-> SQL-> Clear ();

ADOQuery2-> SQL-> Qo'shish ("DELETE mu. *");

ADOQuery2-> SQL-> Add ("FROM mu");

ADOQuery2-> SQL-> Qo'shish ("WHERE (mu.ID_source =" + ADOTable2-

> FieldByName ("ID_source") -> AsString + ") VA (mu.ID_element =" + ADOTable1-)

> FieldByName ("ID_element") -> AsString + ");");

ADOQuery2-> ExecSQL ();

ADOQuery1-> Active = false;

ADOQuery1-> Active = true;

}

/ * moddalar tarkibini va ularning kontsentratsiyasini qo'shish, olib tashlash va o'zgartirish shakli



elementlar * /

# kiritilgan

#pragma hdrstop

# "Unit1.h" ni o'z ichiga oladi

# "Unit2.h" ni o'z ichiga oladi

# "Unit3.h" ni kiriting

// ------------------------------------------------ ---------------------------

#pragma to'plami (smart_init)

#pragma manbai "* .dfm"

TForm3 * Form3;

// ------------------------------------------------ ---------------------------

__fastcall TForm3 :: TForm3 (TComponent * egasi)

: TForm (Egasi)

{

}



// ------------------------------------------------ ---------------------------

/ * DBLookupComboBox1 maydonidan moddaning miqdoriy tarkibini tanlash bo'yicha so'rov

* /

void __fastcall TForm3 :: DBLookupComboBox1Click (TObject * Sender)



{

ADOQuery1-> Active = false;

ADOQuery1-> SQL-> Clear ();

ADOQuery1-> SQL-> Qo'shish ("SELECT elements.Name, koncenracia.Koncentr_min, koncenra-

cia.Koncentr_max, elements.E, elements.Sk ");

ADOQuery1-> SQL-> Qo'shish ("FROM elementlaridan INNER JOIN (materiallar INNER JOIN kon-

cenracia ON materials.ID_material = koncenracia.ID_material) ON elements.ID_element =

koncenracia.ID_element ");

ADOQuery1-> SQL-> Qo'shish ("QAYERDA (materials.Name = '" + DBLookupComboBox1-

> Matn + "')");

ADOQuery1-> SQL-> Qo'shish ("ORDER BY материалы. Name DESC;");



Sahifa 170

170

ADOQuery1-> Active = true;

}

/ * tanlangan moddaga Edit1 va Edit2 dan konsentratsiyali element qo'shing * /



void __fastcall TForm3 :: Button2Click (TObject * Sender)

{

int id_mat, id_elem;



ADOQuery3-> Active = false;

ADOQuery3-> SQL-> Clear ();

ADOQuery3-> SQL-> Qo'shish ("SELECT elements.ID_element, materials.ID_material");

ADOQuery3-> SQL-> Add ("FROM materiallar, elementlar");

ADOQuery3-> SQL-> Qo'shish ("WHERE (elements.Name) = '" + DBLookupComboBox2-> Text + "'

VA materiallar.Name = '"+ DBLookupComboBox1-> Matn +"'; ");

ADOQuery3-> Active = true;

ADOQuery3-> Birinchi ();

id_elem = ADOQuery3-> FieldByName ("ID_element") -> AsInteger;

id_mat = ADOQuery3-> FieldByName ("ID_material") -> AsInteger;

ADOQuery3-> Active = false;

ADOQuery3-> SQL-> Clear ();

ADOQuery3-> SQL-> Qo'shish ("INSERT INTO koncenracia (ID_material, ID_element, Kon-

centr_min, Koncentr_max) ");

ADOQuery3-> SQL-> Qo'shish ("VALUES

("+ IntToStr (id_mat) +", "+ IntToStr (id_elem) +", "+ Edit1-> Text +", "+ Edit2-> Text +"); ");

ADOQuery3-> ExecSQL ();

ADOQuery1-> Active = false;

ADOQuery1-> Active = true;

}

// ------------------------------------------------ ---------------------------



/ * Elementni olib tashlash * /

void __fastcall TForm3 :: Button3Click (TObject * Sender)

{

ADOQuery3-> Active = false;



ADOQuery3-> SQL-> Clear ();

ADOQuery3-> SQL-> Qo'shish ("DELETE koncenracia. *");

ADOQuery3-> SQL-> Add ("FROM elementlaridan INNER JOIN (materiallar INNER JOIN kon-

cenracia ON materials.ID_material = koncenracia.ID_material) ON elements.ID_element =

koncenracia.ID_element ");

ADOQuery3-> SQL-> Qo'shish ("QAYERDA (materials.Name = '" + DBLookupComboBox1-> Text + "')

VA (elements.Name = '"+ ADOQuery1-> FieldByName (" Ism ") -> AsString +"'); ");

ADOQuery3-> ExecSQL ();

ADOQuery1-> Active = false;

ADOQuery1-> Active = true;

}

// ------------------------------------------------ ---------------------------



void __fastcall TForm3 :: Edit3Change (TObject * Sender)

{

agar (Edit3-> Text! = "")



Button1-> Enabled = true;

boshqa


Button1-> Enabled = false;

}



Sahifa 171

171

// ------------------------------------------------ ---------------------------

/ * yangi moddani qo'shish * /

void __fastcall TForm3 :: Button1Click (TObject * Sender)

{

ADOQuery3-> Active = false;



ADOQuery3-> SQL-> Clear ();

ADOQuery3-> SQL-> Add ("INSERT INTO materiallari (Ismi)");

ADOQuery3-> SQL-> Qo'shish ("VALUES ('" + Edit3-> Text + "');");

ADOQuery3-> ExecSQL ();

ADOTable1-> Active = false;

ADOTable1-> Active = true;

}

/ * moddani olib tashlash * /



void __fastcall TForm3 :: Button4Click (TObject * Sender)

{

ADOQuery3-> Active = false;



ADOQuery3-> SQL-> Clear ();

ADOQuery3-> SQL-> Qo'shish ("O'chirish materiallari. *");

ADOQuery3-> SQL-> Add ("FROM materiallari");

ADOQuery3-> SQL-> Qo'shish ("QAYERDA (materials.Name = '" + DBLookupComboBox1-

> Matn + "');");

ADOQuery3-> ExecSQL ();

ADOTable1-> Active = false;

ADOTable1-> Active = true;

}

/ * Analitik parametrlarni hisoblash moduli, ularning ichida bog'liqliklarni yaratish



plomba moddasining massa koeffitsienti chegaralari. Optimalni topish

qo'shimcha absorberning sirt zichligi. * /

# kiritilgan

# matematikani qo'shib qo'ying

# matematikani qo'shib qo'ying

#pragma hdrstop

#include

# "Unit6.h" ni o'z ichiga oladi

# "Unit1.h" ni o'z ichiga oladi

// ------------------------------------------------ ---------------------------

#pragma to'plami (smart_init)

#pragma manbai "* .dfm"

TForm6 * Form6;

// ------------------------------------------------ ---------------------------

__fastcall TForm6 :: TForm6 (TComponent * egasi)

: TForm (Egasi)

{

}

// ------------------------------------------------ ---------------------------



er-xotin ma0, mn0, Ca, Cn, x1, x2, fi, ksi, d, step, n;

ikki barobar ** natija;

int N, M;



Sahifa 172

172

/ * Hisoblash natijalarini o'z ichiga olgan massiv * /

void __fastcall TForm6 :: Button1Click (TObject * Sender)

{

N = 10;



M = 10;

ikki baravar E0, Ei, Sk;

InputQuery ("Graflar sonini kiriting", N);

InputQuery ("Grafika chiziladigan punktlar sonini kiriting", M);

/ * dinamik qatorni ishga tushirish * /

natija = yangi juftlik * [M + 4];

uchun (int i = 0; i

natija [i] = yangi juft [N];

/ * seriyali N ob'ektlarini yaratish * /

uchun (int i = 0; i

{

TLineSeries * ss = yangi TLineSeries (Application);



ss-> Name = "Series" + IntToStr (i);

ss-> ParentChart = Chart1;

ss-> LinePen-> Width = 1;

ss-> Pointer-> VertSize = 2;

ss-> Pointer-> HorizSize = 2;

ss-> Pointer-> Visible = true;

}

StringGrid1-> RowCount = M + 4;



StringGrid1-> ColCount = N + 1;

uchun (int i = 1; i

StringGrid1-> Hujayralar [i] [0] = "n" + IntToStr (i);

uchun (int i = 1; i

StringGrid1-> Hujayralar [0] [i] = IntToStr (i);

StringGrid1-> Hujayralar [0] [M + 1] = "d";

StringGrid1-> Hujayralar [0] [M + 2] = "SKO";

uchun (int i = 0; i

{

Chart1-> Series [i] -> Clear ();



}

ma0 = StrToFloat (Edit1-> Matn);

Ca = StrToFloat (Edit2-> Text);

Sk = StrToFloat (Edit3-> Matn);

E0 = StrToFloat (Edit4-> Matn);

Ei = StrToFloat (Edit5-> Text);

fi = StrToFloat (Edit6-> Matn);

ksi = StrToFloat (Edit7-> Matn);

x1 = StrToFloat (Edit8-> Matn);

x2 = StrToFloat (Edit9-> Matn);

mn0 = (x2 + x1) / 2;

Cn = 1-Ca;

qadam = (x2-x1) / M;



Sahifa 173

173

/ * dinamik kutubxona function.dll ning dop funktsiyasiga qo'ng'iroq * /

dllInstance = LoadLibrary ("functions.dll");

agar (dllInstance)

Dt = (FType *) GetProcAddress (dllInstance, "_ dop");

d = Dt (Sk, Ca, Cn, E0, Ei, ma0, mn0, fi, ksi);

int i = 0;

for (float x = x1; x <= x2; x = x + step) // DAVRAN BOSHLASH

{

StringGrid1-> Hujayralar [0] [i + 1] = FloatToStr (SimpleRoundTo (x, -5));



mn0 = x;

/ * analitik n-pa ni qo'shimcha * / ishlatmasdan hisoblash

natija [i] [0] = nn (Sk, Ca, Cn, E0, Ei, ma0, mn0, fi, ksi, 0); //

uchun (int r = 1; r

{

/ * qo'shimcha absorber yordamida analitik bug'ni hisoblash * /



natija [M + 2] [i] = 0,5 * d + 0,1 * r * d;

natija [i] [r] = nn (Sk, Ca, Cn, E0, Ei, ma0, mn0, fi, ksi, 0,5 * d + 0,1 * r * d); //

}

i ++;


}

/ * natijalar jadvaliga d oralig'ini yozish davri * /

uchun (int j = 1; j

{natija [M + 2] [j] = 0,5 * d + 0,1 * j * d;

StringGrid1-> Hujayralar [j + 1] [M + 1] = SimpleRoundTo (0,5 * d + 0,1 * j * d, -9);

}

/ * normallashtirish omillarini topish va ularni natijaga yozish [M + 3] [i] * /



uchun (int i = 0; i

natija [M + 3] [i] = natija [0] [0] / natija [0] [i];

uchun (int i = 0; i

uchun (int r = 0; r

{

natija [i] [r] = natija [i] [r] * natija [M + 3] [r];



StringGrid1-> Hujayralar [r + 1] [i + 1] = FloatToStr (SimpleRoundTo (natija [i] [r], - 5));

}

er-xotin yig'indisi = 0;



uchun (int j = 0; j

{

/ * har bir diagramma uchun o'rtacha qiymatni topish va uni [M] [j] * / natija berish uchun yozish



summ = 0;

uchun (int k = 0; k

summ + = natija [k] [j];

natija [M] [j] = summ / M;

}

/ * RMS topish * /



uchun (int j = 0; j

{summ = 0;





Sahifa 174

174

uchun (int k = 0; k

{

summ + = (natija [k] [j]-natija [M] [j]) * (natija [k] [j]-natija [M] [j]);}



natija [M + 1] [j] = sqrt (summ / (M * (M-1)));

StringGrid1-> Hujayralar [j + 1] [M + 2] = SimpleRoundTo (natija [M + 1] [j], - 5);

} //

double min = natija [M + 1] [0];



er-xotin dopt;

int gr = 0;

/ * minimal standart og'ishni qidirish

uchun (int i = 1; i

{

agar (natija [M + 1] [i]

{

min = natija [M + 1] [i];

dopt = natija [M + 2] [i];

gr = i;


}

}

uchun (int i = 1; i

{

Chart1-> Series [i] -> Title = FloatToStr (SimpleRoundTo (natija [M + 2] [i], - 5));

Form8-> Chart1-> Series [i] -> Title = FloatToStr (SimpleRoundTo (natija [M + 2] [i], - 5));

}

Chart1-> Series [gr] -> Title + = "optimal d";



Chart1-> Series [0] -> Title = "qo'shimcha absorbersiz";

Chart1-> Seriya [N / 2] -> Sarlavha + = "middle mn";

Form8-> Chart1-> Series [gr] -> Title + = "optimal d";

Form8-> Chart1-> Series [0] -> Title = "qo'shimcha absorbersiz";

Form8-> Chart1-> Series [N / 2] -> Sarlavha + = "middle mn";

grafik (Chart1, natija, M-1, N, x1, x2);

ShowMessage ("Optimal d =" + FloatToStr (dopt) + ". Bunday holda xato bo'ladi

"+ FloatToStr (min));

Edit10-> Text = FloatToStr (dopt);

Edit11-> Text = FloatToStr (min);

Edit14-> Text = FloatToStr (natija [M + 1] [5]);

Edit13-> Text = FloatToStr (natija [M + 2] [5]);

Edit12-> Text = FloatToStr (natija [M + 1] [0]);

}

// ------------------------------------------------ ---------------------------



void __fastcall TForm6 :: Chart1Click (TObject * Sender)

{

grafik (Form8-> Chart1, natija, M-1, N, x1, x2);



Form8-> Show ();

}

// ------------------------------------------------ ---------------------------



void __fastcall TForm6 :: SpeedButton1Click (TObject * Sender)

{

grafik (Form8-> Chart1, natija, M-1, N, x1, x2);





Sahifa 175

175

Form8-> Show ();

qgraph (Form10-> QRChart1, natija, M-1, N, x1, x2);

}

/ * Dinamik havola kutubxonasining header fayli functions.dll * /



# kiritilgan

#include

# ni o'z ichiga oladi

#pragma hdrstop

#pragma munozarali

int WINAPI DllEntryPoint (HINSTANCE hinst, imzosiz sabab, bekor * lpReserve)

{

qaytish 1;



}

/ * areal zichligini hisoblash funktsiyasi * /

er-xotin dop (er-xotin Sk, er-xotin Ca, er-xotin Cn, er-xotin E0, er-xotin Ei, er-xotin ma0, er-xotin

mn0, double fi, double ksi)

{

er-xotin D1, D2, D3;



D1 = (E0 / Ei * E0 / Ei * E0 / Ei) / sin (fi);

D2 = Ca * ma0 * D1 * (1-1 / Sk);

D3 = Ca * Ca * ma0 * ma0 * (D1 / Sk + 1 / sin (ksi))

+ Ca * Cn * ma0 * mn0 * (D1 * (1 + 1 / Sk) + 2 / sin (ksi))

+ Cn * Cn * mn0 * mn0 * (D1 + 1 / sin (ksi));

qaytish D2 / D3;

}

/ * analitik parametrni hisoblash funktsiyasi * /



er-xotin nn (er-xotin Sk, er-xotin Ca, er-xotin Cn, er-xotin E0, er-xotin Ei, er-xotin ma0, er-xotin

mn0, er-xotin fi, juft ksi, juft d)

{

juft A1, A2, B1, B2;



A1 = ma0 * (1 / sin (fi) + sin (ksi)) * Ca;

A2 = mn0 * (1 / sin (fi) + sin (ksi)) * Cn;

B1 = ma0 * (1 / sin (fi) + sin (ksi) * (E0 * E0 * E0) / (Ei * Ei * Ei * Sk)) * Ca;

B2 = mn0 * (1 / sin (fi) + sin (ksi) * (E0 * E0 * E0) / (Ei * Ei * Ei)) * Cn;

qaytarish (A1 + A2) / (B1 + B2) * exp ((ma0 * Ca + mn0 * Cn) * d);

}

/ * natija massividagi ma'lumotlardan foydalangan holda TChart-da diagrammalar tuzish funktsiyasi * /



bo'sh grafik (TChart * ChartX, ikkilangan ** natija, int M, int N, float x1, float x2)

{

int i = 0;



suzuvchi qadam = (x2-x1) / M;

int cntser = ChartX-> SeriesCount ();

uchun (float x = x1; x

{uchun (int r = 0; r



Sahifa 176

176

{

ChartX-> Series [r] -> AddXY (x, natija [i] [r]);



}

i ++;


}

}

/ * natija massividagi ma'lumotlarga asoslangan holda TQRChart-da grafiklarni tuzish funktsiyasi * /



bo'sh qgraph (TQRChart * ChartX, ikki marta ** natija, int M, int N, float x1, float x2)

{

int i = 0;



suzuvchi qadam = (x2-x1) / M;

int cntser = ChartX-> SeriesCount ();

int cntser = 10;

uchun (float x = x1; x

{uchun (int r = 0; r

{

ChartX-> Series [r] -> AddXY (x, natija [i] [r]);



}

i ++;


}

}



Sahifa 177

177

ILOVA 2a


Foydalanuvchi uchun qo'llanma

Dastur rentgen nurlanishini optimallashtirish uchun mo'ljallangan

qo'shimcha va optimal sirt zichligini hisoblash va hisoblash

matritsa effektini hisobga olish usuli uchun absorber

qo'shimcha absorber qo'shilishi bilan.

Dasturni ishga tushirish uchun faqat arxivni papkaga oching va

poglot.exe faylini ishga tushiring. Ishga tushgandan so'ng, quyidagi oyna paydo bo'ladi:

Bu erda, asosiy menyuda foydalanuvchi nima bilan ishlashini tanlaydi

o'g'ri:

- ma'lumotnomalarni tahrirlash (kimyoviy elementlar, tahlil qilinadigan turlari



moddalar, nurlanish manbalari);

- sirtning optimal zichligini hisoblash uchun bosqichma-bosqich sehrgar;

- oldingi natijalarni ko'rish;

- ma'lumotnoma.





Sahifa 178

178

Kataloglar bilan ishlash

"Kimyoviy elementlar" katalogi

Kimyoviy elementlarning xususiyatlarini ko'rish va tahrirlashga imkon beradi

politsiya, masalan: seriya raqami, belgilanishi, nomi, energiyasi

nurlanish, yutilish sakrashi. Ma'lumotlarni o'zgartirish yordamida amalga oshiriladi

ko'rsatilgan ma'lumotlar ostidagi navigatsiya paneli.

"Analitik turlari" katalogi

Tahlil qilingan tarkibni ko'rish va tahrirlashga imkon beradi

moddalar, har birining minimal va maksimal kontsentratsiyasini o'rnating

moddaning kimyoviy elementi va shuningdek, yangi turdagi namunalarni joriy etish.



"Radiatsiya manbalari" qo'llanmasi



Sahifa 179

179

Bu erda siz ko'rasiz, o'zgartirasiz, qo'shasiz va o'chirasiz

nurlanish manbalari va ularning energiyalari.

"Ommaviy assimilyatsiya koeffitsientlari" qo'llanmasi.

Ushbu qo'llanmada massani yutish koeffitsientlari ko'rsatilgan

Har bir nurlanish manbai uchun rentgen elementlari.

"Moddaning tahlili" tugmachasini bosgandan so'ng, bosqichma-bosqich

optimal zichlikni hisoblash uchun sehrgar. Foydalanuvchi

tahlil qilinadigan mahsulotlar turini tanlash taklif etiladi





Sahifa 180

180

keyin tahlil qilingan kimyoviy element

Keyin siz o'rganilayotgan element konsentratsiyasini o'rnatishingiz kerak

belgilangan oraliq

Shundan so'ng, plomba tarkibini ko'rsatadigan jadval paydo bo'ladi

(plomba - bu namunaning barcha kimyoviy elementlari to'plami, bundan mustasno

tahlil qilingan)



Sahifa 181

181

Keyingi qadam zarur bo'lgan asosiy parametrlarni aks ettiradi

grafiklarni chizish uchun: tahlil qilingan mahsulotlar turi, tahlil qilingan

element va uning kontsentratsiyasi, massaning hisoblangan chegaralari

plomba moddasining yutilish samaradorligi, optimal nurlanish manbai va

o'rganilayotgan elementning yutilish sakrashi.



Natijalarni chizish va ko'rsatish



Sahifa 182

182

Grafiklarda analitik parametrning ko- ga bog'liqligi ko'rsatilgan.

plomba moddasi, qo'shimcha optimal zichligi

yutuvchi. Foydalanuvchi RMS-ni ikki marta ko'rish imkoniyatiga ega

Rentgenologik tahlil usullari: fon standart usuli (ishlatmasdan

absorber) va absorber yordamida tavsiya etilgan usul.





Sahifa 183

Download 1.14 Mb.

Do'stlaringiz bilan baham:
1   ...   13   14   15   16   17   18   19   20   21




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling