[FEM] electric Potential: add missing conversion

- add missing conversion of property change that was already done before FC 0.20
This commit is contained in:
Uwe
2022-08-10 13:33:39 +02:00
parent c96fe6b32e
commit 31376b12ad
+12
View File
@@ -633,6 +633,18 @@ class Writer(object):
for name in obj.References[0][1]:
if obj.PotentialEnabled:
if hasattr(obj, "Potential"):
# Potential was once a float and scaled not fitting SI units
if isinstance(obj.Potential, float):
savePotential = obj.Potential
obj.removeProperty("Potential")
obj.addProperty(
"App::PropertyElectricPotential",
"Potential",
"Parameter",
"Electric Potential"
),
# scale to match SI units
obj.Potential = savePotential * 1e6
potential = float(obj.Potential.getValueAs("V"))
self._boundary(name, "Potential", potential)
if obj.PotentialConstant: