Xreferat.com » Рефераты по информатике и программированию » Разработка лабораторного стенда для исследования фотоэффекта

Разработка лабораторного стенда для исследования фотоэффекта

нем. – К.: Издательская группа BHV, 2006г.

Жуков А. Изучаем Delphi. – СПб.: Питер, 2000.

Культин Н.Б. Программирование на Object Pascal в Delphi 6. – СПб.: БХВ – Санкт-Петербург, 2005г.

Благодатских В.А. и др. Экономика, разработка и использование программного обеспечения ЭВМ. М.: Финансы и статистика, 2005г.

ПРИЛОЖЕНИЕ 1


ЛИСТИНГ ПРОГРАММЫ


Главная форма (1)


Закрытие формы

procedure TForm1.N6Click(Sender: TObject);

begin

If MessageDlg('Завершить работу ? ', mtinformation,

[mbYes, mbNo], 0) = mrYes Then close;

end;


Обращение к Web-странице

procedure TForm1.Button1Click(Sender: TObject);

begin

winexec('C:Program FilesInternet Exploreriexplore.exe C:Мои документыДиплом-Жгутовтеория1.htm',SW_MAXIMIZE);

end;


Обращение к Web-странице

procedure TForm1.N2Click(Sender: TObject);

begin

winexec('C:Program FilesInternet Exploreriexplore.exe C:Мои документыДиплом-Жгутовтеория1.htm',SW_MAXIMIZE);

end;


Открывает форму 4

procedure TForm1.Button2Click(Sender: TObject);

begin

Form4.Show;

Form1.Hide;

end;


Открывает форму 4

procedure TForm1.N3Click(Sender: TObject);

begin

Form4.Show;

Form1.Hide;

end;


Открывает форму 3

procedure TForm1.N8Click(Sender: TObject);

begin

Form3.Visible:=True;

Form1.Enabled:=false;

end;


Выводит сообщение о программе

procedure TForm1.N9Click(Sender: TObject);

begin

messagedlg ('Данный проект разработал студент 4-го курса, специальности 2203 "Программное обеспечение вычислительной техники и автоматизированных систем", Жгутов К.А.',mtInformation,[mbOk],0);

end;


Переходит на форму 8 и очищает на ней все данные

procedure TForm1.N4Click(Sender: TObject);

begin

form8.Show;

form1.Hide;

form4.Hide;

Form8.ScrollBar1.Enabled:=false;

Form8.Button2.Visible:=true;

Form8.Button3.Visible:=false;

Form8.Image1.Visible:=true;

Form8.Image2.Visible:=False;

Form8.Image3.Visible:=False;

Form8.Image4.Visible:=False;

Form8.Image7.Visible:=False;

Form8.Image8.Visible:=False;

Form8.Image9.Visible:=False;

Form8.ScrollBar1.Position:=0;

Form8.Gauge1.Progress:=100-Form8.ScrollBar1.Position;

Form8.Gauge2.Progress:=Form8.ScrollBar1.Position;

Form8.ScrollBar1.Enabled:=false;

Form8.radiobutton1.Checked:=false;

Form8.radiobutton2.Checked:=false;

Form8.radiobutton3.Checked:=false;

end;


Переходит на форму 8 и очищает на ней все данные

procedure TForm1.Button3Click(Sender: TObject);

begin

form8.Show;

form1.Hide;

form4.Hide;

Form8.ScrollBar1.Enabled:=false;

Form8.Button2.Visible:=true;

Form8.Button3.Visible:=false;

Form8.Image1.Visible:=true;

Form8.Image2.Visible:=False;

Form8.Image3.Visible:=False;

Form8.Image4.Visible:=False;

Form8.Image7.Visible:=False;

Form8.Image8.Visible:=False;

Form8.Image9.Visible:=False;

Form8.ScrollBar1.Position:=0;

Form8.Gauge1.Progress:=100-Form8.ScrollBar1.Position;

Form8.Gauge2.Progress:=Form8.ScrollBar1.Position;

Form8.ScrollBar1.Enabled:=false;

