예제 #1
0
// CMainWnd message handlers
BOOL CReturnDlg::OnInitDialog()
{
	m_bReturnFlag = TRUE;
	m_Title = L"  RETURN";

	CBaseDlg::OnInitDialog();

	m_TRREC.TranCode = TRAN_REFUND;
	m_iLevel = PASSWORD_INPUT;

	m_strMsg.ShowWindow(SW_SHOW);
	m_strMsg1.ShowWindow(SW_SHOW);
	m_strMsg2.ShowWindow(SW_SHOW);

	m_Bt.SetValue(1, L"  CHEQUE");
	m_Bt.SubclassDlgItem(IDC_BUTTON1, this);
	m_Bt.MoveWindow(8, screenY- 50, 120, 45);

	m_Bt1.SetValue(3, L"  SAVING");
	m_Bt1.SubclassDlgItem(IDC_BUTTON2, this);
	m_Bt1.MoveWindow(screenX-128,  screenY- 50, 120, 45);

	WorkLoop(m_iLevel);
	SetTimer(2, 50, NULL);

	m_CustDialogTimer = 30;

	m_iKeyStatus = 0;

	m_MsgWnd = m_hWnd;

	return TRUE;  // return TRUE unless you set the focus to a control
}
예제 #2
0
static
PVOID
WorkThread(
    PVOID pContext
    )
{
    WorkLoop((PLW_WORK_THREAD) pContext);

    return NULL;
}
예제 #3
0
/** 
 * Main entrypoint, guarded by a try ... except.
 * This expects 4 parameters:
 *		The image path and name
 *		The working directory path, which has to be unique to the instigating process and thread.
 *		The parent process Id
 *		The thread Id corresponding to this worker
 */
int32 GuardedMain(int32 argc, TCHAR* argv[])
{
	GEngineLoop.PreInit(argc, argv, TEXT("-NOPACKAGECACHE -Multiprocess"));
#if DEBUG_USING_CONSOLE
	GLogConsole->Show( true );
#endif

#if PLATFORM_WINDOWS
	//@todo - would be nice to change application name or description to have the ThreadId in it for debugging purposes
	SetConsoleTitle(argv[3]);
#endif

	// We just enumerate the shader formats here for debugging.
	const TArray<const class IShaderFormat*>& ShaderFormats = GetShaderFormats();
	check(ShaderFormats.Num());
	for (int32 Index = 0; Index < ShaderFormats.Num(); Index++)
	{
		TArray<FName> OutFormats;
		ShaderFormats[Index]->GetSupportedFormats(OutFormats);
		check(OutFormats.Num());
		for (int32 InnerIndex = 0; InnerIndex < OutFormats.Num(); InnerIndex++)
		{
			UE_LOG(LogShaders, Display, TEXT("Available Shader Format %s"), *OutFormats[InnerIndex].ToString());
		}
	}

	LastCompileTime = FPlatformTime::Seconds();

	FString InCommunicating = argv[6];
#if PLATFORM_SUPPORTS_NAMED_PIPES
	const bool bThroughFile = GShaderCompileUseXGE || (InCommunicating == FString(TEXT("-communicatethroughfile")));
	const bool bThroughNamedPipe = (InCommunicating == FString(TEXT("-communicatethroughnamedpipe")));
	const bool bThroughNamedPipeOnce = (InCommunicating == FString(TEXT("-communicatethroughnamedpipeonce")));
#else
	const bool bThroughFile = true;
	const bool bThroughNamedPipe = false;
	const bool bThroughNamedPipeOnce = false;
#endif
	check((int32)bThroughFile + (int32)bThroughNamedPipe + (int32)bThroughNamedPipeOnce == 1);

	FWorkLoop::ECommunicationMode Mode = bThroughFile ? FWorkLoop::ThroughFile : (bThroughNamedPipeOnce ? FWorkLoop::ThroughNamedPipeOnce : FWorkLoop::ThroughNamedPipe);
	FWorkLoop WorkLoop(argv[2], argv[1], argv[4], argv[5], Mode);

	WorkLoop.Loop();

	return 0;
}
예제 #4
0
/** 
 * Main entrypoint, guarded by a try ... except.
 * This expects 4 parameters:
 *		The image path and name
 *		The working directory path, which has to be unique to the instigating process and thread.
 *		The parent process Id
 *		The thread Id corresponding to this worker
 */
