1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Added tracking of dropped packets to PipX and turned off visible text on signal strength meters.

This commit is contained in:
Brian Webb 2012-06-04 21:16:40 -07:00
parent 3721504458
commit 4e68f6543e
5 changed files with 55 additions and 10 deletions

View File

@ -83,6 +83,7 @@ typedef struct {
uint16_t retries; uint16_t retries;
uint16_t errors; uint16_t errors;
uint16_t uavtalk_errors; uint16_t uavtalk_errors;
uint16_t dropped;
uint16_t resets; uint16_t resets;
uint8_t ecc[RS_ECC_NPARITY]; uint8_t ecc[RS_ECC_NPARITY];
} PHStatusPacket, *PHStatusPacketHandle; } PHStatusPacket, *PHStatusPacketHandle;

View File

@ -73,6 +73,7 @@ typedef struct {
uint16_t errors; uint16_t errors;
uint16_t uavtalk_errors; uint16_t uavtalk_errors;
uint16_t resets; uint16_t resets;
uint16_t dropped;
int8_t rssi; int8_t rssi;
uint8_t lastContact; uint8_t lastContact;
} PairStats; } PairStats;
@ -104,6 +105,7 @@ typedef struct {
uint32_t radioRxErrors; uint32_t radioRxErrors;
uint32_t UAVTalkErrors; uint32_t UAVTalkErrors;
uint32_t packetErrors; uint32_t packetErrors;
uint32_t droppedPackets;
uint16_t txBytes; uint16_t txBytes;
uint16_t rxBytes; uint16_t rxBytes;
@ -245,6 +247,7 @@ static int32_t RadioComBridgeInitialize(void)
data->pairStats[i].errors = 0; data->pairStats[i].errors = 0;
data->pairStats[i].uavtalk_errors = 0; data->pairStats[i].uavtalk_errors = 0;
data->pairStats[i].resets = 0; data->pairStats[i].resets = 0;
data->pairStats[i].dropped = 0;
data->pairStats[i].lastContact = 0; data->pairStats[i].lastContact = 0;
} }
// The first slot is reserved for our current pairID // The first slot is reserved for our current pairID
@ -313,7 +316,7 @@ static void comUAVTalkTask(void *parameters)
// No packets available? // No packets available?
if (p == NULL) if (p == NULL)
{ {
DEBUG_PRINTF(2, "Packet dropped!\n\r"); data->droppedPackets++;
continue; continue;
} }
@ -625,6 +628,7 @@ static void transparentCommTask(void * parameters)
// No packets available? // No packets available?
if (p == NULL) if (p == NULL)
{ {
data->droppedPackets++;
// Wait a bit for a packet to come available. // Wait a bit for a packet to come available.
vTaskDelay(5); vTaskDelay(5);
continue; continue;
@ -702,6 +706,7 @@ static void radioStatusTask(void *parameters)
pipxStatus.Retries = data->comTxRetries; pipxStatus.Retries = data->comTxRetries;
pipxStatus.Errors = data->packetErrors; pipxStatus.Errors = data->packetErrors;
pipxStatus.UAVTalkErrors = data->UAVTalkErrors; pipxStatus.UAVTalkErrors = data->UAVTalkErrors;
pipxStatus.Dropped = data->droppedPackets;
pipxStatus.Resets = PIOS_RFM22B_Resets(pios_rfm22b_id); pipxStatus.Resets = PIOS_RFM22B_Resets(pios_rfm22b_id);
pipxStatus.TXRate = (uint16_t)((float)(data->txBytes * 1000) / STATS_UPDATE_PERIOD_MS); pipxStatus.TXRate = (uint16_t)((float)(data->txBytes * 1000) / STATS_UPDATE_PERIOD_MS);
data->txBytes = 0; data->txBytes = 0;
@ -721,6 +726,7 @@ static void radioStatusTask(void *parameters)
pipxStatus.Retries += data->pairStats[i].retries; pipxStatus.Retries += data->pairStats[i].retries;
pipxStatus.Errors += data->pairStats[i].errors; pipxStatus.Errors += data->pairStats[i].errors;
pipxStatus.UAVTalkErrors += data->pairStats[i].uavtalk_errors; pipxStatus.UAVTalkErrors += data->pairStats[i].uavtalk_errors;
pipxStatus.Dropped += data->pairStats[i].dropped;
pipxStatus.Resets += data->pairStats[i].resets; pipxStatus.Resets += data->pairStats[i].resets;
pipxStatus.LinkState = PIPXSTATUS_LINKSTATE_CONNECTED; pipxStatus.LinkState = PIPXSTATUS_LINKSTATE_CONNECTED;
} }

