Changeset 1953 for trunk/MagicSoft/Cosy/devdrv
- Timestamp:
- 04/12/03 19:06:27 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/devdrv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/devdrv/macs.cc
r1804 r1953 46 46 switch (idx) 47 47 { 48 case 0x1003: 49 // FIXME, see Init 50 if (subidx!=2) 51 return; 52 lout << "- " << GetNodeName() << ": Error[0]=" << dec << val << endl; 53 SetError(val); 54 return; 55 48 56 case 0x100a: 49 57 lout << "- " << GetNodeName() << ": Using Software Version V" << dec << (int)(val>>16) << "." << (int)(val&0xff) << endl; … … 221 229 } 222 230 223 224 231 void Macs::Init() 225 232 { 233 // 234 // Request current error status (FIXME: is the first entry in the 235 // error list) 236 // 237 lout << "- " << GetNodeName() << ": Requesting Error[0]." << endl; 238 RequestSDO(0x1003, 2); 239 WaitForSdo(0x1003, 2); 226 240 if (HasError()) 227 241 { … … 238 252 RequestSDO(0x100a); 239 253 WaitForSdo(0x100a); 240 241 254 if (IsZombieNode()) 242 { 243 lout << GetNodeName() << " - InitDevice failed!" << endl; 244 return; 245 } 255 return; 246 256 247 257 // FIXME! Not statically linked! … … 538 548 return; 539 549 550 case 71: 551 lout << "Array out of bound." << endl; 552 return; 553 540 554 case 84: 541 555 lout << "Too many (>12) ON TIME calls." << endl; -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r1804 r1953 40 40 default: 41 41 lout << "?" << endl; 42 SetZombie(); 42 43 return; 43 44 } 44 45 default: 45 46 lout << "???" << endl; 47 SetZombie(); 46 48 return; 47 49 } … … 88 90 89 91 case 0x6502: 90 if (val==0)91 val = 1; // Single Turn = Multiturn with one turn92 lout << "- Possible Turns: " << dec << val << endl;92 //if (val==0) 93 // val = 1; // Single Turn = Multiturn with one turn 94 lout << "- Number of Revolutions: " << dec << val << endl; 93 95 fTurns = val; 94 96 return; … … 105 107 if (IsZombieNode()) 106 108 { 107 fLabel[0]->SetText(new TGString("")); 108 fLabel[1]->SetText(new TGString("")); 109 fLabel[2]->SetText(new TGString("")); 109 fLabel->SetText(new TGString("")); 110 110 fUpdPos = ~fPos; 111 fUpdVel = ~fVel;112 fUpdAcc = ~fAcc;113 111 return; 114 112 } … … 116 114 char text[21]; 117 115 118 if (fPos!=fUpdPos && fLabel [0])116 if (fPos!=fUpdPos && fLabel) 119 117 { 120 118 sprintf(text, "%ld", fPos); 121 fLabel [0]->SetText(new TGString(text));119 fLabel->SetText(new TGString(text)); 122 120 fUpdPos = fPos; 123 }124 125 if (fVel!=fUpdVel && fLabel[1])126 {127 sprintf(text, "%d", fVel);128 fLabel[1]->SetText(new TGString(text));129 fUpdVel = fVel;130 }131 132 if (fAcc!=fUpdAcc && fLabel[2])133 {134 sprintf(text, "%d", fAcc);135 fLabel[2]->SetText(new TGString(text));136 fUpdAcc = fAcc;137 121 } 138 122 } … … 183 167 fAcc = data[6] | (data[7]<<8); 184 168 185 const int uplim = 9*fTicks/10;186 const int dnlim = 1*fTicks/10;169 const int dnlim = fTicks/10; 170 const int uplim = fTurns*fTicks-dnlim; 187 171 188 172 int turn = fTurn; … … 199 183 fPos = pos; 200 184 fTurn = turn; 201 202 //fout << dec << (int)GetId() << " " << turn << " " << pos << endl;203 185 204 186 fTime.SetTimer(tv); … … 230 212 RequestSDO(0x1000); 231 213 WaitForSdo(0x1000); 232 233 214 if (IsZombieNode()) 234 { 235 lout << GetNodeName() << " - Init failed!" << endl; 236 return; 237 } 215 return; 238 216 239 217 // -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
r1727 r1953 17 17 WORD_t fTurns; // Number of possible turns 18 18 19 TGLabel **fLabel; //19 TGLabel *fLabel; // 20 20 LWORDS_t fUpdPos; // ticks 21 WORDS_t fUpdVel; // ticks per 5ms22 WORDS_t fUpdAcc; // ticks per 25ms^221 // WORDS_t fUpdVel; // ticks per 5ms 22 // WORDS_t fUpdAcc; // ticks per 25ms^2 23 23 24 24 bool fPosHasChanged; //! … … 40 40 void StopDevice(); 41 41 42 void SetDisplay(TGLabel * *label) { fLabel = label; }42 void SetDisplay(TGLabel *label) { fLabel = label; } 43 43 44 44 void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
Note:
See TracChangeset
for help on using the changeset viewer.