View Issue Details

IDProjectCategoryView StatusLast Update
0001110PartDesignBugpublic2013-07-12 13:19
Reporterproject4 Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.13 
Fixed in Version0.14 
Summary0001110: Decimal point entry in LinearPattern length field
DescriptionMinor, but very annoying...

When using the LinearPattern tool, entering a number with a decimal point (ie 100.20) will stop the entry after the point is pressed.
Looks like the cursor moves beyond the dot, but any pressed number is not shown.

I guess the problem is created since the number of digits after the point is limited to 3, so the system doesn't allow it to become "100.2000" when it sees "100.000".

Solution is to press the point and delete the zeros after it to allow entry of the numbers.
TagsNo tags attached.
FreeCAD Information

Activities

normandc

2013-04-28 18:07

manager   ~0003120

You have reported many bugs and in none of them do you specify your FreeCAD version and operating system. Please do so in each of them.

project4

2013-04-28 18:25

reporter   ~0003121

I've selected product version as 0.13 in bugtracker menu, but here's the info anyway:

OS: Ubuntu 11.10
Platform: 64-bit
Version: 0.13.1830 (Git)
Branch: releases/FreeCAD-0-13
Hash: ec7636d7aaf2612e9b43cff5d6a424037d53e505
Python version: 2.7.2+
Qt version: 4.7.4
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0

normandc

2013-04-28 20:15

manager   ~0003127

Thanks. The fact is there are great differences in library versions between Ubuntu versions, other Linux distros or Win or Mac. Some bugs may or may not appear on all platforms.

I checked and have the same problem on Ubuntu 12.04 LTS.

OS: Ubuntu 12.04.2 LTS
Platform: 64-bit
Version: 0.13.1830 (Git)
Branch: releases/FreeCAD-0-13
Hash: ec7636d7aaf2612e9b43cff5d6a424037d53e505
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0

project4

2013-07-12 05:47

reporter   ~0003378

Hi, since I have to model many parts and that issue is getting really annoying, I took control and here's the proposed solution (diff file attached):

Add a timer, when a parameter changes, restart the timer.
When timer expires update the UI and recompute.
I set the time to 1 second, which might be later added to a global configuration...

I've also updated the .gitignore to hide some autogenerated files.
I don't really understand how do you work when all the generated files appears as changed...
There are still many files listed there, it will be a good idea to have all autogenerated files with a special name, like you have the moc_*.cpp, ui_*.h and *.cxx

The application is great, so keep up the good work!
The real thing that is missing is the assembly module... When done, it might replace the sketchUp for many people...

2013-07-12 05:48

 

LinearPatternParameters.diff (7,251 bytes)   
diff --git a/.gitignore b/.gitignore
index fae4f11..761f412 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,3 @@
 # file types to ignore
 
 *.pyc
