[Patch] MultiwiiConf fails to compile with current controlP5

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

[Patch] MultiwiiConf fails to compile with current controlP5

Post by Tommie »

I tried compiling MultiwiiConf with controlP5 0.7.2, which however fails with the following message:

"The method hideLabel(Controller) in the type MultiWiiConf is not applicable for the arguments (Checkbox)"

I tracked it down to the lines 223ff:

Code: Select all

...
    hideLabel(checkbox1[i].addItem(i + "1",1));hideLabel(checkbox1[i].addItem(i + "2",2));hideLabel(checkbox1[i].addItem(i + "3",3));
    hideLabel(checkbox1[i].addItem(i + "4",4));hideLabel(checkbox1[i].addItem(i + "5",5));hideLabel(checkbox1[i].addItem(i + "6",6));
...

The .addItem method of the CheckBox class does not return an object derived from the Control class; it returns the checkbox, which is a control group.

This is due to this change in controlP5:
https://code.google.com/p/controlp5/sou ... ckBox.java

I uploaded a patch that also cleans up the checkbox creation here: https://github.com/wertarbyte/multiwii- ... _hidelabel

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Tommie »

Am I the only one experiencing this problem? Any kind of feedback is greatly appreciated.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by copterrichie »

I had the same problem but I reverted back to a previous verse of Processing and ControlP for the time being.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Tommie »

copterrichie wrote:I had the same problem but I reverted back to a previous verse of Processing and ControlP for the time being.

Would you mind checking my patch? It applies to the current version of MultiwiiConfGUI and works fine for me :-)
Thanks in advance.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by copterrichie »

I will as soon as I return today.

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by KeesvR »

I've seen this and used your patch, I get a warning under in the processing screen when the Gui starts.

RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Tommie »

That's not related to the patch, I am getting this warning since day one, even with the old version of the file. It's working though.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by copterrichie »

Just wanted to let you know, I was able to compile your patch version, appears to work great. Sorry I don't have a GPS device connected but everything else is working.

Thanks.

Tifani
Posts: 63
Joined: Sun Nov 06, 2011 5:15 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Tifani »

Hi !
After applying your patch I was able to compile - will test afternoon if I finish soldering new controller.
I run Windows 7 -64bit but only 32bit version works (the same for original MultiWiiConf)
Thanks
Tom

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Hamburger »

is the patch backwards compatible, i.e. does it work with the older controlP5 version as well?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Tommie »

I don't have an earlier version installed, but since the patch is just a few lines long, someone using an older controlP5 can probably test it easily.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by copterrichie »

