Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
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<string> sequentialEmsDevDevQueue = new Queue<string>();
  28:   
  29:          /// <summary/>
  30:          public Dev() { }
  31:   
  32:          ////////////////////////////////////////////////////////////////////////////
  33:   
  34:          /// <summary>
  35:          ///
  36:          /// </summary>
  37:          public static int DevId(int did)
  38:          {
  39:              /*
  40:               * Id: OLT_01 Id-Frame-Slot-Port-OnuID
  41:               * FN    SN   PN   ONTID
  42:               * 
  43:               * Dev: did
  44:               * Board: FN SN
  45:               * Port: FN SN PN
  46:               * Ont: FN SN PN ONTID
  47:               * 
  48:               * /// FN INTEGER 0-255 Indicates the subrack ID of the OLT. 
  49:               * /// SN INTEGER 0-35 Indicates the slot ID of the OLT. 
  50:               * /// PN INTEGER 0-63 Indicates the port ID of the OLT. 
  51:               * /// 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. 
  52:               */
  53:   
  54:              int id;
  55:   
  56:              id = did;
  57:   
  58:              return id;
  59:          }
  60:   
  61:          ////////////////////////////////////////////////////////////////////////////
  62:   
  63:          /// <summary>
  64:          ///
  65:          /// </summary>
  66:          public static string SequentialEmsDevDevListItem(out int sequentialEmsDevDevQueueCount, out string progressCounterString)
  67:          {
  68:              string item;
  69:              List<string> list;
  70:   
  71:              if (sequentialEmsDevDevQueue.Count == 0)
  72:              {
  73:                  list = Ia.Ngn.Cl.Model.Data.Huawei.Dev.DevList();
  74:   
  75:                  sequentialEmsDevDevQueue = new Queue<string>(list);
  76:   
  77:                  sequentialEmsDevDevQueueOriginalCount = sequentialEmsDevDevQueue.Count;
  78:              }
  79:   
  80:              if (sequentialEmsDevDevQueue.Count > 0) item = sequentialEmsDevDevQueue.Dequeue();
  81:              else item = string.Empty;
  82:   
  83:              progressCounterString = "(" + sequentialEmsDevDevQueue.Count + "/" + sequentialEmsDevDevQueueOriginalCount + ")";
  84:   
  85:              sequentialEmsDevDevQueueCount = sequentialEmsDevDevQueue.Count;
  86:   
  87:              return item;
  88:          }
  89:   
  90:          ////////////////////////////////////////////////////////////////////////////
  91:          ////////////////////////////////////////////////////////////////////////////
  92:      }
  93:   
  94:      ////////////////////////////////////////////////////////////////////////////
  95:      ////////////////////////////////////////////////////////////////////////////
  96:  }