[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:32:32 +02:00
parent 1dc4ed454e
commit 96cd900691

View File

@@ -648,6 +648,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: