Разработка приложения вычисления определенных интегралов по формуле левых прямоугольников

Возможно использования приложения как вспомогательного средства при изучении интегрального исчисления.

Список использованных источников

1. Фаронов В.В. Delphi. Программирование на языке высокого уровня. - СПб: Издательство «Питер», 2000.- 639 с.

2. Марко Кэнту. Delphi 5 для профессионалов.-СПб.: Питер. 2001. – 944 с.

3. А.Я.Архангельский. Delphi 7. Учебное пособие. - СПб

: Издательство «Питер», 2004.- 1087 с.

4. Электронные учебники

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

Сервер:

unit pServer_TLB;

// ****************************************************** //

// WARNING

// -------

// The types declared in this file were generated from data read from a

// Type Library. If this type library is explicitly or indirectly (via

// another type library referring to this type library) re-imported, or the

// 'Refresh' command of the Type Library Editor activated while editing the

// Type Library, the contents of this file will be regenerated and all

// manual modifications will be lost.

// ********************************************************** //

// PASTLWTR : 1.2

// File generated on 15.11.2005 22:46:27 from Type Library described below.

// ************************************************* //

// Type Lib: C:\Documents and Settings\Sergh\Рабочий стол\Разработка приложения вычисления определенных интегралов по формуле левых прямоугольников (Delphi)\Source\Server\pServer.tlb (1)

// LIBID: {73AF5EFB-ABD6-4565-91C3-0E7C137DA989}

// LCID: 0

// Helpfile:

// HelpString: pServer Library

// DepndLst:

// (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)

// ********************************************************* //

{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.

{$WARN SYMBOL_PLATFORM OFF}

{$WRITEABLECONST ON}

{$VARPROPSETTER ON}

interface

uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;

// ****************************************************//

// GUIDS declared in the TypeLibrary. Following prefixes are used:

// Type Libraries : LIBID_xxxx

// CoClasses : CLASS_xxxx

// DISPInterfaces : DIID_xxxx

// Non-DISP interfaces: IID_xxxx

// ********************************************************//

const

// TypeLibrary Major and minor versions

pServerMajorVersion = 1;

pServerMinorVersion = 0;

LIBID_pServer: TGUID = '{73AF5EFB-ABD6-4565-91C3-0E7C137DA989}';

IID_IIntegral: TGUID = '{2877719B-94E7-45FB-82BE-7F9CD8A6017C}';

CLASS_Integral: TGUID = '{3AD7BD31-8C15-49ED-A0B5-436060913721}';

type

// ***************************************************//

// Forward declaration of types defined in TypeLibrary

// *******************************************************//

IIntegral = interface;

// *******************************************************//

// Declaration of CoClasses defined in Type Library

// (NOTE: Here we map each CoClass to its Default Interface)

// *********************************************************//

Integral = IIntegral;

// *******************************************************//

// Interface: IIntegral

// Flags: (0)

// GUID: {2877719B-94E7-45FB-82BE-7F9CD8A6017C}

// *****************************************************//

IIntegral = interface(IUnknown)

['{2877719B-94E7-45FB-82BE-7F9CD8A6017C}']

function Func(x: Double): Double; stdcall;

end;

// **********************************************************//

// The Class CoIntegral provides a Create and CreateRemote method to

// create instances of the default interface IIntegral exposed by

// the CoClass Integral. The functions are intended to be used by

// clients wishing to automate the CoClass objects exposed by the

// server of this typelibrary.

// ***********************************************************//

CoIntegral = class

class function Create: IIntegral;

class function CreateRemote(const MachineName: string): IIntegral;

end;

implementation

uses ComObj;

class function CoIntegral.Create: IIntegral;

begin

Result := CreateComObject(CLASS_Integral) as IIntegral;

end;

class function CoIntegral.CreateRemote(const MachineName: string): IIntegral;

begin

Result := CreateRemoteComObject(MachineName, CLASS_Integral) as IIntegral;

end;

end.

unit uFunc;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses

Windows, ActiveX, Classes, ComObj, pServer_TLB, StdVcl;

type

TIntegral = class(TTypedComObject, IIntegral)

protected

function Func(x: Double): Double; stdcall;

end;

implementation

uses ComServ;

// Вычисление значения уравнения

function TIntegral.Func(x: Double): Double;

begin

Result := (x + 0.8) / sqrt (x * x + 1.2);

end;

initialization

TTypedComObjectFactory.Create(ComServer, TIntegral, Class_Integral,

ciMultiInstance, tmApartment);

end.

Клиент:

unit uMain;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Buttons, ExtCtrls, TeEngine, Series, TeeProcs, Chart,

Grids, Menus, ToolWin, ComCtrls, ImgList;

type

TfrmMain = class(TForm)

GroupBox1: TGroupBox;

edtA: TEdit;

Label1: TLabel;

edtB: TEdit;

Label2: TLabel;

edtN: TEdit;

Label3: TLabel;

btnApply: TBitBtn;

pnlRes: TPanel;

Chart1: TChart;

Series1: TAreaSeries;

grdAll: TStringGrid;

MainMenu1: TMainMenu;

N1: TMenuItem;

Excel: TMenuItem;

N2: TMenuItem;

nExit: TMenuItem;

N3: TMenuItem;

NApply: TMenuItem;

N5: TMenuItem;

NSave: TMenuItem;

NLoad: TMenuItem;

OpenDialog: TOpenDialog;

SaveDialog: TSaveDialog;

ToolBar1: TToolBar;

ToolButton1: TToolButton;

ToolButton2: TToolButton;

ToolButton3: TToolButton;

ToolButton4: TToolButton;

ToolButton5: TToolButton;

ToolButton6: TToolButton;

ToolButton7: TToolButton;

ToolButton8: TToolButton;

ToolButton9: TToolButton;

N4: TMenuItem;

nAbout: TMenuItem;

ToolButton10: TToolButton;

NHelp: TMenuItem;

N6: TMenuItem;

ImageList1: TImageList;

procedure FormCreate(Sender: TObject);

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

procedure nExitClick(Sender: TObject);

procedure ExcelClick(Sender: TObject);

procedure NApplyClick(Sender: TObject);

procedure NLoadClick(Sender: TObject);

procedure NSaveClick(Sender: TObject);

procedure nAboutClick(Sender: TObject);

procedure NHelpClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

frmMain: TfrmMain;

implementation

uses uLogo, uIntegral, uAbout;

var

Integral: TIntegral;

{$R *.dfm}

// Создание формы

procedure TfrmMain.FormCreate(Sender: TObject);

Страница:  1  2  3  4 


Другие рефераты на тему «Программирование, компьютеры и кибернетика»:

Поиск рефератов

Последние рефераты раздела

Copyright © 2010-2024 - www.refsru.com - рефераты, курсовые и дипломные работы