/[qspeakers]/branches/qtcharts/mainwindow.h
ViewVC logotype

Contents of /branches/qtcharts/mainwindow.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 293 - (show annotations)
Mon Nov 23 17:37:05 2020 UTC (6 months, 3 weeks ago) by ben
File MIME type: text/plain
File size: 5002 byte(s)
Implement 2D OpenSCAD export
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QMainWindow>
5 #include <QFileDialog>
6 #include <QPrinter>
7
8 #include "speakerdialog.h"
9 #include "searchdialog.h"
10 #include "listdialog.h"
11 #include "bandpassdialog.h"
12 #include "speaker.h"
13 #include "sealedbox.h"
14 #include "portedbox.h"
15 #include "bandpassbox.h"
16 #include "plot.h"
17
18 namespace Ui {
19 class MainWindow;
20 }
21
22 class MainWindow : public QMainWindow
23 {
24 Q_OBJECT
25
26 public:
27 explicit MainWindow(QWidget *parent = 0);
28 ~MainWindow();
29
30 QUndoStack* getCommandStack() {
31 return this->commandStack;
32 };
33
34 void changeSpeakerNumber(int number);
35 void changeVendor(const QString &vendor, const Speaker& oldspeaker);
36 void changeModel(const QString &model);
37 void changeSealedVolume(double val);
38 void changePortedVolume(double val);
39 void changePortedResFreq(double val);
40 void changePortedPortNumber(unsigned int val);
41 void changePortedPortDiam(double val);
42 void changePortedSlotPortActivation(bool checked);
43 void changePortedSlotWidth(double val);
44 void changeBPSealedVolume(double val);
45 void changeBPPortedVolume(double val);
46 void changeBPPortedResFreq(double val);
47 void changeBPPortedPortNumber(double val);
48 void changeBPPortedPortDiam(double val);
49 void exportPlot(const QString& outfileName, int tabindex);
50 void exportScad3D(const QString& outfileName, int tabindex);
51 void exportScad2D(const QString& outfileName, int tabindex);
52 void exportScad(const QString &scad, const QString& outfileName, int tabindex);
53 signals:
54 void currentSpeakerChanged(Speaker spk);
55 void currentSealedBoxChanged(SealedBox box);
56 void currentPortedBoxChanged(PortedBox box);
57 void currentBandPassBoxChanged(BandPassBox box);
58
59 public slots:
60 void onProjectSave();
61 void onProjectExport();
62 void onProjectImport();
63 void onProjectQuit();
64 void onSpeakerNew();
65 void onSpeakerRemove();
66 void onSpeakerModify();
67 void onSpeakerInserted(Speaker spk);
68 void onSpeakerCancelled();
69 void onEditOptimize();
70 void onSpeakerSearch();
71 void onProjectPrint();
72 void onUndo();
73 void onRedo();
74 void onAboutAbout();
75
76 void onSearchRequested(const QString& param, double min, double max);
77 void onSearchCancelled();
78 void onSpeakerItemSelected(QString title, const Speaker &speaker);
79 void onSpeakerItemCancelled();
80
81 void onCurrentTabChanged(int tab);
82
83 void onNumberSpinChanged(int number);
84 void onVendorChanged(QString vendor);
85 void onModelChanged(QString model);
86
87 void onCurrentSpeakerChanged(const Speaker& spk);
88
89 void onCurrentSealedBoxChanged(const SealedBox& box);
90 void onCurrentPortedBoxChanged(const PortedBox& box);
91 void onCurrentBandPassBoxChanged(const BandPassBox& box);
92
93 void onSealedVolumeDoubleSpinChanged(double val);
94
95 void onPortedVolumeDoubleSpinChanged(double val);
96 void onPortedResonanceDoubleSpinChanged(double val);
97 void onPortedPortsNumberSpinChanged(int val);
98 void onPortedPortDiameterDoubleSpinChanged(double val);
99 void onPortedSlotWidthDoubleSpinChanged(double val);
100 void onPortedSlotPortActivated(bool checked);
101
102 void onBandPassSealedVolumeDoubleSpinChanged(double val);
103 void onBandPassPortedVolumeDoubleSpinChanged(double val);
104 void onBandPassPortedResonanceDoubleSpinChanged(double val);
105 void onBandPassPortNumSpinChanged(int val);
106 void onBandPassPortDiameterDoubleSpinChanged(double val);
107
108 void onAlignModerate_Inf();
109 void onAlignLegendre();
110 void onAlignBessel();
111 void onAlignBullock();
112 void onAlignKeele_Hoge();
113
114 void onBandpassAlignment();
115 void onBandpassOptimizeRequested(double s, double pa);
116 void onBandpassOptimizeCancelled();
117
118 void onCurvePlot();
119 void on3DScadExport();
120 void on2DScadExport();
121
122 protected:
123 void linkMenus();
124 void linkTabs();
125 void linkInternals();
126 void unlinkMenus();
127 void unlinkTabs();
128 void unlinkInternals();
129 bool print(QPrinter* printer);
130 void syncUiFromCurrentSpeaker(const Speaker &spk);
131 void syncUiFromCurrentSealedBox(const SealedBox& box);
132 void syncUiFromCurrentPortedBox(const PortedBox& box);
133 void syncUiFromCurrentBandPassBox(const BandPassBox& box);
134 void setActivateActions(QList<QAction *> actions, bool enable);
135 void setCurrentSpeaker(const Speaker& spk);
136
137 private:
138 static QString getHome();
139
140 Ui::MainWindow *ui;
141 bool projectSaved;
142 bool isModifying;
143 SpeakerDialog *spkDialog;
144 QFileDialog *fileDialog;
145 SearchDialog *searchDialog;
146 ListDialog *listDialog;
147 BandpassDialog *bandpassDialog;
148
149 Speaker oldSpeaker;
150 Speaker currentSpeaker;
151 int currentSpeakerNumber;
152
153 SealedBox currentSealedBox;
154 PortedBox currentPortedBox;
155 BandPassBox currentBandPassBox;
156
157 int currentTabIndex;
158
159 Plot *sealedPlot;
160 Plot *portedPlot;
161 Plot *bandpassPlot;
162
163 const Speaker *notInDbSpeaker;
164 QUndoStack *commandStack;
165 };
166
167 #endif // MAINWINDOW_H

  ViewVC Help
Powered by ViewVC 1.1.26