#include "RelayQuad.h"
//
CRelayQuad::CRelayQuad(int pina, int pinb, int pinc, int pind,
                       EStateRelay initstate, bool inverted)
{
    FPRelayA = new CRelay(pina, initstate, inverted);
    FPRelayB = new CRelay(pinb, initstate, inverted);
    FPRelayC = new CRelay(pinc, initstate, inverted);
    FPRelayD = new CRelay(pind, initstate, inverted);
}
//
//--------------------------------------------
//  Relay A..D
//--------------------------------------------
void CRelayQuad::Open(EStateRelay initstate)
{
    FPRelayA->Open(initstate);
    FPRelayB->Open(initstate);
    FPRelayC->Open(initstate);
    FPRelayD->Open(initstate);
}
void CRelayQuad::Close(void)
{
    FPRelayA->Close();
    FPRelayB->Close();
    FPRelayC->Close();
    FPRelayD->Close();
}
//
//--------------------------------------------
//  Relay A..D
//--------------------------------------------
void CRelayQuad::ADSetState(EStateRelay state)
{
    FPRelayA->SetState(state);
    FPRelayB->SetState(state);
    FPRelayC->SetState(state);
    FPRelayD->SetState(state);
}
//
void CRelayQuad::ADSetOn(void)
{
    FPRelayA->SetOn();
    FPRelayB->SetOn();
    FPRelayC->SetOn();
    FPRelayD->SetOn();
}
//
void CRelayQuad::ADSetOff(void)
{
    FPRelayA->SetOff();
    FPRelayB->SetOff();
    FPRelayC->SetOff();
    FPRelayD->SetOff();
}
//
void CRelayQuad::ADToggle(void)
{
    FPRelayA->Toggle();
    FPRelayB->Toggle();
    FPRelayC->Toggle();
    FPRelayD->Toggle();
}
//
//--------------------------------------------
//  Relay A
//--------------------------------------------
EStateRelay CRelayQuad::AGetState(void)
{
    return FPRelayA->GetState();
}
//
void CRelayQuad::ASetState(EStateRelay state)
{
    FPRelayA->SetState(state);
}
//
const char* CRelayQuad::AGetStateText(void)
{
    return FPRelayA->GetStateText();
}
//
void CRelayQuad::ASetOn(void)
{
    FPRelayA->SetOn();
}
//
void CRelayQuad::ASetOff(void)
{
    FPRelayA->SetOff();
}
//
void CRelayQuad::AToggle(void)
{
    FPRelayA->Toggle();
}
//
//--------------------------------------------
//  Relay B
//--------------------------------------------
EStateRelay CRelayQuad::BGetState(void)
{
    return FPRelayB->GetState();
}
//
void CRelayQuad::BSetState(EStateRelay state)
{
    FPRelayB->SetState(state);
}
//
const char* CRelayQuad::BGetStateText(void)
{
    return FPRelayB->GetStateText();
}
//
void CRelayQuad::BSetOn(void)
{
    FPRelayB->SetOn();
}
//
void CRelayQuad::BSetOff(void)
{
    FPRelayB->SetOff();
}
//
void CRelayQuad::BToggle(void)
{
    FPRelayB->Toggle();
}
//
//--------------------------------------------
//  Relay C
//--------------------------------------------
EStateRelay CRelayQuad::CGetState(void)
{
    return FPRelayC->GetState();
}
//
void CRelayQuad::CSetState(EStateRelay state)
{
    FPRelayC->SetState(state);
}
//
const char* CRelayQuad::CGetStateText(void)
{
    return FPRelayC->GetStateText();
}
//
void CRelayQuad::CSetOn(void)
{
    FPRelayC->SetOn();
}
//
void CRelayQuad::CSetOff(void)
{
    FPRelayC->SetOff();
}
//
void CRelayQuad::CToggle(void)
{
    FPRelayC->Toggle();
}
//
//--------------------------------------------
//  Relay D
//--------------------------------------------
EStateRelay CRelayQuad::DGetState(void)
{
    return FPRelayD->GetState();
}
//
void CRelayQuad::DSetState(EStateRelay state)
{
    FPRelayD->SetState(state);
}
//
const char* CRelayQuad::DGetStateText(void)
{
    return FPRelayD->GetStateText();
}
//
void CRelayQuad::DSetOn(void)
{
    FPRelayD->SetOn();
}
//
void CRelayQuad::DSetOff(void)
{
    FPRelayD->SetOff();
}
//
void CRelayQuad::DToggle(void)
{
    FPRelayD->Toggle();
}
//
//