Updated the spreadsheets to the new module
This commit is contained in:
parent
f7be7d1e30
commit
657041d6b1
|
@ -107,21 +107,19 @@ class Plot(object):
|
|||
@param v Volume of fluid.
|
||||
@param tank Active tank instance.
|
||||
"""
|
||||
# Create the spreadsheet
|
||||
obj = Spreadsheet.makeSpreadsheet()
|
||||
s = obj.Proxy
|
||||
obj.Label = 'Capacity curve'
|
||||
s = FreeCAD.activeDocument().addObject('Spreadsheet::Sheet',
|
||||
'Capacity curve')
|
||||
|
||||
# Print the header
|
||||
s.a1 = "Percentage of filling level"
|
||||
s.b1 = "Level [m]"
|
||||
s.c1 = "Volume [m^3]"
|
||||
s.set("A1", "Percentage of filling level")
|
||||
s.set("B1", "Level [m]")
|
||||
s.set("C1", "Volume [m^3]")
|
||||
|
||||
# Print the data
|
||||
for i in range(len(l)):
|
||||
s.__setattr__("a{}".format(i + 2), l[i])
|
||||
s.__setattr__("b{}".format(i + 2), z[i])
|
||||
s.__setattr__("c{}".format(i + 2), v[i])
|
||||
s.set("A{}".format(i + 2), str(l[i]))
|
||||
s.set("B{}".format(i + 2), str(z[i]))
|
||||
s.set("C{}".format(i + 2), str(v[i]))
|
||||
|
||||
# Open the spreadsheet
|
||||
FreeCADGui.ActiveDocument.setEdit(obj.Name, 0)
|
||||
# Recompute
|
||||
FreeCAD.activeDocument().recompute()
|
|
@ -303,37 +303,36 @@ class Plot(object):
|
|||
@param trim Trim in degrees.
|
||||
@return True if error happens.
|
||||
"""
|
||||
# Create the spreadsheet
|
||||
obj = Spreadsheet.makeSpreadsheet()
|
||||
s = obj.Proxy
|
||||
obj.Label = 'Hydrostatics'
|
||||
s = FreeCAD.activeDocument().addObject('Spreadsheet::Sheet',
|
||||
'Hydrostatics')
|
||||
|
||||
# Print the header
|
||||
s.a1 = "displacement [ton]"
|
||||
s.b1 = "draft [m]"
|
||||
s.c1 = "wetted surface [m^2]"
|
||||
s.d1 = "1cm triming ship moment [ton*m]"
|
||||
s.e1 = "Floating area [m^2]"
|
||||
s.f1 = "KBl [m]"
|
||||
s.g1 = "KBt [m]"
|
||||
s.h1 = "BMt [m]"
|
||||
s.i1 = "Cb"
|
||||
s.j1 = "Cf"
|
||||
s.k1 = "Cm"
|
||||
s.set("A1", "displacement [ton]")
|
||||
s.set("B1", "draft [m]")
|
||||
s.set("C1", "wetted surface [m^2]")
|
||||
s.set("D1", "1cm triming ship moment [ton*m]")
|
||||
s.set("E1", "Floating area [m^2]")
|
||||
s.set("F1", "KBl [m]")
|
||||
s.set("G1", "KBt [m]")
|
||||
s.set("H1", "BMt [m]")
|
||||
s.set("I1", "Cb")
|
||||
s.set("J1", "Cf")
|
||||
s.set("K1", "Cm")
|
||||
|
||||
# Print the data
|
||||
for i in range(len(self.points)):
|
||||
point = self.points[i]
|
||||
s.__setattr__("a{}".format(i + 2), point.disp)
|
||||
s.__setattr__("b{}".format(i + 2), point.draft)
|
||||
s.__setattr__("c{}".format(i + 2), point.wet)
|
||||
s.__setattr__("d{}".format(i + 2), point.mom)
|
||||
s.__setattr__("e{}".format(i + 2), point.farea)
|
||||
s.__setattr__("f{}".format(i + 2), point.xcb)
|
||||
s.__setattr__("g{}".format(i + 2), point.KBt)
|
||||
s.__setattr__("h{}".format(i + 2), point.BMt)
|
||||
s.__setattr__("i{}".format(i + 2), point.Cb)
|
||||
s.__setattr__("j{}".format(i + 2), point.Cf)
|
||||
s.__setattr__("k{}".format(i + 2), point.Cm)
|
||||
s.set("A{}".format(i + 2), str(point.disp))
|
||||
s.set("B{}".format(i + 2), str(point.draft))
|
||||
s.set("C{}".format(i + 2), str(point.wet))
|
||||
s.set("D{}".format(i + 2), str(point.mom))
|
||||
s.set("E{}".format(i + 2), str(point.farea))
|
||||
s.set("F{}".format(i + 2), str(point.xcb))
|
||||
s.set("G{}".format(i + 2), str(point.KBt))
|
||||
s.set("H{}".format(i + 2), str(point.BMt))
|
||||
s.set("I{}".format(i + 2), str(point.Cb))
|
||||
s.set("J{}".format(i + 2), str(point.Cf))
|
||||
s.set("K{}".format(i + 2), str(point.Cm))
|
||||
|
||||
# Open the spreadsheet
|
||||
FreeCADGui.ActiveDocument.setEdit(obj.Name,0)
|
||||
# Recompute
|
||||
FreeCAD.activeDocument().recompute()
|
Loading…
Reference in New Issue
Block a user