/* * Class: edu_wpi_first_wpilibj_hal_PDPJNI * Method: resetPDPTotalEnergy * Signature: (BLjava/nio/IntBuffer;)D */ JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy (JNIEnv *env, jclass, jobject status, jint module) { jint *status_ptr = (jint *)env->GetDirectBufferAddress(status); return getPDPTotalEnergy(status_ptr, module); }
/* * Class: edu_wpi_first_wpilibj_hal_PDPJNI * Method: resetPDPTotalEnergy * Signature: (I)D */ JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy (JNIEnv *env, jclass, jint module) { int32_t status = 0; double energy = getPDPTotalEnergy(module, &status); CheckStatus(env, status, false); return energy; }
/** * Query the total energy drawn from the monitored PDP channels * @return The the total energy drawn from the PDP channels in Joules */ double PowerDistributionPanel::GetTotalEnergy() { int32_t status = 0; double energy = getPDPTotalEnergy(&status); if(status) { wpi_setWPIErrorWithContext(Timeout, ""); } return energy; }