Open yilongx opened 12 years ago
I find sample->max is samller than sample->min when i call function getSample(); but not every time.
Testcode code as follows:
nmprk::translation::sample_t* sample; try { sample = nmprk::translation::getSample(&d,nmprk::translation::samplePower,nmprk::translation::domainSystem,NULL); }catch(nmprk::nmprkException* e) { std::cout << "Failed!\nCaught Exception getSample(power): Code[" << e->errorCode << "] MSG[" << e->errorMsg << "]\n"; return -1; } if(sample != NULL) { std::cout << "Power Reading:\n"; std::cout << "\tCurrent Power Reading (Watts): " << sample->cur << std::endl; std::cout << "\tMin Power Reading (Watts): " << sample->min << std::endl; std::cout << "\tMax Power Reading (Watts): " << sample->max << std::endl; std::cout << "\tAverage Power Reading (Watts): " << sample->avg << std::endl; std::cout << "\tReading Time Stamp: " << asctime(&sample->timestamp) << std::endl; std::cout << "\tReporting Period (seconds): " << sample->statReportingPeriod << std::endl; }else{ std::cout << "Unable to sample power reading!\n"; return -1; }
Print message as follows:
Power Reading: Current Power Reading (Watts): 120 Min Power Reading (Watts): 87 Max Power Reading (Watts): 22 Average Power Reading (Watts): 112 Reading Time Stamp: Fri Aug 24 06:00:27 2012 Reporting Period (seconds): 80729
Will look for this issue, so far I have not seen it.
I find sample->max is samller than sample->min when i call function getSample(); but not every time.
Testcode code as follows:
nmprk::translation::sample_t* sample; try { sample = nmprk::translation::getSample(&d,nmprk::translation::samplePower,nmprk::translation::domainSystem,NULL); }catch(nmprk::nmprkException* e) { std::cout << "Failed!\nCaught Exception getSample(power): Code[" << e->errorCode << "] MSG[" << e->errorMsg << "]\n"; return -1; } if(sample != NULL) { std::cout << "Power Reading:\n"; std::cout << "\tCurrent Power Reading (Watts): " << sample->cur << std::endl; std::cout << "\tMin Power Reading (Watts): " << sample->min << std::endl; std::cout << "\tMax Power Reading (Watts): " << sample->max << std::endl; std::cout << "\tAverage Power Reading (Watts): " << sample->avg << std::endl; std::cout << "\tReading Time Stamp: " << asctime(&sample->timestamp) << std::endl; std::cout << "\tReporting Period (seconds): " << sample->statReportingPeriod << std::endl; }else{ std::cout << "Unable to sample power reading!\n"; return -1; }
Print message as follows:
Power Reading: Current Power Reading (Watts): 120 Min Power Reading (Watts): 87 Max Power Reading (Watts): 22 Average Power Reading (Watts): 112 Reading Time Stamp: Fri Aug 24 06:00:27 2012 Reporting Period (seconds): 80729