⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 param.cpp

📁 一个操作系统资源监测器的需求、设计与实现
💻 CPP
📖 第 1 页 / 共 5 页
字号:

		m_cplat25.SetFocus();
		
	}
	//设定框三
	//标签:<FRAME3></FRAME3>
	fstr=param->getCStringValue("FRAME3");
	if(fstr=="")  //没有设定参数,默认状态
	{
		m_pre31=true;
		m_pre32=true;
		m_pre33=true;
		m_pre34=true;

		m_min31=m_max32=90;
		m_min32=m_max33=80;
		m_min33=m_max34=50;
		m_min34=m_max35=10;

		m_cvalue31=255;
		m_cvalue32=16744703;
		m_cvalue33=16744576;
		m_cvalue34=65280;
		m_cvalue35=12632256;

		crColor31=255;
		crColor32=16744703;
		crColor33=16744576;
		crColor34=65280;
		crColor35=12632256;

		m_cplat31.SetFocus();
		m_cplat32.SetFocus();
		m_cplat33.SetFocus();
		m_cplat34.SetFocus();
		m_cplat35.SetFocus();
	}
	else
	{
		//级别:严重
		//标签:<Level1></Level1>
		int start=fstr.Find("Level1",0);
		start+=7;
		int pos=fstr.Find("<",start);
		CString mstr=fstr.Mid(start,pos-start);
		int mid=mstr.Find(" ",0);
		CString sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre31=false;
			m_pre31=false;
			crColor31=16777215;
			m_cctrl31.EnableWindow(FALSE);
			m_cplat31.EnableWindow(FALSE);
			m_little1.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue31=value;
			crColor31=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min31=value;

			m_pre31=true;
			
			m_cplat31.SetFocus();
		}
		//级别:紧张
		//标签:<Level2></Leve12>
		start=fstr.Find("Level2",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre32=false;
			m_pre32=false;
			crColor32=16777215;
			m_up32.EnableWindow(FALSE);
			m_cctrl32.EnableWindow(FALSE);
			m_cplat32.EnableWindow(FALSE);
			m_little2.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue32=value;
			crColor32=value;

			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			value=atoi(sel);
			m_max32=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min32=value;

			m_pre32=true;
			
			m_cplat32.SetFocus();
		}
		//级别:略微
		//标签:<Level3></Leve13>
		start=fstr.Find("Level3",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre33=false;
			m_pre33=false;
			crColor33=16777215;
			m_up33.EnableWindow(FALSE);
			m_cctrl33.EnableWindow(FALSE);
			m_cplat33.EnableWindow(FALSE);
			m_little3.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue33=value;
			crColor33=value;

			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			value=atoi(sel);
			m_max33=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min33=value;

			m_pre33=true;
			
			m_cplat33.SetFocus();
		}
		//级别:正常
		//标签:<Level4></Leve14>
		start=fstr.Find("Level4",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre34=false;
			m_pre34=false;
			crColor34=16777215;
			m_up34.EnableWindow(FALSE);
			m_cctrl34.EnableWindow(FALSE);
			m_cplat34.EnableWindow(FALSE);
			m_little4.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue34=value;
			crColor34=value;

			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			value=atoi(sel);
			m_max34=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min34=value;

			m_pre34=true;
			
			m_cplat34.SetFocus();
		}
		//级别:富余
		//标签:<Level5></Leve15>
		start=fstr.Find("Level5",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		int value=atoi(sel);
		m_cvalue35=value;
		crColor35=value;
		
		sel=mstr.Right(mstr.GetLength()-mid-1);
		value=atoi(sel);
		m_max35=value;

		m_cplat35.SetFocus();
		
	}
	//设定框四
	//标签:<FRAME4></FRAME4>
	fstr=param->getCStringValue("FRAME4");
	if(fstr=="")  //没有设定参数,默认状态
	{
		m_pre41=true;
		m_pre42=true;
		m_pre43=true;
		m_pre44=true;

		m_min41=m_max42=90;
		m_min42=m_max43=80;
		m_min43=m_max44=50;
		m_min44=m_max45=10;

		m_cvalue41=255;
		m_cvalue42=16744703;
		m_cvalue43=16744576;
		m_cvalue44=65280;
		m_cvalue45=12632256;

		crColor41=255;
		crColor42=16744703;
		crColor43=16744576;
		crColor44=65280;
		crColor45=12632256;

		m_cplat41.SetFocus();
		m_cplat42.SetFocus();
		m_cplat43.SetFocus();
		m_cplat44.SetFocus();
		m_cplat45.SetFocus();
	}
	else
	{
		//级别:严重
		//标签:<Level1></Level1>
		int start=fstr.Find("Level1",0);
		start+=7;
		int pos=fstr.Find("<",start);
		CString mstr=fstr.Mid(start,pos-start);
		int mid=mstr.Find(" ",0);
		CString sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre41=false;
			m_pre41=false;
			crColor41=16777215;
			m_cctrl41.EnableWindow(FALSE);
			m_cplat41.EnableWindow(FALSE);
			m_normal1.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue41=value;
			crColor41=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min41=value;

			m_pre41=true;
			
			m_cplat41.SetFocus();
		}
		//级别:紧张
		//标签:<Level2></Leve12>
		start=fstr.Find("Level2",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre42=false;
			m_pre42=false;
			crColor42=16777215;
			m_up42.EnableWindow(FALSE);
			m_cctrl42.EnableWindow(FALSE);
			m_cplat42.EnableWindow(FALSE);
			m_normal2.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue42=value;
			crColor42=value;

			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			value=atoi(sel);
			m_max42=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min42=value;

			m_pre42=true;
			
			m_cplat42.SetFocus();
		}
		//级别:略微
		//标签:<Level3></Leve13>
		start=fstr.Find("Level3",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre43=false;
			m_pre43=false;
			crColor43=16777215;
			m_up43.EnableWindow(FALSE);
			m_cctrl43.EnableWindow(FALSE);
			m_cplat43.EnableWindow(FALSE);
			m_normal3.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue43=value;
			crColor43=value;

			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			value=atoi(sel);
			m_max43=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min43=value;

			m_pre43=true;
			
			m_cplat43.SetFocus();
		}
		//级别:正常
		//标签:<Level4></Leve14>
		start=fstr.Find("Level4",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		if(sel=="UnSel")
		{
			m_pre44=false;
			m_pre44=false;
			crColor44=16777215;
			m_up44.EnableWindow(FALSE);
			m_cctrl44.EnableWindow(FALSE);
			m_cplat44.EnableWindow(FALSE);
			m_normal4.EnableWindow(FALSE);
		}
		else
		{
			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			int value=atoi(sel);
			m_cvalue44=value;
			crColor44=value;

			mstr=mstr.Right(mstr.GetLength()-mid-1);
			mid=mstr.Find(" ",0);

			sel=mstr.Left(mid);
			value=atoi(sel);
			m_max44=value;

			sel=mstr.Right(mstr.GetLength()-mid-1);
			value=atoi(sel);
			m_min44=value;

			m_pre44=true;
			
			m_cplat44.SetFocus();
		}
		//级别:富余
		//标签:<Level5></Leve15>
		start=fstr.Find("Level5",pos);
		start+=7;
		pos=fstr.Find("<",start);
		mstr=fstr.Mid(start,pos-start);
		
		mid=mstr.Find(" ",0);
		sel=mstr.Left(mid);
		int value=atoi(sel);
		m_cvalue45=value;
		crColor45=value;
		
		sel=mstr.Right(mstr.GetLength()-mid-1);
		value=atoi(sel);
		m_max45=value;

		m_cplat45.SetFocus();
		
	}

	//初始化可视化状态
	//设置窗口大小
	CRect rc;
	this->GetWindowRect(rc);
	this->SetWindowPos(&(wndTop),rc.left,rc.top,716,610,SWP_SHOWWINDOW);

	m_PCtrl.SetWindowPos(&(wndTop),14,14,685,510,SWP_SHOWWINDOW);

	m_frame1.SetWindowPos(&(wndBottom),30,52,656,82,SWP_SHOWWINDOW);
	m_frame2.SetWindowPos(&(wndBottom),30,146,656,90,SWP_SHOWWINDOW);

	m_frame3.ShowWindow(SW_HIDE);
	m_frame4.ShowWindow(SW_HIDE);

	m_title2.ShowWindow(SW_HIDE);
	m_title3.ShowWindow(SW_HIDE);
	m_title4.ShowWindow(SW_HIDE);
	m_title5.ShowWindow(SW_HIDE);
	m_title6.ShowWindow(SW_HIDE);
	m_title7.ShowWindow(SW_HIDE);
	m_title8.ShowWindow(SW_HIDE);
	m_title9.ShowWindow(SW_HIDE);
	m_title10.ShowWindow(SW_HIDE);
	m_title11.ShowWindow(SW_HIDE);
	m_title12.ShowWindow(SW_HIDE);
	m_title13.ShowWindow(SW_HIDE);


	m_level11.ShowWindow(SW_HIDE);
	m_level12.ShowWindow(SW_HIDE);
	m_level13.ShowWindow(SW_HIDE);
	m_level14.ShowWindow(SW_HIDE);
	m_level15.ShowWindow(SW_HIDE);

	m_level21.ShowWindow(SW_HIDE);
	m_level22.ShowWindow(SW_HIDE);
	m_level23.ShowWindow(SW_HIDE);
	m_level24.ShowWindow(SW_HIDE);
	m_level25.ShowWindow(SW_HIDE);

	m_level31.ShowWindow(SW_HIDE);
	m_level32.ShowWindow(SW_HIDE);
	m_level33.ShowWindow(SW_HIDE);
	m_level34.ShowWindow(SW_HIDE);
	m_level35.ShowWindow(SW_HIDE);

	m_level41.ShowWindow(SW_HIDE);
	m_level42.ShowWindow(SW_HIDE);
	m_level43.ShowWindow(SW_HIDE);
	m_level44.ShowWindow(SW_HIDE);
	m_level45.ShowWindow(SW_HIDE);


	m_up11.ShowWindow(SW_HIDE);
	m_up12.ShowWindow(SW_HIDE);
	m_up13.ShowWindow(SW_HIDE);
	m_up14.ShowWindow(SW_HIDE);
	m_up15.ShowWindow(SW_HIDE);

	m_up21.ShowWindow(SW_HIDE);
	m_up22.ShowWindow(SW_HIDE);
	m_up23.ShowWindow(SW_HIDE);
	m_up24.ShowWindow(SW_HIDE);
	m_up25.ShowWindow(SW_HIDE);

	m_up31.ShowWindow(SW_HIDE);
	m_up32.ShowWindow(SW_HIDE);
	m_up33.ShowWindow(SW_HIDE);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -