Выбор материала и расчет параметров обделок вертикальных стволов метрополитенов
Рефераты >> Технология >> Выбор материала и расчет параметров обделок вертикальных стволов метрополитенов

else

Canvas.LineTo(R.Right-10,Round(R.Bottom - 33 -

(Ky*(-b+(k*((R.Right-R.Left-70)/Kx))))));

end;

begin

PLines[isP0,3] := 0;

PLines[isP2,3] := 0;

MaxX := 0.0;

MinX := 0.0;

MaxY := 0.0;

MinY := 0.0;

for i := 1 to 5 do begin

if PLines[isP0,i] > MaxX then MaxX := PLines[isP0,i];

if PLines[isP2,i] > MaxY then MaxY := PLines[isP2,i];

if PLines[isP0,i] < MinX then MinX := PLines[isP0,i];

if PLines[isP2,i] < MinY then MinY := PLines[isP2,i];

end;

if MaxX > 200 then Nx := 100 else Nx := 10;

MaxX := Round(MaxX/Nx)*Nx+Nx;

if MaxY > 200 then Ny := 100 else Ny := 10;

MaxY := Round(MaxY/Ny)*Ny+Ny;

with DrawForm do begin

Canvas.Pen.Color := clBlack;

R.Left := 10;

R.Top := 10;

R.Right := Width - 15;

R.Bottom := Height - 70;

Canvas.FrameRect(R);

Canvas.Brush.Color := clBtnFace;

Kx := (R.Right - R.Left - 80)/MaxX;

Ky := (R.Bottom - R.Top - 80)/MaxY;

{Ось Po}

Canvas.MoveTo(R.Left+10,R.Bottom-30);

Canvas.LineTo(R.Right-10,R.Bottom-30);

{Ось P2}

Canvas.MoveTo(R.Left+60,R.Top+30);

Canvas.LineTo(R.Left+60,R.Bottom-30);

i := 0;

while i*Nx<MaxX do begin

Inc(i);

Canvas.MoveTo(R.Left+60+Round(Kx*i*Nx),R.Bottom-33);

Canvas.LineTo(R.Left+60+Round(Kx*i*Nx),R.Bottom-27);

Canvas.TextOut(R.Left+50+Round(Kx*i*Nx), R.Bottom-20,

IntToStr(i*Nx));

end;

i := 0;

while i*Ny<MaxY do begin

Inc(i);

Canvas.MoveTo(R.Left+63,R.Bottom-30-Round(Ky*i*Ny));

Canvas.LineTo(R.Left+57,R.Bottom-30-Round(Ky*i*Ny));

Canvas.TextOut(R.Left+30, R.Bottom-35-Round(Ky*i*Ny),

IntToStr(i*Ny));

end;

if PLines[isP0,1] > PLines[isP0,4] then

PointMax := PLines[isP0,4]

else PointMax := PLines[isP0,1];

if PLines[isP0,2] > PLines[isP0,5] then

PointMin := PLines[isP0,2]

else PointMin := PLines[isP0,5];

if PointMin < 0 then PointMin := 0.0;

DrawLine(PLines[isP0,1],

-(PLines[isP2,1]/PLines[isP0,1]),PLines[isP2,1]);

DrawLine(PLines[isP0,2],

-(PLines[isP2,2]/PLines[isP0,2]),PLines[isP2,2]);

DrawLine(0,1,0);

DrawLine(PLines[isP0,4],

-(PLines[isP2,4]/PLines[isP0,4]),PLines[isP2,4]);

DrawLine(PLines[isP0,5],

-(PLines[isP2,5]/PLines[isP0,5]),PLines[isP2,5]);

Canvas.Brush.Color := clGreen;

Canvas.FloodFill(Round((((PointMax-PointMin)/2)*Kx)+R.Left+60),

R.Bottom-55, clBlack, fsBorder);

Canvas.Brush.Color := clBtnFace;

