Inverted peakmeterctrl

I recently started looking at the various controls within the AGW widgets and came across the peak meter. Does anyone have conductive suggestions on how to invert the control so that the bars/cells drop down instead of going up? I'm curious because I can see a use for it within a project for my son.

This doesn’t appear to be implemented in the source code. You can do horizontal, but I don’t see any way to flip it so the peak meter goes down or even to the left. On the plus side, this widget is pure Python, so you can read the source and modify it a bit to see if you can get it to work. I think with a little experimentation, you could probably get this working.

  • Mike
···

On Tuesday, June 24, 2014 3:02:05 PM UTC-5, Mike Stover wrote:

I recently started looking at the various controls within the AGW widgets and came across the peak meter. Does anyone have conductive suggestions on how to invert the control so that the bars/cells drop down instead of going up? I’m curious because I can see a use for it within a project for my son.

That's what I thought I might need to do. I think I'll start by simply subclassing the current widget and copying the code for the vertical orientation to that to tweak.

Well, after some sleep deprived frustration I was able to create an inverted version of the Vertical Peak Meter. So far I have only tested this with subclassing Andrea’s DrawVertBand but I am currently working on incorporating the code into a copy of Andrea’s original. If anyone is interested I’ll post the .py file when I am satisfied with the changes, including the name of the style flag. I am open to suggestions for the style name, so far I have thought of PM_VERTICAL_INVERT, PM_INVERTED_VERTICAL, or even PM_VERTICAL_TOP.

I guess while I am at it I will also attempt to finish adding the Falloff effect to the horizontal Peak Meter as well as the new Inverted Vertical. The changes were easier than I had expected, it was just difficult to find the time.

-Mike S.

···

On Tuesday, June 24, 2014 6:32:04 PM UTC-4, Mike Stover wrote:

That’s what I thought I might need to do. I think I’ll start by simply subclassing the current widget and copying the code for the vertical orientation to that to tweak.

say: Thank you. You rock!

···

On Fri, Jun 27, 2014 at 12:26 PM, Mike Stover <hakugin.gin@gmail.com> wrote:

Well, after some sleep deprived frustration I was able to create an
inverted version of the Vertical Peak Meter. So far I have only tested this
with subclassing Andrea's DrawVertBand but I am currently working on
incorporating the code into a copy of Andrea's original. If anyone is
interested I'll post the .py file when I am satisfied with the changes,
including the name of the style flag. I am open to suggestions for the
style name, so far I have thought of PM_VERTICAL_INVERT,
PM_INVERTED_VERTICAL, or even PM_VERTICAL_TOP.

I guess while I am at it I will also attempt to finish adding the Falloff
effect to the horizontal Peak Meter as well as the new Inverted Vertical.
The changes were easier than I had expected, it was just difficult to find
the time.

-Mike S.

On Tuesday, June 24, 2014 6:32:04 PM UTC-4, Mike Stover wrote:

That's what I thought I might need to do. I think I'll start by simply
subclassing the current widget and copying the code for the vertical
orientation to that to tweak.

I don't know whether I'll ever need this control, but I'd just like to

Ok, now that I have worked out a few of the kinks on this computer I am able to upload the modified peakmeter.py, which I named peakmeter2.py so that I retained the original for backup purposes. I’ve attached the updated code.

A few of the changes include:
Added fall off effect for horizontal peakmeter

Added the new orientation, Inverted Vertical

Added fall off effect for the new orientation as well

Most of the work was already completed by Andrea Gavana (original creator), it was simply applying a little extra time to copy/paste/modify to add the missing / extra features.

peakmeter2.py (30.5 KB)

···

On Tuesday, June 24, 2014 4:02:05 PM UTC-4, Mike Stover wrote:

I recently started looking at the various controls within the AGW widgets and came across the peak meter. Does anyone have conductive suggestions on how to invert the control so that the bars/cells drop down instead of going up? I’m curious because I can see a use for it within a project for my son.

Mike,
If you want to spend some more time… head over to trac.wxwidgets.org and create a ticket for ‘new feature’ (I think that’s what it’s called)… then use a diff tool (lately I’ve been using Beyond Compare) to create a unified diff patch file… diff the latest SVN version of peakmeter.py (wxTrac has been migrated to GitHub Issues - wxWidgets) and that same file with your fixes applied (that file may be the same one you already have, depends how recently the SVN has been updated) then add that patch file to your new ticket. I think it’s ideal if you add some demo code too.

Congrats!

···

On Tuesday, July 1, 2014 7:01:09 AM UTC-7, Mike Stover wrote:

