Ejemplo n.º 1
0
void I_FSBlock::OnUpdate()
{
	if(d_fspFSParams->d_bUpdateSolids)
		UpdateSolids();
	
	if(d_fspFSParams->d_bUpdateWater)
	{
		UpdateWater();
		d_Ports.UpdatePercentSolids();
	}
}
Ejemplo n.º 2
0
void AppGUI::Tick(RenderEngine& engine)
{
    UpdateShader(engine);
    switch (m_cache->PageSelected.Get())
    {
    case PAGE_SCENE:
        UpdateScene(engine);
        break;
    case PAGE_AREA:
        UpdateTerrain(engine);
        UpdateTexture(engine);
        break;
    case PAGE_MESH:
        UpdateMesh();
        UpdateWater();
        UpdateEmitter();
        break;
    case PAGE_POST:
        UpdateLight();
        UpdatePost(engine);
        break;
    }
}
Ejemplo n.º 3
0
int DoSign(const char* pszTrace, const char* pszDate, const char* pszRefNum)
{	
	int nRet, nHandle, nFileContentLen = 0;
	char szFeatureCode[8+1];
	char szPath[64];
	char szNum[3+1], szLastNum[3+1], szFileContent[BOARD_MAX_SIZE];
	char cStatus;
	STWATER stWater;
	int nRecNo=0;		/**<当前记录号*/
	
	nRet = Hand_Shake();
	if(nRet != APP_SUCC)
	{
		PubMsgDlg(NULL, "没有正常的签字板,请手工签字", 3, 3);
		return APP_FAIL;
	}

#if OPTIONAL_SIGN
	memset(szLastNum, 0, sizeof(szLastNum));
	GetVarLastElecSignSendNum(szLastNum);
	
	if(YES == GetVarElecSignSendResult())
	{
		cStatus = 0x01;
	}
	else
	{
		cStatus = 0x00;
	}
	
	nRet = Last_Status_Inform(szLastNum,&cStatus);
	if(nRet != APP_SUCC)
	{
		PubMsgDlg(NULL, "未获取到上一笔状态响应报文", 3, 3);
		cStatus = 0x04;
//			return APP_FAIL;
	}
#endif
	
	
	memset(szFeatureCode, 0, sizeof(szFeatureCode));
	GetFeatureCode(pszDate, pszRefNum, szFeatureCode);

	memset(szNum, 0, sizeof(szNum));
	memset(szFileContent, 0, sizeof(szFileContent));

	nRet = Sign_Input(szFeatureCode, szNum, szFileContent);
	if(nRet < 0)
	{
		Sign_End();
		PubMsgDlg(NULL, "签字异常, 请手工签字", 3, 3);
		return APP_FAIL;
	}
	sprintf(szPath, "%s%s.bmp", FILE_PATH, pszTrace);
	

	if(NDK_FsExist(szPath))
		NDK_FsDel(szPath);

	nHandle = NDK_FsOpen(szPath, "w");

	if(nHandle < 0)
	{
		Sign_End();
		return APP_FAIL;
	}

	nFileContentLen = nRet;
	nRet = NDK_FsWrite(nHandle, szFileContent, nFileContentLen);
	NDK_FsClose(nHandle);

	if(nRet < nFileContentLen)
	{	
		Sign_End();
		return APP_FAIL;
	}
	Sign_End();
/*	
	nFileContentLen = nRet;
	nRet = SaveSignToBmp(pszTrace, szFileContent,nFileContentLen);
	Sign_End();
	if(nRet != APP_SUCC)
	{
		return APP_FAIL;
	}
//*/
	memset(&stWater, 0, sizeof(STWATER));
	FindWaterWithInvno(pszTrace, &stWater);
//	memcpy(stWater.sNum,szNum,3);
//	TlvAdd(TAG_SIGN_NUM, 3, szNum, (char *)stWater.sAddition2, &stWater.nAdditionLen2);		

	UpdateWater(&stWater);

#if OPTIONAL_SIGN
	{
		char cSigninfNum = 0;
//		char szNum[3+1];
//		char sData[BOARD_MAX_SIZE];
		char cFailCount = 0;
		

		if(cStatus == 0x03)
		{
			char szTrace[6+1] = {0};
			
			cSigninfNum = 0;
			memset(szNum, 0, sizeof(szNum));	
			/*待修改*/
			memset(szFileContent, 0, sizeof(szFileContent));
		
			PubDisplayGen(2, "正在批量传输");
			PubDisplayGen(3, "失败电子签名单据");
			PubUpdateWindow();
			nRet = Batch_Fail_Sign(&cSigninfNum, szNum, szFileContent);
			
		
			while(1)
			{
				if(nRet >= 0)
				{
					/*处理sData值(上送失败的电子签名)*/
					memset(&stWater, 0, sizeof(STWATER));
					memset(&szTrace, 0, sizeof(szTrace));
					PubFindRec (FILE_WATER, NULL, szNum,1, (char *)&stWater, &nRecNo);
					PubHexToAsc((unsigned char *)stWater.sTrace, 6, 0, (unsigned char *)szTrace);
					nFileContentLen = nRet;

					/*此处nRet 结果也作为与签字板的接收成功或失败处理*/
					//nRet = SaveSignToBmp(pszTrace, szFileContent, nFileContentLen);
					sprintf(szPath, "%s%s.bmp", FILE_PATH, szTrace);
	

					if(NDK_FsExist(szPath))
						NDK_FsDel(szPath);

					nHandle = NDK_FsOpen(szPath, "w");

					if(nHandle < 0)
					{
						PubMsgDlg("签名", "文件打开失败", 3, 5);
						nRet = APP_FAIL;
					}
					else
					{
						nFileContentLen = nRet;
						nRet = NDK_FsWrite(nHandle, szFileContent, nFileContentLen);
						NDK_FsClose(nHandle);

						if(nRet < nFileContentLen)
						{	
							PubMsgDlg("签名", "写文件失败", 3, 5);
							nRet = APP_FAIL;
						}
						else
						{
							CompressElecFailSign(szTrace);
						}						
					}

				}

				if(nRet < 0)
				{
					/*重发一次,否则退出*/
					if(cFailCount > 1)
					{
						break;
					}
					cSigninfNum = 0;
					memset(szNum, 0, sizeof(szNum));			
					memset(szFileContent, 0, sizeof(szFileContent));
					cFailCount ++;
					
					nRet = Batch_Sign_Fail(&cSigninfNum, szNum, szFileContent);
				}
				else
				{
					
					
					cFailCount = 0;
					if(cSigninfNum <= 1)
					{
						break;
					}
					
					cSigninfNum = 0;
					memset(szNum, 0, sizeof(szNum));			
					memset(szFileContent, 0, sizeof(szFileContent));
					nRet = Batch_Sign_Succ(&cSigninfNum, szNum, szFileContent);
				}
			}

			if(cSigninfNum == 1)
			{
				nRet = Batch_Fail_Sign_End();
			}
			
		}
		else if(cStatus == 0x04)/*打单处理*/
		{
			memset(&stWater, 0, sizeof(STWATER));
			PubFindRec (FILE_WATER, NULL, szLastNum,1, (char *)&stWater, &nRecNo);
			PubDisplayGen(2, "正 在 重 打 印");
			PubDisplayGen(3, "上笔电子签名单据");
			PubUpdateWindow();
			PrintWater(&stWater, REPRINT);
		}
	}
#endif	

	if (GetVarExElecConfirm() == '1' || GetVarExElecConfirm() == 1)
	{
		nRet = PubConfirmDlg(NULL, "请确认签字是否正确", 1, 0);
		if (nRet != APP_SUCC)
		{
			NDK_FsDel(szPath);		/*取消签名则删除保存的电子签名*/
			return APP_FAIL;
		}
	}
	
	return APP_SUCC;
}