mirror of
https://github.com/rvtr/ctr_card_test.git
synced 2025-10-31 13:51:17 -04:00
カード評価関数をちょっと組み込み
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_card_test@6 ff8ce827-af98-4349-adb5-4c00699b5328
This commit is contained in:
parent
dc4dbc75e7
commit
cf445c8195
@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
using namespace nn::red::nakayama;
|
using namespace nn::red::nakayama;
|
||||||
|
|
||||||
class S1FunctionTest: public Program
|
class CardFunctionTest: public Program
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void Execute()
|
virtual void Execute()
|
||||||
{
|
{
|
||||||
|
bool run = false;
|
||||||
Page page;
|
Page page;
|
||||||
|
|
||||||
Label running;
|
Label running;
|
||||||
@ -34,53 +35,30 @@ public:
|
|||||||
pad.ReadKey();
|
pad.ReadKey();
|
||||||
page.Show(Display::GetInstance(Display::Lower));
|
page.Show(Display::GetInstance(Display::Lower));
|
||||||
|
|
||||||
if (pad.IsTrigger(KeyPad::B))
|
if (pad.IsTrigger(KeyPad::A))
|
||||||
{
|
{
|
||||||
Display::GetInstance(Display::Lower).Clear();
|
// 実行中でなければ
|
||||||
Display::GetInstance(Display::Lower).SwapBuffer();
|
if( !run )
|
||||||
break;
|
{
|
||||||
|
run = true;
|
||||||
|
//cardFunctionTestStart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
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))
|
if (pad.IsTrigger(KeyPad::B))
|
||||||
{
|
{
|
||||||
Display::GetInstance(Display::Lower).Clear();
|
// 実行中であれば
|
||||||
Display::GetInstance(Display::Lower).SwapBuffer();
|
if( run )
|
||||||
break;
|
{
|
||||||
|
run = false;
|
||||||
|
cardFunctionTestEnd();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Display::GetInstance(Display::Lower).Clear();
|
||||||
|
Display::GetInstance(Display::Lower).SwapBuffer();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -94,6 +72,7 @@ class FunctionTest: public Program
|
|||||||
{
|
{
|
||||||
virtual void Execute()
|
virtual void Execute()
|
||||||
{
|
{
|
||||||
|
string test_label;
|
||||||
Page page;
|
Page page;
|
||||||
|
|
||||||
Label title;
|
Label title;
|
||||||
@ -113,15 +92,18 @@ class FunctionTest: public Program
|
|||||||
menu.Y = 40;
|
menu.Y = 40;
|
||||||
page.Add(menu);
|
page.Add(menu);
|
||||||
|
|
||||||
// [TODO] カードIDに応じて切り替える
|
// [TODO] カードID読み出し
|
||||||
|
|
||||||
|
|
||||||
if (1)
|
if (1)
|
||||||
{
|
{
|
||||||
menu.Register("S1 Function Test", *(new S1FunctionTest()));
|
test_label = "S1 Function Test";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menu.Register("S2 Function Test", *(new S2FunctionTest()));
|
test_label = "S2 Function Test";
|
||||||
}
|
}
|
||||||
|
menu.Register(test_label , *(new CardFunctionTest()));
|
||||||
menu.Register("Irregular Access Test", *(new IrregularAccessTest()));
|
menu.Register("Irregular Access Test", *(new IrregularAccessTest()));
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
@ -143,3 +125,4 @@ class FunctionTest: public Program
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ SOURCES[] =
|
|||||||
nakayama.cpp
|
nakayama.cpp
|
||||||
CtrCardTest.cpp
|
CtrCardTest.cpp
|
||||||
FunctionTest.cpp
|
FunctionTest.cpp
|
||||||
|
CardTestFunction.cpp
|
||||||
|
|
||||||
LIBS += libnn_demo
|
LIBS += libnn_demo
|
||||||
|
|
||||||
|
|||||||
@ -626,7 +626,7 @@ void VariableSelector::KeyIn(KeyPad& key)
|
|||||||
if( selector::items[selector::current_item]->Editable )
|
if( selector::items[selector::current_item]->Editable )
|
||||||
{
|
{
|
||||||
// 右ボタンが押された場合
|
// 右ボタンが押された場合
|
||||||
if( key.IsTrigger(KeyPad::A) )
|
if( key.IsTrigger(KeyPad::RIGHT) )
|
||||||
{
|
{
|
||||||
EditMode = true;
|
EditMode = true;
|
||||||
return;
|
return;
|
||||||
@ -655,7 +655,7 @@ void VariableSelector::KeyIn(KeyPad& key)
|
|||||||
{
|
{
|
||||||
selector::items[selector::current_item]->ShiftLeft();
|
selector::items[selector::current_item]->ShiftLeft();
|
||||||
}
|
}
|
||||||
else if(key.IsTrigger(KeyPad::A) || key.IsTrigger(KeyPad::B))
|
else if(key.IsTrigger(KeyPad::B))
|
||||||
{
|
{
|
||||||
EditMode = false;
|
EditMode = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,8 @@
|
|||||||
#include <nn/demo.h>
|
#include <nn/demo.h>
|
||||||
//#include "HwTestLib/hwtest_SdFileManager.h"
|
//#include "HwTestLib/hwtest_SdFileManager.h"
|
||||||
|
|
||||||
|
#include "CardTestFunction.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace nn{
|
namespace nn{
|
||||||
@ -45,8 +47,6 @@ class KeyValuePair;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!--------------------------------------------------------------------------*
|
/*!--------------------------------------------------------------------------*
|
||||||
@brief ディスプレイ
|
@brief ディスプレイ
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user