- This topic has 18 replies, 3 voices, and was last updated 8 years, 11 months ago by Support.
-
AuthorPosts
-
September 5, 2015 at 11:18 am #36657HeDiBoParticipant
First of all: congratulations with this very beautiful new component :a7:
Maybe there should be a property (BoundaryLimited) to say that Position may not be outside the set Max and Min values,
Because position can be outside the Max and Min limits, a different signal color may be used for the Arrow when it is outside those limits.
And the optional drawing of dials that show the current position value would be a nice addition too. Something like this:
[attachment=7296:MeterDials.jpg]
Thanks for a great addition to AC.
September 8, 2015 at 12:49 pm #53945JM-DGParticipantGreat component indeed. 🙂
I would like to notify a minor memory leak in the acMeter.pas with the variable ShadowLayer : TBitmap.
At line 428, there's this code:
Code:ShadowLayer := CreateBmp32(MeterSize.cx, MeterSize.cy);I believe, It should be replace with something like:
Code:if ShadowLayer = nil then
begin
ShadowLayer := CreateBmp32(MeterSize.cx, MeterSize.cy)
end else
begin // Clear canvas
ShadowLayer.Canvas.Brush.Style := bsClear;
ShadowLayer.Canvas.Brush.Color := $FFFFFF;
ShadowLayer.Canvas.FillRect(Rect(0, 0, MeterSize.cx, MeterSize.cy));
end;And add this line
ShadowLayer.Canvas.Brush.Style := bsSolid;
in the prepareCache procedure.
Code:// Shadows
if FPaintData.FDialShadow.Visible then begin
ShadowLayer.Canvas.Pen.Color := $AAAAAA;
ShadowLayer.Canvas.Pen.Width := 2;
ShadowLayer.Canvas.Brush.Style := bsSolid; // Added line <============
ShadowLayer.Canvas.Brush.Color := $FFFFFF;
ShadowLayer.Canvas.Ellipse(Margin + ShadowOffset.X, Margin + ShadowOffset.Y,
MeterSize.cx – Margin -1{+ ShadowOffset.X}, MeterSize.cy – Margin{ + ShadowOffset.Y});
end;September 14, 2015 at 6:08 am #53954SupportKeymasterThanks for messages, I will improve this component soon.
The issue with memory leak will be fixed in the nearest release.
September 28, 2015 at 1:42 pm #54027HeDiBoParticipant'Support' wrote:Thanks for messages, I will improve this component soon.
Thanks for updating TsMeter.
- It should still be possible to set a position outside Max and Min, provided a special property (like IgnoreBounds) is set to True.[*]Setting the color for PaintData.ArrowColor should not change the color of the Dial.[*]It would be a good idea if the Caption could be made to reflect the value of the current Position (adding a Boolean property like CapShowPos).[*]Also the Captions for Min and Max should reflect the Min and Max values (maybe Boolean property CapShowMinMax).
Using this project:[attachment=7326:acTestMeter.zip]
when you click the button, you will find discrepancies between the TsStaticText Caption and the TsMeter.Caption. The meter's caption seems to lag behind one value :a1: when moving from one valid position to a next valid position.
October 6, 2015 at 3:49 pm #53942SupportKeymasterThank you for files, I will add it in the nearest release )
October 12, 2015 at 1:10 pm #54094HeDiBoParticipantThanks for updating TsMeter.
Most of my comment seems to have found a way into the component. Thanks :a3:
If IgnoreBounds is False and ShowCaptionValue is True, setting a position outside the bounds does not show the proper value in the Caption (it shows the Max or Min value, it should show the position value, to show it is outside the bounds), possibly the font color should take on some signal color (add boolean Property ShowCaptionAttention).
October 13, 2015 at 12:37 pm #54110SupportKeymasterQuote:…it shows the Max or Min value, it should show the position value, to show it is outside the boundsI'm not sure that this behaviour is correct, Caption shows current Position, but Position is limited by Min/Max if IgnoreBounds is False…
October 13, 2015 at 3:43 pm #54116HeDiBoParticipant'Support' wrote:I'm not sure that this behaviour is correct, Caption shows current Position, but Position is limited by Min/Max if IgnoreBounds is False…
The arrow cannot point beyond Min and Max values, where Position should be able to go outside these limits.
It's very enlightening to show that the arrow does not reflect the Position's actual value.
Think of this meter as used for pressure monitoring. It would be an enormous risk, not knowing what the actual pressure was when above the maximum value. In fact, that's the moment you really want to know the actual pressure. If used for temperature both the Min and Max values are very important.
In other words, IgnoreBounds should only affect the arrow, not the Position property. You might add a LimitPosition boolean property to get the current effect if true.
November 6, 2015 at 11:31 am #54284HeDiBoParticipant'HeDiBo' wrote:In other words, IgnoreBounds should only affect the arrow, not the Position property. You might add a LimitPosition boolean property to get the current effect if true.
If you think of “Position” as where the arrow is pointing, you are right. But in a real life situation that is next to useless.
If the liquid that's tested freezes, I want to know if that's because the temperature is -5 or -30. If MIN is set to 0, that does not show. But only the value -274 would be a proper MIN value in this case, making the meter useless.
Please change it, so to make the meter usable.
Adding the suggested LimitPosition property defaulted to True, would still produce the effect that you want.
November 6, 2015 at 12:55 pm #54285HeDiBoParticipantIt would be a very valuable addition if all values were floats i.s.o. integers.
Think of an instrumentation setup where a Volt meter should show the voltage of a certain component.
If that value must be within the range 5.87 to 6.23 the TsMeter component cannot be used for that.
November 29, 2015 at 11:46 am #54410HeDiBoParticipantNo change in 10.21
December 1, 2015 at 7:09 am #54420SupportKeymasterI was encountered with some difficulties in changing of these properties types.
If property is float, then I can't specify a default value for such property.
For example, I can't define the Max property to 100 as default value.
I'm searching the good way, but have not found it yet.
December 1, 2015 at 10:37 pm #54431HeDiBoParticipant'Support' wrote:If property is float, then I can't specify a default value for such property.
For example, I can't define the Max property to 100 as default value.
But you can. Just think of those values as whole numbers, but because they're really floats, you have the best of both worlds.
Think of the possibilities. If you have a range of 0 – 100, you can now have increments of 2.5 🙄
December 2, 2015 at 6:15 am #54433SupportKeymasterDelphi does not allow to set default values for float properties, this is the problem.
I'm agree that float value will be better in this component, but I can't set default values in this case.
December 2, 2015 at 3:56 pm #54454HeDiBoParticipant'Support' wrote:Delphi does not allow to set default values for float properties, this is the problem.
I'm agree that float value will be better in this component, but I can't set default values in this case.
Have a close look at the TcxProgressBar component from Developer Express. It has a property named Properties and in it you find the properties Min and Max of type Double. They can have a default value, but only in the special way implemented by Developer Express. That procedure is similar as what is described in http://tiku.io/quest…-is-it-possible
The essence of it is to define a float property like this:
Code:property MyFloat: Float read GetValue write SetValue stored IsMyFloatStored;with a Boolean function IsMyFloatStored that returns True if MyFloat doesn't have its default value
December 27, 2015 at 12:02 pm #54535SupportKeymasterI have tried this way, but without success, unfortunately.
December 28, 2015 at 2:42 pm #54544HeDiBoParticipant'Support' wrote:I have tried this way, but without success, unfortunately.
Did you try it this way (I omitted the obvious setter method SetMyDouble):
Code:interfaceconst
DefaultMyDouble: Double = 2/3;type
TMyObject – class(TPersistent)
private
FMyDouble: Double;
function IsMyDoubleStored: Boolean;
public
constructor Create(AOwner: TComponent); override;
published
property MyDouble: Double read FMyDouble
write SetMyDouble
stored IsMyDoubleStored;
end{class};implementation
constructor TMyObject.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FMyDouble := DefaultMyDouble;
end;function TMyObject.IsMyDoubleStored: Boolean;
begin
Result := FMyDouble DefaultMyDouble;
end;I believe this is the simplest way to define a float property with a default value.
December 29, 2015 at 3:41 pm #54545HeDiBoParticipantHere is a proof of concept.
It is a very minimal component, called TFloatProps.
It's default value for property MaxValue is 2.68
As you can see, it keeps this default until you overwrite the value with your own.
[attachment=7516:FloatPropertyDemo.zip]
December 29, 2015 at 4:16 pm #54546SupportKeymasterThank you, Dick, I will check it soon.
Happy New Year!
-
AuthorPosts
- You must be logged in to reply to this topic.