"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
Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

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

#1 Post by Tetrachromat »

Although the online store now offers more than 1000 different instruments for download, I am regularly missing gauges for a new aircraft that I try to build the panels for. Mostly just simple steam gauges. But I'm not able to do myself, because I am a 'nil' when it comes to graphics art works.

I have been following some interesting discussions about adjustable instruments lately. But the concept didn't catch up in the community of creators.

To help myself out of this situation, I started my own project 'Easy Gauges' some days ago.

The intention was to let users (mainly me) create new instruments with the following restrictions:
- NO USER CODE required (OK, one single line of code to start the instrument in "logic.lua")
- REUSE OF GRAPHICS RESOURCES already available in the community instruments.
- SPECIFICATION instead of coding the instrument features.

State of the Project
At the current (early) state of the project, I can create instruments with the following features:
- Steam Gauges with rotating indicators (needles)
- A layer for a plain background image
- A layer (canvas) for drawing
- Multiple circular scales with
- Selectable center position
- Multiple scale sections having
- Configurable major and optionally minor tick marks
- Optionally scale values at the major tick marks (divisible by powers of 10)
- One or more colored arcs per scale with
- multiple continuous or broken segments in different colors
- redlines for operational limits
- Freely placeable markup text for instrument and scales
- Multiple gauges, able to
- Subscribe to a SimVar (currently MSFS2020 only)
- Maintain received value updates
- Indicate the values using an indicator image (needle)
- Use the assigned scale (different gauges can use individual or a common scale)
- Using the scale section specifications for interpolating correct position
- Optionally use the AM animation feature
- A layer for a cover image (to hide certain parts of the instrument)
- A layer for a bezel image

