/// <summary> /// This method determines if the given KYZ output uses a pulse weight. /// </summary> /// <param name="Output">The KYZ output to check.</param> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ --------------------------------------------- // 04/20/09 jrf 2.20.02 n/a Created. // public bool UsesPulseWeight(KYZOutput Output) { bool blnUsesPulseWt = false; switch (Output) { case KYZOutput.KYZ1: { if ((byte)Energy.NoEnergy != m_bytKYZ1EnergyID) { blnUsesPulseWt = true; } break; } case KYZOutput.KYZ2: { if ((byte)Energy.NoEnergy != m_bytKYZ2EnergyID) { blnUsesPulseWt = true; } break; } case KYZOutput.LC1: { //Low current output never uses energy and thus never uses //a pulse weight. blnUsesPulseWt = false; break; } default: { blnUsesPulseWt = false; break; } } return(blnUsesPulseWt); }
/// <summary> /// This method determines the event ID, energy ID and output type for /// a particular KYZ output based on a description. /// </summary> /// <param name="KYZOutput">The KYZ output to obtain values for.</param> /// <param name="strDescription">The description to decode.</param> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ --------------------------------------------- // 04/20/09 jrf 2.20.02 n/a Created. // private void DecodeDescription(KYZOutput KYZOutput, string strDescription) { byte bytEventID = (byte)Event.NoEvent; byte bytEnergyID = (byte)Energy.NoEnergy; byte bytOutputType = (byte)OutputType.NotUsed; //Determine the energy and event IDs bytEventID = DetermineEventID(strDescription); if ((byte)Event.NoEvent == bytEventID) { bytEnergyID = DetermineEnergyID(strDescription); } //Default to pulse until proven otherwise if ((byte)Energy.NoEnergy != bytEnergyID) { bytOutputType = (byte)OutputType.PulseEnergy; } else if ((byte)Event.NoEvent != bytEventID) { bytOutputType = (byte)OutputType.PulseEvent; } //Set output type, energy ID and event ID based on the KYZ output switch (KYZOutput) { case KYZOutput.KYZ1: { m_bytKYZ1EnergyID = bytEnergyID; m_bytKYZ1EventID = bytEventID; //Change output type to toggle or state change if necessary AdjustOutputType(ref bytOutputType, m_usKYZ1PulseWidth); m_bytKYZ1OutputType = bytOutputType; break; } case KYZOutput.KYZ2: { m_bytKYZ2EnergyID = bytEnergyID; m_bytKYZ2EventID = bytEventID; //Change output type to toggle or state change if necessary AdjustOutputType(ref bytOutputType, m_usKYZ2PulseWidth); m_bytKYZ2OutputType = bytOutputType; break; } case KYZOutput.LC1: { m_bytLC1EventID = bytEventID; //Change output type to toggle or state change if necessary AdjustOutputType(ref bytOutputType, m_usLC1PulseWidth); m_bytLC1OutputType = bytOutputType; break; } default: break; } }