예제 #1
0
void CIndicator::Render(std::vector<struct kline_struct>* pvData)
{
	m_pvData = pvData;
	
	

	if (!m_pRender)
		return;

	m_pRender->BeginRender(m_rcArea);

	if (m_nIndicatorType == INDICATOR_TYPE_MA)
	{
		KLine();
		

	}
	else if (m_nIndicatorType == INDICATOR_TYPE_VOL)
	{
		Vol();		
	}
	else
	{
		CColorUtil clr(0, 0, 255);
		m_pRender->DrawRectangle(m_rcMemDC, clr);

		m_pRender->DrawText(m_rcMemDC, _T("macd"), clr);
	}

	m_pRender->EndRender();
}
// Tests
void CTestImapAtomBuilder::TestAtomParserL()
	{
	INFO_PRINTF1(_L("TestL"));
	
	_LIT8(KLine, "sugar (one (two \"33 () three\" )) apple wibble");
	TPtrC8 ptrLine = KLine();
	TBool wantMore = iAtomParser->ProcessLineL(ptrLine);
	
	ASSERT_FALSE(wantMore);
	
	CImapAtom* root = iAtomParser->RootAtom();
	RPointerArray<CImapAtom> stack;
	stack.AppendL(root);
	
	CImapAtom* current = root;
	
	while(current!=NULL)
		{
		TPtrC8 ptrAtom = current->Atom(EFalse);
		TInt topOfStack = stack.Count() - 1;
				
		// Log the data (SendDataReq is non-leaving, so avoid leaving.  Hence no cleanup stack)
		HBufC16* unicodeAtom = NULL;
		TRAPD(err,
			unicodeAtom = CnvUtfConverter::ConvertToUnicodeFromUtf8L(ptrAtom);
		);
		
		if (err == KErrNone)
			{
			INFO_PRINTF3(_L("%d [%S]"), topOfStack, unicodeAtom);
			}
			
		delete unicodeAtom;	
		unicodeAtom=NULL;
		
		// Try going down
		CImapAtom* candidateAtom = current->Child();
		if (candidateAtom != NULL)
			{
			stack.AppendL(candidateAtom);
			++topOfStack;
			}
		// Try going along
		else
			{
			candidateAtom = current->Next();
			// Try going back-up-and-along
			while (candidateAtom == NULL && topOfStack > 0)
				{
				stack.Remove(topOfStack);
				--topOfStack;
				candidateAtom = stack[topOfStack];
				candidateAtom = candidateAtom->Next();
				}
			
			stack[topOfStack] = candidateAtom;
			}
			
		// Could use a table (or at least tables - need repeats) to parse different BODYSTRUCTURE's !!!
		current = candidateAtom;
	}