Page 1 of 1

Usng string values from enums in Instrument Panels

Posted: Sun 7. May 2023, 22:54
by mwbevington
Hi,

I know I have had this working before, but can't seem to figure it out today, plus could not find anything in the forum.
I have a symbol file (FormatVersion=5.0) for which I have enums assigned for some symbols. I'd like to be able to see the text associated with the symbol in a ValueInidcator in a Instrument Panel file, instead of the numeric value. How do I do it?

Example, for ChainLatchStatus)

Code: Select all

{ENUMS}
enum ChainLatchStatus (0="Default ERROR", 1="UnLatched", 2="Latched", 3="In Transit", 4="Valve Driver Fault")

{SENDRECEIVE}
[Hitch_Status_1]
ID=18FFE042h    // 0xFFE0, SA=0x42 (66), Rep = 50 mS
DLC=8
CycleTime=50
Var=HydraulicPressure                           unsigned   0,16 /o:0 /f:0.1 /u:PSI      // Does not use metric, i.e. does not conform to SAE spec for liquid pressure
Var=InsufficientHydraulicPressure          unsigned  16,2 /o:0 /f:1.0
Var=StartHitch_UnHitchStatusNumeric   unsigned  18,4 /o:0 /f:1.0					
Var=HitchHoodStatusNumeric                unsigned  22,4 /o:0 /f:1.0		
Var=PintleReleaseStatusNumeric            unsigned  26,4 /o:0 /f:1.0		
Var=TongueLockStatusNumeric              unsigned  30,4 /o:0 /f:1.0		
Var=KickstandStatusNumeric                 unsigned  34,4 /o:0 /f:1.0		   
Var=HitchLockStatusNumeric                 unsigned  38,5 /o:0 /f:1.0		
Var=ChainLatchStatusNumeric               unsigned  43,5 /o:0 /f:1.0 /e:ChainLatchStatus
ChainLatchStatusValueIndicator.JPG
ChainLatchStatusValueIndicator.JPG (12.48 KiB) Viewed 5115 times

Re: Usng string values from enums in Instrument Panels

Posted: Mon 8. May 2023, 09:25
by M.Gerber
Hello mwbevington,

The Label instrument is your friend. If you apply a Signal to this kind of instrument, the Signal's Enum texts are displayed.

Kind regards
Mark

Re: Usng string values from enums in Instrument Panels

Posted: Mon 8. May 2023, 20:43
by mwbevington
Hi,

I can't find any property mentioned in the Property Editor for this ValueIndicator. See screensnip below. Also, I do not know of any /parameter
named label in a Peak Format version 5.0 symbol file, e.g. /e:=enum

How do I do this?
ValueIndicator9_ChainLatchStatus.JPG
ValueIndicator9_ChainLatchStatus.JPG (86.45 KiB) Viewed 5107 times
Thanks,
Mark

Re: Usng string values from enums in Instrument Panels

Posted: Tue 9. May 2023, 04:13
by mwbevington
I figured it out. Needed to use the "Label" element from within the Instrument Panel and assign the appropriate symbol to it. Here's a pic on where to find it, in case anyone else ever gets stuck on this...or....in case I forget how to do it again sometime in the future :lol:
Label4Capture.JPG
Label4Capture.JPG (63.41 KiB) Viewed 5107 times