Skip to content

Commit

Permalink
Fix bind bug in r221/F9
Browse files Browse the repository at this point in the history
Fix AFHDS2A telemetry in Multi
Add failsafe to eepskye
  • Loading branch information
MikeBland committed Dec 31, 2017
1 parent a9dc08a commit 75a866c
Show file tree
Hide file tree
Showing 16 changed files with 422 additions and 35 deletions.
2 changes: 2 additions & 0 deletions eepe/eepe/src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ QString subSubProtocolText( int type, int index, QComboBox *b )
case M_FRSKYX :
names[0] = "CH-16" ;
names[1] = "CH-8" ;
names[2] = "EU-16" ;
names[3] = "EU-8" ;
break ;
case M_CG023 :
names[0] = "CG023" ;
Expand Down
39 changes: 38 additions & 1 deletion eepe/eepskye/src/ProtocolDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,21 +281,50 @@ void ProtocolDialog::setBoxes()
ui->rateLabel->show() ;
ui->rateCB->show() ;
}
if ( save == PROTO_PXX )
if ( hasFailsafe() )
{
ui->FailsafeCB->setCurrentIndex( ppd->failsafeMode ) ;
ui->RepeatSendCB->setChecked( !ppd->failsafeRepeat ) ;
ui->failsafeLabel->show() ;
ui->FailsafeCB->show() ;
ui->RepeatSendCB->show() ;
ui->RepeatLabel->show() ;
}
else
{
ui->failsafeLabel->hide() ;
ui->FailsafeCB->hide() ;
ui->RepeatSendCB->hide() ;
ui->RepeatLabel->hide() ;
}

protocolEditLock = false ;
}

uint32_t ProtocolDialog::hasFailsafe(void)
{
if ( ppd->protocol == PROTO_MULTI )
{
if ( ( ppd->sub_protocol & 0x3F ) == 6 ) return 1 ; // Devo
if ( ( ppd->sub_protocol & 0x3F ) == 20 ) return 1 ;
if ( ( ppd->sub_protocol & 0x3F ) == 27 ) return 1 ;
if ( ( ppd->sub_protocol & 0x3F ) == 29 ) return 1 ;
if ( ( ppd->sub_protocol & 0x3F ) == 14 ) // FrskyX
{
if ( ( ( (ppd->channels >> 4) & 0x07 ) & 1 ) == 0 )
{
return 1 ;
}
}
}
if ( ppd->protocol == PROTO_PXX )
{
if ( ppd->sub_protocol == 0 ) return 1 ;
}
return 0 ;
}


void ProtocolDialog::on_ProtocolCB_currentIndexChanged(int index)
{
if(protocolEditLock) return;
Expand Down Expand Up @@ -435,13 +464,15 @@ void ProtocolDialog::on_multiTypeCB_currentIndexChanged(int index)
ppd->sub_protocol = index + (ppd->sub_protocol & 0xC0) ;
subSubProtocolText( ppd->sub_protocol & 0x3F, 0, ui->multiSubProtocolCB ) ;
ui->multiSubProtocolCB->setCurrentIndex( (ppd->channels >> 4) & 0x07 ) ;
setBoxes();
}

void ProtocolDialog::on_multiSubProtocolCB_currentIndexChanged(int value)
{
if ( protocolEditLock ) return ;
if ( value < 0 ) return ;
ppd->channels = ( value << 4) + (ppd->channels & 0x8F);
setBoxes();
}

void ProtocolDialog::on_rateCB_currentIndexChanged(int index)
Expand All @@ -454,6 +485,12 @@ void ProtocolDialog::on_FailsafeCB_currentIndexChanged(int index)
{
if ( protocolEditLock ) return ;
ppd->failsafeMode = index ;
}

void ProtocolDialog::on_RepeatSendCB_toggled(bool checked)
{
if ( protocolEditLock ) return ;
ppd->failsafeRepeat = !checked ;

}

2 changes: 2 additions & 0 deletions eepe/eepskye/src/ProtocolDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ProtocolDialog : public QDialog {

protected:
void setBoxes() ;
uint32_t hasFailsafe(void) ;

// void changeEvent(QEvent *e);

Expand All @@ -40,6 +41,7 @@ private slots:
void on_multiSubProtocolCB_currentIndexChanged(int value) ;
void on_rateCB_currentIndexChanged(int index) ;
void on_FailsafeCB_currentIndexChanged(int index) ;
void on_RepeatSendCB_toggled(bool checked) ;

// void valuesChanged();
// void updateChannels() ;
Expand Down
37 changes: 36 additions & 1 deletion eepe/eepskye/src/ProtocolDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@
</property>
</widget>
</item>
<item row="1" column="2">
<item row="16" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -1056,6 +1056,28 @@
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QLabel" name="RepeatLabel">
<property name="minimumSize">
<size>
<width>115</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>115</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Repeat Send</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QComboBox" name="FailsafeCB">
Expand Down Expand Up @@ -1105,6 +1127,19 @@
</property>
</item>
</widget>
<widget class="QCheckBox" name="RepeatSendCB">
<property name="geometry">
<rect>
<x>390</x>
<y>40</y>
<width>71</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<resources/>
<connections>
Expand Down
9 changes: 6 additions & 3 deletions eepe/eepskye/src/eepskye.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ HEADERS += mainwindow.h \
GvarAdjustDialog.h \
ProtocolDialog.h \
SwitchDialog.h \
loggingDialog.h
loggingDialog.h \
cellDialog.h
SOURCES += main.cpp \
mainwindow.cpp \
file.cpp \
Expand Down Expand Up @@ -65,7 +66,8 @@ SOURCES += main.cpp \
GvarAdjustDialog.cpp \
ProtocolDialog.cpp \
switchDialog.cpp \
loggingDialog.cpp
loggingDialog.cpp \
cellDialog.cpp
unix {
SOURCES += mountlist.cpp
}
Expand All @@ -88,7 +90,8 @@ FORMS += modeledit.ui \
GvarAdjustDialog.ui \
ProtocolDialog.ui \
SwitchDialog.ui \
loggingDialog.ui
loggingDialog.ui \
cellDialog.ui
TRANSLATIONS = eepe_.ts \
eepe_he.ts \
eepe_pt.ts \
Expand Down
Loading

0 comments on commit 75a866c

Please sign in to comment.