Closed inki2 closed 3 years ago
@rhomspuron This solves issue #2 New functionality: New menu item / Ctrl+F / new button saves ALL buffered data to file. Some details could be polished but currently focus is on delivering functionality.
Hi @inki2
I try to test it and it raises this exception:
Traceback (most recent call last):
File "/homelocal/rhoms/develop/pycharm/IcepapOSC/icepaposc/window_main.py", line 459, in _save_to_file
self._create_csv_file(fn)
File "/homelocal/rhoms/develop/pycharm/IcepapOSC/icepaposc/window_main.py", line 476, in _create_csv_file
df.to_csv(file_name)
File "/home/rhoms/miniconda/envs/ipap/lib/python2.7/site-packages/pandas/core/generic.py", line 3019, in to_csv
escapechar=escapechar, decimal=decimal)
File "/home/rhoms/miniconda/envs/ipap/lib/python2.7/site-packages/pandas/io/formats/csvs.py", line 44, in __init__
path_or_buf, encoding=encoding, compression=compression, mode=mode
File "/home/rhoms/miniconda/envs/ipap/lib/python2.7/site-packages/pandas/io/common.py", line 232, in get_filepath_or_buffer
raise ValueError(msg.format(_type=type(filepath_or_buffer)))
ValueError: Invalid file path or buffer object type: <class 'PyQt4.QtCore.QString'>
In addition, why you include one dependency of panda? Is it really need it?
I review the code and I have a doubt: Do you save the data continuously or only when you click on the button?
@rhomspuron : I removed the use of pandas. Now the exception should be gone too (I could not recreate it in my environment). Also now there is BOTH manual "Save All From Start" (menu + ctrl+F + save-button) AND continuous save (hardcoded to 5 minute interval). Continuous save is also triggered just before a signal is removed or user presses the clear-button.
@inki2 great, I will start to review the code. Thanks!
@rhomspuron Code is again ready for review. Hopefully I've not left too many bugs around this time.
Added support for saving data to file.