int32 GuardedMain(int32 argc, TCHAR* argv[])
{
	GEngineLoop.PreInit(argc, argv, TEXT("-NOPACKAGECACHE -Multiprocess"));
#if DEBUG_USING_CONSOLE
	GLogConsole->Show( true );
#endif

#if PLATFORM_WINDOWS
	//@todo - would be nice to change application name or description to have the ThreadId in it for debugging purposes
	SetConsoleTitle(argv[3]);
#endif

	// We just enumerate the shader formats here for debugging.
	const TArray<const class IShaderFormat*>& ShaderFormats = GetShaderFormats();
	check(ShaderFormats.Num());
	TMap<FString, uint16> FormatVersionMap;
	for (int32 Index = 0; Index < ShaderFormats.Num(); Index++)
	{
		TArray<FName> OutFormats;
		ShaderFormats[Index]->GetSupportedFormats(OutFormats);
		check(OutFormats.Num());
		for (int32 InnerIndex = 0; InnerIndex < OutFormats.Num(); InnerIndex++)
		{
			UE_LOG(LogShaders, Display, TEXT("Available Shader Format %s"), *OutFormats[InnerIndex].ToString());
			uint16 Version = ShaderFormats[Index]->GetVersion(OutFormats[InnerIndex]);
			FormatVersionMap.Add(OutFormats[InnerIndex].ToString(), Version);
		}
	}

	LastCompileTime = FPlatformTime::Seconds();

	FWorkLoop::ECommunicationMode Mode = FWorkLoop::ThroughFile;
	FWorkLoop WorkLoop(argv[2], argv[1], argv[4], argv[5], Mode, FormatVersionMap);

	WorkLoop.Loop();

	return 0;
}
예제 #5
0
//----------------------------------------------------------------------------
//!	\brief	Message entry function for any GUI's, 
//----------------------------------------------------------------------------
LRESULT CReturnDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
	CString strTemp; 
	DWORD len = 0;
   DWORD decode = 0;

	if (wParam == 1)
	{
//	TRACE(L"CEnterCardDlg RFID event = %x\n", message);
		BYTE buf[2048] = {0};
		DWORD len;
		switch(message)
		{
			case RFID_EVENT_READY:
				m_RFID.GetData();
				m_iKeyStatus =  KEY_CTLS;
				m_TRREC.EntryMode = ENTRY_MODE_CTLS;
				m_RFID.GetData((BYTE*)buf, &len);
				CloseDevice();
				ProcessCtlsTLV((USHORT)len, (BYTE*)buf);
				if (m_TRREC.CtlsData.C2[0] == 0x05)		// EMV
				{
					m_TRREC.bEmvTransaction = TRUE;
					m_TRREC.bEmvCtlsTransaction = TRUE;
					m_TRREC.bCtlsTransaction = TRUE;
				}
				else if (m_TRREC.CtlsData.C2[0] == 0x04)	// MSR
				{
					m_TRREC.bEmvTransaction = FALSE;
					m_TRREC.bEmvCtlsTransaction = FALSE;
					m_TRREC.bCtlsTransaction = TRUE;
				}
				else if (m_TRREC.CtlsData.C2[0] == 0x06)	// Terminated
				{
					// Get error code from C3
					TRACE(L"RFID ERROR\n");
					return 0;
				}
				else
				{
//					assert(FALSE);
					m_strErr1 = L"CARD NOT SUPPORT";
					ErrorExit(ENTERCARD_INPUT);
					return 0;
				}
				
				m_TRREC.CardType = CARD_CREDIT;	// FIXME: will change when have FLASH support
				m_TRREC.CardError = ProcessSwipedCard(m_TRREC.Track2);
				
				// FIXME: CTLS kernel currently doesn't return AID for VISA, just fake it for now.
				if (m_TRREC.bEmvCtlsTransaction && strcmp("V ", m_TRREC.ServType) == 0)
				{
					strcpy(m_TRREC.EmvData.AID, "A0000000031010");				
				}
				
				m_iLevel = DOTRANSACTION;
				WorkLoop(m_iLevel);
				return 0;
				break;
			case RFID_EVENT_TIMEOUT:
				m_RFID.Cancel();
				TRACE(L"RFID_EVENT_TIMEOUT\n");
				PostMessage(ERROR_MESSAGE, 2, 5);
				break;
			case RFID_EVENT_CANCELLED:
				break;
			case RFID_EVENT_ERROR:
				m_RFID.Cancel();
				ReOpenRFID();
				break;
			default:
				break;	
		}	
	}
	else if (wParam == 0)
	{
		switch(message)
		{
			case MSR_EVENT_DEV_OFFLINE :
				m_strErr1 = L"MSR Open Fail !";
				ErrorExit();
				return NULL;
			case MSR_EVENT_DATA_READY :
			case MSR_EVENT_CT_STATUS :
			case MSR_EVENT_READ_ERROR :
				m_MSR.MsrGetTrackData();
				m_MSR.GetMSRData(2, (BYTE*)m_TRREC.Track2, &len, &decode);
				m_TRREC.CardError = ProcessSwipedCard(m_TRREC.Track2);
				if (m_TRREC.CardError != CARD_NO_ERROR)
				{
					m_strErr1 = L"CARD NOT SUPPORT";
					CloseDevice();
					ErrorExit(ENTERCARD_INPUT);
					return 0;
				}

				m_iKeyStatus =  KEY_MSR;
				m_TRREC.EntryMode = ENTRY_MODE_SWIPED;

				CloseDevice();
/*
				if (m_TRREC.CardType == CARD_DEBIT)
					m_iLevel = DEBITCARDENTRY;
				else if (m_TRREC.CardType == CARD_CREDIT)
					m_iLevel = CREDITSWIPEENTRYY;
*/
				m_iLevel = DOTRANSACTION;
				WorkLoop(m_iLevel);

				return 0;
		}
	}
	else if (wParam == 2 && message == ERROR_MESSAGE)
	{ 
		if (lParam == 1) //error
		{
			ErrorExit();
		}
		else if (lParam == 2) //for jump to other level
			WorkLoop(m_iLevel);
		else if (lParam == 3) // print done
		{
			m_bPrintDone = TRUE;
			GoNext();
		}
		else if (lParam == 4) //Can't print
		{
			m_strErr1 = L"Can't Print";
			ErrorExit();
		}
		else if (lParam == 5) //RFID time out and restart it
		{
			ReOpenRFID();
		}
		else if (lParam == 6) //Show CDisplay window
		{
			if(!m_bCancelFlag)
				GoToLevel(DISPLAY_WINDOW);
		}
	}
	return CDialog::DefWindowProc(message, wParam, lParam);
}