unit ViewModel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, jpeg, StdCtrls, pngimage, JvPanel, JvExExtCtrls,
JvExtComponent, Series, TeeShape, TeEngine, TeeProcs, Chart, Math, TeeGDIPlus,
ComCtrls, JvExComCtrls, JvComCtrls, model, model.stockpile,
controller, dOPCIntf, dOPCComn, dOPCDA, dOPC;
implementation
type
TViewModel =
class(TModel)
private
FModel: TStockpileModel;
FBar:
String;
FFoo:
string;
function GetBioLifeCDS:
String;
function GetFishPictures: TBitmap;
procedure SetBar(
const Value:
String);
procedure SetFoo(
const Value:
string);
public
constructor Create;
destructor Destroy;
override;
property BioLifeCDS:
String read GetBioLifeCDS;
property FishPictures: TBitmap
read GetFishPictures;
property Foo:
string read FFoo
write SetFoo;
property Bar:
String read FBar
write SetBar;
end;
{ TViewModel }
constructor TViewModel.Create;
begin
inherited Create;
FModel := TStockpileModel.Create;
end;
destructor TViewModel.Destroy;
begin
FModel.Free;
inherited;
end;
procedure TViewModel.SetBar(
const Value:
String);
begin
if FBar <> Value
then
begin
FBar := Value;
notify;
end;
end;
procedure TViewModel.SetFoo(
const Value:
string);
begin
if FFoo <> Value
then
begin
FFoo := Value;
notify;
// OnPropertyChanged('Foo');
end;
end;
function TViewModel.GetBioLifeCDS:
String;
begin
Result := FModel.BioLife;
end;
function TViewModel.GetFishPictures: TBitmap;
begin
try
Result := TBitmap.Create;
Result.LoadFromFile
(ExpandFileName(IncludeTrailingPathDelimiter(ExtractFileDir(ParamStr(0)) +
'
') + '
../../Assets/Images/sidebar-icon-error.jpg'));
finally
end;
end;
end.