dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
outputchannelform.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 #ifndef OUTPUTCHANNELFORM_H
27 #define OUTPUTCHANNELFORM_H
28 
29 #include <QWidget>
30 #include "ui_outputchannelform.h"
32 
34 {
35  Q_OBJECT
36 
37 public:
38  explicit OutputChannelForm(const int index, QWidget *parent = NULL,
39  const bool showLegend = false);
41  friend class ConfigOnputWidget;
42 
43  void setAssignment(const QString &assignment);
44  int index() const;
45 
46 public slots:
47  void setMax(int maximum);
48  int max() const;
49  void setMin(int minimum);
50  int min() const;
51  void setMinmax(int minimum, int maximum);
52  void setNeutral(int value);
53  int neutral() const;
54  void enableChannelTest(bool state);
55  void updateChannelLimits(int minPulse, int maxPulse, bool digitalProtocol = false);
56 
57 signals:
58  void channelChanged(int index, int value);
59  void formChanged();
60 
61 private:
62  Ui::OutputChannelForm ui;
64  int m_index;
65  bool m_inChannelTest;
66  int limitMin, limitMax;
67  bool minMaxFixed;
68 
69  bool inhibitRangeChanges;
70 
71  void alignFields();
72 
73 private slots:
74  void linkToggled(bool state);
75  void reverseChannel();
76  void updateSlider();
77  void sendChannelTest(int value);
78  void setChannelRange();
79  void notifyFormChanged();
80 };
81 
82 inline int OutputChannelForm::index() const
83 {
84  return m_index;
85 }
86 
87 inline int OutputChannelForm::max() const
88 {
89  return ui.actuatorMax->value();
90 }
91 
92 inline int OutputChannelForm::min() const
93 {
94  return ui.actuatorMin->value();
95 }
96 
97 inline int OutputChannelForm::neutral() const
98 {
99  return ui.actuatorNeutral->value();
100 }
101 #endif // OUTPUTCHANNELFORM_H
void channelChanged(int index, int value)
void setMinmax(int minimum, int maximum)
void setAssignment(const QString &assignment)
void setMin(int minimum)
void enableChannelTest(bool state)
void updateChannelLimits(int minPulse, int maxPulse, bool digitalProtocol=false)
void setMax(int maximum)
friend class ConfigOnputWidget
OutputChannelForm(const int index, QWidget *parent=NULL, const bool showLegend=false)
int neutral() const
void setNeutral(int value)