View File

@ -76,6 +76,7 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget
addUAVObjectToWidgetRelation("PipXStatus", "Errors", m_pipx->Errors); addUAVObjectToWidgetRelation("PipXStatus", "Errors", m_pipx->Errors);
addUAVObjectToWidgetRelation("PipXStatus", "UAVTalkErrors", m_pipx->UAVTalkErrors); addUAVObjectToWidgetRelation("PipXStatus", "UAVTalkErrors", m_pipx->UAVTalkErrors);
addUAVObjectToWidgetRelation("PipXStatus", "Resets", m_pipx->Resets); addUAVObjectToWidgetRelation("PipXStatus", "Resets", m_pipx->Resets);
addUAVObjectToWidgetRelation("PipXStatus", "Dropped", m_pipx->Dropped);
addUAVObjectToWidgetRelation("PipXStatus", "RXRate", m_pipx->RXRate); addUAVObjectToWidgetRelation("PipXStatus", "RXRate", m_pipx->RXRate);
addUAVObjectToWidgetRelation("PipXStatus", "TXRate", m_pipx->TXRate); addUAVObjectToWidgetRelation("PipXStatus", "TXRate", m_pipx->TXRate);

View File

@ -156,7 +156,7 @@
<number>-127</number> <number>-127</number>
</property> </property>
<property name="textVisible"> <property name="textVisible">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="format"> <property name="format">
<string>%v dBm</string> <string>%v dBm</string>
@ -185,7 +185,7 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="textVisible"> <property name="textVisible">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="format"> <property name="format">
<string>%v dBm</string> <string>%v dBm</string>
@ -214,7 +214,7 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="textVisible"> <property name="textVisible">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="format"> <property name="format">
<string>%v dBm</string> <string>%v dBm</string>
@ -243,7 +243,7 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="textVisible"> <property name="textVisible">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="format"> <property name="format">
<string>%v dBm</string> <string>%v dBm</string>
@ -631,7 +631,7 @@
</widget> </widget>
</item> </item>
<item row="9" column="0"> <item row="9" column="0">
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="RetriesLabel">
<property name="text"> <property name="text">
<string>Retries</string> <string>Retries</string>
</property> </property>
@ -775,9 +775,9 @@
</widget> </widget>
</item> </item>
<item row="13" column="0"> <item row="13" column="0">
<widget class="QLabel" name="TXRateLabel"> <widget class="QLabel" name="DroppedLabel">
<property name="text"> <property name="text">
<string>TX Rate (B/s)</string> <string>Dropped</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -785,7 +785,7 @@
</widget> </widget>
</item> </item>
<item row="13" column="1"> <item row="13" column="1">
<widget class="QLineEdit" name="TXRate"> <widget class="QLineEdit" name="Dropped">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -811,6 +811,42 @@
</widget> </widget>
</item> </item>
<item row="14" column="0"> <item row="14" column="0">
<widget class="QLabel" name="TXRateLabel">
<property name="text">
<string>TX Rate (B/s)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QLineEdit" name="TXRate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 8px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="RXRateLabel"> <widget class="QLabel" name="RXRateLabel">
<property name="text"> <property name="text">
<string>RX Rate (B/s)</string> <string>RX Rate (B/s)</string>
@ -820,7 +856,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="1"> <item row="15" column="1">
<widget class="QLineEdit" name="RXRate"> <widget class="QLineEdit" name="RXRate">
<property name="font"> <property name="font">
<font> <font>

View File

@ -14,6 +14,7 @@
<field name="Retries" units="" type="uint16" elements="1" defaultvalue="0"/> <field name="Retries" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="Errors" units="" type="uint16" elements="1" defaultvalue="0"/> <field name="Errors" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="UAVTalkErrors" units="" type="uint16" elements="1" defaultvalue="0"/> <field name="UAVTalkErrors" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="Dropped" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="Resets" units="" type="uint16" elements="1" defaultvalue="0"/> <field name="Resets" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="TXRate" units="Bps" type="uint16" elements="1" defaultvalue="0"/> <field name="TXRate" units="Bps" type="uint16" elements="1" defaultvalue="0"/>
<field name="RXRate" units="Bps" type="uint16" elements="1" defaultvalue="0"/> <field name="RXRate" units="Bps" type="uint16" elements="1" defaultvalue="0"/>