Almetare  1.15
Alle meine Taschenrechner - Eine C++-Bibliothek zur Entwicklung von Taschenrechnern
calc_fx3600p.h
gehe zur Dokumentation dieser Datei
1 //******************************************************************************
2 // Copyright (c) 2002-2004 by Friedemann Seebass, Germany.
3 // Dieses Programm ist freie Software. Siehe GNU GPL Notiz in Datei main.cpp.
4 // This program is free software. See the GNU GPL notice in file main.cpp.
5 // Projekt: Almetare - Alle meine Taschenrechner
6 //******************************************************************************
11 //******************************************************************************
12 // Wann Wer Was
13 // ---------- -------- ---------------------------------------------------------
14 // 11.08.2003 fse ComputerFx3600p::qsimp(): neuer Parameter dif
15 // 01.03.2003 fse erzeugt
16 //******************************************************************************
17 
18 #ifndef CALC_FX3600P_H
19 #define CALC_FX3600P_H
20 
21 #ifndef __cplusplus
22 #error calc_fx3600p.h is only for C++!
23 #endif
24 
25 //******************************************************************************
26 
27 #include "calc_casio_sci.h"
28 
29 using namespace std;
30 
31 //******************************************************************************
32 
33 class DisplayFx3600p;
34 class CalculatorFx3600p;
35 
36 //******************************************************************************
37 // Klasse ComputerFx3600p:
38 //******************************************************************************
39 
41 
43 {
46  bool mIsIdxMode;
47  bool mIsLrnMode;
48  bool mIsEntMode;
49  bool mIsHltMode;
50  string mPrgMem[2];
51  string mPrgMemOrg[2];
52  int mActivePrg;
53  string mRunningPrg;
54  bool mIsPrgBreak;
55  int mIdxStep;
57  int mDigits;
58  void addCasioFx3600SymsToSymTab();
59  bool preProcess(string& in);
60  bool checkOnPrgBreak();
61  void addPrgStep(const string& in);
62  double trapzd(double a, double b, int n);
63  double qsimp (double a, double b, int& n, double& dif); // fse, 11.08.03: dif
64  double f(double x);
65  bool storeMainPrgAndCheckOnRecursionError(bool isSubPrgRunning, const string& in, string& mainRunningPrg);
66 public:
68 // ~ComputerFx3600p();
69  bool map(string& sym);
70  bool getIsIdxMode() { return mIsIdxMode; }
71  bool getIsLrnMode() { return mIsLrnMode; }
72  bool getIsEntMode() { return mIsEntMode; }
73  bool getIsHltMode() { return mIsHltMode; }
74  int getActivePrg() { return mActivePrg; }
75  int getIsPrgBreak(){ return mIsPrgBreak;}
76  int getIdxStep() { return mIdxStep; }
77  string getRunningPrg(){ return mRunningPrg;}
78  string getPrgMem(int i) { return mPrgMem[i]; }
79  string getPrgMemOrg(int i) { return mPrgMemOrg[i]; }
80 // void setCalcP(CalculatorFx3600p* calcP) { mCalcFx3600pP = calcP; }
81  void setIsIdxMode(bool isOn) { mIsIdxMode = isOn; }
82  void setIsLrnMode(bool isOn) { mIsLrnMode = isOn; }
83  void setIsEntMode(bool isOn) { mIsEntMode = isOn; }
84  void setIsHltMode(bool isOn) { mIsHltMode = isOn; }
85  void setActivePrg(int prg ) { mActivePrg = prg ; }
86  void setIsPrgBreak(bool b ) { mIsPrgBreak = b ; }
87  void setIdxStep (int i ) { mIdxStep = i ; }
88  void setPrgMem (int i, string str) { mPrgMem [i] = str; }
89  void setPrgMemOrg(int i, string str) { mPrgMemOrg[i] = str; }
90  void setRunningPrg(string prg) { mRunningPrg = prg; }
91  void resetRunningPrg() { mRunningPrg = mPrgMem[mActivePrg-1]; }
92  bool isPrgRunning() { return (mActivePrg == 1 || mActivePrg == 2) && !mIsLrnMode && !mIsEntMode && !mIsHltMode; }
93  void precedeRunningPrg(const string& pre) { mRunningPrg = pre + mRunningPrg; }
94  Number execPrg();
95  void intgrInputAb();
96  void integrate();
97  void aftProcess2(string& in);
98 };
99 
100 //******************************************************************************
101 // Klasse DisplayFx3600p:
102 //******************************************************************************
103 
105 
107 {
109 
110  void setModesCasioFx3600p();
111  void makeSeven(string displayStr = "");
112  void setOn (bool on) { mOn = on ? "On" : ".." ; }
113  void setInv (bool on) { mInv = on ? "INV" : "..."; }
114  void setLrn (bool on) { mLrn = on ? "LRN" : "..."; }
115  void setEnt (bool on) { mEnt = on ? "ENT" : "..."; }
116  void setIdx (bool on) { mIdx = on ? "Idx" : "..."; }
117  void setP1 (bool on) { mP1 = on ? "P1" : ".." ; }
118  void setP2 (bool on) { mP2 = on ? "P2" : ".." ; }
119 protected:
120  string mOn;
121  string mLrn;
122  string mIdx;
123  string mEnt;
124  string mP1;
125  string mP2;
126 
127 public:
129  void setModes();
130 };
131 
132 //******************************************************************************
133 // Klasse CalculatorFx3600p:
134 //******************************************************************************
135 
137 
139 {
140  ComputerFx3600p* mCompP;
141  const char mSep;
142  string nvRamToStr();
143  void restoreNvRam();
144  void restorePrg(int i, string prg);
145 public:
146  CalculatorFx3600p(int argc, char** argv);
148 // void setPrg(string prg) { mActivePrg = prg; }
149 // string& getPrg() { return mActivePrg; }
150 };
151 
152 //******************************************************************************
153 // zusaetzliche Symbole im Casio fx-3600P:
154 //************************* ************************* **************************
155 
156 
158 
159 class AcIdx : public SymAction
160 
161 {
162 public:
163  AcIdx() : SymAction("idx", "set into integration mode") {}
164  void process();
165 };
166 
167 //************************* ************************* **************************
168 
170 
171 class AcLrn : public SymAction
172 
173 {
174 public:
175  AcLrn() : SymAction("lrn", "set into programming mode") {}
176  void process();
177 };
178 
179 //************************* ************************* **************************
180 
182 
183 class AcRnm : public SymAction
184 
185 {
186 public:
187  AcRnm() : SymAction("rnm", "set into normal run mode") {}
188  void process();
189 };
190 
191 
192 //************************* ************************* **************************
193 
195 
196 class AcPcl : public SymAction
197 {
198 public:
199  AcPcl() : SymAction("pcl", "clear program(s)") {}
200  void process();
201 };
202 
203 //************************* ************************* **************************
204 
206 
207 class AcStrps : public SymAction
208 {
209 public:
210  AcStrps() : SymAction("strps", "set number of integration stripes (= 2^...)") {}
211  void process();
212 };
213 
214 //************************* ************************* **************************
215 
219 
220 class AcPrgCtrl : public SymAction
221 {
222 protected:
223 // static CalculatorFx3600p* mCalcP;
224  void processP1P2(int actPrg);
225 
226 public:
227  explicit AcPrgCtrl(string sym = "", string hlp = "no help available")
228  : SymAction(sym, hlp) {}
229 // static void setCalcP(CalculatorFx3600p* calcP) { mCalcP = calcP; }
230 };
231 
232 //****************** ******************* ******************* *******************
233 
235 
236 class PrgCtrlP1 : public AcPrgCtrl
237 {
238 public:
239  PrgCtrlP1() : AcPrgCtrl("p1", "choose/execute program no. 1") {}
240  void process();
241 };
242 
243 //****************** ******************* ******************* *******************
244 
246 
247 class PrgCtrlP2 : public AcPrgCtrl
248 {
249 public:
250  PrgCtrlP2() : AcPrgCtrl("p2", "choose/execute program no. 2") {}
251  void process();
252 };
253 
254 //****************** ******************* ******************* *******************
255 
257 
258 class PrgCtrlRun : public AcPrgCtrl
259 {
260 public:
261  PrgCtrlRun() : AcPrgCtrl("run", "continue the program") {}
262  void process();
263 };
264 
265 //****************** ******************* ******************* *******************
266 
268 
269 class PrgCtrlEnt : public AcPrgCtrl
270 {
271 public:
272  PrgCtrlEnt() : AcPrgCtrl("ent", "enter data into program") {}
273  void process();
274 };
275 
276 //****************** ******************* ******************* *******************
277 
279 
280 class PrgCtrlHlt : public AcPrgCtrl
281 {
282 public:
283  PrgCtrlHlt() : AcPrgCtrl("hlt", "halt program") {}
284  void process();
285 };
286 
287 //************************* ************************* **************************
288 
290 
291 class PrgCtrlXgt0 : public AcPrgCtrl
292 {
293 public:
294  PrgCtrlXgt0() : AcPrgCtrl("xgt0", "jumps to program start if x > 0") {}
295  void process();
296 };
297 
298 //************************* ************************* **************************
299 
301 
302 class PrgCtrlXleM : public AcPrgCtrl
303 {
304 public:
305  PrgCtrlXleM() : AcPrgCtrl("xlem", "jumps to program start if x <= M") {}
306 
307  void process();
308 };
309 
310 //************************* ************************* **************************
311 
313 
314 class PrgCtrlRtn : public AcPrgCtrl
315 {
316 public:
317  PrgCtrlRtn() : AcPrgCtrl("rtn", "jumps to program start") {}
318  void process();
319 };
320 
321 //******************************************************************************
322 //************************************** ***************************************
323 
324 //************************* ************************* **************************
325 
326 #endif // !CALC_FX3600P_H
DspMode
Winkelmodus Altgrad, Neugrad oder Rad.
Definition: calc_sci.h:35
Gibt Streifenanzahl bei Integration vor.
Definition: calc_fx3600p.h:207
int mDigits
aktuelle Display-Genauigkeit, zum Ruecksetzen nach Integration
Definition: calc_fx3600p.h:57
Waehlt Programm Nr. 2.
Definition: calc_fx3600p.h:247
Schaltet Rechner in Programmiermodus.
Definition: calc_fx3600p.h:171
CalculatorFx3600p * mCalcFx3600pP
Zeiger auf den zugehoerigen Calculator.
Definition: calc_fx3600p.h:44
Loescht Programm.
Definition: calc_fx3600p.h:196
Schaltet Rechner in Integrationsmodus.
Definition: calc_fx3600p.h:159
bool mIsPrgBreak
Flag, ob laufendes Prg. durch "AC" unterbr. wurde.
Definition: calc_fx3600p.h:54
Startet Programm oder setzt es fort.
Definition: calc_fx3600p.h:258
string mIdx
String des Integrations-Modus.
Definition: calc_fx3600p.h:122
int mIdxStep
aktueller Zustand des Integrationsprozesses
Definition: calc_fx3600p.h:55
Die Klasse implementiert den Calculator des Casio fx-3600P.
Definition: calc_fx3600p.h:138
DspMode mDspMode
aktueller Display-Mode, zum Ruecksetzen nach Integration
Definition: calc_fx3600p.h:56
Gemeinsame Basisklasse aller wissenschaftlichen Casio-Rechner.
Definition: calc_casio_sci.h:43
Klasse mit Unterklassen, die die Ausfuehrung von Programmen kontrollieren.
Definition: calc_fx3600p.h:220
bool mIsIdxMode
Rechner ist im Intagrationsmodus.
Definition: calc_fx3600p.h:46
string mRunningPrg
gerade ablaufendes Programm
Definition: calc_fx3600p.h:53
string mEnt
String des Enter-Modus.
Definition: calc_fx3600p.h:123
Schaltet Rechner in normalen Runmodus.
Definition: calc_fx3600p.h:183
const char mSep
Separator fuer nvRam-String in der Konf.datei.
Definition: calc_fx3600p.h:141
bool mIsEntMode
Rechner ist im "Enter"-Modus.
Definition: calc_fx3600p.h:48
Die Klasse Number repraesentiert Zahlen.
Definition: number.h:48
Die Klasse implementiert die Anzeige des Casio fx-3600P.
Definition: calc_fx3600p.h:106
Unterbricht Programm.
Definition: calc_fx3600p.h:280
Basisklasse fuer alle Aktionen ("=", "%", ...).
Definition: symbols.h:277
ComputerFx3600p * mCompP
Zeiger auf den Computer des Rechners.
Definition: calc_fx3600p.h:108
string mP2
String des Programmspeichers P2.
Definition: calc_fx3600p.h:125
bool mIsForceSciTypeB
true, wenn SCI erst bei Zahlen kleiner 1e-7
Definition: calc_fx3600p.h:45
bool mIsLrnMode
Rechner ist im Programmiermodus.
Definition: calc_fx3600p.h:47
Basisklasse aller Taschenrechner.
Definition: calculator.h:244
Gemeinsame Klassen fuer wissenschaftliche Casio-Rechner (Modul special).
Verzweigt an Programmanfang.
Definition: calc_fx3600p.h:314
Die Klasse implementiert den Computer des Casio fx-3600P.
Definition: calc_fx3600p.h:42
string mOn
String des Power-Status "On".
Definition: calc_fx3600p.h:120
Klasse der Anzeige aller wissenschaftlichen Casio-Rechner.
Definition: calc_casio_sci.h:102
bool mIsHltMode
Programm wurde durch "HLT"-Befehl unterbrochen.
Definition: calc_fx3600p.h:49
string mLrn
String des Programmiermodus "LRN".
Definition: calc_fx3600p.h:121
Basisklasse aller Computer.
Definition: calculator.h:84
Erlaubt Dateneingabe in Programmen.
Definition: calc_fx3600p.h:269
Waehlt Programm Nr. 1.
Definition: calc_fx3600p.h:236
Verzweigt an Programmanfang, wenn Anzeige <= M.
Definition: calc_fx3600p.h:302
Verzweigt an Programmanfang, wenn Anzeige > 0.
Definition: calc_fx3600p.h:291
int mActivePrg
gerade aktives Programm
Definition: calc_fx3600p.h:52
string mP1
String des Programmspeichers P1.
Definition: calc_fx3600p.h:124