"Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

Working on a instrument project or just finished a project? Show it to others!

Moderators: russ, Ralph

Message
Author
User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#21 Post by Keith Baxter »

Hi,

Looking super great Paul and love the concept.

A huge winner would be to be able to export all the parameters into a separate UUID instrument.
I think @Corjan had something in mind and wanted to do something similar when I first did this instrument in 2019 I think.

Whilst this concept might bring about some appetite with you and SI. The idea was to build a instrument and then use the print statement to write the code.

This instrument is somewhere in the abyss of the forum from a few years ago. You are welcome to use any part for your project should you find benefit.
02-Gauge Code Generator - Basic Pie Gauge.siff
(5.71 KiB) Downloaded 102 times
What I am trying to converse, is a appetite for @Corjan and @Ralph SI Guys to allow for a port to export generic auto generated instruments.

Keep up the good work. Love what you are doing.

Keith

EDIT: It might be that there is a method to use persistence to do this. Hmmm You got me thinking....
If one can write to a print function() one could also write to a log()
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#22 Post by Tetrachromat »

There is not much code generated in "Easy Gauges". Just a few lines for each gauge in the instrument, something like this:

Code: Select all

gauge.indicate = function ()
  local position = interpolate_linear( gauge.sections, gauge.value, true )
  rotate(gauge.indicator, position, table.unpack(gauge.animation) )
end
         
gauge.update = function ( value )
  gauge.value = value
  gauge.indicate()
end

fs2020_variable_subscribe(variable, unit, gauge.update)
Thats all, nothing fancy.

Most of the code I developed is for reading the instrument specification, drawing the scale features (scale marks, values, arcs, redlines, markup text) on the canvas, and loading the images (background, cover, bezel and gauge indicators). But this is based completely on the AM API.

Paul

WokkelP
Posts: 7
Joined: Tue Nov 30, 2021 8:20 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#23 Post by WokkelP »

I have tried out this add-on / mod / way of making gauges, and I'm very pleased with it.
It's easy, quick, forgiving.


I'm not good with graphic design, so I altered a bunch of images to make it suit more.
Not sure where credit is due with the graphics but I got the first two instruments done.
I'm working on gauges for the Boeing 247D and this is what I came up with so far for the Fuel gauges.
(note, they don't use these exact needles, they have a selector knob and a plunger to show the correct Fuel levels. I ommited that to make the logic easier and less fussy with Air manager panels)

Image
Image

And the original instruments from the simulator
Image

I do have two questions though, and since your PM inbox is full Tetrachromat, I will ask them here.

The manual doesn't mention anything like it, and I've been fiddling around.
Is there a way to have the minor scale marks a different color from the major scale marks?
See attached screenshot, left the air speed indicator from the Boeing 247D and right my WIP gauge.

Second question. Is there a way to "bend" the text? (see the text below the needle centerhole).
Image

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#24 Post by Tetrachromat »

Hi Pieter,

PM sent with the answers. Actually my Inbox is quite empty. When you send a PM it will stay in your Outbox until I read the message. This is not an indication that my Inbox is full.

The next release will at least support a separate color for the minor marks.

Paul

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#25 Post by Tetrachromat »

There is a solution to curved text, inspired from works by @Sling (see community library):

Unfortunately, for proportionally spaced fonts it does not produce nice text
curved text.png
For non-proportional (monospaced) fonts it should work. However there are no default monospaced fonts in AirManager. You would need to add those font files to your resources.

I will add support for that solution in the next release (coming soon).

Paul

P.S: You might get better results with proportional fonts with a graphics tool, placing curved text directly on the background image.

ADDENDUM:
With this solution the characters will be rotated along the arc. That means a character at 180° is upside down. The arced text as shown on your sample airspeed gauge below the center will not be possible. This is a restriction of the AirManager API, there is no API function for curved text.

WokkelP
Posts: 7
Joined: Tue Nov 30, 2021 8:20 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#26 Post by WokkelP »

Great to see it coming in future releases!

Another one I'm looking for is using L vars in the gauges. Right now it seems I can only use SIMVARS (A), which is a limitation for custom aircraft.
How would I get i.e. (L:ENGINE CYLINDER1 TEMPERATURE:index, Celcius) displayed?

Also wondering if there is a way to rotate the values of the scales. For instance, on the barometer, on the altitude indicator, the inhg values are rotated by 90 degrees.
And, would it be possible to add the option to place a canvas image above the background but below everything else?
And, would it be possible to add a layer variable for the gauges, determining with a value what the gauge layer will be.
I've noticed that these three things would be necessary to create an altimeter with easy gauges.

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#27 Post by Tetrachromat »

WokkelP wrote: Sat Feb 04, 2023 11:07 am ... How would I get i.e. (L:ENGINE CYLINDER1 TEMPERATURE:index, Celcius) displayed?
Actually this should work out of the box in AM using

Code: Select all

fs2020_variable_subscribe("L:ENGINE CYLINDER1 TEMPERATURE:1", "Celcius", callback)
in the easygauge JSON specify:

Code: Select all

  "variable" : [ "L:ENGINE CYLINDER1 TEMPERATURE:1", "Celcius" ],
WokkelP wrote: Sat Feb 04, 2023 11:07 am Also wondering if there is a way to rotate the values of the scales.
Not yet :) , could you show a screenshot image here?
WokkelP wrote: Sat Feb 04, 2023 11:07 am And, would it be possible to add the option to place a canvas image above the background but below everything else?
And, would it be possible to add a layer variable for the gauges, determining with a value what the gauge layer will be.
I've noticed that these three things would be necessary to create an altimeter with easy gauges.
The canvas (with the markups and scales) is already above the background and below the gauge indicator, cover and bezel images. So for example the non-transparent parts of those images may cover parts of the canvas.

