You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

Horizontal/vertical zoom for Simulator plots ADDED: Horizontal/vertical zoom for simulator plots, via mouse wheel, toolbar buttons, menu commands, and hotkeys. ADDED: Simulator preferences panel, populated with mouse wheel and trackpad settings that control pan and zoom of simulator plots. ADDED: Zoom In/Out Horizontally/Vertically commands that can be bound to hotkeys. CHANGED: Simulator plot scroll wheel gestures are no longer hard-coded and can now be configured via the new Simulator preferences panel. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16597 Other unreported bugs that were fixed: - Fixed wierd, jumpy simulator plot view limiting behavior. - Fixed Zoom In Center and Zoom Out Center commands not preserving the simulator plot center point. - Fixed simulator plot nudging when exported as PNGs. - Fixed rectangular selection zoom being able to exceed simulator plot view limits. Notes: - Provided new SIM_PREFERENCES struct to be used for future simulator preferences set via the simulator preferences dialog. - Bundled pre-existing EESCHEMA_SETTINGS::SIMULATOR settings into EESCHEMA_SETTINGS::SIMULATOR::VIEW. - Replaced mpWindow::EnableMouseWheelPan with more general SetMouseWheelActions. - Refactored and tidied up wxMathPlot's mpWindow code involved with fitting, zooming, and panning. - Consolidated long lists of duplicated member variable initializers to a new mpWindow private delegated constructor. - Provided provisional Zoom In/Out Horizontally/Vertically toolbar icons that need improvement by a graphics designer. - Provided gitignore entries for the Qt Creator IDE
2 years ago
Horizontal/vertical zoom for Simulator plots ADDED: Horizontal/vertical zoom for simulator plots, via mouse wheel, toolbar buttons, menu commands, and hotkeys. ADDED: Simulator preferences panel, populated with mouse wheel and trackpad settings that control pan and zoom of simulator plots. ADDED: Zoom In/Out Horizontally/Vertically commands that can be bound to hotkeys. CHANGED: Simulator plot scroll wheel gestures are no longer hard-coded and can now be configured via the new Simulator preferences panel. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16597 Other unreported bugs that were fixed: - Fixed wierd, jumpy simulator plot view limiting behavior. - Fixed Zoom In Center and Zoom Out Center commands not preserving the simulator plot center point. - Fixed simulator plot nudging when exported as PNGs. - Fixed rectangular selection zoom being able to exceed simulator plot view limits. Notes: - Provided new SIM_PREFERENCES struct to be used for future simulator preferences set via the simulator preferences dialog. - Bundled pre-existing EESCHEMA_SETTINGS::SIMULATOR settings into EESCHEMA_SETTINGS::SIMULATOR::VIEW. - Replaced mpWindow::EnableMouseWheelPan with more general SetMouseWheelActions. - Refactored and tidied up wxMathPlot's mpWindow code involved with fitting, zooming, and panning. - Consolidated long lists of duplicated member variable initializers to a new mpWindow private delegated constructor. - Provided provisional Zoom In/Out Horizontally/Vertically toolbar icons that need improvement by a graphics designer. - Provided gitignore entries for the Qt Creator IDE
2 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2016-2023 CERN
  5. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  6. * @author Sylwester Kocjan <s.kocjan@o2.pl>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 3
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * https://www.gnu.org/licenses/gpl-3.0.html
  21. * or you may search the http://www.gnu.org website for the version 3 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #ifndef __SIM_PLOT_PANEL_BASE_H
  26. #define __SIM_PLOT_PANEL_BASE_H
  27. #include <sim/sim_preferences.h>
  28. #include <sim/sim_types.h>
  29. #include <sim/spice_circuit_model.h>
  30. #include <wx/panel.h>
  31. #include <wx/sizer.h>
  32. #include <wx/stattext.h>
  33. class SIM_TAB : public wxWindow
  34. {
  35. public:
  36. SIM_TAB();
  37. SIM_TAB( const wxString& aSimCommand, wxWindow* parent );
  38. virtual ~SIM_TAB();
  39. static bool IsPlottable( SIM_TYPE aSimType );
  40. virtual void OnLanguageChanged() = 0;
  41. virtual void ApplyPreferences( const SIM_PREFERENCES& aPrefs );
  42. SIM_TYPE GetSimType() const;
  43. const wxString& GetSimCommand() const { return m_simCommand; }
  44. void SetSimCommand( const wxString& aSimCommand ) { m_simCommand = aSimCommand; }
  45. int GetSimOptions() const { return m_simOptions; }
  46. void SetSimOptions( int aOptions ) { m_simOptions = aOptions; }
  47. wxString GetLastSchTextSimCommand() const { return m_lastSchTextSimCommand; }
  48. void SetLastSchTextSimCommand( const wxString& aCmd ) { m_lastSchTextSimCommand = aCmd; }
  49. const wxString& GetSpicePlotName() const { return m_spicePlotName; }
  50. void SetSpicePlotName( const wxString& aPlotName ) { m_spicePlotName = aPlotName; }
  51. private:
  52. wxString m_simCommand;
  53. unsigned m_simOptions;
  54. wxString m_lastSchTextSimCommand;
  55. wxString m_spicePlotName;
  56. };
  57. class SIM_NOPLOT_TAB : public SIM_TAB
  58. {
  59. public:
  60. SIM_NOPLOT_TAB( const wxString& aSimCommand, wxWindow* parent );
  61. virtual ~SIM_NOPLOT_TAB();
  62. void OnLanguageChanged() override;
  63. private:
  64. wxSizer* m_sizer;
  65. wxStaticText* m_textInfo;
  66. };
  67. #endif