#include "nakayama.h" using namespace nn::red::nakayama; class S1FunctionTest: public Program { public: virtual void Execute() { Page page; Label running; running.X = 120; running.Y = 100; running.Text = "Running"; page.Add(running); Label loop; loop.X = 10; loop.Y = 200; loop.Text = "Loop:"; page.Add(loop); Label count; count.X = 60; count.Y = 200; count.Text = "0000000000000"; page.Add(count); KeyPad& pad = KeyPad::GetInstance(); while (1) { pad.ReadKey(); page.Show(Display::GetInstance(Display::Lower)); if (pad.IsTrigger(KeyPad::B)) { Display::GetInstance(Display::Lower).Clear(); Display::GetInstance(Display::Lower).SwapBuffer(); break; } } }; }; class S2FunctionTest: public Program { public: virtual void Execute() { Page page; Label running; running.X = 120; running.Y = 100; running.Text = "Running"; page.Add(running); Label loop; loop.X = 10; loop.Y = 200; loop.Text = "Loop:"; page.Add(loop); Label count; count.X = 60; count.Y = 200; count.Text = "0000000000000"; page.Add(count); KeyPad& pad = KeyPad::GetInstance(); while (1) { pad.ReadKey(); page.Show(Display::GetInstance(Display::Lower)); if (pad.IsTrigger(KeyPad::B)) { Display::GetInstance(Display::Lower).Clear(); Display::GetInstance(Display::Lower).SwapBuffer(); break; } } }; }; class IrregularAccessTest: public Program { }; class FunctionTest: public Program { virtual void Execute() { Page page; Label title; title.X = 20; title.Y = 10; title.Text = "Function Test"; page.Add(title); Label date; date.X = 250; date.Y = 10; date.Text = __DATE__; page.Add(date); Selector menu; menu.X = 30; menu.Y = 40; page.Add(menu); // [TODO] カードIDに応じて切り替える if (1) { menu.Register("S1 Function Test", *(new S1FunctionTest())); } else { menu.Register("S2 Function Test", *(new S2FunctionTest())); } menu.Register("Irregular Access Test", *(new IrregularAccessTest())); while (1) { page.Show(Display::GetInstance(Display::Upper)); if (menu.Selected) { menu.GetSelectedItem()->Execute(); menu.Selected = false; } if (menu.Canceled) { menu.Canceled = false; break; } } }; };