Commit Graph

50 Commits

Author SHA1 Message Date
Uwe
31fa8187d5 [PD] add tooltip for Hole feature
- tooltip makes clear what the depth means for countersinks
- add comment why a calculation cannot be performed
- shorten some long lines
2023-03-10 05:14:24 +01:00
wmayer
a122aa01a7 PD: move to new style connect() 2023-01-15 14:27:33 +01:00
Uwe
6d889db9d7 [PD] remove deprecated holes
- as discussed in https://github.com/FreeCAD/FreeCAD/pull/7642 the backwards compatibility for deprecated holes was already lost since FC 0.19
- this PR removes the deprecated types and transform holes created with FC 0.19 or 0.20 to the corresponding countersinks/counterbores.

- also add Counterdrill for translations
2022-10-27 14:24:32 +02:00
Stefan Klug
673be545fd PartDesign: Add HoleCuteType "Counterdrill" 2022-10-24 15:19:24 +02:00
Stefan Klug
264d0bb890 [Bugfix] PartDesign: Fix HoleCutDepth not being recalculated correctly
HoleCutDepth is reset to 0 to force a recalculation of te depth when
HoleCutType is set to a new value.
But the line
	pcHole->HoleCutCustomValues.setValue(false)
also forces a recalculation. So the depth was recalculated with the old
value in HoleCutType which was not expected behaviour.
2022-10-23 04:10:18 +02:00
Uwe
16b25c5dab [PD] remove superfluous nullptr checks 2022-07-17 18:12:41 +02:00
wmayer
2628fb0350 App: fix memory leaks in Enumeration class and simplify code 2022-06-25 18:18:57 +02:00
Uwe
814de93e36 [PD] Hole dialog fixes
- when there is no profile the change of the hole cut type was not handled
- for the deprecated hole cut types it must also be possible to use custom values
2022-06-25 03:31:27 +02:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
037b2796b3 [PD] Hole, Pipe and Revolution: remove unused includes 2022-02-19 18:47:26 +01:00
Uwe
734bb426bf [PD] Hole: fix angle constraints
- all 3 angles cannot be >= 180°
- also add missing minimum in UI for taper angle
2022-01-07 20:38:05 +01:00
Uwe
d660bce346 [PD] Hole: some coding style fixes
all done by MSVC
2022-01-06 16:18:25 +01:00
Uwe
55421ce9cb [PD] add missing hole constraint
- add missing constraint for hole diameter
- add missing sets of angle constraints in the task dialog
2022-01-06 15:39:13 +01:00
Uwe
25558880ce [PD] hole dialog improvements
- no keyboard tracking
- don't disable labels since we don't do this for the other dialog labels
- avoid a doubled word in subsequent labels
- further UI file changes are by Qt's Designer
2021-12-22 02:46:07 +01:00
Uwe
99765c53a8 [PD] fix several hole thread issues
- actually use specified thread depth, fixes issue reported here: https://github.com/FreeCAD/FreeCAD/pull/4274#issuecomment-997787744
- fixes 2 UI enabling issues
- the thread depth cannot be longer than the hole depth
- the hole cannot be deeper than the through-all depth
2021-12-22 01:09:06 +01:00
David Osterberg
beb85522e4 PartDesign: Hole. Address Donovaly bugs 7 and 8
bug 7: the update view checkbox should be enabled/disabled based on Model thread.
       the checked state should not change

bug 8: the Thread depth options should be disabled when Model thread is unchecked.
       because they don't do anything in the model it is confusing if they are enabled.
2021-02-28 20:13:14 +01:00
David Osterberg
10f922613b PartDesign: Hole: Always update view if modelthread is disabled
Also: Check the Update View checkbox and disable it, when turning off
model thread.
2021-02-28 20:13:14 +01:00
David Osterberg
d94946781e PartDesign: Add true threads to Hole
- Thread runout according to DIN 76-1
- Through all length updated to be calculated based on bounding box
- New properties: ModelThread, ThreadDepthType, ThreadDepth,
                  UseCustomThreadClearance, CustomThreadClearance
- Rename Old but unused parameters related to thread modeling.
- Functionality exposed in UI
2021-02-28 20:13:14 +01:00
donovaly
b483fc0518 [PD] make pointers to the UI std::unique_ptr
Same as PR #4293, just for PartDesign

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all PartDesign dialogs that don't already use a unique_ptr.
2021-02-05 18:01:57 +01:00
donovaly
09385d9d00 fix issue reported by @chennes
also fix annoying variable naming - different variables representing different types should not have the same name

