Программирование в Delphi математических процессов

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование

ой системе Windows. Программа написана при использовании самых современных на сегодняшний день технологий программирования и обеспечивает быструю и качественную работу.

В результате спроектирована программа, позволяющий обрабатывать, изменять информацию и автоматизировать некий математический процесс, что является основной задачей представленной выпускной работы. Программа программирование математических процессов может быть использовано для учебных целей.

 

Список используемой литературы

 

1.Бобровский С. Delphi5: учебный курс.Спб: Питер,2001. 640с.;

.Климова Л.М. Delphi 7. Основы программирования.М.:Кудиц-Образ,2004. 480с.;

.Фаронов В. Программирование баз данных в Dephi 7: учебный курс.Спб: Питер,2003. 459с.

.В.Гофман, А.Хомоненко. Delphi 6: СПб.:БХВ-Петербург, 2001.-1152с.:ил.

5.Delphi 5.0, учебный курс, Фараонов В.В., ISBN 5-8952-020-4, 400

6.Delphi 4.0, Дарахвелидзе П.Г., Марков Е. П. 1998, 816 с.

7.Сайт

 

Приложение: Листинг программы

 

unit Unit1;, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,, StdCtrls, jpeg, ExtCtrls, Buttons, MPlayer;= class(TForm): TImage;: TLabel;: TLabel;: TLabel;: TLabel;: TBitBtn;: TMediaPlayer;Label1Click(Sender: TObject);Label2Click(Sender: TObject);Label3Click(Sender: TObject);Label4Click(Sender: TObject);FormActivate(Sender: TObject);

{Private declarations}

{Public declarations};: TForm1;Unit2;

{$R *.dfm}TForm1.Label1Click(Sender: TObject);.show;;TForm1.Label2Click(Sender: TObject);.show;;TForm1.Label3Click(Sender: TObject);.show;;TForm1.Label4Click(Sender: TObject);.show;;TForm1.FormActivate(Sender: TObject);.Play;;uMain;, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,, Spin, ExtCtrls;= class(TForm): TLabel;: TLabel;: TSpinEdit;: TLabel;: TSpinEdit;: TLabel;: TSpinEdit;: TButton;: TLabel;: TLabel;FormCreate(Sender: TObject);FormDestroy(Sender: TObject);btCalcClick(Sender: TObject);;: TfmMain;

