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

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.HuaweiAccessNameFormatFromInaccurateHuaweiFileAndEmsNameFormat(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 Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPn FirstFnSnPn
  96:              {
  97:                  get
  98:                  {
  99:                      return Ia.Ngn.Cl.Model.Business.Huawei.Ems.FirstFnSnPnForMduDevList(this);
 100:                  }
 101:              }
 102:   
 103:              ////////////////////////////////////////////////////////////////////////////
 104:   
 105:              /// <summary>
 106:              ///
 107:              /// </summary>
 108:              public override string ToString()
 109:              {
 110:                  string line;
 111:   
 112:                  line = "Dev: " + this.Dev + ", AccessName: " + this.AccessName;
 113:   
 114:                  return line;
 115:              }
 116:   
 117:              ////////////////////////////////////////////////////////////////////////////
 118:              ////////////////////////////////////////////////////////////////////////////
 119:          }
 120:   
 121:          /// <summary/>
 122:          public Dev() { }
 123:   
 124:          ////////////////////////////////////////////////////////////////////////////
 125:   
 126:          /// <summary>
 127:          ///
 128:          /// </summary>
 129:          public static int DevId(int did)
 130:          {
 131:              /*
 132:               * Id: OLT_01 Id-Frame-Slot-Port-OnuID
 133:               * FN    SN   PN   ONTID
 134:               * 
 135:               * Dev: did
 136:               * Board: FN SN
 137:               * Port: FN SN PN
 138:               * Ont: FN SN PN ONTID
 139:               * 
 140:               * /// FN INTEGER 0-255 Indicates the subrack ID of the OLT. 
 141:               * /// SN INTEGER 0-35 Indicates the slot ID of the OLT. 
 142:               * /// PN INTEGER 0-63 Indicates the port ID of the OLT. 
 143:               * /// 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. 
 144:               */
 145:   
 146:              int id;
 147:   
 148:              id = did;
 149:   
 150:              return id;
 151:          }
 152:   
 153:          ////////////////////////////////////////////////////////////////////////////
 154:   
 155:          /// <summary>
 156:          ///
 157:          /// </summary>
 158:          public static Ia.Ngn.Cl.Model.Huawei.EmsDev SequentialEmsDevListItem(out int sequentialEmsDevDevQueueCount, out string progressCounterString)
 159:          {
 160:              Ia.Ngn.Cl.Model.Huawei.EmsDev item;
 161:              List<Ia.Ngn.Cl.Model.Huawei.EmsDev> list;
 162:   
 163:              if (sequentialEmsDevDevQueue.Count == 0)
 164:              {
 165:                  list = Ia.Ngn.Cl.Model.Data.Huawei.Dev.List();
 166:                  //list = Ia.Ngn.Cl.Model.Data.Huawei.Default.AccessListBy5616Or5878OntEquipmentId();
 167:   
 168:                  sequentialEmsDevDevQueue = new Queue<Ia.Ngn.Cl.Model.Huawei.EmsDev>(list.Shuffle());
 169:   
 170:                  sequentialEmsDevDevQueueOriginalCount = sequentialEmsDevDevQueue.Count;
 171:              }
 172:   
 173:              if (sequentialEmsDevDevQueue.Count > 0) item = sequentialEmsDevDevQueue.Dequeue();
 174:              else item = null;
 175:   
 176:              progressCounterString = "(" + sequentialEmsDevDevQueue.Count + "/" + sequentialEmsDevDevQueueOriginalCount + ")";
 177:   
 178:              sequentialEmsDevDevQueueCount = sequentialEmsDevDevQueue.Count;
 179:   
 180:              return item;
 181:          }
 182:   
 183:          ////////////////////////////////////////////////////////////////////////////
 184:          ////////////////////////////////////////////////////////////////////////////
 185:      }
 186:   
 187:      ////////////////////////////////////////////////////////////////////////////
 188:      ////////////////////////////////////////////////////////////////////////////
 189:  }