[CLI] reboot command added

This commit is contained in:
Bertrand Songis
2016-02-20 16:55:05 +01:00
parent 0f4f49b64e
commit 67a599e0b9
45 changed files with 920 additions and 605 deletions
+15 -19
View File
@@ -20,6 +20,16 @@
#include "opentx.h"
const uint8_t LBM_LAYOUT_1x1[] = {
#include "mask_layout1x1.lbm"
};
const ZoneOption OPTIONS_LAYOUT_1x1[] = {
{ "Top bar", ZoneOption::Bool },
{ "Sliders+Trims", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
class Layout1x1: public Layout
{
public:
@@ -55,25 +65,15 @@ class Layout1x1: public Layout
return zone;
}
virtual void refresh(bool setup=false);
static const ZoneOption options[];
virtual void refresh();
};
const ZoneOption Layout1x1::options[] = {
{ "Top bar", ZoneOption::Bool },
{ "Sliders+Trims", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
void Layout1x1::refresh(bool setup)
void Layout1x1::refresh()
{
theme->drawBackground();
if (persistentData->options[0].boolValue) {
// Top Bar
drawMainViewTopBar();
drawTopBar();
}
if (persistentData->options[1].boolValue) {
@@ -86,11 +86,7 @@ void Layout1x1::refresh(bool setup)
drawTrims(mixerCurrentFlightMode);
}
Layout::refresh(setup);
Layout::refresh();
}
const uint8_t LBM_LAYOUT_1x1[] __DMA = {
#include "mask_layout1x1.lbm"
};
BaseLayoutFactory<Layout1x1> layout1x1("Layout1x1", LBM_LAYOUT_1x1, Layout1x1::options);
BaseLayoutFactory<Layout1x1> layout1x1("Layout1x1", LBM_LAYOUT_1x1, OPTIONS_LAYOUT_1x1);
+25 -31
View File
@@ -20,6 +20,24 @@
#include "opentx.h"
const uint8_t LBM_LAYOUT_2P1[] = {
#include "mask_layout2+1.lbm"
};
const ZoneOption OPTIONS_LAYOUT_2P1[] = {
{ "Top bar", ZoneOption::Bool },
{ "Flight mode", ZoneOption::Bool },
{ "Sliders", ZoneOption::Bool },
{ "Trims", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
const Zone ZONES_LAYOUT_2P1[3] = {
{ 240, 60, 192, 152 },
{ 48, 60, 180, 70 },
{ 48, 142, 180, 70 }
};
class Layout2P1: public Layout
{
public:
@@ -39,43 +57,23 @@ class Layout2P1: public Layout
virtual unsigned int getZonesCount() const
{
return 3;
return DIM(ZONES_LAYOUT_2P1);
}
virtual Zone getZone(unsigned int index) const
{
return zones[index];
return ZONES_LAYOUT_2P1[index];
}
virtual void refresh(bool setup=false);
static const ZoneOption options[];
protected:
static const Zone zones[3];
virtual void refresh();
};
const Zone Layout2P1::zones[3] = {
{ 240, 60, 192, 145 },
{ 46, 60, 182, 66 },
{ 46, 139, 182, 66 }
};
const ZoneOption Layout2P1::options[] = {
{ "Top bar", ZoneOption::Bool },
{ "Flight mode", ZoneOption::Bool },
{ "Sliders", ZoneOption::Bool },
{ "Trims", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
void Layout2P1::refresh(bool setup)
void Layout2P1::refresh()
{
theme->drawBackground();
if (persistentData->options[0].boolValue) {
// Top Bar
drawMainViewTopBar();
drawTopBar();
}
if (persistentData->options[1].boolValue) {
@@ -98,11 +96,7 @@ void Layout2P1::refresh(bool setup)
drawTrims(mixerCurrentFlightMode);
}
Layout::refresh(setup);
Layout::refresh();
}
const uint8_t LBM_LAYOUT_2P1[] __DMA = {
#include "mask_layout2+1.lbm"
};
BaseLayoutFactory<Layout2P1> layout2P1("Layout2P1", LBM_LAYOUT_2P1, Layout2P1::options);
BaseLayoutFactory<Layout2P1> layout2P1("Layout2P1", LBM_LAYOUT_2P1, OPTIONS_LAYOUT_2P1);
+14 -18
View File
@@ -20,6 +20,15 @@
#include "opentx.h"
const uint8_t LBM_LAYOUT_2x1[] = {
#include "mask_layout2x1.lbm"
};
const ZoneOption OPTIONS_LAYOUT_2x1[] = {
{ "Top bar", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
class Layout2x1: public Layout
{
public:
@@ -55,31 +64,18 @@ class Layout2x1: public Layout
return zone;
}
virtual void refresh(bool setup=false);
static const ZoneOption options[];
virtual void refresh();
};
const ZoneOption Layout2x1::options[] = {
{ "Top bar", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
void Layout2x1::refresh(bool setup)
void Layout2x1::refresh()
{
theme->drawBackground();
if (persistentData->options[0].boolValue) {
// Top Bar
drawMainViewTopBar();
drawTopBar();
}
Layout::refresh(setup);
Layout::refresh();
}
const uint8_t LBM_LAYOUT_2x1[] __DMA = {
#include "mask_layout2x1.lbm"
};
BaseLayoutFactory<Layout2x1> Layout2x1("Layout2x1", LBM_LAYOUT_2x1, Layout2x1::options);
BaseLayoutFactory<Layout2x1> Layout2x1("Layout2x1", LBM_LAYOUT_2x1, OPTIONS_LAYOUT_2x1);
+14 -18
View File
@@ -20,6 +20,15 @@
#include "opentx.h"
const uint8_t LBM_LAYOUT_2x2[] = {
#include "mask_layout2x2.lbm"
};
const ZoneOption OPTIONS_LAYOUT_2x2[] = {
{ "Top bar", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
class Layout2x2: public Layout
{
public:
@@ -58,31 +67,18 @@ class Layout2x2: public Layout
return zone;
}
virtual void refresh(bool setup=false);
static const ZoneOption options[];
virtual void refresh();
};
const ZoneOption Layout2x2::options[] = {
{ "Top bar", ZoneOption::Bool },
{ NULL, ZoneOption::Bool }
};
void Layout2x2::refresh(bool setup)
void Layout2x2::refresh()
{
theme->drawBackground();
if (persistentData->options[0].boolValue) {
// Top Bar
drawMainViewTopBar();
drawTopBar();
}
Layout::refresh(setup);
Layout::refresh();
}
const uint8_t LBM_LAYOUT_2x2[] __DMA = {
#include "mask_layout2x2.lbm"
};
BaseLayoutFactory<Layout2x2> layout2x2("Layout2x2", LBM_LAYOUT_2x2, Layout2x2::options);
BaseLayoutFactory<Layout2x2> layout2x2("Layout2x2", LBM_LAYOUT_2x2, OPTIONS_LAYOUT_2x2);
+21 -25
View File
@@ -20,6 +20,22 @@
#include "opentx.h"
const uint8_t LBM_LAYOUT_2x4[] = {
#include "mask_layout2x4.lbm"
};
const ZoneOption OPTIONS_LAYOUT_2x4[] = {
{ "Top bar", ZoneOption::Bool },
{ "Flight mode", ZoneOption::Bool },
{ "Sliders", ZoneOption::Bool },
{ "Trims", ZoneOption::Bool },
{ "Panel1 background", ZoneOption::Bool },
{ " Color", ZoneOption::Color },
{ "Panel2 background", ZoneOption::Bool },
{ " Color", ZoneOption::Color },
{ NULL, ZoneOption::Bool }
};
class Layout2x4: public Layout
{
public:
@@ -56,31 +72,15 @@ class Layout2x4: public Layout
return zone;
}
virtual void refresh(bool setup=false);
static const ZoneOption options[];
virtual void refresh();
};
const ZoneOption Layout2x4::options[] = {
{ "Top bar", ZoneOption::Bool },
{ "Flight mode", ZoneOption::Bool },
{ "Sliders", ZoneOption::Bool },
{ "Trims", ZoneOption::Bool },
{ "Panel1 background", ZoneOption::Bool },
{ " Color", ZoneOption::Color },
{ "Panel2 background", ZoneOption::Bool },
{ " Color", ZoneOption::Color },
{ NULL, ZoneOption::Bool }
};
void Layout2x4::refresh(bool setup)
void Layout2x4::refresh()
{
theme->drawBackground();
if (persistentData->options[0].boolValue) {
// Top Bar
drawMainViewTopBar();
drawTopBar();
}
if (persistentData->options[1].boolValue) {
@@ -113,11 +113,7 @@ void Layout2x4::refresh(bool setup)
lcdDrawSolidFilledRect(250, 50, 180, 170, CUSTOM_COLOR);
}
Layout::refresh(setup);
Layout::refresh();
}
const uint8_t LBM_LAYOUT_2x4[] __DMA = {
#include "mask_layout2x4.lbm"
};
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", LBM_LAYOUT_2x4, Layout2x4::options);
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", LBM_LAYOUT_2x4, OPTIONS_LAYOUT_2x4);