Skip to content

Commit

Permalink
Versioning + wraparound for coarse grid
Browse files Browse the repository at this point in the history
  • Loading branch information
ceds92 committed May 10, 2024
1 parent 998434b commit 20590f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "scanbot"
version = "4.4.0"
version = "4.4.1"
description = "Collection of automated STM and nc-AFM commands compatible with Nanonis V5 SPM Controller"
authors = ["Julian Ceddia <jdceddia@gmail.com>"]
readme = "README.md"
Expand Down
14 changes: 11 additions & 3 deletions scanbot/App/src/Survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Survey() {
3: {autotip: 0, hk_survey: 0, hk_classifier: 0}
});
const [surveyRunning, setSurveyRunning] = useState(false);
const [surveyImages, setSurveyImages] = useState([
const emptyGrid = [
{ src: emptyFrameIcon, alt: "blank image", width: 300, height: 300},
{ src: emptyFrameIcon, alt: "blank image", width: 300, height: 300},
{ src: emptyFrameIcon, alt: "blank image", width: 300, height: 300},
Expand All @@ -28,7 +28,8 @@ function Survey() {
{ src: emptyFrameIcon, alt: "blank image", width: 300, height: 300},
{ src: emptyFrameIcon, alt: "blank image", width: 300, height: 300},
{ src: emptyFrameIcon, alt: "blank image", width: 300, height: 300},
]);
]
const [surveyImages, setSurveyImages] = useState(emptyGrid);
const [surveyIndex, setSurveyIndex] = useState(0);
// const [surveyFinalIndex, setSurveyFinalIndex] = useState(1);
const [surveyTimestamp, setSurveyTimestamp] = useState(0);
Expand Down Expand Up @@ -272,7 +273,7 @@ function Survey() {
useEffect(() => {
const pollingCallback = async () => {
const timestamp = surveyTimestamp
const index = surveyIndex
let index = surveyIndex
const response = await fetch('/image_updates', {
method: 'POST',
headers: {
Expand All @@ -285,9 +286,16 @@ function Survey() {
const blob = await response.blob()
const url = URL.createObjectURL(blob);

const n = parseInt(allFormData[0]['n'])
if(index === n*n){
index = 0
setSurveyImages(emptyGrid)
}

var images = surveyImages
images[index]['src'] = url
setSurveyImages(images)

setSurveyIndex(index + 1)
setSurveyTimestamp(Date.now())
}
Expand Down
4 changes: 2 additions & 2 deletions scanbot/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
# pip install pyinstaller
# Comment out the below ARGS section
# Run the following command:
# pyinstaller --onefile --icon=..\App\public\favicon.ico --add-data "..\App\build;static" --name scanbot_v4.3.0 server.py
# pyinstaller --onefile --icon=..\App\public\favicon.ico --add-data "..\App\build;static" --name scanbot_v4.4.1 server.py

################# ARGS ##################
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--version', action='version', version='scanbot 4.4.0', help='show the version number and exit')
parser.add_argument('--version', action='version', version='scanbot 4.4.1', help='show the version number and exit')
parser.add_argument('-c', '--terminal', action='store_true', help='run scanbot in terminal')
parser.add_argument('-z', '--zulip', action='store_true', help='run scanbot in terminal')
args = parser.parse_args()
Expand Down

0 comments on commit 20590f0

Please sign in to comment.