levylabpitt / AFM-Lithography

BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Page Selection is Allowed to Exceed Max Value #58

Closed Monkeymerlot closed 3 years ago

Monkeymerlot commented 3 years ago

Images from AFMs have "pages", ie multiple images contained in the data file. You can swap out the shown image by swapping out the page. However, if the page selected exceeds the number of images in the file, it will produce an error.

The user should not be able to select a page that doesn't exist, and if they do, it should revert to the last image ie the highest index.

So if there are 4 images, the pages for each image are 0, 1, 2, 3. If a user tries to select 4 before the image file is loaded, it should use 3 and change the control value to 3. Upon loading the image, it should not permit users to select a page higher than the max or min values.

Initially submitted by @jlevylab

Monkeymerlot commented 3 years ago

Fixed in develop with commit 309d25c244c3818ee4f687ecbb40697ab26d58f2.