wp34s ui tweaks



#14

I implemented several minor changes to keyboard/display interface. I tied them to enablers in features.h so default builds act as they did before.

1. DEFAULT_DATEMODE

Specifies "default" date mode, the one that is not shown when selected. I tried to set my favorite y.md format and discovered that I cannot work like that since y.md hovers in top line ALL THE TIME. So I pretty much had to switch back to d.my. You would want to change this feature if your favorite mode is other than d.my

Additionally, when DEFAULT_DATEMODE is undefined, there is no date indication whatsoever. Since datemode is something that you set once and never touch, maybe it is the right setting for some because it saves a few bytes.

2. MODIFY_BEG_SSIZE8

When defined, changes the meaning of BEG annunciator. Now it is lit when stack size is 8 (think of BEG as BIG with typo). I found that I like the flexibility of 2 stack sizes, but most of the time I want to use 4 levels + 4 easy to access registers a,b,c,d. So when some library program (or myself) sneakily changes that, I want some visual indication.

3. MODIFY_K62_E3_SWITCH

When defined, modifies meaning of [h] [./,] in DECM mode. Instead of changing radix symbol it turns on/off thousand separator, similar to INT mode.

Here is the patch (preserves original settings). Would you please incorporate it into build?

Index: display.c
===================================================================
--- display.c (revision 3412)
+++ display.c (working copy)
@@ -14,6 +14,7 @@
* along with 34S. If not, see <http://www.gnu.org/licenses/>.
*/

+#include "features.h"
#include "xeq.h"
#include "storage.h"
#include "display.h"
@@ -485,13 +486,21 @@
}

