Profile chart - colors depending on the gas mix ?

Discussions about Diving Log 6.0 - questions and hints
StehtimSchilf
Posts: 4
Joined: Mon Sep 30, 2019 17:54

Re: Profile chart - colors depending on the gas mix ?

Post by StehtimSchilf » Mon Sep 30, 2019 18:13

I know this is an old topic - but I'm wondering if there is a hidden setting for a multi colored profile?

This caught my attentions as I displayed my diving profile for the first time - no different colors for the gas mixes (the reason I even registered to this board right now).

I do understand, you cannot change the default behavior - but why not implement this feature request as an option?

thanks to all the developers.
SiS

divinglog
Site Admin
Posts: 5090
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Profile chart - colors depending on the gas mix ?

Post by divinglog » Tue Oct 01, 2019 15:00

Hi

Thank you for your feedback and reminder, it's been a long time this was requested :o Well, time goes by...

This is not often requested and that's the reason I forgot this. Of course this can be added as an option, but it has to be implemented which is taking time. I'm a single developer and for example, I was working the all this year only on the dive computer downloader for PC and Android. So I have to decide the things I'm working on :cry:

Is that really that helpful if the dive profile is in different colors? I mean, you still cannot see which gas mix was used without the labels or the separate gas profile. And red warnings will overwrite the gas mix color anyways, even though they are usually short.

Please suggest the colors that should be used exactly? Black for air, green for Nitrox, blue for O2 and gray for Trimix?

Kind regards,
Sven

StehtimSchilf
Posts: 4
Joined: Mon Sep 30, 2019 17:54

Re: Profile chart - colors depending on the gas mix ?

Post by StehtimSchilf » Sat Oct 12, 2019 13:00

Hi Sven

thank you for addressing to this topic.

It is indeed really helpful when comparing the profiles. Same dive, different gas setup by buddies. You immediately see where and for how long you used which mix. Especially when having more than 3 gases. When having 4, 6 charts side-by-side it's even more obvious that different colored lines is more useful than just the labels.

If I show the "gas switch" chart (below the profile) there are already different colors. Just use those colors for the lines above (air = black, O2 blue, NX green tones, TX brown tones, ...) or for sure there is a EU standardization color scheme ...

Suggestions:
For the first draft (less effort needed), just make an option (so it does not confuse the default behaviour. I wouldn't mind, if i have to set a registry flag manually. So you do not have to update the GUI/DB. I know, GUI/DB adjustments takes most of time) to have the color based on a function color = GetColorForMix(p02, pHe).

Code: Select all

function GetColorForMix(p02, pHe, defaultAir, defaultO2, baseToneNx, baseToneHe) {
   // besides the standard gases (air, 100% O2) this functions creates a color based upon the p02 and pHe factors.
   // this will createthe same color for identical mixes always but different color tones if only the p02 part differs
    
   if p02 = 21 and pHe = 0 then 
        color = defaultAir 
   elseif pO2 = 100 then
        color = defaultO2
   elseif pHe > 0 then
       color = baseToneHe
       color = color.IncreaseSaturation(p02 * pHe) // change brown tone according Tx-mix 
   else
       // its a Nx
       color = baseToneNx 
       color = color.IncreaseSaturation(pO2)
   endif

   return color
}

if getRegistryValue(CustomTankColors) then
   defaultAir = black // default black for air according "switch gas" chart
   defaultO2 = blue // default blue for 100% O2 according "switch gas" chart
   baseToneNx = green // default green according "switch gas" chart (could be yellow ... )
   baseToneHe = brown // default brown
   
   // or even read those default Color Values also from Registry and use "switch gas" color if value not set:
   defaultAir = getRegistryValue(CutomTankColorAir, black)
   
   color = GetColorForMix(p02, pHe, defaultAir, defaultO2, baseToneNx, baseToneHe)
else 
   // color as to day.
   color = currentBlueLineColor
endif

foreach profileDataPoint {
   Plot(profileDataPoint.X, profileDataPoint.Y, color)
}

How you implement "IncreaseSaturation()" depends on your programming language. But i'm sure you get the idea.

With this approach, initially, you do not need to update any database tables nor the GUI - IMHO.

In a second step, add new color "TankColor" to Table "Tank" defaulted to your GetColorForMix(). Users may then mess directly on DB level to adjust the color to their personal preferences.

In a thrid step, implement a color picker in the "Tank & Gas" Dialog.

I hope I'm not pretentious with this Pseudo-Code stuff. If you find this GetColorForMix() based on p02/pHe appealing and you wish me to send you a working example, please let me know.

cheerioh & Thanks

divinglog
Site Admin
Posts: 5090
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Profile chart - colors depending on the gas mix ?

Post by divinglog » Wed Oct 16, 2019 18:32

I've created a first proof of concept:

Image1.png
Image1.png (26.57 KiB) Viewed 741 times

StehtimSchilf
Posts: 4
Joined: Mon Sep 30, 2019 17:54

Re: Profile chart - colors depending on the gas mix ?

Post by StehtimSchilf » Sat Oct 19, 2019 21:32

and I like it!!! exactly what I had in mind - top!

cheerioh
SiS

divinglog
Site Admin
Posts: 5090
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Profile chart - colors depending on the gas mix ?

Post by divinglog » Thu Oct 31, 2019 15:53

If you want to try this feature, you can download this zip file and copy the content into the Diving Log 6.0 program folder. Then you can activate it with this button:

Image1.png
Image1.png (55.74 KiB) Viewed 617 times

StehtimSchilf
Posts: 4
Joined: Mon Sep 30, 2019 17:54

Re: Profile chart - colors depending on the gas mix ?

Post by StehtimSchilf » Tue Nov 05, 2019 09:28

It does exactly what I was looking for: different colored lines for different mixes!

thank you.

Post Reply