WP31s error recovery
03-04-2015, 12:56 AM
Post: #21
 Bit Member Posts: 265 Joined: Jan 2014
RE: WP31s error recovery
(03-03-2015 01:58 PM)rprosperi Wrote:  Good idea to wait a bit (get it? ). Walter is away for a couple days, and best if he verifies w/the docs, etc. It's odd that it took this long for such an issue to be discovered. Can you tell if the code with the issue is original 31S release level?

I'll wait...

I'm not sure what exactly you mean by original 31S release level. The problem is not related to my other patches, it's present in the official versions. It's been present for a long time but I don't know when it was introduced, you'd need to bisect the code to figure it out, which is not something I have the time for right now.
03-04-2015, 01:02 AM
Post: #22
 Bit Member Posts: 265 Joined: Jan 2014
RE: WP31s error recovery
(03-03-2015 08:48 PM)Dieter Wrote:
(03-03-2015 08:10 PM)BarryMead Wrote:  Dieter: That dot is the "Stack Size Indicator" with stack size of 4 you get one dot, with stack size 8 you get two dots (looks like a colon).

I see. Not a bad idea, but I would prefer having this indicator always on the same spot, preferably on the far left as it is now in YDON mode.

I agree that a consistent location for the stack size indicator would be preferable, but you'd need to sacrifice something in YDOFF+DBLON mode. What would you do exactly? I didn't implement something like that originally because I didn't want to change the display in YDOFF mode. Feel free to suggest improvements either in the thread about the patches or in a private message.
03-04-2015, 01:08 AM
Post: #23
 Bit Member Posts: 265 Joined: Jan 2014
RE: WP31s error recovery
(03-03-2015 09:20 PM)BarryMead Wrote:  [...] you will need to make significant changes to the following files:
QtKeyCode.cpp QtKeyCode.h
QtSkin.cpp QtSkin.h
QtKeyboard.cpp QtKeyboard.h

All of these cpp and header files have references to the hShifted state of the key, and would need to be modified to fShifted.

You'll need to take care of the Preferences dialog, too. Search for shift in QtPreferencesDialog.cpp and QtPreferencesDialog.h.
03-04-2015, 02:17 AM (This post was last modified: 03-04-2015 02:21 AM by Sanjeev Visvanatha.)
Post: #24
 Sanjeev Visvanatha Member Posts: 239 Joined: Dec 2013
RE: WP31s error recovery
(03-04-2015 12:56 AM)Bit Wrote:  I'm not sure what exactly you mean by original 31S release level. The problem is not related to my other patches, it's present in the official versions. It's been present for a long time but I don't know when it was introduced, you'd need to bisect the code to figure it out, which is not something I have the time for right now.

I had some time to dig around. It looks like the issue was introduced at the time of the UNDO implementation at r3551. I loaded a commit before that (r3532) that I had committed before the UNDO implementation, and the Back Arrow (<-) behaviour for the 1st example is identical to the WP 34S.

I believe it was Pauli that implemented UNDO at r3551. It is not unreasonable that an unexpected 'feature' was introduced.

-- Sanjeev Visvanatha
03-04-2015, 02:48 AM
Post: #25
 rprosperi Senior Member Posts: 2,221 Joined: Dec 2013
RE: WP31s error recovery
(03-04-2015 12:56 AM)Bit Wrote:  I'm not sure what exactly you mean by original 31S release level.

All I meant was referring to when the 31S was initially released in "final" form, following a fair amount of testing within the community that likely would have found this issue. Just wondering when the problem was introduced. No offense meant about your code, indeed the problem is seen in build 3680 which predates any of your enhancements.

Possibly, it's been there all along and no one ever noticed; since it's such a basic issue, perhaps no one tested simple things like this. I certainly didn't.

--Bob Prosperi
03-04-2015, 06:22 AM
Post: #26
 Paul Dale Senior Member Posts: 1,234 Joined: Dec 2013
RE: WP31s error recovery
I'm not going to get a chance to look at this very quickly. Marcus? Bit?

