)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Port (Ia.Ftn.Cl.Models.Business.Huawei)

Public general use code classes and xml files that we've compiled and used over the years:

Huawei's Port support class of Fixed Telecommunications Network (FTN) business model.

    1: namespace Ia.Ftn.Cl.Models.Business.Huawei
    2: {
    3:     ////////////////////////////////////////////////////////////////////////////
    4:  
    5:     /// <summary publish="true">
    6:     /// Huawei's Port support class of Fixed Telecommunications Network (FTN) business model.
    7:     /// </summary>
    8:     /// 
    9:     /// <remarks> 
   10:     /// Copyright © 2016-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   11:     /// </remarks> 
   12:     public class Port
   13:     {
   14:         /// <summary/>
   15:         public Port() { }
   16:  
   17:         ////////////////////////////////////////////////////////////////////////////
   18:  
   19:         /// <summary>
   20:         ///
   21:         /// </summary>
   22:         public static string PortId(int devId, int fn, int sn, int pn)
   23:         {
   24:             /*
   25:              * Id: OLT_01 Id-Frame-Slot-Port-OnuID
   26:              * FN    SN   PN   ONTID
   27:              * 
   28:              * Dev: did
   29:              * Board: FN SN
   30:              * Port: FN SN PN
   31:              * Ont: FN SN PN ONTID
   32:              * 
   33:              * /// FN INTEGER 0-255 Indicates the subrack ID of the OLT. 
   34:              * /// SN INTEGER 0-35 Indicates the slot ID of the OLT. 
   35:              * /// PN INTEGER 0-63 Indicates the port ID of the OLT. 
   36:              * /// ONTID INTEGER 0-255 NOTE If the UNI port is of 10G GPON, the value range is 0-255; if the UNI port is of 1G GPON, the value range is 0-127. Indicates the ONT ID. 
   37:              */
   38:  
   39:             string id;
   40:  
   41:             if (devId > 0 && fn >= 0 && fn <= 255 && sn >= 0 && sn <= 35 && pn >= 0 && pn <= 63)
   42:             {
   43:                 id = devId.ToString() + fn.ToString().PadLeft(3, '0') + sn.ToString().PadLeft(2, '0') + pn.ToString().PadLeft(2, '0');
   44:             }
   45:             else
   46:             {
   47:                 throw new System.ArgumentOutOfRangeException("fn, sn, pn", "fn, sn, or pn is out of range");
   48:             }
   49:  
   50:             return id;
   51:         }
   52:  
   53:         ////////////////////////////////////////////////////////////////////////////
   54:  
   55:         /// <summary>
   56:         ///
   57:         /// </summary>
   58:         public static string PortId(string boardId, int pn)
   59:         {
   60:             string id;
   61:  
   62:             if (boardId.Length > 0 && pn >= 0 && pn <= 63)
   63:             {
   64:                 id = boardId + pn.ToString().PadLeft(2, '0');
   65:             }
   66:             else
   67:             {
   68:                 throw new System.ArgumentOutOfRangeException("pn", "pn is out of range");
   69:             }
   70:  
   71:             return id;
   72:         }
   73:  
   74:         ////////////////////////////////////////////////////////////////////////////
   75:         ////////////////////////////////////////////////////////////////////////////
   76:     }
   77:  
   78:     ////////////////////////////////////////////////////////////////////////////
   79:     ////////////////////////////////////////////////////////////////////////////
   80: }