{$R *.DFM}= Double;= packed record, dO2: TOperandType;;= 'Multitasking Copyright 2007 Loonies Software';= '\\.\mailslot\';= Copyright + ' - Mul_OpsReady';= Copyright + ' - Mul_ResReady';= MailslotPrefix + 'Lab2_Mul_Operands';= MailslotPrefix + 'Lab2_Mul_Result';= Copyright + ' - Div_OpsReady';= Copyright + ' - Div_ResReady';= MailslotPrefix + 'Lab2_Div_Operands';= MailslotPrefix + 'Lab2_Div_Result';= Copyright + ' - Sub_OpsReady';= Copyright + ' - Sub_ResReady';= MailslotPrefix + 'Lab2_Sub_Operands';= MailslotPrefix + 'Lab2_Sub_Result';= Copyright + ' - Add_OpsReady';= Copyright + ' - Add_ResReady';= MailslotPrefix + 'Lab2_Add_Operands';= MailslotPrefix + 'Lab2_Add_Result';= Copyright + ' - Root_OpsReady';= Copyright + ' - Root_ResReady';= MailslotPrefix + 'Lab2_Root_Operands';= MailslotPrefix + 'Lab2_Root_Result';, hDivOpsReadyEvent, hSubOpsReadyEvent, hAddOpsReadyEvent, hRootOpsReadyEvent,, hDivResReadyEvent, hSubResReadyEvent, hAddResReadyEvent, hRootResReadyEvent: THandle;, DivThreadHandle, SubThreadHandle, AddThreadHandle, RootThreadHandle: THandle;, hDivResMailslot, hSubResMailslot, hAddResMailslot, hRootResMailslot: THandle;MulThreadProc(lpParameter: Pointer);, ResReadyEvent: THandle;, ResMailslot: THandle;: TOperands;: TOperandType;, WrittenBytes: DWORD;:=OpenEvent(EVENT_ALL_ACCESS, false, MulOpsReadyEventName);:=OpenEvent(EVENT_ALL_ACCESS, false, MulResReadyEventName);:=CreateMailslot(MulMailslotOpsName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateFile(MulMailslotResName, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);WaitForSingleObject(OpsReadyEvent, INFINITE) = WAIT_OBJECT_0 do(OpsReadyEvent);(OpsMailslot, Operands, SizeOf(TOperands), ReadBytes, nil);:=Operands.dO1 * Operands.dO2;(ResMailslot, Res, SizeOf(TOperandType), WrittenBytes, nil);(ResReadyEvent);;(OpsMailslot);(ResMailslot);(0);;DivThreadProc(lpParameter: Pointer);, ResReadyEvent: THandle;, ResMailslot: THandle;: TOperands;: TOperandType;, WrittenBytes: DWORD;:=OpenEvent(EVENT_ALL_ACCESS, false, DivOpsReadyEventName);:=OpenEvent(EVENT_ALL_ACCESS, false, DivResReadyEventName);:=CreateMailslot(DivMailslotOpsName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateFile(DivMailslotResName, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);WaitForSingleObject(OpsReadyEvent, INFINITE) = WAIT_OBJECT_0 do(OpsReadyEvent);(OpsMailslot, Operands, SizeOf(TOperands), ReadBytes, nil);:=Operands.dO1 / Operands.dO2;(ResMailslot, Res, SizeOf(TOperandType), WrittenBytes, nil);(ResReadyEvent);;(OpsMailslot);(ResMailslot);(0);;SubThreadProc(lpParameter: Pointer);, ResReadyEvent: THandle;, ResMailslot: THandle;: TOperands;: TOperandType;, WrittenBytes: DWORD;:=OpenEvent(EVENT_ALL_ACCESS, false, SubOpsReadyEventName);:=OpenEvent(EVENT_ALL_ACCESS, false, SubResReadyEventName);:=CreateMailslot(SubMailslotOpsName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateFile(SubMailslotResName, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);WaitForSingleObject(OpsReadyEvent, INFINITE) = WAIT_OBJECT_0 do(OpsReadyEvent);(OpsMailslot, Operands, SizeOf(TOperands), ReadBytes, nil);:=Operands.dO1 - Operands.dO2;(ResMailslot, Res, SizeOf(TOperandType), WrittenBytes, nil);(ResReadyEvent);;(OpsMailslot);(ResMailslot);(0);;AddThreadProc(lpParameter: Pointer);, ResReadyEvent: THandle;, ResMailslot: THandle;: TOperands;: TOperandType;, WrittenBytes: DWORD;:=OpenEvent(EVENT_ALL_ACCESS, false, AddOpsReadyEventName);:=OpenEvent(EVENT_ALL_ACCESS, false, AddResReadyEventName);:=CreateMailslot(AddMailslotOpsName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateFile(AddMailslotResName, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);WaitForSingleObject(OpsReadyEvent, INFINITE) = WAIT_OBJECT_0 do(OpsReadyEvent);(OpsMailslot, Operands, SizeOf(TOperands), ReadBytes, nil);:=Operands.dO1 + Operands.dO2;(ResMailslot, Res, SizeOf(TOperandType), WrittenBytes, nil);(ResReadyEvent);;(OpsMailslot);(ResMailslot);(0);;RootThreadProc(lpParameter: Pointer);, ResReadyEvent: THandle;, ResMailslot: THandle;: TOperands;: TOperandType;, WrittenBytes: DWORD;:=OpenEvent(EVENT_ALL_ACCESS, false, RootOpsReadyEventName);:=OpenEvent(EVENT_ALL_ACCESS, false, RootResReadyEventName);:=CreateMailslot(RootMailslotOpsName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateFile(RootMailslotResName, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);WaitForSingleObject(OpsReadyEvent, INFINITE) = WAIT_OBJECT_0 do(OpsReadyEvent);(OpsMailslot, Operands, SizeOf(TOperands), ReadBytes, nil);:=Sqrt(Operands.dO1);(ResMailslot, Res, SizeOf(TOperandType), WrittenBytes, nil);(ResReadyEvent);;(OpsMailslot);(ResMailslot);(0);;TfmMain.FormCreate(Sender: TObject);: DWORD;:=CreateEvent(nil, true, false, MulOpsReadyEventName);:=CreateEvent(nil, true, false, DivOpsReadyEventName);:=CreateEvent(nil, true, false, SubOpsReadyEventName);:=CreateEvent(nil, true, false, AddOpsReadyEventName);:=CreateEvent(nil, true, false, RootOpsReadyEventName);:=CreateEvent(nil, true, false, MulResReadyEventName);:=CreateEvent(nil, true, false, DivResReadyEventName);:=CreateEvent(nil, true, false, SubResReadyEventName);:=CreateEvent(nil, true, false, AddResReadyEventName);:=CreateEvent(nil, true, false, RootResReadyEventName);:=CreateMailslot(MulMailslotResName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateMailslot(DivMailslotResName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateMailslot(SubMailslotResName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateMailslot(AddMailslotResName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateMailslot(RootMailslotResName, 0, MAILSLOT_WAIT_FOREVER, nil);:=CreateThread(nil, 0, @MulThreadProc, nil, 0, ThreadId);:=CreateThread(nil, 0, @DivThreadProc, nil, 0, ThreadId);:=CreateThread(nil, 0, @SubThreadProc, nil, 0, ThreadId);:=CreateThread(nil, 0, @AddThreadProc, nil, 0, ThreadId);:=CreateThread(nil, 0, @RootThreadProc, nil, 0, ThreadId);;TfmMain.FormDestroy(Sender: TObject);(hMulOpsReadyEvent);(hDivOpsReadyEvent);(hSubOpsReadyEvent);(hAddOpsReadyEvent);(hRootOpsReadyEvent);(hMulResReadyEvent);(hDivResReadyEvent);(hSubResReadyEvent);(hAddResReadyEvent);(hRootResReadyEvent);(hMulResMailslot);(hDivResMailslot);(hSubResMailslot);(hAddResMailslot);(hRootResMailslot);(MulThreadHandle, 0);(MulThreadHandle);(DivThreadHandle, 0);(DivThreadHandle);(SubThreadHandle, 0);(SubThreadHandle);(AddThreadHandle, 0);(AddThreadHandle);(RootThreadHandle, 0);(RootThreadHandle);;WriteOperandsUsingFileMapping(OpsMailslotName: PChar; Operands: TOperands; hEvent: THandle);: THandle;: DWORD;:=CreateFile(OpsMailslotName, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);(OpsMailslot, Operands, SizeOf(TOperands), WrittenBytes, nil);(OpsMailslot);(hEvent);;ReadResultUsingFileMapping(hResReadyEvent: THandle; MailslotHandle: THandle): TOperandType;: TOperandType;: DWORD;WaitForSingleObject(hResReadyEvent, INFINITE) = WAIT_OBJECT_0 then(MailslotHandle, Res, SizeOf(TOperandType), ReadBytes, nil);:=Res;;;TfmMain.btCalcClick(Sender: TObject);: TOperands;, dRes2, dRes3: Double;, B, C: Integer;:=sedAFactor.Value;:=sedBFactor.Value;:=sedCFactor.Value;.dO1:=B;.dO2:=B;(MulMailslotOpsName, Operands, hMulOpsReadyEvent);:=ReadResultUsingFileMap