// ExpTime.cpp : implementation file
//

#include "stdafx.h"
#include "CheckTr.h"
#include "ExpTime.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CExpTime dialog


CExpTime::CExpTime(CWnd* pParent /*=NULL*/)
	: CDialog(CExpTime::IDD, pParent)
{
	//{{AFX_DATA_INIT(CExpTime)
	m_Check = FALSE;
	m_Blank = _T("");
	m_Test = FALSE;
	m_TotEndPix = _T("");
	m_TotStartPix = _T("");
	m_NScans = _T("");
	m_KeepTrigger = FALSE;
	m_Trigger = FALSE;
	m_Average = FALSE;
	m_Fast = FALSE;
	m_ColBar = TRUE;
	m_ApplNorm = FALSE;
	m_ShowMaxInt = FALSE;
	m_CalcDistr = FALSE;
	m_LowRange = _T("");
	m_LowRange2 = _T("");
	m_LowRange3 = _T("");
	m_UpperRange1 = _T("");
	m_UpperRange = _T("");
	m_UpperRange2 = _T("");
	m_UpperRange3 = _T("");
	m_LowRange1 = _T("");
	m_AutoMinutes = _T("");
	m_AutoSave = FALSE;
	m_AutoSave1 = FALSE;
	m_AutoSave2 = FALSE;
	m_AutoSave3 = FALSE;
	m_AutoSave4 = FALSE;
	m_EnergyCorrect = _T("");
	m_IrradiationCorrectionSaveToFlash = FALSE;
	m_Gauss = FALSE;
	m_ApplCal = FALSE;
	//}}AFX_DATA_INIT
}


void CExpTime::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CExpTime)
	DDX_Text(pDX, IDC_EXPTIME, m_ExpTime);
	DDX_Check(pDX, IDC_CHECK1, m_Check);
	DDX_Text(pDX, IDC_BLANK, m_Blank);
	DDX_Check(pDX, IDC_TEST, m_Test);
	DDX_Text(pDX, IDC_TOTENDPIX, m_TotEndPix);
	DDX_Text(pDX, IDC_TOTSTARTPIX, m_TotStartPix);
	DDX_Text(pDX, IDC_NSCAN, m_NScans);
	DDX_Check(pDX, IDC_KEEPTRIGGER, m_KeepTrigger);
	DDX_Check(pDX, IDC_TRIGGER, m_Trigger);
	DDX_Check(pDX, IDC_AVERAGED, m_Average);
	DDX_Check(pDX, IDC_FAST, m_Fast);
	DDX_Check(pDX, IDC_COLBAR, m_ColBar);
	DDX_Check(pDX, IDC_APPLNORM, m_ApplNorm);
	DDX_Check(pDX, IDC_SHOWMAX, m_ShowMaxInt);
	DDX_Check(pDX, IDC_CALCDISTR, m_CalcDistr);
	DDX_Text(pDX, IDC_LOWRANGE, m_LowRange);
	DDX_Text(pDX, IDC_LOWRANGE2, m_LowRange2);
	DDX_Text(pDX, IDC_LOWRANGE3, m_LowRange3);
	DDX_Text(pDX, IDC_UPEERRANGE1, m_UpperRange1);
	DDX_Text(pDX, IDC_UPPERRANGE, m_UpperRange);
	DDX_Text(pDX, IDC_UPPERRANGE2, m_UpperRange2);
	DDX_Text(pDX, IDC_UPPERRANGE3, m_UpperRange3);
	DDX_Text(pDX, IDC_LOWRANGE1, m_LowRange1);
	DDX_Text(pDX, IDC_AUTOMINUTES, m_AutoMinutes);
	DDX_Check(pDX, IDC_AUTOSAVE, m_AutoSave);
	DDX_Check(pDX, IDC_AUTOSAVE_1, m_AutoSave1);
	DDX_Check(pDX, IDC_AUTOSAVE_2, m_AutoSave2);
	DDX_Check(pDX, IDC_AUTOSAVE_3, m_AutoSave3);
	DDX_Check(pDX, IDC_AUTOSAVE_4, m_AutoSave4);
	DDX_Text(pDX, IDC_ENERGYCORRECT, m_EnergyCorrect);
	DDX_Check(pDX, IDC_IRRCORRSAVE, m_IrradiationCorrectionSaveToFlash);
	DDX_Check(pDX, IDC_GAUSS, m_Gauss);
	DDX_Check(pDX, IDC_APPLCAL, m_ApplCal);
	//}}AFX_DATA_MAP

	Trig=m_Trigger;
}


BEGIN_MESSAGE_MAP(CExpTime, CDialog)
	//{{AFX_MSG_MAP(CExpTime)
	ON_BN_CLICKED(IDC_TRIGGER, OnTrigger)
	ON_BN_CLICKED(IDC_KEEPTRIGGER, OnKeeptrigger)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExpTime message handlers

void CExpTime::OnTrigger() 
{
	if(Trig==false)	Trig=true;
	else
	{
		Trig=false;
		::CheckDlgButton(GetSafeHwnd(),IDC_KEEPTRIGGER,0);
	}
}

void CExpTime::OnKeeptrigger() 
{
	if(Trig==false)	::CheckDlgButton(GetSafeHwnd(),IDC_KEEPTRIGGER,0);
}
