industrialstuff: Add TA3nalogGauge (by Irnis Haliullin).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6556 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-07-11 17:45:20 +00:00
parent 2e252ce658
commit 3c28657703
18 changed files with 2825 additions and 56 deletions

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="demo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
</General>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="3">
<Unit0>
<Filename Value="demo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
<Unit2>
<Filename Value="..\..\source\a3naloggauge.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\..\source"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,14 @@
program demo;
uses
Interfaces, Forms,
main in 'main.pas' {MainForm};
{$R *.RES}
begin
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

View File

@ -0,0 +1,602 @@
object MainForm: TMainForm
Left = 427
Height = 483
Top = 104
Width = 779
Caption = 'AntiAliased Analog Gauge demo'
ClientHeight = 483
ClientWidth = 779
Color = clBtnFace
Font.Color = clWindowText
OnCreate = FormCreate
Position = poDefaultPosOnly
LCLVersion = '1.9.0.0'
Scaled = False
object Panel1: TPanel
Left = 0
Height = 216
Top = 224
Width = 779
Align = alBottom
BevelOuter = bvNone
ClientHeight = 216
ClientWidth = 779
TabOrder = 0
object MarginLabel: TLabel
Left = 8
Height = 15
Top = 120
Width = 38
Caption = 'Margin'
FocusControl = MarginEdit
ParentColor = False
end
object CenterLabel: TLabel
Left = 104
Height = 15
Top = 120
Width = 70
Caption = 'Center radius'
FocusControl = CenterRadEdit
ParentColor = False
end
object CircleLabel: TLabel
Left = 199
Height = 15
Top = 120
Width = 65
Caption = 'Circle radius'
FocusControl = CircleRadEdit
ParentColor = False
end
object ScaleLabel: TLabel
Left = 295
Height = 15
Top = 120
Width = 58
Caption = 'Scale value'
FocusControl = ScaleEdit
ParentColor = False
end
object AngleLabel: TLabel
Left = 393
Height = 15
Top = 120
Width = 59
Caption = 'Scale angle'
FocusControl = AngleEdit
ParentColor = False
end
object MinimLabel: TLabel
Left = 295
Height = 15
Top = 40
Width = 53
Caption = 'Minimum'
FocusControl = MinimEdit
ParentColor = False
end
object MaximLabel: TLabel
Left = 393
Height = 15
Top = 40
Width = 54
Caption = 'Maximum'
FocusControl = MaximEdit
ParentColor = False
end
object WidthLabel: TLabel
Left = 8
Height = 15
Top = 168
Width = 65
Caption = 'Arrow width'
FocusControl = WidthEdit
ParentColor = False
end
object NumMainLabel: TLabel
Left = 104
Height = 15
Top = 168
Width = 54
Caption = 'Main ticks'
FocusControl = NumMainEdit
ParentColor = False
end
object MainLenLabel: TLabel
Left = 199
Height = 15
Top = 168
Width = 67
Caption = 'Main length '
FocusControl = MainLenEdit
ParentColor = False
end
object SubLenLabel: TLabel
Left = 295
Height = 15
Top = 168
Width = 57
Caption = 'Sub length'
FocusControl = SubLenEdit
ParentColor = False
end
object CaptionLabel: TLabel
Left = 393
Height = 15
Top = 168
Width = 42
Caption = 'Caption'
FocusControl = CaptionEdit
ParentColor = False
end
object FPSLabel: TLabel
Left = 498
Height = 15
Top = 24
Width = 22
Caption = 'FPS:'
ParentColor = False
end
object FreqLabel: TLabel
Left = 393
Height = 15
Top = 0
Width = 89
Caption = 'Timer delay (ms)'
FocusControl = FreqEdit
ParentColor = False
end
object AAModeLabel: TLabel
Left = 295
Height = 15
Top = 0
Width = 62
Caption = 'Antialiasing'
FocusControl = AAModeBox
ParentColor = False
end
object FaceColorButton: TButton
Left = 8
Height = 25
Top = 56
Width = 88
Caption = 'Face color'
OnClick = FaceColorButtonClick
TabOrder = 0
end
object CenterColorButton: TButton
Left = 104
Height = 25
Top = 56
Width = 88
Caption = 'Center color'
OnClick = CenterColorButtonClick
TabOrder = 1
end
object CenterRadEdit: TSpinEdit
Left = 104
Height = 23
Top = 136
Width = 88
MaxValue = 0
OnChange = CenterRadEditChange
TabOrder = 2
end
object CircleColorButton: TButton
Left = 199
Height = 25
Top = 56
Width = 88
Caption = 'Circle color'
OnClick = CircleColorButtonClick
TabOrder = 3
end
object CircleRadEdit: TSpinEdit
Left = 199
Height = 23
Top = 136
Width = 88
MaxValue = 0
OnChange = CircleRadEditChange
TabOrder = 4
end
object MarginEdit: TSpinEdit
Left = 8
Height = 23
Top = 136
Width = 88
MaxValue = 0
OnChange = MarginEditChange
TabOrder = 5
end
object ScaleEdit: TSpinEdit
Left = 295
Height = 23
Top = 136
Width = 88
MaxValue = 0
OnChange = ScaleEditChange
TabOrder = 6
end
object AngleEdit: TSpinEdit
Left = 393
Height = 23
Top = 136
Width = 88
MaxValue = 0
OnChange = AngleEditChange
TabOrder = 7
end
object MinimEdit: TSpinEdit
Left = 295
Height = 23
Top = 56
Width = 88
MaxValue = 0
OnChange = MinimEditChange
TabOrder = 8
end
object MaximEdit: TSpinEdit
Left = 393
Height = 23
Top = 56
Width = 88
MaxValue = 0
OnChange = MaximEditChange
TabOrder = 9
end
object WidthEdit: TSpinEdit
Left = 8
Height = 23
Top = 184
Width = 88
MaxValue = 0
OnChange = WidthEditChange
TabOrder = 10
end
object NumMainEdit: TSpinEdit
Left = 104
Height = 23
Top = 184
Width = 88
MaxValue = 0
OnChange = NumMainEditChange
TabOrder = 11
end
object MainLenEdit: TSpinEdit
Left = 199
Height = 23
Top = 184
Width = 75
MaxValue = 0
OnChange = MainLenEditChange
TabOrder = 12
end
object SubLenEdit: TSpinEdit
Left = 295
Height = 23
Top = 184
Width = 88
MaxValue = 0
OnChange = SubLenEditChange
TabOrder = 13
end
object MarginBox: TCheckBox
Left = 490
Height = 19
Top = 84
Width = 90
Caption = 'Show margin'
OnClick = MarginBoxClick
TabOrder = 14
end
object CirclesBox: TCheckBox
Left = 659
Height = 19
Top = 84
Width = 85
Caption = 'Show circles'
OnClick = CirclesBoxClick
TabOrder = 15
end
object MainTicksBox: TCheckBox
Left = 490
Height = 19
Top = 100
Width = 106
Caption = 'Show main ticks'
OnClick = MainTicksBoxClick
TabOrder = 16
end
object SubticksBox: TCheckBox
Left = 490
Height = 19
Top = 116
Width = 98
Caption = 'Show sub ticks'
OnClick = SubticksBoxClick
TabOrder = 17
end
object IndMinBox: TCheckBox
Left = 490
Height = 19
Top = 132
Width = 155
Caption = 'Show indicator minimum'
OnClick = IndMinBoxClick
TabOrder = 18
end
object IndMidBox: TCheckBox
Left = 490
Height = 19
Top = 148
Width = 123
Caption = 'Show indicator mid'
OnClick = IndMidBoxClick
TabOrder = 19
end
object IndMaxBox: TCheckBox
Left = 490
Height = 19
Top = 164
Width = 156
Caption = 'Show indicator maximum'
OnClick = IndMaxBoxClick
TabOrder = 20
end
object ValuesBox: TCheckBox
Left = 659
Height = 19
Top = 100
Width = 85
Caption = 'Show values'
OnClick = ValuesBoxClick
TabOrder = 21
end
object CenterBox: TCheckBox
Left = 659
Height = 19
Top = 116
Width = 85
Caption = 'Show center'
OnClick = CenterBoxClick
TabOrder = 22
end
object FrameBox: TCheckBox
Left = 659
Height = 19
Top = 132
Width = 83
Caption = 'Show frame'
OnClick = FrameBoxClick
TabOrder = 23
end
object Draw3DBox: TCheckBox
Left = 659
Height = 19
Top = 148
Width = 66
Caption = 'Show 3D'
OnClick = Draw3DBoxClick
TabOrder = 24
end
object CaptionBox: TCheckBox
Left = 659
Height = 19
Top = 164
Width = 92
Caption = 'Show caption'
OnClick = CaptionBoxClick
TabOrder = 25
end
object CaptionEdit: TEdit
Left = 393
Height = 23
Top = 184
Width = 377
OnChange = CaptionEditChange
TabOrder = 26
Text = 'CaptionEdit'
end
object FreqEdit: TSpinEdit
Left = 393
Height = 23
Top = 16
Width = 88
MaxValue = 0
OnChange = FreqEditChange
TabOrder = 27
end
object TicksColorButton: TButton
Left = 8
Height = 25
Top = 88
Width = 88
Caption = 'Ticks color'
OnClick = TicksColorButtonClick
TabOrder = 28
end
object ValueColorButton: TButton
Left = 104
Height = 25
Top = 88
Width = 88
Caption = 'Values color'
OnClick = ValueColorButtonClick
TabOrder = 29
end
object CaptionColorButton: TButton
Left = 199
Height = 25
Top = 88
Width = 88
Caption = 'Caption color'
OnClick = CaptionColorButtonClick
TabOrder = 30
end
object ArrowColorButton: TButton
Left = 295
Height = 25
Top = 88
Width = 88
Caption = 'Arrow color'
OnClick = ArrowColorButtonClick
TabOrder = 31
end
object MarginColorButton: TButton
Left = 393
Height = 25
Top = 88
Width = 88
Caption = 'Margin color'
OnClick = MarginColorButtonClick
TabOrder = 32
end
object MinColorButton: TButton
Left = 490
Height = 25
Top = 56
Width = 88
Caption = 'Min color'
OnClick = MinColorButtonClick
TabOrder = 33
end
object MidColorButton: TButton
Left = 584
Height = 25
Top = 56
Width = 88
Caption = 'Mid color'
OnClick = MidColorButtonClick
TabOrder = 34
end
object MaxColorButton: TButton
Left = 678
Height = 25
Top = 56
Width = 88
Caption = 'Max color'
OnClick = MaxColorButtonClick
TabOrder = 35
end
object AAModeBox: TComboBox
Left = 295
Height = 23
Top = 16
Width = 88
ItemHeight = 15
Items.Strings = (
'None'
'Biline'
'Triline'
'Quadral'
)
OnChange = AAModeBoxChange
Style = csDropDownList
TabOrder = 36
end
object StyleBox: TComboBox
Left = 199
Height = 23
Top = 16
Width = 88
ItemHeight = 15
ItemIndex = 2
Items.Strings = (
'Left'
'Right'
'Center'
)
OnChange = StyleBoxChange
Style = csDropDownList
TabOrder = 37
Text = 'Center'
end
object AAModeLabel1: TLabel
Left = 199
Height = 15
Top = 0
Width = 25
Caption = 'Style'
FocusControl = StyleBox
ParentColor = False
end
end
object Panel2: TPanel
Left = 0
Height = 43
Top = 440
Width = 779
Align = alBottom
BevelOuter = bvNone
ClientHeight = 43
ClientWidth = 779
TabOrder = 1
object CloseButton: TButton
Left = 8
Height = 25
Top = 8
Width = 88
Caption = 'Close'
OnClick = CloseButtonClick
TabOrder = 0
end
object AboutLabel: TLabel
Left = 96
Height = 40
Top = 0
Width = 682
Alignment = taCenter
Anchors = [akLeft, akRight, akBottom]
AutoSize = False
Caption = 'Anti Aliased Analog Gauge component demonstration. '#13#10'(c) Irnis Haliullin, http://www.irnis.net/'
Layout = tlCenter
ParentColor = False
OnClick = AboutLabelClick
OnMouseMove = AboutLabelMouseMove
end
end
object Panel3: TPanel
Left = 0
Height = 224
Top = 0
Width = 779
Align = alClient
BevelOuter = bvNone
TabOrder = 2
end
object Timer: TTimer
Interval = 10
OnTimer = TimerTimer
left = 88
top = 112
end
object ColorDialog: TColorDialog
Color = clBlack
CustomColors.Strings = (
'ColorA=000000'
'ColorB=000080'
'ColorC=008000'
'ColorD=008080'
'ColorE=800000'
'ColorF=800080'
'ColorG=808000'
'ColorH=808080'
'ColorI=C0C0C0'
'ColorJ=0000FF'
'ColorK=00FF00'
'ColorL=00FFFF'
'ColorM=FF0000'
'ColorN=FF00FF'
'ColorO=FFFF00'
'ColorP=FFFFFF'
'ColorQ=C0DCC0'
'ColorR=F0CAA6'
'ColorS=F0FBFF'
'ColorT=A4A0A0'
)
left = 224
top = 120
end
end