Teaser
Below you can see a screenshot of a sample instrument created.
easygauge.png
It is sample dual 'Engine Oil Temperature and Pressure' indicator with the following features
- A simple circular black background image (Yes, I'm able to produce such simple things with the help of 'Inkscape')
- A canvas covering the full instrument area (can be restricted if needed)
- A freely placed single instrument markup text element 'Engine Oil'
- 2 scales drawn on the canvas with the same center position (center positions can be different if needed)
- Scale 1 for 'engine oil pressure' on the right side
- ranging from 0 to 140 psi in two sections
- Section 1 from 0 to 40 psi with just major tick marks at steps of 40 psi
- Section 2 from 40 to 140 psi with major and minor tick marks at steps of 20 resp. 10 psi
- with values printed at the major tick marks
- 2 colored arcs
- Arc 1 just plain white for the full range
- Arc 2 with multiple configurable and colored segments, including a skipped segment
- A redline marker at a specified value of 115 psi
- Two freely placed scale markup text elements 'Pressure' and 'psi'
- Scale 2 for 'engine oil temperature' on the left side
- ranging from 10 to 120 °C in with sections
- Section 1 from 10 to 40 °C with just major tick marks at steps of 40 °C
- Section 2 from 40 to 120 °C with major and minor tick marks at steps of 20 resp. 10 °C
- with values printed at the major tick marks, this time printed as values divided by 10^1
- 2 colored arcs
- Arc 1 in grey color for a single range
- Arc 2 again with multiple configurable and colored continuous segments
- A redline marker at a specified value of 110 °C
- Two freely placed scale markup text elements 'Temperature' and 'x10 °C'
- 2 indicating gauges
- Gauge 1
- subscribing to MSFS2020 for variable "GENERAL ENG OIL PRESSURE:1" and unit "PSI"
- Indicating the received values using scale 1 on the right side
- With a rotating 'needle' image as indicator (reused from a Seneca engine instruments, credit goes to Filipe Bessa)
- Gauge 2
- subscribing to MSFS2020 for variable "GENERAL ENG OIL TEMPERATURE:1" and unit "CELSIUS"
- Indicating the received values using scale 2 on the left side
- using the same 'needle' image as indicator
- A reused cover image from the Seneca engine instruments (credit goes to Filipe Bessa)
- A reused bezel image from a generic instrument (credit goes to SimInnovations)

Attached you can find the corresponding instrument specification file 'easygauge.json' for the presented instrument. 100 lines of specification text is sufficient for such an instrument. For simpler instruments it can be much less. The specification file must go into the instrument 'resources' folder.
easygauge.json
(2.51 KiB) Downloaded 151 times
To reduce specification efforts, some attributes have default values defined. If a default value fits your need, you can leave the attribute unspecified. The default values can even be adjusted to user or instrument preferences.

Code Base
Sure all this needs some code. But it is generalized code I have developed over some time now. Not specific to a single instrument. The code is currently contained in two '.lua' files. All together about 380 lines of LUA code (might be reduced further with some optimization). The files must be placed in the instrument 'lib' folder. I might create a single file at a later project state.

The files can also be placed in the global Air Manager 'lua_libs' folder. This is my preferred method. No harm is done to the remaining environment with this method. I do keep care of not clashing with the AM API.

Anybody interested in evaluating the code is invited to send me a PM.

I hope my development can help users without LUA knowledge create their own simple instruments. Let’s see how it develops.


Awaiting your comments.
Paul

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

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

#2 Post by JackZ »

Nice & impressive
Quite a job actually.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

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

#3 Post by Keith Baxter »

Hi,

Great to see peeps using the .json file concept.

I do exactly what you do for airframe ID.
I use acf datarefs to ID the airframe then load the airframe "RED LINE and SCOPE" .json for that airframe

love this concept coming to the fore.

Here is a red line .json for a C172
Make sure all your airframes are consistent. Should peeps need explanatory on the .json and how it is used. Press my bell.
C127_2.json
(6.34 KiB) Downloaded 110 times


Keithj
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 

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

#4 Post by Keith Baxter »

Hi,

So what happens is relevant .json is loaded and the gauge is drawn using the parameters in the json. Like this.

Code: Select all

canvas_draw(mp_gauge,function()
    _arc(85,95,210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[2],210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[3],85)---Range 1
    _stroke(airframe_01[1],4)
    _arc(85,95,210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[5],210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[6],85)---Range 2
    _stroke(airframe_01[4],4)
    _arc(85,95,210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[8],210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[9],85)---Range 3
    _stroke(airframe_01[7],4)
    _arc(85,95,210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[11],210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[12],85)---Range 4
    _stroke(airframe_01[10],4)
    _arc(85,95,210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[14],210+(120 / (airframe_01[17]-airframe_01[16]))*airframe_01[15],85)---Range 5
    _stroke(airframe_01[13],4)
    _txt("M.P.",oitCB_36witCB,85,112)
    _txt("Hg",oitCM_16witLB,125,81)
end)

Keith
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

#5 Post by Tetrachromat »

Hi Keith

I really appreciate what your doing here on the forum and the support you provide to many with the knowledge about AM, LUA (and much more) you have accumulated over a long time. I learned much from your postings.

But I have started this topic for receiving feedback about my project "EasyGauges".

I kindly ask you to start your own topic about your project. I wouldn't mind if you comment on my project and insert a link to your topic. That's fine.

Thank you
Paul

P.S.
Almost every second topic I start here on the forum is somehow hijacked by other members. You are not the only, there are worse.

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

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

#6 Post by Tetrachromat »

OK, back to my project.
Just found that adjustable gauge (Generic Airspeed adjustable) by Russ Barlow:
russbarlows.png
I tried to reproduce that as a "Easy Gauge". Here you can see the result:
easygauge airspeed.png
To finally match that 'reference' I had to add some features. "Easy Gauges" now supports:
- Sections without markings (like the scale section from 0 to 40)
- Thinner minor marks (selectable thinning)
- Major marks without values (only every nth Major mark receiving a value)

Credits: For the that example I reused the needle, screws and bezelring images from Russ' gauge as gauge indicator, cover and bezel layers, but any other matching images could be used.

Attached you find the corresponding specification JSON file (having 47 lines of JSON syntax)
airspeed.json
(1.41 KiB) Downloaded 99 times

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

#7 Post by Keith Baxter »

Hi Paul,

Sorry I did not mean to try and hijack the thread. Simply to give you an idea.

I got the impression that what you are wanting to do is change the "red line" as the concept is known. Both "gamin" and "electronics international" use this method on GI275 and MVP50 ranges of instruments. I thought you might like to see how I do it.

What I showed you was a method that they use for when they sell the basic instrument. They have a basic .json that they modify for different airframes. I would be happy to share thoughts.

I notice you asked for a method to change "static files" in the create/edit console. That gives me the imprecision you want users to change the .json.

I want to suggest you use <persistence> instead. That way users have very little interaction with the code and files. On startup you could have a splash page that sets up the instrument. Something like the MVP50 in this image. By using a dial and push button you could adjust range color. UOM, scope etc. Or you could add invisible dials/sliders behind the values you want users to change.
After the user has changed the parameters the data is saved to persistence and used whenever called.
ice_screenshot_20220428-083939.png
Just something for you to consider to make things easy for users that have very limited coding savvy.


Keith
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

#8 Post by Tetrachromat »

Keith you wrote
Keith Baxter wrote: Thu Apr 28, 2022 7:12 am .. That gives me the imprecision you want users to change the .json.

I want to suggest you use <persistence> instead. That way users have very little interaction with the code and files.
I think you misunderstood the intention of "Easy Gauges" . See may first post in the top part:
- NO USER CODE required
- SPECIFICATION instead of coding the instrument features.

AM "Persistence" is not in the concept of "Easy Guages". That would require coding in LUA.

No, on the contrary, I want the user to have full control over the content of the json file. Because that is the only way to specify the content and appearance of the instrument. There is no coding in LUA required.

This is not a project for people with full knowledge of AM and LUA like you. IT is for people lacking this knowledge, but might be able to produce great graphic art resources. With "Easy Gauges" they will be able to create completely different instruments without writing more than one line of code.

I think you should try to create one yourself, just to understand the concept.

Paul

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

#9 Post by Keith Baxter »

Tetrachromat wrote: Thu Apr 28, 2022 7:40 am

This is not a project for people with full knowledge of AM and LUA like you. IT is for people lacking this knowledge, but might be able to produce great graphic art resources. With "Easy Gauges" they will be able to create completely different instruments without writing more than one line of code.

I think you should try to create one yourself, just to understand the concept.

Paul
Hi Paul,

Yes I think I am not understanding correct.
I will knock up something quick today and send to you via PM.


Keith
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

#10 Post by Tetrachromat »

To tinker with "Easy Gauges" you need the easygauge libraries. I will send them to you via PM, with some instructions.

Paul

Post Reply