コード例 #1
0
        ///<summary>
        /// Returns a single repetition of Specimen Parent IDs(SPM-3).
        /// throws HL7Exception if the repetition number is invalid.
        /// <param name="rep">The repetition number (this is a repeating field)</param>
        ///</summary>
        public EIP GetSpecimenParentIDs(int rep)
        {
            EIP ret = null;

            try
            {
                IType t = this.GetField(3, rep);
                ret = (EIP)t;
            } catch (System.Exception ex) {
                HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", ex);
                throw new System.Exception("An unexpected error ocurred", ex);
            }
            return(ret);
        }
コード例 #2
0
    public string GetIP(EIP type = EIP.IPv4)
    {
        switch (type)
        {
        case EIP.IPv4:
            return(GetInsideIP(AddressFamily.InterNetwork));

        case EIP.IPv6:
            return(GetInsideIP(AddressFamily.InterNetworkV6));

        case EIP.OutSideIP:
            return(GetOutSideIP());
        }
        return(null);
    }
コード例 #3
0
 private void TestEIP_Load(object sender, EventArgs e)
 {
     // Comment out next line if browser not needed
     browser = new Browser(txtIPAddress.Text, 44818, @"C:\Temp\EIP", @"C:\GitHubEtherNetIP\Messages", 0);
     if (browser == null)
     {
         // Get a new EtherNet/IP instance
         EIP = new EIP(txtIPAddress.Text, 44818, @"C:\Temp\EIP");
     }
     else
     {
         // Use the instance from the browser
         EIP = browser.EIP;
     }
 }
コード例 #4
0
ファイル: SPM.cs プロジェクト: carlhuth/GenXSource
        /// <summary> Returns a single repetition of Specimen Parent IDs (SPM-3).</summary>
        /// <param name="rep">the repetition number (this is a repeating field)
        /// </param>
        /// <throws>  HL7Exception if the repetition number is invalid. </throws>
        public virtual EIP getSpecimenParentIDs(int rep)
        {
            EIP ret = null;

            try
            {
                Type t = this.getField(3, rep);
                ret = (EIP)t;
            }
            catch (System.InvalidCastException)
            {
                throw new Exception();
            }
            return(ret);
        }
コード例 #5
0
 ///<summary>
 /// Returns all repetitions of Specimen Parent IDs (SPM-3).
 ///</summary>
 public EIP[] GetSpecimenParentIDs()
 {
     EIP[] ret = null;
     try {
         IType[] t = this.GetField(3);
         ret = new EIP[t.Length];
         for (int i = 0; i < ret.Length; i++)
         {
             ret[i] = (EIP)t[i];
         }
     } catch (HL7Exception he) {
         HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", he);
         throw new System.Exception("An unexpected error ocurred", he);
     } catch (System.Exception cce) {
         HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", cce);
         throw new System.Exception("An unexpected error ocurred", cce);
     }
     return(ret);
 }
コード例 #6
0
ファイル: SPM.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Returns all repetitions of Specimen Parent IDs (SPM-3).</summary>
 public virtual EIP[] getSpecimenParentIDs()
 {
     EIP[] ret = null;
     try
     {
         Type[] t = this.getField(3);
         ret = new EIP[t.Length];
         for (int i = 0; i < ret.Length; i++)
         {
             ret[i] = (EIP)t[i];
         }
     }
     catch (System.InvalidCastException)
     {
         throw new Exception();
     }
     catch (NuGenHL7Exception)
     {
         throw new Exception();
     }
     return(ret);
 }
コード例 #7
0
 private void TestEIP_FormClosing(object sender, FormClosingEventArgs e)
 {
     EIP.CloseExcelFile(false);
     EIP     = null;
     browser = null;
 }