/**************************************************************************
<MODULE NAME>
<FILENAME></FILENAME>
<HISTORY>
	<MODIFICATION>
		<DATE></DATE>
		<ATHOR></ATHOR>
		< DESCRIPTION>
		< /DESCRIPTION>
	</MODIFICATION>
</HISTORY>
</MODULE NAME>
**************************************************************************/


/**************************************************************************
INCLUDE FILE
**************************************************************************/
#include "..\comp\alarmbox\AlrBxJit.h"

/**************************************************************************
LOCAL VARIABLES
Always start with « static »-keyword
**************************************************************************/


/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
CAlarmBoxJites::CAlarmBoxJites()
{
	m_absStatus = eConnected;
	m_iPort = PORT_LED_KEY_JITES;
}

/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
CAlarmBoxJites::~CAlarmBoxJites()
{
}



/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME>Instance</NAME>
	<TYPE >GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
    <RETURNS>
		<TYPE>CAlarmBox *</TYPE>
		<DESCRIPTION>
			Returns one instance on the self class
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
CAlarmBox* CAlarmBoxJites::Instance(void)
{
    if(m_hInst == NULL)
    {
        m_hInst = new CAlarmBoxJites();
    }
    return m_hInst;
}


/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
void CAlarmBoxJites::SetGreenLed(void)
{
    int iC;
    iC = inp(m_iPort) & ~(eValGreenLed |eValRedLed);
    outp(m_iPort, iC | eValGreenLed);
}


/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
void CAlarmBoxJites::SetRedLed(void)
{
    int iC;
    iC = inp(m_iPort) & ~(eValGreenLed |eValRedLed);
    outp(m_iPort, iC | eValRedLed);
}


/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
void CAlarmBoxJites::SetLeds(void)
{
    int iC;
    iC = inp(m_iPort) & ~(eValGreenLed |eValRedLed);
    outp(m_iPort, iC | eValAllOn);
}

/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
void CAlarmBoxJites::ResetLeds(void)
{
    int iC;
    iC = inp(m_iPort) & ~(eValGreenLed |eValRedLed);
    outp(m_iPort, iC);                // Both off
}


/**************************************************************************
<METHOD>
	<CLASS>CAlarmBoxJites</CLASS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION></DESCRIPTION>
	<PARAMETERS>
		<PARAMETER>
			<NAME></NAME>
			<TYPE></TYPE>
			<IO> IN | OUT | INOUT</ IO >
			<DESCRIPTION>
			</DESCRIPTION>
		</PARAMETER>
    <RETURNS>
		<TYPE></TYPE>
		<DESCRIPTION>
		</DESCRIPTION>
    </RETURNS>
</METHOD>
**************************************************************************/
unsigned char CAlarmBoxJites::ButtonPressed(void)
{
	int iRep = ((inp(m_iPort) & eValKey) == eValKey)?1:0;
	return (unsigned char)iRep;
}
