Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
total_control_app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Drechsler
total_control_app
Commits
ddd01088
Commit
ddd01088
authored
May 30, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image save button improved, so that it wont overwrite
parent
7861a4d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
cameraGui.py
cameraGui.py
+14
-2
No files found.
cameraGui.py
View file @
ddd01088
...
...
@@ -18,6 +18,7 @@ from subclasses.controllayouts import LaserControlLayout, LaserScanLayout
from
subclasses.cameraParameterFrame
import
CameraParameterFrame
from
resources.scanFunctions
import
create_measurement_array
from
resources.storage
import
get_date_string
from
resources.messages
import
show_warning
from
appsettings
import
WORKING_DIR
from
measurement
import
MeasurementFrame
import
sys
,
os
...
...
@@ -316,7 +317,7 @@ class CameraGuiMainWindow(QMainWindow):
measure_params
[
'comment'
]
=
self
.
measurementFrame
.
comments
.
toPlainText
()
for
l
in
LaserControlLayout
.
_registry
:
for
sb_name
,
sb
in
l
.
spinboxes
.
items
():
measure_params
[
'sb_name'
]
=
sb
.
value
()
measure_params
[
sb_name
]
=
sb
.
value
()
for
roi
in
self
.
rois
:
measure_params
[
'Roi Pos'
]
=
roi
.
pos
()
...
...
@@ -324,11 +325,22 @@ class CameraGuiMainWindow(QMainWindow):
self
.
signalWithMeasurementParameters
.
emit
(
measure_params
)
def
save_current_image
(
self
):
if
self
.
cameraParamFrame
.
imagePrefix
.
text
()
==
''
:
show_warning
(
'You have to write a filename'
)
return
if
'.'
in
self
.
cameraParamFrame
.
imagePrefix
.
text
():
show_warning
(
'No points in your filename please'
)
return
saving_directory
=
WORKING_DIR
+
get_date_string
()
if
not
os
.
path
.
exists
(
saving_directory
):
os
.
makedirs
(
saving_directory
)
os
.
makedirs
(
saving_directory
+
'/images'
)
np
.
save
(
saving_directory
+
'/images/'
+
self
.
cameraParamFrame
.
imagePrefix
.
text
(),
self
.
current_image
)
filename
=
saving_directory
+
'/images/'
+
self
.
cameraParamFrame
.
imagePrefix
.
text
()
if
os
.
path
.
isfile
(
filename
+
'.npy'
):
show_warning
(
'File already exists!'
)
else
:
np
.
save
(
filename
,
self
.
current_image
)
def
__del__
(
self
):
print
(
"chau gui"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment