Changeset 10504 for fact/FADctrl/FAD.cc


Ignore:
Timestamp:
05/02/11 14:56:49 (10 years ago)
Author:
neise
Message:
supports new FAD event format:
setting runnumber
resetting internat trigger ID
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.cc

    r10291 r10504  
    2828   {"sclk", &FAD::cmd_sclk, true, 1, "<on|off>", "Set SCLK"},
    2929   {"trigger", &FAD::cmd_trigger, false, 0, "[n|cont [rate]|stop|enable|disable]", "Issue software triggers"},
     30   {"reset_trigger", &FAD::cmd_reset_trigger, false, 0, "resets the internal trigger counter"},
     31   {"set_runnumber", &FAD::cmd_set_runnumber, false, 1, "<n> sets runnumber"},
    3032   {"roi", &FAD::cmd_roi, true, 2, "<channel range> <value>", "Set region-of-interest to value"},
    3133   {"dac", &FAD::cmd_dac, true, 2, "<range> <value>", "Set DAC numbers in range to value"},
     
    195197}
    196198
     199void FAD::cmd_reset_trigger() {
     200  for (unsigned int i=0; i<Boards.size(); i++) {
     201        Boards[i]->Send(CMD_RESET_TRIGGER_ID);
     202  }
     203}
     204
     205
     206void FAD::cmd_set_runnumber() {
     207  int Num;
     208
     209  if (Parameter.size() == 2) {
     210                ConvertToInt(Parameter[1], &Num);
     211          for (unsigned int i=0; i<Boards.size(); i++) {
     212                        Boards[i]->Send( CMD_Write | ADDR_RUNNUMBER );
     213                        Boards[i]->Send((unsigned short) Num>>16);              // Write the HIGH-word first
     214                        Boards[i]->Send( CMD_Write | (ADDR_RUNNUMBER+1) );
     215                        Boards[i]->Send((unsigned short) (Num>>16)<<16); // now write the LOW-word
     216                }
     217        }
     218        else {
     219          PrintUsage();
     220          return;
     221        }
     222}
     223 
     224
    197225//
    198226// Switch socket mode
Note: See TracChangeset for help on using the changeset viewer.