Usee display name in editor
This commit is contained in:
@@ -110,7 +110,8 @@ QVariant MaterialDelegate::getValue(const QModelIndex& index) const
|
||||
QVariant propertyValue;
|
||||
if (group->child(row, 1)) {
|
||||
auto material = group->child(row, 1)->data().value<std::shared_ptr<Materials::Material>>();
|
||||
auto propertyName = group->child(row, 0)->text();
|
||||
// auto propertyName = group->child(row, 0)->text();
|
||||
auto propertyName = group->child(row, 0)->data().toString();
|
||||
propertyValue = material->getProperty(propertyName)->getValue();
|
||||
}
|
||||
return propertyValue;
|
||||
@@ -130,7 +131,8 @@ void MaterialDelegate::setValue(QAbstractItemModel* model,
|
||||
int row = index.row();
|
||||
if (group->child(row, 1)) {
|
||||
auto material = group->child(row, 1)->data().value<std::shared_ptr<Materials::Material>>();
|
||||
auto propertyName = group->child(row, 0)->text();
|
||||
// auto propertyName = group->child(row, 0)->text();
|
||||
auto propertyName = group->child(row, 0)->data().toString();
|
||||
material->getProperty(propertyName)->setValue(value);
|
||||
group->child(row, 1)->setText(value.toString());
|
||||
}
|
||||
@@ -152,7 +154,8 @@ void MaterialDelegate::notifyChanged(const QAbstractItemModel* model,
|
||||
int row = index.row();
|
||||
if (group->child(row, 1)) {
|
||||
auto material = group->child(row, 1)->data().value<std::shared_ptr<Materials::Material>>();
|
||||
auto propertyName = group->child(row, 0)->text();
|
||||
// auto propertyName = group->child(row, 0)->text();
|
||||
auto propertyName = group->child(row, 0)->data().toString();
|
||||
auto propertyValue = material->getProperty(propertyName)->getValue();
|
||||
material->setEditStateAlter();
|
||||
Base::Console().Log("MaterialDelegate::notifyChanged() - marked altered\n");
|
||||
@@ -181,7 +184,8 @@ bool MaterialDelegate::editorEvent(QEvent* event,
|
||||
|
||||
int row = index.row();
|
||||
|
||||
QString propertyName = group->child(row, 0)->text();
|
||||
// QString propertyName = group->child(row, 0)->text();
|
||||
QString propertyName = group->child(row, 0)->data().toString();
|
||||
|
||||
auto type = getType(index);
|
||||
if (type == Materials::MaterialValue::Color) {
|
||||
|
||||
@@ -963,7 +963,9 @@ void MaterialsEditor::updateMaterialAppearance()
|
||||
QList<QStandardItem*> items;
|
||||
|
||||
QString key = itp->first;
|
||||
auto propertyItem = new QStandardItem(key);
|
||||
// auto propertyItem = new QStandardItem(key);
|
||||
auto propertyItem = new QStandardItem(itp->second.getDisplayName());
|
||||
propertyItem->setData(key);
|
||||
propertyItem->setToolTip(itp->second.getDescription());
|
||||
items.append(propertyItem);
|
||||
|
||||
@@ -1026,7 +1028,9 @@ void MaterialsEditor::updateMaterialProperties()
|
||||
QString key = itp->first;
|
||||
Materials::ModelProperty modelProperty =
|
||||
static_cast<Materials::ModelProperty>(itp->second);
|
||||
auto propertyItem = new QStandardItem(key);
|
||||
// auto propertyItem = new QStandardItem(key);
|
||||
auto propertyItem = new QStandardItem(modelProperty.getDisplayName());
|
||||
propertyItem->setData(key);
|
||||
propertyItem->setToolTip(modelProperty.getDescription());
|
||||
items.append(propertyItem);
|
||||
|
||||
|
||||
@@ -28,16 +28,19 @@ Model:
|
||||
Description: "default architectural model"
|
||||
DOI: ""
|
||||
EnvironmentalEfficiencyClass:
|
||||
DisplayName: "Environmental Efficiency Class"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
ExecutionInstructions:
|
||||
DisplayName: "Execution Instructions"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
FireResistanceClass:
|
||||
DisplayName: "Fire Resistance Class"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
@@ -48,11 +51,13 @@ Model:
|
||||
URL: ''
|
||||
Description: " "
|
||||
SoundTransmissionClass:
|
||||
DisplayName: "Sound Transmission Class"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
UnitsPerQuantity:
|
||||
DisplayName: "Units Per Quantity"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -28,11 +28,13 @@ Model:
|
||||
Description: "default cost model"
|
||||
DOI: ""
|
||||
ProductURL:
|
||||
DisplayName: "Product URL"
|
||||
Type: 'URL'
|
||||
Units: ''
|
||||
URL: 'https://de.wikipedia.org/wiki/Hyperlink'
|
||||
Description: "Product URL, recommended are wikipedia links"
|
||||
SpecificPrice:
|
||||
DisplayName: "Specific Price"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -28,17 +28,20 @@ Model:
|
||||
Description: "default electromagnetic model"
|
||||
DOI: ""
|
||||
RelativePermittivity:
|
||||
DisplayName: "Relative Permittivity"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Relative_permittivity'
|
||||
Description: "The ratio to the permittivity of the vacuum"
|
||||
ElectricalConductivity:
|
||||
DisplayName: "Electrical Conductivity"
|
||||
Type: 'Quantity'
|
||||
Units: 'S/m'
|
||||
URL: 'https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity'
|
||||
Description: >
|
||||
The electrical conductivity in [FreeCAD ElectricalConductivity unit]
|
||||
RelativePermeability:
|
||||
DisplayName: "Relative Permeability"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Permeability_(electromagnetism)'
|
||||
|
||||
@@ -30,6 +30,7 @@ Model:
|
||||
- Density:
|
||||
UUID: '454661e5-265b-4320-8e6f-fcf6223ac3af'
|
||||
DynamicViscosity:
|
||||
DisplayName: "Dynamic Viscosity"
|
||||
Type: 'Quantity'
|
||||
Units: 'Pa*s'
|
||||
URL: 'https://en.wikipedia.org/wiki/Viscosity'
|
||||
@@ -38,11 +39,13 @@ Model:
|
||||
flow and deform during mechanical oscillation as a function of
|
||||
temperature, frequency, time, or both
|
||||
KinematicViscosity:
|
||||
DisplayName: "Kinematic Viscosity"
|
||||
Type: 'Quantity'
|
||||
Units: 'm^2/s'
|
||||
URL: 'https://en.wikipedia.org/wiki/Viscosity'
|
||||
Description: "Kinematic Viscosity = Dynamic Viscosity / Density"
|
||||
PrandtlNumber:
|
||||
DisplayName: "Prandtl Number"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Prandtl_number'
|
||||
|
||||
@@ -28,16 +28,19 @@ Model:
|
||||
Description: "Describes the norm or standards referenced by this material"
|
||||
DOI: ""
|
||||
KindOfMaterial:
|
||||
DisplayName: "Kind Of Material"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
MaterialNumber:
|
||||
DisplayName: "Material Number"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
StandardCode:
|
||||
DisplayName: "Standard Code"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -30,21 +30,25 @@ Model:
|
||||
and strain relationship is linear
|
||||
DOI: "10.1016/j.ijplas.2004.06.004"
|
||||
BulkModulus:
|
||||
DisplayName: "Bulk Modulus"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Bulk_modulus'
|
||||
Description: "Bulk modulus in [FreeCAD Pressure unit]"
|
||||
PoissonRatio:
|
||||
DisplayName: "Poisson Ratio"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio'
|
||||
Description: "Poisson's ratio [unitless]"
|
||||
ShearModulus:
|
||||
DisplayName: "Shear Modulus"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Shear_modulus'
|
||||
Description: "Shear modulus in [FreeCAD Pressure unit]"
|
||||
YoungsModulus:
|
||||
DisplayName: "Young's Modulus"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus'
|
||||
|
||||
@@ -35,6 +35,7 @@ Model:
|
||||
- IsotropicLinearElastic:
|
||||
UUID: 'f6f9e48c-b116-4e82-ad7f-3659a9219c50'
|
||||
AngleOfFriction:
|
||||
DisplayName: "Angle Of Friction"
|
||||
Type: 'Quantity'
|
||||
Units: 'deg'
|
||||
URL: 'https://en.wikipedia.org/wiki/Friction#Angle_of_friction'
|
||||
@@ -42,11 +43,13 @@ Model:
|
||||
Further information can be found at
|
||||
https://en.wikipedia.org/wiki/Mohr%E2%80%93Coulomb_theory
|
||||
CompressiveStrength:
|
||||
DisplayName: "Compressive Strength"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Compressive_strength'
|
||||
Description: "Compressive strength in [FreeCAD Pressure unit]"
|
||||
FractureToughness:
|
||||
DisplayName: "Fracture Toughness"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Fracture_toughness'
|
||||
@@ -55,16 +58,19 @@ Model:
|
||||
the unit is fixed MPa * m^0.5.
|
||||
https://github.com/FreeCAD/FreeCAD/pull/2156
|
||||
UltimateStrain:
|
||||
DisplayName: "Ultimate Strain"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Deformation_(mechanics)'
|
||||
Description: " "
|
||||
UltimateTensileStrength:
|
||||
DisplayName: "Ultimate Tensile Strength"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Ultimate_tensile_strength'
|
||||
Description: "Ultimate tensile strength in [FreeCAD Pressure unit]"
|
||||
YieldStrength:
|
||||
DisplayName: "Yield Strength"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Yield_Strength'
|
||||
|
||||
@@ -30,33 +30,39 @@ Model:
|
||||
strain relationship is linear
|
||||
DOI: "10.1016/j.ijplas.2004.06.004"
|
||||
OgdenModuli:
|
||||
DisplayName: "Ogden Moduli"
|
||||
Type: 'List'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Ogden_hyperelastic_model'
|
||||
Description: "Elastic moduli μ for Ogden [FreeCAD Pressure unit]"
|
||||
OgdenExponent:
|
||||
DisplayName: "Ogden Exponent"
|
||||
Type: 'Integer'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Ogden_hyperelastic_model'
|
||||
Description: "Exponent ɑ for Ogden [unitless]"
|
||||
InitialYieldStress:
|
||||
DisplayName: "Initial Yield Stress"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: ''
|
||||
Description: >
|
||||
Saturation stress for Voce isotropic hardening [FreeCAD Pressure unit]
|
||||
VoceSaturationStress:
|
||||
DisplayName: "Voce Saturation Stress"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: ''
|
||||
Description: >
|
||||
Saturation stress for Voce isotropic hardening [FreeCAD Pressure unit]
|
||||
VoceStrainScale:
|
||||
DisplayName: "Voce Strain Scale"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: "Strain scale in Voce isotropic hardening [unitless]"
|
||||
Yld2004p18Coefficients:
|
||||
DisplayName: "Yld2004p18 Coefficients"
|
||||
Type: 'List'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -30,46 +30,55 @@ Model:
|
||||
strain relationship is linear
|
||||
DOI: ""
|
||||
PoissonRatioXY:
|
||||
DisplayName: "Poisson Ratio XY"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio'
|
||||
Description: "Poisson's ratio [unitless]"
|
||||
PoissonRatioXZ:
|
||||
DisplayName: "Poisson Ratio XZ"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio'
|
||||
Description: "Poisson's ratio [unitless]"
|
||||
PoissonRatioYZ:
|
||||
DisplayName: "Poisson Ratio YZ"
|
||||
Type: 'Float'
|
||||
Units: 'Pressure'
|
||||
URL: 'https://en.wikipedia.org/wiki/Poisson%27s_ratio'
|
||||
Description: "Poisson's ratio [unitless]"
|
||||
ShearModulusXY:
|
||||
DisplayName: "Shear Modulus XY"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Shear_modulus'
|
||||
Description: "Shear modulus in [FreeCAD Pressure unit]"
|
||||
ShearModulusXZ:
|
||||
DisplayName: "Shear Modulus XZ"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Shear_modulus'
|
||||
Description: "Shear modulus in [FreeCAD Pressure unit]"
|
||||
ShearModulusYZ:
|
||||
DisplayName: "Shear Modulus YZ"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Shear_modulus'
|
||||
Description: "Shear modulus in [FreeCAD Pressure unit]"
|
||||
YoungsModulusX:
|
||||
DisplayName: "Young's Modulus X"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus'
|
||||
Description: "Young's modulus (or E-Module) in [FreeCAD Pressure unit]"
|
||||
YoungsModulusY:
|
||||
DisplayName: "Young's Modulus Y"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus'
|
||||
Description: "Young's modulus (or E-Module) in [FreeCAD Pressure unit]"
|
||||
YoungsModulusZ:
|
||||
DisplayName: "Young's Modulus Z"
|
||||
Type: 'Quantity'
|
||||
Units: 'kPa'
|
||||
URL: 'https://en.wikipedia.org/wiki/Young%27s_modulus'
|
||||
|
||||
@@ -31,11 +31,13 @@ AppearanceModel:
|
||||
- BasicRendering:
|
||||
UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e'
|
||||
FragmentShader:
|
||||
DisplayName: "Fragment Shader"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
VertexShader:
|
||||
DisplayName: "Vertex Shader"
|
||||
Type: 'String'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -28,16 +28,19 @@ AppearanceModel:
|
||||
Description: "default rendering model"
|
||||
DOI: ""
|
||||
AmbientColor:
|
||||
DisplayName: "Ambient Color"
|
||||
Type: 'Color'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
DiffuseColor:
|
||||
DisplayName: "Diffuse Color"
|
||||
Type: 'Color'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
EmissiveColor:
|
||||
DisplayName: "Emissive Color"
|
||||
Type: 'Color'
|
||||
Units: ''
|
||||
URL: ''
|
||||
@@ -48,6 +51,7 @@ AppearanceModel:
|
||||
URL: ''
|
||||
Description: " "
|
||||
SpecularColor:
|
||||
DisplayName: "Specular Color"
|
||||
Type: 'Color'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -31,11 +31,13 @@ AppearanceModel:
|
||||
- BasicRendering:
|
||||
UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e'
|
||||
TexturePath:
|
||||
DisplayName: "Texture Path"
|
||||
Type: 'File'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
TextureScaling:
|
||||
DisplayName: "Texture Scaling"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -28,31 +28,37 @@ AppearanceModel:
|
||||
Description: "default vector rendering model"
|
||||
DOI: ""
|
||||
SectionFillPattern:
|
||||
DisplayName: "Section Fill Pattern"
|
||||
Type: 'File'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
SectionLinewidth:
|
||||
DisplayName: "Section Linewidth"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
SectionColor:
|
||||
DisplayName: "Section Color"
|
||||
Type: 'Color'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
ViewColor:
|
||||
DisplayName: "View Color"
|
||||
Type: 'Color'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
ViewFillPattern:
|
||||
DisplayName: "View Fill Pattern"
|
||||
Type: 'Boolean'
|
||||
Units: ''
|
||||
URL: ''
|
||||
Description: " "
|
||||
ViewLinewidth:
|
||||
DisplayName: "View Linewidth"
|
||||
Type: 'Float'
|
||||
Units: ''
|
||||
URL: ''
|
||||
|
||||
@@ -28,16 +28,19 @@ Model:
|
||||
Description: "default thermal model"
|
||||
DOI: ""
|
||||
SpecificHeat:
|
||||
DisplayName: "Specific Heat"
|
||||
Type: 'Quantity'
|
||||
Units: 'J/kg/K'
|
||||
URL: 'https://en.wikipedia.org/wiki/Heat_capacity'
|
||||
Description: "Specific capacity in [FreeCAD SpecificHeat unit]"
|
||||
ThermalConductivity:
|
||||
DisplayName: "Thermal Conductivity"
|
||||
Type: 'Quantity'
|
||||
Units: 'W/m/K'
|
||||
URL: 'https://en.wikipedia.org/wiki/Thermal_conductivity'
|
||||
Description: "Thermal conductivity in [FreeCAD ThermalConductivity unit]"
|
||||
ThermalExpansionCoefficient:
|
||||
DisplayName: "Thermal Expansion Coefficient"
|
||||
Type: 'Quantity'
|
||||
Units: 'm/m/K'
|
||||
URL:
|
||||
|
||||
Reference in New Issue
Block a user