Changeset 10077


Ignore:
Timestamp:
Jan 5, 2011, 11:30:12 AM (10 years ago)
Author:
neise
Message:
choose sock0 or sock1..7 via soc command - see help
Location:
fact/FADctrl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.cc

    r10036 r10077  
    3939   {"cancel", &FAD::cmd_cancel, false, 0, "", "Cancel current operation"},
    4040   {"update", &FAD::cmd_update, false, 1, "<sec>", "Minimum delay between updates to DIM event service"},                 
     41         {"socketmode", &FAD::cmd_socketmode, true, 1, "<com|daq>", "Choose which Sockets are used for data transmission"},               
    4142   {"exit", &FAD::cmd_exit, true, 0, "", "Exit program"},
    4243   {"help", &FAD::cmd_help, false, 0, "", "Print help"}};
     
    6970
    7071  // Construct boards
    71   BoardList = Tokenize(GetConfig("BoardList","192.33.99.225"));
     72 
     73        // ETHZ
     74        //BoardList = Tokenize(GetConfig("BoardList","192.33.99.225"));
     75        // TUDO
     76        BoardList = Tokenize(GetConfig("BoardList","129.217.160.119"));
    7277
    7378  for (unsigned int i=0; i<BoardList.size(); i++) {
     
    190195  else PrintUsage();
    191196}
     197
     198//
     199// Switch which sockets are used to send data away
     200// case parameter is: "com" - command mode is enabled.
     201//      thus only socket 0 is used
     202// case parameter is: "daq" - daq mode is enabled
     203//      thus only sockets 1 - 7 are used.
     204//
     205//      note: socket 0 is always used to issue commands
     206//
     207void FAD::cmd_socketmode() {
     208
     209  for (unsigned int i=0; i<Boards.size(); i++) {
     210        if (Match(Parameter[1],"com")) Boards[i]->Send(CMD_Stop);
     211        else if (Match(Parameter[1],"daq")) Boards[i]->Send(CMD_Start);
     212  }
     213
     214  if (Match(Parameter[1],"com")) PrintMessage("all active boards switched to command mode - socket 0\n");
     215  else if (Match(Parameter[1],"daq")) PrintMessage("all active boards switched to DAQ mode - socket 1..7\n");
     216  else PrintUsage();
     217}
     218
    192219
    193220//
  • fact/FADctrl/FAD.h

    r10036 r10077  
    6666    void cmd_board();           void cmd_status();
    6767    void cmd_acalib();          void cmd_serial();
    68     void cmd_trigger();
     68    void cmd_trigger();         void cmd_socketmode();
    6969        void cmd_srclk();               void cmd_sclk();
    7070        void cmd_dwrite();              void cmd_domino();
  • fact/FADctrl/FADctrl.cc

    r10036 r10077  
    116116void OpenOtherSockets() {
    117117
    118   static char Hostname[] = "192.33.99.225";
     118        //ETHZ
     119  //static char Hostname[] = "192.33.99.225";
     120        //TUDO
     121        static char Hostname[] = "129.217.160.119";
    119122  int List[] = {5001, 5002, 5003, 5004, 5005, 5006, 5007};
    120123  int Socket[sizeof(List)/sizeof(int)], MaxSocketNum=0, Ret;
Note: See TracChangeset for help on using the changeset viewer.