maxthemouse / ezconcert Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sgasilov/ezconcert
Ezconcert is a gui for creating an interface for users at the beam-line.
This project forked from sgasilov/ezconcert
Ezconcert is a gui for creating an interface for users at the beam-line.
Need to check the camera trigger mode before setting. The driver will error if the mode is set to the same mode that it is already in. This might be a good idea to check in general.
Reported that the program freezes when saving single images while live on mode is active.
User reported that error occurs when motion is started while stage is still moving. Message to wait occurs as expected but there can be exception due to Qtimer.
Should do one of:
Should have an appropriate license and copyright file.
I have gotten permission to use BSD 3-Clause License rather than a CLS specific license.
Need to display some kind of fault information in the gui. Need to be able to clear the faults. Perhaps this can be automatic.
One situation where this will happen is when the user is attaching a sample and they put more torque on the stage than the brake can handle. The stage will move and go into an error condition. The over-current fault needs to be cleared before the stage can be used again.
Make additions to the gui.
Ideas for control
open
textclose
textIndicator
The return button does not seem to do anything. Is it connected? What is the expected function? Should it read values from somewhere?
Make improvements to the logging system.
No perfect overlap between the 0 and 180 projections in AUTO scan - like a pixel or half off.
Seems like the images at 0 and 180 degrees are not exact. This might be timing. This might be in how the velocity is calculated. This might not assume that the last point should be exactly 180 degrees from the start.
Print statements are used for debugging. This might interfere with Qt or be less stable.
Example.
Use a Message Handler.
import sys
from PyQt5 import QtCore, QtWidgetsdef qt_message_handler(mode, context, message):
if mode == QtCore.QtInfoMsg:
mode = 'INFO'
elif mode == QtCore.QtWarningMsg:
mode = 'WARNING'
elif mode == QtCore.QtCriticalMsg:
mode = 'CRITICAL'
elif mode == QtCore.QtFatalMsg:
mode = 'FATAL'
else:
mode = 'DEBUG'
print('qt_message_handler: line: %d, func: %s(), file: %s' % (
context.line, context.function, context.file))
print(' %s: %s\n' % (mode, message))QtCore.qInstallMessageHandler(qt_message_handler)
app = QtWidgets.QApplication(sys.argv)
def main():
QtCore.qDebug('something informative')
win = QtWidgets.QMainWindow()
# trigger a Qt debug message
win.setLayout(QtWidgets.QVBoxLayout())main()
Reported that the live window opened while changing the display limts.
User request to save a specific number of images when doing stream to disk. The request was for 10 images or some other number.
This would require an input to the GUI.
The current behavior is to stream to disk as fast as possible until the button to stop is pressed. A counter might be possible as well.
Want to have a consistent handling of the start position for scans.
start
. If the distance to the position is long (> 360) give a warning and ask if the user wants to use home
to get to the start.start position
start position.
Note. Want to avoid large motions that will take a long time. Wrapping the stage around could be a problem for cables, etc.
Need to check the camera trigger mode before setting. The driver will error if the mode is set to the same mode that it is already in. This might be a good idea to check in general.
New scan mode requested.
This is the mode in Camware. You start recording and can stop at anytime. This is quite common with camera programs and goes by various names. This is a sequence acquisition but with interactive control.
The requested mode is with Auto trigger mode which is the fast mode for the Dimax camera.
The EDC (Epics Devices for Concert) is currently a sub module in a larger project, soft-ioc. It would be useful to move the concert specific part to ezconcert.
Scan doesn't run. There is a problem with setting the camera. A dummy camera is used but it doesn't have the correct attributes. Probably need to avoid the camera as it is not needed. The required settings are passed already.
There sometimes extra triggers sent or camera takes an additional image.
User report:
Set-up:
PCOEdge 5-5 with 2x
20ms exposure ->cameware
20ms exposure -> GUI
5ms delay -> GUI
Mode -> Half-acquisitionSo in halfaq mode there is a unique combination of values which lead to an additional projection being grabbed.
I initially start with 2000 projections , 20 flats, 20 darks -> no issues
Tried 3000 projections, 20 flats, 20 darks -> no issues
Tried 4000 projectinos, 20 flats, 20 darks -> 4001 projections are grabbed in cameware so you miss 1 * x images on your final projection. i.e. If you want 4 views you should allocate 16160 projections, however on view 4, 4 projections are lost.Temporary work around ๏ set allocation to 4041 * views in allocation dialogue. This is annoying though as you must delete this extra view for the half-aq stitching to work as it needs an even about of images to stitch..
Extra images is not a serious issue as it is at most an inconvenience to delete them.
The likely issue is the extra distance padding added to insure that there are no images lost can add an image. Need to look at details of how the distance is calculated and set. This could be a numeric round-off issue.
It would be useful to have a utility for doing ttl pulses.
Generate-TTL
Motor control - would be good to have relative move entry.
Currently, there is only absolute motion control. Add a relative motion. Should look at CLS programs and follow that design. Eg have three fields in a row:
Go
buttonThis will likely require a redesign of that space to be clear. Change the absolute motion to follow the same pattern
Go
buttonWill need a bit of design work to avoid too much clutter or confusing labels and buttons in a small area.
The draft manual claims that the stage will stop before the data is read from the camers. Currently, the data is read first and then the stage is stopped. Should it be changed? Currently, it has only been tested in the current mode.
There are a few settings to think about for the rotation stage. It is also desirable to not clutter the gui too much. One possibility is to add a button to open a configuration window to set values.
User request to not return the vertical scan at the end of the scan. This was for a case where multiple steps were used but not all at once. The reason was so that the sample could be adjusted between steps. The vertical stage is very slow and returning to the start required moving back each time.
This would add a selection to the GUI.
If the stage is in freerun mode and is moving it is not possible to stop the stage using Stop All
or Home
. Either of these functions should work.
Want to add to the gui.
Noted that the exposure time for the Dimax camera did not behave as expected.
Apparently at very fast fps frame are not necessarily stored in the memory chronologically
Combine various utility scripts into one program. Could be a gui or a command-line program. It has be be easy for people to use.
Although there are some checks the scan will freeze if the Live On
function is still running. Probably need to run the Live Off
function before a scan runs or show a message.
Typical software like Camware and HCImage can take a sequence of images and save it. This mode is to simple click start and have the camera take a sequence of the specified number of images. Saving can be optional if the sequence is stored in RAM first.
Currently, motors and the like are hard-coded. It would be better to have a configuration file to define a specific set of motors, shutters, PVs.
A specific design has not been decided on. The file might be read into an object or a dictionary.
It looks like a lot of the logging is appearing in two log files; ezconcert.log and edc.log.
Print statements are used for debugging. This might interfere with Qt or be less stable.
Example.
Use a Message Handler.
import sys
from PyQt5 import QtCore, QtWidgetsdef qt_message_handler(mode, context, message):
if mode == QtCore.QtInfoMsg:
mode = 'INFO'
elif mode == QtCore.QtWarningMsg:
mode = 'WARNING'
elif mode == QtCore.QtCriticalMsg:
mode = 'CRITICAL'
elif mode == QtCore.QtFatalMsg:
mode = 'FATAL'
else:
mode = 'DEBUG'
print('qt_message_handler: line: %d, func: %s(), file: %s' % (
context.line, context.function, context.file))
print(' %s: %s\n' % (mode, message))QtCore.qInstallMessageHandler(qt_message_handler)
app = QtWidgets.QApplication(sys.argv)
def main():
QtCore.qDebug('something informative')
win = QtWidgets.QMainWindow()
# trigger a Qt debug message
win.setLayout(QtWidgets.QVBoxLayout())main()
Closing or opening the shutter can throw an exception when the state is already closed or opened. need to catch the TransitionNotAllowed error.
Trying to move the motor can throw an exception. The error is that the state is 'moving' and not in a state that it can use.
Request:
The hardware is not always available due to it being in use. Need to be able to switch to dummy devices for testing.
All scans should return to the start.
The current behavior is to ignore the checkbox for including the end point. This might only be needed for the step and shoot scan. This should be checked for the step and shoot and for PSO-based triggered scans.
There are places in the code that use function()
, join()
and result()
in inconsistent ways. These are various ways of using futures to return right away or wait until done. Note that the function have to synchronous functions for the future to work.
join()
to wait until done.The stage was left in a moving stage after a PSO scan or perhaps due to an aborted scan. The question arose on how to stop the stage. The stop all button should have done this. Check this function more and look at adding a separate abort/reset program for dealing with such issues. It could include a display of faults and conditions. Would be useful for diagnosis and monitoring the status of the stage.
User reported that a scan with 2 images does not stop after the images are taken. The trigger mode is with software. For example the points are at 0 and 180.
In gui.py two timers are initialized;
self.total_experiment_time = QTimer()
self.last_inner_loop_scan_time = QTimer()
However, in the code there are things like: self.total_experiment_time = time.time()
Seems like start
, stop
methods should be used on the QTimer instead to measure the time.
Error occurs after the scan. Exception is: float object has no attribute 'to'.
This probably an error with using a float instead of a quantity.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.