STATSZAM

Top  Previous  Next

 

{Földmérési egységek átszámítása}

 

unit Statszam;

 

interface

 

uses

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

Forms, Dialogs, StdCtrls;

 

type

TStTrans = class(TComponent)

private

  Fnegyszogol : double;

  Fm2    : double;

  Fhektar: double;

  FKatHold: double;

  FnegyszogolLabel : TLabel;

  Fm2Label         : TLabel;

  FhektarLabel     : TLabel;

  FKatHoldLabel    : TLabel;

  FOnChange: TNotifyEvent;

  procedure Setnegyszogol(Value:double);

  procedure Setm2(Value:double);

  procedure Sethektar(Value:double);

  procedure SetKatHold(Value:double);

protected

{    procedure Change(Sender: TObject);}

public

  constructor Create(AOwner:TComponent);override;

  destructor Destroy;override;

published

  property Negyszogol    : double read Fnegyszogol write Setnegyszogol;

  property m2    : double read Fm2 write Setm2;

  property Hektar: double read Fhektar write Sethektar;

  property KatHold: double read FKatHold write SetKatHold;

  property NegyszogolLabel : TLabel read FnegyszogolLabel write FnegyszogolLabel;

  property m2Label         : TLabel read Fm2Label write Fm2Label;

  property HektarLabel     : TLabel read FhektarLabel write FhektarLabel;

  property KatHoldLabel    : TLabel read FKatHoldLabel write FKatHoldLabel;

{    property OnChange: TNotifyEvent read FOnChange write FOnChange;}

end;

 

const olpermeter : double = 1.89648384;

    meterperol : double = 0.5272916;

 

implementation

 

constructor TStTrans.Create(AOwner:TComponent);

begin

inherited Create(AOwner);

END;

 

destructor TStTrans.Destroy;

begin

inherited Destroy;

end;

 

procedure TStTrans.SetNegyszogol(Value:double);

begin

Fnegyszogol := Value;

m2 := Value/0.278036432;

end;

 

procedure TStTrans.Setm2(Value:double);

begin

Fm2 := Value;

Fnegyszogol := Value/3.596650954;

Fkathold := Value/5754.642;

Fhektar := Fkathold/1.737727702;

If NegyszogolLabel<>nil then NegyszogolLabel.Caption:=Format('%9.2f',[Fnegyszogol]);

If m2Label<>nil then m2Label.Caption:=Format('%9.2f',[Fm2]);

If hektarLabel<>nil then hektarLabel.Caption:=Format('%9.2f',[Fhektar]);

If KatHoldLabel<>nil then KatHoldLabel.Caption:=Format('%9.2f',[Fkathold]);

{  Change(nil);}

end;

 

procedure TStTrans.Sethektar(Value:double);

begin

Fhektar := Value;

m2 := 1.737727702 * 5754.642 * Value;

end;

 

procedure TStTrans.SetKatHold(Value:double);

begin

FKatHold := Value;

m2 := 5754.642 * Value;

end;

 

{

procedure TStTrans.Change(Sender: TObject);

begin

m2 := m2;

end;

}

 

end.