Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color SigMF Annotations #195

Closed
wants to merge 2 commits into from

Conversation

jacobagilbert
Copy link

@jacobagilbert jacobagilbert commented Aug 25, 2021

Adds the ability to color SigMF using the information in the core:comment annotation SigMF field. If the string in this field is a valid QColor QString (see: https://doc.qt.io/qt-5/qcolor.html#setNamedColor), either a SVG named color or a supported hexadecimal color specification (including alpha) it can be used to set the color of the annotation. This has many uses, and does not require any libsigmf changes. There is also a checkbox to disable custom colors (reverts to white).

image

{
  ...
  "annotations": [
    {
      "core:sample_start": 3383600,
      "core:sample_count": 197312,
      "core:freq_upper_edge": 201379186,
      "core:freq_lower_edge": 200727361,
      "core:description": "UNKNOWN",
      "core:comment": "#55ffffff"
    },
    {
      "core:sample_start": 7327744,
      "core:sample_count": 397312,
      "core:freq_upper_edge": 198540829,
      "core:freq_lower_edge": 197964200,
      "core:description": "VALID",
      "core:comment": "lightgreen"
    },
    {
      "core:sample_start": 5327744,
      "core:sample_count": 897312,
      "core:freq_upper_edge": 195540829,
      "core:freq_lower_edge": 194964200,
      "core:description": "ERROR",
      "core:comment": "palevioletred"
    },
    ...
  ]
}

Closes #189 (as this MR includes it... ill leave that open in case you just want it and not this one).

Jacob Gilbert added 2 commits July 16, 2021 22:43
Signed-off-by: Jacob Gilbert <jacob.gilbert@protonmail.com>
This allows the use of the  field to specify a QColor string
for the annotation. This can be an SVG Named Color Code, or a valid hex
string (see: https://doc.qt.io/qt-5/qcolor.html#setNamedColor)

Signed-off-by: Jacob Gilbert <jacob.gilbert@protonmail.com>
@jacobagilbert
Copy link
Author

This is a potential abuse of the core:comment field... if this is the type of behavior that you like @miek we could discuss expanding this to provide control over line width, fill, text, etc via a dedicated inspectrum.sigmf-ext.md extension. This is more complicated as libsigmf would need to be updated for that extension, but I can probably make that happen.

@jacobagilbert
Copy link
Author

jacobagilbert commented Oct 11, 2021

New plan is to add a presentation.sigmf-ext.md extension to more cleanly handle this, and to support it within libsigmf directly. This should not be merged, so I am going to close it.

For now its still on the main branch of my fork of inspectrum if anyone would like to try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant