)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Skip Navigation LinksHome » Code Library » Ont

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

ONT support class of Optical Fiber Network (OFN) Nokia business model.

    1: using System.Collections;
    2: using System.Collections.Generic;
    3: using System.Linq;
    4: using System.Text.RegularExpressions;
    5:  
    6: namespace Ia.Ngn.Cl.Model.Business.Nokia
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     /// ONT support class of Optical Fiber Network (OFN) Nokia business model.
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2006-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   16:     ///
   17:     /// 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
   18:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   19:     ///
   20:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   21:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   22:     /// 
   23:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   24:     /// 
   25:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   26:     /// </remarks> 
   27:     public class Ont
   28:     {
   29:         public static readonly int MaximumCardValue = 3;
   30:         public static readonly int MinimumCardValue = 1;
   31:         public static readonly int MaximumPortValue = 24;
   32:         public static readonly int MinimumPortValue = 1;
   33:  
   34:         /// <summary/>
   35:         public class EquipmentType
   36:         {
   37:             public string Name;
   38:             public string Model;
   39:             public string ActiveSoftware;
   40:             public string VersionNumber;
   41:             public int TelPorts;
   42:             public int EthernetPorts;
   43:             public Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType FamilyType;
   44:  
   45:             public EquipmentType() { }
   46:         }
   47:  
   48:         /// <summary/>
   49:         public static EquipmentType[] EquipmentTypeList =
   50:             {
   51:             new EquipmentType { Name = "BVM3G00CRAO420EB", Model = "O-420E-B", ActiveSoftware="3FE50853AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50683AD", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu, EthernetPorts = 2, TelPorts = 4 },
   52:             new EquipmentType { Name = "BVM4310DRAO420EB", Model = "O-420E-B", ActiveSoftware="3FE50853AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50683AM", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu, EthernetPorts = 2, TelPorts = 4 },
   53:             new EquipmentType { Name = "BVM4X00DRAO821GD", Model = "O-821G-D", ActiveSoftware="3FE51136AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50774AD", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sbu, EthernetPorts = 2, TelPorts = 8 },
   54:             new EquipmentType { Name = "BVM5F00CRAO24120", Model = "O-24120G-A", ActiveSoftware="3FE51408AJJE06 (R05.06.01 H.248)", VersionNumber="3FE51185AB", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu, EthernetPorts = 12, TelPorts = 24 },
   55:             new EquipmentType { Name = "BVM5J00CRAO820GD", Model = "O-820G-D", ActiveSoftware="3FE51136AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50774AG", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sbu, EthernetPorts = 2, TelPorts = 8 },
   56:             new EquipmentType { Name = "VAMZS10BRAG440GA", Model = "G-440G-A", ActiveSoftware="3FE56398DFGB42 (R05.06.01 H.248)", VersionNumber="3FE55423BA", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu, EthernetPorts = 4, TelPorts = 4 },
   57:             new EquipmentType { Name = "RVM3G00CRAO420EB", Model = "G-24240E-P", ActiveSoftware="3FE45670AOCK69 (R05.06.01 H.248)", VersionNumber="3FE45307AA", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu, EthernetPorts = 24, TelPorts = 24 },
   58:  
   59:             //new EquipmentType { Name = "BVMDM00CRBG881GA", Model = "Undefined", ActiveSoftware="", VersionNumber="", FamilyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Undefined, EthernetPorts = 0, TelPorts = 0 },
   60:         };
   61:  
   62:         /*
   63: select count(Id) as Count, substring(ActiveSoftware, 1, 6) as ActiveSoftware from Onts group by substring([ActiveSoftware], 1, 6)
   64: 
   65: Count    ActiveSoftware
   66: 160    3FE514
   67: 2    3FE556
   68: 4    3FE511
   69: 26811    3FE508
   70: 46317    NULL
   71: 2    3FE456
   72: 1    3FE559
   73: 108    3FE563       
   74:          */
   75:  
   76:         /*
   77: select count(Id) as Count, '[' + EquipmentId + ']' as EquipmentId from Onts group by EquipmentId
   78: 
   79: Count    EquipmentId
   80: 1    [BVM4X00DRAO821GD]
   81: 2    [RVM3G00CRAO420EB]
   82: 110    [VAMZS10BRAG440GA]
   83: 1    [BVMDM00CRBG881GA]
   84: 3    [BVM5J00CRAO820GD]
   85: 2913    [BVM4310DRAO420EB]
   86: 46376    NULL
   87: 23839    [BVM3G00CRAO420EB]
   88: 160    [BVM5F00CRAO24120]
   89:         */
   90:  
   91:         /// <summary/>
   92:         public enum FamilyType { Undefined = 0, Sfu = 1, Soho = 2, Mdu = 3, Gfu = 4, Sbu = 5, Gmdu = 6 };
   93:  
   94:         /// <summary/>
   95:         public Ont() { }
   96:  
   97:         ////////////////////////////////////////////////////////////////////////////
   98:  
   99:         /// <summary>
  100:         ///
  101:         /// </summary>
  102:         public static string OntId(string ponId, int ontNumber)
  103:         {
  104:             string id;
  105:  
  106:             id = Ia.Ngn.Cl.Model.Business.Default.OntId(ponId, ontNumber);
  107:  
  108:             return id;
  109:         }
  110:  
  111:         ////////////////////////////////////////////////////////////////////////////
  112:  
  113:         /// <summary>
  114:         ///
  115:         /// </summary>
  116:         public static string OntId(string amsName, string cardPortOntSequence)
  117:         {
  118:             string id;
  119:             string ontPosition;
  120:  
  121:             ontPosition = Ia.Ngn.Cl.Model.Business.Nokia.Ams.OntPositionFromAmsNameAndCardPortOntSquence(amsName, cardPortOntSequence);
  122:  
  123:             id = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntIdByPosition(ontPosition);
  124:             //id = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Position == ontPosition select o.Id).SingleOrDefault();
  125:  
  126:             return id;
  127:         }
  128:  
  129:         ////////////////////////////////////////////////////////////////////////////
  130:  
  131:         /// <summary>
  132:         ///
  133:         /// </summary>
  134:         public static Ia.Ngn.Cl.Model.Business.Nokia.Ont.EquipmentType EquipmentTypeFromActiveSoftware(string activeSoftware)
  135:         {
  136:             Ia.Ngn.Cl.Model.Business.Nokia.Ont.EquipmentType equipmentType;
  137:  
  138:             equipmentType = null;
  139:  
  140:             return equipmentType;
  141:         }
  142:  
  143:         ////////////////////////////////////////////////////////////////////////////
  144:  
  145:         /// <summary>
  146:         /// Return the ONT family type id from the software version
  147:         /// </summary>
  148:         public static Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType FamilyTypeIdFromActiveSoftwareAndPlannedSoftware(string activeSoftware, string plannedSoftware)
  149:         {
  150:             Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType;
  151:  
  152:             if (activeSoftware != null)
  153:             {
  154:                 if (activeSoftware == plannedSoftware || plannedSoftware == "auto" || plannedSoftware == "AUTO")
  155:                 {
  156:                     if (activeSoftware.StartsWith("3FE508")) familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu;
  157:                     else if (activeSoftware.StartsWith("3FE563")) familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu;
  158:                     else if (activeSoftware.StartsWith("3FE511")) familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho;
  159:                     else if (activeSoftware.StartsWith("3FE514")) familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu;
  160:                     else if (activeSoftware.StartsWith("3FE456")) familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu;
  161:                     else familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Undefined;
  162:                 }
  163:                 else familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Undefined;
  164:             }
  165:             else familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Undefined;
  166:  
  167:             return familyType;
  168:         }
  169:  
  170:         ////////////////////////////////////////////////////////////////////////////
  171:  
  172:         /// <summary>
  173:         /// 
  174:         /// </summary>
  175:         public static Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType FamilyTypeFromString(string familyTypeString)
  176:         {
  177:             // this will convert string format of ONU type from both email submittals and from EMSONT EQUIPMENTID values from NCE
  178:  
  179:             Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType;
  180:  
  181:             if (!string.IsNullOrEmpty(familyTypeString))
  182:             {
  183:                 switch (familyTypeString.ToUpper())
  184:                 {
  185:                     case "SFU": familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu; break;
  186:                     case "GFU": familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu; break;
  187:                     case "SOHO": familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho; break;
  188:                     case "MDU": familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu; break;
  189:                     case "GMDU": familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu; break;
  190:                     default: familyType = Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Undefined; break;
  191:                 }
  192:             }
  193:             else familyType = 0;
  194:  
  195:             return familyType; // Undefined
  196:         }
  197:  
  198:         ////////////////////////////////////////////////////////////////////////////
  199:  
  200:         /// <summary>
  201:         /// 
  202:         /// </summary>
  203:         public static string FamilyTypeStringFromFamilyTypeId(int familyTypeId)
  204:         {
  205:             string familyTypeString;
  206:             Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType;
  207:  
  208:             familyType = (Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType)familyTypeId;
  209:  
  210:             switch (familyType)
  211:             {
  212:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu: familyTypeString = "SFU"; break;
  213:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu: familyTypeString = "GFU"; break;
  214:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho: familyTypeString = "SOHO"; break;
  215:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu: familyTypeString = "MDU"; break;
  216:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu: familyTypeString = "GMDU"; break;
  217:                 default: familyTypeString = string.Empty; break;
  218:             }
  219:  
  220:             return familyTypeString;
  221:         }
  222:  
  223:         ////////////////////////////////////////////////////////////////////////////
  224:  
  225:         /// <summary>
  226:         /// 
  227:         /// </summary>
  228:         public static int PossibleNumberOfTdForOntFamilyType(int familyTypeId)
  229:         {
  230:             Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType;
  231:  
  232:             familyType = (Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType)familyTypeId;
  233:  
  234:             return PossibleNumberOfTdForOntFamilyType(familyType);
  235:         }
  236:  
  237:         ////////////////////////////////////////////////////////////////////////////
  238:  
  239:         /// <summary>
  240:         /// 
  241:         /// </summary>
  242:         public static int PossibleNumberOfTdForOntFamilyType(Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType)
  243:         {
  244:             int number;
  245:  
  246:             switch (familyType)
  247:             {
  248:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu: number = 4; break;
  249:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu: number = 4; break;
  250:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho: number = 8; break;
  251:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu: number = 24; break;
  252:                 case Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu: number = 24; break;
  253:                 default: number = 0; break;
  254:             }
  255:  
  256:             return number;
  257:         }
  258:  
  259:         ////////////////////////////////////////////////////////////////////////////
  260:  
  261:         /// <summary>
  262:         /// Get the number of card-port for a parameter of familyType and td
  263:         /// </summary>
  264:         public static void ReturnOntPotsCardAndPortFromFamilyTypeAndTd(Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType, int td, out int card, out int port)
  265:         {
  266:             card = port = 0;
  267:  
  268:             if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu || familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu)
  269:             {
  270:                 if (td >= 1 && td <= 4)
  271:                 {
  272:                     card = 2; port = td;
  273:                 }
  274:             }
  275:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho)
  276:             {
  277:                 if (td >= 1 && td <= 8)
  278:                 {
  279:                     card = 2; port = td;
  280:                 }
  281:             }
  282:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu)
  283:             {
  284:                 if (td >= 1 && td <= 24)
  285:                 {
  286:                     if (td >= 1 && td <= 4 || td >= 13 && td <= 16)
  287:                     {
  288:                         card = 1;
  289:                         if (td <= 4) port = td;
  290:                         else port = td - 8;
  291:                     }
  292:                     else if (td >= 5 && td <= 8 || td >= 17 && td <= 20)
  293:                     {
  294:                         card = 2;
  295:                         if (td <= 8) port = td - 4;
  296:                         else port = td - 12;
  297:                     }
  298:                     else if (td >= 9 && td <= 12 || td >= 21 && td <= 24)
  299:                     {
  300:                         card = 3;
  301:                         if (td <= 12) port = td - 8;
  302:                         else port = td - 16;
  303:                     }
  304:                 }
  305:             }
  306:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu)
  307:             {
  308:                 if (td >= 1 && td <= 24)
  309:                 {
  310:                     card = 2;
  311:                     port = td;
  312:                 }
  313:             }
  314:         }
  315:  
  316:         ////////////////////////////////////////////////////////////////////////////
  317:  
  318:         /// <summary>
  319:         /// 
  320:         /// </summary>
  321:         public static List<string> PossiblePotsCardPortConfigurationForOntFamilyTypeList(Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType)
  322:         {
  323:             var list = new List<string>(100);
  324:  
  325:             /*
  326:              * see 
  327:         public static readonly int MaximumCardValue = 0;
  328:         public static readonly int MinimumCardValue = 0;
  329:         public static readonly int MaximumPortValue = 0;
  330:         public static readonly int MinimumPortValue = 0;
  331:              */
  332:  
  333:             if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu || familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu)
  334:             {
  335:                 list.Add("2-1");
  336:                 list.Add("2-2");
  337:                 list.Add("2-3");
  338:                 list.Add("2-4");
  339:             }
  340:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho)
  341:             {
  342:                 list.Add("2-1");
  343:                 list.Add("2-2");
  344:                 list.Add("2-3");
  345:                 list.Add("2-4");
  346:                 list.Add("2-5");
  347:                 list.Add("2-6");
  348:                 list.Add("2-7");
  349:                 list.Add("2-8");
  350:             }
  351:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu)
  352:             {
  353:                 list.Add("1-1");
  354:                 list.Add("1-2");
  355:                 list.Add("1-3");
  356:                 list.Add("1-4");
  357:                 list.Add("1-5");
  358:                 list.Add("1-6");
  359:                 list.Add("1-7");
  360:                 list.Add("1-8");
  361:  
  362:                 list.Add("2-1");
  363:                 list.Add("2-2");
  364:                 list.Add("2-3");
  365:                 list.Add("2-4");
  366:                 list.Add("2-5");
  367:                 list.Add("2-6");
  368:                 list.Add("2-7");
  369:                 list.Add("2-8");
  370:  
  371:                 list.Add("3-1");
  372:                 list.Add("3-2");
  373:                 list.Add("3-3");
  374:                 list.Add("3-4");
  375:                 list.Add("3-5");
  376:                 list.Add("3-6");
  377:                 list.Add("3-7");
  378:                 list.Add("3-8");
  379:             }
  380:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu)
  381:             {
  382:                 list.Add("2-1");
  383:                 list.Add("2-2");
  384:                 list.Add("2-3");
  385:                 list.Add("2-4");
  386:                 list.Add("2-5");
  387:                 list.Add("2-6");
  388:                 list.Add("2-7");
  389:                 list.Add("2-8");
  390:  
  391:                 list.Add("2-9");
  392:                 list.Add("2-10");
  393:                 list.Add("2-11");
  394:                 list.Add("2-12");
  395:                 list.Add("2-13");
  396:                 list.Add("2-14");
  397:                 list.Add("2-15");
  398:                 list.Add("2-16");
  399:  
  400:                 list.Add("2-17");
  401:                 list.Add("2-18");
  402:                 list.Add("2-19");
  403:                 list.Add("2-20");
  404:                 list.Add("2-21");
  405:                 list.Add("2-22");
  406:                 list.Add("2-23");
  407:                 list.Add("2-24");
  408:             }
  409:  
  410:             return list;
  411:         }
  412:  
  413:         ////////////////////////////////////////////////////////////////////////////
  414:  
  415:         /// <summary>
  416:         /// 
  417:         /// </summary>
  418:         public static List<string> PossibleHsiCardPortServiceConfigurationForOntFamilyTypeList(Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType familyType)
  419:         {
  420:             List<string> list;
  421:  
  422:             list = new List<string>(100);
  423:  
  424:             if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu || familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Soho)
  425:             {
  426:                 list.Add("1-1-1");
  427:                 list.Add("1-2-1");
  428:             }
  429:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gfu)
  430:             {
  431:                 list.Add("1-1-1");
  432:                 list.Add("1-2-1");
  433:                 list.Add("1-3-1");
  434:                 list.Add("1-4-1");
  435:             }
  436:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Mdu)
  437:             {
  438:                 list.Add("1-1-1");
  439:                 list.Add("1-2-1");
  440:                 list.Add("1-3-1");
  441:                 list.Add("1-4-1");
  442:                 list.Add("1-5-1");
  443:                 list.Add("1-6-1");
  444:                 list.Add("1-7-1");
  445:                 list.Add("1-8-1");
  446:                 list.Add("1-9-1");
  447:                 list.Add("1-10-1");
  448:                 list.Add("1-11-1");
  449:                 list.Add("1-12-1");
  450:             }
  451:             else if (familyType == Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType.Gmdu)
  452:             {
  453:                 // not verified
  454:  
  455:                 list.Add("1-1-1");
  456:                 list.Add("1-2-1");
  457:                 list.Add("1-3-1");
  458:                 list.Add("1-4-1");
  459:                 list.Add("1-5-1");
  460:                 list.Add("1-6-1");
  461:                 list.Add("1-7-1");
  462:                 list.Add("1-8-1");
  463:                 list.Add("1-9-1");
  464:                 list.Add("1-10-1");
  465:                 list.Add("1-11-1");
  466:                 list.Add("1-12-1");
  467:  
  468:                 list.Add("1-13-1");
  469:                 list.Add("1-14-1");
  470:                 list.Add("1-15-1");
  471:                 list.Add("1-16-1");
  472:                 list.Add("1-17-1");
  473:                 list.Add("1-18-1");
  474:                 list.Add("1-19-1");
  475:                 list.Add("1-20-1");
  476:                 list.Add("1-21-1");
  477:                 list.Add("1-22-1");
  478:                 list.Add("1-23-1");
  479:                 list.Add("1-24-1");
  480:             }
  481:  
  482:             return list;
  483:         }
  484:  
  485:         ////////////////////////////////////////////////////////////////////////////
  486:  
  487:         /// <summary>
  488:         /// 
  489:         /// </summary>
  490:         public static int PossibleNumberOfHsiCardPortServiceConfigurationForOntFamilyType(int familyType)
  491:         {
  492:             List<string> list;
  493:  
  494:             list = PossibleHsiCardPortServiceConfigurationForOntFamilyTypeList((Ia.Ngn.Cl.Model.Business.Nokia.Ont.FamilyType)familyType);
  495:  
  496:             return list.Count;
  497:         }
  498:  
  499:         ////////////////////////////////////////////////////////////////////////////
  500:  
  501:         /// <summary>
  502:         ///
  503:         /// </summary>
  504:         public static string OntPositionFromOntId(string ontId)
  505:         {
  506:             string rest, ontPosition, amsName;
  507:             int oltId, card, port, ont;
  508:  
  509:             oltId = int.Parse(ontId.Substring(0, 1 + 2 + 2 + 2 + 2)); // network id, site id, router id, odf id, olt id
  510:  
  511:             rest = Regex.Replace(ontId, "^" + oltId.ToString(), "");
  512:  
  513:             card = int.Parse(rest.Substring(4, 2));
  514:             port = int.Parse(rest.Substring(6, 2));
  515:             ont = int.Parse(rest.Substring(8, 2));
  516:  
  517:             amsName = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.AmsNameFromOltId(oltId);
  518:  
  519:             ontPosition = amsName + "-" + card + "-" + port + "-" + ont;
  520:  
  521:             return ontPosition;
  522:         }
  523:  
  524:         ////////////////////////////////////////////////////////////////////////////
  525:  
  526:         /// <summary>
  527:         ///
  528:         /// </summary>
  529:         public static bool IsValidSerialNumber(string serialNumber)
  530:         {
  531:             bool isValid;
  532:             string s;
  533:  
  534:             if (!string.IsNullOrEmpty(serialNumber))
  535:             {
  536:                 if (serialNumber.Length == 12) // ALCLA0A23C74
  537:                 {
  538:                     s = serialNumber.ToUpper();
  539:  
  540:                     if (s.Substring(0, 4) == "ALCL")
  541:                     {
  542:                         s = s.Substring(4, 8);
  543:  
  544:                         isValid = Ia.Cl.Model.Default.IsHex(s);
  545:                     }
  546:                     else isValid = false;
  547:                 }
  548:                 else isValid = false;
  549:             }
  550:             else isValid = false;
  551:  
  552:             return isValid;
  553:         }
  554:  
  555:         ////////////////////////////////////////////////////////////////////////////
  556:         ////////////////////////////////////////////////////////////////////////////
  557:     }
  558:  
  559:     ////////////////////////////////////////////////////////////////////////////
  560:     ////////////////////////////////////////////////////////////////////////////
  561: }