Bitmap to Component Converter - Options error

Bug #1744043 reported by Hildo Guillardi Júnior
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Jeff Young

Bug Description

When I use the Bitmap to Component Converter, on KiCad Nightly e1c01e1~61~ubuntu16.04, the "Options" (Normal/Negative) on the right have some strange behavior.
Clicking on one of them, the figure view still switching, like if the options was changed (e.g. clicking first time on "Negative", sure, goes negative, but clicking again, goes normal and still checked negative). Appear be just a error in the GUI.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Jeff Young (jeyjey) wrote :

I can't reproduce this on OSX. I know Windows has some issues with radio buttons, but Hildo reports this on ubuntu.

Can anyone else reproduce it?

Changed in kicad:
status: New → Incomplete
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I just tested now (201802181433+322ce84~61~ubuntu16.04.1). And the behavior still: clicking in "Options >> Normal", the image still switching between Normal and Negative (like if I had clicked on "Options >> Negative").

Revision history for this message
Jeff Young (jeyjey) wrote :

My bad. Clicking on the *already selected* radio button causes it to toggle. I didn't get that part.

Easy to reproduce.

Changed in kicad:
status: Incomplete → Triaged
importance: Undecided → Low
assignee: nobody → Jeff Young (jeyjey)
Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1744043] Re: Bitmap to Component Converter - Options error

wxUpdateUIEvent is your friend. This way you don't have to keep track
of where control state is being toggled, set, or cleared in code.

On 02/18/2018 07:56 PM, Jeff Young wrote:
> My bad. Clicking on the *already selected* radio button causes it to
> toggle. I didn't get that part.
>
> Easy to reproduce.
>
> ** Changed in: kicad
> Status: Incomplete => Triaged
>
> ** Changed in: kicad
> Importance: Undecided => Low
>
> ** Changed in: kicad
> Assignee: (unassigned) => Jeff Young (jeyjey)
>

Revision history for this message
Jeff Young (jeyjey) wrote :

Patch was missing a file.

Revision history for this message
Jeff Young (jeyjey) wrote :

Repaired patch.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Jeff, this wasn't exactly what I had in mind but it will work. wxUpdateUIEvents are for managing UI control states. If you perform a task that takes a long time in a wxUpdateUIEvent, the UI will hang until the event is processed. I'm guessing Binarize() doesn't take too long or you would have noticed it. Typically you want to keep a variable with the state of the UI control and update the variable when you fire an event such as from a button or a menu. I'm not sure why you wouldn't just use a checkbox for the negative rather than two radio buttons. I think unchecked for the not negative condition would be obvious. If you want me to, I can go ahead merge this as is or you can change it. Please let me know.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I agree with @stambaughw, a "work around" and better design may be just use a CheckBox as "Negative Image Option", if not checked, the image have to be normal. Add a code variable just to deal with this appear strange.

Revision history for this message
Jeff Young (jeyjey) wrote :

@Wayne, let me have another crack at it. I'll see if I can't come up with something better.

Revision history for this message
Jeff Young (jeyjey) wrote :

@Hildo, since the algorithm uses essentially an XOR to reverse the image (the original isn't stored), we have to have a variable to track it.

Revision history for this message
Jeff Young (jeyjey) wrote :

@Wayne & @Hildo, let me know what you think of this one.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Well done Jeff, thank you very much!

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 702eb48ca057be7d64e65441581aec18faf2dfef
https://git.launchpad.net/kicad/patch/?id=702eb48ca057be7d64e65441581aec18faf2dfef

Changed in kicad:
status: Triaged → Fix Committed
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Nice, @jeyjey.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.