Changeset 11205


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

Legend:

Unmodified
Added
Removed
  • fact/BIASctrl/BIASctrl.cc

    r10153 r11205  
    2929  siginterrupt(SIGTERM, true);
    3030
    31   system("clear");                   
     31  if (system("clear") == -1) printf("Error with system() call\n");
     32                   
    3233  printf("\n*** BIASctrl (compiled %s, %s) ***\n\n", __DATE__, __TIME__);
    3334   
  • fact/BIASctrl/Crate.cc

    r10905 r11205  
    134134        FD_ZERO(&SelectDescriptor);   FD_SET(fDescriptor, &SelectDescriptor);
    135135        if (select(fDescriptor+1, &SelectDescriptor, NULL, NULL, &WaitTime)==-1) {
    136           if (errno = EINTR) goto ExitCommunicate;  // in case program is exiting
     136          if (errno == EINTR) goto ExitCommunicate;  // in case program is exiting
    137137      m->Message(m->FATAL, "Error with select() (%s)", strerror(errno));
    138138        }
  • fact/BIASctrl/History.txt

    r10905 r11205  
    1212                        Added 'crate' command. Changed signaling of program exit.
    13133/6/2011        Fixed bug in channel addressing from board numbers above 7.
     1428/6/2011       Adapted for compilation under ubuntu
  • fact/BIASctrl/Makefile

    r10049 r11205  
    66
    77CPPFLAGS = -O3 -Wall $(INCDIRS)
    8 LDLIBS = -L/usr/lib/termcap -lstdc++ -lpthread -lfl -lreadline -ltermcap $(DIMDIR)/linux/libdim.a
     8LDLIBS = -L/usr/lib/termcap -lstdc++ -lpthread -lreadline -ltermcap $(DIMDIR)/linux/libdim.a
    99
    1010BIASctrl: $(OBJECTS)
  • fact/BIASctrl/User.cc

    r10153 r11205  
    114114  // Shell command
    115115  if(Command[0]=='.') {
    116     system(Command.c_str()+1);
     116    if (system(Command.c_str()+1) == 1) {
     117          PrintMessage("Error with system() call\n");
     118        }
    117119    return;
    118120  }
     
    620622bool User::ConvertToRange(string String, struct User::Range &R) {
    621623
    622   int N, M;
     624  int N=0, M=0; // Init to avoid compiler warning
    623625
    624626  // Full range
  • fact/Evidence/DColl.cc

    r253 r11205  
    260260        struct tm *TM = localtime(&RawTime);
    261261
    262         fprintf(DataFile, "%s %d %d %d %d %d %d %d %d %lu ", I->getName(), I->getQuality(), TM->tm_year+1900, TM->tm_mon+1, TM->tm_mday, TM->tm_hour, TM->tm_min, TM->tm_sec, I->getTimestampMillisecs(), I->getTimestamp());
     262        fprintf(DataFile, "%s %d %d %d %d %d %d %d %d %d ", I->getName(), I->getQuality(), TM->tm_year+1900, TM->tm_mon+1, TM->tm_mday, TM->tm_hour, TM->tm_min, TM->tm_sec, I->getTimestampMillisecs(), I->getTimestamp());
    263263
    264264        // Translate data into ASCII
  • 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
  • fact/Feedback/Feedback.cc

    r10118 r11205  
    224224
    225225  // Calculate average signal 
    226   for (unsigned int i=0; i<Parameter.size()-1, i<fIDTable.size(); i++) {
     226  for (unsigned int i=0; i<Parameter.size()-1 && i<fIDTable.size(); i++) {
    227227        Average[i] += atof(Parameter[i+1].c_str());
    228228        Sigma[i] += pow(atof(Parameter[i+1].c_str()), 2);
     
    465465  char *Command;
    466466
    467   system("clear");
     467  if (system("clear") == -1) printf("Error with system() call\n");
    468468  printf("\n*** Bias feedback (built %s, %s, revision %s) *** \n\n",__DATE__, __TIME__, REVISION);
    469469
  • fact/Feedback/Makefile

    r10118 r11205  
    1212
    1313CPPFLAGS = -DREVISION='"$(REVISION)"' -O3 -Wall
    14 LIBS = -L /usr/lib/termcap -lstdc++ -lz -lpthread -lutil -lfl -lreadline -ltermcap $(DIMDIR)/linux/libdim.a
     14LIBS = -L /usr/lib/termcap -lstdc++ -lz -lpthread -lutil -lreadline -ltermcap $(DIMDIR)/linux/libdim.a
    1515
    1616Feedback: $(OBJECTS)
Note: See TracChangeset for help on using the changeset viewer.