w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11Probe.cpp
Go to the documentation of this file.
1// $Id: Rw11Probe.cpp 1185 2019-07-12 17:29:12Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-03-10 1121 1.1.3 ctor: fData* initialized as 0 (not false)
8// 2018-12-19 1090 1.1.2 use RosPrintf(bool)
9// 2017-04-07 868 1.1.1 Dump(): add detail arg
10// 2017-02-04 848 1.1 Keep probe data; add DataInt(), DataRem()
11// 2013-03-05 495 1.0 Initial version
12// ---------------------------------------------------------------------------
13
18#include "librtools/RosFill.hpp"
20
22
23#include "Rw11Probe.hpp"
24
25using namespace std;
26
32// all method definitions in namespace Retro
33namespace Retro {
34
35//------------------------------------------+-----------------------------------
37
38Rw11Probe::Rw11Probe(uint16_t addr, bool probeint, bool proberem)
39 : fAddr(addr),
40 fProbeInt(probeint),
41 fProbeRem(proberem),
42 fProbeDone(false),
43 fFoundInt(false),
44 fFoundRem(false),
45 fDataInt(0),
46 fDataRem(0)
47{}
48
49//------------------------------------------+-----------------------------------
51
52bool Rw11Probe::Found() const
53{
54 if (!fProbeDone) return false;
55 if (fProbeInt && ! fFoundInt) return false;
56 if (fProbeRem && ! fFoundRem) return false;
57 return true;
58}
59
60//------------------------------------------+-----------------------------------
62
64{
65 if (!fProbeDone) return '?';
66 if (!fProbeInt) return '-';
67 return fFoundInt ? 'y' : 'n';
68}
69
70//------------------------------------------+-----------------------------------
72
74{
75 if (!fProbeDone) return '?';
76 if (!fProbeRem) return '-';
77 return fFoundRem ? 'y' : 'n';
78}
79
80//------------------------------------------+-----------------------------------
82
83void Rw11Probe::Dump(std::ostream& os, int ind, const char* text,
84 int /*detail*/) const
85{
86 RosFill bl(ind);
87 os << bl << (text?text:"--") << "Rw11Probe @ " << this << endl;
88
89 os << bl << " fAddr: " << RosPrintf(fAddr,"o0",6) << endl;
90 os << bl << " fProbeInt,Rem: " << RosPrintf(fProbeInt) << ", "
91 << RosPrintf(fProbeInt) << endl;
92 os << bl << " fProbeDone: " << RosPrintf(fProbeDone) << endl;
93 os << bl << " fFoundInt,Rem: " << RosPrintf(fFoundInt) << ", "
94 << RosPrintf(fFoundInt) << endl;
95 os << bl << " fDataInt,Rem: " << RosPrintf(fDataInt,"o0",6)<< ", "
96 << RosPrintf(fDataRem,"o0",6) << endl;
97 return;
98}
99
100} // end namespace Retro
I/O appicator to generate fill characters.
Definition: RosFill.hpp:24
RosPrintfS< bool > RosPrintf(bool value, const char *form=0, int width=0, int prec=0)
Creates a print object for the formatted output of a bool value.
Definition: RosPrintf.ipp:38
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47
char IndicatorInt() const
FIXME_docs.
Definition: Rw11Probe.cpp:63
bool Found() const
FIXME_docs.
Definition: Rw11Probe.cpp:52
uint16_t fDataRem
Definition: Rw11Probe.hpp:31
Rw11Probe(uint16_t addr=0, bool probeint=false, bool proberem=false)
Default constructor.
Definition: Rw11Probe.cpp:38
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
Definition: Rw11Probe.cpp:83
uint16_t fDataInt
Definition: Rw11Probe.hpp:30
uint16_t fAddr
Definition: Rw11Probe.hpp:24
char IndicatorRem() const
FIXME_docs.
Definition: Rw11Probe.cpp:73