Changeset 2518 for trunk/MagicSoft/Cosy/devdrv
- Timestamp:
- 11/17/03 13:50:48 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/devdrv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/devdrv/macs.cc
r2280 r2518 1 1 #include "macs.h" 2 2 3 #include <iostream .h>3 #include <iostream> 4 4 #include <sys/time.h> // timeval->tv_sec 5 5 … … 9 9 10 10 ClassImp(Macs); 11 12 using namespace std; 11 13 12 14 /* … … 66 68 return; 67 69 70 case 0x100c: 71 lout << "- " << GetNodeName() << ": Guard time:" << dec << val << endl; 72 return; 73 74 case 0x100d: 75 lout << "- " << GetNodeName() << ": Life time factor:" << dec << val << endl; 76 return; 77 68 78 case 0x2002: 69 79 cout << GetNodeName() << ": Current velocity: " << dec << val << endl; … … 140 150 switch (idx) 141 151 { 152 case 0x1000: 153 switch (subidx) 154 { 155 case 1: 156 //lout << ddev(MLog::eGui); 157 lout << "- " << GetNodeName() << ": State of node set." << endl; 158 //lout << edev(MLog::eGui); 159 return; 160 } 161 break; 162 163 case 0x100c: 164 switch (subidx) 165 { 166 case 0: 167 //lout << ddev(MLog::eGui); 168 lout << "- " << GetNodeName() << ": Guard time set." << endl; 169 //lout << edev(MLog::eGui); 170 return; 171 } 172 break; 173 174 case 0x100d: 175 switch (subidx) 176 { 177 case 0: 178 //lout << ddev(MLog::eGui); 179 lout << "- " << GetNodeName() << ": Life time factor set." << endl; 180 //lout << edev(MLog::eGui); 181 return; 182 } 183 break; 184 185 case 0x1800: 186 switch (subidx) 187 { 188 case 1: 189 //lout << ddev(MLog::eGui); 190 lout << "- " << GetNodeName() << ": Status of PDO1 set." << endl; 191 //lout << edev(MLog::eGui); 192 return; 193 } 194 break; 195 142 196 case 0x2002: 143 197 switch (subidx) … … 189 243 HandleNodeguard(tv); 190 244 return; 245 246 case 0x6000: 247 //lout << ddev(MLog::eGui); 248 lout << "- " << GetNodeName() << ": Rotation direction set." << endl; 249 //lout << edev(MLog::eGui); 250 return; 251 252 case 0x6002: 253 //lout << ddev(MLog::eGui); 254 lout << "- " << GetNodeName() << ": Velocitz resolution set." << endl; 255 //lout << edev(MLog::eGui); 256 return; 257 258 case 0x6003: 259 switch (subidx) 260 { 261 case 0: 262 //lout << ddev(MLog::eGui); 263 lout << "- " << GetNodeName() << ": Absolute positioning started." << endl; 264 //lout << edev(MLog::eGui); 265 return; 266 267 case 1: 268 //lout << ddev(MLog::eGui); 269 lout << "- " << GetNodeName() << ": Relative positioning started." << endl; 270 //lout << edev(MLog::eGui); 271 return; 272 } 273 break; 191 274 192 275 case 0x6004: … … 271 354 StopGuarding(); 272 355 273 // ****FIXME*** usleep(2000*GetGuardTime());274 275 356 lout << "- " << GetNodeName() << ": Requesting Mac Software Version." << endl; 276 357 RequestSDO(0x100a); … … 302 383 //SetNoWait(TRUE); 303 384 304 // StartGuarding(200, 2, kFALSE); // Using PDO1 @ 100ms305 // 306 // 385 StartGuarding(250, 1, kFALSE); // Using PDO1 @ 100ms 386 //StartGuarding(250, 4); 387 //StartHostGuarding(); 307 388 308 389 StartNode(); … … 478 559 void Macs::HandlePDO1(BYTE_t *data, timeval_t *tv) 479 560 { 480 // FIXME!!!! 561 // FIXME!!!! Only 0x4000 should do this to be 562 // CanOpen conform 481 563 HandleNodeguard(tv); 482 /* 483 Timer t(tv); 484 cout << GetNodeName()<< " " <<t.GetTimeStr() << endl; 485 */ 564 486 565 fPdoPos = (data[4]<<24) | (data[5]<<16) | (data[6]<<8) | data[7]; 487 566 … … 656 735 return; 657 736 658 lout << GetNodeName() << ": Status PDO3 = "; 737 Timer time; 738 time.Now(); 739 740 lout << time << ": " << GetNodeName() << " - PDO3 = "; 659 741 const Bool_t ready = data[3]&0x01; 660 742 const Bool_t fuse = data[3]&0x02; -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc
r2278 r2518 4 4 #include "network.h" 5 5 6 #include <iostream.h> // cout 7 #include <iomanip.h> // setw, setfill 8 9 #include <TSystem.h> // gSystem 6 #include <iostream> // cout 7 #include <iomanip> // setw, setfill 8 10 9 #include <TGLabel.h> // TGLabel->SetText 11 10 12 #include <pthread.h>13 #include <sys/resource.h> // PRIO_PROCESS14 15 11 ClassImp(ShaftEncoder); 12 13 using namespace std; 16 14 17 15 ShaftEncoder::ShaftEncoder(const BYTE_t nodeid, const char *name, MLog &out) … … 104 102 } 105 103 104 void ShaftEncoder::HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv) 105 { 106 switch (idx) 107 { 108 case 0x1802: 109 switch (subidx) 110 { 111 case 1: 112 //lout << ddev(MLog::eGui); 113 lout << "- " << GetNodeName() << ": PDOs configured." << endl; 114 //lout << edev(MLog::eGui); 115 return; 116 } 117 break; 118 119 case 0x6001: 120 switch (subidx) 121 { 122 case 0: 123 //lout << ddev(MLog::eGui); 124 lout << "- " << GetNodeName() << ": Log.ticks/revolution set." << endl; 125 //lout << edev(MLog::eGui); 126 return; 127 } 128 break; 129 130 case 0x6002: 131 switch (subidx) 132 { 133 case 0: 134 //lout << ddev(MLog::eGui); 135 lout << "- " << GetNodeName() << ": Max number of ticks set." << endl; 136 //lout << edev(MLog::eGui); 137 return; 138 } 139 break; 140 141 case 0x6003: 142 switch (subidx) 143 { 144 case 0: 145 //lout << ddev(MLog::eGui); 146 lout << "- " << GetNodeName() << ": Preset value set." << endl; 147 //lout << edev(MLog::eGui); 148 return; 149 } 150 break; 151 } 152 NodeDrv::HandleSDOOK(idx, subidx, data, tv); 153 } 154 106 155 void ShaftEncoder::DisplayVal() 107 156 { … … 288 337 */ 289 338 290 // StartGuarding(175, 2); // 175339 // StartGuarding(200, 1, kTRUE); // 175 291 340 // StartGuarding(10*GetId(), 2); // 175 292 341 } -
trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
r1953 r2518 43 43 44 44 void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv); 45 void HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv); 45 46 /* 46 47 void HandleSDOOK(WORD_t idx, BYTE_t subidx, timeval_t *tv) { NodeDrv::HandleSDOOK(idx, subidx, tv); }
Note:
See TracChangeset
for help on using the changeset viewer.