Ok, now that I have worked out a few of the kinks on this computer I am able to upload the modified peakmeter.py, which I named peakmeter2.py so that I retained the original for backup purposes. I’ve attached the updated code.

A few of the changes include:
Added fall off effect for horizontal peakmeter

Added the new orientation, Inverted Vertical

Added fall off effect for the new orientation as well

Most of the work was already completed by Andrea Gavana (original creator), it was simply applying a little extra time to copy/paste/modify to add the missing / extra features.

On Tuesday, June 24, 2014 4:02:05 PM UTC-4, Mike Stover wrote:

I recently started looking at the various controls within the AGW widgets and came across the peak meter. Does anyone have conductive suggestions on how to invert the control so that the bars/cells drop down instead of going up? I’m curious because I can see a use for it within a project for my son.

Thanks, at the moment I do not have access to a difference tool to create a patch file, but I will make sure to submit one soon.

···

On Tuesday, July 1, 2014 4:03:24 PM UTC-4, Nathan McCorkle wrote:

Mike,
If you want to spend some more time… head over to trac.wxwidgets.org and create a ticket for ‘new feature’ (I think that’s what it’s called)… then use a diff tool (lately I’ve been using Beyond Compare) to create a unified diff patch file… diff the latest SVN version of peakmeter.py (http://trac.wxwidgets.org/browser/wxPython/3rdParty/AGW/agw/peakmeter.py) and that same file with your fixes applied (that file may be the same one you already have, depends how recently the SVN has been updated) then add that patch file to your new ticket. I think it’s ideal if you add some demo code too.

Congrats!

On Tuesday, July 1, 2014 7:01:09 AM UTC-7, Mike Stover wrote:

Ok, now that I have worked out a few of the kinks on this computer I am able to upload the modified peakmeter.py, which I named peakmeter2.py so that I retained the original for backup purposes. I’ve attached the updated code.

A few of the changes include:
Added fall off effect for horizontal peakmeter

Added the new orientation, Inverted Vertical

Added fall off effect for the new orientation as well

Most of the work was already completed by Andrea Gavana (original creator), it was simply applying a little extra time to copy/paste/modify to add the missing / extra features.

On Tuesday, June 24, 2014 4:02:05 PM UTC-4, Mike Stover wrote:

I recently started looking at the various controls within the AGW widgets and came across the peak meter. Does anyone have conductive suggestions on how to invert the control so that the bars/cells drop down instead of going up? I’m curious because I can see a use for it within a project for my son.

Oh, and apparently peakmeter.py hasn’t changed in 2 years and the version I have came with wxPython 3.0.0.0

···

On Tuesday, July 1, 2014 4:03:24 PM UTC-4, Nathan McCorkle wrote:

Mike,
If you want to spend some more time… head over to trac.wxwidgets.org and create a ticket for ‘new feature’ (I think that’s what it’s called)… then use a diff tool (lately I’ve been using Beyond Compare) to create a unified diff patch file… diff the latest SVN version of peakmeter.py (http://trac.wxwidgets.org/browser/wxPython/3rdParty/AGW/agw/peakmeter.py) and that same file with your fixes applied (that file may be the same one you already have, depends how recently the SVN has been updated) then add that patch file to your new ticket. I think it’s ideal if you add some demo code too.

Congrats!

On Tuesday, July 1, 2014 7:01:09 AM UTC-7, Mike Stover wrote:

Ok, now that I have worked out a few of the kinks on this computer I am able to upload the modified peakmeter.py, which I named peakmeter2.py so that I retained the original for backup purposes. I’ve attached the updated code.

A few of the changes include:
Added fall off effect for horizontal peakmeter

Added the new orientation, Inverted Vertical

Added fall off effect for the new orientation as well

Most of the work was already completed by Andrea Gavana (original creator), it was simply applying a little extra time to copy/paste/modify to add the missing / extra features.

On Tuesday, June 24, 2014 4:02:05 PM UTC-4, Mike Stover wrote:

I recently started looking at the various controls within the AGW widgets and came across the peak meter. Does anyone have conductive suggestions on how to invert the control so that the bars/cells drop down instead of going up? I’m curious because I can see a use for it within a project for my son.

Yeah. I don’t think I’ve seen many people mention that widget on here, so Andrea probably doesn’t receive very many feature requests or bug reports.

Mike

···

On Wednesday, July 2, 2014 7:25:04 AM UTC-5, Mike Stover wrote:

Oh, and apparently peakmeter.py hasn’t changed in 2 years and the version I have came with wxPython 3.0.0.0

To be honest, I didn’t even know it was part of AGW until I was asked to help create something similar to KITT’s voicebox display in Knight Rider…
I’ll see about using Beyond Compare on my Ubuntu laptop (unless there is another tool able to make a diff patch) and submit the patch, hopefully later today.

···

On Wednesday, July 2, 2014 9:35:44 AM UTC-4, Mike Driscoll wrote:

On Wednesday, July 2, 2014 7:25:04 AM UTC-5, Mike Stover wrote:

Oh, and apparently peakmeter.py hasn’t changed in 2 years and the version I have came with wxPython 3.0.0.0

Yeah. I don’t think I’ve seen many people mention that widget on here, so Andrea probably doesn’t receive very many feature requests or bug reports.

Mike

Ok, managed to submit a patch ticket during my lunch break. http://trac.wxwidgets.org/ticket/16364, here’s hoping it gets added!

···

On Wednesday, July 2, 2014 10:52:37 AM UTC-4, Mike Stover wrote:

To be honest, I didn’t even know it was part of AGW until I was asked to help create something similar to KITT’s voicebox display in Knight Rider…
I’ll see about using Beyond Compare on my Ubuntu laptop (unless there is another tool able to make a diff patch) and submit the patch, hopefully later today.

On Wednesday, July 2, 2014 9:35:44 AM UTC-4, Mike Driscoll wrote:

On Wednesday, July 2, 2014 7:25:04 AM UTC-5, Mike Stover wrote:

Oh, and apparently peakmeter.py hasn’t changed in 2 years and the version I have came with wxPython 3.0.0.0

Yeah. I don’t think I’ve seen many people mention that widget on here, so Andrea probably doesn’t receive very many feature requests or bug reports.

Mike

Ok, managed to submit a patch ticket during my lunch break. http://trac.wxwidgets.org/ticket/16364, here’s hoping it gets added!

To be honest, I didn’t even know it was part of AGW until I was asked to help create something similar to KITT’s voicebox display in Knight Rider…
I’ll see about using Beyond Compare on my Ubuntu laptop (unless there is another tool able to make a diff patch) and submit the patch, hopefully later today.

Oh, and apparently peakmeter.py hasn’t changed in 2 years and the version I have came with wxPython 3.0.0.0

Yeah. I don’t think I’ve seen many people mention that widget on here, so Andrea probably doesn’t receive very many feature requests or bug reports.

Mike

Looks ligit to me. The demo worked. Tho I see you missed at least a single docstring under the
PM_VERTICAL_INVERTED = 2

“”" Shows inverted vertical bands in :class:PeakMeterCtrl. “”"

line. This is for the sphinx docs.

···

On Wednesday, July 2, 2014 11:24:32 AM UTC-6, Mike Stover wrote:

On Wednesday, July 2, 2014 10:52:37 AM UTC-4, Mike Stover wrote:

On Wednesday, July 2, 2014 9:35:44 AM UTC-4, Mike Driscoll wrote:

On Wednesday, July 2, 2014 7:25:04 AM UTC-5, Mike Stover wrote:

Did not realize I missed the doc strings, I’ll get that fixed.

···

On Wednesday, July 2, 2014 5:35:45 PM UTC-4, Metallicow wrote:

On Wednesday, July 2, 2014 11:24:32 AM UTC-6, Mike Stover wrote:

Ok, managed to submit a patch ticket during my lunch break. http://trac.wxwidgets.org/ticket/16364, here’s hoping it gets added!

On Wednesday, July 2, 2014 10:52:37 AM UTC-4, Mike Stover wrote:

To be honest, I didn’t even know it was part of AGW until I was asked to help create something similar to KITT’s voicebox display in Knight Rider…
I’ll see about using Beyond Compare on my Ubuntu laptop (unless there is another tool able to make a diff patch) and submit the patch, hopefully later today.

On Wednesday, July 2, 2014 9:35:44 AM UTC-4, Mike Driscoll wrote:

On Wednesday, July 2, 2014 7:25:04 AM UTC-5, Mike Stover wrote:

Oh, and apparently peakmeter.py hasn’t changed in 2 years and the version I have came with wxPython 3.0.0.0

Yeah. I don’t think I’ve seen many people mention that widget on here, so Andrea probably doesn’t receive very many feature requests or bug reports.

Mike

Looks ligit to me. The demo worked. Tho I see you missed at least a single docstring under the
PM_VERTICAL_INVERTED = 2

“”" Shows inverted vertical bands in :class:PeakMeterCtrl. “”"

line. This is for the sphinx docs.