[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)
This commit is contained in:
donovaly
2020-09-23 01:24:26 +02:00
committed by wwmayer
parent 8ea1a38849
commit 4a1f81395e
3 changed files with 280 additions and 286 deletions

View File

@@ -604,17 +604,17 @@ void TaskHoleParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
Q_UNUSED(msg)
}
bool TaskHoleParameters::getThreaded() const
bool TaskHoleParameters::getThreaded() const
{
return ui->Threaded->isChecked();
}
long TaskHoleParameters::getThreadType() const
long TaskHoleParameters::getThreadType() const
{
return ui->ThreadType->currentIndex();
}
long TaskHoleParameters::getThreadSize() const
long TaskHoleParameters::getThreadSize() const
{
if ( ui->ThreadSize->currentIndex() == -1 )
return 0;
@@ -622,7 +622,7 @@ long TaskHoleParameters::getThreadSize() const
return ui->ThreadSize->currentIndex();
}
long TaskHoleParameters::getThreadClass() const
long TaskHoleParameters::getThreadClass() const
{
if ( ui->ThreadSize->currentIndex() == -1 )
return 0;
@@ -632,10 +632,9 @@ long TaskHoleParameters::getThreadClass() const
long TaskHoleParameters::getThreadFit() const
{
if (ui->Threaded->isChecked())
return ui->ThreadFit->currentIndex();
else
return 0;
// the fit is independent if the hole is threaded or not
// since an unthreaded hole for a screw can also have a close fit
return ui->ThreadFit->currentIndex();
}
Base::Quantity TaskHoleParameters::getDiameter() const
@@ -643,12 +642,15 @@ Base::Quantity TaskHoleParameters::getDiameter() const
return ui->Diameter->value();
}
bool TaskHoleParameters::getThreadDirection() const
long TaskHoleParameters::getThreadDirection() const
{
return ui->directionRightHand->isChecked();
if (ui->directionRightHand->isChecked())
return 0;
else
return 1;
}
long TaskHoleParameters::getHoleCutType() const
long TaskHoleParameters::getHoleCutType() const
{
if (ui->HoleCutType->currentIndex() == -1)
return 0;
@@ -671,7 +673,7 @@ Base::Quantity TaskHoleParameters::getHoleCutCountersinkAngle() const
return ui->HoleCutCountersinkAngle->value();
}
long TaskHoleParameters::getDepthType() const
long TaskHoleParameters::getDepthType() const
{
return ui->DepthType->currentIndex();
}
@@ -681,7 +683,7 @@ Base::Quantity TaskHoleParameters::getDepth() const
return ui->Depth->value();
}
long TaskHoleParameters::getDrillPoint() const
long TaskHoleParameters::getDrillPoint() const
{
if ( ui->drillPointFlat->isChecked() )
return 0;
@@ -696,7 +698,7 @@ Base::Quantity TaskHoleParameters::getDrillPointAngle() const
return ui->DrillPointAngle->value();
}
bool TaskHoleParameters::getTapered() const
bool TaskHoleParameters::getTapered() const
{
return ui->Tapered->isChecked();
}