Changeset 13693
- Timestamp:
- 05/13/12 12:08:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r13677 r13693 60 60 61 61 vector<float> fFeedbackCalibration; 62 63 float fFeedbackTempOffset; 64 float fFeedbackUserOffset; 65 62 66 vector<float> fBiasControlVoltageVec; 63 67 … … 175 179 DimStampedInfo fDimMagicWeatherData; 176 180 181 DimStampedInfo fDimFeedbackDeviation; 177 182 DimStampedInfo fDimFeedbackCalibration; 178 183 … … 436 441 const float *ptr = d.ptr<float>(); 437 442 fFeedbackCalibration.assign(ptr+2*416, ptr+3*416); 443 } 444 445 void HandleFeedbackDeviation(const DimData &d) 446 { 447 if (!CheckDataSize(d, "Feedback:Deviation", 2*4*416+2)) 448 return; 449 450 vector<float> dev(ptr+416, ptr+416+320); 451 452 fFeedbackTempOffset = ptr[2*416]; 453 fFeedbackUserOffset = ptr[2*416+1]; 454 455 for (int i=0; i<320; i++) 456 dev[i] -= fFeedbackTempOffset+fFeedbackUserOffset; 457 458 // Write the 160 patch values to a file 459 WriteBinary("feedback-deviation", dev, 2000, -1000); 460 461 const Statistics stat(dev, 3); 462 463 ostringstream out; 464 out << setprecision(3); 465 out << d.time.JavaDate() << '\n'; 466 out << kHtmlWhite << '\t' << fFeedbackUserOffset << '\n'; 467 out << kHtmlWhite << '\t' << fFeedbackTempOffset << '\n'; 468 out << kHtmlWhite << '\t' << stat.min << '\n'; 469 out << kHtmlWhite << '\t' << stat.med << '\n'; 470 out << kHtmlWhite << '\t' << stat.avg << '\n'; 471 out << kHtmlWhite << '\t' << stat.max << '\n'; 472 ofstream("www/feedback.txt") << out.str(); 473 438 474 } 439 475 … … 719 755 return; 720 756 if (HandleService(curr, fDimDriveControlSource, &StateMachineSmartFACT::HandleDriveControlSource)) 757 return; 758 if (HandleService(curr, fDimFeedbackDeviation, &StateMachineSmartFACT::HandleFeedbackDeviation)) 721 759 return; 722 760 if (HandleService(curr, fDimFeedbackCalibration, &StateMachineSmartFACT::HandleFeedbackCalibration)) … … 1043 1081 fDimMagicWeatherData ("MAGIC_WEATHER/DATA", (void*)NULL, 0, this), 1044 1082 //--- 1083 fDimFeedbackDeviation ("FEEDBACK/DEVIATION", (void*)NULL, 0, this), 1045 1084 fDimFeedbackCalibration ("FEEDBACK/CALIBRATION", (void*)NULL, 0, this), 1046 1085 //---
Note:
See TracChangeset
for help on using the changeset viewer.