예제 #1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
 * Method:    getPDPTotalPower
 * Signature: (BLjava/nio/IntBuffer;)D
 */
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower
(JNIEnv *env, jclass, jobject status, jint module)
{
    jint *status_ptr = (jint *)env->GetDirectBufferAddress(status);

    return getPDPTotalPower(status_ptr, module);
}
예제 #2
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
 * Method:    getPDPTotalPower
 * Signature: (I)D
 */
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower
  (JNIEnv *env, jclass, jint module)
{
	int32_t status = 0;
	double power = getPDPTotalPower(module, &status);
  CheckStatus(env, status, false);
  return power;
}
/**
 * Query the total power drawn from the monitored PDP channels
 * @return The the total power drawn from the PDP channels in Watts
 */
double
PowerDistributionPanel::GetTotalPower() {
	int32_t status = 0;
	
	double power = getPDPTotalPower(&status);
	
	if(status) {
		wpi_setWPIErrorWithContext(Timeout, "");
	}
	
	return power;
}