if (!is_intmode()) {
+#ifdef DEFAULT_DATEMODE
switch (UState.date_mode) {
- //case DATE_DMY: q = "d.my\006\006"; break;
+#if (DEFAULT_DATEMODE!=0)
+ case DATE_DMY: q = "d.my\006\006"; break;
+#endif
+#if (DEFAULT_DATEMODE!=1)
case DATE_YMD: q = "y.md\006\006"; break;
+#endif
+#if (DEFAULT_DATEMODE!=2)
case DATE_MDY: q = "m.dy\006\006"; break;
+#endif
default: q = " \006"; break;
}
p = scopy(p, q);
+#endif
p = scopy(p, (get_trig_mode() == TRIG_GRAD)?"\006\006\007":" \006\006\006");
} else {
switch(int_mode()) {
@@ -1614,7 +1623,11 @@
* typing lower case in alpha mode. Turn the big equals if we're
* browsing constants.
*/
+#ifdef MODIFY_BEG_SSIZE8
+ dot(BEG, UState.stack_depth && ! Running);
+#else
dot(BEG, state_pc() <= 1 && ! Running);
+#endif
dot(INPUT, State2.catalogue || State2.alphas || State2.confirm);
dot(DOWN_ARR, (State2.alphas || State2.multi) && State2.alphashift);
dot(BIG_EQ, get_user_flag(A_FLAG));
Index: features.h
===================================================================
--- features.h (revision 3412)
+++ features.h (working copy)
@@ -157,7 +157,27 @@
// Right-justify seven-segment exponent (007 rather than 7 )
//#define INCLUDE_RIGHT_EXP

+// h ./, in DECM mode switches E3 separator on/off (instead of chnaging radix symbol)
+//#define MODIFY_K62_E3_SWITCH

+// BEG annunciators indicates BIG stack size rather than beginning of program
+//#define MODIFY_BEG_SSIZE8
+
+/*
+ * This setting allows to change default mode to one of the other 2
+ * possibilities. The date mode equal to DEFAULT_DATEMODE will not be
+ * announced, the other 2 will be.
+ * When undefined, there will be no indication of date mode (other than result
+ * of date operations).
+ * Since date mode is something that does not change often, or even at all,
+ * undefining this feature may be worth its bytes in savings. To implement
+ * original behaviour set DEFAULT_DATEMODE to 0.
+ * See enum date_modes for values of
+ * DATE_DMY=0, DATE_YMD=1, DATE_MDY=2
+*/
+#define DEFAULT_DATEMODE 0
+
/*******************************************************************/
/* Below here are the automatic defines depending on other defines */
/*******************************************************************/
Index: keys.c
===================================================================
--- keys.c (revision 3412)
+++ keys.c (working copy)
@@ -14,6 +14,7 @@
* along with 34S. If not, see <http://www.gnu.org/licenses/>.
*/

+#include "features.h"
#include "xeq.h"
#include "keys.h"
#include "display.h"
@@ -783,7 +784,11 @@
// Row 7
OP_NIL | OP_OFF,
_RARG | RARG_PAUSE,
+#ifdef MODIFY_K62_E3_SWITCH
+ OP_NIL | OP_THOUS_OFF,
+#else
OP_NIL | OP_RADCOM,
+#endif
STATE_UNFINISHED, // P/R
OP_SPEC | OP_SIGMAPLUS | NO_INT
};
@@ -797,8 +802,12 @@
case K62:
if (UState.intm)
op = UState.nointseparator ? (OP_NIL | OP_INTSEP_ON) : (OP_NIL | OP_INTSEP_OFF);
- else if (UState.fraccomma)
- op = OP_NIL | OP_RADDOT;
+ else
+#ifdef MODIFY_K62_E3_SWITCH
+ if (UState.nothousands) op = OP_NIL | OP_THOUS_ON;
+#else
+ if (UState.fraccomma) op = OP_NIL | OP_RADDOT;
+#endif
break;

case K63: // Program<->Run mode

Edited: 21 June 2013, 11:05 p.m.


#15

Incorporated but all turned off.

I modified the data behaviour to not allow the display to be excluded. I.e. undefined is as before this patch.


- Pauli


#16

Thanks.

Quote:
I modified the data behaviour to not allow the display to be excluded

Uh-oh. That was actually the mode I was going for. I personally find datemode indication way too intrusive. Even when I want to temporary switch to non-default mode, I do not want those constant reminders.

Would extra feature "#define NO_DATEMODE_INDICATION" be more in line with the coding style?


#17

Andrew, I'm with you here. The mode indicators in the pixel area are quite intrusive. I don't mind them in binary mode but for one time settings I'd like an option to hide them.

#18

You could always compile with

#define INCLUDE_YREG_CODE
uncommented (in features.h) and then, after setting Flag J, you'll have the y-register displayed instead of the date format!

Nigel (UK)


#19

Nigel,

why flag J, why not flag Y?


#20

I chose Flag J because it's on the x<->y key (not entirely logical, but good enough for me!). I didn't choose Flag Y because I think of it as one of the user flags that people are likely to use in their normal programming. The WP-34s has an awful lot of flags, of course! Clashes are probably unlikely whichever flag is chosen.

Nigel (UK)

#21

I've added the NO_DATEMODE_INDICATION option to features.h and it is disabled by default.

I do agree that the date mode indication is a little intrusive, however the few times I do change it, I definitely want to know. It is more important to display this than degrees/radians IMO. At least with degrees vs radians I've got a feel for the kind of answers to expect and realise the error quickly. Degrees vs gradians would be a problem however, but I never use the latter.

The D.MY default was an easy choice. By far the majority of countries and the world's population use this format. That it also covers all of the principle authors made the choice even easier :)


- Pauli


#22

Pauli, thanks.

For the record, I did not question the validity of d.my as THE choice for standard default setting. However, from my point of view it is only slightly lesser abomination than m.dy, so I appreciate an option not to use it.

Also, I think that rad/deg/grad indication is adequate. I agree with you on principle, but somehow, internet is full of posts "how comes my calculator gives me garbage for an answer?" immediately followed by "figured it out -- radians mode". Maybe, if I ever use grads, I will start thinking that hovering g is intrusive, but not today.


#23

For the record, please see p. 47 of your printed manual. We'd have appreciated any opportunity for a smaller indication but had to accept the display as it is. Writing this, however, the following idea crossed my mind like a neutrino: how about using a subscript Y instead of y.md for indicating the second widest spread date format? Would be really tiny.

d:-)


#24

We don't have a spare character in the character set for a subscript Y.

- Pauli


#25

Quote:
We don't have a spare character in the character set for a subscript Y.

Hmmh, I see a subscript Y on my WP 34S.

d;-)


#26

Guess I'm blind at the moment :-(

- Pauli


Possibly Related Threads...
Thread Author Replies Views Last Post
  [WP34S] WP34S firmware on the AT91SAM7L-STK dev kit? jerome ibanes 1 404 10-04-2012, 04:59 PM
Last Post: Paul Dale
  [wp34s] Incomplete Gamma on the wp34s Les Wright 18 1,529 12-06-2011, 11:07 AM
Last Post: Namir
  [wp34s] Romberg Integration on the wp34s Les Wright 2 512 12-04-2011, 10:49 PM
Last Post: Les Wright
  HP-16C sim has new UI features Cameron Paine 11 996 05-02-2004, 07:53 PM
Last Post: Andrés C. Rodríguez (Argentina)

Forum Jump: