Beispiel #1
0
void CGui::CreateFriendInfoBox(std::string newName)
{
	IGUIEnvironment* env=device->getGUIEnvironment();
	IGUIElement* root=env->getRootGUIElement();
	IGUIElement* e=root->getElementFromId(GUI_ID_FRIEND_INFORMATION_WINDOW,true);
	if (e)
	{
		e->remove();
	}
	wchar_t* temp=NULL;

	char* charTemp="PersonalInfo";
	charTowchar(charTemp,temp,strlen(charTemp));
	IGUIWindow* wnd=env->addWindow(rect<s32>(200,50,350,400),false,temp,0,GUI_ID_FRIEND_INFORMATION_WINDOW);

	// 姓名
	stringw friendName=newName.c_str();
	env->addStaticText(L"Name:",rect<s32>(5,25,25,55),false,false,wnd);
	env->addEditBox(friendName.c_str(),rect<s32>(35,25,100,45),true,wnd,GUI_ID_FRIEND_NAME);

	env->addButton(rect<s32>(10,50,110,75),wnd,GUI_ID_BUTTON_FRIEND_INFO,L"INFO");
	env->addButton(rect<s32>(10,100,110,125),wnd,GUI_ID_BUTTON_FRIEND_TEXT_CHAT,L"TEXT");
	env->addButton(rect<s32>(10,150,110,175),wnd,GUI_ID_BUTTON_FRIEND_VOICE_CHAT,L"VOICE");
	env->addButton(rect<s32>(10,200,110,225),wnd,GUI_ID_BUTTON_FRIEND_VIDEO_CHAT,L"VIDEO");
	env->addButton(rect<s32>(10,250,110,275),wnd,GUI_ID_BUTTON_FRIEND_FRIEND_SPACE,L"FRIEND SPACE");
}
Beispiel #2
0
void CGui::CreateOtherClientInfoBox(std::string clientName)
{
	IGUIEnvironment* env=device->getGUIEnvironment();
	IGUIElement* root=env->getRootGUIElement();
	IGUIElement* e=root->getElementFromId(GUI_ID_PERSONAL_INFORMATION_WINDOW,true);
	if (e)
	{
		e->remove();
	}
	wchar_t* temp=NULL;

	char* charTemp="PersonalInfo";
	charTowchar(charTemp,temp,strlen(charTemp));
	IGUIWindow* wnd=env->addWindow(rect<s32>(200,50,350,400),false,temp,0,GUI_ID_PERSONAL_INFORMATION_WINDOW);

	// 姓名
	stringw clientNameTemp=clientName.c_str();
	env->addStaticText(L"Name:",rect<s32>(5,25,25,55),false,false,wnd);
	env->addEditBox(clientNameTemp.c_str(),rect<s32>(35,25,100,45),true,wnd,GUI_ID_PERSONAL_NAME);

	env->addButton(rect<s32>(10,50,110,75),wnd,GUI_ID_BUTTON_OTHER_CLIENT_PERSONAL_INFO,L"INFO");
	env->addButton(rect<s32>(10,100,110,125),wnd,GUI_ID_BUTTON_OTHER_CLIENT_TEXT_CHAT,L"TEXT");
	env->addButton(rect<s32>(10,150,110,175),wnd,GUI_ID_BUTTON_OTHER_CLIENT_VOICE_CHAT,L"VOICE");
	env->addButton(rect<s32>(10,200,110,225),wnd,GUI_ID_BUTTON_OTHER_CLIENT_VIDEO_CHAT,L"VIDEO");
	env->addButton(rect<s32>(10,250,110,275),wnd,GUI_ID_BUTTON_OTHER_CLIENT_ADD_FRIEND,L"ADD FRIEND");
	env->addButton(rect<s32>(10,300,110,325),wnd,GUI_ID_BUTTON_OTHER_CLIENT_SEND_FILE,L"SEND FILE");
}
Beispiel #3
0
void CGui::CreateBuildingInfoBox(CBuilding newBuilding)
{
	this->building=newBuilding;

	IGUIEnvironment* env=device->getGUIEnvironment();
	IGUIElement* root=env->getRootGUIElement();
	IGUIElement* e=root->getElementFromId(GUI_ID_BUILDING_INFORMATION_WINDOW,true);
	IVideoDriver* driver=device->getVideoDriver();
	if (e)
	{
		e->remove();
	}
	wchar_t* temp=NULL;


//	charTowchar(buildingName,temp,strlen(buildingName));
	charTowchar(this->building.GetBuildingname().c_str(),temp,strlen(newBuilding.GetBuildingname().c_str()));
	IGUIWindow* wnd=env->addWindow(rect<s32>(200,45,800,480),false,temp,0,GUI_ID_BUILDING_INFORMATION_WINDOW);

	IGUITabControl* tab=env->addTabControl(rect<s32>(2,20,800-202,480-7),wnd,true,true);
	IGUITab* picture=tab->addTab(L"Picture",GUI_ID_TAB_BUILDING_PICTURE);
	IGUITab* info=tab->addTab(L"Information",GUI_ID_TAB_BUILDING_INFORMATION);
	IGUITab* comment=tab->addTab(L"Comment",GUI_ID_TAB_BUILDING_COMMENT);

	// 照片
//	env->addImage(driver->getTexture(pictureName),position2d<int>(10,10),false,picture);
	env->addImage(driver->getTexture(this->building.GetBuildingPicture().c_str()),position2d<int>(10,10),false,picture);

	// 简介
	stringw infoStr;
//	infoStr=buildingInfo;
	infoStr=this->building.GetBuildingInfo().c_str();
	env->addStaticText(infoStr.c_str(),rect<s32>(10,10,590,480-45-10),false,false,info);
	

	// 评论
	// 他人评价区
	env->addStaticText(NULL,rect<s32>(0,0,575,320),true,true,comment,GUI_ID_STATIC_TEXT_OTHER_COMMENT,true);
	IGUIScrollBar* buildingCommentScrollbar=env->addScrollBar(false,rect<s32>(575,0,595,320),comment,GUI_ID_SCROLL_BAR_BUILDING_COMMENT);
	buildingCommentScrollbar->setMax(255);	// 他人评论的数量
	buildingCommentScrollbar->setPos(0);
	buildingCommentScrollbar->setSmallStep(1);
	env->addButton(rect<s32>(540,320,595,340),comment,GUI_ID_BUTTON_REFRESH_COMMENT,L"Refresh");

	// 自己评价
	env->addEditBox(NULL,rect<s32>(0,340,555,378),true,comment,GUI_ID_EDIT_BOX_MY_COMMENT);
	env->addButton(rect<s32>(560,358,595,378),comment,GUI_ID_BUTTON_SEND_COMMENT,L"Send");

}
Beispiel #4
0
void CGui::CreateIsStartVideoChatBox()
{
	IGUIEnvironment* env=device->getGUIEnvironment();
	IGUIElement* root=env->getRootGUIElement();
	IGUIElement* e=root->getElementFromId(GUI_ID_WINDOW_IS_START_VIDEO_CHAT,true);
	if (e)
	{
		e->remove();
	}
	wchar_t* temp=NULL;

	char* charTemp="PersonalInfo";
	charTowchar(charTemp,temp,strlen(charTemp));
	IGUIWindow* wnd=env->addWindow(rect<s32>(600,200,800,300),false,temp,0,GUI_ID_WINDOW_IS_START_VIDEO_CHAT);

	env->addButton(rect<s32>(10,20,90,80),wnd,GUI_ID_BUTTON_VIDEO_CAHT_START,L"OK");
	env->addButton(rect<s32>(100,20,190,80),wnd,GUI_ID_BUTTON_VIDEO_CHAT_CANCLE,L"CANCLE");

}
Beispiel #5
0
void CGui::CreateFriendListBox(vector<std::string> friendList)
{
	IGUIEnvironment* env=device->getGUIEnvironment();
	IGUIElement* root=env->getRootGUIElement();
	IGUIElement* e=root->getElementFromId(GUI_ID_FRIENDLIST_WINDOW,true);
	if (e)
	{
		e->remove();
	}
	wchar_t* temp=NULL;

	char* charTemp="FriendList";
	charTowchar(charTemp,temp,strlen(charTemp));
	IGUIWindow* wnd=env->addWindow(rect<s32>(200,50,350,400),false,temp,0,GUI_ID_FRIENDLIST_WINDOW);

	for (int i=0;i!=friendList.size();i++)
	{
		stringw friendName=friendList[i].c_str();
		env->addButton(rect<s32>(10,50+i*30,140,75+i*30),wnd,GUI_ID_FRIENDLIST_WINDOW_FRIEND+i,friendName.c_str());
	}

}
Beispiel #6
0
void CGui::CreateFriendTextChatBox()
{
	IGUIEnvironment* env=device->getGUIEnvironment();
	IGUIElement* root=env->getRootGUIElement();
	IGUIElement* e=root->getElementFromId(GUI_ID_TEXT_CHAT_WINDOW_FRIEND,true);
	if (e)
	{
		e->remove();
	}
	wchar_t* temp=NULL;

	char* charTemp="PersonalInfo";
	charTowchar(charTemp,temp,strlen(charTemp));
	IGUIWindow* wnd=env->addWindow(rect<s32>(200,50,550,350),false,temp,0,GUI_ID_TEXT_CHAT_WINDOW_FRIEND);


	// 说话人的姓名
	env->addStaticText(L"I say:",rect<s32>(10,270,50,290),false,false,wnd);
	env->addEditBox(temp,rect<s32>(50,270,325,290),true,wnd,GUI_ID_TEXT_PERSON_SAY_STRING_FRIEND);
	env->addButton(rect<s32>(325,270,350,290),wnd,GUI_ID_BUTTON_SEND_CHAT_MESSAGE_FRIEND,L"Send");

	//env->addEditBox(temp,rect<s32>(0,30,350,250),true,wnd,GUI_ID_TEXT_STRING);
	env->addStaticText(L"",rect<s32>(0,30,350,250),true,true,wnd,GUI_ID_TEXT_STRING_FRIEND);
}
Beispiel #7
0
//打开seed文件,校验,并提取所有的台站分量信息
int CSeedFile::open( const WCHAR* pFileName ,CSeedLog* lpLog)
{
	int iLeft, nRet;
	Station station;
	FIX_DATA_HEADER * lpFDH;
	FIX_DATA_HEADER* lpNext;

	//首先释放文件
	close();

	nRet = TRUE;
	//检查seed文件的合法性
	if( seed->MapFile(pFileName, 0) == NULL )
		return FALSE;

	//设置log文件
	SetLogFile(lpLog);
	//日志记录
	if(log != NULL)
	{
		SYSTEMTIME time;

		GetLocalTime(&time);
		sprintf_s(log->logString, MAX_LOG_STR_SIZE, "%04d-%02d-%02d,%02d:%02d:%02d", 
			time.wYear, time.wMonth, time.wDay, 
			time.wHour, time.wMinute, time.wSecond);
		log->FormatAndAppendLog(info_seed, info_open, log->logString);
	}

	if(! IsValidSeed(seed->m_lpBase, seed->m_iSize))//这里方式使用1000块校验,
		nRet = FALSE;
	else if(FALSE == AnalyzeSeedFile(seed->m_lpBase, seed->m_iSize, &m_swap, &m_step) )
		nRet = FALSE;

	if(nRet == FALSE)
	{
		close();
		return FALSE;
	}

	//set the file name and path
	SplitNameAndPath(pFileName, name, path);

	//日志,添加日志
	if(log != NULL)
	{
		char filenameASCII[MAX_PATH];
		WcharNameToCharName(filenameASCII, sizeof(filenameASCII), pFileName, wcslen(pFileName));
		sprintf_s(log->logString, MAX_LOG_STR_SIZE, "file name: %s. file size: %d bytes",
							filenameASCII, seed->m_iSize);
		log->FormatAndAppendLog(info_seed, info_file, log->logString);
	}


	//获取台站信息
	lpFDH = (FIX_DATA_HEADER*)GetFirstDataRecordAddr((char*)seed->m_lpBase, \
									seed->m_iSize, m_step);
	while (lpFDH != NULL)
	{
		BTIME tStart, tend;
		iLeft = seed->m_iSize - ((char*)lpFDH - (char*)(seed->m_lpBase));
		//填充信息
		charTowchar(station.station, lpFDH->szStationID, 5);
		charTowchar(station.channel, lpFDH->szChannelID, 3);

		if(AnalyzeStationInfo((char*)lpFDH, iLeft, m_step, m_swap, (char**)(&lpNext), &station.iRecordLen, 
			&tStart, &tend, &station.nSample, &station.nlost, 
			&station.freq.numerator, &station.freq.denominator) == 0)//出现重大错误,停止分析
			break;
		station.lpAddr = (char*)lpFDH;
		BTimeToSystemTime(&tStart, &station.time);
		BTimeToSystemTime(&tend, &station.tend);
		station.pData = NULL;
		station.bufitemcnt = 0;
		station.iDataCnt = 0;
		station.dataFreq.numerator = station.freq.numerator;
		station.dataFreq.denominator = station.freq.denominator;
		memcpy(&station.datatime, &station.time, sizeof(SYSTEMTIME));
		station.lpNext = NULL;
		list->AddElement(&station);


		if (log != NULL && log->IsDetailLog() )
		{
			//日志,添加台站日志信息
			char szStation[6], szChannel[4];
			float freq;
			freq = ((float)station.freq.numerator) / ((float)station.freq.denominator);
			strcpy_ULN(szStation, lpFDH->szStationID, 5);
			strcpy_ULN(szChannel, lpFDH->szChannelID, 3);
			sprintf_s(log->logString, MAX_LOG_STR_SIZE, 
				"station:%s. channel:%s. "
				"frequency:%f. total samples:%d. lost samples:%d"
				"start time:%04d-%02d-%02d,%02d:%02d:%02d"
				"end time:%04d-%02d-%02d,%02d:%02d:%02d", 
				szStation, szChannel, freq, station.nSample, station.nlost, 
				station.time.wYear, station.time.wMonth, station.time.wDay,
				station.time.wHour, station.time.wMinute, station.time.wSecond, 
				station.tend.wYear, station.tend.wMonth, station.tend.wDay, 
				station.tend.wHour, station.tend.wMinute, station.tend.wSecond);
			log->FormatAndAppendLog(info_seed, info_station, log->logString);
		}

		//准备取下一个台站分量的信息
		lpFDH = lpNext;
	}
	//强制保存
	if(log != NULL)
		log->SaveLog();
	return TRUE;
}