Units in Sketcher

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Units in Sketcher

Postby jriegel » Sun Dec 15, 2013 10:03 pm

Progressing with the role-out of the Unit system the first user facing gui component in FreeCAD got Unit support - the sketcher gui. From now on (in master) the sketcher use the chosen unit-system to display distances and Angles. Also for creating and editing of constraint values the new InputField Qt widget is used. It allows:

* entering units of any kind
* calculating with mathematical expressions
* preserves history values of the certain parameter
* Visual feedback about the correct input
* context menu

http://www.freecadweb.org/wiki/index.ph ... InputField

Have fun and I'm looking forward on feedback...
Stop whining - start coding!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Units in Sketcher

Postby NormandC » Sun Dec 15, 2013 10:25 pm

I'm unable to compile... even when starting fresh, out-of-source build.

Code: Select all

[ 19%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Quantity.cpp.o
In file included from /home/normand/compilation/freecad/src/Base/Quantity.h:27:0,
                 from /home/normand/compilation/freecad/src/Base/Quantity.cpp:29:
/home/normand/compilation/freecad/src/Base/Unit.h:78:2: erreur: ‘QString’ does not name a type
/home/normand/compilation/freecad/src/Base/Unit.h:80:2: erreur: ‘QString’ does not name a type
[ 19%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/QuantityPyImp.cpp.o
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/Quantity.cpp.o] Erreur 1
make[2]: *** Attente des tâches non terminées....
Scanning dependencies of target SMESHDS
[ 19%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_Hypothesis.cpp.o
In file included from /home/normand/compilation/freecad/src/Base/Quantity.h:27:0,
                 from /home/normand/compilation/freecad/src/Base/QuantityPyImp.cpp:4:
/home/normand/compilation/freecad/src/Base/Unit.h:78:2: erreur: ‘QString’ does not name a type
/home/normand/compilation/freecad/src/Base/Unit.h:80:2: erreur: ‘QString’ does not name a type
[ 19%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_Mesh.cpp.o
/home/normand/compilation/freecad/src/Base/QuantityPyImp.cpp: In member function ‘std::string Base::QuantityPy::representation() const’:
/home/normand/compilation/freecad/src/Base/QuantityPyImp.cpp:19:37: erreur: ‘const class Base::Unit’ has no member named ‘getString’
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/QuantityPyImp.cpp.o] Erreur 1
make[1]: *** [src/Base/CMakeFiles/FreeCADBase.dir/all] Erreur 2
make[1]: *** Attente des tâches non terminées....
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_GroupBase.cpp.o
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_SubMesh.cpp.o
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_Document.cpp.o
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_GroupOnGeom.cpp.o
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_Group.cpp.o
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_Script.cpp.o
[ 20%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESHDS.dir/src/SMESHDS/SMESHDS_Command.cpp.o
Linking CXX shared library ../../../lib/SMESHDS.so
[ 20%] Built target SMESHDS
Linking CXX shared library ../../../bin/pivy/_coin.so
[ 20%] Built target coin
make: *** [all] Erreur 2
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Units in Sketcher

Postby jriegel » Sun Dec 15, 2013 11:07 pm

Try again...
Stop whining - start coding!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Units in Sketcher

Postby NormandC » Sun Dec 15, 2013 11:10 pm

Thanks. I'm now getting this:

Code: Select all

[ 16%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/DriverUNV.dir/src/DriverUNV/UNV2417_Structure.cpp.o
/home/normand/compilation/freecad/src/Base/UnitsSchemaMKS.cpp: In member function ‘virtual QString Base::UnitsSchemaMKS::schemaTranslate(Base::Quantity, double&, QString&)’:
/home/normand/compilation/freecad/src/Base/UnitsSchemaMKS.cpp:39:49: erreur: call of overloaded ‘abs(double)’ is ambiguous
/home/normand/compilation/freecad/src/Base/UnitsSchemaMKS.cpp:39:49: note: candidates are:
/usr/include/stdlib.h:771:12: note: int abs(int)
/usr/include/c++/4.6/cstdlib:139:3: note: long int std::abs(long int)
/usr/include/c++/4.6/cstdlib:173:3: note: long long int __gnu_cxx::abs(long long int)
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/UnitsSchemaMKS.cpp.o] Erreur 1
make[1]: *** [src/Base/CMakeFiles/FreeCADBase.dir/all] Erreur 2
make[1]: *** Attente des tâches non terminées....
Linking CXX shared library ../../../lib/DriverUNV.so
[ 16%] Built target DriverUNV
make: *** [all] Erreur 2
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Units in Sketcher

Postby jriegel » Sun Dec 15, 2013 11:20 pm

Ok, next try...
Stop whining - start coding!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Units in Sketcher

Postby NormandC » Sun Dec 15, 2013 11:23 pm

:D

Next error, seems SMESH is the problem now? :?

Code: Select all

[ 16%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/__/zipios++/basicentry.cpp.o
/home/normand/compilation/freecad/src/Base/UnitPyImp.cpp: In member function ‘std::string Base::UnitPy::representation() const’:
/home/normand/compilation/freecad/src/Base/UnitPyImp.cpp:28:63: erreur: conversion from ‘QByteArray’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/UnitPyImp.cpp.o] Erreur 1
make[2]: *** Attente des tâches non terminées....
[ 16%] make[1]: *** [src/Base/CMakeFiles/FreeCADBase.dir/all] Erreur 2
make[1]: *** Attente des tâches non terminées....
Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Group.cpp.o
[ 16%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Exception.cpp.o
[ 16%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Hypothesis.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Block.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_subMesh.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_2D_Algo.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Gen.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_MeshEditor.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Algo.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_OctreeNode.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_HypoFilter.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Octree.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_3D_Algo.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_1D_Algo.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_MesherHelper.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_MeshVSLink.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_0D_Algo.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/Controls/SMESH_Controls.cpp.o
[ 17%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/Controls/SMESHControls.cpp.o
Linking CXX shared library ../../../lib/SMESH.so
[ 17%] Built target SMESH
make: *** [all] Erreur 2
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Units in Sketcher

Postby jriegel » Sun Dec 15, 2013 11:27 pm

No, its still QString... Next try ;)
Stop whining - start coding!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Units in Sketcher

Postby NormandC » Sun Dec 15, 2013 11:31 pm

Compile now at 56%, looking good! :)
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Units in Sketcher

Postby NormandC » Sun Dec 15, 2013 11:33 pm

No luck. :(

Code: Select all

[ 69%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/SpinBox.cpp.o
/home/normand/compilation/freecad/src/Gui/InputField.cpp: In member function ‘void Gui::InputField::pushToHistory(const QString&)’:
/home/normand/compilation/freecad/src/Gui/InputField.cpp:142:31: erreur: ambiguous overload for ‘operator=’ in ‘value = QString::toUtf8() const()’
/home/normand/compilation/freecad/src/Gui/InputField.cpp:142:31: note: candidates are:
/usr/include/c++/4.6/bits/basic_string.h:549:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<char>]
/usr/include/c++/4.6/bits/basic_string.h:560:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<char>]
/home/normand/compilation/freecad/src/Gui/InputField.cpp: In member function ‘void Gui::InputField::pushToSavedValues(const QString&)’:
/home/normand/compilation/freecad/src/Gui/InputField.cpp:183:31: erreur: ambiguous overload for ‘operator=’ in ‘value = QString::toUtf8() const()’
/home/normand/compilation/freecad/src/Gui/InputField.cpp:183:31: note: candidates are:
/usr/include/c++/4.6/bits/basic_string.h:549:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<char>]
/usr/include/c++/4.6/bits/basic_string.h:560:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<char>]
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/InputField.cpp.o] Erreur 1
make[2]: *** Attente des tâches non terminées....
make[1]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/all] Erreur 2
make: *** [all] Erreur 2
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Units in Sketcher

Postby jriegel » Sun Dec 15, 2013 11:39 pm

gcc is a real bitch!
Next try.....
Stop whining - start coding!