Code:
Weight var word 'capacity at given radius
Weight1 var word 'Low capacity at higher boom length
Weight2 var word 'high capacity at lower boom length
Weight3 var word 'Low capacity at high boom (at next closest radius)
weight4 var word 'high capacity at lower boom length (at next closest radius)
weightDiff1 var word 'weight difference between nearest values Weight1 & 2
weightDiff2 var word 'weight difference between nearest values Weight3 & 4
radiusLook var byte 'lookup radius value = (radius/100) -1
'radius var word 'radius in centimeters: 100 = 10 meters
remainder var byte
'boomLength var word ' boom length in centimeters 593 = 5.93 meters
radiusLeftover var byte ' remainder radius from division
radius con 50 'set radius to 5.0 meters
boomLength con 1050 ' set boom length to 10.5 meters
Main:
radiusLook = radius/10 - 2 'sets up our lookup table value 0 starting at 2
radiusLeftover = radius//10
gosub lookThemUp
weight3 = weight1
weight4 = weight2
radiusLook = radiuslook + 1 'next highest radius and put values into weight1 & 2
gosub logthemup
weightdiff1 = weight1 - weight2
weightdiff1 = weight3 - weight4
radiusleftover * weightdiff1
end
'************************************************
lookThemUp:
select case boomLength
case boomLength > 1293 and boomlength < 1386 'halfway between 13.85 and 12.00
'and all the way up to max radius without manual extension ...
'probably need another lookup table exclusively for the extension
gosub lookup_col5 'get weight value from column 5 of the table
weight1 = weight
gosub lookup_col4 'get weight value from column 4 of the table
weight2 = weight
case boomlength > 1100
gosub lookup_col4
weight1 = weight
gosub lookup_col3
weight2 = weight
case boomlength > 900
gosub lookup_col3
weight1 = weight
gosub lookup_col2
weight2 = weight
case boomlength > 593
gosub lookup_col2
weight1 = weight
gosub lookup_col1
weight2 = weight
end select
return
lookup_col1:
'radius = 5.93
lookup2 radiusLook,[7500,7500,5750,0,0,0,0,0,0,0,0,0,0],Weight
return
lookup_col2:
'radius = 8
lookup2 radiusLook,[7500,7500,5700,4400,3600,0,0,0,0,0,0,0,0],Weight
return
lookup_col3:
'radius = 10
lookup2 radiusLook,[7500,6900,5070,4760,3525,2900,2400,0,0,0,0,0,0],Weight
return
lookup_col4:
'radius = 12
lookup2 radiusLook,[0,5200,4500,4000,3475,2900,2478,2130,0,0,0,0,0],Weight
return
lookup_col5:
'radius = 13.85
lookup2 radiusLook,[0,0,3970,3460,3100,2750,2400,2080,1775,1550,1350,0,0],Weight
return
Then need to go through again at
Bookmarks