Ajout de la gestion de roulette de volume du clavier

This commit is contained in:
2024-02-04 06:48:18 -05:00
parent 59b07d5db3
commit ac8490b5ee
25 changed files with 854 additions and 68 deletions
+40
View File
@@ -49,11 +49,14 @@ CChaletGui::CChaletGui(QWidget *parent) :
// create graph and assign data to it:
mBatteryPlotWidget->addGraph();
mBatteryPlotWidget->addGraph(mBatteryPlotWidget->xAxis,mBatteryPlotWidget->yAxis2);
// give the axes some labels:
mBatteryPlotWidget->xAxis->setLabel("time");
mBatteryPlotWidget->yAxis->setLabel("Volts");
mBatteryPlotWidget->yAxis2->setLabel("RSSI (dBm)");
mBatteryPlotWidget->yAxis2->setVisible(true);
double now = QDateTime::currentDateTime().toSecsSinceEpoch();
QSharedPointer<QCPAxisTickerDateTime> dateTicker(new QCPAxisTickerDateTime);
@@ -73,6 +76,14 @@ CChaletGui::CChaletGui(QWidget *parent) :
mBatteryPlotWidget->xAxis->setRange(midnight.toSecsSinceEpoch(), eod.toSecsSinceEpoch());
mBatteryPlotWidget->yAxis->setRange(12,15);
mBatteryPlotWidget->yAxis2->setRange(-255,0.0);
QList<QCPAxis*> xAxis, yAxis;
xAxis.append(mBatteryPlotWidget->xAxis);
yAxis.append(mBatteryPlotWidget->yAxis);
yAxis.append(mBatteryPlotWidget->yAxis2);
mBatteryPlotWidget->axisRect()->setRangeDragAxes(xAxis,yAxis);
mBatteryPlotWidget->axisRect()->setRangeZoomAxes(xAxis,yAxis);
mBatteryPlotWidget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
mBatteryPlotWidget->graph(0)->addData(now,13.5);
@@ -96,6 +107,8 @@ CChaletGui::CChaletGui(QWidget *parent) :
ui->mTotalRxTxRequestsLbl->setText("Chalet Rx req: ??");
ui->mChaletTemperatureLbl->setText("Temperature: -100)");
ui->mChaletWifiSelectionRadioBtn->setChecked(true);
}
CChaletGui::~CChaletGui()
@@ -293,6 +306,28 @@ int CChaletGui::UpdateLoraModuleStatus(CLoraModuleInterfaceStatus Status)
QString ModuleStatusTxt = QString("Ambient RSSI: %1 [%3dBm]\nLast Rx RSSI: %2 [%4dBm]").arg(Status.mModuleAmbientRSSI).arg(Status.mModuleLastRxRSSI).arg(-1*(255-Status.mModuleAmbientRSSI)).arg(-1*(255-Status.mModuleLastRxRSSI));
ui->mLoraIFModuleStatus->setText(ModuleStatusTxt);
quint32 Add = 0;
Add += (quint32)(Status.mIPAddress1 & 0x000000FF);
Add <<= 8;
Add += (quint32)(Status.mIPAddress2 & 0x000000FF);
Add <<= 8;
Add += (quint32)(Status.mIPAddress3 & 0x000000FF);
Add <<= 8;
Add += (quint32)(Status.mIPAddress4 & 0x000000FF);
QHostAddress IP = QHostAddress(Add);
QString IPString = QString("Lora Module IP Address:").append(IP.toString());
ui->mLoraModuleIPAddressLbl->setText(IPString);
if(Status.mModuleLastRxRSSI > 10) //filter glitches
{
double CurTime = QDateTime::currentDateTime().toSecsSinceEpoch();
mBatteryPlotWidget->graph(1)->addData(CurTime,-1*(255-Status.mModuleLastRxRSSI));
mBatteryPlotWidget->replot();
}
return RET_OK;
}
@@ -507,3 +542,8 @@ void CChaletGui::RebootCPUButtonClicked()
ui->mModuleIPAddressLbl->setText("Module IP Address: ");
mProgramHandle->RequestWifiStatus();
}
void CChaletGui::WiFiSettingsSelectionChanged()
{
}
+1
View File
@@ -60,6 +60,7 @@ public slots:
void ResetCommStatsBtnClicked();
void UpdateDeviceWifiStatus(char WifiState, QHostAddress IP);
void GetModuleWifiStatusBtnClicked();
void WiFiSettingsSelectionChanged();
};
+83 -17
View File
@@ -282,7 +282,7 @@
<property name="geometry">
<rect>
<x>420</x>
<y>240</y>
<y>260</y>
<width>1021</width>
<height>321</height>
</rect>
@@ -350,23 +350,23 @@
<string>Temperature:</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="WifiSettingGroupBox">
<property name="geometry">
<rect>
<x>70</x>
<x>60</x>
<y>380</y>
<width>321</width>
<height>231</height>
<height>251</height>
</rect>
</property>
<property name="title">
<string>WiFi parameters (stored in flash)</string>
<string>Wifi parameters stored in flash</string>
</property>
<widget class="QLineEdit" name="mWifiAccessPtNameEditBx">
<property name="geometry">
<rect>
<x>80</x>
<y>110</y>
<y>150</y>
<width>221</width>
<height>20</height>
</rect>
@@ -382,7 +382,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>110</y>
<y>150</y>
<width>71</width>
<height>20</height>
</rect>
@@ -400,7 +400,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>140</y>
<y>180</y>
<width>71</width>
<height>20</height>
</rect>
@@ -418,7 +418,7 @@
<property name="geometry">
<rect>
<x>80</x>
<y>140</y>
<y>180</y>
<width>221</width>
<height>20</height>
</rect>
@@ -434,7 +434,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<y>90</y>
<width>71</width>
<height>20</height>
</rect>
@@ -452,7 +452,7 @@
<property name="geometry">
<rect>
<x>80</x>
<y>50</y>
<y>90</y>
<width>221</width>
<height>20</height>
</rect>
@@ -468,7 +468,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<y>120</y>
<width>71</width>
<height>20</height>
</rect>
@@ -486,7 +486,7 @@
<property name="geometry">
<rect>
<x>80</x>
<y>80</y>
<y>120</y>
<width>221</width>
<height>20</height>
</rect>
@@ -502,7 +502,7 @@
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<y>60</y>
<width>70</width>
<height>17</height>
</rect>
@@ -515,7 +515,7 @@
<property name="geometry">
<rect>
<x>70</x>
<y>180</y>
<y>220</y>
<width>75</width>
<height>23</height>
</rect>
@@ -528,7 +528,7 @@
<property name="geometry">
<rect>
<x>170</x>
<y>180</y>
<y>220</y>
<width>75</width>
<height>23</height>
</rect>
@@ -537,6 +537,38 @@
<string>SET</string>
</property>
</widget>
<widget class="QRadioButton" name="mChaletWifiSelectionRadioBtn">
<property name="geometry">
<rect>
<x>40</x>
<y>20</y>
<width>85</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Chalet</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
<widget class="QRadioButton" name="mLoraIFWifiSelectionRadioBtn">
<property name="geometry">
<rect>
<x>140</x>
<y>20</y>
<width>101</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Lora Module IF</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</widget>
<widget class="QLabel" name="mSolarPanelCurrentCnvLbl">
<property name="geometry">
@@ -770,8 +802,39 @@ Module state: ??</string>
<string>Activity!!!</string>
</property>
</widget>
<widget class="QPushButton" name="mGetLoraWifiStatusBtn">
<property name="geometry">
<rect>
<x>170</x>
<y>130</y>
<width>61</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>GET</string>
</property>
</widget>
<widget class="QLabel" name="mLoraModuleIPAddressLbl">
<property name="geometry">
<rect>
<x>240</x>
<y>130</y>
<width>291</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Module IP Address:</string>
</property>
</widget>
</widget>
<zorder>groupBox_2</zorder>
<zorder>WifiSettingGroupBox</zorder>
<zorder>groupBox</zorder>
<zorder>MainPageLabel</zorder>
<zorder>mInverterRlyStatusLabel</zorder>
@@ -810,4 +873,7 @@ Module state: ??</string>
</widget>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>