-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBkNits.cpp
More file actions
64 lines (59 loc) · 1.61 KB
/
BkNits.cpp
File metadata and controls
64 lines (59 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "stdafx.h"
#include "BkNits.h"
void BkNits::n2cPos(ColorRef& Bkclr)
{
int _gl= 60;// int Graylevel = 55;
int fLv = 100*100;
while(fLv > m_NitsLv) //若亮度還沒有到5以下,就減少
{
_gl -= 2;
Bkclr.iGray(_gl);
m_pdlgcWnd->Invalidate();
m_pdlgcWnd->UpdateWindow();
//量測抓值
if (m_pCa210->Measure() == CA_ZeroCalMode)
AfxMessageBox("檔位不在MEAS");
fLv = (int)((m_pCa210->GetMsrData().oFlt(VluK_Lv))*100); //m_IProbe.GetLv();
}
while(fLv < m_NitsLv) //若亮度還在5以下,就...變亮
{
++_gl;
Bkclr.iGray(_gl);
m_pdlgcWnd->Invalidate();
m_pdlgcWnd->UpdateWindow();
Sleep(60);
// 量測抓值
m_pCa210->Measure();
fLv = (int)((m_pCa210->GetMsrData().oFlt(VluK_Lv))*100); //m_IProbe.GetLv();
}
_SetBkColor(Bkclr);
}
void BkNits::n2cNeg(ColorRef& Bkclr)
{
int fLv = 0;
int _gl = 55;
while(fLv < m_NitsLv) //若亮度還沒有到5以下,就減少
{
_gl += 2;
Bkclr.iGray(_gl);
m_pdlgcWnd->Invalidate();
m_pdlgcWnd->UpdateWindow();
// Sleep(0);
// 量測抓值
if (m_pCa210->Measure() == CA_ZeroCalMode)
AfxMessageBox("檔位不在MEAS");
fLv = (int)((m_pCa210->GetMsrData().oFlt(VluK_Lv))*100); //m_IProbe.GetLv();
}
while(fLv > m_NitsLv) //若亮度還在5以下,就...變亮
{
--_gl;
Bkclr.iGray(_gl);
m_pdlgcWnd->Invalidate();
m_pdlgcWnd->UpdateWindow();
Sleep(60);
//量測抓值
m_pCa210->Measure();
fLv = (int)((m_pCa210->GetMsrData().oFlt(VluK_Lv))*100); //m_IProbe.GetLv();
}
_SetBkColor(Bkclr);
}