-*~
-*.cmake
-CMakeFiles/
-*qrc.depends
-qrc_*.cpp
-*.cxx
-ui_*.h
-moc_*.cpp
-Makefile
-CMakeCache.txt
-config.h
-install_manifest.txt
-
diff --git a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
index d3a819c..0588b27 100644
--- a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
+++ b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
@@ -93,13 +93,7 @@ TaskLinearPatternParameters::TaskLinearPatternParameters(TaskMultiTransformParam
 
 void TaskLinearPatternParameters::setupUI()
 {
-	updateViewTimer = new QTimer(this);
-	updateViewTimer->setSingleShot(true);
-	updateViewTimer->setInterval(1000);
-	
-    connect(updateViewTimer, SIGNAL(timeout()),
-            this, SLOT(onUpdateViewTimer()));
-	connect(ui->comboDirection, SIGNAL(activated(int)),
+    connect(ui->comboDirection, SIGNAL(activated(int)),
             this, SLOT(onDirectionChanged(int)));
     connect(ui->checkReverse, SIGNAL(toggled(bool)),
             this, SLOT(onCheckReverse(bool)));
@@ -137,7 +131,7 @@ void TaskLinearPatternParameters::updateUI()
     if (blockUpdate)
         return;
     blockUpdate = true;
-
+
     PartDesign::LinearPattern* pcLinearPattern = static_cast<PartDesign::LinearPattern*>(getObject());
 
     App::DocumentObject* directionFeature = pcLinearPattern->Direction.getValue();
@@ -170,7 +164,7 @@ void TaskLinearPatternParameters::updateUI()
                 undefined = true;
         } else if (directionFeature != NULL && !directions.empty()) {
             ui->comboDirection->addItem(QString::fromAscii(directions.front().c_str()));
-            ui->comboDirection->setCurrentIndex(maxcount);
+            ui->comboDirection->setCurrentIndex(maxcount);
         }
     } else {
         undefined = true;
@@ -194,12 +188,6 @@ void TaskLinearPatternParameters::updateUI()
     blockUpdate = false;
 }
 
-void TaskLinearPatternParameters::onUpdateViewTimer()
-{
-    updateUI();
-    recomputeFeature();
-}
-
 void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
 {
     if (msg.Type == Gui::SelectionChanges::AddSelection) {
@@ -223,9 +211,8 @@ void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges
                 std::vector<std::string> directions(1,subName);
                 pcLinearPattern->Direction.setValue(getSupportObject(), directions);
 
-				if(updateView()) {
-					kickUpdateViewTimer();
-				}
+                recomputeFeature();
+                updateUI();
             }
             else {
                 App::DocumentObject* sketch = getSketchObject();
@@ -250,23 +237,19 @@ void TaskLinearPatternParameters::onCheckReverse(const bool on) {
     pcLinearPattern->Reversed.setValue(on);
 
     exitSelectionMode();
-	
-	if(updateView()) {
-		kickUpdateViewTimer();
-	}
+    updateUI();
+    recomputeFeature();
 }
 
 void TaskLinearPatternParameters::onLength(const double l) {
-	if (blockUpdate)
+    if (blockUpdate)
         return;
     PartDesign::LinearPattern* pcLinearPattern = static_cast<PartDesign::LinearPattern*>(getObject());
     pcLinearPattern->Length.setValue(l);
 
-	exitSelectionMode();
-
-	if(updateView()) {
-		kickUpdateViewTimer();
-	}
+    exitSelectionMode();
+    updateUI();
+    recomputeFeature();
 }
 
 void TaskLinearPatternParameters::onOccurrences(const int n) {
@@ -276,10 +259,8 @@ void TaskLinearPatternParameters::onOccurrences(const int n) {
     pcLinearPattern->Occurrences.setValue(n);
 
     exitSelectionMode();
-	
-	if(updateView()) {
-		kickUpdateViewTimer();
-	}
+    updateUI();
+    recomputeFeature();
 }
 
 void TaskLinearPatternParameters::onDirectionChanged(int num) {
@@ -316,9 +297,8 @@ void TaskLinearPatternParameters::onDirectionChanged(int num) {
     else if (num == maxcount)
         exitSelectionMode();
 
-	if(updateView()) {
-		kickUpdateViewTimer();
-	}
+    updateUI();
+    recomputeFeature();
 }
 
 void TaskLinearPatternParameters::onUpdateView(bool on)
@@ -347,18 +327,8 @@ void TaskLinearPatternParameters::onUpdateView(bool on)
     }
 }
 
-const bool TaskLinearPatternParameters::updateView() const
-{
-	return ui->checkBoxUpdateView->isChecked();
-}
-
-const void TaskLinearPatternParameters::kickUpdateViewTimer() const
-{
-	updateViewTimer->start();
-}
-
 const std::string TaskLinearPatternParameters::getDirection(void) const
-{
+{
     App::DocumentObject* pcSketch = getSketchObject();
     int maxcount=2;
     if (pcSketch)
@@ -378,17 +348,17 @@ const std::string TaskLinearPatternParameters::getDirection(void) const
     return std::string("");
 }
 
-const bool TaskLinearPatternParameters::getReverse(void) const
+const bool TaskLinearPatternParameters::getReverse(void) const
 {
     return ui->checkReverse->isChecked();
 }
 
-const double TaskLinearPatternParameters::getLength(void) const
+const double TaskLinearPatternParameters::getLength(void) const
 {
     return ui->spinLength->value();
 }
 
-const unsigned TaskLinearPatternParameters::getOccurrences(void) const
+const unsigned TaskLinearPatternParameters::getOccurrences(void) const
 {
     return ui->spinOccurrences->value();
 }
@@ -445,7 +415,7 @@ bool TaskDlgLinearPatternParameters::accept()
             buf = buf.arg(QString::fromUtf8(direction.c_str()));
             Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = %s", name.c_str(), buf.toStdString().c_str());
         } else
-            Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = None", name.c_str());
+            Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = None", name.c_str());
         Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),linearpatternParameter->getReverse());
         Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Length = %f",name.c_str(),linearpatternParameter->getLength());
         Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Occurrences = %u",name.c_str(),linearpatternParameter->getOccurrences());
diff --git a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.h b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.h
index a9335f8..a76e946 100644
--- a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.h
+++ b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.h
@@ -60,9 +60,8 @@ public:
     const bool getReverse(void) const;
     const double getLength(void) const;
     const unsigned getOccurrences(void) const;
-	
+
 private Q_SLOTS:
-	void onUpdateViewTimer();
     void onDirectionChanged(int num);
     void onCheckReverse(const bool on);
     void onLength(const double l);
@@ -76,12 +75,9 @@ protected:
 private:
     void setupUI();
     void updateUI();
-	const bool updateView() const;
-	const void kickUpdateViewTimer() const;
 
 private:
     Ui_TaskLinearPatternParameters* ui;
-	QTimer *updateViewTimer;
 };
 
 
LinearPatternParameters.diff (7,251 bytes)   

wmayer

2013-07-12 08:48

administrator   ~0003380

IMO the patch is by far too complicated. Why not just removing updateUI() from onCheckReverse(), onLength(), onOccurrences() and onDirectionChanged()?

I don't see a reason why calling it there is needed.

wmayer

