1 | #include "ProjectionModel.h" |
---|
2 | #include "gui/QChannelManagerWidget.h" |
---|
3 | #include "gui/QChannelWidget.h" |
---|
4 | #include "gui/QScreenWidget.h" |
---|
5 | #include "gui/QSceneWidget.h" |
---|
6 | #include "gui/QPanelWidget.h" |
---|
7 | |
---|
8 | using namespace projection; |
---|
9 | |
---|
10 | QPanelWidget::QPanelWidget(QWidget* pParent, Qt::WFlags flags) |
---|
11 | : QWidget(pParent, flags) |
---|
12 | { |
---|
13 | ui.setupUi(this); |
---|
14 | |
---|
15 | m_pModel = NULL; |
---|
16 | } |
---|
17 | |
---|
18 | QPanelWidget::~QPanelWidget() |
---|
19 | { |
---|
20 | } |
---|
21 | |
---|
22 | void QPanelWidget::setModel(ProjectionModel* pModel) |
---|
23 | { |
---|
24 | m_pModel = pModel; |
---|
25 | |
---|
26 | ui.channelManager->setModel(m_pModel); |
---|
27 | ui.screen->setScreen(m_pModel->getScreen()); |
---|
28 | ui.scene->setScene(m_pModel->getScene()); |
---|
29 | |
---|
30 | updateGUI(); |
---|
31 | } |
---|
32 | |
---|
33 | void QPanelWidget::selectChannel(Channel* pChannel) |
---|
34 | { |
---|
35 | if (ui.channelManager->getSelectedChannel() != m_pModel->getChannelIndex(pChannel)) |
---|
36 | ui.channelManager->selectChannel(m_pModel->getChannelIndex(pChannel)); |
---|
37 | if (ui.channel->getChannel() != pChannel) { |
---|
38 | ui.channel->setChannel(pChannel); |
---|
39 | ui.channel->updateGUI(); |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | void QPanelWidget::activateChannels() |
---|
44 | { |
---|
45 | ui.tabWidget->setCurrentIndex(0); |
---|
46 | } |
---|
47 | |
---|
48 | void QPanelWidget::activateScreen() |
---|
49 | { |
---|
50 | ui.tabWidget->setCurrentIndex(1); |
---|
51 | } |
---|
52 | |
---|
53 | void QPanelWidget::activateScene() |
---|
54 | { |
---|
55 | ui.tabWidget->setCurrentIndex(2); |
---|
56 | } |
---|
57 | |
---|
58 | void QPanelWidget::updateChannelNames() |
---|
59 | { |
---|
60 | ui.channelManager->updateChannelNamesGUI(); |
---|
61 | } |
---|
62 | |
---|
63 | void QPanelWidget::updateChannels() |
---|
64 | { |
---|
65 | ui.channelManager->updateGUI(); |
---|
66 | } |
---|
67 | |
---|
68 | void QPanelWidget::updateCurrentChannel() |
---|
69 | { |
---|
70 | ui.channel->updateGUI(); |
---|
71 | } |
---|
72 | |
---|
73 | void QPanelWidget::updateGUI() |
---|
74 | { |
---|
75 | ui.channelManager->updateGUI(); |
---|
76 | ui.channel->updateGUI(); |
---|
77 | ui.screen->updateGUI(); |
---|
78 | ui.scene->updateGUI(); |
---|
79 | } |
---|