Changeset 13552 for trunk/FACT++/src
- Timestamp:
- 05/03/12 22:46:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r13529 r13552 196 196 void HandleDriveControlPointing(const DimData &d) 197 197 { 198 if (!CheckDataSize(d, "DriveControl:Pointing", 7*4+2))198 if (!CheckDataSize(d, "DriveControl:Pointing", 16)) 199 199 return; 200 200 … … 211 211 }; 212 212 213 const uint16_t i = uint16_t(floor(fmod(az+ 11.25, 360)/22));213 const uint16_t i = uint16_t(floor(fmod(az+360+11.25, 360)/22)); 214 214 fDriveControlPointingAz = dir[i]; 215 215 … … 227 227 void HandleDriveControlTracking(const DimData &d) 228 228 { 229 if (!CheckDataSize(d, "DriveControl:Tracking", 7*4+2))229 if (!CheckDataSize(d, "DriveControl:Tracking", 56)) 230 230 return; 231 231 … … 239 239 // Simplified: 240 240 const double dev = cos(dzd) - sin(zd)*sin(zd)*(1.-cos(daz)); 241 fDriveControlTrackingDev = acos(dev) * 180 / M_PI; 241 fDriveControlTrackingDev = acos(dev) * 180 / M_PI * 3600; 242 if (fDriveControlTrackingDev<0.01) 243 fDriveControlTrackingDev=0; 242 244 } 243 245 244 246 void HandleDriveControlSource(const DimData &d) 245 247 { 246 if (!CheckDataSize(d, "DriveControl:Source", 7*4+2))247 return;248 //if (!CheckDataSize(d, "DriveControl:Source", 7*4+2)) 249 // return; 248 250 249 251 const double *ptr = d.ptr<double>(); … … 266 268 out << "#ffffff\t" << woff << '\n'; 267 269 out << "#ffffff\t" << wang << '\n'; 268 270 269 271 ofstream fout("www/drive.txt"); 270 272 fout << out.str(); … … 364 366 WriteBinary("ftmcontrol-patchrates", 365 367 vector<float>(prates, prates+160), 10); 368 369 // for (int i=0; i<160; i++) cout << prates[i] << endl; 370 371 ostringstream out; 372 out << setprecision(3); 373 out << uint64_t(d.time.UnixTime()*1000) << '\n'; 374 out << "#ffffff\t" << fFtmControlTriggerRateCam << '\n'; 375 376 ofstream fout("www/trigger.txt"); 377 fout << out.str(); 366 378 } 367 379 … … 371 383 return; 372 384 373 if (fFadControlEventCounter++%30)374 return;385 //if (fFadControlEventCounter++%30) 386 // return; 375 387 376 388 //const float *avg = d.ptr<float>(); … … 518 530 { 519 531 const State rc = fNetwork.GetState("DRIVE_CONTROL", fStatusDriveControl.second); 520 out << kWhite << "\t";532 out << kWhite << '\t'; 521 533 out << rc.name << '\t'; 522 534 out << fDriveControlPointingZd << '\t'; 523 535 out << fDriveControlPointingAz << '\t'; 524 out << fDriveControlTrackingDev << '\t'; 525 out << fDriveControlSourceName << '\n'; 536 if (fStatusDriveControl.second==7) 537 { 538 out << fDriveControlTrackingDev << '\t'; 539 out << fDriveControlSourceName << '\n'; 540 } 541 else 542 out << "\t\n"; 526 543 } 527 544 else 528 out << kWhite << "\n";545 out << kWhite << '\n'; 529 546 530 547 // --------------- MagicWeather ------------- … … 545 562 col2 = kRed; 546 563 547 out << col1 << "\t";564 out << col1 << '\t'; 548 565 out << fMagicWeatherData[kTemp] << '\t'; 549 566 out << fMagicWeatherData[kDew] << '\n'; 550 out << col2 << "\t";567 out << col2 << '\t'; 551 568 out << fMagicWeatherData[kGusts] << '\n'; 552 569 } … … 582 599 col = kBlue; 583 600 584 out << col << "\t";601 out << col << '\t'; 585 602 out << fBiasControlCurrentMed << '\t'; 586 603 out << fBiasControlCurrentMax << '\t'; … … 588 605 } 589 606 else 590 out << kWhite << "\n";607 out << kWhite << '\n'; 591 608 592 609
Note:
See TracChangeset
for help on using the changeset viewer.