Changeset 1985 in Sophya for trunk/ArchTOIPipe


Ignore:
Timestamp:
May 7, 2002, 6:38:03 PM (23 years ago)
Author:
ansari
Message:

Correction SMakefile - remise en marche de TOISeqBuffered - Reza 7/5/2002

Location:
trunk/ArchTOIPipe
Files:
1 added
3 edited

Legend:

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

    r1762 r1985  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toiseqbuff.cc,v 1.9 2001-11-13 16:22:47 aubourg Exp $
     5// $Id: toiseqbuff.cc,v 1.10 2002-05-07 16:38:03 ansari Exp $
    66
    77#include "toiprocessor.h"
     
    8585}
    8686
    87 void TOISeqBuffered::doWontNeedBefore(int i) {
     87void TOISeqBuffered::wontNeedBefore(int i) {
    8888  // $CHECK$  Reza 30/4/2001 - Je ne sais pas a quoi ca sert !
    8989  //  next_out = i; $CHECK$  Reza 30/4/2001
     
    113113#endif
    114114
    115 void TOISeqBuffered::doGetData(int i, double & val, uint_8 & flg) {
     115double TOISeqBuffered::getData(int i)
     116{
     117  double val;
     118  uint_8 flg;
     119  getData(i, val, flg);
     120  return(val);
     121}
     122
     123
     124void TOISeqBuffered::getData(int i, double & val, uint_8 & flg) {
    116125  if (!started) {
    117     cout << " TOISeqBuffered::doGetData() - waitGet() Waiting for start ... " << endl;
     126    cout << " TOISeqBuffered::getData() - waitGet() Waiting for start ... " << endl;
    118127    waitGet();
    119128  }
     
    121130  if (isDataDeleted(i)) {
    122131    if (dbglev > 0)
    123       cout << " TOISeqBuffered::doGetData() - DataDeleted() name=" << getName() 
    124            << " i=" << i << " next_in= " << next_in
    125            << " next_out=" << next_out << endl;
    126     throw RangeCheckError("TOISeqBuffered::doGetData(i) : data deleted");
     132      cout << " TOISeqBuffered::getData() - DataDeleted() name=" << getName() 
     133           << " i=" << i << " next_in= " << next_in
     134           << " next_out=" << next_out << endl;
     135    throw RangeCheckError("TOISeqBuffered::getData(i) : data deleted");
    127136  }
    128137  while (i >= next_in) {
    129138    if (i>next_out) next_out = i;
    130139    if (dbglev > 0)
    131       cout << " TOISeqBuffered::doGetData() - waitGet() name=" << getName() 
     140      cout << " TOISeqBuffered::getData() - waitGet() name=" << getName() 
    132141           << " i=" << i << " next_in= " << next_in
    133142           << " next_out=" << next_out << endl;
     
    144153  if (isPutWaiting() && (next_in-next_out < wsize/2 )) {
    145154    if (dbglev > 0)
    146       cout << " TOISeqBuffered::doGetData() - signalPut() name=" << getName() 
    147            << " i=" << i << " next_in= " << next_in
    148            << " next_out=" << next_out << endl;
    149     signalPut();
     155      cout << " TOISeqBuffered::getData() - signalPut() name=" << getName() 
     156           << " i=" << i << " next_in= " << next_in
     157           << " next_out=" << next_out << endl;
     158    signalPut(); signal();
    150159  }
    151160  return;
     161}
     162
     163
     164void TOISeqBuffered::getData(int i, int n, double* data, uint_8* flg)
     165{
     166  if (!started) {
     167    cout << " TOISeqBuffered::getData(i,n ...) - waitGet() Waiting for start ... " << endl;
     168    waitGet();
     169  }
     170  cleanWaitGet();
     171  if (isDataDeleted(i)) {
     172    if (dbglev > 0)
     173      cout << " TOISeqBuffered::getData(i,n ...) - DataDeleted() name=" << getName() 
     174           << " i=" << i << " next_in= " << next_in
     175           << " next_out=" << next_out << endl;
     176    throw RangeCheckError("TOISeqBuffered::getData(i) : data deleted");
     177  }
     178  for(int j=i; i<i+n; j++) {
     179    while (j >= next_in) {
     180      if (j>next_out) next_out = j;
     181      if (dbglev > 0)
     182        cout << " TOISeqBuffered::getData(i,n ...) - waitGet() name=" << getName() 
     183             << " j=" << j << " next_in= " << next_in
     184             << " next_out=" << next_out << endl;
     185      waitGet();
     186      if (dbglev > 0)
     187        cout << " ... Out of waitGet() j=" << j
     188             << " next_in= " << next_in << " next_out=" << next_out << endl;
     189    }
     190    cleanWaitGet();
     191    data[j-i] = dataRef(j);
     192    if (flg) flg[j-i] = flagRef(j);
     193    if (first_out < 0)  first_out = j;
     194    if ((j+1) > next_out)  next_out = j+1;
     195    if (isPutWaiting() && (next_in-next_out < wsize/2 )) {
     196      if (dbglev > 0)
     197        cout << " TOISeqBuffered::getData(i,n ...) - signalPut() name=" << getName() 
     198             << " i=" << i << " next_in= " << next_in
     199             << " next_out=" << next_out << endl;
     200      signalPut(); signal();
     201    }
     202  }
     203  return;
     204 
    152205}
    153206
     
    182235
    183236
    184 void TOISeqBuffered::doPutData(int i, double value, uint_8 flag) {
     237void TOISeqBuffered::putData(int i, double value, uint_8 flag) {
    185238  if (!started) {
    186239    first_in = next_in = i;
     
    191244    if (i != next_in) {
    192245      if (dbglev > 0)
    193         cout << " TOISeqBuffered::doPutData() - i!=next_in() name=" << getName() 
     246        cout << " TOISeqBuffered::putData() - i!=next_in() name=" << getName() 
    194247             << " i=" << i << " next_in= " << next_in
    195248             << " next_out=" << next_out << endl;
    196       string msg = "TOISeqBuffered::doPutData() : i!=next_in TOIname="  + getName();
     249      string msg = "TOISeqBuffered::putData() : i!=next_in TOIname="  + getName();
    197250      throw RangeCheckError(msg);
    198251    }
    199252    if (next_in-next_out >= wsize) {
    200253      if (dbglev > 0)
    201         cout << " TOISeqBuffered::doPutData() - waitPut() " << getName()
     254        cout << " TOISeqBuffered::putData() - waitPut() " << getName()
    202255             << " i=" << i
    203256             << " next_in= " << next_in << " next_out=" << next_out << endl;
     
    214267  if (isGetWaiting() && (next_in-next_out > wsize/8))  {
    215268    if (dbglev > 0)
    216       cout << " TOISeqBuffered::doPutData() - signalGet() name=" << getName()
    217            << " i=" << i << " next_in= " << next_in
    218            << " next_out=" << next_out << endl;
    219     signalGet();
     269      cout << " TOISeqBuffered::putData() - signalGet() name=" << getName()
     270           << " i=" << i << " next_in= " << next_in
     271           << " next_out=" << next_out << endl;
     272    signalGet(); signal();
     273  }
     274}
     275
     276void TOISeqBuffered::putData(int i, int n, double const* val, uint_8 const* flg) {
     277  if (!started) {
     278    first_in = next_in = i;
     279    next_out = next_in;
     280    started = true;
     281  }
     282  else {
     283    if (i != next_in) {
     284      if (dbglev > 0)
     285        cout << " TOISeqBuffered::putData(i,n ...) - i!=next_in() name=" << getName() 
     286             << " i=" << i << " next_in= " << next_in
     287             << " next_out=" << next_out << endl;
     288      string msg = "TOISeqBuffered::putData() : i!=next_in TOIname="  + getName();
     289      throw RangeCheckError(msg);
     290    }
     291  }
     292  for(int j=i; j<i+n; j++) {
     293    if (next_in-next_out >= wsize) {
     294      if (dbglev > 0)
     295        cout << " TOISeqBuffered::putData(i,n ...) - waitPut() " << getName()
     296             << " j=" << j
     297             << " next_in= " << next_in << " next_out=" << next_out << endl;
     298      waitPut();
     299      if (dbglev > 0)
     300        cout << " ... Out of waitPut() j=" << j
     301             << " next_in= " << next_in << " next_out=" << next_out << endl;
     302    }
     303    cleanWaitPut();
     304    dataRef(j) = val[j-i];
     305    if (flg) flagRef(j) = flg[j-i];
     306    else flagRef(j) = 0;
     307    next_in = j+1;
     308  }
     309  if (isGetWaiting() && (next_in-next_out > wsize/8))  {
     310    if (dbglev > 0)
     311      cout << " TOISeqBuffered::putData(i,n ...) - signalGet() name=" << getName()
     312           << " i=" << i << " next_in= " << next_in
     313           << " next_out=" << next_out << endl;
     314    signalGet(); signal();
    220315  }
    221316}
     
    236331}
    237332
    238                  
    239 
     333void TOISeqBuffered::doGetData(int i, double & val, uint_8 & flg)
     334{
     335  cerr << " TOISeqBuffered::doGetData() not implemented !"
     336       << " \n A quoi ca set ??? Reza - Mai 2002 " << endl;
     337  throw NotAvailableOperation("TOISeqBuffered::doGetData() not implemented !");
     338}
     339
     340void TOISeqBuffered::doPutData(int i, double value, uint_8 flag)
     341{
     342  cerr << " TOISeqBuffered::doGetData() not implemented !"
     343       << " \n A quoi ca set ??? Reza - Mai 2002 " << endl;
     344  throw NotAvailableOperation("TOISeqBuffered::doGetData() not implemented !");
     345}
  • trunk/ArchTOIPipe/Kernel/toiseqbuff.h

    r1762 r1985  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toiseqbuff.h,v 1.9 2001-11-13 16:22:47 aubourg Exp $
     7// $Id: toiseqbuff.h,v 1.10 2002-05-07 16:38:03 ansari Exp $
    88
    99#ifndef TOISEQBUFF_H
     
    3232  inline void setDebugLevel(int lev=0) { dbglev=lev; }
    3333  inline int  getDebugLevel() const { return dbglev; }
     34
     35  virtual double        getData(int i);
     36  virtual void          getData(int i, double& data,  uint_8& flag);
     37  virtual void          getData(int i, int n, double* data, uint_8* flg=0);
     38  virtual void          putData(int i, double  value, uint_8  flag=0);
     39  virtual void          putData(int i, int n, double const* val, uint_8 const* flg=0);
     40  virtual void          wontNeedBefore(int i);
    3441
    3542  inline int getFirstIn() const { return first_in; }
     
    6673   
    6774  virtual void          doPutData(int i, double value, uint_8 flag=0);
    68   virtual void          doWontNeedBefore(int i);
     75  //  virtual void          doWontNeedBefore(int i);  plus besoin ? - Reza Mai 2002
    6976
    7077  virtual int           nextDataAvail(int iAfter);
  • trunk/ArchTOIPipe/TestPipes/SMakefile

    r1980 r1985  
    77#  defined
    88#  Usage: make -f SMakefile name_of_program
     9#         make -f SMakefile clean
    910#  *** Warning: GNU make should be used  ***
    1011# ###############################################################
    1112
    1213include ../SMakefile.h
    13 include ${DPCBASEREP}/Include/Makefile.slb
    14 
    1514
    1615ifdef NOSHLIB
     
    4645%:%.c
    4746
    48 .PRECIOUS: $(EXE)% $(OBJ)%.o
     47.PRECIOUS: $(AEXE)% $(OBJ)%.o
    4948
    50 %:$(EXE)%
    51         echo $@ " done"
    5249
    53 $(EXE)%:$(OBJ)%.o
     50#  --- Compilation and linking rules
     51%:$(AEXE)%
     52        echo '---' $@ build '-->' $<
     53
     54$(AEXE)%:$(OBJ)%.o
    5455        $(LINK.cc)  -o $@ $< $(LIBS)
    5556
     
    5758        $(COMPILE.cc)   $(USERFLAGS) -o $@ $<
    5859
    59 $(EXE)%:$(OBJ)%.cc
    60         $(LINK.cc) $(USERFLAGS)  -o $@ $< $(LIBS)
    61 
    62 $(EXE)%:$(OBJ)%.c
     60%:%.c
    6361        $(LINK.c)  $(USERFLAGS) -o $@ $< $(LIBS)
    64 
    65 $(OBJ)%.o:%.c
    66         $(COMPILE.c) -c $(CFLAGS) $(USERFLAGS) -o $@ $<
    6762
    6863dump :
    6964        echo $(LIBS)
    7065
     66clean :
     67        ../cleantstpipes.csh
Note: See TracChangeset for help on using the changeset viewer.