also update a comment according to depending PRs
2021-02-03 16:24:01 +01:00
donovaly
2a6d30da27 [PD] hole fix custom cut handling
This PR is based on PR #4344 and a spin-off of PR #4337. It fixes:

We have normed screw head cuts. These values can be overridden but we must store the info about the overriding. Why? - because when you have e.g. made a custom change to a normed countersink and then change to another countersink norm, you would either not get the values defined in the norm or you get these values but loose e.g. your depth settings
2021-02-03 16:23:28 +01:00
donovaly
c5fe2589d5 [PD] fix UTS clearance holes
This PR is based on PR #4343 and a spin-off of PR #4337. It fixes:

- the bug that we did not use the normed clearance hole diameters for UTS holes
- missing recompute when changing existing hole from Metric to UTS type
2021-02-03 16:19:24 +01:00
donovaly
19605200a1 [PD] hole dialog UI fixes
This PR is the first in a series of probably 3 PRs to fix known hole dialog bugs.

This one fixes:

- the .ui file issues
- readonly status issues of some widgets/properties (e.g. when the hole is through all, disable drill point settings)
- the bug that updateHoleCutParams() overwrote the previously correctly determined hole diameter
- just a trifle: change a function name to fit into the naming scheme
2021-02-03 16:14:36 +01:00
donovaly
d1071026e7 [PD] fix blind hole depth handling
as reported in https://tracker.freecadweb.org/view.php?id=3818
we treat the blind hole depth not according to the conventions. The size of the drill point due to the angle is normally not taken into account but FC does this in any case.

This PR adds therefore an option, that is by default off, to take the drill point size into account.
Without the option, (the new default) the depth is calculated according to the conventions.

The PR also removes unused widgets and restored the tab order in the .ui file. The thread parameters were never used. In case we made in future the decision to carve into holes real (modeled) threads, we need a special UI for that solution anyway so having the dead code in is not helpful at all.
2021-01-25 01:10:23 +01:00
donovaly
99208ec2f4 [PD] more hole fixes
- there is the ISO 273 describing clearance holes, so we need to take these values. Only if we have a size not defined in the norm, we calculate
- add the coarse (wide) type for clearance holes from ISO 273
- add all screw thread sizes defined in DIN 13/ISO 261
- rearrange thread dialog to make it more compact
- change name "fit" to "clearance" as discussed
- add tooltips to the dialog
- fix issue with TaperedAngle dialog field
- change a size name because the norms define "M1" not "M1.0"
2020-11-18 14:45:14 +01:00
donovaly
c9c5f12629 [PD] Hole countersink angle work
- fix bug that custom angles were overwritten
- the norms only define screw heads, not the cut for them, so also a custom angle is possible to sink a metric screw
- use better step in UI since one changes the presets only in fractions of a millimeter (otherwise it would be a different hole size)
- handle case of no cut
- calculate change in diameter when adding depth to countersinks
2020-11-14 19:24:32 +01:00
wmayer
679731f75e PartDesign: [skip ci] make cut type modes of hole feature translatable 2020-11-13 17:51:41 +01:00
donovaly
83f6c27be7 [PD] hole UTS fixes
- propose cut values also for UTS profiles
- the UTS defines coarse and fine while for ISO it is regular and fine, thus fix the name
- for the dialog: set minimum values to zero (angles etc. cannot be negative)
2020-11-13 09:07:27 +01:00
donovaly
58168f4e89 [PD] more hole cut work
- add definitions for IS 2009, 7046 and 12474
- remove useless file for a ISO 14583 since there are no such screws on the market
- rename "coarse" to "regular" since this what it actually is according to the norms
- uniform the x1 threads (for x2.0 etc we use a trailing zero and for some we use x1, for some already x1.0, thus consistently use x1.0)
- add some ISO 10642 entries
- correct ISO 4762:
  - correct some values
  - the does does not define a size M27
  - add the two missing sizes
2020-11-12 17:41:53 +01:00
donovaly
27e10c52f0 [PD] hole creation
- propose valid values for the cut depth and diameter when creating new holes
- add new definitions for metric fine
- some code simplification and comments
2020-11-10 19:34:53 +01:00
donovaly
722e4ed3c0 [PD] hole - fix typo
- also update profile changing method since fraction diameters no longer end with a '0' in profile ISO coarse
2020-11-03 14:54:01 +01:00
M G Berberich
c66a6be944 [PartDesign] Hole countersink for metric
fix a problem with counterbore and countersink in PartDesign Hole feature.

