Revamp SSR current calibration (Issue #163)
by Chris Satterlee 5 years 1 month
Revamp SSR current calibration (Issue #163)

The algorithm for measuring the SSR current calibration current is changed to have two passes of measurements to average. The stability is evaluated based on the difference between these two averages. Previously, the stability was determined by how far out of whack the highest and lowest values seen were. This was too sensitive, and resulted in many false positives.

The accuracy should be improved slightly too. The second pass discards values that are more than +-0.5% from the average of the first pass. Also, the average of the second pass uses floating point and is rounded to the nearest integer (long). Previously, the average was an integer, so it could be off by nearly one ADC increment. Now the max rounding error is 0.5 ADC increment.
45067076
Addendum to Issue #159 fix
by Chris Satterlee 5 years 2 months
Addendum to Issue #159 fix

This commit removes the other place that the geometry string is parsed and replaces it with calls winfo_width() and winfo_height(). The get_dialog_geometry_width_and_height() method is removed.
b53acce3
Fix mistake in previous commit
by Chris Satterlee 5 years 2 months
Fix mistake in previous commit

The call to tkmsg_showerror needs to have self.master as the first arg, not self.
be2d9279
Catch exception when canceling overlay (Issue #162...
by Chris Satterlee 5 years 2 months
Catch exception when canceling overlay (Issue #162)

Add method rm_overlay_dir(), which catches the OSError exception on the call to shutil.rmtree and gives the user an opportunity to close the PDF viewer. Although the exception is either WindowsError or PermissionError, OSError catches it.

One other small change in this commit is to display an error dialog when the send2trash() call fails with OSError in the delete_selected() method. Previously, this generated a message in the log file, but did not generate an error dialog.
725b2f6c
Display GIF even if CSV files are not found
by Chris Satterlee 5 years 2 months
Display GIF even if CSV files are not found

This is sort of part of Issue #161. It's actually a very contrived case, where both CSV files are not found, but there is a GIF. In that case, it makes sense to go ahead and display the GIF.
7ed6d726
Catch AssertionError in plot_results (Issue #161)
by Chris Satterlee 5 years 2 months
Catch AssertionError in plot_results (Issue #161)

Catch assert from IV_Swinger2 plot_results() in IV_Swinger2_gui plot_results() and display error dialog.
4fdba5a0
Change coeff units combobox widths to 6 (Issue #16...
by Chris Satterlee 5 years 2 months
Change coeff units combobox widths to 6 (Issue #160)

Width of the comboboxes for the PV Model coefficient units needs to be 6 for Windows.
c9592e89
Use winfo_x() and winfo_width() instead of parsing...
by Chris Satterlee 5 years 2 months
Use winfo_x() and winfo_width() instead of parsing geometry() (Issue #159)

Since Issue #159 hasn't been reproduced, it's hard to say what the cause was. But the failure was parsing the X value from the string returned by geometry(), which should be in the format: (width)x(height)+(X)+(Y)

Parsing the X value and width from geometry() is not necessary. These values are available from the winfo_x() and winfo_width() functions respectively. This may just change the synptom of the problem, but it should be more robust.
e37c498d
Capture assert message in plot_results (Issue #158...
by Chris Satterlee 5 years 2 months
Capture assert message in plot_results (Issue #158)

The assertion message is captured in an IV_Swinger2 property so the GUI code can display it in the error dialog.
ba5889f7
Remove unreachable code in IV_Swinger2_gui.py (Iss...
by Chris Satterlee 5 years 2 months
Remove unreachable code in IV_Swinger2_gui.py (Issue #157)

See diffs
6410331f
Report a bug