Changeset 11205 for fact/FADctrl


Ignore:
Timestamp:
06/28/11 14:28:46 (13 years ago)
Author:
ogrimm
Message:
Adaptions to allow compilation on Ubuntu
Location:
fact/FADctrl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.cc

    r11087 r11205  
    138138  // Shell command
    139139  if (*Command == '.') {
    140     system(Command+1);
     140    if (system(Command+1) == -1) PrintMessage("Error with system() call\n");
    141141    return;
    142142  }
     
    12161216bool FAD::ConvertToRange(string String, struct FAD::Range &R) {
    12171217
    1218   int N, M;
     1218  int N=0, M=0;
    12191219
    12201220  // Full range
  • fact/FADctrl/FAD.h

    r10980 r11205  
    1616#include <dirent.h>
    1717#include <sys/time.h>
     18#include <sys/stat.h>
    1819#include <limits>
    1920#include <fcntl.h>
  • fact/FADctrl/FADBoard.cc

    r11204 r11205  
    513513          for (unsigned int i=0; i<NDAC; i++) Status.DAC[i] = ntohs(Header->dac[i]);
    514514
    515           short Buf;
    516515          for (unsigned int Chip=0; Chip<NChips; Chip++) {
    517516                // Extract trigger cells         
     
    522521                  Status.ROI[Chip][Chan] = ntohs(Channel[Chip+NChips*Chan]->roi);
    523522
    524                   // Extract ADC data (stored in 12 bit signed twis complement with out-of-range-bit and leading zeroes)
    525                   for (int i=0; i<Status.ROI[Chip][Chan]; i++) {
    526                           Buf = (Channel[Chip+NChips*Chan]->adc_data[i]);
    527                           (Buf <<= 4) >>= 4;                    //delete the sign-bit by shifting left and shift back
    528                           Data[Chip][Chan][i] = Buf;                                   
     523                  // Extract ADC data (stored as signed short)
     524                  // FADs ADC is 12 bit (values -2048 .. 2047)
     525                  // negative/positive overflow is -2049 / +2048
     526                  for (int i=0; i<Status.ROI[Chip][Chan]; i++) {                         
     527                        Data[Chip][Chan][i] = Channel[Chip+NChips*Chan]->adc_data[i];
    529528                  }
    530529                }
  • fact/FADctrl/FADctrl.cc

    r10813 r11205  
    2828  read_history(READLINE_HIST_FILE.c_str());
    2929
    30   system("clear");
     30  if (system("clear") == -1) {
     31        printf("Error with system() call\n");
     32  }
    3133  printf("\n*** FADctrl (built %s, %s, revision %s) *** \n\n",__DATE__, __TIME__, REVISION);
    3234
Note: See TracChangeset for help on using the changeset viewer.