mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 06:49:24 -05:00
Merge pull request #925 from gullradriel/level-mem-workaround
Automatically reduce rssi graph history
This commit is contained in:
commit
7a89858cc6
@ -434,6 +434,23 @@ namespace ui {
|
|||||||
void RSSIGraph::set_nb_columns( int16_t nb )
|
void RSSIGraph::set_nb_columns( int16_t nb )
|
||||||
{
|
{
|
||||||
nb_columns = nb ;
|
nb_columns = nb ;
|
||||||
|
while( graph_list.size() > nb_columns )
|
||||||
|
{
|
||||||
|
graph_list.erase( graph_list.begin() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RSSIGraph::on_hide() {
|
||||||
|
nb_columns_before_hide = nb_columns ;
|
||||||
|
nb_columns = 1 ;
|
||||||
|
while( graph_list.size() > nb_columns )
|
||||||
|
{
|
||||||
|
graph_list.erase( graph_list.begin() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RSSIGraph::on_show() {
|
||||||
|
nb_columns = nb_columns_before_hide ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSSI::on_focus() {
|
void RSSI::on_focus() {
|
||||||
|
@ -115,8 +115,12 @@ namespace ui {
|
|||||||
void paint(Painter& painter) override;
|
void paint(Painter& painter) override;
|
||||||
void add_values(int16_t rssi_min, int16_t rssi_avg, int16_t rssi_max, int16_t db );
|
void add_values(int16_t rssi_min, int16_t rssi_avg, int16_t rssi_max, int16_t db );
|
||||||
void set_nb_columns( int16_t nb );
|
void set_nb_columns( int16_t nb );
|
||||||
|
|
||||||
|
void on_hide() override ;
|
||||||
|
void on_show() override ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
uint16_t nb_columns_before_hide = 16 ;
|
||||||
uint16_t nb_columns = 16 ;
|
uint16_t nb_columns = 16 ;
|
||||||
RSSIGraphList graph_list { } ;
|
RSSIGraphList graph_list { } ;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user