diff --git a/src/Mod/Ship/Instance.py b/src/Mod/Ship/Instance.py
index 042a6c097..be4481ed8 100644
--- a/src/Mod/Ship/Instance.py
+++ b/src/Mod/Ship/Instance.py
@@ -98,7 +98,6 @@ class Ship:
@param nS Number of sections
@param nP Number of points per section
"""
- print(nS,nP)
self.obj.addProperty("App::PropertyInteger","nSections","Ship", str(Translator.translate("Number of sections"))).nSections=nS
self.obj.addProperty("App::PropertyIntegerList","nPoints","Ship", str(Translator.translate("List of number of points per sections (accumulated histogram)"))).nPoints=[0]
self.obj.addProperty("App::PropertyFloatList","xSection","Ship", str(Translator.translate("List of sections x coordinate"))).xSection=[]
@@ -168,6 +167,8 @@ class Ship:
for j in range(0,len(section)):
mSections.append(section[j])
# Save data
+ for i in range(1,len(nPoints)):
+ nPoints[i] = nPoints[i] + nPoints[i-1]
self.obj.nPoints = nPoints[:]
self.obj.xSection = xSection[:]
self.obj.mSections = mSections[:]
@@ -661,10 +662,8 @@ def sections(obj):
histogram = obj.nPoints[:]
points = obj.mSections[:]
sections = []
- print(histogram)
for i in range(0, len(histogram) - 1):
sections.append([])
- print(histogram[i],histogram[i+1])
for j in range(histogram[i],histogram[i+1]):
sections[i].append(points[j])
return sections
diff --git a/src/Mod/Ship/shipAreasCurve/TaskPanel.py b/src/Mod/Ship/shipAreasCurve/TaskPanel.py
index 9b43c99c2..f076794ae 100644
--- a/src/Mod/Ship/shipAreasCurve/TaskPanel.py
+++ b/src/Mod/Ship/shipAreasCurve/TaskPanel.py
@@ -181,14 +181,14 @@ class TaskPanel:
# Calculate drafts
angle = math.radians(self.form.trim.value())
L = self.ship.Length
- draftAP = self.form.trim.value() + 0.5*L*math.tan(angle)
+ draftAP = self.form.draft.value() + 0.5*L*math.tan(angle)
if draftAP < 0.0:
draftAP = 0.0
- draftFP = self.form.trim.value() - 0.5*L*math.tan(angle)
+ draftFP = self.form.draft.value() - 0.5*L*math.tan(angle)
if draftFP < 0.0:
draftFP = 0.0
# Calculate hydrostatics involved
- disp = Hydrostatics.Displacement(self.ship,self.form.draft.value(),self.form.trim.value())
+ data = Hydrostatics.Displacement(self.ship,self.form.draft.value(),self.form.trim.value())
# Prepare the string in html format
string = 'L = %g [m]
' % (self.ship.Length)
string = string + 'B = %g [m]
' % (self.ship.Beam)
@@ -196,8 +196,8 @@ class TaskPanel:
string = string + 'Trim = %g [degrees]
' % (self.form.trim.value())
string = string + 'TAP = %g [m]
' % (draftAP)
string = string + 'TFP = %g [m]