!********************************************************** !* MACRO GEOMETRY MODULE desdat(); !* Displays a list of principle design data. !* !* (C)Microform AB 1998-09-23, J.Kjellander !* !********************************************************** INT status; FLOAT k1(1),k2(2),k3(3),k4(4); FLOAT displ; string s*1; BEGINMODULE lst_ini("Current design data !"); !* !***LOA. !***Length over all. !* status:=getdat_gm("LOA",k1); if status = 1 then lst_lin("LOA Length over all = "+str(k1(1)/1E3,-8,3)+" meters"); else lst_lin("LOA Length over all = "+"Not defined"); endif; !* !***MAXBEAM. !***Max beam. !* status:=getdat_gm("MAXBEAM",k3); if status = 3 then lst_lin("Bmax Max beam = "+str(k3(3)/1E3,-8,3)+" meters"); lst_lin(" @ x-station = "+str(k3(1)/1E3,-8,3)+" meters"); lst_lin(" @ y-waterline = "+str(k3(2)/1E3,-8,3)+" meters"); else lst_lin("Bmax Max beam = "+"Not defined"); endif; !* !***MAXDRAUGHT. !***Max draught. !* status:=getdat_gm("MAXDRAUGHT",k3); if status = 3 then lst_lin("Tmax Max draught = "+str(k3(2)/1E3,-8,2)+" meters"); lst_lin(" @ x-station = "+str(k3(1)/1E3,-8,3)+" meters"); lst_lin(" @ z-buttock = "+str(k3(3)/1E3,-8,3)+" meters"); else lst_lin("Tmax Max draught = "+"Not defined"); endif; lst_lin("---------------------------------"+"--------"+"------------"); !* !***LWL. !***Length water line. !* status:=getdat_gm("LWL",k2); if status = 2 then lst_lin("LWL Length waterline = "+str(k2(1)/1E3,-8,3)+" meters"); lst_lin(" @ vertical position = "+str(k2(2)/1E3,-8,3)+" meters"); else lst_lin("LWL Length waterline = "+"Not defined"); endif; !* !***BEAM. !***Max beam at waterline. !* status:=getdat_gm("BEAM",k3); if status = 3 then lst_lin("BWL Max beam @ WL = "+str(k3(3)/1E3,-8,3)+" meters"); lst_lin(" @ x-station = "+str(k3(1)/1E3,-8,3)+" meters"); else lst_lin("BWL Max beam = "+"Not defined"); endif; !* !***DRAUGHT. !***Max draught of canoe body. !FIXME: Not good programming practice. Store values for MAXDRAUGHT and LWL... !* status:=getdat_gm("MAXDRAUGHT",k3); if status = 3 then lst_lin("T Max draught = "+str((k2(2)-k3(2))/1E3,-8,3)+" meters"); lst_lin(" @ x-station = "+str(k3(1)/1E3,-8,3)+" meters"); lst_lin(" @ z-buttocks = "+str(k3(3)/1E3,-8,3)+" meters"); else lst_lin("T Max draught = "+"Not defined"); endif; lst_lin(""); !* !***DISPLACEMENT. !***Displacement (volume and weight). !* status:=getdat_gm("DISPLACEMENT",k4); if status = 4 then displ:=k4(1); lst_lin("V Volume displacement = "+str(k4(1)/1E9,-8,3)+" meters³"); lst_lin(" ¤ @ x-station = "+str(k4(2)/1E3,-8,3)+" meters"); lst_lin(" ¤ @ y-waterline = "+str(k4(3)/1E3,-8,3)+" meters"); lst_lin(" ¤ @ z-buttock = "+str(k4(4)/1E3,-8,3)+" meters"); status:=getdat_gm("DENSITY_WATER",k1); if status = 1 then lst_lin("D Displacement = "+str(k4(1)*k1(1),-8,0)+" kg"); else lst_lin("D Displacement = "+"No density defined"); endif; else displ:=-1; lst_lin("V Volume displacement = "+"Not defined"); endif; lst_lin(""); !* !***SECTAREA. !***Max section area. !* status:=getdat_gm("SECTAREA",k2); if status = 2 then lst_lin("AX Max section area = "+str(k2(1)/1E6,-8,3)+" meters²"); lst_lin(" @ x-station = "+str(k2(2)/1E3,-8,3)+" meters"); else lst_lin("AX Max section area = "+"Not defined"); endif; !* !***WLAREA. !***Waterline area. !* status:=getdat_gm("WLAREA",k4); if status = 4 then lst_lin("AWL Waterline area @ WL = "+str(k4(1)/1E6,-8,3)+" meters"); lst_lin(" ¤ @ x-station = "+str(k4(2)/1E3,-8,3)+" meters"); lst_lin(" ¤ @ y-waterline = "+str(k4(3)/1E3,-8,3)+" meters"); lst_lin(" ¤ @ z-buttock = "+str(k4(4)/1E3,-8,3)+" meters"); else lst_lin("AWL Waterline area @ WL = "+"Not defined"); endif; lst_lin(""); !* !***MMTINERTIA. !***Moments of inertia and metacentric heights !***(longitudinal & transversal). !* status:=getdat_gm("MMTINERTIA",k2); if status = 2 then lst_lin("IL Long moment of AWL = "+str(k2(1)/1E12,-8,3)+" meters^4"); lst_lin("IT Trans moment of AWL = "+str(k2(2)/1E12,-8,3)+" meters^4"); if displ >= 0 then lst_lin("BML Long metacentric height = "+str(k2(1)/displ/1E3,-8,3)+" meters"); lst_lin("BM Trans metacentric height = "+str(k2(2)/displ/1E3,-8,3)+" meters"); endif; else lst_lin("I Moments of AWL = "+"Not defined"); endif; lst_lin(""); !* !***DLRATIO. !***Diplacement/Length waterline ratio. !* status:=getdat_gm("DLRATIO",k1); if status = 1 then lst_lin("D/LWL Displ/LWL ratio = "+str(k1(1),-8,2)+" pounds/ft³"); endif; !* !***CP. !***Prismatic coefficient. !* status:=getdat_gm("CP",k1); if status = 1 then lst_lin("cP Prismatic coefficient = "+str(k1(1),-8,3)+" -"); endif; !* !***CB. !***Block coefficient. !* status:=getdat_gm("CB",k1); if status = 1 then lst_lin("cB Block coefficient = "+str(k1(1),-8,3)+" -"); endif; lst_lin(""); !* !***DISPSPEED. !***Hull speed. !* status:=getdat_gm("DISPSPEED",k1); if status = 1 then lst_lin("Vhull Displacement speed = "+str(k1(1),-8,2)+" knots"); endif; lst_lin(""); !* !***HULLAREA. !***Wetted surface. !* status:=getdat_gm("HULLAREA",k2); if status = 2 then lst_lin("Sh Hull area inkl. stern = "+str((k2(1)+k2(2))/1E6,-8,1)+" meters²"); lst_lin("Ss Stern area = "+str(k2(2)/1E6,-8,1)+" meters²"); endif; lst_lin(""); !* !***TBCOMFORT. !***Brewers comfort factor. !* status:=getdat_gm("TBCOMFORT",k1); if status = 1 then lst_lin(" Brewers comfort factor = "+str(k1(1),-8,1)+" -"); endif; lst_lin(""); !* !***SAILAREA. !***Sail area. !* status:=getdat_gm("SAILAREA",k1); if status = 1 then lst_lin("As Sail area = "+str(k1(1)/1E6,-8,2)+" meters²"); else lst_lin("As Sail area = "+"Not defined"); endif; !* !***SIMPSON_SLICES. !***Number of simpson slices. !* status:=getdat_gm("SIMPSON_SLICES",k2); if status = 2 then lst_lin(""); lst_lin("< Calculated with "+str(k2(1),-1,0)+" Simpson double slices (dx="+str(2.0*k2(2)/1E3,-1,2)+"m). >"); endif; status:=getdat_gm("DENSITY_WATER",k1); if status = 1 then lst_lin("< Density of water = "+str(k1(1)*1E6,-6,4)+" kg/dm³ >"); else lst_lin("< Density of water = "+"Not defined >"); endif; lst_exi(); ENDMODULE !**********************************************************