Changeset 11940 for trunk/FACT++/src
- Timestamp:
- 09/02/11 08:23:04 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/biasctrl.cc
r11938 r11940 15 15 16 16 #include "LocalControl.h" 17 #include "HeadersBIAS.h" 17 18 18 19 namespace ba = boost::asio; … … 22 23 using namespace std::placeholders; 23 24 using namespace std; 25 using namespace BIAS; 24 26 25 27 // ------------------------------------------------------------------------ … … 27 29 class ConnectionBias : public ConnectionUSB 28 30 { 29 enum30 {31 kNumBoards = 13,32 kNumChannelsPerBoard = 32,33 kNumChannels = kNumBoards*kNumChannelsPerBoard34 };35 36 enum Command_t37 {38 // Communication commands39 kCmdReset = 0,40 kCmdRead = 1,41 kCmdGlobalSet = 2,42 kCmdChannelSet = 3,43 44 // Internal command names45 kResetChannels = 0x10|kCmdChannelSet,46 kUpdate = 0x10|kCmdRead,47 kExpertChannelSet = 0x14|kCmdChannelSet,48 kSynchronize = 0x1e,49 //kOverCurReset = 20,50 };51 52 enum53 {54 kMaxDac = 0xfff55 };56 57 31 boost::asio::deadline_timer fSyncTimer; 58 32 boost::asio::deadline_timer fRampTimer; … … 60 34 61 35 vector<uint8_t> fBuffer; 36 vector<uint8_t> fBufferRamp; 37 vector<uint8_t> fBufferUpdate; 62 38 63 39 bool fIsVerbose; … … 82 58 bool fIsInitializing; 83 59 bool fIsRamping; 84 //bool fWaitingForAnswer;60 bool fWaitingForAnswer; 85 61 86 62 protected: … … 164 140 } 165 141 166 bool EvalAnswer( uint8_t *answer, uint16_t id, int command)142 bool EvalAnswer(const uint8_t *answer, uint16_t id, int command) 167 143 { 168 144 answer += id*3; … … 215 191 fSendCounter = wrap; 216 192 193 msg.str(""); 194 msg << "Setting fSendCounter to " << wrap; 195 Info(msg); 196 217 197 return true; 218 198 } … … 288 268 289 269 private: 270 void HandleReceivedData(const vector<uint8_t> &buf, size_t bytes_received, int command, int send_counter) 271 { 272 // Now print the received message if requested by the user 273 if (fIsVerbose/* && command!=kUpdate*/) 274 { 275 Out() << endl << kBold << dec << "Data received (size=" << bytes_received << "):" << endl; 276 Out() << " Command=" << command << " fWrapCounter=" << fWrapCounter << " fSendCounter=" << fSendCounter << " fIsInitializing=" << fIsInitializing << " fIsRamping=" << fIsRamping; 277 Out() << hex << setfill('0'); 278 279 for (size_t i=0; i<bytes_received/3; i++) 280 { 281 if (i%8==0) 282 Out() << '\n' << setw(2) << bytes_received/24 << "| "; 283 284 Out() << setw(2) << uint16_t(buf[i*3+2]); 285 Out() << setw(2) << uint16_t(buf[i*3+1]); 286 Out() << setw(2) << uint16_t(buf[i*3+0]) << " "; 287 } 288 Out() << endl; 289 } 290 291 const int cmd = command&0xf; 292 293 // Check the number of received_byted according to the answer expected 294 if ((cmd==kSynchronize && !CheckMessageLength(bytes_received, 3, "Synchronization")) || 295 (cmd==kCmdReset && !CheckMessageLength(bytes_received, 3, "CmdReset")) || 296 (cmd==kCmdRead && !CheckMessageLength(bytes_received, 3*kNumChannels, "CmdRead")) || 297 (cmd==kCmdChannelSet && !CheckMessageLength(bytes_received, 3*kNumChannels, "CmdChannelSet")) || 298 (cmd==kExpertChannelSet && !CheckMessageLength(bytes_received, 3, "CmdExpertChannelSet"))) 299 return; 300 301 // Now evaluate the whole bunch of messages 302 for (size_t i=0; i<bytes_received/3; i++) 303 { 304 if (!EvalAnswer(buf.data(), i, command)) 305 { 306 PostClose(false); 307 return; 308 } 309 } 310 311 if (command==kSynchronize) 312 { 313 Message("Stream successfully synchronized."); 314 fIsInitializing = false; 315 316 // Cancel sending of the next 0 317 fSyncTimer.cancel(); 318 319 // Start continous reading of all channels 320 ScheduleUpdate(100); 321 return; 322 } 323 324 if (send_counter%8 != fWrapCounter) 325 { 326 ostringstream msg; 327 msg << "Corrupted answer: received wrap counter " << fWrapCounter << " is not send counter " << send_counter << "%8."; 328 Error(msg); 329 PostClose(false); 330 } 331 332 333 // Take action depending on what is going on 334 if (command==kCmdReset) 335 Message("Reset command successfully answered."); 336 337 if (cmd==kCmdRead || cmd==kCmdChannelSet || cmd==kExpertChannelSet) 338 { 339 UpdateV(); 340 UpdateA(); 341 } 342 343 if (cmd==kCmdReset || command==kResetChannels) 344 { 345 // Re-start cyclic reading of values after a short time 346 // to allow the currents to become stable 347 fUpdateTimer.cancel(); 348 ScheduleUpdate(100); 349 } 350 351 if (command==kUpdate) 352 ScheduleUpdate(fUpdateTime); 353 354 // If we are ramping, schedule a new ramp step 355 if (command==kCmdChannelSet && fIsRamping) 356 { 357 ScheduleRampStep(); 358 return; 359 } 360 } 361 290 362 void HandleReceivedData(const bs::error_code& err, size_t bytes_received, int command, int send_counter) 291 363 { … … 319 391 } 320 392 321 // Now print the received message if requested by the user 322 if (fIsVerbose/* && command!=kUpdate*/) 323 { 324 Out() << endl << kBold << dec << "Data received (size=" << bytes_received << "):" << endl; 325 Out() << " Command=" << command << " fWrapCounter=" << fWrapCounter << " fSendCounter=" << fSendCounter << " fIsInitializing=" << fIsInitializing << " fIsRamping=" << fIsRamping << endl; 326 Out() << hex << setfill('0'); 327 328 vector<uint32_t> vout((bytes_received/3)*4); 329 330 for (size_t i=0; i<bytes_received/3; i++) 331 { 332 vout[i] = 333 (uint32_t(fBuffer[i*3+2])<<16) | 334 (uint32_t(fBuffer[i*3+1])<< 8) | 335 (uint32_t(fBuffer[i*3+0])<< 0); 336 337 Out() << setw(6) << vout[i] << " "; 338 if (i%8==7) 339 Out() << endl; 340 } 341 342 //Out() << Converter::GetHex<uint32_t>(vout, 16) << endl; 343 } 344 345 const int cmd = command&0xf; 346 347 // Check the number of received_byted according to the answer expected 348 if ((cmd==kSynchronize && !CheckMessageLength(bytes_received, 3, "Synchronization")) || 349 (cmd==kCmdReset && !CheckMessageLength(bytes_received, 3, "CmdReset")) || 350 (cmd==kCmdRead && !CheckMessageLength(bytes_received, 3*kNumChannels, "CmdRead")) || 351 (cmd==kCmdChannelSet && !CheckMessageLength(bytes_received, 3*kNumChannels, "CmdChannelSet")) || 352 (cmd==kExpertChannelSet && !CheckMessageLength(bytes_received, 3, "CmdExpertChannelSet"))) 353 return; 354 355 // Now evaluate the whole bunch of messages 356 for (size_t i=0; i<bytes_received/3; i++) 357 { 358 if (!EvalAnswer(fBuffer.data(), i, command)) 359 { 360 PostClose(false); 361 return; 362 } 363 } 364 365 // Now we are ready to send a new message 366 // fWaitingForAnswer = false; 367 368 if (command==kSynchronize) 369 { 370 Message("Stream successfully synchronized."); 371 fIsInitializing = false; 372 373 // Cancel sending of the next 0 374 fSyncTimer.cancel(); 375 376 // Start continous reading of all channels 377 ScheduleUpdate(100); 378 return; 379 } 380 381 if (send_counter%8 != fWrapCounter) 382 { 383 ostringstream msg; 384 msg << "Corrupted answer: received wrap counter " << fWrapCounter << " is not send counter " << send_counter << "%8."; 385 Error(msg); 386 PostClose(false); 387 } 388 389 390 // Take action depending on what is going on 391 if (command==kCmdReset) 392 Message("Reset command successfully answered."); 393 394 if (cmd==kCmdRead || cmd==kCmdChannelSet || cmd==kExpertChannelSet) 395 { 396 UpdateV(); 397 UpdateA(); 398 } 399 400 if (cmd==kCmdReset || command==kResetChannels) 401 { 402 // Re-start cyclic reading of values after a short time 403 // to allow the currents to become stable 404 fUpdateTimer.cancel(); 405 ScheduleUpdate(100); 406 } 407 408 if (command==kUpdate) 409 ScheduleUpdate(fUpdateTime); 410 411 // If we are ramping, schedule a new ramp step 412 if (command==kCmdChannelSet && fIsRamping) 413 { 414 ScheduleRampStep(); 393 // We have three different parallel streams: 394 // 1) The setting of voltages due to ramping 395 // 2) The cynclic request of the currents 396 // 3) Answers to commands 397 // For each of these three streams an own buffer is needed, otherwise 398 // a buffer which is filled in the background might overwrite 399 // a buffer which is currently evaluated. In all other programs 400 // this is no problem because the boards don't answer and if 401 // they do the answer identifies itself. Consequently, 402 // there is always only one async_read in progress. Here we have 403 // three streams which need to be connected somehow to the 404 // commands. 405 406 // Maybe a better possibility would be to setup a command 407 // queue (each command will be queued in a buffer) 408 // and whenever an answer has been received, a new async_read is 409 // scheduled. 410 // Build a command queue<pair<command, vector<char>>> 411 /// This replaces the send counter and the command argument 412 // in handleReceivedData 413 414 switch (command&0xff) 415 { 416 case kSynchronize: 417 case kCmdReset: 418 case kExpertChannelSet: 419 case kCmdGlobalSet: 420 case kResetChannels: 421 case kCmdRead: 422 HandleReceivedData(fBuffer, bytes_received, command, send_counter); 423 fWaitingForAnswer = false; 424 return; 425 426 case kCmdChannelSet: 427 HandleReceivedData(fBufferRamp, bytes_received, command, send_counter); 428 return; 429 430 case kUpdate: 431 HandleReceivedData(fBufferUpdate, bytes_received, command, send_counter); 415 432 return; 416 433 } … … 491 508 PostMessage("\0", 1); 492 509 AsyncRead(ba::buffer(fBuffer, 3), kSynchronize, 0);//++fSendCounter); 493 //fWaitingForAnswer = true;510 fWaitingForAnswer = true; 494 511 495 512 // Wait for some time before sending the next 0 … … 551 568 552 569 PostMessage(data); 553 AsyncRead(ba::buffer( fBuffer, kNumChannels*3),570 AsyncRead(ba::buffer(special ? fBuffer : fBufferRamp, kNumChannels*3), 554 571 special ? kResetChannels : kCmdChannelSet, fSendCounter); 555 // fWaitingForAnswer = true; 572 573 if (special) 574 fWaitingForAnswer = true; 556 575 } 557 576 … … 651 670 fUpdateTimer(ioservice), 652 671 fBuffer(3*kNumChannels), 672 fBufferRamp(3*kNumChannels), 673 fBufferUpdate(3*kNumChannels), 653 674 fIsVerbose(false), 654 675 fVoltCmd(kNumChannels), … … 658 679 fRampStep(-1), 659 680 fRampTime(-1), 681 fUpdateTime(3000), 660 682 fSyncTime(333), 661 fUpdateTime(3000),662 683 fIsRamping(false), 684 fWaitingForAnswer(false), 663 685 fVolt(kNumChannels), 664 686 fVoltRef(kNumChannels), … … 670 692 void OverCurrentReset() 671 693 { 694 if (fWaitingForAnswer) 695 { 696 Error("Answer on last command not yet received."); 697 return; 698 } 699 672 700 if (fIsRamping) 673 701 { … … 686 714 void ReadAllChannels(bool special = false) 687 715 { 716 if (!special && fWaitingForAnswer) 717 { 718 Error("Answer on last command not yet received."); 719 return; 720 } 721 688 722 vector<char> data; 689 723 data.reserve(kNumChannels*3); … … 698 732 699 733 PostMessage(data); 700 AsyncRead(ba::buffer( fBuffer, kNumChannels*3),734 AsyncRead(ba::buffer(special ? fBufferUpdate : fBuffer, kNumChannels*3), 701 735 special ? kUpdate : kCmdRead, fSendCounter); 702 // fWaitingForAnswer = true; 736 737 if (!special) 738 fWaitingForAnswer = true; 703 739 } 704 740 … … 824 860 void ExpertReset() 825 861 { 862 if (fWaitingForAnswer) 863 { 864 Error("Answer on last command not yet received."); 865 return; 866 } 867 826 868 Warn("EXPERT MODE: Sending reset."); 827 869 PostMessage(GetCmd(kCmdReset)); 828 AsyncRead(ba::buffer(fBuffer, 3), kCmdReset );829 //fWaitingForAnswer = true;870 AsyncRead(ba::buffer(fBuffer, 3), kCmdReset, ++fSendCounter); 871 fWaitingForAnswer = true; 830 872 } 831 873 … … 833 875 bool ExpertChannelSetDac(uint16_t ch, uint16_t dac) 834 876 { 877 if (fWaitingForAnswer) 878 { 879 Error("Answer on last command not yet received."); 880 return false; 881 } 882 835 883 if (!CheckChDac("ExpertChannelSetDac", dac, ch)) 836 884 return false; … … 844 892 PostMessage(GetCmd(kCmdChannelSet, ch, dac)); 845 893 AsyncRead(ba::buffer(fBuffer, 3), kExpertChannelSet|(ch<<8), ++fSendCounter); 846 //fWaitingForAnswer = true;894 fWaitingForAnswer = true; 847 895 848 896 return true; … … 856 904 bool ExpertGlobalSetDac(uint16_t dac) 857 905 { 906 if (fWaitingForAnswer) 907 { 908 Error("Answer on last command not yet received."); 909 return false; 910 } 911 858 912 if (!CheckChDac("ExpertGlobalSetDac", dac)) 859 913 return false; … … 873 927 PostMessage(GetCmd(kCmdGlobalSet, 0, dac)); 874 928 AsyncRead(ba::buffer(fBuffer, 3), kCmdGlobalSet, ++fSendCounter); 875 //fWaitingForAnswer = true;929 fWaitingForAnswer = true; 876 930 877 931 return true; … … 1042 1096 */ 1043 1097 1044 enum States_t 1045 { 1046 kDisconnected = StateMachineImp::kSM_UserMode, 1047 kConnecting, 1048 kInitializing, 1049 kConnected, 1050 kRamping, 1051 kOverCurrent, 1052 kAtReference, 1053 kExpertMode // 'forward' declaration to be used in StateMachineBias 1054 }; 1055 1056 int GetStatus() 1098 States_t GetStatus() 1057 1099 { 1058 1100 if (!IsConnected()) 1059 return kDisconnected;1101 return BIAS::kDisconnected; 1060 1102 1061 1103 if (IsConnecting()) 1062 return kConnecting;1104 return BIAS::kConnecting; 1063 1105 1064 1106 if (fIsInitializing) 1065 return kInitializing;1107 return BIAS::kInitializing; 1066 1108 1067 1109 if (fIsRamping) 1068 return kRamping;1110 return BIAS::kRamping; 1069 1111 1070 1112 for (int ch=0; ch<kNumChannels; ch++) 1071 1113 if (fPresent[ch/kNumChannelsPerBoard] && fCurrent[ch]<0) 1072 return kOverCurrent;1114 return BIAS::kOverCurrent; 1073 1115 1074 1116 for (int ch=0; ch<kNumChannels; ch++) 1075 1117 if (fPresent[ch/kNumChannelsPerBoard] && fVolt[ch]!=fVoltRef[ch]) 1076 return kConnected;1077 1078 return kAtReference;1118 return BIAS::kConnected; 1119 1120 return BIAS::kAtReference; 1079 1121 } 1080 1122 }; … … 1306 1348 poll_one(); 1307 1349 1308 return fExpertMode && fBias.GetStatus() ==ConnectionBias::kConnected ?1309 ConnectionBias::kExpertMode : fBias.GetStatus();1350 return fExpertMode && fBias.GetStatus()>=kConnected ? 1351 kExpertMode : fBias.GetStatus(); 1310 1352 } 1311 1353 … … 1323 1365 1324 1366 // State names 1325 T::AddStateName( ConnectionBias::kDisconnected, "Disconnected",1367 T::AddStateName(kDisconnected, "Disconnected", 1326 1368 "Bias-power supply not connected via USB."); 1327 1369 1328 T::AddStateName( ConnectionBias::kConnecting, "Connecting",1370 T::AddStateName(kConnecting, "Connecting", 1329 1371 "Trying to establish USB connection to bias-power supply."); 1330 1372 1331 T::AddStateName( ConnectionBias::kInitializing, "Initializing",1373 T::AddStateName(kInitializing, "Initializing", 1332 1374 "USB connection to bias-power supply established, synchronizing USB stream."); 1333 1375 1334 T::AddStateName( ConnectionBias::kConnected, "Connected",1376 T::AddStateName(kConnected, "Connected", 1335 1377 "USB connection to bias-power supply established."); 1336 1378 1337 T::AddStateName( ConnectionBias::kAtReference, "Referenced",1379 T::AddStateName(kAtReference, "Referenced", 1338 1380 "Internal reference voltage matches last sent voltage."); 1339 1381 1340 T::AddStateName( ConnectionBias::kOverCurrent, "OverCurrent",1382 T::AddStateName(kOverCurrent, "OverCurrent", 1341 1383 "At least one channel is in over current state."); 1342 1384 1343 T::AddStateName( ConnectionBias::kExpertMode, "ExpertMode",1385 T::AddStateName(kExpertMode, "ExpertMode", 1344 1386 "Special (risky!) mode to directly send command to the bias-power supply."); 1345 1387 1346 T::AddStateName( ConnectionBias::kRamping, "Ramping",1388 T::AddStateName(kRamping, "Ramping", 1347 1389 "Voltage ramping in progress."); 1348 1390 … … 1354 1396 1355 1397 // Conenction commands 1356 T::AddEvent("DISCONNECT", ConnectionBias::kConnected, ConnectionBias::kAtReference)1398 T::AddEvent("DISCONNECT", kConnected, kAtReference) 1357 1399 (bind(&StateMachineBias::Disconnect, this)) 1358 1400 ("disconnect from ethernet"); 1359 1401 1360 T::AddEvent("RECONNECT", "O", ConnectionBias::kDisconnected, ConnectionBias::kConnected, ConnectionBias::kAtReference)1402 T::AddEvent("RECONNECT", "O", kDisconnected, kConnected, kAtReference) 1361 1403 (bind(&StateMachineBias::Reconnect, this, placeholders::_1)) 1362 1404 ("(Re)connect ethernet connection to FTM, a new address can be given" … … 1365 1407 1366 1408 1367 T::AddEvent("REQUEST_STATUS", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1409 T::AddEvent("REQUEST_STATUS", kConnected, kAtReference, kOverCurrent) 1368 1410 (Wrapper(bind(&ConnectionBias::ReadAllChannels, &fBias, false))) 1369 1411 ("Asynchronously request the status (current) of all channels."); 1370 1412 1371 T::AddEvent("RESET_OVER_CURRENT_STATUS", ConnectionBias::kOverCurrent)1413 T::AddEvent("RESET_OVER_CURRENT_STATUS", kOverCurrent) 1372 1414 (Wrapper(bind(&ConnectionBias::OverCurrentReset, &fBias))) 1373 1415 ("NOT YET TESTED"); … … 1375 1417 1376 1418 1377 T::AddEvent("SET_GLOBAL_VOLTAGE", "F:1", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1419 T::AddEvent("SET_GLOBAL_VOLTAGE", "F:1", kConnected, kAtReference, kOverCurrent) 1378 1420 (bind(&StateMachineBias::SetGlobalVolt, this, placeholders::_1)) 1379 1421 ("Set all channels to a new reference voltage. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)"); 1380 1422 1381 T::AddEvent("SET_GLOBAL_DAC", "S:1", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1423 T::AddEvent("SET_GLOBAL_DAC", "S:1", kConnected, kAtReference, kOverCurrent) 1382 1424 (bind(&StateMachineBias::SetGlobalDac, this, placeholders::_1)) 1383 1425 ("Set all channels to a new DAC reference. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)"); 1384 1426 1385 T::AddEvent("SET_CHANNEL_VOLTAGE", "S:1;F:1", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1427 T::AddEvent("SET_CHANNEL_VOLTAGE", "S:1;F:1", kConnected, kAtReference, kOverCurrent) 1386 1428 (bind(&StateMachineBias::SetChannelVolt, this, placeholders::_1)) 1387 1429 ("Set a single channel a new reference voltage. Starts ramping if necessary."); 1388 1430 1389 T::AddEvent("SET_CHANNEL_DAC", "S:1;S:1", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1431 T::AddEvent("SET_CHANNEL_DAC", "S:1;S:1", kConnected, kAtReference, kOverCurrent) 1390 1432 (bind(&StateMachineBias::SetChannelDac, this, placeholders::_1)) 1391 1433 ("Set a single channel a new DAC reference value. Starts ramping if necessary."); 1392 1434 1393 T::AddEvent("SET_GAPD_REFERENCE_VOLTAGE", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1435 T::AddEvent("SET_GAPD_REFERENCE_VOLTAGE", kConnected, kAtReference, kOverCurrent) 1394 1436 (Wrapper(bind(&ConnectionBias::SetGapdVoltage, &fBias))) 1395 1437 ("Set all channels to their G-APD reference voltage. Starts ramping if necessary."); 1396 1438 1397 T::AddEvent("SET_ZERO_VOLTAGE", ConnectionBias::kConnected, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1439 T::AddEvent("SET_ZERO_VOLTAGE", kConnected, kAtReference, kOverCurrent) 1398 1440 (Wrapper(bind(&ConnectionBias::SetZero, &fBias))) 1399 1441 ("Set all channels to a zero reference voltage. Starts ramping if necessary."); … … 1401 1443 1402 1444 1403 T::AddEvent("STOP", ConnectionBias::kConnected, ConnectionBias::kRamping, ConnectionBias::kAtReference, ConnectionBias::kOverCurrent)1445 T::AddEvent("STOP", kConnected, kRamping, kAtReference, kOverCurrent) 1404 1446 (Wrapper(bind(&ConnectionBias::RampStop, &fBias))) 1405 1447 (""); 1406 1448 1407 T::AddEvent("START", ConnectionBias::kConnected, ConnectionBias::kOverCurrent)1449 T::AddEvent("START", kConnected, kOverCurrent) 1408 1450 (Wrapper(bind(&ConnectionBias::RampStart, &fBias))) 1409 1451 (""); … … 1426 1468 ("Enable usage of expert commands (note that for safty reasons the are exclusive with the standard commands)"); 1427 1469 1428 T::AddEvent("EXPERT_RESET", ConnectionBias::kExpertMode)1470 T::AddEvent("EXPERT_RESET", kExpertMode) 1429 1471 (Wrapper(bind(&ConnectionBias::ExpertReset, &fBias))) 1430 1472 ("Send the RESET command (note that this is possibly harmfull command)"); 1431 1473 1432 T::AddEvent("EXPERT_SET_GLOBAL_VOLTAGE", "F:1", ConnectionBias::kExpertMode)1474 T::AddEvent("EXPERT_SET_GLOBAL_VOLTAGE", "F:1", kExpertMode) 1433 1475 (bind(&StateMachineBias::ExpertSetGlobalVolt, this, placeholders::_1)) 1434 1476 ("Send the global set command. The given voltage is converted to DAC counts."); 1435 1477 1436 T::AddEvent("EXPERT_SET_GLOBAL_DAC", "S:1", ConnectionBias::kExpertMode)1478 T::AddEvent("EXPERT_SET_GLOBAL_DAC", "S:1", kExpertMode) 1437 1479 (bind(&StateMachineBias::ExpertSetGlobalDac, this, placeholders::_1)) 1438 1480 ("Send the global set command."); 1439 1481 1440 T::AddEvent("EXPERT_SET_CHANNEL_VOLTAGE", "S:1;F:1", ConnectionBias::kExpertMode)1482 T::AddEvent("EXPERT_SET_CHANNEL_VOLTAGE", "S:1;F:1", kExpertMode) 1441 1483 (bind(&StateMachineBias::ExpertSetChannelVolt, this, placeholders::_1)) 1442 1484 ("Send a single channel set command. The given voltage is converted to DAC commands."); 1443 1485 1444 T::AddEvent("EXPERT_SET_CHANNEL_DAC", "S:1;S:1", ConnectionBias::kExpertMode)1486 T::AddEvent("EXPERT_SET_CHANNEL_DAC", "S:1;S:1", kExpertMode) 1445 1487 (bind(&StateMachineBias::ExpertSetChannelDac, this, placeholders::_1)) 1446 1488 ("Send a single channel set command."); … … 1494 1536 int l = 0; 1495 1537 1496 vector<float> vec( ConnectionBias::kNumChannels);1538 vector<float> vec(kNumChannels); 1497 1539 1498 1540 string buf; … … 1517 1559 str >> fdummy >> fdummy >> fdummy; 1518 1560 1519 if (channel+32*board>= ConnectionBias::kNumChannels)1561 if (channel+32*board>=kNumChannels) 1520 1562 { 1521 1563 T::Error("Invalid board/channel read from FACTmapV5.txt.");
Note:
See TracChangeset
for help on using the changeset viewer.