It was not possible to custom define counterbores or countersinks if a
metric thread hole was selected.

Handle the cut-types None, Counterbore and Countersink euqal
regardless of type of thread and let the user customize:
None:        none
Counterbore: diameter and depth
Countersink: diameter and angle
2020-10-31 12:49:00 +01:00
donovaly
d702536f3a [PD] more holes fixes
- initialization: thread direction only sensible if there is a thread
- initialization: hole diameter can only be changed if there is no profile
- initialization: only enable allowed hole cut parameters
- also for the ISO profiles it is allowed to countersink/bore deeper/less deep
- UI file: add some tooltips (the other changes were done automatically by Qt's designer)
2020-10-22 13:01:57 +02:00
donovaly
9985a5a883 [PD] fix thread UI bugs
- initialization: if a threaded, the fit must not be enabled
- when changing the profile type setReadOnly for the fit and class according to if threaded or not
- when changing if threaded or not, setReadOnly accordingly for the fit and class
2020-10-20 15:47:52 +02:00
donovaly
025fd9dce9 [PD] initialize hole dialog properly
as described in https://forum.freecadweb.org/viewtopic.php?f=3&t=50611, the task dialog should just read out the parameters on initialization and not invoke automatically change actions.

This PR also fixes a bug that opening a document with a cheesehead hole leads to an error about an invalid index. The reason is that we access the hole cut type before we set its enums. Thus initialize the cut type with all possible enums since, if necessary, the reduced enum set will be set later on parsing the file.
2020-10-19 16:48:49 +02:00
wmayer
db093ed0e0 PartDesign: [skip ci] some improvements in TaskHoleParameters
+ do not rely on translated strings but set user data for the items of the combo box
+ do not use tr() to convert the C strings to QString of the hole feature, use QString::fromLatin1
+ do not use findText() twice for the same search but store the result
2020-10-19 16:08:26 +02:00
donovaly
a442dbdfa2 [PD] keep hole size when changing type
as mentioned in https://forum.freecadweb.org/viewtopic.php?f=13&t=47584&start=10#p433116
a typical use case is that one changes the hole type from e.g. ISO normal to ISO fine. The size should however be the same.

This PR enables this and also takes care for the thread class and cut type, see the attached screencast.
2020-10-19 14:44:08 +02:00
donovaly
3ca1bc2495 [PD] fix 2 hole dialog bugs
- 1. reported here: https://forum.freecadweb.org/viewtopic.php?p=432936#p432851
also unthreaded holes can have a close or standard fit

- 2. reported here: https://forum.freecadweb.org/viewtopic.php?p=432936#p432944
the thread direction is always left. The reason is that this property is an enum but the dialog returns a bool.

- also fix an UI issue with the spin boxes (automatically found and repaired by Qt's designer, thus the many changes in the UI file)
2020-09-23 09:58:53 +02:00
wmayer
cd7a6a237a [PartDesign Hole] Restore value of reversed checkbox when opening dialog 2020-08-22 16:14:14 +02:00
mwganson
95ef4f40f7 [PartDesign Hole] Add reversed checkbox to dialog 2020-08-22 15:32:42 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
7e71c8ecc5 [skip ci] include missing boost header 2020-06-07 20:58:45 +02:00
Zheng, Lei
cd2b7e297c PartDesign changes
* Mostly for supporting in-place editing

* Add new SubShapeBinder that support cross coordinate system,
  external, and sub-object binding
2019-08-17 15:15:47 +02:00
Abdullah Tahiri
07dacdba36 PartDesign: PCH GUI 2019-05-02 07:12:51 +02:00
wmayer
83d56d6250 fixes 0003805: After 'Create a hole with the selected sketch' the model disappears 2019-02-21 18:49:00 +01:00
Eivind Kvedalen
91bafde563 PartDesign Hole Feature implemented.
Minor contributions from Mateusz Skowroński <skowri@gmail.com>
2017-07-26 23:39:00 +02:00
wmayer
8d14da3e1e + support units in hole panel 2014-07-22 14:47:09 +02:00
wmayer
09122a27b7 + fixes #0000854: Ability to change number of digits to the right of decimal place in spinboxes 2014-02-16 18:02:09 +01:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00