I just tried compiling the Patch with Processing 1.5.1 and it will not compile. :(

Error message: "This Function hideLabels() does not exist."

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Hamburger »

Ok. This is serrious.
We have an incompatiblity issue to deal with in the future from now on till forever.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Tommie »

Why not simply require the newer version of controlP5 at some point in the future?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Alexinparis »

Hi,
I tried the latest version of ControlP5. There is the incompatibility you mentioned. We could handle this by upgrading everything to the last solution, not a problem.

But there is one point I'm not happy with:
The Numberbox is the new version has now a small triangle inside and the text value is not aligned as before.
It's not a good point if we want to optimize GUI space. I would like to keep Numberbox items thanks to their scrolling ability.
I didn't manage to remove the triangles via object attributes, so until a better solution I will stay with former versions.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Hamburger »

Tommie wrote:Why not simply require the newer version of controlP5 at some point in the future?

sure, we could do that, but it is not to the point I was poking at. Whichever one of the two options we choose, we will be faced with error/support requests from people with the other s/w version and non-compilable GUI code.
About the upgrade, Alex has made his point. Fine with me.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by copterrichie »

IMO, most people don't bother compiling their own version of the GUI, so it is really a non issue in my opinion.

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Katch »

Just thought I'd post and say I ran into this problem today - I was only a few google searches away from submitting an error/support request when I found this post. Tommie's patch sorted it for me.

LenzGr
Posts: 166
Joined: Wed Nov 23, 2011 10:50 am
Location: Hamburg, Germany
Contact:

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by LenzGr »

FWIW, all the sudden this happens to me as well, after pulling the latest trunk (running ControlP5 version 0.6.12): "The function hideLabels() does not exist"

This is the offending line:

Code: Select all

    checkbox[i].hideLabels();   


Do I need to upgrade the library in order to build the GUI?

Update: Yes, updating to the latest version of ControlP5 (0.7.5) fixed the compile error.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by Hamburger »

Alexinparis wrote:Hi,
I tried the latest version of ControlP5. There is the incompatibility you mentioned. We could handle this by upgrading everything to the last solution, not a problem.
[...]
I didn't manage to remove the triangles via object attributes, so until a better solution I will stay with former versions.


so we have (been) moved to the newer ControlP5 library. I hope we do not receive too many requests for support on older versions of the GUI.

fiendie
Posts: 151
Joined: Fri Apr 20, 2012 4:22 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by fiendie »

Hamburger wrote:so we have (been) moved to the newer ControlP5 library. I hope we do not receive too many requests for support on older versions of the GUI.

Do you run a call center? :)
Just document it somewhere and be done with it.
It's an open source project. Try getting support from one of the Linux Kernel devs ;)

User avatar
kos
Posts: 286
Joined: Thu Feb 16, 2012 4:51 am
Location: Fr

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by kos »

the mwi-gui-component / ControlP5 fork used by multiwii can be found here -> https://github.com/treymarc/mwi-gui-com ... ster/build

hdias
Posts: 1
Joined: Fri Jun 29, 2012 11:06 pm

Re: [Patch] MultiwiiConf fails to compile with current contr

Post by hdias »

I had the same problem and solved it with the following code (I hope that this code is right...):

MultiWiiConf_2_0
Processing-1.5.1
controlP5-0.7.5

Code: Select all

//    hideLabel(checkbox1[i].addItem(i + "1",1));hideLabel(checkbox1[i].addItem(i + "2",2));hideLabel(checkbox1[i].addItem(i + "3",3));
//    hideLabel(checkbox1[i].addItem(i + "4",4));hideLabel(checkbox1[i].addItem(i + "5",5));hideLabel(checkbox1[i].addItem(i + "6",6));

    checkbox1[i].addItem(i + "1",1);
    checkbox1[i].addItem(i + "2",2);
    checkbox1[i].addItem(i + "3",3);
    checkbox1[i].addItem(i + "4",4);
    checkbox1[i].addItem(i + "5",5);
    checkbox1[i].addItem(i + "6",6);
    checkbox1[i].hideLabels();

    checkbox2[i] =  controlP5.addCheckBox("cb_"+i,xBox+170,yBox+20+13*i);
    checkbox2[i].setColorActive(color(255));checkbox2[i].setColorBackground(color(120));
    checkbox2[i].setItemsPerRow(6);checkbox2[i].setSpacingColumn(10);
    checkbox2[i].setLabel("");
//    hideLabel(checkbox2[i].addItem(i + "1_",1));hideLabel(checkbox2[i].addItem(i + "2_",2));hideLabel(checkbox2[i].addItem(i + "3_",3));
//    hideLabel(checkbox2[i].addItem(i + "4_",4));hideLabel(checkbox2[i].addItem(i + "5_",5));hideLabel(checkbox2[i].addItem(i + "6_",6));

    checkbox2[i].addItem(i + "1_",1);
    checkbox2[i].addItem(i + "2_",2);
    checkbox2[i].addItem(i + "3_",3);
    checkbox2[i].addItem(i + "4_",4);
    checkbox2[i].addItem(i + "5_",5);
    checkbox2[i].addItem(i + "6_",6);
    checkbox2[i].hideLabels();

Post Reply