2016-08-11 14:41:40 +02:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2022-02-09 01:45:04 +01:00
|
|
|
* Copyright (C) 2022 Mikolaj Wielgus
|
|
|
|
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2016-08-11 14:41:40 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2016-08-11 14:41:43 +02:00
|
|
|
* as published by the Free Software Foundation; either version 3
|
2016-08-11 14:41:40 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
2016-08-11 14:41:43 +02:00
|
|
|
* https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 3 license,
|
2016-08-11 14:41:40 +02:00
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIALOG_SPICE_MODEL_H
|
|
|
|
#define DIALOG_SPICE_MODEL_H
|
|
|
|
|
2021-12-03 03:41:02 +01:00
|
|
|
#include <dialog_spice_model_base.h>
|
|
|
|
#include <netlist_exporter_pspice.h>
|
|
|
|
#include <scintilla_tricks.h>
|
2016-08-11 14:41:56 +02:00
|
|
|
|
2022-02-09 01:45:04 +01:00
|
|
|
#include <sim/spice_model.h>
|
2021-02-24 08:48:02 -05:00
|
|
|
#include <sch_symbol.h>
|
2016-08-11 14:41:56 +02:00
|
|
|
|
2022-02-09 01:45:04 +01:00
|
|
|
template <typename T>
|
2016-08-11 14:41:40 +02:00
|
|
|
class DIALOG_SPICE_MODEL : public DIALOG_SPICE_MODEL_BASE
|
|
|
|
{
|
|
|
|
public:
|
2022-02-09 01:45:04 +01:00
|
|
|
enum COLUMN { DESCRIPTION, NAME, VALUE, UNIT };
|
|
|
|
|
2021-06-10 10:10:55 -04:00
|
|
|
DIALOG_SPICE_MODEL( wxWindow* aParent, SCH_SYMBOL& aSymbol,
|
2022-02-09 01:45:04 +01:00
|
|
|
std::vector<T>* aSchFields );
|
2016-08-11 14:41:40 +02:00
|
|
|
|
|
|
|
private:
|
2022-02-09 01:45:04 +01:00
|
|
|
bool TransferDataFromWindow() override;
|
|
|
|
bool TransferDataToWindow() override;
|
2016-08-11 14:41:40 +02:00
|
|
|
|
2022-02-09 01:45:04 +01:00
|
|
|
void updateModel();
|
|
|
|
void updateWidgets();
|
2016-09-17 14:38:34 +02:00
|
|
|
|
2022-02-09 01:45:04 +01:00
|
|
|
void onDeviceTypeChoice( wxCommandEvent& aEvent ) override;
|
|
|
|
void onTypeChoice( wxCommandEvent& aEvent ) override;
|
|
|
|
void onGridCellChange( wxGridEvent& aEvent ) override;
|
2016-08-11 14:41:40 +02:00
|
|
|
|
2021-06-10 10:10:55 -04:00
|
|
|
SCH_SYMBOL& m_symbol;
|
2022-02-09 01:45:04 +01:00
|
|
|
std::vector<T>* m_fields;
|
2016-08-11 14:41:40 +02:00
|
|
|
|
2022-02-09 01:45:04 +01:00
|
|
|
std::vector<SPICE_MODEL> m_models;
|
|
|
|
std::map<SPICE_MODEL::DEVICE_TYPE, SPICE_MODEL::TYPE> m_curModelTypeOfDeviceType;
|
|
|
|
SPICE_MODEL::TYPE m_curModelType = SPICE_MODEL::TYPE::NONE;
|
2021-12-03 03:41:02 +01:00
|
|
|
|
|
|
|
std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
|
2016-08-11 14:41:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DIALOG_SPICE_MODEL_H */
|