- Pauli
03-04-2015, 06:24 AM
Post: #27
 Paul Dale Senior Member Posts: 1,234 Joined: Dec 2013
RE: WP31s error recovery
(03-04-2015 02:17 AM)Sanjeev Visvanatha Wrote:  I believe it was Pauli that implemented UNDO at r3551. It is not unreasonable that an unexpected 'feature' was introduced.

I wouldn't be at all surprised if I introduced the problem. UNDO was a pretty radical change, although the implementation seemed straightforward (which is always a warning sign in software).

- Pauli
03-04-2015, 01:00 PM (This post was last modified: 03-04-2015 01:07 PM by Sanjeev Visvanatha.)
Post: #28
 Sanjeev Visvanatha Member Posts: 239 Joined: Dec 2013
RE: WP31s error recovery
(03-04-2015 06:24 AM)Paul Dale Wrote:  I wouldn't be at all surprised if I introduced the problem. UNDO was a pretty radical change, although the implementation seemed straightforward (which is always a warning sign in software).

Exactly. This was the intent of my comment, but you worded it so much more eloquently.

-- Sanjeev Visvanatha
03-04-2015, 01:30 PM
Post: #29
 Dieter Senior Member Posts: 1,664 Joined: Dec 2013
RE: WP31s error recovery
(03-04-2015 01:02 AM)Bit Wrote:  I agree that a consistent location for the stack size indicator would be preferable, but you'd need to sacrifice something in YDOFF+DBLON mode.

I admit I only tried your 31s version (3748), so there is no DP mode. What exactly are the problems with DP and the Y-display?

(03-04-2015 01:02 AM)Bit Wrote:  What would you do exactly?

Maybe I'd use a completely different solution: take advantage of the annunciators offered by the 20B/30B hardware. For instance, if SSIZE8 is the default, you could turn on the down-arrow indicator in SSIZE4 to indicate the lower stack height. ;-)

Seriously – wouldn't that be an elegant solution?

Dieter
03-04-2015, 02:02 PM
Post: #30
 Bit Member Posts: 265 Joined: Jan 2014
RE: WP31s error recovery
(03-04-2015 06:22 AM)Paul Dale Wrote:  I'm not going to get a chance to look at this very quickly. Marcus? Bit?

Although the UNDO feature is tricky, fixing this particular issue is not very difficult. If Walter (or someone else in charge of the 31S) confirms what behavior we really need, I can definitely make that happen. However, I'm very snowed under at the moment, so it might take a week or two.
03-05-2015, 04:15 AM
Post: #31
 Bit Member Posts: 265 Joined: Jan 2014
