Changeset 2448 in Sophya for trunk/ArchTOIPipe/Kernel


Ignore:
Timestamp:
Oct 13, 2003, 10:48:37 PM (22 years ago)
Author:
aubourg
Message:

pb long/int

Location:
trunk/ArchTOIPipe/Kernel
Files:
9 edited

Legend:

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

    r2370 r2448  
    22//                               Christophe Magneville
    33//                               Reza Ansari
    4 // $Id: fitsringrdr.cc,v 1.6 2003-04-24 13:29:38 aubourg Exp $
     4// $Id: fitsringrdr.cc,v 1.7 2003-10-13 20:48:36 aubourg Exp $
    55
    66#include "fitsringrdr.h"
     
    7979}
    8080
    81 int FITSRingReader::calcMinOut() {
     81long FITSRingReader::calcMinOut() {
    8282  chkinit();
    8383  TOIManager* mgr = TOIManager::getManager();
    84   int firstReq = mgr->getRequestedBegin();
     84  long firstReq = mgr->getRequestedBegin();
    8585  return snBegin > firstReq ? snBegin : firstReq;
    8686}
    8787
    88 int FITSRingReader::calcMaxOut() {
     88long FITSRingReader::calcMaxOut() {
    8989  chkinit();
    9090  TOIManager* mgr = TOIManager::getManager();
    91   int lastReq = mgr->getRequestedEnd();
     91  long lastReq = mgr->getRequestedEnd();
    9292  return snEnd < lastReq ? snEnd : lastReq;
    9393}
  • trunk/ArchTOIPipe/Kernel/fitsringrdr.h

    r2359 r2448  
    66//                               Christophe Magneville
    77//                               Reza Ansari
    8 // $Id: fitsringrdr.h,v 1.3 2003-04-01 13:27:48 aubourg Exp $
     8// $Id: fitsringrdr.h,v 1.4 2003-10-13 20:48:36 aubourg Exp $
    99
    1010#ifndef FITSRINGRDR_H
     
    3535
    3636protected:
    37   virtual int   calcMinOut();
    38   virtual int   calcMaxOut();
     37  virtual long  calcMinOut();
     38  virtual long  calcMaxOut();
    3939 
    4040  // ajout vf 31/07/2002
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.cc

    r2194 r2448  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: fitstoirdr.cc,v 1.42 2002-09-16 13:28:29 aubourg Exp $
     5// $Id: fitstoirdr.cc,v 1.43 2003-10-13 20:48:37 aubourg Exp $
    66
    77#include "fitstoirdr.h"
     
    178178}
    179179
    180 int FITSTOIReader::calcMinOut() {
     180long FITSTOIReader::calcMinOut() {
    181181  chkinit();
    182182  TOIManager* mgr = TOIManager::getManager();
    183   int firstReq = mgr->getRequestedBegin();
     183  long firstReq = mgr->getRequestedBegin();
    184184  return snBegin > firstReq ? snBegin : firstReq;
    185185}
    186186
    187 int FITSTOIReader::calcMaxOut() {
     187long FITSTOIReader::calcMaxOut() {
    188188  chkinit();
    189189  TOIManager* mgr = TOIManager::getManager();
    190   int lastReq = mgr->getRequestedEnd();
     190  long lastReq = mgr->getRequestedEnd();
    191191  return snEnd < lastReq ? snEnd : lastReq;
    192192}
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.h

    r2206 r2448  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: fitstoirdr.h,v 1.14 2002-10-07 14:23:02 aubourg Exp $
     7// $Id: fitstoirdr.h,v 1.15 2003-10-13 20:48:37 aubourg Exp $
    88
    99
     
    4545
    4646protected:
    47   virtual int  calcMinOut();
    48   virtual int  calcMaxOut();
     47  virtual long calcMinOut();
     48  virtual long calcMaxOut();
    4949 
    5050  // ajout vf 31/07/2002
  • trunk/ArchTOIPipe/Kernel/piotoirdr.cc

    r2398 r2448  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: piotoirdr.cc,v 1.10 2003-06-05 08:15:47 aubourg Exp $
     5// $Id: piotoirdr.cc,v 1.11 2003-10-13 20:48:37 aubourg Exp $
    66
    77#include "piotoirdr.h"
     
    9393       << snBegin << " " << snEnd << endl;
    9494
    95   for (int snb = snBegin; snb <= snEnd; snb += bufferSize) {
    96     int sne = snb + bufferSize - 1;
     95  for (long snb = snBegin; snb <= snEnd; snb += bufferSize) {
     96    long sne = snb + bufferSize - 1;
    9797    if (sne > snEnd) sne=snEnd;
    9898    // TBD : check if PIODOUBLE != double;
    99     char command[80];
     99    char command[128];
    100100    sprintf(command, "Begin=%d; End=%d", snb, sne);
    101101    double* data = NULL;
     
    103103    PIOBYTE*  pioflags = NULL;
    104104    fits_lock();
     105    char objname[128];
     106    strcpy(objname, object.c_str());
    105107    PIOLONG n = PIOReadTOI((void**) &data,
    106                            const_cast<char*>(object.c_str()),
     108                           objname,
    107109                           "PIODOUBLE",
    108110                           command,
     
    113115    }
    114116    if (flagdef != "") {
     117      char flagname[128];
     118      strcpy(flagname, flagdef.c_str());
    115119      PIOLONG nf = PIOReadFLGObjectMask(&pioflags,
    116                                        const_cast<char*>(flagdef.c_str()),
    117                                        command,
    118                                        pioGroup);
     120                                        flagname,
     121                                        command,
     122                                        pioGroup);
    119123      if (nf != n) {
    120124        cerr << "*** PIO Error, inconsistent read, data " << n << " flags "
  • trunk/ArchTOIPipe/Kernel/toimanager.cc

    r2393 r2448  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toimanager.cc,v 1.23 2003-05-28 21:03:53 aubourg Exp $
     5// $Id: toimanager.cc,v 1.24 2003-10-13 20:48:37 aubourg Exp $
    66
    77#include "toimanager.h"
     
    1111#include <unistd.h>
    1212#include <map>
     13
     14//#ifndef NOCFITSIO
     15#include "fitstoiwtr.h"
     16//#endif
    1317
    1418#ifndef MAXINT
     
    139143// fin ajout vf
    140144
    141 void TOIManager::setRequestedSample(int begin, int end) {
     145void TOIManager::setRequestedSample(long begin, long end) {
    142146  cout << "TOIManager::setRequestedSample should not be called anymore" << endl;
    143147  cout << " call same method one any toiprocessor" << endl;
     
    229233
    230234  if (withFlag) { // Si c'est un FITSTOIWriter
     235    //#ifndef NOCFITSIO
    231236    FITSTOIWriter* ftw = dynamic_cast< FITSTOIWriter* >(&prin);
    232237    if (ftw) ftw->addInput(in, toi, withFlag);
    233238    else prin.addInput(in, toi);
     239    //#else
     240    //    prin.addInput(in, toi);
     241    //#endif
    234242  }
    235243  else prin.addInput(in, toi);
  • trunk/ArchTOIPipe/Kernel/toimanager.h

    r2386 r2448  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toimanager.h,v 1.18 2003-05-20 10:10:09 aubourg Exp $
     7// $Id: toimanager.h,v 1.19 2003-10-13 20:48:37 aubourg Exp $
    88
    99
     
    2525#include "toiseqbuff.h"
    2626#include "toisegment.h"
    27 #include "fitstoiwtr.h"
     27//#include "fitstoiwtr.h"
    2828
    2929#ifdef WITH_SOPHYA
     
    4444  static TOIManager* getManager();
    4545  virtual ~TOIManager() {}
    46   void setRequestedSample(int begin, int end);
     46  void setRequestedSample(long begin, long end);
    4747  int getRequestedBegin();
    4848  int getRequestedEnd();
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r2282 r2448  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toiprocessor.cc,v 1.27 2002-11-28 15:49:21 aubourg Exp $
     5// $Id: toiprocessor.cc,v 1.28 2003-10-13 20:48:37 aubourg Exp $
    66
    77#include "toiprocessor.h"
     
    9393}
    9494
    95 int TOIProcessor::getMinOut() {
     95long TOIProcessor::getMinOut() {
    9696  //  return snBegin + lowExtra;
    9797  return snBegin;
    9898}
    9999
    100 int TOIProcessor::getMaxOut() {
     100long TOIProcessor::getMaxOut() {
    101101  //  return snEnd - upExtra;
    102102  return snEnd;
    103103}
    104104
    105 int TOIProcessor::calcMinOut() {
     105long TOIProcessor::calcMinOut() {
    106106  return getMinIn() + lowExtra;
    107107}
    108108
    109 int TOIProcessor::calcMaxOut() {
     109long TOIProcessor::calcMaxOut() {
    110110  return getMaxIn() - upExtra;
    111111}
    112112
    113 int TOIProcessor::getMinIn() {
     113long TOIProcessor::getMinIn() {
    114114  //  return snBegin;
    115115  return snBegin - lowExtra;
    116116}
    117117
    118 int TOIProcessor::getMaxIn() {
     118long TOIProcessor::getMaxIn() {
    119119  //  return snEnd;
    120120  return snEnd + upExtra;
     
    312312#ifndef NO_SOPHYA
    313313/* ---- l'interface va etre modifiee, NE PAS UTILISER
    314 Array TOIProcessor::getData(int toiIndex, int iStart, int iEnd) {
     314Array TOIProcessor::getData(int toiIndex, long iStart, long iEnd) {
    315315  TOI* toi = getInputTOI(toiIndex);
    316316  toi->waitForData(iStart, iEnd);
     
    318318}
    319319
    320 Array TOIProcessor::getError(int toiIndex, int iStart, int iEnd) {
     320Array TOIProcessor::getError(int toiIndex, long iStart, long iEnd) {
    321321  TOI* toi = getInputTOI(toiIndex);
    322322  toi->waitForData(iStart, iEnd);
     
    324324}
    325325
    326 TArray<int_4> TOIProcessor::getFlag(int toiIndex, int iStart, int iEnd) {
     326TArray<int_4> TOIProcessor::getFlag(int toiIndex, long iStart, long iEnd) {
    327327  TOI* toi = getInputTOI(toiIndex);
    328328  toi->waitForData(iStart, iEnd);
     
    332332#endif
    333333
    334 double TOIProcessor::getData(int toiIndex, int i) {
     334double TOIProcessor::getData(int toiIndex, long i) {
    335335  TOI* toi = getInputTOI(toiIndex);
    336336  if (toi->needSyncOldWay()) toi->waitForData(i); // seulement pour autre que segmented
     
    339339}
    340340
    341 void  TOIProcessor::getData(int toiIndex, int i, double &data, uint_8 &flag)
     341void  TOIProcessor::getData(int toiIndex, long i, double &data, uint_8 &flag)
    342342{
    343343  TOI* toi = getInputTOI(toiIndex);
     
    348348}
    349349
    350 void TOIProcessor::getData(int toiIndex, int i, int n, double* d)
     350void TOIProcessor::getData(int toiIndex, long i, long n, double* d)
    351351{
    352352  TOI* toi = getInputTOI(toiIndex);
     
    357357}
    358358
    359 void TOIProcessor::getData(int toiIndex, int i, int n, double* d, uint_8* f)
     359void TOIProcessor::getData(int toiIndex, long i, long n, double* d, uint_8* f)
    360360{
    361361  TOI* toi = getInputTOI(toiIndex);
     
    368368
    369369/*RZCMV
    370 double TOIProcessor::getError(int toiIndex, int i) {
     370double TOIProcessor::getError(int toiIndex, long i) {
    371371  TOI* toi = getInputTOI(toiIndex);
    372372  toi->waitForData(i);
     
    374374}
    375375
    376 int_4 TOIProcessor::getFlag(int toiIndex, int i) {
     376int_4 TOIProcessor::getFlag(int toiIndex, long i) {
    377377  TOI* toi = getInputTOI(toiIndex);
    378378  toi->waitForData(i);
     
    381381*/
    382382
    383 void TOIProcessor::setNeededHistory(int nsamples) {
     383void TOIProcessor::setNeededHistory(long nsamples) {
    384384  neededHistory =  nsamples;
    385385}
    386386
    387 void TOIProcessor::wontNeedBefore(int i) {
     387void TOIProcessor::wontNeedBefore(long i) {
    388388  if (i<wontNeedValue) return;
    389389  wontNeedValue = i;
     
    394394}
    395395
    396 void TOIProcessor::autoWontNeed(int iCur) {
     396void TOIProcessor::autoWontNeed(long iCur) {
    397397  if (neededHistory <=0) return;
    398398  if (iCur < lastAWN + neededHistory/10) return;
     
    409409
    410410
    411 void TOIProcessor::putData(int toiIndex, int i, double value, uint_8 flg) {
     411void TOIProcessor::putData(int toiIndex, long i, double value, uint_8 flg) {
    412412  TOI* toi = getOutputTOI(toiIndex);
    413413  if (toi == NULL) return;
     
    417417}
    418418
    419 void TOIProcessor::putData(int toiIndex, int i, int n, double const* val,
     419void TOIProcessor::putData(int toiIndex, long i, long n, double const* val,
    420420                           uint_8 const* flg) {
    421421  TOI* toi = getOutputTOI(toiIndex);
     
    426426
    427427/*RZCMV
    428 void TOIProcessor::putDataError(int toiIndex, int i, double value,
     428void TOIProcessor::putDataError(int toiIndex, long i, double value,
    429429                                double error, int_4 flg) {
    430430  TOI* toi = getOutputTOI(toiIndex);
  • trunk/ArchTOIPipe/Kernel/toiprocessor.h

    r2187 r2448  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toiprocessor.h,v 1.20 2002-09-09 15:33:15 aubourg Exp $
     7// $Id: toiprocessor.h,v 1.21 2003-10-13 20:48:37 aubourg Exp $
    88
    99
     
    4848  virtual void run();
    4949
    50   virtual int   getMinOut();
    51   virtual int   getMaxOut();
     50  virtual long  getMinOut();
     51  virtual long  getMaxOut();
    5252 
    5353  // rajout vf 29/07/2002
     
    7171#ifndef NO_SOPHYA
    7272  /* ---- l'interface va etre modifiee, NE PAS UTILISER
    73   Array         getData(int toiIndex, int iStart, int iEnd);
    74   Array         getError(int toiIndex, int iStart, int iEnd);
    75   TArray<int_4> getFlag(int toiIndex, int iStart, int iEnd);
     73  Array         getData(int toiIndex, long iStart, long iEnd);
     74  Array         getError(int toiIndex, long iStart, long iEnd);
     75  TArray<int_4> getFlag(int toiIndex, long iStart, long iEnd);
    7676          l'interface va etre modifiee, NE PAS UTILISER ---- */
    7777#endif
     
    8080  // Les methodes qui suivent ne peuvent etre
    8181  // utilisees que sur des entrees simples
    82   double        getData(int toiIndex, int i);
    83   void          getData(int toiIndex, int i, double &data, uint_8 &flag);
    84 
    85   void          getData(int toiIndex, int i, int n, double* d);
    86   void          getData(int toiIndex, int i, int n, double* d, uint_8* f);
    87  
    88   //RZCMV  double        getError(int toiIndex, int i);
    89   //RZCMV  int_4         getFlag(int toiIndex, int i);
    90 
    91   void          wontNeedBefore(int i);
    92   int           wontNeedValue;
    93   void          setNeededHistory(int nsamples); // -1 : disable
    94 
    95   void          putData(int toiIndex, int i, double value, uint_8 flag=0);
    96   //RZCMV  void          putDataError(int toiIndex, int i, double value,
     82  double        getData(int toiIndex, long i);
     83  void          getData(int toiIndex, long i, double &data, uint_8 &flag);
     84
     85  void          getData(int toiIndex, long i, long n, double* d);
     86  void          getData(int toiIndex, long i, long n, double* d, uint_8* f);
     87 
     88  //RZCMV  double        getError(int toiIndex, long i);
     89  //RZCMV  int_4         getFlag(int toiIndex, long i);
     90
     91  void          wontNeedBefore(long i);
     92  long           wontNeedValue;
     93  void          setNeededHistory(long nsamples); // -1 : disable
     94
     95  void          putData(int toiIndex, long i, double value, uint_8 flag=0);
     96  //RZCMV  void          putDataError(int toiIndex, long i, double value,
    9797  //RZCMV                            double error, int_4 flag=0);
    9898
    99   void          putData(int toiIndex, int i, int n, double const* val,
     99  void          putData(int toiIndex, long i, long n, double const* val,
    100100                        uint_8 const* flg=0);
    101101
     
    103103public: 
    104104  // Methodes passees en public par Reza, 14/5/2002
    105   virtual int   calcMinOut(); // Protected ?
    106   virtual int   calcMaxOut(); // Protected ?
    107 
    108   virtual int   getMinIn();
    109   virtual int   getMaxIn();
     105  virtual long   calcMinOut(); // Protected ?
     106  virtual long   calcMaxOut(); // Protected ?
     107
     108  virtual long   getMinIn();
     109  virtual long   getMaxIn();
    110110protected:
    111111  // Implementation par defaut
    112   int           minOut;    // Cache for calcMinOut() value. Protected ?
    113   int           maxOut;    // Cache for calcMaxOut() value. Protected ?
     112  long           minOut;    // Cache for calcMinOut() value. Protected ?
     113  long           maxOut;    // Cache for calcMaxOut() value. Protected ?
    114114
    115115  int           upExtra;  // MaxIn - MaxOut : extra samples for processing
    116116  int           lowExtra; // MinOut - MinIn : extra samples for processing
    117117
    118   int           forcedMinIn; // to process a subset of data
    119   int           forcedMaxIn; // to process a subset of data
    120   void          setSampleSubset(int min, int max);
     118  long           forcedMinIn; // to process a subset of data
     119  long           forcedMaxIn; // to process a subset of data
     120  void          setSampleSubset(long min, long max);
    121121
    122122  int           neededHistory;
     
    134134  //  Fin rajout Reza 11/3/2001
    135135
    136   void          autoWontNeed(int iCur);
    137   int           lastAWN;
     136  void          autoWontNeed(long iCur);
     137  long           lastAWN;
    138138
    139139
     
    158158  virtual ~TOIProcessor();
    159159 
    160   void setMinSn(int n) {forcedMinIn = n;}
    161   void setMaxSn(int n) {forcedMaxIn = n;}
     160  void setMinSn(long n) {forcedMinIn = n;}
     161  void setMaxSn(long n) {forcedMaxIn = n;}
    162162
    163163  // ajout vf 23/08/2002
Note: See TracChangeset for help on using the changeset viewer.