Form8.radiobutton1.Checked:=false;

Form8.radiobutton2.Checked:=false;

Form8.radiobutton3.Checked:=false;

end;


Переходит на форму 9

procedure TForm1.N10Click(Sender: TObject);

begin

Form9.Visible:=true;

Form1.Enabled:=false;

end;


Закрывает главную форму и выводит сообщение

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);

begin

If MessageDlg('Завершить работу ? ', mtinformation,

[mbYes, mbNo], 0) = mrYes

Then

begin

Action:=caFree;

end

else

Action:=caNone;

end;


Форма2


Процедура регистрации пользователей

procedure TForm2.Button1Click(Sender: TObject);

var i:integer;

begin

i:=0;

If ComboBox1.Text='' then

begin

messagedlg('Введите номер группы ',mtInformation,[mbOk],0);

i:=i+1;

end;

If Edit1.Text='' then

begin

messagedlg('Введите фамилию',mtInformation,[mbOk],0);

i:=i+1;

end;

If i=0 then

begin

Form4.show;

Form2.Close;

end;

end;

Форма 3


Переходит на форму 1

procedure TForm3.Button1Click(Sender: TObject);

begin

Form1.Enabled:=true;

close;

end;


Форма 4


Процедура для начала теста

procedure TForm4.Button1Click(Sender: TObject);

var i:integer;

begin

sum:=0;

proc:=0;

Button2.Enabled:=true;

Button1.Enabled:=false;

for i:=1 to 11 do

begin

Gauge1.Progress:=proc;

DBEdit1.Visible:=false;

DBEdit2.Visible:=false;

DBEdit3.Visible:=false;

DBEdit4.Visible:=false;

DBEdit5.Visible:=false;

Image1.Visible:=false;

Image2.Visible:=false;

Image3.Visible:=false;

Image4.Visible:=false;

Image5.Visible:=false;

Image6.Visible:=false;

Image7.Visible:=false;

Image8.Visible:=false;

Image9.Visible:=false;

Image10.Visible:=false;

Image11.Visible:=false;

radiobutton1.Visible:=true;

radiobutton2.Visible:=true;

radiobutton3.Visible:=true;

radiobutton4.Visible:=true;

AdoTable1.Prior;

end;

Form1.show;

Form4.Close;

end;


Тестирование

procedure TForm4.Button2Click(Sender: TObject);

begin

if (radiobutton1.Checked=false) and (radiobutton2.Checked=false) and (radiobutton3.Checked=false) and (radiobutton4.Checked=false)then

begin

messagedlg('Выберите вариант ответа!',mtInformation,[mbOk],0);

end else


begin

AdoTable1.Next;


if ADOTable1.FieldValues['Счетчик']=6 then

begin

Image1.Visible:=true;

Image2.Visible:=true;

Image3.Visible:=true;

DBEdit2.Visible:=false;

DBEdit3.Visible:=false;

DBEdit4.Visible:=false;

end;


if ADOTable1.FieldValues['Счетчик']=7 then

begin

Image4.Visible:=true;

Image5.Visible:=true;

Image6.Visible:=true;

Image7.Visible:=true;

Image1.Visible:=false;

Image2.Visible:=false;

Image3.Visible:=false;

DBEdit2.Visible:=false;

DBEdit3.Visible:=false;

DBEdit4.Visible:=false;

DBEdit5.Visible:=false;

end;


if ADOTable1.FieldValues['Счетчик']=11 then

begin

Image8.Visible:=true;

Image9.Visible:=true;

Image10.Visible:=true;

Image11.Visible:=true;

Image12.Visible:=false;

DBEdit2.Visible:=false;

DBEdit3.Visible:=false;

DBEdit4.Visible:=false;

DBEdit5.Visible:=false;

end;


if ADOTable1.FieldValues['Счетчик']=10 then

begin

Image12.Visible:=true;

end;


if (ADOTable1.FieldValues['Счетчик']<>6) and (ADOTable1.FieldValues['Счетчик']<>7) and (ADOTable1.FieldValues['Счетчик']<>10) and (ADOTable1.FieldValues['Счетчик']<>11) then

