Another minor simulator bugfix
by Chris Satterlee 5 years 3 months
Another minor simulator bugfix

No Issue filed. On Windows, the Results tab is missing its scrollbar.

Fixing this by forcing the ScrolledText widget to width=65. There should be a way to query with width of the Notebook and use that, but I couldn't find how to do that.

Also removed to unnecessary lines.
225259fb
Fix simulator Results tab delayed appearance
by Chris Satterlee 5 years 3 months
Fix simulator Results tab delayed appearance

No Issue filed for this. The Results tab of the siulator dialog is supposed to appear when a simulation is run. At least on Mac with Python 3, this is not happening. Added update_idletasks() to the end of add_results_tab() to fix it.
45e3f4ba
Add READMEs for python/python3 and update build_to...
by Chris Satterlee 5 years 3 months
Add READMEs for python/python3 and update build_tools README

README files are added to both the python and python3 directories. These describe how to install Python and the required packages.

The build_tools/README is updated for Python 3
00b9646e
Fix Windows breakage
by Chris Satterlee 5 years 3 months
Fix Windows breakage

Fix the problem caused by the commit for Issue #125.

Instead of using os.uname() to determine whether to import the Adafruit modules, just use try/except. This is better because RPi isn't the only ARM-based machine. Future Macs are even going to be ARM-based.

Instead of os.uname() to determine if processor is arm6, use platform.machine().
f676e14e
Misc minor cosmetic changes
by Chris Satterlee 5 years 3 months
Misc minor cosmetic changes

No Issue filed for this commit.
- Added 2020 to Copyrights that were missing it
- Fixed a few flake8 warnings
- Added comment to IV_Swinger.py noting that it was originally written for IVS1 and the header comment describes IVS1
9de1d1b1
Remove mac_grayed_menu_workaround (Issue #128)
by Chris Satterlee 5 years 3 months
Remove mac_grayed_menu_workaround (Issue #128)

- Removed the mac_grayed_menu_workaround() method
- Removed tkmsg_* and tksd_* functions
- Changed tkmsg_* and tksd_* function calls to tkmsg.* and tkmsg.*
(had to remove first "self" arg)
- Changed several methods to global functions since pylint generated
no-self-use warnings

This change is made to python3 only.
f564b945
Correct fix for Issue #123
by Chris Satterlee 5 years 3 months
Correct fix for Issue #123

Remove the code from pv_model_listbox_select_actions() and instead configure the listbox with exportselection=False as described here: https://stackoverflow.com/a/30266630/3443477

Change made in both python and python3.
697b0543
Fix problem with manually assigning secondary valu...
by Chris Satterlee 5 years 3 months
Fix problem with manually assigning secondary values (Issue #127)

Changed code in shunt_ohms_widget_actions(), load_cap_widget_actions() and rb_widget_actions() to suppress changing the secondary value (shunt_wattage, load_cap_v, rb_wattage) when the primary value matches one of the standard values is the method was not called with an event. This keeps it from changing a manually enetered value. However, we still want to change the secondary value when the "Restore Defaults" button is called, so the restore_shunt_ohms_defaults(), restore_load_cap_defaults() and restore_rb_defaults() methods call the shunt_ohms_widget_actions(), load_cap_widget_actions() and rb_widget_actions() with a dummy event.

The update_all_widgets() method is also fixed so it updates the secondary values. Otherwise, if the user doesn't hit enter after changing one of these values, the new value isn't used.

This change was made to both the python and python file.
f9fa583e
Include simulation logging in main log file (Issue...
by Chris Satterlee 5 years 3 months
Include simulation logging in main log file (Issue #126)

To fix this, the following changes were made:
- Add optional logger parameter to the IV_Swinger2 class initializer
- Add logger parameter to IV_Swinger2 configure logging method
- Modify configure_logging to just set the logger attribute to the passed value if it is set
- Add optional logger parameter to the IV_Swinger2_sim class initializer and pass that to the IV_Swinger2 initializer
- Add optional logger parameter to the SimulatorDialog class initializer and pass that to the IV_Swinger2_sim instantiation
- Pass the existing logger to the SimulatorDialog instantiaton in the run_simulator method in the MenuBar class of the main GUI

This commit also includes one unrelated whitespace fix in IV_Swinger2_gui.py

All changes are made to both python and python3 files.
1586f663
Log runtime OS version (Issue #125)
by Chris Satterlee 5 years 3 months
Log runtime OS version (Issue #125)

This started as a simple change, but I realized that most of the logging in the log_python_and_tcl_tk_versions() method in the GUI class really should be in the log_initial_debug_info() method in the IVS2 class, and the determination of most of the package versions actually belongs in IV_Swinger.py since that is where the imports are.

This commit does the following:
- IV_Swinger2_gui.py:
Change log_python_and_tcl_tk_versions() to simply
log_tcl_tk_version(), removing the logging of the Python version
and all of the Python package versions.
- IV_Swinger.py:
Set IV_Swinger class attributes with the values of:
- OS version
- Python version
- Matplotlib version
- IV_Swinger_PV_model.py:
Get SciPy version into global namespace with import
- IV_Swinger2.py
Set IV_Swinger2 class attributes with the values of:
- PySerial version
- Pillow version
Add the following logging to log_initial_debug_info():
- OS version
- Python version
- Matplotlib version
- SciPy version
- PySerial version
- Pillow version

Additionally, the conditional imports in IV_Swinger.py were changed to eliminate the copied lines. And in the Python 2 version, the workaround for the matplotlib crash on Python 2.7.18 is moved here from IV_Swinger2_gui.py, which no longer imports matplotlib.
3abb8497
Report a bug