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

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