當前位置: 首頁>>代碼示例>>Java>>正文


Java RPCException類代碼示例

本文整理匯總了Java中krpc.client.RPCException的典型用法代碼示例。如果您正苦於以下問題:Java RPCException類的具體用法?Java RPCException怎麽用?Java RPCException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RPCException類屬於krpc.client包,在下文中一共展示了RPCException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPitchDirFromVector

import krpc.client.RPCException; //導入依賴的package包/類
PitchDir getPitchDirFromVector(dVector2 vec) throws RPCException, IOException
{
	PitchDir toRet = new PitchDir(0,0);
	Triplet<Double, Double, Double> relVel = spaceCenter.transformPosition(booster_flight.getVelocity(), booster.getOrbit().getBody().getReferenceFrame(), booster.getSurfaceReferenceFrame());
	align_vel_current.x = ((Double) relVel.getValue1()).doubleValue();
	align_vel_current.y = ((Double) relVel.getValue2()).doubleValue();
	
	align_vel_current = align_vel_current.Swap();
	
	vec = vec.Subtract(align_vel_current);
	toRet.HDG = (float) ((Math.atan2(vec.x, vec.y)/Math.PI)*180d);
	if(toRet.HDG < 0) toRet.HDG = 360f + toRet.HDG;
	
	double length = Math.pow(1+vec.Magnitude(), align_vel_pow)-1;
	
	toRet.pitch = Math.max(align_pitch_min,(float)(90d - length*align_pitch_factor) );
	
	return toRet;
}
 
開發者ID:janw23,項目名稱:New-Kepard,代碼行數:20,代碼來源:JPilot.java

示例2: checkFairings

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Checks if a fairing would be decoupled in the next stage and if the
 * height of the rocket is above atmosphere
 * 
 * @return true if a fairing can be decoupled or if there is none
 * @throws AGuSDataException 
 */
private boolean checkFairings() throws AGuSDataException {
	if (fairings == false) {
		try {
			if (flight.getMeanAltitude() < vessel.getOrbit().getBody().getAtmosphereDepth()) {
				this.fairings = Fairings();
				if (fairings == false) {
					this.fairings = false;
					return false;
				}
			}
		} catch (RPCException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e);
			throw new AGuSDataException(e);
		}

	}
	this.fairings = true;
	return true;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:29,代碼來源:STAGING.java

示例3: Fairings

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * checks if there are fairings getting activated in the next stage
 * 
 * @return true if there are no fairings getting activated in the stage
 * @throws AGuSDataException 
 */
private boolean Fairings() throws AGuSDataException {
	for (int i = 0; i < pas; i++) {
		Part f = partAcList.get(i);
		try {
			if (f.getFairing() != null) {
				if (f.getStage() == currentStage.getNextStage().getId()) {
					return false;
				}
			}
		} catch (RPCException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e);
			throw new AGuSDataException(e);
		}
	}
	return true;

}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:26,代碼來源:STAGING.java

示例4: checkLaunchEscape

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * checks if there is an launch escape system in the next stage
 * 
 * @return true if a launch escape system in the next stage can be decoupled
 *         or if there is none
 * @throws AGuSDataException 
 */
private boolean checkLaunchEscape() throws AGuSDataException {
	if (launchEscape == false) {
		try {
			if (flight.getMeanAltitude() <= vessel.getOrbit().getBody().getAtmosphereDepth()) {
				this.launchEscape = LaunchEscape();
				if (launchEscape) {
					this.launchEscape = false;
					return false;
				}
			}
		} catch (RPCException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e);
			throw new AGuSDataException(e);
		}
	}
	this.launchEscape = true;
	return true;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:28,代碼來源:STAGING.java

示例5: checkLaunchClamp

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * checks if a launch clamp will be activated in the next stage
 * 
 * @return true if a launch clamp can be activated in the next stage or if
 *         there is none
 * @throws AGuSDataException 
 */
private boolean checkLaunchClamp() throws AGuSDataException {
	if (launchClamp == false) {
		this.launchClamp = LaunchClamp();
		if (launchClamp) {
			try {

				if (currentStage.getNextStage().getAcceleration(1) < vessel.getOrbit().getBody()
						.getSurfaceGravity()) {
					this.launchClamp = false;
					return false;
				}
			} catch (RPCException | IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				LOGGER.logger.log(Level.SEVERE, "", e);
				throw new AGuSDataException(e);
			}
		}
	}
	this.launchClamp = true;
	return true;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:30,代碼來源:STAGING.java

示例6: checkParachute

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * 
 * @return true if a parachute can be activated in the next stage, or if
 *         there is none
 * @throws AGuSDataException 
 */
private boolean checkParachute() throws AGuSDataException {
	if (parachute == false) {
		this.parachute = Parachute();
		if (parachute) {
			try {
				if (flight.getMeanAltitude() > parachuteAlt * 1.25) { //|| flight.getDynamicPressure() < parachutePres) {
					this.parachute = false;
					return false;
				}
			} catch (RPCException | IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				LOGGER.logger.log(Level.SEVERE, "", e);
				throw new AGuSDataException(e);
			}
		}
	}
	this.parachute = true;
	return true;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:27,代碼來源:STAGING.java

示例7: outprintVesselTreeStructure

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Will create a .txt document at the given location and with the given name
 * <p>
 * Leaving the value of both strings empty will result in an system outprint
 * 
 * @param dir
 *            the directory where the file should be stored
 * @param name
 *            the name of the file
 */
public void outprintVesselTreeStructure(String dir, String name) {
	int size = partArr.length;
	if (dir.equals("") && name.equals("")) {
		//both are empty 
		for (int i = 0; i < size; i++) {
			try {
				System.out.println(i + ": " + partArr[i].getName());
			} catch (RPCException | IOException e) {
				e.printStackTrace();
				LOGGER.logger.log(Level.SEVERE, "Error printing information", e);
			}
		}
	}

	//TODO
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:27,代碼來源:PARTS.java

示例8: getAllEngineIds

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Returns a List containing the ids of all engines of the vessel
 * 
 * @return the ids of all engines
 */
public List<Integer> getAllEngineIds() {
	int size = partArr.length;
	List<Integer> data = new ArrayList<Integer>();
	for (int i = 0; i < size; i++) {
		try {
			if (partArr[i].getEngine() != null) {
				data.add(i);
			}
		} catch (RPCException | IOException e) {
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "Error fetching object", e);
		}
	}
	return data;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:21,代碼來源:PARTS.java

示例9: getAllAntennaIds

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Returns a List containing the ids of all antennas of the vessel
 * 
 * @return the ids of all antennas
 */
public List<Integer> getAllAntennaIds() {
	int size = partArr.length;
	List<Integer> data = new ArrayList<Integer>();
	for (int i = 0; i < size; i++) {
		try {
			if (partArr[i].getAntenna() != null) {
				data.add(i);
			}
		} catch (RPCException | IOException e) {
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "Error fetching object", e);
		}
	}
	return data;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:21,代碼來源:PARTS.java

示例10: getMaximumAntennaRange

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Searches for the antenna with the maximum range
 * 
 * @return the maximum range of the antenna
 */
public double getMaximumAntennaRange() {
	double power = 0;
	Iterator<Integer> dataIt = getAllAntennaIds().iterator();
	while (dataIt.hasNext()) {
		double pow = 0;
		try {
			pow = getPartWithId(dataIt.next()).getAntenna().getPower();
		} catch (RPCException | IOException e) {
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "Failed fetching antenna power", e);
		}
		if (pow > power) {
			power = pow;
		}
	}
	return power;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:23,代碼來源:PARTS.java

示例11: updateOrderedPartListRecursive

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Recursivly searches through the vessel to create the partlist
 * 
 * @param parts
 *            the partlist
 * @param root
 *            the root part
 * @param id
 *            the id of the root part Default 0
 * @return the id of the current root part
 */
private int updateOrderedPartListRecursive(Part[] parts, Part root, int id) {
	parts[id] = root;
	List<Part> childs = null;
	try {
		childs = root.getChildren();
	} catch (RPCException | IOException e) {
		e.printStackTrace();
		LOGGER.logger.log(Level.SEVERE, "Error getting part children", e);
	}
	while (childs.size() > 0) {
		id = updateOrderedPartListRecursive(parts, childs.get(0), id + 1);
		childs.remove(0);
	}
	return id;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:27,代碼來源:PARTS.java

示例12: calcMass

import krpc.client.RPCException; //導入依賴的package包/類
/**
 * Uses the mass of the next stage and adds the mass of every part that will
 * be decoupled in the next stage
 * 
 * @return the mass of this stage
 * @throws AGuSDataException 
 */
private float calcMass() throws AGuSDataException {
	float m = nextStage.getMass();
	List<Part> p = nextStage.getDecoupledParts();
	int s = p.size();
	for (int i = 0; i < s; i++) {
		try {
			m += p.get(i).getMass();
		} catch (RPCException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e);
			throw new AGuSDataException(e);
		}
	}
	return m;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:24,代碼來源:STAGE_NORMAL.java

示例13: calcMassAfterSRBs

import krpc.client.RPCException; //導入依賴的package包/類
private float calcMassAfterSRBs() throws AGuSDataException {
	float m = getMass();
	List<Engine> srb = getSRBs();
	int s = srb.size();
	for (int i = 0; i < s; i++) {
		try {
			m = (float) (m - (srb.get(i).getPart().getMass() - srb.get(i).getPart().getDryMass()));
		} catch (RPCException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e);
			throw new AGuSDataException(e);
		}
	}
	return m;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:17,代碼來源:STAGE_NORMAL.java

示例14: calcAvailableThrust

import krpc.client.RPCException; //導入依賴的package包/類
private float calcAvailableThrust() throws AGuSDataException {
	List<Engine> en = getActiveEngines();
	float thrust = 0;
	int s = en.size();
	for (int i = 0; i < s; i++) {
		try {
			thrust += en.get(i).getMaxVacuumThrust();
		} catch (RPCException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e);
			throw new AGuSDataException(e);
		}
	}
	return thrust;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:17,代碼來源:STAGE_NORMAL.java

示例15: checkSRBs

import krpc.client.RPCException; //導入依賴的package包/類
private List<Engine> checkSRBs() throws AGuSDataException {
	List<Engine> srb = new ArrayList<Engine>();
	List<Engine> e = getActiveEngines();
	int se = e.size();
	for (int i = 0; i < se; i++) {
		try {
			if (e.get(i).getThrottleLocked()) {
				srb.add(e.get(i));
			}
		} catch (RPCException | IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
			LOGGER.logger.log(Level.SEVERE, "", e1);
			throw new AGuSDataException(e1);
		}
	}
	return srb;
}
 
開發者ID:Nik4053,項目名稱:KSP-AGuS-Automatic-Guidance-System,代碼行數:19,代碼來源:STAGE_NORMAL.java


注:本文中的krpc.client.RPCException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。