Almetare  1.14
Alle meine Taschenrechner - Eine C++-Bibliothek zur Entwicklung von Taschenrechnern
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungswerte Freundbeziehungen
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;
56  DspMode mDspMode;
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 public:
67 // ~ComputerFx3600p();
68  bool map(string& sym);
69  bool getIsIdxMode() { return mIsIdxMode; }
70  bool getIsLrnMode() { return mIsLrnMode; }
71  bool getIsEntMode() { return mIsEntMode; }
72  bool getIsHltMode() { return mIsHltMode; }
73  int getActivePrg() { return mActivePrg; }
74  int getIsPrgBreak(){ return mIsPrgBreak;}
75  int getIdxStep() { return mIdxStep; }
76  string getRunningPrg(){ return mRunningPrg;}
77  string getPrgMem(int i) { return mPrgMem[i]; }
78  string getPrgMemOrg(int i) { return mPrgMemOrg[i]; }
79 // void setCalcP(CalculatorFx3600p* calcP) { mCalcFx3600pP = calcP; }
80  void setIsIdxMode(bool isOn) { mIsIdxMode = isOn; }
81  void setIsLrnMode(bool isOn) { mIsLrnMode = isOn; }
82  void setIsEntMode(bool isOn) { mIsEntMode = isOn; }
83  void setIsHltMode(bool isOn) { mIsHltMode = isOn; }
84  void setActivePrg(int prg ) { mActivePrg = prg ; }
85  void setIsPrgBreak(bool b ) { mIsPrgBreak = b ; }
86  void setIdxStep (int i ) { mIdxStep = i ; }
87  void setPrgMem (int i, string str) { mPrgMem [i] = str; }
88  void setPrgMemOrg(int i, string str) { mPrgMemOrg[i] = str; }
89  void setRunningPrg(string prg) { mRunningPrg = prg; }
90  void resetRunningPrg() { mRunningPrg = mPrgMem[mActivePrg-1]; }
91  bool isPrgRunning() { return (mActivePrg == 1 || mActivePrg == 2) && !mIsLrnMode && !mIsEntMode && !mIsHltMode; }
92  void precedeRunningPrg(const string& pre) { mRunningPrg = pre + mRunningPrg; }
93  Number execPrg();
94  void intgrInputAb();
95  void integrate();
96  void aftProcess2(string& in);
97 };
98 
99 //******************************************************************************
100 // Klasse DisplayFx3600p:
101 //******************************************************************************
102 
104 
106 {
108 
109  void setModesCasioFx3600p();
110  void makeSeven(string displayStr = "");
111  void setOn (bool on) { mOn = on ? "On" : ".." ; }
112  void setInv (bool on) { mInv = on ? "INV" : "..."; }
113  void setLrn (bool on) { mLrn = on ? "LRN" : "..."; }
114  void setEnt (bool on) { mEnt = on ? "ENT" : "..."; }
115  void setIdx (bool on) { mIdx = on ? "Idx" : "..."; }
116  void setP1 (bool on) { mP1 = on ? "P1" : ".." ; }
117  void setP2 (bool on) { mP2 = on ? "P2" : ".." ; }
118 protected:
119  string mOn;
120  string mLrn;
121  string mIdx;
122  string mEnt;
123  string mP1;
124  string mP2;
125 
126 public:
128  void setModes();
129 };
130 
131 //******************************************************************************
132 // Klasse CalculatorFx3600p:
133 //******************************************************************************
134 
136 
138 {
139  ComputerFx3600p* mCompP;
140  const char mSep;
141  string nvRamToStr();
142  void restoreNvRam();
143  void restorePrg(int i, string prg);
144 public:
145  CalculatorFx3600p(int argc, char** argv);
147 // void setPrg(string prg) { mActivePrg = prg; }
148 // string& getPrg() { return mActivePrg; }
149 };
150 
151 //******************************************************************************
152 // zusaetzliche Symbole im Casio fx-3600P:
153 //************************* ************************* **************************
154 
155 
157 
158 class AcIdx : public SymAction
159 
160 {
161 public:
162  AcIdx() : SymAction("idx", "set into integration mode") {}
163  void process();
164 };
165 
166 //************************* ************************* **************************
167 
169 
170 class AcLrn : public SymAction
171 
172 {
173 public:
174  AcLrn() : SymAction("lrn", "set into programming mode") {}
175  void process();
176 };
177 
178 //************************* ************************* **************************
179 
181 
182 class AcRnm : public SymAction
183 
184 {
185 public:
186  AcRnm() : SymAction("rnm", "set into normal run mode") {}
187  void process();
188 };
189 
190 
191 //************************* ************************* **************************
192 
194 
195 class AcPcl : public SymAction
196 {
197 public:
198  AcPcl() : SymAction("pcl", "clear program(s)") {}
199  void process();
200 };
201 
202 //************************* ************************* **************************
203 
205 
206 class AcStrps : public SymAction
207 {
208 public:
209  AcStrps() : SymAction("strps", "set number of integration stripes (= 2^...)") {}
210  void process();
211 };
212 
213 //************************* ************************* **************************
214 
218 
219 class AcPrgCtrl : public SymAction
220 {
221 protected:
222 // static CalculatorFx3600p* mCalcP;
223  void processP1P2(int actPrg);
224 
225 public:
226  explicit AcPrgCtrl(string sym = "", string hlp = "no help available")
227  : SymAction(sym, hlp) {}
228 // static void setCalcP(CalculatorFx3600p* calcP) { mCalcP = calcP; }
229 };
230 
231 //****************** ******************* ******************* *******************
232 
234 
235 class PrgCtrlP1 : public AcPrgCtrl
236 {
237 public:
238  PrgCtrlP1() : AcPrgCtrl("p1", "choose/execute program no. 1") {}
239  void process();
240 };
241 
242 //****************** ******************* ******************* *******************
243 
245 
246 class PrgCtrlP2 : public AcPrgCtrl
247 {
248 public:
249  PrgCtrlP2() : AcPrgCtrl("p2", "choose/execute program no. 2") {}
250  void process();
251 };
252 
253 //****************** ******************* ******************* *******************
254 
256 
257 class PrgCtrlRun : public AcPrgCtrl
258 {
259 public:
260  PrgCtrlRun() : AcPrgCtrl("run", "continue the program") {}
261  void process();
262 };
263 
264 //****************** ******************* ******************* *******************
265 
267 
268 class PrgCtrlEnt : public AcPrgCtrl
269 {
270 public:
271  PrgCtrlEnt() : AcPrgCtrl("ent", "enter data into program") {}
272  void process();
273 };
274 
275 //****************** ******************* ******************* *******************
276 
278 
279 class PrgCtrlHlt : public AcPrgCtrl
280 {
281 public:
282  PrgCtrlHlt() : AcPrgCtrl("hlt", "halt program") {}
283  void process();
284 };
285 
286 //************************* ************************* **************************
287 
289 
290 class PrgCtrlXgt0 : public AcPrgCtrl
291 {
292 public:
293  PrgCtrlXgt0() : AcPrgCtrl("xgt0", "jumps to program start if x > 0") {}
294  void process();
295 };
296 
297 //************************* ************************* **************************
298 
300 
301 class PrgCtrlXleM : public AcPrgCtrl
302 {
303 public:
304  PrgCtrlXleM() : AcPrgCtrl("xlem", "jumps to program start if x <= M") {}
305 
306  void process();
307 };
308 
309 //************************* ************************* **************************
310 
312 
313 class PrgCtrlRtn : public AcPrgCtrl
314 {
315 public:
316  PrgCtrlRtn() : AcPrgCtrl("rtn", "jumps to program start") {}
317  void process();
318 };
319 
320 //******************************************************************************
321 //************************************** ***************************************
322 
323 //************************* ************************* **************************
324 
325 #endif // !CALC_FX3600P_H
Gibt Streifenanzahl bei Integration vor.
Definition: calc_fx3600p.h:206
int mDigits
aktuelle Display-Genauigkeit, zum Ruecksetzen nach Integration
Definition: calc_fx3600p.h:57
Waehlt Programm Nr. 2.
Definition: calc_fx3600p.h:246
Schaltet Rechner in Programmiermodus.
Definition: calc_fx3600p.h:170
CalculatorFx3600p * mCalcFx3600pP
Zeiger auf den zugehoerigen Calculator.
Definition: calc_fx3600p.h:44
Loescht Programm.
Definition: calc_fx3600p.h:195
Schaltet Rechner in Integrationsmodus.
Definition: calc_fx3600p.h:158
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:257
string mIdx
String des Integrations-Modus.
Definition: calc_fx3600p.h:121
int mIdxStep
aktueller Zustand des Integrationsprozesses
Definition: calc_fx3600p.h:55
Die Klasse implementiert den Calculator des Casio fx-3600P.
Definition: calc_fx3600p.h:137
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:219
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:122
Schaltet Rechner in normalen Runmodus.
Definition: calc_fx3600p.h:182
const char mSep
Separator fuer nvRam-String in der Konf.datei.
Definition: calc_fx3600p.h:140
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:105
Unterbricht Programm.
Definition: calc_fx3600p.h:279
Basisklasse fuer alle Aktionen ("=", "%", ...).
Definition: symbols.h:277
ComputerFx3600p * mCompP
Zeiger auf den Computer des Rechners.
Definition: calc_fx3600p.h:107
string mP2
String des Programmspeichers P2.
Definition: calc_fx3600p.h:124
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:242
Gemeinsame Klassen fuer wissenschaftliche Casio-Rechner (Modul special).
Verzweigt an Programmanfang.
Definition: calc_fx3600p.h:313
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:119
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:120
Basisklasse aller Computer.
Definition: calculator.h:84
Erlaubt Dateneingabe in Programmen.
Definition: calc_fx3600p.h:268
Waehlt Programm Nr. 1.
Definition: calc_fx3600p.h:235
Verzweigt an Programmanfang, wenn Anzeige <= M.
Definition: calc_fx3600p.h:301
Verzweigt an Programmanfang, wenn Anzeige > 0.
Definition: calc_fx3600p.h:290
int mActivePrg
gerade aktives Programm
Definition: calc_fx3600p.h:52
string mP1
String des Programmspeichers P1.
Definition: calc_fx3600p.h:123