I do not understand "a layer variable for the gauges, determining with a value what the gauge layer will be". Could you elaborate on that?
If you have multiple gauges specified the indicator images are placed on top of each other in the order the gauges are specified.

Paul

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#28 Post by SimPassion »

Tetrachromat wrote: Sat Feb 04, 2023 11:46 pm
WokkelP wrote: Sat Feb 04, 2023 11:07 am ... How would I get i.e. (L:ENGINE CYLINDER1 TEMPERATURE:index, Celcius) displayed?
Actually this should work out of the box in AM using

Code: Select all

fs2020_variable_subscribe("L:ENGINE CYLINDER1 TEMPERATURE:1", "Celcius", callback)
in the easygauge JSON specify:

Code: Select all

  "variable" : [ "L:ENGINE CYLINDER1 TEMPERATURE:1", "Celcius" ],
WokkelP wrote: Sat Feb 04, 2023 11:07 am Also wondering if there is a way to rotate the values of the scales.
Not yet :) , could you show a screenshot image here?
WokkelP wrote: Sat Feb 04, 2023 11:07 am And, would it be possible to add the option to place a canvas image above the background but below everything else?
And, would it be possible to add a layer variable for the gauges, determining with a value what the gauge layer will be.
I've noticed that these three things would be necessary to create an altimeter with easy gauges.
The canvas (with the markups and scales) is already above the background and below the gauge indicator, cover and bezel images. So for example the non-transparent parts of those images may cover parts of the canvas.

I do not understand "a layer variable for the gauges, determining with a value what the gauge layer will be". Could you elaborate on that?
If you have multiple gauges specified the indicator images are placed on top of each other in the order the gauges are specified.

Paul
Rather 'Celsius' ;-)

WokkelP
Posts: 7
Joined: Tue Nov 30, 2021 8:20 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#29 Post by WokkelP »

Tetrachromat wrote: Sat Feb 04, 2023 11:46 pm
WokkelP wrote: Sat Feb 04, 2023 11:07 am Also wondering if there is a way to rotate the values of the scales.
Not yet :) , could you show a screenshot image here?
Like so:
disc_baro_digits.png
Tetrachromat wrote: Sat Feb 04, 2023 11:46 pm
WokkelP wrote: Sat Feb 04, 2023 11:07 am And, would it be possible to add the option to place a canvas image above the background but below everything else?
And, would it be possible to add a layer variable for the gauges, determining with a value what the gauge layer will be.
I've noticed that these three things would be necessary to create an altimeter with easy gauges.
The canvas (with the markups and scales) is already above the background and below the gauge indicator, cover and bezel images. So for example the non-transparent parts of those images may cover parts of the canvas.
I basically want to recreate the Altitude indicator gauge with working Barometer.
Tetrachromat wrote: Sat Feb 04, 2023 11:46 pm I do not understand "a layer variable for the gauges, determining with a value what the gauge layer will be". Could you elaborate on that?
If you have multiple gauges specified the indicator images are placed on top of each other in the order the gauges are specified.

Paul
What I'm talking about here is that I'd like to be able to decide which needle comes on top or below another.
I think right now this is proceduraly done. In short, I want an exact replica of the altitude gauge.

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: "Easy Gauges" - No Coding - Full Functionality for Simple Gauges and More

#30 Post by Tetrachromat »

Ok, now I got it. This is a barometer card behind the altimeter faceplate. That card would be used as indicator image for a separate barometer gauge. This is the way how it is done in AirManager.

It requires that the barometer scale is a part of the image itself not a canvas on top of that image, because the image is rotated not the canvas.

Also the faceplate with a transparent cutout would be used as a intermediate cover plate and the altimeter gauge with the needle image on top of it.

This is a more complex setup than EasGauges allows currently. I have been thinking about such instruments as well but did not implement yet.It would require multiple layered instrument specifications in one JSON file. So no short term solution for that.

Paul

Post Reply