RE: WP31s error recovery
(03-04-2015 01:30 PM)Dieter Wrote:  I admit I only tried your 31s version (3748), so there is no DP mode. What exactly are the problems with DP and the Y-display?
With Y register display off, a big 'D' character in the upper left corner indicates double precision mode. The date mode indicator is right after that 'D' (if you aren't in D.MY mode). There's simply no space left for the dots. But if enable the NO_DATEMODE_INDICATION compile time option in features.h and sacrifice the date mode indicator, then the stack size indicator will appear in the upper left corner just as you suggested.

(03-04-2015 01:30 PM)Dieter Wrote:  Maybe I'd use a completely different solution: take advantage of the annunciators offered by the 20B/30B hardware. For instance, if SSIZE8 is the default, you could turn on the down-arrow indicator in SSIZE4 to indicate the lower stack height. ;-)

Seriously – wouldn't that be an elegant solution?

The down arrow is used to indicate lower case character entry in alpha mode in the 34S.

Have you seen the MODIFY_BEG_SSIZE8 compile time option? It makes the 'BEG' annunciator indicate an 8-level ('big') stack.
03-05-2015, 04:58 AM
Post: #32
 Paul Dale Senior Member Posts: 1,234 Joined: Dec 2013
RE: WP31s error recovery
(03-05-2015 04:15 AM)Bit Wrote:  The down arrow is used to indicate lower case character entry in alpha mode in the 34S.

In alpha mode you probably care less about the stack depth. Still likely to be confusing.

Pauli
Post: #33
 BarryMead Senior Member Posts: 361 Joined: Feb 2014
RE: WP31s error recovery
(03-04-2015 12:52 AM)Bit Wrote:
(03-02-2015 05:43 PM)Bit Wrote:
Even better: [f] [UNDO] switches between two saved states, or in other words, you can undo the undo operation. This patch also takes care of saving the undo state in the emulators.
I applied Bit's "Even Better" Undo patch and rebuilt the binary file for the wp31s. If anyone wants to give it a try (allows UNDO of UNDO), unzip and flash your wp31s with the attached zipped binary file.

Attached File(s)
03-05-2015, 08:04 PM (This post was last modified: 03-05-2015 08:11 PM by Dieter.)
Post: #34
 Dieter Senior Member Posts: 1,664 Joined: Dec 2013
RE: WP31s error recovery
(03-05-2015 07:31 PM)BarryMead Wrote:  I applied Bit's "Even Better" Undo patch and rebuilt the binary file for the wp31s. If anyone wants to give it a try (allows UNDO of UNDO), unzip and flash your wp31s with the attached zipped binary file.

Hmm... I was quite surprised to find that already Bit's earlier version 3748 (more exactly: the one you recently posted as wp31s.zip) has a kind of UNDO of UNDO:

Code:
1 [ENTER] 2 [ENTER] 3 [ENTER] 4 T  1       1       1       0 Z  2       1       2       1  Y  3       2       3       2 X  4      12       4       3      [x]    [UNDO]  [UNDO]

What's different in the newer version?

Dieter
03-05-2015, 08:13 PM
Post: #35
 rprosperi Senior Member Posts: 2,221 Joined: Dec 2013
RE: WP31s error recovery
(03-05-2015 08:04 PM)Dieter Wrote:
(03-05-2015 07:31 PM)BarryMead Wrote:  I applied Bit's "Even Better" Undo patch and rebuilt the binary file for the wp31s. If anyone wants to give it a try (allows UNDO of UNDO), unzip and flash your wp31s with the attached zipped binary file.

Hmm... I was quite surprised to find that already Bit's earlier version 3748 (more exactly: the one you recently posted as wp31s.zip) has a kind of UNDO of UNDO:

Code:
1 [ENTER] 2 [ENTER] 3 [ENTER] 4 T  1       1       1       0 Z  2       1       2       1  Y  3       2       3       2 X  4      12       4       3      [x]    [UNDO]  [UNDO]

What's different in the newer version?

Dieter

Undo of Undo should put you back to 1,1,2,12 since it is undo-ing the last operation, back to it's prior state.

--Bob Prosperi
03-05-2015, 08:25 PM
Post: #36
 Dieter Senior Member Posts: 1,664 Joined: Dec 2013
RE: WP31s error recovery
(03-05-2015 04:58 AM)Paul Dale Wrote:
(03-05-2015 04:15 AM)Bit Wrote:  The down arrow is used to indicate lower case character entry in alpha mode in the 34S.

In alpha mode you probably care less about the stack depth. Still likely to be confusing.

I see it's always a tradeoff between keeping things consistent between 34s and 31s, and possible improvements in handling and usage. There are quite a few things that are done differently on the 31s, compared to the 34s. So I do not think that the down-arrow annunciator would confuse 31s users just because it signals lowercase alpha entry on the 34s. This is also true for the problem with the big D for DP mode that is not available on the 31s (neither the mode nor the D ;-)), so the respective problem will never arise on a 31s.

Bit has already implemented some nice improvements that are only available on the 31s, but not on the 34s. I think a better stack size indicator could be another 31s-specific improvement.

Dieter
Post: #37
 BarryMead Senior Member Posts: 361 Joined: Feb 2014
RE: WP31s error recovery
(03-05-2015 08:13 PM)rprosperi Wrote:
(03-05-2015 08:04 PM)Dieter Wrote:  Hmm... I was quite surprised to find that already Bit's earlier version 3748 (more exactly: the one you recently posted as wp31s.zip) has a kind of UNDO of UNDO:

Code:
1 [ENTER] 2 [ENTER] 3 [ENTER] 4 T  1       1       1       0 Z  2       1       2       1  Y  3       2       3       2 X  4      12       4       3      [x]    [UNDO]  [UNDO]

What's different in the newer version?

Dieter

Undo of Undo should put you back to 1,1,2,12 since it is undo-ing the last operation, back to it's prior state.
Bob: I just flashed one of my wp34s calculators with the NEW wp31s.bin image and the UNDO of UNDO works as expected.
I do get 1,1,2,12 back in the registers after the 2nd UNDO using your example. I suspect that you flashed your calc with the
version and the UNDO of UNDO will work.
03-05-2015, 08:35 PM
Post: #38
 Dieter Senior Member Posts: 1,664 Joined: Dec 2013
RE: WP31s error recovery
(03-05-2015 08:13 PM)rprosperi Wrote:  Undo of Undo should put you back to 1,1,2,12 since it is undo-ing the last operation, back to it's prior state.

So it's a kind of UNDOing the UNDO, maybe something like a RESTORE. ;-)

I don't know which solution I would prefer. Version 1 is similar to Windows programs with an Undo-history (e.g. Excel or Photoshop): every CTRL+Z steps one operation back in history. Likewike CTRL+R goes one step forward. Other programs without operation history (e.g. Notepad) behave the way the "improved UNDO" seems to work: Pressing CTRL+Z several times simply switches between the previous and current state. Both solutions have their advantages.

Dieter
Post: #39
 BarryMead Senior Member Posts: 361 Joined: Feb 2014
RE: WP31s error recovery
(03-05-2015 08:35 PM)Dieter Wrote:
(03-05-2015 08:13 PM)rprosperi Wrote:  Undo of Undo should put you back to 1,1,2,12 since it is undo-ing the last operation, back to it's prior state.

So it's a kind of UNDOing the UNDO, maybe something like a RESTORE. ;-)

I don't know which solution I would prefer. Version 1 is similar to Windows programs with an Undo-history (e.g. Excel or Photoshop): every CTRL+Z steps one operation back in history. Likewike CTRL+R goes one step forward. Other programs without operation history (e.g. Notepad) behave the way the "improved UNDO" seems to work: Pressing CTRL+Z several times simply switches between the previous and current state. Both solutions have their advantages.

Dieter
Dieter: I just applied Bit's patch and ran my compiler. Bit would be better qualified to address your preferences on UNDO behavior than I would. Personally, I think it is a well defined, elegant solution, with clean boundary conditions, and manageable memory utilization.
03-05-2015, 09:39 PM (This post was last modified: 03-05-2015 09:44 PM by rprosperi.)
Post: #40
 rprosperi Senior Member Posts: 2,221 Joined: Dec 2013
RE: WP31s error recovery
(03-05-2015 08:29 PM)BarryMead Wrote:  Bob: I just flashed one of my wp34s calculators with the NEW wp31s.bin image and the UNDO of UNDO works as expected.
I do get 1,1,2,12 back in the registers after the 2nd UNDO using your example. I suspect that you flashed your calc with the
version and the UNDO of UNDO will work.

Barry: I didn't flash anything, I was just aswering Dieter's inquiry about what Undo of Undo should do.

A multi-step undo would be lovely of course, but not feasible for these memory-constrained machines.

The Undo of Undo back to just prior staet (flipping back and forth as it were) is, IMHO, the best solution as it's utterly consistent with the definiton of Undo and it gets you back to the stack you really may have wanted when you hit Undo the first time (something many Undos don't do).

BTW: Thanks for jumping all the way in and becoming another 31S/34S contributor! Like Pascal, Sanjeev, Jonathan and Bit before you, it lets more stuff get done without necessarily having to add work for Pauli or Marcus, plus adds some new eyes, ears and ideas from folks that can actually see and understand the code.