Exemple #1
0
 License()
 {
   if ( CheckLicense(VISUALIZATION_LIBRARY_LICENSE) )
   {
     VISUALIZATION_LIBRARY_LICENSE = NULL;
   }
   else
   {
     char* msg = 
     "Invalid license.\n"
     "\n"
     "Visit our website www.visualizationlibrary.com to obtain a valid license.\n"
     "\n"
     "Note that we provide FREE licenses for NON COMMERCIAL OPENSOURCE applications, which makes Visualization Library perfect for personal and educational use.\n"
     "\n"
     "Even if you don't match any of the above mentioned categories ask to our sales office for a personalized offer and special discounts: \n"
     "\n"
     "[email protected]\n"
     "\n"
     "or visit the page:\n" 
     "\n"
     "www.visualizationlibrary.com/sales.html" 
     "\n";
     printf(msg);
     Time time;
     time.start();
     while(time.elapsed() < 15) {}
     exit(8);
   }
 }
Exemple #2
0
int main(int argc, char *argv[])
{

#ifdef CHECK_LICENSE
	if ( !CheckLicense() )
		return -1;
#endif

	DbgHelper::InstallDbgHelper();

	Test();

	PROCESS_INFORMATION procInfo = ProcessProxy::CreateProcess((Utils::GetExePath() + L"\\GenymotionMonitor.exe").c_str());
	CloseHandle(procInfo.hThread);
	CloseHandle(procInfo.hProcess);

	QApplication a(argc, argv);
	a.setWindowIcon(QIcon(QPixmap(":/Image/icon.png")));

	QTranslator* ts = new QTranslator;
	ts->load(":/qt_zh_CN.qm");
	a.installTranslator(ts);

	FramelessDlg dlg(0);
	AppDlg* app = new AppDlg(&dlg);

	dlg.SetDlg(app);
	dlg.SetTitle(Utils::GetConfigValue("title", "value"));
	dlg.SetSubTitle(Utils::stoq("未选择要分析的设备"));
	dlg.setMinimumSize(1020, 600);

	QObject::connect(app, SIGNAL(AddMenuAction(QAction*)), &dlg, SLOT(AddMenuAction(QAction*)));
	QObject::connect(app, SIGNAL(AddSubMenu(QMenu*)), &dlg, SLOT(AddSubMenu(QMenu*)));
	QObject::connect(app, SIGNAL(RemoveMenuAction(QAction*)), &dlg, SLOT(RemoveMenuAction(QAction*)));
	QObject::connect(app, SIGNAL(SetSubTitle(QString)), &dlg, SLOT(SetSubTitle(QString)));

	app->InitAction();
	InitStyle(a);

	dlg.show();
	dlg.CenterWindow();

	app->AnalyzeDir(GetDefaultForensicsDir());

	a.exec();

	ProcessProxy::KillProcess(L"GenymotionMonitor.exe");

	return 0;
}
Exemple #3
0
///----------------------------------------------------------------------------
/// <summary>
/// Perform validation on the operation
/// </summary>
///----------------------------------------------------------------------------
void MgSiteOperation::Validate()
{
    AuthenticateCurrentUser();
    CheckLicense();
}
Exemple #4
0
///----------------------------------------------------------------------------
/// <summary>
/// Perform validation on the operation
/// </summary>
///----------------------------------------------------------------------------
void MgFeatureOperation::Validate()
{
    CheckLicense();
}
Exemple #5
0
void CTryData4Dlg::OnTimer(UINT nIDEvent) 
{
	static bool bTwice = false;
	if(m_currPage == 0)	//is quiting
		return;
	if(bTwice)
		return;
	bTwice = true;
	SWISTATUS ss;
	CDHtmlDialog::OnTimer(nIDEvent);
	if (nIDEvent == 1)
	{
		CString status;
		m_CheckTicks++;
		if(m_CheckTicks == 1){
			status.Format("正在进行License检查");
			SetElementText(_T("checking"),status.AllocSysString());
			}
		if(m_CheckTicks == 2){	
			if(!CheckLicense())
			{
				MessageBox("本软件无法在本机上使用,请联系供应商");
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
			status.Format("正在连接控制板");
			SetElementText(_T("checking"),status.AllocSysString());
			}
		if(m_CheckTicks == 3){
			if(!m_Switch.Open(SPORT_SWITCH))
			{
				MessageBox("连接控制板失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
		
			status.Format("正在连接纳伏计");
			SetElementText(_T("checking"),status.AllocSysString());
			}
		if(m_CheckTicks == 4){
			if(!m_Navmeter.Open(SPORT_NAVMETER))
			{
				MessageBox("连接纳伏计失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}

			status.Format("正在连接数据库");
			SetElementText(_T("checking"),status.AllocSysString());
		}
		if(m_CheckTicks == 5){
			if(!SqlInit(g_Path+_T("\\Data\\test.mdb")))
			{
				MessageBox("连接数据库失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
			status.Format("正在装载程序");
			SetElementText(_T("checking"),status.AllocSysString());
		}
		if(m_CheckTicks == 6){
			if(!m_Program.InstallScheme(PathQuery2(CLSGROUP,IDTYPE)))
			{
				MessageBox("程序装载失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
		}
		if(m_CheckTicks == 7){
			m_currPage = INDEX;		Handler("init",m_sRegSel,m_sRegLst,true);
//			m_currPage = CONFIG;	Handler("init",m_sConfSel,m_sConfLst,true);
//			m_currPage = DATA;		Handler("init",m_sDataSel,m_sDataLst,true);
//			m_currPage = JIAOHE;	Handler("init",m_sJhSel,m_sJhLst,true);
			KillTimer(1);
			m_currPage = INDEX;
			m_cmdStep = CMD_LOADHTML;
			//create the chart dialog
			m_pChartDlg = new CChartDlg(this);
			m_pChartDlg->Create(IDD_DIALOG2,this);
			m_pChartDlg->ShowWindow(SW_HIDE);
			//create the wait dialog
			m_pWaitDlg = new CWaitDialog(this);
			m_pWaitDlg->Create(IDD_DIALOG3,this);
			m_pWaitDlg->ShowWindow(SW_HIDE);

			SetTimer(2,30,NULL);
		}
	}	
	
	if(nIDEvent == 2)
	{
		if(m_cmdStep == CMD_INITHTML){
			IHTMLElement* newElement;
			if((m_currPage == INDEX) && (S_OK == GetElement("idvals",&newElement)))
			{
				m_sRegvals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sRegSel,m_sRegLst);
			}
			if((m_currPage == CONFIG) && (S_OK == GetElement("idvals",&newElement)))
			{
				m_sConfigvals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sConfSel,m_sConfLst);
			}
			if((m_currPage == JIAOHE) && (S_OK == GetElement("idvals",&newElement)))
			{

				m_sJhvals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sJhSel,m_sJhLst);
			}
			if((m_currPage == DATA) && (S_OK == GetElement("idvals",&newElement)))
			{
				if(g_TesterConf.m_Ps.iTimes == 0) //come to the data page directly from reg page 
				{
					m_currPage = CONFIG;
					m_sConfigvals = CString(",cklt9,rstdlt9,alphalt9,betalt9,cklt8,rstdlt8,alphalt8,betalt8,cklt1,rstdlt1,alphalt1,betalt1,cklt2,rstdlt2,alphalt2,betalt2,cklt3,rstdlt3,alphalt3,betalt3,cklt4,rstdlt4,alphalt4,betalt4,cklt5,rstdlt5,alphalt5,betalt5,cklt6,rstdlt6,alphalt6,betalt6,cklt7,rstdlt7,alphalt7,betalt7,confdxcl,zdpselect,lcselect,confcysj,confcycs,confwd,");
					Handler("init",m_sConfSel,m_sConfLst,true);


					m_currPage = JIAOHE;
					m_sJhvals = CString(",jhsel19,jhsel18,jhsel17,jhsel16,jhsel15,jhsel14,jhsel13,jhsel12,jhsel11,jhsel10,jhsel9,jhsel8,jhsel7,jhsel6,jhsel5,jhsel4,jhsel3,jhsel2,jhsel1,jhsel0,");
					Handler("init",m_sJhSel,m_sJhLst,true);
					m_sJhvals.Empty();

					m_currPage = DATA;
				}

				m_sDatavals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sDataSel,m_sDataLst);
				if(m_sDataLst.IsEmpty() || (m_sDataLst == " ,"))
				{
						InternalRoutines('9');//update value to page
				}
				Handler("update",m_sDataSel,m_sDataLst);
				
			}
			if(m_currPage == REPORT)
			{
				Handler("init",m_sReportSel,m_sReportLst);
			}
			m_cmdStep = CMD_IDLEHTML;
		}
		if((m_cmdStep == CMD_CONTHTML)||(m_cmdStep == CMD_CONTHTML2)){
			int group = -1;
			switch(m_currPage)
			{
			case JIAOHE:	group=IDJH;break;
			case DATA:		group=IDTEST;break;
			default: break;
			}
			if(group >= 0)
			{
				CStdioFile csf;
				if(csf.Open(g_Path+CString(PathQuery2(CLSJS,group)),CFile::modeRead))
				{
					CString content(""),line;
					while(csf.ReadString(line))
					{
						content += line;
					}
					csf.Close();
					SetElementHtml("cont",content.AllocSysString());
				}
			}
			if(m_cmdStep == CMD_CONTHTML2)
				m_cmdStep = CMD_INITHTML;
			else
				m_cmdStep = CMD_CONTHTML2;
		}
		if(m_cmdStep == CMD_LOADHTML && m_currPage > 0){
			LoadFromResource(m_currPage);
			m_cmdStep = CMD_CONTHTML;
		}
				CString str;
				CTime t = CTime::GetCurrentTime();
				str = t.Format("%H:%M:%S");
				SetElementText("curtime",str.AllocSysString());
		
		if(m_State == SUSPEND)			m_State = IDLE;
		if(m_State == BEERROR)			m_State = SUSPEND;

		if((m_State == IDLE)||(m_State == BEERROR))
		{
			if(m_CheckTicks++ > CHECKWAIT)
			{
				m_CheckTicks = 0;
#if 1
				SWISTATUS ss = m_Switch.GetSwitchStatus();
				while(ss.bOl1)
				{
					MessageBox("发生过载","电阻校验",MB_OK);
					ss = m_Switch.GetSwitchStatus();
				}

				CString str;
				str.Format("外标准[%s],被测[%s]",ss.bKN[0]?"接通":"未接",ss.bRn?"接通":"未接");
				SetElementText("swistatus",str.AllocSysString());
#endif;
			}
		}
		if(m_State == RUNNING)
		{
			char type;
			CString line;
//			m_State = SUSPEND;
				while((m_Program.m_iStackDepth > 0) )
				{
					if(m_Program.NextLine(type,line))//loop until some pausable command
					{
						if((type == 'z') || (type == 'd') || (type == 'w'))
						{
							HandleCommand(type,line);
							continue;
						}
						break;
					}
					
					 
				}
			    if(m_Program.m_iStackDepth <= 0)
				{
					Abort();
				}else{
					if(!HandleCommand(type,line))
					{
						m_State = BEERRO;
						Abort();
					}
				}
		}
	}
	bTwice = false;
	return;

}
Exemple #6
0
///----------------------------------------------------------------------------
/// <summary>
/// Perform validation on the operation
/// </summary>
///----------------------------------------------------------------------------
void MgRenderingOperation::Validate()
{
    CheckLicense();
}