Skip to content

Commit f421a77

Browse files
committed
Merge branch 'dev'
2 parents 422e403 + 6e5ef0d commit f421a77

File tree

16 files changed

+157
-146
lines changed

16 files changed

+157
-146
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.gcc-flags.json
44
.piolibdeps
55
src/main.cpp
6-
examples/debug
6+
/debug
77
lib
88
.travis.yml
99
!/.travis.yml

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,14 @@ Web browser (experimental) when using ESP devices
208208
## Dependencies
209209
This library depends on the following libraries:
210210
211-
- Streaming https://github.com/scottdky/Streaming (on debug mode)
212-
- Assert4a https://github.com/nettigo/Assert4a (on debug mode)
211+
- streamFlow https://github.com/neu-rah/streamFlow (on debug mode)
213212
214213
Depending on the type of input or output, other libraries might be needed. Essentially any library needed for your devices.
215214
216215
## Limits
217216
218217
- when using macros the menu is limited to 16 options (current macro limnit).
219-
- menus **must** have at least 2 options.
218+
- menus **must** have at least 2 options when built using macros.
220219
- maximum 127 options.
221220
- fast access (numeric keys) only supports 9 options (1 to 9)
222221
- prompts can overflow on panels with less than 4 characters width
@@ -255,7 +254,7 @@ multiple stream packing for input to mix encoder stream with encoder keyboard (u
255254
- More examples
256255
- Text edit fields with validation *
257256
- Pad style menus (horizontal list)
258-
- inline pad menus can input custom formats like IP/Date/Time, experimental and just for devices that can position a cursor
257+
- inline pad menus can input custom formats like IP/Date/Time, experimental and just for devices that can position a cursor
259258
- Plugins, alternative menu items potentially device specific
260259
- Allow multiple concurrent menus
261260
- Support UCGLib displays

TODO.txt

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
11
Arduino Menu Library
22

3-
- pad menu should exit at left (the least)
4-
=> can have edit blocks (non-preview)
5-
- implement dynamic attribute hidden and edit (only appears on edit)
6-
- central menu init
3+
- password fields
4+
- scroll long prompts (not for serial)
5+
- allow disabled items to receive events! for help print purposes
6+
- support frames
7+
- explore arrow keys for ansiSerial
8+
- alternative keys example
9+
- freelancer fields (can be polled without a menu structure, or a singular menu struct)
10+
=>navNode needed to point o navTarget instead of menuNode <- NOT!
11+
=>use an one option menu
12+
- support 1 option menu on macros
13+
- use formatters for color application
14+
- detach panels from output, instead panels should be a gateway for output!
15+
- Web menu: index all handlers and let web call them by ID (forget the parser)
16+
=> how to index to a field value? handlers should have received the values => templates :S
17+
feedback, use the same schema ids should update the state on a permanent web page
18+
updates should be requested by the client along with the current page url/path (navNode)
19+
then javascript should update the values received by id.
20+
- constructing the callback table...
21+
a) navRoot.begin() but then webmenu had to register
22+
b) * use esp8266Out.begin()
23+
24+
- central menu init by calling menu begin
725
=> check's ex: if numeric input available then output numeric indexes
8-
+1 padMenu: printMenu needs to return idx_t instead of void
26+
- help texts
27+
=> multi-line fields to combine with menu preview
28+
- implement dynamic attribute hidden and edit (only appears on edit)
29+
30+
31+
DONE:
32+
+ pad menu should exit at left (the least)
33+
? can have edit blocks (non-preview) => require new attribute
34+
+ padMenu: printMenu needs to return idx_t instead of void
935
=> why not an area? because it would send menu to a 2d thing.. .and its already huge for AVR's
1036
and using and area => that all printTo had to return an area
1137
- done so on a dumb mode where int means width and using original width return
1238
change it later to width,height
13-
-2 mark exit options
39+
x mark exit options
1440
-> then we can zero index them
1541
-> can omit them on in-line pad preview
1642
=> abandoned! options are marked with _Exit system style but no more
1743
because kb accels would go very complicated
18-
- freelancer fields (can be polled without a menu structure, or a singular menu struct)
19-
=>navNode needed to point o navTarget instead of menuNode <- NOT!
20-
=>use an one option menu
21-
- support 1 option menu on macros
22-
- use formatters for color application
44+
=> primary source of panels continues to be the output definition
2345
+ remove title brackets
24-
- detach panels from output, instead panels should be a gateway for output!
25-
=> primary source continues to be the output definition
26-
- scroll long prompts (not for serial)
27-
- allow disabled items to receive events! for help print purposes
28-
- help texts
29-
=> multi-line fields to combine with menu preview
30-
- password fields
31-
- support frames
32-
- explore arrow keys for ansiSerial
33-
- alternative keys example
3446
+ separate functions as parentDraw, isMenu, asPad, etc... are inefficient
3547
=> added `is` and `has` functions to deal with systemStyles, styles and events
3648
+ check uint8_t types -> wrap and non-wrap ok