View File

@ -0,0 +1,684 @@
unit main;
{$DEFINE TICKER}
{$IFDEF LCL}
{$MODE DELPHI}
{$IFNDEF WINDOWS}{$UNDEF TICKER}{$ENDIF}
{$ENDIF}
interface
uses
Windows, Messages, ShellApi, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls, Spin, A3nalogGauge;
type
{ TMainForm }
TMainForm = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
StyleBox: TComboBox;
AAModeLabel1: TLabel;
Timer: TTimer;
ColorDialog: TColorDialog;
FPSLabel: TLabel;
FreqLabel: TLabel;
FreqEdit: TSpinEdit;
FaceColorButton: TButton;
CenterColorButton: TButton;
CircleColorButton: TButton;
MinimLabel: TLabel;
MinimEdit: TSpinEdit;
MaximLabel: TLabel;
MaximEdit: TSpinEdit;
MinColorButton: TButton;
MidColorButton: TButton;
MaxColorButton: TButton;
TicksColorButton: TButton;
ValueColorButton: TButton;
CaptionColorButton: TButton;
ArrowColorButton: TButton;
MarginColorButton: TButton;
MarginLabel: TLabel;
MarginEdit: TSpinEdit;
CenterLabel: TLabel;
CenterRadEdit: TSpinEdit;
CircleLabel: TLabel;
CircleRadEdit: TSpinEdit;
ScaleLabel: TLabel;
ScaleEdit: TSpinEdit;
AngleLabel: TLabel;
AngleEdit: TSpinEdit;
WidthLabel: TLabel;
WidthEdit: TSpinEdit;
NumMainLabel: TLabel;
NumMainEdit: TSpinEdit;
MainLenLabel: TLabel;
MainLenEdit: TSpinEdit;
SubLenLabel: TLabel;
SubLenEdit: TSpinEdit;
MarginBox: TCheckBox;
MainTicksBox: TCheckBox;
SubticksBox: TCheckBox;
IndMinBox: TCheckBox;
IndMidBox: TCheckBox;
IndMaxBox: TCheckBox;
CirclesBox: TCheckBox;
ValuesBox: TCheckBox;
CenterBox: TCheckBox;
FrameBox: TCheckBox;
Draw3DBox: TCheckBox;
CaptionBox: TCheckBox;
CaptionLabel: TLabel;
CaptionEdit: TEdit;
CloseButton: TButton;
AboutLabel: TLabel;
AAModeBox: TComboBox;
AAModeLabel: TLabel;
procedure FormCreate(Sender: TObject);
procedure StyleBoxChange(Sender: TObject);
procedure TimerTimer(Sender: TObject);
{$IFDEF TICKER}
procedure FramesChanged(Sender: TObject);
{$ENDIF}
procedure AAModeBoxChange(Sender: TObject);
procedure FreqEditChange(Sender: TObject);
procedure FaceColorButtonClick(Sender: TObject);
procedure CenterColorButtonClick(Sender: TObject);
procedure CircleColorButtonClick(Sender: TObject);
procedure MinimEditChange(Sender: TObject);
procedure MaximEditChange(Sender: TObject);
procedure MinColorButtonClick(Sender: TObject);
procedure MidColorButtonClick(Sender: TObject);
procedure MaxColorButtonClick(Sender: TObject);
procedure TicksColorButtonClick(Sender: TObject);
procedure ValueColorButtonClick(Sender: TObject);
procedure CaptionColorButtonClick(Sender: TObject);
procedure ArrowColorButtonClick(Sender: TObject);
procedure MarginColorButtonClick(Sender: TObject);
procedure MarginEditChange(Sender: TObject);
procedure CenterRadEditChange(Sender: TObject);
procedure CircleRadEditChange(Sender: TObject);
procedure ScaleEditChange(Sender: TObject);
procedure AngleEditChange(Sender: TObject);
procedure WidthEditChange(Sender: TObject);
procedure NumMainEditChange(Sender: TObject);
procedure MainLenEditChange(Sender: TObject);
procedure SubLenEditChange(Sender: TObject);
procedure MarginBoxClick(Sender: TObject);
procedure MainTicksBoxClick(Sender: TObject);
procedure SubticksBoxClick(Sender: TObject);
procedure IndMinBoxClick(Sender: TObject);
procedure IndMidBoxClick(Sender: TObject);
procedure IndMaxBoxClick(Sender: TObject);
procedure CirclesBoxClick(Sender: TObject);
procedure ValuesBoxClick(Sender: TObject);
procedure CenterBoxClick(Sender: TObject);
procedure FrameBoxClick(Sender: TObject);
procedure Draw3DBoxClick(Sender: TObject);
procedure CaptionBoxClick(Sender: TObject);
procedure CaptionEditChange(Sender: TObject);
procedure CloseButtonClick(Sender: TObject);
procedure AboutLabelMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure AboutLabelClick(Sender: TObject);
private
AnalogGauge1: TA3nalogGauge;
AnalogGauge2: TA3nalogGauge;
AnalogGauge3: TA3nalogGauge;
FDelta: Double;
end;
var
MainForm: TMainForm;
implementation
{$IFDEF FPC}
{$R *.lfm}
{$ELSE}
{$R *.dfm}
{$DEFINE TICKER}
{$ENDIF}
procedure TMainForm.FormCreate(Sender: TObject);
begin
AnalogGauge1 := TA3nalogGauge.Create(self);
with AnalogGauge1 do begin
Parent := Panel3;
Left := 8;
Top := 16;
Width := 278;
Height := 200; //245;
Anchors := [akLeft, akTop, akBottom];
Angle := 90;
Caption := 'mV';
AntiAliased := aaNone;
CaptionFont.Style := [fsBold];
end;
AnalogGauge2 := TA3nalogGauge.Create(self);
with AnalogGauge2 do begin
Parent := Panel3;
Left := 295;
Top := 16;
Width := 185;
Height := 200;
Anchors := [akLeft, akRight, akTop, akBottom];
Caption := 'mV';
AntiAliased := aaNone;
CaptionFont.Style := [fsBold];
end;
AnalogGauge3 := TA3nalogGauge.Create(self);
with AnalogGauge3 do begin
Parent := Panel3;
Left := 490;
Top := 16;
Width := 278;
Height := 200; //245;
Anchors := [akRight, akTop, akBottom];
Angle := 180;
Caption := 'mV';
AntiAliased := aaNone;
CaptionFont.Style := [fsBold];
end;
CenterRadEdit.Value := AnalogGauge1.CenterRadius;
CircleRadEdit.Value := AnalogGauge1.CircleRadius;
MarginEdit.Value := AnalogGauge1.Margin;
ScaleEdit.Value := AnalogGauge1.Scale;
AngleEdit.Value := AnalogGauge1.Angle;
MinimEdit.Value := AnalogGauge1.IndMinimum;
MaximEdit.Value := AnalogGauge1.IndMaximum;
WidthEdit.Value := AnalogGauge1.ArrowWidth;
NumMainEdit.Value := AnalogGauge1.NumberMainTicks;
MainLenEdit.Value := AnalogGauge1.LengthMainTicks;
SubLenEdit.Value := AnalogGauge1.LengthSubTicks;
MarginBox.Checked := foShowMargin in AnalogGauge1.FaceOptions;
CirclesBox.Checked := foShowCircles in AnalogGauge1.FaceOptions;
MainTicksBox.Checked := foShowMainTicks in AnalogGauge1.FaceOptions;
SubTicksBox.Checked := foShowSubTicks in AnalogGauge1.FaceOptions;
IndMinBox.Checked := foShowIndicatorMin in AnalogGauge1.FaceOptions;
IndMidBox.Checked := foShowIndicatorMid in AnalogGauge1.FaceOptions;
IndMaxBox.Checked := foShowIndicatorMax in AnalogGauge1.FaceOptions;
ValuesBox.Checked := foShowValues in AnalogGauge1.FaceOptions;
CenterBox.Checked := foShowCenter in AnalogGauge1.FaceOptions;
FrameBox.Checked := foShowFrame in AnalogGauge1.FaceOptions;
Draw3DBox.Checked := foShow3D in AnalogGauge1.FaceOptions;
CaptionBox.Checked := foShowCaption in AnalogGauge1.FaceOptions;
CaptionEdit.Text := AnalogGauge1.Caption;
FreqEdit.Value := Timer.Interval;
AAModeBox.ItemIndex := 0;
{$IFDEF TICKER}
AnalogGauge1.OnFrames := FramesChanged;
{$ENDIF}
end;
procedure TMainForm.StyleBoxChange(Sender: TObject);
begin
AnalogGauge1.Style := TStyle(StyleBox.ItemIndex);
AnalogGauge2.Style := TStyle(StyleBox.ItemIndex);
AnalogGauge3.Style := TStyle(StyleBox.ItemIndex);
end;
procedure TMainForm.TimerTimer(Sender: TObject);
var
V: Double;
begin
V := AnalogGauge1.Position;
if FDelta = 0 then FDelta := 1;
V := V + FDelta;
if V < 0 then begin
V := 0;
FDelta := -FDelta
end else
if V > AnalogGauge1.Scale then begin
V := AnalogGauge1.Scale;
FDelta := -FDelta
end;
AnalogGauge1.Position := V;
AnalogGauge2.Position := V;
AnalogGauge3.Position := V;
end;
{$IFDEF TICKER}
procedure TMainForm.FramesChanged(Sender: TObject);
begin
FPSLabel.Caption := Format('FPS: %d', [AnalogGauge1.Frames]);
end;
{$ENDIF}
procedure TMainForm.AAModeBoxChange(Sender: TObject);
var
AA: TAntialiased;
begin
case AAModeBox.ItemIndex of
1: AA := aaBiline;
2: AA := aaTriline;
3: AA := aaQuadral;
else AA := aaNone
end;
AnalogGauge1.AntiAliased := AA;
AnalogGauge2.AntiAliased := AA;
AnalogGauge3.AntiAliased := AA;
end;
procedure TMainForm.FreqEditChange(Sender: TObject);
begin
Timer.Interval := FreqEdit.Value
end;
procedure TMainForm.FaceColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.FaceColor;
if ColorDialog.Execute then begin
AnalogGauge1.FaceColor := ColorDialog.Color;
AnalogGauge2.FaceColor := ColorDialog.Color;
AnalogGauge3.FaceColor := ColorDialog.Color;
end;
end;
procedure TMainForm.CenterColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.CenterColor;
if ColorDialog.Execute then begin
AnalogGauge1.CenterColor := ColorDialog.Color;
AnalogGauge2.CenterColor := ColorDialog.Color;
AnalogGauge3.CenterColor := ColorDialog.Color;
end;
end;
procedure TMainForm.CircleColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.CircleColor;
if ColorDialog.Execute then begin
AnalogGauge1.CircleColor := ColorDialog.Color;
AnalogGauge2.CircleColor := ColorDialog.Color;
AnalogGauge3.CircleColor := ColorDialog.Color;
end;
end;
procedure TMainForm.MinimEditChange(Sender: TObject);
begin
if MinimEdit.Text <> '' then begin
AnalogGauge1.IndMinimum := MinimEdit.Value;
AnalogGauge2.IndMinimum := MinimEdit.Value;
AnalogGauge3.IndMinimum := MinimEdit.Value;
end;
end;
procedure TMainForm.MaximEditChange(Sender: TObject);
begin
if MaximEdit.Text <> '' then begin
AnalogGauge1.IndMaximum := MaximEdit.Value;
AnalogGauge2.IndMaximum := MaximEdit.Value;
AnalogGauge3.IndMaximum := MaximEdit.Value;
end;
end;
procedure TMainForm.MinColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.MinColor;
if ColorDialog.Execute then begin
AnalogGauge1.MinColor := ColorDialog.Color;
AnalogGauge2.MinColor := ColorDialog.Color;
AnalogGauge3.MinColor := ColorDialog.Color;
end;
end;
procedure TMainForm.MidColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.MidColor;
if ColorDialog.Execute then begin
AnalogGauge1.MidColor := ColorDialog.Color;
AnalogGauge2.MidColor := ColorDialog.Color;
AnalogGauge3.MidColor := ColorDialog.Color;
end;
end;
procedure TMainForm.MaxColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.MaxColor;
if ColorDialog.Execute then begin
AnalogGauge1.MaxColor := ColorDialog.Color;
AnalogGauge2.MaxColor := ColorDialog.Color;
AnalogGauge3.MaxColor := ColorDialog.Color;
end;
end;
procedure TMainForm.TicksColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.TicksColor;
if ColorDialog.Execute then begin
AnalogGauge1.TicksColor := ColorDialog.Color;
AnalogGauge2.TicksColor := ColorDialog.Color;
AnalogGauge3.TicksColor := ColorDialog.Color;
end;
end;
procedure TMainForm.ValueColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.ValueColor;
if ColorDialog.Execute then begin
AnalogGauge1.ValueColor := ColorDialog.Color;
AnalogGauge2.ValueColor := ColorDialog.Color;
AnalogGauge3.ValueColor := ColorDialog.Color;
end;
end;
procedure TMainForm.CaptionColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.CaptionColor;
if ColorDialog.Execute then begin
AnalogGauge1.CaptionColor := ColorDialog.Color;
AnalogGauge2.CaptionColor := ColorDialog.Color;
AnalogGauge3.CaptionColor := ColorDialog.Color;
end;
end;
procedure TMainForm.ArrowColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.ArrowColor;
if ColorDialog.Execute then begin
AnalogGauge1.ArrowColor := ColorDialog.Color;
AnalogGauge2.ArrowColor := ColorDialog.Color;
AnalogGauge3.ArrowColor := ColorDialog.Color;
end;
end;
procedure TMainForm.MarginColorButtonClick(Sender: TObject);
begin
ColorDialog.Color := AnalogGauge1.MarginColor;
if ColorDialog.Execute then begin
AnalogGauge1.MarginColor := ColorDialog.Color;
AnalogGauge2.MarginColor := ColorDialog.Color;
AnalogGauge3.MarginColor := ColorDialog.Color;
end;
end;
procedure TMainForm.MarginEditChange(Sender: TObject);
begin
if MarginEdit.Text <> '' then begin
AnalogGauge1.Margin := MarginEdit.Value;
AnalogGauge2.Margin := MarginEdit.Value;
AnalogGauge3.Margin := MarginEdit.Value;
end;
end;
procedure TMainForm.CenterRadEditChange(Sender: TObject);
begin
if CenterRadEdit.Text <> '' then begin
AnalogGauge1.CenterRadius := CenterRadEdit.Value;
AnalogGauge2.CenterRadius := CenterRadEdit.Value;
AnalogGauge3.CenterRadius := CenterRadEdit.Value;
end;
end;
procedure TMainForm.CircleRadEditChange(Sender: TObject);
begin
if CircleRadEdit.Text <> '' then begin
AnalogGauge1.CircleRadius := CircleRadEdit.Value;
AnalogGauge2.CircleRadius := CircleRadEdit.Value;
AnalogGauge3.CircleRadius := CircleRadEdit.Value;
end;
end;
procedure TMainForm.ScaleEditChange(Sender: TObject);
begin
if ScaleEdit.Text <> '' then begin
AnalogGauge1.Scale := ScaleEdit.Value;
AnalogGauge2.Scale := ScaleEdit.Value;
AnalogGauge3.Scale := ScaleEdit.Value;
end;
end;
procedure TMainForm.AngleEditChange(Sender: TObject);
begin
if AngleEdit.Text <> '' then begin
AnalogGauge1.Angle := AngleEdit.Value;
AnalogGauge2.Angle := AngleEdit.Value;
AnalogGauge3.Angle := AngleEdit.Value;
end;
end;
procedure TMainForm.WidthEditChange(Sender: TObject);
begin
if WidthEdit.Text <> '' then begin
AnalogGauge1.ArrowWidth := WidthEdit.Value;
AnalogGauge2.ArrowWidth := WidthEdit.Value;
AnalogGauge3.ArrowWidth := WidthEdit.Value;
end;
end;
procedure TMainForm.NumMainEditChange(Sender: TObject);
begin
if NumMainEdit.Text <> '' then begin
AnalogGauge1.NumberMainTicks := NumMainEdit.Value;
AnalogGauge2.NumberMainTicks := NumMainEdit.Value;
AnalogGauge3.NumberMainTicks := NumMainEdit.Value;
end;
end;
procedure TMainForm.MainLenEditChange(Sender: TObject);
begin
if MainLenEdit.Text <> '' then begin
AnalogGauge1.LengthMainTicks := MainLenEdit.Value;
AnalogGauge2.LengthMainTicks := MainLenEdit.Value;
AnalogGauge3.LengthMainTicks := MainLenEdit.Value;
end;
end;
procedure TMainForm.SubLenEditChange(Sender: TObject);
begin
if SubLenEdit.Text <> '' then begin
AnalogGauge1.LengthSubTicks := SubLenEdit.Value;
AnalogGauge2.LengthSubTicks := SubLenEdit.Value;
AnalogGauge3.LengthSubTicks := SubLenEdit.Value;
end;
end;
procedure TMainForm.MarginBoxClick(Sender: TObject);
begin
if MarginBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowMargin];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowMargin];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowMargin];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowMargin];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowMargin];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowMargin];
end;
end;
procedure TMainForm.MainTicksBoxClick(Sender: TObject);
begin
if MainTicksBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowMainTicks];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowMainTicks];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowMainTicks];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowMainTicks];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowMainTicks];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowMainTicks];
end;
end;
procedure TMainForm.SubTicksBoxClick(Sender: TObject);
begin
if SubTicksBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowSubTicks];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowSubTicks];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowSubTicks];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowSubTicks];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowSubTicks];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowSubTicks];
end;
end;
procedure TMainForm.IndMinBoxClick(Sender: TObject);
begin
if IndMinBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowIndicatorMin];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowIndicatorMin];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowIndicatorMin];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowIndicatorMin];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowIndicatorMin];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowIndicatorMin];
end;
end;
procedure TMainForm.IndMidBoxClick(Sender: TObject);
begin
if IndMidBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowIndicatorMid];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowIndicatorMid];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowIndicatorMid];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowIndicatorMid];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowIndicatorMid];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowIndicatorMid];
end;
end;
procedure TMainForm.IndMaxBoxClick(Sender: TObject);
begin
if IndMaxBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowIndicatorMax];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowIndicatorMax];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowIndicatorMax];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowIndicatorMax];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowIndicatorMax];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowIndicatorMax];
end;
end;
procedure TMainForm.CirclesBoxClick(Sender: TObject);
begin
if CirclesBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowCircles];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowCircles];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowCircles];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowCircles];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowCircles];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowCircles];
end;
end;
procedure TMainForm.ValuesBoxClick(Sender: TObject);
begin
if ValuesBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowValues];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowValues];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowValues];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowValues];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowValues];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowValues];
end;
end;
procedure TMainForm.CenterBoxClick(Sender: TObject);
begin
if CenterBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowCenter];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowCenter];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowCenter];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowCenter];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowCenter];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowCenter];
end;
end;
procedure TMainForm.FrameBoxClick(Sender: TObject);
begin
if FrameBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowFrame];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowFrame];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowFrame];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowFrame];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowFrame];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowFrame];
end;
end;
procedure TMainForm.Draw3DBoxClick(Sender: TObject);
begin
if Draw3DBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShow3D];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShow3D];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShow3D];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShow3D];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShow3D];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShow3D];
end;
end;
procedure TMainForm.CaptionBoxClick(Sender: TObject);
begin
if CaptionBox.Checked then begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions + [foShowCaption];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions + [foShowCaption];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions + [foShowCaption];
end else begin
AnalogGauge1.FaceOptions := AnalogGauge1.FaceOptions - [foShowCaption];
AnalogGauge2.FaceOptions := AnalogGauge2.FaceOptions - [foShowCaption];
AnalogGauge3.FaceOptions := AnalogGauge3.FaceOptions - [foShowCaption];
end;
end;
procedure TMainForm.CaptionEditChange(Sender: TObject);
begin
AnalogGauge1.Caption := CaptionEdit.Text;
AnalogGauge2.Caption := CaptionEdit.Text;
AnalogGauge3.Caption := CaptionEdit.Text;
end;
procedure TMainForm.CloseButtonClick(Sender: TObject);
begin
Close
end;
procedure TMainForm.AboutLabelMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var
Control: TLabel;
begin
Control := Sender as TLabel;
if (X > 0) and (X < Control.Width) and
(Y > 0) and (Y < Control.Height) then begin
Control.Font.Style := Control.Font.Style + [fsUnderLine];
Control.Cursor := crHandPoint;
Windows.SetCursor(Screen.Cursors[Control.Cursor]);
SetCaptureControl(Control);
end else begin
Control.Font.Style := Control.Font.Style - [fsUnderLine];
Control.Cursor := crDefault;
SetCaptureControl(nil);
end;
end;
procedure TMainForm.AboutLabelClick(Sender: TObject);
var
Control: TLabel;
begin
Control := Sender as TLabel;
Control.Font.Style := Control.Font.Style - [fsUnderLine];
Control.Cursor := crDefault; SetCaptureControl(nil);
ShellExecute(0, nil, PChar('http://www.irnis.net/'), nil, nil, SW_SHOWDEFAULT);
end;
end.

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/> <Version Value="11"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
@ -13,9 +13,6 @@
<i18n> <i18n>
<EnableI18N LFM="False"/> <EnableI18N LFM="False"/>
</i18n> </i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1"> <BuildModes Count="1">
<Item1 Name="Default" Default="True"/> <Item1 Name="Default" Default="True"/>
</BuildModes> </BuildModes>
@ -25,9 +22,10 @@
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<local> <FormatVersion Value="2"/>
<FormatVersion Value="1"/> <Modes Count="1">
</local> <Mode0 Name="default"/>
</Modes>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>
@ -41,7 +39,6 @@
<Unit0> <Unit0>
<Filename Value="Ex_IndustrialStuff.lpr"/> <Filename Value="Ex_IndustrialStuff.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="Ex_IndustrialStuff"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="u_industrial.pas"/> <Filename Value="u_industrial.pas"/>
@ -49,7 +46,6 @@
<ComponentName Value="Form1"/> <ComponentName Value="Form1"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="u_industrial"/>
</Unit1> </Unit1>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
@ -82,12 +78,6 @@
</Win32> </Win32>
</Options> </Options>
</Linking> </Linking>
<Other>
<CompilerMessages>
<MsgFileName Value=""/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions> </CompilerOptions>
<Debugging> <Debugging>
<Exceptions Count="3"> <Exceptions Count="3">