begin

DBEdit2.Visible:=true;

DBEdit3.Visible:=true;

DBEdit4.Visible:=true;

DBEdit5.Visible:=true;

Image1.Visible:=false;

Image2.Visible:=false;

Image3.Visible:=false;

Image4.Visible:=false;

Image5.Visible:=false;

Image6.Visible:=false;

Image7.Visible:=false;

Image8.Visible:=false;

Image9.Visible:=false;

Image10.Visible:=false;

Image11.Visible:=false;

Image12.Visible:=false;

end;


if radiobutton1.Checked=true then flag:='A';

if radiobutton2.Checked=true then flag:='B';

if radiobutton3.Checked=true then flag:='C';

if radiobutton4.Checked=true then flag:='D';

if flag=adotable1.FieldValues['Правильный_ответ'] then

begin

sum:=sum+1;

proc:=proc+9;

Gauge1.Progress:=proc;

end;


if ADOTable1.FieldValues['Счетчик']=12 then

begin

Gauge1.Progress:=proc+1;

DBEdit1.Visible:=false;

DBEdit2.Visible:=false;

DBEdit3.Visible:=false;

DBEdit4.Visible:=false;

DBEdit5.Visible:=false;

radiobutton1.Visible:=false;

radiobutton2.Visible:=false;

radiobutton3.Visible:=false;

radiobutton4.Visible:=false;

messagedlg('Тест пройден. Позовите преподавателя, чтобы показать результат.',mtInformation,[mbOk],0);

Button1.Enabled:=true;

N2.Enabled:=true;

N3.Enabled:=true;

Button2.Enabled:=false;

form5.adotable1.Insert;

form5.adotable1.fieldbyname ('Группа').AsString:=Form2bobox1.Text;

form5.adotable1.fieldbyname ('Фамилия').AsString:=Form2.Edit1.Text;

form5.adotable1.fieldbyname ('Результат').AsString:=inttostr(proc+1);

form5.adotable1.post;

end;


if sum>=9 then

begin

Form1.Button3.Enabled:=true;

Form1.N4.Enabled:=true;

end

else

begin

Form1.Button3.Enabled:=false;

Form1.N4.Enabled:=false;

end;


RadioButton1.Checked:=false;

RadioButton2.Checked:=false;

RadioButton3.Checked:=false;

RadioButton4.Checked:=false;

end;

end;


Переходит на форму 2

procedure TForm4.N2Click(Sender: TObject);

var i:integer;

begin

Form2.Show;

form2.ComboBox1.Text:='';

form2.Edit1.Text:='';

sum:=0;

proc:=0;

Button2.Enabled:=true;

Button1.Enabled:=false;

for i:=1 to 11 do

begin

Gauge1.Progress:=proc;

DBEdit1.Visible:=true;

DBEdit2.Visible:=true;

DBEdit3.Visible:=true;

DBEdit4.Visible:=true;

DBEdit5.Visible:=true;

Image1.Visible:=false;

Image2.Visible:=false;

Image3.Visible:=false;

Image4.Visible:=false;

Image5.Visible:=false;

Image6.Visible:=false;

Image7.Visible:=false;

Image8.Visible:=false;

Image9.Visible:=false;

Image10.Visible:=false;

Image11.Visible:=false;

radiobutton1.Visible:=true;

radiobutton2.Visible:=true;

radiobutton3.Visible:=true;

radiobutton4.Visible:=true;

AdoTable1.Prior;

end;

N2.Enabled:=false;

N3.Enabled:=false;

Button2.Enabled:=true;

end;

procedure TForm4.N3Click(Sender: TObject);

begin

Form1.show;

Form4.Close;

end;


Очистка пароля

procedure TForm4.N5Click(Sender: TObject);

begin

PasswordDlg.Show;

PasswordDlg.Password.Text:='';

PasswordDlg.Label2.Caption:='';

Form4.Enabled:=false;

end;


Переходит на форму 7

procedure TForm4.N6Click(Sender: TObject);

