VC++单片机虚拟仪器测试系统 第5页

VC++单片机虚拟仪器测试系统 第5页"
m_nSource=m_meas->m_CB_Source->GetCurSel();
 CString m_Source;
 m_meas->m_CB_Source->GetWindowText(m_Source);

 switch(m_nSource)
 {
 case 0:m_nStr_Source="CHAN1";break;
 case 1:m_nStr_Source="CHAN2";break;
 case 2:m_nStr_Source="DIGI0";break;
 case 3:m_nStr_Source="DIGI1";break;
 case 4:m_nStr_Source="DIGI2";break;
 case 5:m_nStr_Source="DIGI3";break;
 case 6:m_nStr_Source="FUNC";break;
 case 7:m_nStr_Source="MATH";break;
 }

    CString m_nStr_Param;
 m_nSource=m_meas->m_CB_Param->GetCurSel();
 CString m_Param;
 m_meas->m_CB_Param->GetWindowText(m_Param);
 switch(m_nSource)
 {
 case 0:m_nStr_Param="VAMP";break;
 case 1:m_nStr_Param="VPP";break;
 case 2:m_nStr_Param="VAVE";break;
 case 3:m_nStr_Param="VRMS";break;
 case 4:m_nStr_Param="FREQ";break;
 case 5:m_nStr_Param="PHAS";break;
 case 6:m_nStr_Param="PERI";break;
 case 7:m_nStr_Param="NWID";break;
 case 8:m_nStr_Param="PWID";break;
 case 9:m_nStr_Param="RISE";break;
 case 10:m_nStr_Param="FALL";break;
 case 11:m_nStr_Param="DELA";break;
 case 12:m_nStr_Param="DUTY";break;
 }

    CString  m_Result;
 
 viPrintf(theApp.m_Session,":MEAS:SOUR %s\n",m_nStr_Source);
 viPrintf(/*oscillograph*/theApp.m_Session,":MEAS:%s?\n",m_nStr_Param);//这里的通道源的赋值会会结果好像有影响//%s\n",m_nStr_Param,m_nStr_Source);
 float buff;
 viScanf(/*oscillograph*/theApp.m_Session,"%f",&buff);
    m_Result.Format("%s's %s value is %f!",m_Source,m_Param,buff);
 m_meas->m_dlg->MessageBox(m_Result,"测量结果",MB_OK);

 return 0;
}
//******************************************测量函数
void COSCILLOGRAPH::OnBtnMeasure()
{ UpdateData(TRUE);   
 m_measure.m_CB_Param=&m_nCtrl_Param;
 m_measure.m_CB_Source=&m_nCtrl_Source;
 m_measure.m_dlg=this;
 AfxBeginThread(ThreadMeasure,&m_measure);
 return;
  
}//***************************************X Y的处理函数
void COSCILLOGRAPH::OnCustomdrawSliderX(NMHDR* pNMHDR, LRESULT* pResult)
{ m_Static.m_XShow=m_nCtrl_Slide_X.GetPos();
 AfxBeginThread(ThreadProc,&m_Data);//采用线程的方式进行界面的刷新
    g_End.SetEvent();   
 *pResult = 0;
}void COSCILLOGRAPH::OnCustomdrawSliderY(NMHDR* pNMHDR, LRESULT* pResult)
{     m_Static.m_YShow=m_nCtrl_Slide_Y.GetPos();
// m_Y=m_nCtrl_Slide_Y.GetPos();
 AfxBeginThread(ThreadProc,&m_Data);
    g_End.SetEvent(); 
 *pResult = 0;
}


附  录 三
//万用表的测量函数的代码
void CMULTIMETER::OnBtnMultimeterMeas()
{//******************************************参数是否已经被选择的判断2005/5/22
 int m_nID;
 m_nID=GetCheckedRadioButton(IDC_RADIO_VOLTAGE,IDC_RADIO_PERIOD);
 if(m_nID==0)
 {  MessageBox("请先选择测量参数!","提示信息",MB_OK);
  return; }
//******************************************加上超时时间
 viSetAttribute(/*multimeter*/theApp.m_Session,VI_ATTR_TMO_VALUE,10000);
//*******************************************输入输出的设置以及采样的设置
 viPrintf(/*multimeter*/theApp.m_Session,"*RST\n");
 viPrintf(/*multimeter*/theApp.m_Session,"SAMP:COUN %s\n",m_nStr_Sample);
// viPrintf(/*multimeter*/theApp.m_Session,"INP:IMP:AUTO %s\n",m_nStr_Input);
 viPrintf(/*multimeter*/theApp.m_Session,"OUTPUT:%s %s\n",m_nStr_Output,m_nStr_Output_Mode);
//*******************************************//触发器设置按钮的点击--这里是一个大的循环
 if(m_bTrig==TRUE)
 {  viPrintf(/*multimeter*/theApp.m_Session,"TRIG:SOUR %s\n",SetParam.m_nTrigger_Source);
  viPrintf(/*multimeter*/theApp.m_Session,"TRIG:COUN %s\n",SetParam.m_nTrigger_Count);
  
  viPrintf(/*multimeter*/theApp.m_Session,"TRIG:DEL %s\n",SetParam.m_nTrigger_Delay);//这里要对延时做处理判断
  m_bTrig=FALSE;
 }  CButton*pRB;
    switch(m_nID)

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有