View File

@ -1,12 +1,12 @@
object Form1: TForm1 object Form1: TForm1
Left = 123 Left = 159
Height = 166 Height = 223
Top = 95 Top = 156
Width = 568 Width = 824
Caption = 'IndustrialStuff Example' Caption = 'IndustrialStuff Example'
ClientHeight = 166 ClientHeight = 223
ClientWidth = 568 ClientWidth = 824
LCLVersion = '1.1' LCLVersion = '1.9.0.0'
object indLed1: TindLed object indLed1: TindLed
Left = 200 Left = 200
Height = 35 Height = 35
@ -40,7 +40,6 @@ object Form1: TForm1
Height = 59 Height = 59
Top = 24 Top = 24
Width = 25 Width = 25
Center = True
Picture.Data = { Picture.Data = {
1754506F727461626C654E6574776F726B47726170686963EF00000089504E47 1754506F727461626C654E6574776F726B47726170686963EF00000089504E47
0D0A1A0A0000000D49484452000000150000002B08020000001805541C000000 0D0A1A0A0000000D49484452000000150000002B08020000001805541C000000
@ -55,23 +54,22 @@ object Form1: TForm1
State = slRED State = slRED
end end
object LEDNumber1: TLEDNumber object LEDNumber1: TLEDNumber
Left = 32 Left = 40
Height = 28 Height = 28
Top = 116 Top = 128
Width = 177 Width = 177
Caption = 'Lazarus' Caption = 'Lazarus'
OffColor = 930866
OnColor = clLime
end end
object AnalogSensor1: TAnalogSensor object AnalogSensor1: TAnalogSensor
Left = 256 Left = 256
Height = 136 Height = 152
Top = 8 Top = 8
Width = 153 Width = 153
BevelOuter = bvNone
BorderWidth = 2 BorderWidth = 2
BorderStyle = bsSingle BorderStyle = bsSingle
Caption = 'level : ' Caption = 'level : '
ClientHeight = 132 ClientHeight = 148
ClientWidth = 149 ClientWidth = 149
Font.Height = -16 Font.Height = -16
Font.Name = 'Arial' Font.Name = 'Arial'
@ -80,9 +78,9 @@ object Form1: TForm1
TabOrder = 0 TabOrder = 0
ShowText = True ShowText = True
ShowLevel = True ShowLevel = True
ColorFore = clLime ColorRed = clYellow
ColorBack = clBlack ColorYellow = clRed
Value = 20 Value = 70
ValueMin = 0 ValueMin = 0
ValueMax = 100 ValueMax = 100
ValueRed = 30 ValueRed = 30
@ -91,7 +89,7 @@ object Form1: TForm1
end end
object indGnouMeter1: TindGnouMeter object indGnouMeter1: TindGnouMeter
Left = 424 Left = 424
Height = 129 Height = 143
Top = 17 Top = 17
Width = 120 Width = 120
Caption = 'indGnouMeter1' Caption = 'indGnouMeter1'
@ -109,7 +107,7 @@ object Form1: TForm1
Transparent = True Transparent = True
GapTop = 20 GapTop = 20
GapBottom = 10 GapBottom = 10
BarThickness = 5 BarThickness = 6
MarkerColor = clBlue MarkerColor = clBlue
ShowMarker = True ShowMarker = True
end end
@ -129,6 +127,31 @@ object Form1: TForm1
Kind = lkYellowLight Kind = lkYellowLight
State = lsOn State = lsOn
Blink = False Blink = False
AutoSize = True end
object A3nalogGauge1: TA3nalogGauge
Left = 568
Height = 192
Top = 16
Width = 241
ArrowWidth = 2
Caption = 'mV'
CaptionFont.Height = -16
CaptionFont.Style = [fsBold]
CenterColor = clSilver
FaceOptions = [foShowMainTicks, foShowSubTicks, foShowIndicatorMin, foShowIndicatorMid, foShowIndicatorMax, foShowValues, foShowCenter, foShowFrame, foShowCaption]
IndMaximum = 60
IndMinimum = 30
Position = 70
end
object TrackBar1: TTrackBar
Left = 32
Height = 25
Top = 184
Width = 504
Frequency = 10
Max = 100
OnChange = TrackBar1Change
Position = 70
TabOrder = 2
end end
end end

View File

@ -5,14 +5,15 @@ unit u_industrial;
interface interface
uses uses
Classes, SysUtils, FileUtil, IndLed, Sensors, LedNumber, Classes, SysUtils, FileUtil, IndLed, Sensors, LedNumber, IndGnouMeter, AdvLed,
IndGnouMeter, AdvLed, Forms, Controls, Graphics, Dialogs, Arrow; A3nalogGauge, Forms, Controls, Graphics, Dialogs, Arrow, ComCtrls;
type type
{ TForm1 } { TForm1 }
TForm1 = class(TForm) TForm1 = class(TForm)
A3nalogGauge1: TA3nalogGauge;
AdvLed1: TAdvLed; AdvLed1: TAdvLed;
AnalogSensor1: TAnalogSensor; AnalogSensor1: TAnalogSensor;
Arrow1: TArrow; Arrow1: TArrow;
@ -20,6 +21,8 @@ type
indLed1: TindLed; indLed1: TindLed;
LEDNumber1: TLEDNumber; LEDNumber1: TLEDNumber;
StopLightSensor1: TStopLightSensor; StopLightSensor1: TStopLightSensor;
TrackBar1: TTrackBar;
procedure TrackBar1Change(Sender: TObject);
private private
public public
@ -35,5 +38,12 @@ implementation
{ TForm1 } { TForm1 }
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
A3nalogGauge1.Position := Trackbar1.Position;
indGnouMeter1.Value := Trackbar1.Position;
AnalogSensor1.Value := Trackbar1.Position;
end;
end. end.

View File

@ -1,9 +1,10 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<Package Version="4"> <Package Version="4">
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Name Value="industrial"/> <Name Value="industrial"/>
<Author Value="Jurassic Pork"/> <Type Value="RunAndDesignTime"/>
<Author Value="Jurassic Pork; A3nalogGauge by Irnis Haliullin"/>
<CompilerOptions> <CompilerOptions>
<Version Value="11"/> <Version Value="11"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
@ -23,17 +24,11 @@
<GenerateDebugInfo Value="False"/> <GenerateDebugInfo Value="False"/>
</Debugging> </Debugging>
</Linking> </Linking>
<Other>
<CompilerMessages>
<MsgFileName Value=""/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions> </CompilerOptions>
<Description Value="Industrial-themed (IPV/PCV) components and gauges (e.g. LEDs)."/> <Description Value="Industrial-themed (IPV/PCV) components and gauges (e.g. LEDs)."/>
<License Value="MPL + GPL "/> <License Value="MPL + GPL "/>
<Version Minor="1"/> <Version Minor="2"/>
<Files Count="10"> <Files Count="11">
<Item1> <Item1>
<Filename Value="source\indled.pas"/> <Filename Value="source\indled.pas"/>
<UnitName Value="IndLed"/> <UnitName Value="IndLed"/>
@ -53,7 +48,7 @@
</Item4> </Item4>
<Item5> <Item5>
<Filename Value="source\indgnoumeter.pas"/> <Filename Value="source\indgnoumeter.pas"/>
<UnitName Value="IndGnouMeter"/> <UnitName Value="indGnouMeter"/>
</Item5> </Item5>
<Item6> <Item6>
<Filename Value="source\AdvLed.pas"/> <Filename Value="source\AdvLed.pas"/>
@ -75,8 +70,11 @@
<Filename Value="source\indcyTypes.pas"/> <Filename Value="source\indcyTypes.pas"/>
<UnitName Value="indcyTypes"/> <UnitName Value="indcyTypes"/>
</Item10> </Item10>
<Item11>
<Filename Value="source\a3naloggauge.pas"/>
<UnitName Value="A3nalogGauge"/>
</Item11>
</Files> </Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="1"> <RequiredPkgs Count="1">
<Item1> <Item1>
<PackageName Value="IDEIntf"/> <PackageName Value="IDEIntf"/>

View File

@ -9,7 +9,8 @@ interface
uses uses
IndLed, Sensors, AllIndustrialRegister, LedNumber, indGnouMeter, AdvLed, IndLed, Sensors, AllIndustrialRegister, LedNumber, indGnouMeter, AdvLed,
indcyBaseLed, indcyClasses, indcyGraphics, indcyTypes, LazarusPackageIntf; indcyBaseLed, indcyClasses, indcyGraphics, indcyTypes, A3nalogGauge,
LazarusPackageIntf;
implementation implementation

View File

@ -1,3 +1,3 @@
..\..\..\tools\lazres ..\source\sensors.res @sensors.txt lazres ..\source\sensors.res @sensors.txt
..\..\..\tools\lazres ..\source\industrial_icons.res @industrial_icons.txt lazres ..\source\industrial_icons.res @industrial_icons.txt
..\..\..\tools\lazres ..\source\ledbuttons.res @ledbuttons.txt lazres ..\source\ledbuttons.res @ledbuttons.txt

View File

@ -4,3 +4,4 @@ tindgnoumeter.png
tindled.png tindled.png
tlednumber.png tlednumber.png
tstoplightsensor.png tstoplightsensor.png
ta3naloggauge.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

View File

@ -11,7 +11,8 @@ interface
uses uses
Classes, LResources, AdvLed, IndLed, LedNumber, Sensors, IndGnouMeter; Classes, LResources, AdvLed, IndLed, LedNumber, Sensors, IndGnouMeter,
A3nalogGauge;
procedure Register; procedure Register;
@ -23,7 +24,9 @@ implementation
procedure Register; procedure Register;
begin begin
RegisterComponents ('Industrial',[ RegisterComponents ('Industrial',[
TAdvLed, TIndLed, TLedNumber, TStopLightSensor, TAnalogSensor, TindGnouMeter]); TAdvLed, TIndLed, TLedNumber, TStopLightSensor,
TAnalogSensor, TA3nalogGauge, TindGnouMeter
]);
end; end;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,84 @@
AntiAliased AnalogGauge component for Delphi
============================================
2002, Irnis Haliullin (irnis@irnis.net)
based on AnalogGauge component source
by Shteg Vyacheslav (slast@softhome.net),
use the supersampling algoritm source
by Nacho Urenda (nurenda@wanadoo.es)
Overview
--------------------------------------------
A3nalogGauge - simple component for displaying
floating point value as analog voltmeter. In
addition to AnalogGauge component, the A3nalogGauge
allow to use the supersampling antialiasing algorithm
for improvement the image quality. Besides, the
A3nalogGauge contains additional properties for
more powerfull control of the own face. And also
others, less significant improvements.
Licenses
--------------------------------------------
This component is free for use in any purposes.
Contacts
--------------------------------------------
All questons, bugreports and suggestions
please send by mail to: irnis@irnis.net
Reference
--------------------------------------------
The component contains fallowing properties:
- these properties define the voltmeter elements colors:
* MinColor: TColor - color of indicator of minimum range;
* MidColor: TColor - color of indicator of normal range;
* MaxColor: TColor - color of indicator of maximum range;
* FaceColor: TColor - voltmeter scale background color;
* TicksColor: TColor - voltmeter scale mark lines color;
* ValueColor: TColor - color of values on mark lines;
* CaptionColor: TColor - values unit name color;
* ArrowColor: TColor - voltmeter pointer arrow color;
* MarginColor: TColor - margin rectangle color;
* CenterColor: TColor - color of a knob on an axis of the pointer arrow;
* CircleColor: TColor - color of circles on mark lines;
- these properties define the voltmeter elements sizes:
* CenterRadius: Integer - radius of a knob on an axis of the pointer arrow;
* CircleRadius: Integer - radius of circles on mark lines;
* Angle: Integer - the angle of scale segment;
* Margin: Integer - margin width;
* ArrowWidth: Integer - width of pointer arrow;
* LengthMainTicks: Integer - main (marked) tick lines length;
* LengthSubTicks: Integer - additional tick lines length;
* Style: TStyle read - the scale styles (left corner, on center and
right corner);
* NumberMainTicks: Integer - number of main tick lines;
* FaceOptions: TFaceOptions - defines what voltmeter elements will
be displayed;
* Position: Single read - the value for display;
* Scale: Integer - the maximal value for display (minimal is always 0);
* IndMaximum: Integer - maximal value for normal range;
* IndMinimum: Integer - minimal value for normal range;
* Caption: string - this text will be displayed in the voltmeter centre;
* AntiAliased: TAntialiased = (aaNone, aaBiline, aaTriline, aaQuadral) -
Mode of smoothing. Accordingly: without smoothing, smoothing with
cells of 2x2, 3x3 and 4x4 pixels;
* OnOverMax: TNotifyEvent - this event is fired if the value reached
the maximum of normal range;
* OnOverMin: TNotifyEvent - the same for a minimum;
- if you have set a "TICKER" condition, the component will calculate own
performance:
{$IFDEF TICKER}
* Frames: Integer - last repaint speed, frames per second (FPS);
* OnFrames: TNotifyEvent - this event will fired when performance value
has been changed;
{$ENDIF}