lambcutlet / DPS5005_pyGUI

A python gui to display & control DPS5005 power supply
GNU General Public License v3.0
71 stars 18 forks source link

CSV view #14

Closed HBerecz closed 5 years ago

HBerecz commented 6 years ago

The CSV view does not work. I get the following IndexError although I used your newest files:

Traceback (most recent call last): File "D:\DPS3005-py\3\dps_GUI_program.py", line 388, in pushButton_CSV_view_clicked self.graph_X = [row[0] for row in self.CSV_list] # Xaxis - time interval File "D:\DPS3005-py\3\dps_GUI_program.py", line 388, in self.graph_X = [row[0] for row in self.CSV_list] # Xaxis - time interval IndexError: list index out of range

2018-06-12-20-05-58.zip

lambcutlet commented 6 years ago

Your file has a blank row after each row containing values. Odd as it is it does not cause me any issues. Your file opens perfectly. The current falls exponentially from 124mA to 82mA. Screenshot from 2018-09-27 21-02-40.png.zip

lambcutlet commented 6 years ago

Confirmed, in windows it fails as you mention above. In linux it works. i'll look into it.

HBerecz commented 6 years ago

attached is a copy of another csv file that I saved after I had changed line 517 in your newest dps_GUI_program.py self.time_interval = time.time() - self.time_old to self.time_interval = int(time.time() - self.time_old) so that the seconds are integers. I hope that the new CSV view for windows will accept that. The file is an example for the fact that 9V NiMH-batteries often are not good for -dV charging, because they have no -dV when they are full. Therefor I implemented in a personal copy of dps_GUI_program.py a feature that the program switches to PSU mode and continues with trickle charging at 2 mA if the set -dV is not reached within 20 minutes after the last peak value of the voltage.

S.zip

lambcutlet commented 6 years ago

HBerecz, try the new 'dps_GUI_program.py' file. you should now be able to view your zipped file from above

lambcutlet commented 6 years ago

The problem is with windows. When saving to a CSV file the line termination contains two carriage returns and one linefeed 'CR CR LF' In linux saving to a CSV file the line termination contains one carriage return and one linefeed 'CR LF' So when CSVview was attempted it failed due to every second line in the CSV file being blank. This should now be resolved. Windows no longer writes a second carriage return (CR) and your old files with the blank lines will when imported shall have the blank lines removed allowing the CSV file to be viewed.

lambcutlet commented 6 years ago

Also, can you provide the Manufacturers Name & part number for the battery you are charging. I wish to view the datasheet.

HBerecz commented 6 years ago

I use 9 V Block-Akku NiMH Conrad energy 6LR61 160 mAh (http://www.produktinfo.conrad.com/datenblaetter/250000-274999/250181-da-01-en-Akku_9V_NiMH_160mAh.pdf), Varta 150mAh NiMH 9V Rechargeable Battery (https://docs-emea.rs-online.com/webdocs/00bb/0900766b800bbd0f.pdf) and HyCell Power Solutions - NiMH Akku 9V-Block E Typ 150mAh (https://hycell.de/akkus-batterien/e-150-1).