Question about slice meters and conversion to s-units

  • 1
  • Question
  • Updated 3 years ago
To the gurus that have already figured this out...  Thanks in advance for your hard work.

In my project I'm subscribing to all meters and as expected bunches of them come down and I generally understand them.

I'm curious about signal level meters for slices.  In looking at the data sent for the meter I see a line like this:

S8D2F0DB8|meter 27.src=SLC#27.num=1#27.nam=LEVEL#27.low=-150.0#27.hi=20.0#27.desc=Signal strength of signals in the filter passband#27.unit=dBm#27.fps=10#

In parsing this out I can see that it is sourced from a slice "SLC" and the name is LEVEL.  The description also supports that this is a signal strength meter.

The question is... from the data above how do I know which slice this goes with?  I don't see any kind of slice ID in the meter packet?

I'm guessing that I just have to infer it using the logic that the first set of SLC meters would go to the first slice.  I'd then expect to see a repeat new set of SLC meters and assign them to the next slice.  Is that correct?

Secondly as pointed out in some other threads the Vita meter packets return the meterId as a uint16 and the meter data as an int16.

In  looking at the example meter above the low will be -150.0 to a high of 20.0 and the unit is dBm.  So the int16 value for the meter needs to be converted to dBm for use.  I'm no expert on dBm but I did notice in the FlexAPI the following function:

        public static float convertVITAtodB(int vita)       
       {
          short db = (short)(vita & 0xFFFF);
          return ((float)db / 128.0f);
        }

Does this do the job?

Thanks in advance guys!
Photo of Mark - WS7M

Mark - WS7M

  • 1026 Posts
  • 364 Reply Likes

Posted 3 years ago

  • 1
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
Ok - lets tease this apart

You get a string telling you of the creation of a meter - be aware that meters are added and removed based on events on the radio so be sure you are able to handle the creation/deletion logic:

The fields in the status message are separated by # charatcers

S8D2F0DB8|meter  - client handle and meter keyword
27.src=SLC - source of meter is a slice
27.num=1 - slice number 
27.nam=LEVEL - meter short name
27.low=-150.0 - meter min value
27.hi=20.0 - meter high value
27.desc=Signal strength of signals in the filter passband - meter long name/description
27.unit=dBm - units
27.fps=10 - updates per second

The raw values in the VITA packet need to be scaled based on the unit type - you found the code that scales for dBm - divide the value supplied by 128.0 and now you have dBm.

To map into S units you will need to apply the standard conversion;  See

https://en.wikipedia.org/wiki/S_meter

Stu K6TU
Photo of Mark - WS7M

Mark - WS7M

  • 1026 Posts
  • 364 Reply Likes
Hey Stu,

Thanks!  Somehow I completely missed the 23.num=1...  I guess I've been staring at the code too long!!!

That is the part I needed to be able to associate the meter with a slice.

Thanks for the dBm info.  I did find the S_meter wiki page and a few others.  I think I can figure that out.

My logic should handle meter deletion the way I have it written.  I need to test that however.  I think I can easily trigger it by removing a pan.  It seems to me I remember seeing some meter removed messages.
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 643 Reply Likes
Well, when you subscribe to that even, it would be in your slice instance object. You are seeing that in a status message, correct? There is a one-to-one correlation between dbm and s-unit.
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 643 Reply Likes
https://community.flexradio.com/flexradio/topics/metering-question

Alledgedly getSatisfaction knows about <code>...</code> but it appears to me not to work.
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
Use the pre option in the tool bar.

It lets you create mono-spaced content like this.
Stu K6TU
Photo of Mark - WS7M

Mark - WS7M

  • 1026 Posts
  • 364 Reply Likes
pre is what I did use but it did what you see above to a simple method.
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 643 Reply Likes
No, either you misinterpreted me or I did a crap job of explaining. The slice doesn't listen to squat. It registers interest in events and they flow asynchronously to the given slice object. Similar to the pan, it registers interest in events and the events flow asynchronously to it.

I did likely an incomplete job of masking out 6700 things from 6500 things. I don't know much about 6300 controls so that is tbd. So I put up a slider, for instance, for the rfgain. It has 5 stops, -10,0,10,20,30. Works great for 6700, which I don't have. But I do know that is a difference so, if it is a 6500 in the model description, part of the radio object, I go into the slider and remove that last stop so on my machine it has stops at (-10, 0, 10, 20). Ditto for loopB, which is part of that hiddenPane...OH, this is cool, I eliminated a mouse click by doing a proximity pane for the pan options, when the mouse gets close to the left wall of spectrum that pan's control the hidden options pane slides out and when the mouse moves away from it the pane slides back...too cool. Similarly, for rf power, in my case I have 0-700w. For power under 100w I set the linear in stdy. If its talking to a different linear, the range might be 0-2000w. Or, maybe I'll be a tad 'nanny' (in Howard's terminology) and limit total output power to 1500w. If over 100w I set the linear in oper and reduce power to exciter power only. What I try to do is add enough things like that to whet the prospect's appetite for the subscription version. In the teaser version it does 0-100 only.

Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 643 Reply Likes
yep, pre is short for preserve spacing.There is a hidden option that, as I recall, you get by clicking on </> that shows all the options for text layout available or, intended to be eventually available, like <code</code>

So I am adding a lot of 'Easter eggs' for people to comment on. Frankly that may have drive look and feel stuff done in Austin. Maybe not but...
(Edited)