Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: F746_GUI_vV mbed Vision_Indus_IHM
Diff: main.cpp
- Revision:
- 12:262492b42b04
- Parent:
- 11:0195d802ab3d
- Child:
- 13:270545d8d62e
diff -r 0195d802ab3d -r 262492b42b04 main.cpp
--- a/main.cpp Sat Apr 30 06:34:22 2016 +0000
+++ b/main.cpp Mon May 30 14:35:25 2016 +0000
@@ -5,7 +5,7 @@
// GuiBase, Button, ButtonGroup, Label, NumericLabel, BlinkLabel,
// SeekBar, SeekbarGroup
//
-// 2016/04/30, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/05/30, Copyright (c) 2016 MIKAMI, Naoki
//--------------------------------------------------------------------------------
#include "NumericLabel.hpp"
@@ -15,15 +15,6 @@
using namespace Mikami;
-Ticker timer;
-NumericLabel<float> obj2(10, 116, Label::LEFT, Font16, LCD_COLOR_YELLOW);
-
-void TimerIsr()
-{
- static int sec = 0;
- obj2.Draw("%6.1f [s]", (float)(sec++)/10.0f);
-}
-
int main()
{
Label obj10(240, 2, "Dome: GUI parts, 2016/04/30, 15:31", Label::CENTER, Font16);
@@ -62,20 +53,19 @@
NumericLabel<int> numLabel3(160, 205);
// SeekbarGroup (vertical)
- SeekbarGroup barV(400, 120, 130, 2, 50, -5, 5, 2,
+ SeekbarGroup barV(410, 130, 121, 2, 45, -6, 6, 2,
SeekBar::Vertical, 0xFFA0FFC0);
NumericLabel<float> **numLabel4;
numLabel4 = new NumericLabel<float> *[2];
for (int n=0; n<2; n++) numLabel4[n] =
- new NumericLabel<float>(400+n*50, 94, "%4.1f", barV.GetValue(n), Label::CENTER);
+ new NumericLabel<float>(410+n*45, 104, "%4.1f", barV.GetValue(n), Label::CENTER);
+ NumericLabel<int> numLabel5(455, 92, "%1d", barV.GetIntValue(0), Label::CENTER);
- // Test of left-, cenrer-, right-justified
+ // Test of left-, cenrer-, and right-justified
Label leftJustified(420, 52, "ABC", Label::LEFT);
Label centerJustified(420, 62, "ABC", Label::CENTER);
Label rightJustified1(420, 72, "ABC", Label::RIGHT);
- timer.attach(&TimerIsr, 0.1f);
-
while (true)
{
if (button1.Touched()) button2.Draw();
@@ -117,8 +107,11 @@
int sbNum;
if (barV.GetSlidedNumber(sbNum))
- numLabel4[sbNum]->Draw("%4.1f", barV.GetValue(sbNum));
-
+ {
+ if (sbNum == 0) numLabel4[sbNum]->Draw("%4.1f", barV.GetValue(sbNum));
+ else numLabel4[sbNum]->Draw("%4.1f", barV.GetValue(sbNum));
+ if (sbNum == 1) numLabel5.Draw("%1d", barV.GetIntValue(sbNum));
+ }
// If "doNotTouch" button touched, trapped into endless loop
if (doNotTouch.Touched())
BlinkLabel warning(250, 200, "You must reset", Label::LEFT, Font16);