Changeset 1462 in Sophya


Ignore:
Timestamp:
Apr 10, 2001, 6:35:25 PM (24 years ago)
Author:
cmv
Message:

changement getData... intermediaire NE COMPILE PAS cmv+rz 10/4/2001

Location:
trunk/ArchTOIPipe
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/asciitoiwtr.cc

    r1370 r1462  
    3939  int sne = getMaxIn();
    4040
     41  double val;
     42  int_4 flg;
    4143  for (int sn = snb; sn <= sne; sn++) {
    4244    s << sn << "   ";
    4345    for (int i=0; i<ncols; i++) {
    44       double x = getData(i, sn);
    45       s << x << "   ";
    46       if (outFlags) {
    47         int_4 f = getFlag(i, sn);
    48         s << f << "   ";
    49       }
     46      getData(i, sn, val, flg);
     47      s << val << "   ";
     48      if (outFlags)
     49        s << flg << "   ";
    5050    }
    5151    s << '\n';
  • trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc

    r1442 r1462  
    115115    //  cout << " DBG-A-FitsWriter::run()" << sn << endl;
    116116    try {
     117      int_4 out_flg;
     118      double out_val;
    117119      for (i=0; i<ndata; i++) {
    118120        if (tabck[i]) {
    119           tabdata[i] = getData(i, sn);
    120           if (outFlags) tabflag[i] = getFlag(i, sn);
     121          getData(i,sn, out_val, out_flg);
     122          tabdata[i] = out_val;
     123          if (outFlags) tabflag[i] = out_flg;
    121124        }
    122125      }
  • trunk/ArchTOIPipe/Kernel/toi.cc

    r1437 r1462  
    8080#endif
    8181
     82/*RZCMV
    8283double TOI::getError(int i) {
    8384  if (errorTOI == NULL) throw NotFoundExc("TOI::getDataError : no Error TOI");
     
    9192}
    9293
     94*/
     95
    9396#ifndef NO_SOPHYA
    9497Array TOI::getData(int iStart, int iEnd) {
     
    103106double TOI::getData(int i) {
    104107  lock();
    105   double dat = doGetData(i);
     108  int_4 flg;
     109  double dat;
     110  doGetData(i, dat, flg);
    106111  unlock();
    107112  if (fgsigput) { fgsigput = false; broadcast(); }
     
    109114}
    110115
     116void TOI::getData(int i, double &data,int_4 &flag) {
     117  lock();
     118  doGetData(i, data, flag);
     119  unlock();
     120  if (fgsigput) { fgsigput = false; broadcast(); }
     121  return;
     122}
     123
     124
    111125
    112126#ifndef NO_SOPHYA
     
    120134#endif
    121135
    122 int_4 TOI::getFlag(int i) {
    123   lock();
    124   int_4 f = doGetFlag(i);
    125   unlock();
    126   if (fgsigput) { fgsigput = false; broadcast(); }
    127   return f;
    128 }
    129136 
    130137 
     
    249256#endif
    250257
    251 double TOIRegularWindow::doGetData(int i) {
     258void TOIRegularWindow::doGetData(int i, double & val, int_4 & flg) {
    252259  if (isDataAvailNL(i) != DATA_OK) {
    253260    cerr << "TOI::getData : data not available " << i << endl;
    254261    throw RangeCheckError("TOI::getData : data not available");
    255262  }
    256   double dat = data[i - i0];
    257   return dat;
     263
     264  val = data[i - i0];
     265  flg = flags[i - i0];
     266
    258267}
    259268
     
    271280#endif
    272281
     282/*RZCMV
    273283int_4 TOIRegularWindow::doGetFlag(int i) {
    274284  if (isDataAvailNL(i) != DATA_OK) {
     
    278288  return flags[i - i0];
    279289}
     290*/
    280291
    281292
  • trunk/ArchTOIPipe/Kernel/toi.h

    r1437 r1462  
    3232
    3333#ifdef WITH_SOPHYA
     34  // l'interface va etre modifiee, NE PAS UTILISER
    3435  virtual Array         getData(int iStart, int iEnd);
    3536  virtual Array         getError(int iStart, int iEnd);
    3637  virtual TArray<int_4> getFlag(int iStart, int iEnd);
     38  // l'interface va etre modifiee, NE PAS UTILISER
    3739#endif
     40
     41  enum DataStatus       {DATA_OK=0, DATA_DELETED, DATA_NOT_YET};
    3842   
    3943  virtual double        getData(int i);
    40   virtual double        getError(int i);
    41   virtual int_4         getFlag(int i);
     44  virtual void          getData(int i,double &data,int_4 &flag);
     45  //RZCMV  virtual DataStatus    getDataError(int i,double &data,double &error,int_4 &flag);
    4246
    43   enum DataStatus       {DATA_OK=0, DATA_DELETED, DATA_NOT_YET};
    4447  virtual DataStatus    isDataAvail(int iStart, int iEnd);
    4548  virtual DataStatus    isDataAvail(int i);
     
    5154 
    5255  virtual void          putData(int i, double value, int_4 flag=0);
    53   virtual void          putDataError(int i, double value,
    54                                      double error, int_4 flag=0);
     56  //RZCMV  virtual void          putDataError(int i, double value,
     57  //                                 double error, int_4 flag=0);
    5558
    5659  virtual void          wontNeedBefore(int i);
     
    8285  virtual TArray<int_4> doGetFlag(int iStart, int iEnd)=0;
    8386#endif
    84   virtual double        doGetData(int i)=0;
    85   virtual int_4         doGetFlag(int i)=0;
     87  virtual void          doGetData(int i, double& data, int_4& flag)=0;
    8688  virtual void          doPutData(int i, double value, int_4 flag=0)=0;
    8789  virtual void          doWontNeedBefore(int i);
     
    156158  virtual TArray<int_4> doGetFlag(int iStart, int iEnd);
    157159#endif
    158   virtual double        doGetData(int i);
    159   virtual int_4         doGetFlag(int i);
     160  virtual void          doGetData(int i, double & val, int_4 & flg);
    160161   
    161162  virtual void          doPutData(int i, double value, int_4 flag=0);
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r1439 r1462  
    284284}
    285285
     286void  TOIProcessor::getData(int toiIndex, int i, double &data,int_4 &flag)
     287{
     288  TOI* toi = getInputTOI(toiIndex);
     289  toi->waitForData(i);
     290  toi->getData(i, data, flag);
     291  return;
     292}
     293
     294/*RZCMV
    286295double TOIProcessor::getError(int toiIndex, int i) {
    287296  TOI* toi = getInputTOI(toiIndex);
     
    295304  return toi->getFlag(i);
    296305}
     306*/
    297307
    298308void TOIProcessor::setNeededHistory(int nsamples) {
     
    334344}
    335345
    336 
     346/*RZCMV
    337347void TOIProcessor::putDataError(int toiIndex, int i, double value,
    338348                                double error, int_4 flg) {
     
    344354  notify();
    345355}
    346 
    347 
     356*/
     357
  • trunk/ArchTOIPipe/Kernel/toiprocessor.h

    r1443 r1462  
    5252  // utilisees que sur des entrees simples
    5353  double        getData(int toiIndex, int i);
    54   double        getError(int toiIndex, int i);
    55   int_4         getFlag(int toiIndex, int i);
     54  void          getData(int toiIndex, int i, double &data,int_4 &flag);
     55 
     56  //RZCMV  double        getError(int toiIndex, int i);
     57  //RZCMV  int_4         getFlag(int toiIndex, int i);
    5658
    5759  void          wontNeedBefore(int i);
     
    6062
    6163  void          putData(int toiIndex, int i, double value, int_4 flag=0);
    62   void          putDataError(int toiIndex, int i, double value,
    63                              double error, int_4 flag=0);
     64  //RZCMV  void          putDataError(int toiIndex, int i, double value,
     65  //RZCMV                            double error, int_4 flag=0);
    6466
    6567  // Gestion des bornes pour les transformations de TOIs...
  • trunk/ArchTOIPipe/Kernel/toiseqbuff.cc

    r1442 r1462  
    9696#endif
    9797
    98 double TOISeqBuffered::doGetData(int i) {
     98void TOISeqBuffered::doGetData(int i, double & val, int_4 & flg) {
    9999  if (!started) {
    100100    cout << " TOISeqBuffered::doGetData() - waitGet() Waiting for start ... " << endl;
     
    121121  }
    122122  cleanWaitGet();
    123   double dat = dataRef(i);
     123  val = dataRef(i);
     124  flg = flagRef(i);
    124125  if (first_out < 0)  first_out = i;
    125126  if ((i+1) > next_out)  next_out = i+1;
     
    131132    signalPut();
    132133  }
    133   return dat;
     134  return;
    134135}
    135136
     
    149150#endif
    150151
     152/*RZCMV
    151153int_4 TOISeqBuffered::doGetFlag(int i) {
    152154  if (!started) waitGet();
     
    158160  return dat;
    159161}
     162*/
    160163
    161164
  • trunk/ArchTOIPipe/Kernel/toiseqbuff.h

    r1442 r1462  
    4747  virtual TArray<int_4> doGetFlag(int iStart, int iEnd);
    4848#endif
    49   virtual double        doGetData(int i);
    50   virtual int_4         doGetFlag(int i);
     49  virtual void          doGetData(int i, double & val, int_4 & flg);
    5150   
    5251  virtual void          doPutData(int i, double value, int_4 flag=0);
  • trunk/ArchTOIPipe/ProcWSophya/rztoi.cc

    r1443 r1462  
     1#include "array.h"
    12#include "rztoi.h"
    23#include "toimanager.h"
  • trunk/ArchTOIPipe/ProcWSophya/simtoipr.cc

    r1454 r1462  
     1#include "array.h"
    12#include "simtoipr.h"
    23#include <math.h>
  • trunk/ArchTOIPipe/SMakefile

    r1442 r1462  
    1 USERFLAGS = -I$(EXTLIBDIR)/Include/FitsIO -DWITH_SOPHYA
     1# USERFLAGS = -I$(EXTLIBDIR)/Include/FitsIO -DWITH_SOPHYA
     2USERFLAGS = -I$(EXTLIBDIR)/Include/FitsIO
    23include $(DPCBASEREP)/Include/MakefileUser.h
    3  
    4 ALIB := ./Objs/
    5 AOBJ := ./Objs/
     4
     5ALIB := ./$(MACHDIR)/
     6AOBJ := ./$(MACHDIR)/
    67
    78$(AOBJ)%.o:%.cc
    8         $(COMPILE.cc)   $(USERFLAGS) -o $@ $<
     9        $(COMPILE.cc) $(USERFLAGS) -o $@ $<
    910$(AOBJ)%.o:%.c
    10         $(COMPILE.c) -c $(CFLAGS) $(USERFLAGS) -o $@ $<
     11        $(COMPILE.c) $(CFLAGS) $(USERFLAGS) -o $@ $<
    1112
    12 LIBOLIST := $(AOBJ)asciitoiwtr.o $(AOBJ)fitstoirdr.o $(AOBJ)fitstoiwtr.o $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)toisqfilter.o \
    13 $(AOBJ)toiseqbuff.o $(AOBJ)simtoipr.o
    14 EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o
    15 EXELIST := $(AOBJ)simtst $(AOBJ)tstrztoi $(AOBJ)fits2asc $(AOBJ)tsttoi $(AOBJ)tsttoi2
     13LIBOLIST := $(AOBJ)asciitoiwtr.o $(AOBJ)fitstoirdr.o $(AOBJ)fitstoiwtr.o \
     14            $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o \
     15            $(AOBJ)toisqfilter.o $(AOBJ)toiseqbuff.o $(AOBJ)simtoipr.o \
     16            $(AOBJ)map2toi.o $(AOBJ)toi2map.o
     17EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o $(AOBJ)simtst.o \
     18            $(AOBJ)tstrztoi.o $(AOBJ)rztoi.o \
     19            $(AOBJ)fits2ascii.o $(AOBJ)tstmap2toi.o $(AOBJ)tsttoi2map.o
     20EXELIST := $(AOBJ)simtst $(AOBJ)tstrztoi $(AOBJ)fits2asc $(AOBJ)tsttoi \
     21           $(AOBJ)tsttoi2 $(AOBJ)fits2ascii $(AOBJ)tstmap2toi $(AOBJ)tsttoi2map
    1622
    1723INCLIST := asciitoiwtr.h fitstoirdr.h fitstoiwtr.h toi.h config.h conf.h \
    18  toiprocessor.h toimanager.h toiseqbuff.h simtoipr.h
    19 
     24           toiprocessor.h toimanager.h toiseqbuff.h simtoipr.h map2toi.h toi2map.h
    2025
    2126all : $(EXELIST)
     27lib : $(LIBOLIST)
    2228
    2329clean:
     
    2531        rm -f  $(EXEOLIST)
    2632        rm -f  $(EXELIST)
    27 #       rm -f $(AOBJ)asciitoiwtr.o $(AOBJ)fitstoirdr.o $(AOBJ)fitstoiwtr.o $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)toisqfilter.o $(AOBJ)tsttoi.o
    2833
    2934LIBF =  $(SLB)libsophya.so $(SLB)libextsophya.so
    30 LIBS = -L$(SLB) -lextsophya -lsophya -lpthread -lm
     35LIBS =  -L$(SLB) -lextsophya -lsophya -lpthread -lm
    3136ifeq ($(MACHEROS),OSF1)
    3237LIBS := $(LIBS) -lfor
     
    4449$(AOBJ)tsttoi2: $(AOBJ)tsttoi2.o $(LIBOLIST)
    4550        $(LINK.cc)  -o $@ $^ $(LIBS)
     51$(AOBJ)fits2ascii: $(AOBJ)fits2ascii.o $(LIBOLIST)
     52        $(LINK.cc)  -o $@ $^ $(LIBS)
     53$(AOBJ)tstmap2toi: $(AOBJ)tstmap2toi.o $(LIBOLIST)
     54        $(LINK.cc)  -o $@ $^ $(LIBS)
     55$(AOBJ)tsttoi2map: $(AOBJ)tsttoi2map.o $(LIBOLIST)
     56        $(LINK.cc)  -o $@ $^ $(LIBS)
    4657
    4758$(AOBJ)tstrztoi.o: tstrztoi.cc rztoi.h $(INCLIST)
     
    5061$(AOBJ)tsttoi.o: tsttoi.cc $(INCLIST)
    5162$(AOBJ)tsttoi2.o: tsttoi2.cc $(INCLIST)
     63$(AOBJ)fits2ascii.o: fits2ascii.cc $(INCLIST)
     64$(AOBJ)tstmap2toi.o: tstmap2toi.cc $(INCLIST)
     65$(AOBJ)tsttoi2toi.o: tsttoi2map.cc $(INCLIST)
    5266
    53  
    5467$(AOBJ)asciitoiwtr.o: asciitoiwtr.cc asciitoiwtr.h toi.h config.h conf.h \
    55  toiprocessor.h toimanager.h
     68                      toiprocessor.h toimanager.h
    5669$(AOBJ)fitstoirdr.o: fitstoirdr.cc fitstoirdr.h toiprocessor.h config.h conf.h
    5770$(AOBJ)fitstoiwtr.o: fitstoiwtr.cc fitstoiwtr.h toi.h config.h conf.h
     
    5972$(AOBJ)toimanager.o: toimanager.cc toimanager.h
    6073$(AOBJ)toiprocessor.o: toiprocessor.cc toiprocessor.h config.h conf.h toi.h \
    61  toimanager.h
     74                       toimanager.h
    6275$(AOBJ)toisqfilter.o: toisqfilter.cc toisqfilter.h toiprocessor.h config.h \
    63  conf.h toi.h toimanager.h
     76                      conf.h toi.h toimanager.h
    6477$(AOBJ)toiseqbuff.o: toiseqbuff.cc toiprocessor.h config.h conf.h toi.h \
    65 toiseqbuff.h
     78                     toiseqbuff.h
    6679$(AOBJ)simtoipr.o: simtoipr.cc toiprocessor.h config.h conf.h toi.h \
    67 simtoipr.h
     80                   simtoipr.h
     81$(AOBJ)map2toi.o: map2toi.cc map2toi.h
     82$(AOBJ)toi2map.o: toi2map.cc toi2map.h
  • trunk/ArchTOIPipe/TestPipes/fits2asc.cc

    r1437 r1462  
     1#include "machdefs.h"
    12#include "toi.h"
    23#include "toiprocessor.h"
     
    1314
    1415
    15   int n = r.getNOut();
    16   for (int i=0; i<n; i++) {
     16  int ncol = r.getNOut();
     17  for (int i=0; i<ncol; i++) {
    1718    TOI* toi = new TOIRegularWindow("t1");
    1819    string n = r.getOutName(i);
  • trunk/ArchTOIPipe/TestPipes/simtst.cc

    r1454 r1462  
     1#include "machdefs.h"
     2#include "array.h"
    13#include <unistd.h>
    24#include <stdexcept>
  • trunk/ArchTOIPipe/TestPipes/tstrztoi.cc

    r1442 r1462  
     1#include "machdefs.h"
     2#include "array.h"
    13#include <unistd.h>
    24#include <stdexcept>
Note: See TracChangeset for help on using the changeset viewer.