add: cursor count

This commit is contained in:
liuyihui 2022-06-04 01:40:27 +08:00
parent ac1043f2e2
commit eafef1fd61
7 changed files with 17 additions and 4 deletions

View File

@ -26,6 +26,8 @@ CControlView::CControlView()
, m_nCursor1(0)
, m_nCursor2(1023)
, m_nCursorROI(0)
, m_nCursor1Count(0)
, m_nCursor2Count(0)
, m_nCursorROICount(0) {
}
@ -44,6 +46,8 @@ void CControlView::DoDataExchange(CDataExchange* pDX) {
DDX_Text(pDX, IDC_CURSOR1, m_nCursor1);
DDX_Text(pDX, IDC_CURSOR2, m_nCursor2);
DDX_Text(pDX, IDC_CURSORROI, m_nCursorROI);
DDX_Text(pDX, IDC_CURSOR1_COUNT, m_nCursor1Count);
DDX_Text(pDX, IDC_CURSOR2_COUNT, m_nCursor2Count);
DDX_Text(pDX, IDC_CURSORROI_COUNT, m_nCursorROICount);
DDX_Control(pDX, IDC_MODE, m_ComboMode);
DDX_Control(pDX, IDC_AXIS, m_ComboAxis);
@ -112,7 +116,6 @@ void CControlView::OnCbnSelchangeSource() {
CString tmp;
CMainFrame* pFrame = (CMainFrame*)GetParentFrame();
m_ComboSource.GetWindowText(tmp);
OutputDebugString(tmp);
if (tmp != m_sSource) {
pFrame->OnStaStop();
@ -127,7 +130,6 @@ void CControlView::OnCbnSelchangeMode() {
CString tmp;
CMainFrame* pFrame = (CMainFrame*)GetParentFrame();
m_ComboMode.GetWindowText(tmp);
OutputDebugString(tmp);
if (tmp == "时间") m_sMode = "Time";
else m_sMode = "Count";
@ -137,7 +139,6 @@ void CControlView::OnCbnSelchangeAxis() {
CString tmp;
CMainFrame* pFrame = (CMainFrame*)GetParentFrame();
m_ComboAxis.GetWindowText(tmp);
OutputDebugString(tmp);
if (tmp == "对数") pFrame->OnAxisLog();
else pFrame->OnAxisLinear();

View File

@ -48,6 +48,8 @@ public:
int m_nCursor1;
int m_nCursor2;
int m_nCursorROI;
int m_nCursor1Count;
int m_nCursor2Count;
int m_nCursorROICount;
// 侧边信息

View File

@ -127,6 +127,8 @@ void CDetailView::OnRButtonDown(UINT nFlags, CPoint point) {
if (pView == NULL) pView = (CControlView*)pDoc->GetView(RUNTIME_CLASS(CControlView));
pView->m_nCursor1 = 0;
pView->m_nCursor2 = 1023;
pView->m_nCursor1Count = pDoc->m_nChannelCount[0];
pView->m_nCursor2Count = pDoc->m_nChannelCount[1023];
pView->m_nWidth = 1024;
pView->UpdateData(FALSE);
pDoc->UpdateAllViews(NULL);

Binary file not shown.

View File

@ -205,6 +205,8 @@ void CMainFrame::UpdateValue() {
pView->m_nTotalCount = pDoc->GetTotal(0, 1023);
pView->m_nMaxCount = pDoc->GetMax(0, 1023);
pView->m_nPartCount = pDoc->GetTotal(pView->m_nCursor1, pView->m_nCursor2);
pView->m_nCursor1Count = pDoc->m_nChannelCount[pView->m_nCursor1];
pView->m_nCursor2Count = pDoc->m_nChannelCount[pView->m_nCursor2];
pView->m_nCursorROICount = pDoc->m_nChannelCount[pView->m_nCursorROI];
pView->m_nTime += GetMilliTime() - pView->m_nT0;
@ -444,6 +446,8 @@ void CMainFrame::OnStaClear() {
pView->m_nMaxCount = 0;
pView->m_nPartCount = 0;
pView->m_nTotalCount = 0;
pView->m_nCursor1Count = 0;
pView->m_nCursor2Count = 0;
pView->m_nCursorROICount = 0;
pView->m_nTimeStr = (CString)"0.0";
// 更新屏幕信息

View File

@ -28,10 +28,12 @@
#define IDC_RANGE 1025
#define IDC_MCOUNT 1026
#define IDC_AXIS 1027
#define IDC_CURSOR2 1029
#define IDC_CURSOR2 1028
#define IDC_CURSOR1_COUNT 1029
#define IDC_WIDTH 1030
#define IDC_CURSORROI 1031
#define IDC_PCOUNT 1032
#define IDC_CURSOR2_COUNT 1033
#define ID_ARROW_RIGHT 32805
#define ID_ARROW_UP 32806
#define ID_ARROW_DOWN 32807

View File

@ -114,6 +114,7 @@ void CTotalView::OnLButtonDown(UINT nFlags, CPoint point) {
int nX = (point.x - 1) / 2;
if (nX < pView->m_nCursor2) {
pView->m_nCursor1 = nX;
pView->m_nCursor1Count = pDoc->m_nChannelCount[nX];
pView->m_nWidth = pView->m_nCursor2 - pView->m_nCursor1 + 1;
pView->m_nCursorROI = max(pView->m_nCursor1, pView->m_nCursorROI);
}
@ -128,6 +129,7 @@ void CTotalView::OnRButtonDown(UINT nFlags, CPoint point) {
int nX = (point.x - 1) / 2;
if (nX > pView->m_nCursor1) {
pView->m_nCursor2 = nX;
pView->m_nCursor2Count = pDoc->m_nChannelCount[nX];
pView->m_nWidth = pView->m_nCursor2 - pView->m_nCursor1 + 1;
pView->m_nCursorROI = min(pView->m_nCursor2, pView->m_nCursorROI);
}