begin

Form7.Show;

Form4.Enabled:=false;

end;


Форма 5


Переходит на форму 4

procedure TForm5.Button1Click(Sender: TObject);

begin

form4.Enabled:=true;

Form5.Close;

end;


Форма 6


Проверка пароля

procedure TPasswordDlg.OKBtnClick(Sender: TObject);

begin

If Password.Text='физика' then

begin

Form5.show;

PasswordDlg.Close;

end

else

Label2.Caption:='Неверный пароль';

Password.Text:='';

end;


Переходит на форму 4 и очищает пароль

procedure TPasswordDlg.CancelBtnClick(Sender: TObject);

begin

Form4.Enabled:=true;

Label2.Caption:='';

Password.Text:='';

close;

end;


Форма 7


Переходит на форму 4

procedure TForm7.Button1Click(Sender: TObject);

begin

form4.Enabled:=true;

close;

end;


Форма 8


Переходит на форму 1

procedure TForm8.Button1Click(Sender: TObject);

begin

form1.Show;

form8.Hide;

end;


Определение показателей вольтметра

procedure TForm8.ScrollBar1Change(Sender: TObject);

var i:integer;

f:real;

a:string;

begin

If RadioButton1.Checked=true then

begin

Gauge2.Progress:=ScrollBar1.Position;

Gauge1.Progress:=100-(ScrollBar1.Position*2);

f:=0;

for i:=0 to ScrollBar1.Position do

begin

f:=f+0.1;

a:=floattostr(f);

Label3.Caption:=a+' B';

if ScrollBar1.Position=0 then Label3.Caption:='0'+' B';

if ScrollBar1.Position<47 then Image7.Visible:=true;

if ScrollBar1.Position=50 then f:=4.9;

if ScrollBar1.Position<21 then Image7.Left:=350+ScrollBar1.Position*5;

if (ScrollBar1.Position>21) and (ScrollBar1.Position<41) then Image7.Left:=550-ScrollBar1.Position*5;

if ScrollBar1.Position>47 then Image7.Visible:=false;

end;

end;


If RadioButton2.Checked=true then

begin

Gauge2.Progress:=ScrollBar1.Position;

Gauge1.Progress:=100-(ScrollBar1.Position*2);

f:=0;

for i:=0 to ScrollBar1.Position do

begin

f:=f+0.1;

a:=floattostr(f);

Label3.Caption:=a+' B';

if ScrollBar1.Position=0 then Label3.Caption:='0'+' B';

if ScrollBar1.Position<36 then Image8.Visible:=true;

if ScrollBar1.Position=50 then f:=4.9;

if ScrollBar1.Position<12 then Image8.Left:=350+ScrollBar1.Position*9;

if (ScrollBar1.Position>12) and (ScrollBar1.Position<23) then Image8.Left:=550-ScrollBar1.Position*9;

if ScrollBar1.Position>35 then Image8.Visible:=false;

end;

end;


If RadioButton3.Checked=true then

begin

Gauge2.Progress:=ScrollBar1.Position;

Gauge1.Progress:=100-(ScrollBar1.Position*2);

f:=0;

for i:=0 to ScrollBar1.Position do

begin

f:=f+0.1;

a:=floattostr(f);

Label3.Caption:=a+' B';

if ScrollBar1.Position=0 then Label3.Caption:='0'+' B';

if ScrollBar1.Position<40 then Image9.Visible:=true;

if ScrollBar1.Position=50 then f:=4.9;

if ScrollBar1.Position<16 then Image9.Left:=360+ScrollBar1.Position*6;

if (ScrollBar1.Position>16) and (ScrollBar1.Position<35) then Image9.Left:=550-ScrollBar1.Position*6;

if ScrollBar1.Position>39 then Image9.Visible:=false;

end;

end;

end;


Обнуление результатов при выборе красного цвета

procedure TForm8.RadioButton1Click(Sender: TObject);

begin

If RadioButton1.Checked=true Then

begin

ScrollBar1.Position:=0;

Image2.Visible:=true;