Canvas.TextOut(R.Right-80, R.Bottom-50, 'P0, TC/M*2');

Canvas.TextOut(R.Left+20, R.Top+10, 'P2, TC/M*2');

end;

end;

end.

unit Edittub;

interface

uses

SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics,

Controls,Forms, Dialogs, DBFilter, DB, DBTables, Grids, DBGrids,

RXLookup, ExtCtrls, DBCtrls;

type

TEditDataForm = class(TForm)

Panel1: TPanel;

rxDBLookupCombo1: TrxDBLookupCombo;

TableSTUFF: TTable;

DataSourceSTUFF: TDataSource;

DBGrid1: TDBGrid;

DataSourceDATA: TDataSource;

TableDATA: TTable;

TableDATAMass: TFloatField;

TableDATAR_press: TFloatField;

TableDATAR_stretch: TFloatField;

TableDATAPuasson: TFloatField;

TableDATAR1: TFloatField;

TableDATARb: TFloatField;

TableDATAR: TFloatField;

TableDATAA: TFloatField;

TableDATAB: TFloatField;

rxDBFilter1: TrxDBFilter;

TableDATAStuff: TSmallintField;

DBNavigator1: TDBNavigator;

procedure rxDBLookupCombo1Change(Sender: TObject);

procedure DBNavigator1Click(Sender: TObject; Button:

TNavigateBtn);

procedure DBGrid1DblClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

EditDataForm: TEditDataForm;

implementation

{$R *.DFM}

uses

EditForm;

procedure TEditDataForm.rxDBLookupCombo1Change(Sender: TObject);

var

S: String;

begin

rxDBFilter1.Deactivate;

rxDBFilter1.Filter.Clear;

s:='Stuff = '+TableSTUFF.FieldByName('Code').AsString;

rxDBFilter1.Filter.Add(S);

rxDBFilter1.Activate;

end;

procedure TEditDataForm.DBNavigator1Click(Sender: TObject; Button:

TNavigateBtn);

begin

case Button of

nbInsert:

begin

EditDataTub(TableDATA, True,

TableSTUFF.FieldByName('Code').AsInteger);

end;

nbEdit:

begin

EditDataTub(TableDATA, False,

TableSTUFF.FieldByName('Code').AsInteger);

end;

end;

end;

procedure TEditDataForm.DBGrid1DblClick(Sender: TObject);

begin

EditDataTub(TableDATA, False,

TableSTUFF.FieldByName('Code').AsInteger);

end;

end.

unit Editform;

interface

uses

SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics,

Controls, Forms, Dialogs, StdCtrls, Mask, DBCtrls, ExtCtrls, DB,

DBTables, Buttons;

type

TEdTubForm = class(TForm)

DataSource1: TDataSource;

Panel1: TPanel;

DBEdit1: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

DBEdit6: TDBEdit;

Label7: TLabel;

DBEdit7: TDBEdit;

Label8: TLabel;

Label9: TLabel;

Panel2: TPanel;

Panel3: TPanel;

DBEdit8: TDBEdit;

DBEdit9: TDBEdit;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

Table1: TTable;

Label10: TLabel;

DBText1: TDBText;

DataSource2: TDataSource;

Query1: TQuery;

Query1Material: TStringField;

procedure FormCreate(Sender: TObject);

public

FCode: Integer;

function EditTub( Table: TTable; IsNew: Boolean; Code: Integer):

Boolean;

end;

var

EdTubForm: TEdTubForm;

function EditDataTub(Table: TTable; IsNew: Boolean; Code: Integer):

Boolean;

implementation

{$R *.DFM}

function EditDataTub(Table: TTable; IsNew: Boolean; Code: Integer):

Boolean;

begin

Result := False;

with TEdTubForm.Create(Application) do

try

FCode := Code;

Result := EditTub(Table, IsNew, Code);

finally

Free;

end;

end;

function TEdTubForm.EditTub(Table: TTable; IsNew: Boolean; Code:


Страница: