Off Image Display Order

Discussion around the Swiss Micros DM42 calculator.
Jeff O.
Posts: 16
Joined: Fri Jul 21, 2017 8:40 pm

Off Image Display Order

Post by Jeff O. » Wed Mar 07, 2018 6:48 pm

Does anyone know on what the DM42 bases the order in which it cycles through the Off Images? I guess I would have expected alphabetical, but the 36 images I have in my DM42 display in the following order relative to alphabetical: 34, 7, 8, 10, 11, 22, 12, 20, 25, 33... (i.e., the image that would be 34th in an alphabetical listing displays first, the 7th alphabetically displays second, etc.). I thought that it might be the order in which they were added to the Off Image folder, but I deleted the one that displayed first and then added it again, and it still displays first. So I was wondering if it based on something else, and if there is any way to force a display order.

User avatar
Walter
Posts: 726
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Off Image Display Order

Post by Walter » Wed Mar 07, 2018 8:33 pm

On my DM42-Beta the order is alphabetical though not starting at the beginning but constantly with a file somewhere near the end. Also no idea why. :?
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

User avatar
ijabbott
Posts: 87
Joined: Fri Dec 15, 2017 1:34 pm
Location: Manchester, UK

Re: Off Image Display Order

Post by ijabbott » Wed Mar 07, 2018 11:01 pm

They are displayed in raw directory order. If you delete files, it leaves empty spaces in the directory that can be filled by new files. (It's a little more complicated than that, because with VFAT, directory entries are variable length. So when a new file is added to the directory, it needs to find a large enough gap in the directory, or append to the end of the directory.)

I think you can force a particular display order by deleting all the files in the OFFIMG folder and adding them back one at a time in the order you want them to be displayed. To save flash wear, it would be better to rename the OFFIMG folder to OLDIMG, create a new OFFIMG folder, and move (not copy) the images one at a time from OLDIMG to OFFIMG in the desired display order.

Jeff O.
Posts: 16
Joined: Fri Jul 21, 2017 8:40 pm

Re: Off Image Display Order

Post by Jeff O. » Thu Mar 08, 2018 12:54 am

ijabbott wrote:
Wed Mar 07, 2018 11:01 pm
I think you can force a particular display order by deleting all the files in the OFFIMG folder and adding them back one at a time in the order you want them to be displayed. To save flash wear, it would be better to rename the OFFIMG folder to OLDIMG, create a new OFFIMG folder, and move (not copy) the images one at a time from OLDIMG to OFFIMG in the desired display order.
Thanks, that did it.
Creating folders and moving files doesn't cause any flash wear? So I could leave the OLDIMG folder intact, and move images back and forth without wearing flash? (Please pardon my ignorance which I am sure is on full display.)

Thomas Okken
Posts: 455
Joined: Tue May 02, 2017 3:48 pm
Contact:

Re: Off Image Display Order

Post by Thomas Okken » Thu Mar 08, 2018 1:43 am

Jeff O. wrote:
Thu Mar 08, 2018 12:54 am
Creating folders and moving files doesn't cause any flash wear? So I could leave the OLDIMG folder intact, and move images back and forth without wearing flash?
Moving files around does cause some flash wear, but not as much as copying files. When you move files, the file data stays put, but the affected directories do have to be updated.

A directory is essentially just another file, containing a list of file names and pointers to the files' contents. When a directory changes, because of files or subdirectories being added, removed, or renamed, it has to be updated on disk, but this is an operation that is typically optimized to write as little data as possible. Copying a file, on the other hand, is the worst-case scenario: all the sectors of the original file have to be copied to new locations.

Having said all that, I wouldn't worry about it too much. Modern flash memory lasts a long time, and offimg files are small... I don't think you'll wear out the DM42 flash chip that way.

User avatar
Walter
Posts: 726
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Off Image Display Order

Post by Walter » Thu Mar 08, 2018 5:08 am

Thanks to ijabott and Thomas for explaining. Reminded me of something learned long ago but forgotten. IIRC file handling on magnetic disks worked a similar way.
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

Jeff O.
Posts: 16
Joined: Fri Jul 21, 2017 8:40 pm

Re: Off Image Display Order

Post by Jeff O. » Thu Mar 08, 2018 1:49 pm

Walter wrote:
Thu Mar 08, 2018 5:08 am
Thanks to ijabott and Thomas for explaining.
Agreed, thanks for the help and information.
Regarding wearing out the flash, you are probably correct, I will never wear it out and should not worry. But then I think, “if I did 10 flash-wearing operations per day, and the flash is good for 100,000 operations, that’s only 10,000 days! That’s only 27 years!”

keithdalby
Posts: 483
Joined: Mon Apr 24, 2017 6:38 pm

Re: Off Image Display Order

Post by keithdalby » Thu Mar 08, 2018 5:30 pm

Jeff O. wrote:
Thu Mar 08, 2018 1:49 pm
That’s only 27 years!”
With my diet, that'll see me through until I reroll my next character.

User avatar
Walter
Posts: 726
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Off Image Display Order

Post by Walter » Thu Mar 08, 2018 9:40 pm

keithdalby wrote:
Thu Mar 08, 2018 5:30 pm
Jeff O. wrote:
Thu Mar 08, 2018 1:49 pm
That’s only 27 years!”
With my diet, that'll see me through until I reroll my next character.
Are you going to queue for rebirth?
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

mcc
Posts: 157
Joined: Fri Jun 23, 2017 3:10 am

Re: Off Image Display Order

Post by mcc » Thu Mar 08, 2018 10:25 pm

Hi,
Jeff O. wrote:
Thu Mar 08, 2018 1:49 pm
Agreed, thanks for the help and information.
Regarding wearing out the flash, you are probably correct, I will never wear it out and should not worry. But then I think, “if I did 10 flash-wearing operations per day, and the flash is good for 100,000 operations, that’s only 10,000 days! That’s only 27 years!”
A colleque of mine said, that the 100000 write cycles were combined with the 20 years of quaranteed data integrity.
After that the flash dont stop working suddenly but you may loose the long term data integrity.

I haven't checked that practically though but searching for according tests with the Atmel mcu for the Arduino project (keyword "flash destroyer") may be worth searching/reading.

HTH!
Cheers Meino
DM 42 - SN: 00373, Firmware v.:3.7 / 3.7.1 as compiled by SwissMicros

Post Reply