B4J Library [B4X] [XUI] xGauges Class

klaus

Expert
Licensed User
Last edited:

Scantech

Well-Known Member
Licensed User
This is from my Project Car Diagnostic Pro. I decided to share this with all of you.

This is a huge update to xGauges. Add ColorPallete to additional library.

I ask to upload any improvements. Thanks
 

Attachments

Last edited:

klaus

Expert
Licensed User
I added a DrawArc routine in the class, replacing the drawing with paths.
You project works only with B4A it will not with with B4J.

It is also added in the original class which will be updated soon.
 

Attachments

Scantech

Well-Known Member
Licensed User
Use BitmapCreator DrawArc. It fills lot better. Depending on color you may see imperfections filled with your example. If you have good eyes look at the attached photo. ScaleLow and ScaleHigh Colors are the same. ScaleLow is BitmapCreator and ScaleHigh is your DrawArc Example.
 

Attachments

tomi85

Member
Licensed User
I testing xgauges 1.5 and i have got error.

Error occurred on line: 140 (xGauges)
java.lang.RuntimeException: Cannot parse: null as boolean

the eror is in this line cNeedleON = Props.Get("NeedleON")

Do you have any idea? Im just download the demo and have this problem.
 

klaus

Expert
Licensed User
Which platform are you using?
I just tested the B4A version, got the error you mentioned, opened the Designer and closed it.
I got the message if I want save it, I answered Yes, and it worked.
If you still have the same problem, I will post an update tomorrow.
 

klaus

Expert
Licensed User

Diceman

Active Member
Licensed User
Klaus, your gauges look really nice and will give a professional touch to an application.
Have you given any thought to producing rectangular edgewise gauges? I mention this because some application will require several gauges on the screen at a time and the round gauges will take up a lot of screen space. The edgewise gauges take up less room and are stackable both vertically and horizontally. They could even be used in a CustomListView without taking up a lot of vertical space. Each item in the CustomListView would have their own gauge and text beside it describing what it is monitoring like "Outside Temp", "Room#1 Humidity", "Room#1 Temp" etc.. I have attached a few examples of edgewise gauges.
 

Attachments

Diceman

Active Member
Licensed User
I suppose that it is something like this what you are expecting.
Still need some more work.

View attachment 97815
Yes, your edgewise gauges look really good. The only suggestion I have is to allow the developer to choose the width &/or style of the pointer. Sometimes the pointer can get lost in the background so it should stand out. Maybe add a drop shadow to the pointer or a black outline around the pointer? Or a triangular pointer? There was a triangular pointer in one of the samples I uploaded. Apart from that minor improvement, I think you nailed it. 🤩
 

klaus

Expert
Licensed User
The only suggestion I have is to allow the developer to choose the width &/or style of the pointer.
This is already in the to do list :).
 

Diceman

Active Member
Licensed User
This is already in the to do list :).
Great minds think alike. ROFL

The only other thing I can think of is an optional sliding set pointer like on a thermostat. I can see someone using these gauges to control a thermostat or humidifier and they would need to set the temperature on the face of the gauge. A real physical temperature gauge would have a metal pointer triangle that slides the full width of the scale but on the opposite side of the pointer so you would see what the temperature is set for and the actual reading from the temperature probe. If the equipment is working correctly the two should line up. At a glance you can see visually how well the equipment is working by comparing the distance from the set pointer and the actual pointer (temperature reading). Just a thought.
 
Top