tic  130
tic.hxx
Go to the documentation of this file.
1 #ifndef _TINA_TIC_HXX
2 #define _TINA_TIC_HXX
3 
4 #include "umic/umi.hxx"
5 #include "umi/umi_user.hxx"
6 #include "tina/tina.hxx"
7 #include "rio/rio.hxx"
8 
14 namespace INdepDev100 {
15  namespace Umi=INdepUmi100 ;
16  namespace Rio=INdepRio100 ;
17  namespace Tina=INdepTina100 ;
18 
19  class TicArmClientFunc:public Umi::TaskFunc::Func {
20  int _cnRio;
21  int _fUnit;
22 
23  int cnRio() { return _cnRio; }
24 
25  public:
26  int func( int eState );
27  TicArmClientFunc(int cnRio, int fUnit):_cnRio(cnRio), _fUnit(fUnit) { }
28  ~TicArmClientFunc() { }
29  };
30 
31  class TicConfigClientFunc:public Umi::TaskFunc::Func {
32  int _cnRio;
33 
34  int cnRio() { return _cnRio; }
35 
36  public:
37  int func( int eState ) ;
38  TicConfigClientFunc(int cnRio):_cnRio(cnRio) { }
39  ~TicConfigClientFunc() { }
40  };
41 
42  class TicMode:public Failable { };
43 
44  class TicPlex:public Umi::TaskPlex, public Failable {
45  Umi::ChanUser *_pucIo;
46  Umi::Channel *_puc;
47 
48  bool _fRun;
49 
50  void done(Umi::Task *pta) { /* TaskUser virtual */
51  _fRun=0;
52  }
53 
54  void run(Umi::TaskFunc::Func *ptf) {
55  assert(!_fRun);
56  _fRun=1;
57 
58  TaskFunc::run(ptf);
59  sigUp(0, _puc, 0);
60  runio(_pucIo);
61  assert(!_fRun);
62  }
63 
64  public:
65 
66  int callTicConfig(TicMode *ptm) {
67  TicConfigClientFunc *ptf=new TicConfigClientFunc(0); /* deleted by task code ! */
68  run(ptf);
69  return ptm->isGood();
70  }
71 
72  int callTicArm() {
73  TicArmClientFunc *ptf=new TicArmClientFunc(0, 3); /* deleted by task code ! */
74  run(ptf);
75  return 1;
76  }
77 
78 
79  TicPlex(Umi::Channel *puc, Umi::ChanUser *pucIo):Umi::TaskPlex(puc),
80  _pucIo(pucIo),
81  _puc(puc),
82  _fRun(false)
83  {
84  assert(*(pucIo->pup()) == INdepRio100::theRio_rio_Proto);
85  assert(*(puc->pup()) == INdepRio100::theRio_rio_Proto);
86  }
87  };
88 }
89 #endif
90 
bool isGood() const
fine
Definition: failable.hxx:40
Definition: tic.hxx:31
Definition: tic.hxx:19
Definition: tic.hxx:42
Definition: tinacp.cxx:88
namespace for the ines Timing Analyzer (Tina) interface
Definition: protocols.cxx:7
base class for something that does have a failed/good state.
Definition: failable.hxx:13
Definition: tic.hxx:44
Definition: tap.cxx:6
Definition: tinacp.cxx:82