Add ignition_pin/delay to gui

This commit is contained in:
hawkeyexp 2018-08-02 13:36:46 +02:00
parent 2ace4e9198
commit 8fbdd32abb
2 changed files with 407 additions and 172 deletions

View File

@ -177,6 +177,10 @@ void SettingsWindow::onSave()
params.append("0");
}
params.append("#");
params.append( std::string(ui_->comboBoxGPIOShutdown->currentText().toStdString()) );
params.append("#");
params.append( std::to_string(ui_->spinBoxGPIOShutdownDelay->value()) );
params.append("#");
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
this->close();
}
@ -538,6 +542,9 @@ void SettingsWindow::loadSystemValues()
ui_->radioButtonDebugmodeDisabled->setChecked(true);
}
// GPIO based shutdown
ui_->comboBoxGPIOShutdown->setCurrentText(getparams[28]);
ui_->spinBoxGPIOShutdownDelay->setValue(getparams[29].toInt());
}
}

View File

@ -1612,7 +1612,7 @@ subcontrol-position: center left;
<rect>
<x>0</x>
<y>10</y>
<width>616</width>
<width>400</width>
<height>141</height>
</rect>
</property>
@ -1799,7 +1799,7 @@ subcontrol-position: center left;
<widget class="QComboBox" name="comboBoxInvert">
<property name="geometry">
<rect>
<x>300</x>
<x>290</x>
<y>60</y>
<width>100</width>
<height>30</height>
@ -2114,7 +2114,7 @@ subcontrol-position: center left;
<widget class="QLabel" name="labelRearcam">
<property name="geometry">
<rect>
<x>210</x>
<x>200</x>
<y>100</y>
<width>90</width>
<height>30</height>
@ -2124,174 +2124,10 @@ subcontrol-position: center left;
<string>Rearcam Pin</string>
</property>
</widget>
<widget class="QComboBox" name="comboBoxAndroid">
<property name="geometry">
<rect>
<x>500</x>
<y>60</y>
<width>100</width>
<height>30</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string>- - -</string>
</property>
<item>
<property name="text">
<string>- - -</string>
</property>
</item>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>9</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
</property>
</item>
<item>
<property name="text">
<string>11</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
</property>
</item>
<item>
<property name="text">
<string>13</string>
</property>
</item>
<item>
<property name="text">
<string>14</string>
</property>
</item>
<item>
<property name="text">
<string>15</string>
</property>
</item>
<item>
<property name="text">
<string>16</string>
</property>
</item>
<item>
<property name="text">
<string>17</string>
</property>
</item>
<item>
<property name="text">
<string>18</string>
</property>
</item>
<item>
<property name="text">
<string>19</string>
</property>
</item>
<item>
<property name="text">
<string>20</string>
</property>
</item>
<item>
<property name="text">
<string>21</string>
</property>
</item>
<item>
<property name="text">
<string>22</string>
</property>
</item>
<item>
<property name="text">
<string>23</string>
</property>
</item>
<item>
<property name="text">
<string>24</string>
</property>
</item>
<item>
<property name="text">
<string>25</string>
</property>
</item>
<item>
<property name="text">
<string>26</string>
</property>
</item>
</widget>
<widget class="QLabel" name="labelAndroid">
<property name="geometry">
<rect>
<x>420</x>
<y>60</y>
<width>80</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Android Pin</string>
</property>
</widget>
<widget class="QComboBox" name="comboBoxRearcam">
<property name="geometry">
<rect>
<x>300</x>
<x>290</x>
<y>100</y>
<width>100</width>
<height>30</height>
@ -2442,7 +2278,7 @@ subcontrol-position: center left;
<widget class="QLabel" name="labelInvert">
<property name="geometry">
<rect>
<x>210</x>
<x>200</x>
<y>60</y>
<width>90</width>
<height>30</height>
@ -2734,9 +2570,9 @@ subcontrol-position: center left;
<widget class="QGroupBox" name="groupBoxDebugmode">
<property name="geometry">
<rect>
<x>325</x>
<x>320</x>
<y>320</y>
<width>291</width>
<width>296</width>
<height>91</height>
</rect>
</property>
@ -2790,7 +2626,7 @@ subcontrol-position: center left;
<rect>
<x>40</x>
<y>60</y>
<width>251</width>
<width>241</width>
<height>23</height>
</rect>
</property>
@ -2807,6 +2643,398 @@ subcontrol-position: center left;
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBoxGPIO2">
<property name="geometry">
<rect>
<x>400</x>
<y>10</y>
<width>216</width>
<height>141</height>
</rect>
</property>
<property name="title">
<string>Standalone GPIO Settings</string>
</property>
<widget class="QComboBox" name="comboBoxAndroid">
<property name="geometry">
<rect>
<x>100</x>
<y>26</y>
<width>100</width>
<height>30</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string>- - -</string>
</property>
<item>
<property name="text">
<string>- - -</string>
</property>
</item>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>9</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
</property>
</item>
<item>
<property name="text">
<string>11</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
</property>
</item>
<item>
<property name="text">
<string>13</string>
</property>
</item>
<item>
<property name="text">
<string>14</string>
</property>
</item>
<item>
<property name="text">
<string>15</string>
</property>
</item>
<item>
<property name="text">
<string>16</string>
</property>
</item>
<item>
<property name="text">
<string>17</string>
</property>
</item>
<item>
<property name="text">
<string>18</string>
</property>
</item>
<item>
<property name="text">
<string>19</string>
</property>
</item>
<item>
<property name="text">
<string>20</string>
</property>
</item>
<item>
<property name="text">
<string>21</string>
</property>
</item>
<item>
<property name="text">
<string>22</string>
</property>
</item>
<item>
<property name="text">
<string>23</string>
</property>
</item>
<item>
<property name="text">
<string>24</string>
</property>
</item>
<item>
<property name="text">
<string>25</string>
</property>
</item>
<item>
<property name="text">
<string>26</string>
</property>
</item>
</widget>
<widget class="QLabel" name="labelAndroid">
<property name="geometry">
<rect>
<x>10</x>
<y>26</y>
<width>80</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Android Pin</string>
</property>
</widget>
<widget class="QLabel" name="labelGPIOShutdown">
<property name="geometry">
<rect>
<x>10</x>
<y>66</y>
<width>80</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Ignition Pin</string>
</property>
</widget>
<widget class="QComboBox" name="comboBoxGPIOShutdown">
<property name="geometry">
<rect>
<x>100</x>
<y>66</y>
<width>100</width>
<height>30</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string>- - -</string>
</property>
<item>
<property name="text">
<string>- - -</string>
</property>
</item>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>9</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
</property>
</item>
<item>
<property name="text">
<string>11</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
</property>
</item>
<item>
<property name="text">
<string>13</string>
</property>
</item>
<item>
<property name="text">
<string>14</string>
</property>
</item>
<item>
<property name="text">
<string>15</string>
</property>
</item>
<item>
<property name="text">
<string>16</string>
</property>
</item>
<item>
<property name="text">
<string>17</string>
</property>
</item>
<item>
<property name="text">
<string>18</string>
</property>
</item>
<item>
<property name="text">
<string>19</string>
</property>
</item>
<item>
<property name="text">
<string>20</string>
</property>
</item>
<item>
<property name="text">
<string>21</string>
</property>
</item>
<item>
<property name="text">
<string>22</string>
</property>
</item>
<item>
<property name="text">
<string>23</string>
</property>
</item>
<item>
<property name="text">
<string>24</string>
</property>
</item>
<item>
<property name="text">
<string>25</string>
</property>
</item>
<item>
<property name="text">
<string>26</string>
</property>
</item>
</widget>
<widget class="QSpinBox" name="spinBoxGPIOShutdownDelay">
<property name="geometry">
<rect>
<x>100</x>
<y>96</y>
<width>100</width>
<height>41</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QSpinBox::up-button { width: 32px; height: 32px;
subcontrol-origin: margin;
subcontrol-position: center right;
}
QSpinBox::down-button { width: 32px; height: 32px;
subcontrol-origin: margin;
subcontrol-position: center left;
}</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
<widget class="QLabel" name="labelGPIOShutdownDelay">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>80</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Delay</string>
</property>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">