Выбор материала и расчет параметров обделок вертикальных стволов метрополитеновСтраница 24
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: