شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Dev

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

Huawei's Dev support class of Next Generation Network'a (NGN's) business model.

   1:  using System.Collections.Generic;
   2:   
   3:  namespace Ia.Ngn.Cl.Model.Business.Huawei
   4:  {
   5:      ////////////////////////////////////////////////////////////////////////////
   6:   
   7:      /// <summary publish="true">
   8:      /// Huawei's Dev support class of Next Generation Network'a (NGN's) business model.
   9:      /// </summary>
  10:      /// 
  11:      /// <remarks> 
  12:      /// Copyright © 2016-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  13:      ///
  14:      /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
  15:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  16:      ///
  17:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  18:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  19:      /// 
  20:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  21:      /// 
  22:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  23:      /// </remarks> 
  24:      public partial class Dev
  25:      {
  26:          private static int sequentialEmsDevDevQueueOriginalCount;
  27:          private static Queue<Ia.Ngn.Cl.Model.Huawei.EmsDev> sequentialEmsDevDevQueue = new Queue<Ia.Ngn.Cl.Model.Huawei.EmsDev>();
  28:   
  29:          ////////////////////////////////////////////////////////////////////////////
  30:   
  31:          /// <summary>
  32:          ///
  33:          /// </summary>
  34:          public class MduDev
  35:          {
  36:              public int Did;
  37:              public string Dev;
  38:              public string DevType;
  39:              public string DevIp;
  40:              public string AccessName;
  41:              public string NddOntId;
  42:   
  43:              public List<Ia.Ngn.Cl.Model.Business.Huawei.Board.MduDevBoard> MduDevBoardList;
  44:   
  45:              ////////////////////////////////////////////////////////////////////////////
  46:   
  47:              /// <summary>
  48:              ///
  49:              /// </summary>
  50:              public MduDev(int did)
  51:              {
  52:                  string dev, accessName, s;
  53:   
  54:                  if (Ia.Ngn.Cl.Model.Data.Huawei.Dev.DidToDevDictionary.ContainsKey(did))
  55:                  {
  56:                      dev = Ia.Ngn.Cl.Model.Data.Huawei.Dev.DidToDevDictionary[did];
  57:                      s = Ia.Ngn.Cl.Model.Business.Huawei.Ems.RemoveMduNameInHuaweiOntActivationReportSpecificNameFormat(dev);
  58:                      accessName = Ia.Ngn.Cl.Model.Business.Default.StandardizeAccessNameInLegalFormatFromValue(s);
  59:   
  60:                      this.Did = did;
  61:                      this.Dev = dev;
  62:   
  63:                      this.AccessName = accessName;
  64:   
  65:                      if (Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntAccessNameToOntIdDictionary.ContainsKey(accessName))
  66:                      {
  67:                          this.NddOntId = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntAccessNameToOntIdDictionary[accessName];
  68:                      }
  69:                      else this.NddOntId = string.Empty;
  70:                  }
  71:                  else
  72:                  {
  73:                      throw new System.Exception("DidToDevDictionary does not contain did key: " + did);
  74:                  }
  75:              }
  76:   
  77:              ////////////////////////////////////////////////////////////////////////////
  78:   
  79:              /// <summary>
  80:              /// 
  81:              /// </summary>
  82:              public List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPn> PossibleFnSnPnList
  83:              {
  84:                  get
  85:                  {
  86:                      return Ia.Ngn.Cl.Model.Business.Huawei.Ems.PossibleFnSnPnForMduDevList(this);
  87:                  }
  88:              }
  89:   
  90:              ////////////////////////////////////////////////////////////////////////////
  91:   
  92:              /// <summary>
  93:              ///
  94:              /// </summary>
  95:              public override string ToString()
  96:              {
  97:                  string line;
  98:   
  99:                  line = "Dev: " + this.Dev + ", AccessName: " + this.AccessName;
 100:   
 101:                  return line;
 102:              }
 103:   
 104:              ////////////////////////////////////////////////////////////////////////////
 105:              ////////////////////////////////////////////////////////////////////////////
 106:          }
 107:   
 108:          /// <summary/>
 109:          public Dev() { }
 110:   
 111:          ////////////////////////////////////////////////////////////////////////////
 112:   
 113:          /// <summary>
 114:          ///
 115:          /// </summary>
 116:          public static int DevId(int did)
 117:          {
 118:              /*
 119:               * Id: OLT_01 Id-Frame-Slot-Port-OnuID
 120:               * FN    SN   PN   ONTID
 121:               * 
 122:               * Dev: did
 123:               * Board: FN SN
 124:               * Port: FN SN PN
 125:               * Ont: FN SN PN ONTID
 126:               * 
 127:               * /// FN INTEGER 0-255 Indicates the subrack ID of the OLT. 
 128:               * /// SN INTEGER 0-35 Indicates the slot ID of the OLT. 
 129:               * /// PN INTEGER 0-63 Indicates the port ID of the OLT. 
 130:               * /// 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. 
 131:               */
 132:   
 133:              int id;
 134:   
 135:              id = did;
 136:   
 137:              return id;
 138:          }
 139:   
 140:          ////////////////////////////////////////////////////////////////////////////
 141:   
 142:          /// <summary>
 143:          ///
 144:          /// </summary>
 145:          public static Ia.Ngn.Cl.Model.Huawei.EmsDev SequentialEmsDevListItem(out int sequentialEmsDevDevQueueCount, out string progressCounterString)
 146:          {
 147:              Ia.Ngn.Cl.Model.Huawei.EmsDev item;
 148:              List<Ia.Ngn.Cl.Model.Huawei.EmsDev> list;
 149:   
 150:              if (sequentialEmsDevDevQueue.Count == 0)
 151:              {
 152:                  list = Ia.Ngn.Cl.Model.Data.Huawei.Dev.List();
 153:   
 154:                  sequentialEmsDevDevQueue = new Queue<Ia.Ngn.Cl.Model.Huawei.EmsDev>(list);
 155:   
 156:                  sequentialEmsDevDevQueueOriginalCount = sequentialEmsDevDevQueue.Count;
 157:              }
 158:   
 159:              if (sequentialEmsDevDevQueue.Count > 0) item = sequentialEmsDevDevQueue.Dequeue();
 160:              else item = null;
 161:   
 162:              progressCounterString = "(" + sequentialEmsDevDevQueue.Count + "/" + sequentialEmsDevDevQueueOriginalCount + ")";
 163:   
 164:              sequentialEmsDevDevQueueCount = sequentialEmsDevDevQueue.Count;
 165:   
 166:              return item;
 167:          }
 168:   
 169:          ////////////////////////////////////////////////////////////////////////////
 170:          ////////////////////////////////////////////////////////////////////////////
 171:      }
 172:   
 173:      ////////////////////////////////////////////////////////////////////////////
 174:      ////////////////////////////////////////////////////////////////////////////
 175:  }