examples/Serial/ansiSerial/ansiSerial/ansiSerial.ino

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,24 @@ MENU(subMenu,"Sub-Menu",doNothing,noEvent,noStyle
227227
,EXIT("<Back")
228228
);
229229

230-
// extern menu mainMenu;
231-
// TOGGLE((mainMenu[1].enabled),togOp,"Op 2:",doNothing,noEvent,noStyle
232-
// ,VALUE("Enabled",enabledStatus,doNothing,noEvent)
233-
// ,VALUE("disabled",disabledStatus,doNothing,noEvent)
234-
// );
230+
uint16_t year=2017;
231+
uint16_t month=10;
232+
uint16_t day=7;
233+
234+
//define a pad style menu (single line menu)
235+
//here with a set of fields to enter a date in YYYY/MM/DD format
236+
altMENU(menu,birthDate,"Birth",doNothing,noEvent,noStyle,(systemStyles)(_asPad|Menu::_menuData|Menu::_canNav|_parentDraw)
237+
,FIELD(year,"","/",1900,3000,20,1,doNothing,noEvent,noStyle)
238+
,FIELD(month,"","/",1,12,1,0,doNothing,noEvent,wrapStyle)
239+
,FIELD(day,"","",1,31,1,0,doNothing,noEvent,wrapStyle)
240+
);
235241

236242
char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
237243
char* constMEM hexNr[] MEMMODE={"0","x",hexDigit,hexDigit};
238244
char buf1[]="0x11";
239245

240246
MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
247+
,SUBMENU(birthDate)
241248
,OP("Op1",action1,anyEvent)
242249
,OP("Op2",action2,enterEvent)
243250
//,SUBMENU(togOp)

examples/Serial/ansiSerial/platformio.ini

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111
src_dir=ansiSerial
1212
lib_dir=~/Arduino/Libraries
1313

14-
; [env:nanoatmega328]
15-
; platform = atmelavr
16-
; board = nanoatmega328
17-
; framework = arduino
18-
; upload_port=/dev/ttyUSB*
19-
; upload_flags=-V
20-
; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
14+
[env:nanoatmega328]
15+
platform = atmelavr
16+
board = nanoatmega328
17+
framework = arduino
18+
upload_port=/dev/ttyUSB*
19+
upload_flags=-V
20+
build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
2121

2222
; [env:teensy31]
2323
; platform = teensy
2424
; board = teensy31
2525
; framework = arduino
2626
; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++
2727

28-
[env:due]
29-
platform = atmelsam
30-
board = due
31-
framework = arduino
32-
build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG -DNOTRACE
28+
; [env:due]
29+
; platform = atmelsam
30+
; board = due
31+
; framework = arduino
32+
; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG -DNOTRACE
3333

3434
;[env:esp01_1m]
3535
;platform = espressif8266

examples/Serial/serialio/serialio/serialio.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ uint16_t day=7;
9393

9494
//define a pad style menu (single line menu)
9595
//here with a set of fields to enter a date in YYYY/MM/DD format
96-
altMENU(menu,birthDate,"Birth",doNothing,noEvent,noStyle,_asPad
96+
//altMENU(menu,birthDate,"Birth",doNothing,noEvent,noStyle,(systemStyles)(_asPad|Menu::_menuData|Menu::_canNav|_parentDraw)
97+
PADMENU(birthDate,"Birth",doNothing,noEvent,noStyle
9798
,FIELD(year,"","/",1900,3000,20,1,doNothing,noEvent,noStyle)
9899
,FIELD(month,"","/",1,12,1,0,doNothing,noEvent,wrapStyle)
99100
,FIELD(day,"","",1,31,1,0,doNothing,noEvent,wrapStyle)
@@ -104,6 +105,7 @@ char* constMEM hexNr[] MEMMODE={"0","x",hexDigit,hexDigit};
104105
char buf1[]="0x11";
105106

106107
MENU(mainMenu,"Main menu",zZz,noEvent,wrapStyle
108+
,SUBMENU(birthDate)
107109
,OP("Op1",action1,anyEvent)
108110
,OP("Op2",action2,enterEvent)
109111
,FIELD(test,"Test","%",0,100,10,1,doNothing,noEvent,wrapStyle)
@@ -115,7 +117,6 @@ MENU(mainMenu,"Main menu",zZz,noEvent,wrapStyle
115117
,SUBMENU(chooseMenu)
116118
,OP("Alert test",doAlert,enterEvent)
117119
,EDIT("Hex",buf1,hexNr,doNothing,noEvent,noStyle)
118-
//,SUBMENU(birthDate)
119120
,EXIT("<Back")
120121
);
121122

examples/esp8266/WebMenu/WebMenu/WebMenu.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
115115

116116
int timeOn=50;
117117
void updAnalog() {
118-
analogWrite(ANALOG_PIN,map(timeOn,0,100,0,PWMRANGE));
118+
analogWrite(ANALOG_PIN,map(timeOn,0,100,0,255/*PWMRANGE*/));
119119
}
120120

121121
//the menu
@@ -268,8 +268,9 @@ bool handleMenu(){
268268
void setup(){
269269
pinMode(LEDPIN,OUTPUT);
270270
updLed();
271+
analogWriteRange(1023);
271272
pinMode(ANALOG_PIN,OUTPUT);
272-
analogWriteRange(255);
273+
updAnalog();
273274
//options=&myOptions;//menu options
274275
Serial.begin(115200);
275276
while(!Serial)

examples/esp8266/WebMenu/WebMenu/data/menu.css

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
/*
2-
* Globals
3-
*/
1+
html,
2+
body {
3+
height: 100%;
4+
background-color: #132;
5+
}
6+
body {
7+
color: #fff;
8+
text-align: center;
9+
text-shadow: 0 1px 3px rgba(0,0,0,.5);
10+
font-size: 18px;
11+
}
412

513
/* Links */
614
a,
@@ -9,6 +17,10 @@ a:hover {
917
color: #fff;
1018
}
1119

20+
.aml_op {
21+
font-size:1.3em;
22+
}
23+
1224
.actionBtn {
1325
display:inline-block;
1426
padding:1em;
@@ -39,17 +51,6 @@ input[type=range] {
3951
* Base structure
4052
*/
4153

42-
html,
43-
body {
44-
height: 100%;
45-
background-color: #132;
46-
}
47-
body {
48-
color: #fff;
49-
text-align: center;
50-
text-shadow: 0 1px 3px rgba(0,0,0,.5);
51-
}
52-
5354
select {color: black;}
5455

5556
/* Extra markup and styles for table-esque vertical and horizontal centering */
@@ -84,11 +85,15 @@ select {color: black;}
8485
margin-bottom: 10px;
8586
}
8687

88+
ul {
89+
list-style-type: none;
90+
}
91+
8792
.masthead-nav > li {
8893
display: inline-block;
8994
}
9095
.masthead-nav > li + li {
91-
margin-left: 20px;
96+
margin-left: 0.5em;
9297
}
9398
.masthead-nav > li > a {
9499
padding-right: 0;

examples/esp8266/WebMenu/WebMenu/data/menu.xslt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
this is usefull for develop/debug
1111
to use external server the browser must be intructed to accept cross domain files
1212
-->
13-
<xsl:variable name="auxFilesSrc">http://neurux:8080</xsl:variable>
13+
<xsl:variable name="auxFilesSrc"></xsl:variable>
1414

1515
<xsl:template match="/">
1616
<html>
@@ -45,7 +45,7 @@
4545
<div class="cover-container">
4646
<div class="masthead clearfix">
4747
<div class="inner">
48-
<h3 class="masthead-brand">ArduinoMenu library</h3>
48+
<a href="/"><h3 class="masthead-brand">ArduinoMenu library</h3></a>
4949
<nav>
5050
<ul class="nav masthead-nav">
5151
<li class="active"><a href="https://github.com/neu-rah/ArduinoMenu">Home</a></li>
@@ -57,7 +57,8 @@
5757
</div>
5858

5959
<div class="inner cover">
60-
<h2><img src="logo.png" height="48px"/>on ESP8266 (dev mode!)</h2>
60+
<h2><img src="logo.png" height="48px"/>on ESP8266</h2>
61+
(dev mode!)
6162
<xsl:apply-templates/>
6263
</div>
6364

src/macros.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Menu::utftOut id##n(gfx,color,id##Tops##n,id##Panels##n,fontW,fontH);
157157
Menu::outputsList id(id##_outPtrs,sizeof(id##_outPtrs)/sizeof(Menu::menuOut*));
158158

159159
#define MENU(id,text,aFn,mask,style,...) altMENU(Menu::menu,id,text,aFn,mask,style,(Menu::_menuData|Menu::_canNav),__VA_ARGS__)
160+
#define PADMENU(id,text,aFn,mask,style,...) altMENU(Menu::menu,id,text,aFn,mask,style,(Menu::_asPad|Menu::_menuData|Menu::_canNav|Menu::_parentDraw),__VA_ARGS__)
160161
#define altMENU(objType,id,text,aFn,mask,style,ss,...)\
161162
FOR_EACH(DECL,__VA_ARGS__)\
162163
constMEM char id##_text[] MEMMODE=text;\

0 commit comments

Comments
 (0)