put all STEP export/import options into one tab page

This commit is contained in:
wmayer
2018-02-07 22:46:30 +01:00
parent 6fb1972875
commit 4eb3f9aeb6
6 changed files with 93 additions and 61 deletions

View File

@@ -546,16 +546,12 @@ private:
Base::FileInfo file(Utf8Name.c_str());
if (file.hasExtension("stp") || file.hasExtension("step")) {
//Interface_Static::SetCVal("write.step.schema", "AP214IS");
bool optionScheme_214;
bool optionScheme_203;
ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Import/hSTEP");
optionScheme_214 = hGrp_stp->GetBool("Scheme_214",true);
optionScheme_203 = hGrp_stp->GetBool("Scheme_203",false);
if (optionScheme_214)
Interface_Static::SetCVal("write.step.schema", "AP214IS");
if (optionScheme_203)
ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part/STEP");
std::string scheme = hGrp_stp->GetASCII("Scheme", "AP214IS");
if (scheme == "AP203")
Interface_Static::SetCVal("write.step.schema", "AP203");
else if (scheme == "AP214IS")
Interface_Static::SetCVal("write.step.schema", "AP214IS");
STEPCAFControl_Writer writer;
Interface_Static::SetIVal("write.step.assembly",1);

View File

@@ -40,9 +40,3 @@ FreeCAD.addExportType("STEPZ zip File Type (*.stpZ *.stpz)","stepZ")
paramGetV = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Import/hSTEP")
if paramGetV.GetBool("ReadShapeCompoundMode", False) != paramGetV.GetBool("ReadShapeCompoundMode", True):
paramGetV.SetBool("ReadShapeCompoundMode", True)
if paramGetV.GetBool("Scheme_203", False) != paramGetV.GetBool("Scheme_203", True):
paramGetV.SetBool("Scheme_203", False)
if paramGetV.GetBool("Scheme_214", False) != paramGetV.GetBool("Scheme_214", True):
paramGetV.SetBool("Scheme_214", True)

View File

@@ -68,5 +68,6 @@ class ImportWorkbench ( Workbench ):
Gui.addWorkbench("Import",ImportWorkbench())
"""
import Import_rc
FreeCADGui.addPreferencePage(":/ui/preferences-import.ui","Import-Export")
# See https://forum.freecadweb.org/viewtopic.php?f=3&t=26782
#import Import_rc
#FreeCADGui.addPreferencePage(":/ui/preferences-import.ui","Import-Export")

View File

@@ -49,7 +49,7 @@
<cstring>Scheme_203</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Part/hSTEP</cstring>
<cstring>Mod/Import/hSTEP</cstring>
</property>
</widget>
</item>

View File

@@ -7,13 +7,52 @@
<x>0</x>
<y>0</y>
<width>445</width>
<height>291</height>
<height>323</height>
</rect>
</property>
<property name="windowTitle">
<string>STEP</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0">
<widget class="QGroupBox" name="groupBoxHeader">
<property name="title">
<string>Header</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Company</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditCompany"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Author</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditAuthor"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Product</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditProduct"/>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
@@ -95,46 +134,7 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBoxHeader">
<property name="title">
<string>Header</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Company</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditCompany"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Author</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditAuthor"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Product</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditProduct"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -147,8 +147,43 @@
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="GroupBox2">
<property name="title">
<string>Import</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout2">
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxMergeCompound">
<property name="toolTip">
<string>If this is checked, no Compound merge will be done during file reading (slower but higher details).</string>
</property>
<property name="text">
<string>Enable STEP Compound merge</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ReadShapeCompoundMode</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Import/hSTEP</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>comboBoxUnits</tabstop>
<tabstop>checkBoxPcurves</tabstop>

View File

@@ -230,14 +230,17 @@ void DlgImportExportStep::saveSettings()
}
else {
// possible values: AP214CD (1996), AP214DIS (1998), AP214IS (2002)
Interface_Static::SetCVal("write.step.schema","AP214CD");
hStepGrp->SetASCII("Scheme", "AP214CD");
Interface_Static::SetCVal("write.step.schema","AP214IS");
hStepGrp->SetASCII("Scheme", "AP214IS");
}
// header info
hStepGrp->SetASCII("Company", ui->lineEditCompany->text().toLatin1());
hStepGrp->SetASCII("Author", ui->lineEditAuthor->text().toLatin1());
//hStepGrp->SetASCII("Product", ui->lineEditProduct->text().toLatin1());
// (h)STEP of Import module
ui->checkBoxMergeCompound->onSave();
}
void DlgImportExportStep::loadSettings()
@@ -269,6 +272,9 @@ void DlgImportExportStep::loadSettings()
ui->lineEditAuthor->setText(QString::fromStdString(hStepGrp->GetASCII("Author")));
ui->lineEditProduct->setText(QString::fromLatin1(
Interface_Static::CVal("write.step.product.name")));
// (h)STEP of Import module
ui->checkBoxMergeCompound->onRestore();
}
/**