w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11UnitRL11.cpp
Go to the documentation of this file.
1// $Id: Rw11UnitRL11.cpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-09 1080 1.0.3 use HasVirt(); Virt() returns ref
8// 2017-04-07 868 1.0.2 Dump(): add detail arg
9// 2015-03-21 659 1.0.1 BUGFIX: SetType(): set fType;
10// 2014-06-08 561 1.0 Initial version
11// ---------------------------------------------------------------------------
12
18#include "librtools/RosFill.hpp"
19#include "Rw11CntlRL11.hpp"
20
21#include "Rw11UnitRL11.hpp"
22
23using namespace std;
24
30// all method definitions in namespace Retro
31namespace Retro {
32
33//------------------------------------------+-----------------------------------
35
37 : Rw11UnitDiskBase<Rw11CntlRL11>(pcntl, index),
38 fRlsta(0),
39 fRlpos(0)
40{
41 // setup disk geometry: rl01 and rl02 supported, default rl02
42 fType = "rl02";
43 fEnabled = true;
44 fNCyl = 512;
45 fNHead = 2;
46 fNSect = 40;
47 fBlksize = 256;
49}
50
51//------------------------------------------+-----------------------------------
53
55{}
56
57//------------------------------------------+-----------------------------------
59
60void Rw11UnitRL11::SetType(const std::string& type)
61{
62 if (HasVirt()) {
63 throw Rexception("Rw11UnitRL11::SetType",
64 string("Bad state: file attached"));
65 }
66
67 if (type == "rl01") {
68 fNCyl = 256;
69 } else if (type == "rl02") {
70 fNCyl = 512;
71 } else {
72 throw Rexception("Rw11UnitRL11::SetType",
73 string("Bad args: only types 'rl01' and 'rl02' supported"));
74 }
75
76 fType = type;
78 return;
79}
80
81//------------------------------------------+-----------------------------------
83
84void Rw11UnitRL11::Dump(std::ostream& os, int ind, const char* text,
85 int detail) const
86{
87 RosFill bl(ind);
88 os << bl << (text?text:"--") << "Rw11UnitRL11 @ " << this << endl;
89 os << bl << " fRlsta: " << RosPrintf(fRlsta,"o",6) << endl;
90 os << bl << " fRlpos: " << RosPrintf(fRlpos,"o",6) << endl;
91
92 Rw11UnitDiskBase<Rw11CntlRL11>::Dump(os, ind, " ^", detail);
93 return;
94}
95
96} // end namespace Retro
FIXME_docs.
Definition: Rexception.hpp:29
I/O appicator to generate fill characters.
Definition: RosFill.hpp:24
Implemenation (inline) of Rw11UnitDiskBase.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
size_t fBlksize
block size (in bytes)
bool fEnabled
unit enabled
std::string fType
drive type
~Rw11UnitRL11()
Destructor.
virtual void SetType(const std::string &type)
FIXME_docs.
Rw11UnitRL11(Rw11CntlRL11 *pcntl, size_t index)
Constructor.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
bool HasVirt() const
FIXME_docs.
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