Image7.Visible:=false;

Image1.Visible:=False;

Image3.Visible:=False;

Image4.Visible:=False;

Image8.Visible:=False;

Image9.Visible:=False;

ScrollBar1.Enabled:=false;

Button2.Visible:=true;

Button3.Visible:=false;

Gauge1.Progress:=100-ScrollBar1.Position;

Gauge2.Progress:=ScrollBar1.Position;

ScrollBar1.Enabled:=false;

end;

end;


Обнуление результатов при выборе синего цвета

procedure TForm8.RadioButton2Click(Sender: TObject);

begin

If RadioButton2.Checked=true Then

begin

ScrollBar1.Position:=0;

Image3.Visible:=true;

Image8.Visible:=false;

Image7.Visible:=False;

Image9.Visible:=False;

Image1.Visible:=False;

Image2.Visible:=False;

Image4.Visible:=False;

ScrollBar1.Enabled:=false;

Button2.Visible:=true;

Button3.Visible:=false;

Gauge1.Progress:=100-ScrollBar1.Position;

Gauge2.Progress:=ScrollBar1.Position;

ScrollBar1.Enabled:=false;

end;

end;

Обнуление результатов при выборе зеленого цвета

procedure TForm8.RadioButton3Click(Sender: TObject);

begin

If RadioButton3.Checked=true Then

begin

ScrollBar1.Position:=0;

Image4.Visible:=true;

Image9.Visible:=false;

Image8.Visible:=False;

Image7.Visible:=False;

Image1.Visible:=False;

Image2.Visible:=False;

Image3.Visible:=False;

ScrollBar1.Enabled:=false;

Button2.Visible:=true;

Button3.Visible:=false;

Gauge1.Progress:=100-ScrollBar1.Position;

Gauge2.Progress:=ScrollBar1.Position;

ScrollBar1.Enabled:=false;

end;

end;


Проверяет выбор цвета

procedure TForm8.Button2Click(Sender: TObject);

begin

if (radiobutton1.Checked=false) and (radiobutton2.Checked=false) and (radiobutton3.Checked=false)then

begin

messagedlg('Выберите цвет света!',mtInformation,[mbOk],0);

end else

begin

ScrollBar1.Enabled:=true;

Button3.Visible:=true;

Button2.Visible:=false;

If RadioButton1.Checked=true then Image7.Visible:=true;

If RadioButton2.Checked=true then Image8.Visible:=true;

If RadioButton3.Checked=true then Image9.Visible:=true;

end;

end;

Выключает цепь

procedure TForm8.Button3Click(Sender: TObject);

begin

ScrollBar1.Position:=0;

ScrollBar1.Enabled:=false;

Button2.Visible:=true;

Button3.Visible:=false;

Image7.Visible:=False;

Image8.Visible:=False;

Image9.Visible:=False;

Image1.Visible:=true;

Image2.Visible:=False;

Image3.Visible:=False;

Image4.Visible:=False;

ScrollBar1.Position:=0;

Gauge1.Progress:=100-ScrollBar1.Position;

Gauge2.Progress:=ScrollBar1.Position;

ScrollBar1.Enabled:=false;

radiobutton1.Checked:=false;

radiobutton2.Checked:=false;

radiobutton3.Checked:=false;

end;


Форма 9


Переходит на форму 1

procedure TForm9.Button1Click(Sender: TObject);

begin

form1.Enabled:=true;

close;

end;

Если Вам нужна помощь с академической работой (курсовая, контрольная, диплом, реферат и т.д.), обратитесь к нашим специалистам. Более 90000 специалистов готовы Вам помочь.
Бесплатные корректировки и доработки. Бесплатная оценка стоимости работы.

Поможем написать работу на аналогичную тему

Получить выполненную работу или консультацию специалиста по вашему учебному проекту
Нужна помощь в написании работы?
Мы - биржа профессиональных авторов (преподавателей и доцентов вузов). Пишем статьи РИНЦ, ВАК, Scopus. Помогаем в публикации. Правки вносим бесплатно.

Похожие рефераты: