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.

65 lines
2.3 KiB

  1. /*
  2. * This program source code file is part of KICAD, a free EDA CAD application.
  3. *
  4. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 3
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef PANEL_WAVELENGTH_H
  20. #define PANEL_WAVELENGTH_H
  21. #include "panel_wavelength_base.h"
  22. class PCB_CALCULATOR_SETTINGS;
  23. class PANEL_WAVELENGTH : public PANEL_WAVELENGTH_BASE
  24. {
  25. public:
  26. PANEL_WAVELENGTH( wxWindow* parent, wxWindowID id = wxID_ANY,
  27. const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
  28. long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
  29. ~PANEL_WAVELENGTH(){};
  30. // Methods from CALCULATOR_PANEL that must be overriden
  31. void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
  32. void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
  33. void ThemeChanged() override{};
  34. void OnFrequencyChange( wxCommandEvent& event ) override;
  35. void OnPeriodChange( wxCommandEvent& event ) override;
  36. void OnWavelengthVacuumChange( wxCommandEvent& event ) override;
  37. void OnWavelengthMediumChange( wxCommandEvent& event ) override;
  38. void OnPermittivityChange( wxCommandEvent& event ) override;
  39. void OnPermeabilityChange( wxCommandEvent& event ) override;
  40. void OnButtonPermittivity( wxCommandEvent& event ) override;
  41. private:
  42. void update( double aFrequency );
  43. void updateUnits( wxCommandEvent& aEvent ) override;
  44. double m_permittivity = 1;
  45. double m_permeability = 1;
  46. double m_frequency = 1;
  47. bool m_updatingFrequency = false;
  48. bool m_updatingPeriod = false;
  49. bool m_updatingWavelengthVacuum = false;
  50. bool m_updatingWavelengthMedium = false;
  51. bool m_updatingSpeed = false;
  52. bool m_updatingUI = false;
  53. };
  54. #endif