Changeset 1959 for trunk/MagicSoft/Cosy
- Timestamp:
- 04/14/03 17:54:32 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r1954 r1959 1 1 -*-*- END -*-*- 2 2003/04/13 - Thomas Bretz 3 4 * base/timer.cc: 5 - added cast to _suseconds_t 6 7 * candrv/nodedrv.cc: 8 - set starting timeout 9 10 * devdrv/macs.cc: 11 - after requsting error[0] check Zombie-status 12 - Software version 0.66 --> 0.68 13 - added all known MACS error messages 14 15 * gui/MGStarguider.cc, videodev/Filter.[h,cc]: 16 - added stretching of the picture 17 18 19 2 20 2003/04/12 - Thomas Bretz 3 21 -
trunk/MagicSoft/Cosy/base/timer.cc
r1810 r1959 30 30 { 31 31 tv->tv_sec = fSecs; 32 tv->tv_usec = fMs;32 tv->tv_usec = (__suseconds_t)fMs; 33 33 } 34 34 -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r1953 r1959 501 501 fTimeout->Reset(); 502 502 503 // Timer t; 504 // fTimeoutTime = t.Now() + (fGuardTime*fLifeTimeFactor/1000.); 503 Timer t; 504 fTimeoutTime = t.Now() + (fGuardTime*fLifeTimeFactor/1000.); 505 //cout << GetNodeName() << ": " << fmod(fTimeoutTime*10000, 10000)/10 << endl; 505 506 506 507 fTimeout->TurnOn(); … … 583 584 if (now > fTimeoutTime) 584 585 { 585 cout << "==out==> " << fmod(now*1000, 10000)/10 << " > " << fmod(fTimeoutTime*10000, 10000)/10 << endl;586 cout << GetNodeName() << ": " << "==out==> " << fmod(now*1000, 10000)/10 << " > " << fmod(fTimeoutTime*10000, 10000)/10 << endl; 586 587 //cout << "ERROR - " << GetNodeName() << " didn't respond in timeout window." << endl; 587 588 //lout << "ERROR - " << GetNodeName() << " didn't respond in timeout window." << endl; … … 609 610 Timer t(tv); 610 611 fTimeoutTime = t + (fGuardTime*fLifeTimeFactor/1000.); 612 //cout << GetNodeName() << ": " << fmod(fTimeoutTime*10000, 10000)/10 << endl; 611 613 } 612 614 -
trunk/MagicSoft/Cosy/devdrv/macs.cc
r1953 r1959 44 44 void Macs::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv) 45 45 { 46 // cout << "SdoRx: Idx=0x"<< hex << idx << "/" << (int)subidx; 47 // cout << ", val=0x" << val << endl; 46 48 switch (idx) 47 49 { … … 127 129 void Macs::HandleSDOOK(WORD_t idx, BYTE_t subidx, timeval_t *tv) 128 130 { 131 // cout << "Node #" << dec << (int)GetId() << ": Sdo=" << hex << idx << "/" << (int)subidx << " set." << endl; 129 132 switch (idx) 130 133 { … … 201 204 } 202 205 203 204 206 void Macs::ReqVelRes() 205 207 { … … 243 245 SetZombie(); 244 246 } 247 if (IsZombieNode()) 248 return; 245 249 246 250 StopHostGuarding(); … … 252 256 RequestSDO(0x100a); 253 257 WaitForSdo(0x100a); 254 if (IsZombieNode())255 return;256 257 258 // FIXME! Not statically linked! 258 if (fSoftVersion<0x0000004 2) // 00.66259 if (fSoftVersion<0x00000044) // 00.68 259 260 { 260 261 lout << GetNodeName() << " - Software Version too old!" << endl; … … 272 273 WaitForSdo(0x3000); 273 274 274 // SetHome(250000);275 276 // lout << "- Requesting SDO 0x2001 of " << (int)GetId() << endl;277 // RequestSDO(0x2001);278 // WaitForSdo(0x2001);279 280 275 SetPDO1On(FALSE); // this is a workaround for the Macs 281 276 SetPDO1On(TRUE); … … 283 278 SetNoWait(TRUE); 284 279 285 // StartGuarding(500, 2);286 280 // StartGuarding(250, 4); 281 // StartHostGuarding(); 287 282 } 288 283 … … 301 296 302 297 SetNoWait(FALSE); 298 299 StopHostGuarding(); 300 StopGuarding(); 303 301 304 302 // … … 506 504 switch (errnum) 507 505 { 506 case 3: 507 lout << "Axis does not existing." << endl; 508 return; 509 case 5: 510 lout << "Error not cleared (while trying to move axis)" << endl; 511 return; 508 512 case 6: 509 513 // … … 515 519 SetError(0); 516 520 return; 517 518 521 case 8: 519 522 lout << "Control deviation overflow." << endl; 520 523 return; 521 522 524 case 9: 523 525 lout << "Zero index not found." << endl; 524 526 return; 525 527 case 10: 528 lout << "Unknown command, syntax error." << endl; 529 lout << "Please recompile and reload program." << endl; 530 return; 526 531 case 11: 527 532 case 25: … … 540 545 { 541 546 case 11: 542 lout << " software endswitch activated." << endl;547 lout << " software"; 543 548 break; 544 549 case 25: 545 lout << " hardware endswitch activated." << endl;550 lout << " hardware"; 546 551 break; 547 552 } 548 return; 549 553 lout << " endswitch activated." << endl; 554 return; 555 case 12: 556 lout << "Wrong parameter number used in SET command." << endl; 557 return; 558 case 14: 559 lout << " Too many LOOP calls." << endl; 560 return; 561 case 16: 562 lout << "Parameter in EEPROM broken (means: EEPROM broken, or saving not finished)" << endl; 563 lout << "Please use APOSS to 'Reset' the MACS and reload the parameters." << endl; 564 return; 565 case 17: 566 lout << "Program in EEPROM broken (means: EEPROM broken, or saving not finished)" << endl; 567 lout << "Please use APOSS to delete all Programs restore the programs." << endl; 568 return; 569 case 18: 570 lout << "Reset by CPU (reset called by Watch-dog cause of CPU halted)" << endl; 571 lout << "Possible reasons: short under-/overvoltage or shortcut." << endl; 572 return; 573 case 19: 574 lout << "User break (autostart program stopped by user)" << endl; 575 return; 576 case 51: 577 lout << "Too many (>=10) GOSUB calls." << endl; 578 return; 579 case 52: 580 lout << "Too many RETURN calls." << endl; 581 return; 582 case 62: 583 lout << "Error veryfiing EEPROM after access (Try again savaing parameters or program)" << endl; 584 return; 585 case 70: 586 lout << "Error in DIM call (call to DIM doesn't fit existing DIM call)" << endl; 587 return; 550 588 case 71: 551 589 lout << "Array out of bound." << endl; 552 590 return; 553 591 case 79: 592 lout << "Timeout waiting for index (WAITNDX)." << endl; 593 return; 554 594 case 84: 555 595 lout << "Too many (>12) ON TIME calls." << endl; 596 return; 597 case 87: 598 lout << "Out of memory for variables - Check APOSS predifined number of" << endl; 599 lout << "variables and try deleting the array by doing a 'Reset' from APOSS." << endl; 600 return; 601 case 89: 602 lout << "CAN I/O error (REOPEN=" << dec << errinf << " " << (errinf==0?"OK":"ERR") << ")" << endl; 556 603 return; 557 604 -
trunk/MagicSoft/Cosy/gui/MGStarguider.cc
r1953 r1959 56 56 IDM_kPNG, 57 57 IDM_kOnce, 58 IDM_kStretch, 58 59 IDM_kUseFileRaDec, 59 60 IDM_kContinous, … … 204 205 fDisplay->AddEntry("Sao &Catalog", IDM_kCatalog); 205 206 fDisplay->AddEntry("Starguider", IDM_kStarguider); 207 fDisplay->AddEntry("Stretch", IDM_kStretch); 206 208 fDisplay->DisableEntry(IDM_kStarguider); 209 fDisplay->CheckEntry(IDM_kStretch); 207 210 fDisplay->Associate(this); 208 211 fList->Add(fDisplay); … … 637 640 case IDM_kStarguider: 638 641 Toggle(fDisplay, IDM_kStarguider); 642 gSystem->Unlink("tracking_error.txt"); 639 643 return kTRUE; 640 644 … … 648 652 fDisplay->DisableEntry(IDM_kStarguider); 649 653 } 654 return kTRUE; 655 656 case IDM_kStretch: 657 Toggle(fDisplay, IDM_kStretch); 650 658 return kTRUE; 651 659 … … 928 936 pos1 -= pos0; 929 937 930 ofstream fout2("tracking_error.txt" );938 ofstream fout2("tracking_error.txt", ios::app); 931 939 fout2 << setprecision(10) << fSao->GetMjd()-52000 << " " << -pos1.Alt() << " " << pos1.Az() << endl; 932 940 … … 1017 1025 return; 1018 1026 1019 cout << "Img: " << n << endl;1027 //cout << "Img: " << n << endl; 1020 1028 1021 1029 byte c[768*576]; 1022 1030 for (int i=0; i<768*576; i++) 1023 1031 c[i] = (byte)(myimg[i]/fIntRate+.5); 1032 1033 if (fDisplay->IsEntryChecked(IDM_kStretch)) 1034 Filter::Stretch(c); 1024 1035 1025 1036 if (!fWritePictures->IsEntryEnabled(IDM_kStart) && -
trunk/MagicSoft/Cosy/videodev/Filter.cc
r1531 r1959 203 203 } 204 204 205 void Filter::Stretch(byte *img) 206 { 207 const int offset = 10; 208 209 int max; 210 int min; 211 212 /*const float mean =*/Mean(img, offset, &min, &max); 213 214 for (int x=0; x<768; x++) 215 for (int y=0; y<576; y++) 216 { 217 img[y*768+x] -= min; 218 img[y*768+x] *= 255/(max-min); 219 } 220 } -
trunk/MagicSoft/Cosy/videodev/Filter.h
r1111 r1959 29 29 public: 30 30 static void Execute(byte *img); 31 static void Stretch(byte *img); 31 32 32 33 ClassDef(Filter, 0)
Note:
See TracChangeset
for help on using the changeset viewer.