2013-07-12 08:52

administrator   ~0003381

> I don't really understand how do you work when all the generated files appears as changed...

Why do they appear as changed?

wmayer

2013-07-12 08:56

administrator   ~0003382

git show 227b1f6

project4

2013-07-12 10:45

reporter   ~0003385

Well, I just looked around and saw that all other dialog boxes had the call to updateUI, so I've looked a solution around it.

Thanks for the commit with the fix.

I still see benefit for delayed update, here's a scenario:
I have a complex object with many linear repetitions that take some time to update.
I want to update the length field to let's say 123.55 value.
I select current text in the field, type "1", get the "overlapping" message...
Type "2", get the overlapping message again.
Type "3", now there is no overlapping, but the object is recalculated.
Type ".", probably recalculated again
Type "5", recalculated again
And the last "5" also triggers recalculation...

6 time consuming operations opposing to just 1 that I really need.

Deselecting "Update view" checkbox is a possible solution, but since it's value is not saved anywhere, doing it every time I want to change some numbers is very annoying...

Just my 2 cents.

project4

2013-07-12 10:52

reporter   ~0003386

Sorry, the files appear in git status as new files and not changed, but still, scrolling 200 lines up to see what was actually changed and need commit is not a good practice.

I suggest to add all autogenerated files to .gitignore, that's what this file is used for.

I want to promote FreeCad to my customers as a tool for mechanical planning. My customers most likely are not willing to pay for a program like that, they will prefer a pen and a paper instead of paying high sums...
The missing part in the assembly module...
I think I might find some time to help you with the development, so there are some questions:
Is there any design guidelines for the program I can read? Or any document describling the design?
Is there a mailing list or something like that can be used to ask questions and collaborate with other developers?

Thanks.

wmayer

2013-07-12 11:54

administrator   ~0003388

> I still see benefit for delayed update, here's a scenario:...
You're right, that's a good point!

> Sorry, the files appear in git status as new files and not changed, but still, scrolling 200 lines up to see what was actually changed and need commit is not a good practice.
When I do a git status all these auto generated files don't even appear because I do an out-of-source build. And files that are not part of the repository appear as "Untracked files".
> I suggest to add all autogenerated files to .gitignore, that's what this file is used for.
But isn't this "*.cxx" too strong because we also have some real .cxx files in the repo? The same applies to "*.cmake".

> I think I might find some time to help you with the development, so there are some questions:
 Is there any design guidelines for the program I can read? Or any document describling the design?
 Is there a mailing list or something like that can be used to ask questions and collaborate with other developers?

Do you know of the dev-assembly branch? I think the best place to discuss things is here: http://forum.freecadweb.org/viewforum.php?f=20

project4

2013-07-12 12:14

reporter   ~0003389

Now I see the src/CXX folder with real files...
Maybe we should consider other rules...
Like appending "_autogenerated" to the file name for example. That might be a good caution flag in addition to the warning the file that all the changes will be lost.

Are there manually maintained *.cmake files?
I thought all are generated...

Another path to take is to generate the .gitignore in every directory where the autogenerated files are produced. That way it will always be in sync with the actual files.

Thanks for the link, I've found the forum right after I wrote the questions.
Will ask the questions there.
Looks like the assembly launch is closer than I've expected :)

wmayer

2013-07-12 13:18

administrator   ~0003390

About the git ignore stuff I recommend you to do an out-of-source build because then there is a single directory that appears in the untracked file list.

And yes, there are real .cmake files in the cMake folder.

wmayer

2013-07-12 13:18

administrator   ~0003391

git show de9ad5d

Issue History

Date Modified Username Field Change
2013-04-27 13:53 project4 New Issue
2013-04-28 18:07 normandc Note Added: 0003120
2013-04-28 18:25 project4 Note Added: 0003121
2013-04-28 20:15 normandc Note Added: 0003127
2013-07-12 05:47 project4 Note Added: 0003378
2013-07-12 05:48 project4 File Added: LinearPatternParameters.diff
2013-07-12 08:48 wmayer Note Added: 0003380
2013-07-12 08:52 wmayer Note Added: 0003381
2013-07-12 08:56 wmayer Note Added: 0003382
2013-07-12 08:56 wmayer Status new => resolved
2013-07-12 08:56 wmayer Fixed in Version => 0.14
2013-07-12 08:56 wmayer Resolution open => fixed
2013-07-12 08:56 wmayer Assigned To => wmayer
2013-07-12 10:45 project4 Note Added: 0003385
2013-07-12 10:45 project4 Status resolved => feedback
2013-07-12 10:45 project4 Resolution fixed => reopened
2013-07-12 10:52 project4 Note Added: 0003386
2013-07-12 11:54 wmayer Note Added: 0003388
2013-07-12 12:14 project4 Note Added: 0003389
2013-07-12 13:18 wmayer Note Added: 0003390
2013-07-12 13:18 wmayer Note Added: 0003391
2013-07-12 13:19 wmayer Status feedback => closed
2013-07-12 13:19 wmayer Resolution reopened => fixed