LoggedMeasurement::LoggedMeasurement(std::string attributeKey, unsigned int measureInterval_secs, unsigned int saveInterval_secs, double deviationThreshold, STI_Device* sti_device) : measureInterval(measureInterval_secs), threshold(deviationThreshold), device(sti_device) { measurementKey = attributeKey; type = Attribute; thresholdExceeded = false; sigma.setValue(MixedData(0)); //sets value to be Empty measurement.setValue(MixedData(0)); numberAveragedMeasurements = 0; maxNumberToAverage = max(1, static_cast<int>(saveInterval_secs/measureInterval_secs)); resultIsReady = false; }
LoggedMeasurement::LoggedMeasurement(unsigned short channel, unsigned int measureInterval_secs, unsigned int saveInterval_secs, double deviationThreshold, STI_Device* sti_device, MixedValue& valueInput) : measureInterval(measureInterval_secs), threshold(deviationThreshold), device(sti_device), valueIn(valueInput) { measurementChannel = channel; type = Channel; thresholdExceeded = false; sigma.setValue(MixedData(0)); //sets value to be Empty measurement.setValue(MixedData(0)); numberAveragedMeasurements = 0; maxNumberToAverage = max(1, static_cast<int>(saveInterval_secs/measureInterval_secs)); resultIsReady = false; }
ap_result ScopeAgent::Run(int32 index, uint32 command, void *args) { switch (command) { // Show the output data in the window case APVA_MIXED_DATA: { MixedData((APAgent_MixedData *)args); return (AP_OK); } // The module has been ejected, so clean up our window case APVA_STOP_SHOWING: { StopShowing(); return (AP_OK); } } return (AP_UNKNOWN); }