📄 drawcurvedlg.cpp
字号:
if(m_bCheckSync) //如果同步
{
m_ctrl.SetYOffsetValueRef(1,m_dLineDataAvg2);
m_ctrl.SetYOffsetValueRef(2,m_dLineDataAvg3);
m_bCheckAC3=m_bCheckAC2=m_bCheckAC1;
UpdateData(FALSE);
}
}
else
{
pEdit->EnableWindow(TRUE);
m_ctrl.SetYOffsetValueRef(0,m_dYOffset1);
if(m_bCheckSync) //如果同步
{
m_ctrl.SetYOffsetValueRef(1,m_dYOffset2);
m_ctrl.SetYOffsetValueRef(2,m_dYOffset3);
m_bCheckAC3=m_bCheckAC2=m_bCheckAC1;
UpdateData(FALSE);
}
}
m_ctrl.InvalidateRectangle();
}
void DrawCurveDlg::OnCheckAc2()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_EDIT_OFFSET2);
if(m_bCheckAC2)
{
pEdit->EnableWindow(FALSE);
m_ctrl.SetYOffsetValueRef(1,m_dLineDataAvg2);
}
else
{
pEdit->EnableWindow(TRUE);
m_ctrl.SetYOffsetValueRef(1,m_dYOffset2);
}
m_ctrl.InvalidateRectangle();
}
void DrawCurveDlg::OnCheckAc3()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_EDIT_OFFSET3);
if(m_bCheckAC3)
{
pEdit->EnableWindow(FALSE);
m_ctrl.SetYOffsetValueRef(2,m_dLineDataAvg3);
}
else
{
pEdit->EnableWindow(TRUE);
m_ctrl.SetYOffsetValueRef(2,m_dYOffset3);
}
m_ctrl.InvalidateRectangle();
}
////////////////////////////////////////////////////////////////
//直流偏置设置响应函数OnChangeEditOffset
////////////////////////////////////////////////////////////////
void DrawCurveDlg::OnChangeEditOffset1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_ctrl.SetYOffsetValueRef(0,m_dYOffset1);
if(m_bCheckSync) //如果同步
{
CString str;
str.Format(_T("%.3f"),m_dYOffset1);
GetDlgItem(IDC_EDIT_OFFSET2)->SetWindowText(str); //3,2,1通道同步
GetDlgItem(IDC_EDIT_OFFSET3)->SetWindowText(str); //刷新DC 分量
m_ctrl.SetYOffsetValueRef(1,m_dYOffset1);
m_ctrl.SetYOffsetValueRef(2,m_dYOffset1);
}
m_ctrl.InvalidateRectangle();
}
void DrawCurveDlg::OnChangeEditOffset2()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_ctrl.SetYOffsetValueRef(1,m_dYOffset2);
m_ctrl.InvalidateRectangle();
}
void DrawCurveDlg::OnChangeEditOffset3()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_ctrl.SetYOffsetValueRef(2,m_dYOffset3);
m_ctrl.InvalidateRectangle();
}
void DrawCurveDlg::OnButtonRunstop()
{
// TODO: Add your control notification handler code here
m_bRunFlag=!m_bRunFlag;
}
void DrawCurveDlg::OnCheckOpenCh1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CEdit *pEdit;
CSliderCtrl *pSlider;
CButton *pButton;
if(m_bCheckOpenCH1)
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET1);
pEdit->EnableWindow(TRUE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE1);
pSlider->EnableWindow(TRUE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC1);
pButton->EnableWindow(TRUE);
m_ctrl.SetChanelOpen(0,TRUE); //状态传给画线函数
}
else
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET1);
pEdit->EnableWindow(FALSE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE1);
pSlider->EnableWindow(FALSE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC1);
pButton->EnableWindow(FALSE);
m_ctrl.SetChanelOpen(0,FALSE);
}
}
void DrawCurveDlg::OnCheckOpenCh2()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CEdit *pEdit;
CSliderCtrl *pSlider;
CButton *pButton;
if(m_bCheckOpenCH2)
{
if(!m_bCheckSync) //如果不同步
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET2);
pEdit->EnableWindow(TRUE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE2);
pSlider->EnableWindow(TRUE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC2);
pButton->EnableWindow(TRUE);
}
m_ctrl.SetChanelOpen(1,TRUE); //状态传给画线函数
}
else
{
if(!m_bCheckSync) //如果不同步
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET2);
pEdit->EnableWindow(FALSE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE2);
pSlider->EnableWindow(FALSE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC2);
pButton->EnableWindow(FALSE);
}
m_ctrl.SetChanelOpen(1,FALSE);
}
}
void DrawCurveDlg::OnCheckOpenCh3()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CEdit *pEdit;
CSliderCtrl *pSlider;
CButton *pButton;
if(m_bCheckOpenCH3)
{
if(!m_bCheckSync) //如果不同步
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET3);
pEdit->EnableWindow(TRUE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE3);
pSlider->EnableWindow(TRUE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC2);
pButton->EnableWindow(TRUE);
}
m_ctrl.SetChanelOpen(2,TRUE); //状态传给画线函数
}
else
{
if(!m_bCheckSync) //如果不同步
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET3);
pEdit->EnableWindow(FALSE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE3);
pSlider->EnableWindow(FALSE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC3);
pButton->EnableWindow(FALSE);
}
m_ctrl.SetChanelOpen(2,FALSE);
}
}
void DrawCurveDlg::OnCheckSync()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CEdit *pEdit;
CSliderCtrl *pSlider;
CButton *pButton;
if(m_bCheckSync)
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET2);
pEdit->EnableWindow(FALSE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE2);
pSlider->EnableWindow(FALSE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC2);
pButton->EnableWindow(FALSE);
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET3);
pEdit->EnableWindow(FALSE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE3);
pSlider->EnableWindow(FALSE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC3);
pButton->EnableWindow(FALSE);
CScrollBar* pScrollBar=(CScrollBar*)GetDlgItem(IDC_SLIDER_SETYVALUE1);
OnHScroll(0, 0, pScrollBar);
OnCheckAc1();
OnChangeEditOffset1();
}
else
{
if(m_bCheckOpenCH2)
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET2);
pEdit->EnableWindow(TRUE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE2);
pSlider->EnableWindow(TRUE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC2);
pButton->EnableWindow(TRUE);
}
if(m_bCheckOpenCH3)
{
pEdit= (CEdit*)GetDlgItem(IDC_EDIT_OFFSET3);
pEdit->EnableWindow(TRUE);
pSlider= (CSliderCtrl*)GetDlgItem(IDC_SLIDER_SETYVALUE3);
pSlider->EnableWindow(TRUE);
pButton=(CButton*)GetDlgItem(IDC_CHECK_AC3);
pButton->EnableWindow(TRUE);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -