カード評価関数をちょっと組み込み

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:
(no author) 2010-02-18 09:57:47 +00:00
parent dc4dbc75e7
commit cf445c8195
4 changed files with 35 additions and 51 deletions

View File

@ -2,11 +2,12 @@
using namespace nn::red::nakayama;
class S1FunctionTest: public Program
class CardFunctionTest: public Program
{
public:
virtual void Execute()
{
bool run = false;
Page page;
Label running;
@ -34,53 +35,30 @@ public:
pad.ReadKey();
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();
break;
// 実行中でなければ
if( !run )
{
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))
{
Display::GetInstance(Display::Lower).Clear();
Display::GetInstance(Display::Lower).SwapBuffer();
break;
// 実行中であれば
if( run )
{
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()
{
string test_label;
Page page;
Label title;
@ -113,15 +92,18 @@ class FunctionTest: public Program
menu.Y = 40;
page.Add(menu);
// [TODO] カードIDに応じて切り替える
// [TODO] カードID読み出し
if (1)
{
menu.Register("S1 Function Test", *(new S1FunctionTest()));
test_label = "S1 Function Test";
}
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()));
while (1)
@ -143,3 +125,4 @@ class FunctionTest: public Program
};
};

View File

@ -20,6 +20,7 @@ SOURCES[] =
nakayama.cpp
CtrCardTest.cpp
FunctionTest.cpp
CardTestFunction.cpp
LIBS += libnn_demo

View File

@ -626,7 +626,7 @@ void VariableSelector::KeyIn(KeyPad& key)
if( selector::items[selector::current_item]->Editable )
{
// 右ボタンが押された場合
if( key.IsTrigger(KeyPad::A) )
if( key.IsTrigger(KeyPad::RIGHT) )
{
EditMode = true;
return;
@ -655,7 +655,7 @@ void VariableSelector::KeyIn(KeyPad& key)
{
selector::items[selector::current_item]->ShiftLeft();
}
else if(key.IsTrigger(KeyPad::A) || key.IsTrigger(KeyPad::B))
else if(key.IsTrigger(KeyPad::B))
{
EditMode = false;
}

View File

@ -32,6 +32,8 @@
#include <nn/demo.h>
//#include "HwTestLib/hwtest_SdFileManager.h"
#include "CardTestFunction.h"
using namespace std;
namespace nn{
@ -45,8 +47,6 @@ class KeyValuePair;
/*!--------------------------------------------------------------------------*
@brief