manuver node execution
This commit is contained in:
		
						commit
						c8a839b49c
					
				
					 4 changed files with 128 additions and 0 deletions
				
			
		
							
								
								
									
										7
									
								
								lib/SASCheck.ks
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lib/SASCheck.ks
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
function sascheck { //returns the average exaust velocity of active engines. to convert to isp, divide by constant:g0
 | 
			
		||||
	set saslist to ship:modulesnamed("ModuleSAS").
 | 
			
		||||
	if saslist:length = 0 {
 | 
			
		||||
		return false.
 | 
			
		||||
	}
 | 
			
		||||
	return true.
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								lib/isp.ks
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								lib/isp.ks
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
function evcalc { //returns the average exaust velocity of active engines. to convert to isp, divide by constant:g0
 | 
			
		||||
	local englist is list().
 | 
			
		||||
	local totalflow is 0.
 | 
			
		||||
	local totalthrust is 0.
 | 
			
		||||
	list engines in englist.
 | 
			
		||||
	for eng in englist { 
 | 
			
		||||
		if eng:ignition and not eng:flameout {
 | 
			
		||||
			set totalflow to totalflow + (eng:possiblethrust /(eng:isp * constant:g0)).
 | 
			
		||||
			set totalthrust to totalthrust + eng:possiblethrust.
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if totalthrust = 0 { //avoid div by 0 later
 | 
			
		||||
		return 1.
 | 
			
		||||
	}
 | 
			
		||||
	return (totalthrust / totalflow).
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue