Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

63 lines
1.3 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: voltage.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of RELAY.CPP
//----------------------------------------------------------------------------
#include "voltage.h"
void CVoltage::Invalidate( BOOL bVoltageOK )
{
// if voltage control disabled
if( !m_VoltageParameters.bControl )
return;
// update power state
if( bVoltageOK )
{
if( m_nBoardVoltageValue < +1000 )
m_nBoardVoltageValue++;
else
{
if( !m_bBoardVoltage )
{
m_bBoardVoltage = TRUE;
m_bBoardVoltageChanged = TRUE;
}
}
}
else
{
if( m_nBoardVoltageValue > -1000 )
m_nBoardVoltageValue--;
else
{
if( m_bBoardVoltage )
{
m_bBoardVoltage = FALSE;
m_bBoardVoltageChanged = TRUE;
}
}
}
}
// protocol processing
BOOL CVoltage::GetVoltage()
{
// clear notification flag
m_bBoardVoltageChanged = FALSE;
return m_bBoardVoltage;
}
void CVoltage::OnProtocolLgsState2Command( BYTE& bFlags )
{
if( m_bBoardVoltageChanged )
bFlags |= LGS::S2_ITF_VOLTAGE;
}