Changeset 1953 for trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
- Timestamp:
- 04/12/03 19:06:27 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 //
Note:
See TracChangeset
for help on using the changeset viewer.