)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » EmsPort (Ia.Ftn.Cl.Models.Huawei)

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

Huawei's EMS Port Entity Framework class for Fixed Telecommunications Network (FTN) entity model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.ComponentModel.DataAnnotations;
    4: using System.ComponentModel.DataAnnotations.Schema;
    5: using System.Linq;
    6: using System.Threading;
    7: using System.Threading.Tasks;
    8:  
    9: namespace Ia.Ftn.Cl.Models.Huawei
   10: {
   11:     ////////////////////////////////////////////////////////////////////////////
   12:  
   13:     /// <summary publish="true">
   14:     /// Huawei's EMS Port Entity Framework class for Fixed Telecommunications Network (FTN) entity model.
   15:     /// </summary>
   16:     /// 
   17:     /// <remarks> 
   18:     /// Copyright © 2016-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   19:     /// </remarks> 
   20:     public class EmsPort
   21:     {
   22:         /*
   23:          * iManager_NCE_V200R014C60_TL1_NBI_User_Guide_13.pdf
   24:          * 14.1.10 Querying the Information About a Port (LST-PORT)
   25:          * 
   26:          * Usage Note
   27:          * 
   28:          * The DEV (IP address of an OLT) and ONULOCATEINFO parameters can be used as the location information. Before using these two parameters as the location information, make sure that the DEV parameter indicates the IP address of the device. For details, see C.7 How to Locate a Device According to the IP Address.
   29:          * 
   30:          * Command Format LST-PORT::[ALIAS=Port-Alias][,](DID=Device-ID|DEV=Device-name|(DEV=device-oltipaddress,ONULOCATEINFO=onu-locate-infomation))[,FN=Frame-num[,SN=Slotnum[,PN=Port-num]]][,PT=Port-type][,PSTAT=Port-status]:CTAG::[SHOWOPTION=option 
   31:          * 
   32:          */
   33:  
   34:         /// <summary/>
   35:         //public enum ServiceTypeList { IMPU = 1, TEMPLATEIDX, DSPIDX, LP, CSC, UNAME, VCCFLAG, VTFLAG, NSCFU, NSCFUVM, NSCFB, NSCFBVM, NSCFNR, NSCFNRVM, NSCFNL, NSCFNLVM, NSCD, NSCDVM, NSCFNRC, NSCFNRCVM, NSCLIP, NSCIDCW, NSRIO, NSCNIP, NSCLIR, NSRIP, NSCNIR, NSRID, NSNRID, NSRND, NSNRND, NSCW, NSCCW, NSOIP, NSACRM, NSGOIR, NSMOIR, NSTIP, NSTIR, NSOTIR, NSCLIPNOSCREENING, NSCR, NSWAKE_UP, NSAOC_D, NSAOC_E, NSXEXH, NSXEGJ, NSCWCFNR, NSIIFC, NSDN_CALL_OUT_BAR, NSCCBS, NSCCNR, NSCCBSR, NSCCNRR, NS3PTY, NSNPTY, NSDND, NSMCR, NSCBA, NSTMP_LIN, NSCODEC_CNTRL, NSMWI, NSDC, NSHOLD, NSECT, NSCFTB, NSDAN, NSSTOP_SECRET, NSMCID, NSEBO, NSICO, NSOUTG, NSINQYH, NSUINFO, NSDN_CALL_OUT_ALLOW, NSSIC, NSSOC, NSSETCFNRTIME, NSCFS, NSCFSB, NSFAX, NSABRC, NSACRTOVM, NSPREPAID, NSCRBT, NSICB, NSMRINGING, NSCIS, NSCBEG, NSCOLP, NSCOLR, NSCOLPOVR, NSBAOC, NSBOIC, NSBOICEXHC, NSBAIC, NSBICROM, NSSPEED_DIAL, NSSD1D, NSSD2D, NSGRNCALL, NSCPARK, NSGAA, NSQSNS, NSMSN, NSHOTLINE, NSAOC_S, NSNIGHTSRV, NSBACKNUM, NSAUTOCON, NSCAMPON, NSCTD, NSCLICKHOLD, NSQUEUE, NSSANSWER, NSICENCF, NSCFGO, NSCECT, NSCTGO, NSCTIO, NSSETBUSY, NSOVERSTEP, NSABSENT, NSMONITOR, NSFMONITOR, NSDISCNT, NSFDISCNT, NSINSERT, NSFINSERT, NSASI, NSPWCB, NSRD, NSLCPS, NSNCPS, NSICPS, NSCBCLOCK, NSMINIBAR, NSMCN, NSDSTR, NSOPRREG, NSONEKEY, NSINBOUND, NSOUTBOUND, NSCALLERID, NSCUN, NSIPTVVC, NSNP, NSSEC, NSSECSTA, NSHRCN, NSSB, NSOCCR, LCO, LC, LCT, NTT, ITT, ICTX, OCTX, INTT, IITT, ICLT, ICDDD, ICIDD, IOLT, CTLCO, CTLCT, CTLD, CTINTNANP, CTINTWORLD, CTDA, CTOSM, CTOSP, CTOSP1, CCO1, CCO2, CCO3, CCO4, CCO5, CCO6, CCO7, CCO8, CCO9, CCO10, CCO11, CCO12, CCO13, CCO14, CCO15, CCO16, HIGHENTCO, OPERATOR, SUPYSRV, IDDCI, NTCI, LTCI, RSC, CIG, OUTRST, INRST, NOAT, RINGCOUNT, VMAIND, VDMAIND, TGRP, TIDHLD, TIDCW, SCF, LMTGRP, FLBGRP, SLBGRP, COP, G711_64K_A_LAW, G711_64K_U_LAW, G722, G723, G726, G728, G729, CODEC_MP4A, CODEC2833, CODEC2198, G726_40, G726_32, G726_24, G726_16, AMR, CLEARMODE, ILBC, SPEEX, G729EV, EVRC, EVRCB, H261, H263, CODEC_MP4V, H264, T38, T120, G711A_VBD, G711U_VBD, G726_VBD, G726_40_VBD, G726_32_VBD, G726_24_VBD, G726_16_VBD, WIND_BAND_AMR, GSM610, H263_2000, BROADVOICE_32, UNKNOWN_CODEC, ACODEC, VCODEC, POLIDX, NCPI, ICPI, EBOCL, EBOPL, EBOIT, RM, CPC, PCHG, TFPT, CHT, MCIDMODE, MCIDCMODE, MCIDAMODE, PREPAIDIDX, CRBTID, ODBBICTYPE, ODBBOCTYPE, ODBBARTYPE, ODBSS, ODBBRCFTYPE, PNOTI, MAXPARACALL, ATSDTMBUSY, CALLCOUNT, CDNOTICALLER, ISCHGFLAG, CHC, CUSER, CGRP, CUSERGRP, STCF, CHARSC, REGUIDX, SOCBFUNC, SOCBPTONEIDX, ADMINCBA, ADCONTROL_DIVERSION, DPR, PRON, CPCRUS, CUSCAT, SPT100REL }
   36:  
   37:         /// <summary/>
   38:         public EmsPort() { }
   39:  
   40:         /// <summary/>
   41:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   42:         public string Id { get; set; }
   43:  
   44:         /// <summary>
   45:         /// ALIAS OCTET STRING SIZE (64) Indicates the alias for the port.
   46:         /// </summary>
   47:         public string ALIAS { get; set; }
   48:  
   49:         /// <summary>
   50:         /// DID INTEGER - Indicates the device ID. 
   51:         /// </summary>
   52:         public int DID { get; set; }
   53:  
   54:         /// <summary>
   55:         /// FN INTEGER 0-255 Indicates the subrack ID. 
   56:         /// </summary>
   57:         public int FN { get; set; }
   58:  
   59:         /// <summary>
   60:         /// SN INTEGER 0-35 Indicates the slot ID. 
   61:         /// </summary>
   62:         public int SN { get; set; }
   63:  
   64:         /// <summary>
   65:         /// PN INTEGER 0-63 Indicates the port ID. 
   66:         /// </summary>
   67:         public int PN { get; set; }
   68:  
   69:         /// <summary>
   70:         /// PT OCTET STRING See D.4 Parameters Related To the Port Type. Indicates the type of the port. NA: If the displayed port type is not included in the list of port types, the character string "NA(subtype of the port)" is displayed. For example, if the BRUS type is not included in the list of port types, "NA(BRUS)" is displayed for the corresponding port. 
   71:         /// </summary>
   72:         public string PT { get; set; }
   73:  
   74:         /// <summary>
   75:         /// PSTAT OCTET STRING See D.5 Parameters Related To the Port Status. Indicates the status of the port. 
   76:         /// </summary>
   77:         public string PSTAT { get; set; }
   78:  
   79:         /// <summary>
   80:         /// NAME OCTET STRING SIZE (64) Indicates the port name. 
   81:         /// </summary>
   82:         public string NAME { get; set; }
   83:  
   84:         /// <summary>
   85:         /// PSPEED OCTET STRING SIZE (64) Indicates the port rate. Unit: bit/s. 
   86:         /// </summary>
   87:         public string PSPEED { get; set; }
   88:  
   89:         /// <summary>
   90:         /// PDIRECT OCTET STRING bidirectional Indicates the port direction. 
   91:         /// </summary>
   92:         public string PDIRECT { get; set; }
   93:  
   94:         /// <summary>
   95:         /// LOOPSTAT OCTET STRING l noLoop l remoteLoop l localLoop l unknown Indicates the loopback status of a port. Options are as follows: l noLoop: no loopback l remoteLoop: remote loopback l localLoop: local loopback l unknown: The loopback status is unknown. 
   96:         /// </summary>
   97:         public string LOOPSTAT { get; set; }
   98:  
   99:         /// <summary>
  100:         /// TESTSTAT OCTET STRING l noTest l Test l unknown Indicates the test status of a port.
  101:         /// </summary>
  102:         public string TESTSTAT { get; set; }
  103:  
  104:         /// <summary>
  105:         /// FEC OCTET STRING l enable l disable l unknown Specifies whether the forward error correction (FEC) function is enabled. 
  106:         /// </summary>
  107:         public string FEC { get; set; }
  108:  
  109:         /// <summary>
  110:         /// RN OCTET STRING SIZE (64) Indicates the rack identifier. 
  111:         /// </summary>
  112:         public string RN { get; set; }
  113:  
  114:         /// <summary>
  115:         /// AState OCTET STRING l up l down l testing Indicates the management status of a port. Options are as follows: l up: activated l down: deactivated
  116:         /// </summary>
  117:         public string AState { get; set; }
  118:  
  119:         /// <summary/>
  120:         public DateTime Created { get; set; }
  121:  
  122:         /// <summary/>
  123:         public DateTime Updated { get; set; }
  124:  
  125:         /// <summary/>
  126:         [ForeignKey("EmsBoard_Id")]
  127:         public virtual Ia.Ftn.Cl.Models.Huawei.EmsBoard EmsBoard { get; set; }
  128:  
  129:         /// <summary/>
  130:         public virtual ICollection<Ia.Ftn.Cl.Models.Huawei.EmsOnt> EmsOnts { get; set; }
  131:  
  132:         ////////////////////////////////////////////////////////////////////////////
  133:  
  134:         /// <summary>
  135:         ///
  136:         /// </summary>
  137:         public bool Equal(Ia.Ftn.Cl.Models.Huawei.EmsPort b)
  138:         {
  139:             // below: this will not check the Id, Created, Updated fields
  140:             bool areEqual;
  141:  
  142:             if (this.ALIAS != b.ALIAS) areEqual = false;
  143:             else if (this.DID != b.DID) areEqual = false;
  144:             else if (this.FN != b.FN) areEqual = false;
  145:             else if (this.SN != b.SN) areEqual = false;
  146:             else if (this.PN != b.PN) areEqual = false;
  147:             else if (this.PT != b.PT) areEqual = false;
  148:             else if (this.PSTAT != b.PSTAT) areEqual = false;
  149:             else if (this.NAME != b.NAME) areEqual = false;
  150:             else if (this.PSPEED != b.PSPEED) areEqual = false;
  151:             else if (this.PDIRECT != b.PDIRECT) areEqual = false;
  152:             else if (this.LOOPSTAT != b.LOOPSTAT) areEqual = false;
  153:             else if (this.TESTSTAT != b.TESTSTAT) areEqual = false;
  154:             else if (this.FEC != b.FEC) areEqual = false;
  155:             else if (this.RN != b.RN) areEqual = false;
  156:             else if (this.AState != b.AState) areEqual = false;
  157:             else if (this.EmsBoard.Id != b.EmsBoard.Id) areEqual = false;
  158:             else areEqual = true;
  159:  
  160:             return areEqual;
  161:         }
  162:  
  163:         ////////////////////////////////////////////////////////////////////////////
  164:  
  165:         /// <summary>
  166:         ///
  167:         /// </summary>
  168:         public bool Update(Ia.Ftn.Cl.Models.Huawei.EmsPort updatedItem)
  169:         {
  170:             // below: this will not update Id, Created
  171:             bool updated;
  172:  
  173:             updated = false;
  174:  
  175:             if (this.ALIAS != updatedItem.ALIAS) { this.ALIAS = updatedItem.ALIAS; updated = true; }
  176:             if (this.DID != updatedItem.DID) { this.DID = updatedItem.DID; updated = true; }
  177:             if (this.FN != updatedItem.FN) { this.FN = updatedItem.FN; updated = true; }
  178:             if (this.SN != updatedItem.SN) { this.SN = updatedItem.SN; updated = true; }
  179:             if (this.PN != updatedItem.PN) { this.PN = updatedItem.PN; updated = true; }
  180:             if (this.PT != updatedItem.PT) { this.PT = updatedItem.PT; updated = true; }
  181:             if (this.PSTAT != updatedItem.PSTAT) { this.PSTAT = updatedItem.PSTAT; updated = true; }
  182:             if (this.NAME != updatedItem.NAME) { this.NAME = updatedItem.NAME; updated = true; }
  183:             if (this.PSPEED != updatedItem.PSPEED) { this.PSPEED = updatedItem.PSPEED; updated = true; }
  184:             if (this.PDIRECT != updatedItem.PDIRECT) { this.PDIRECT = updatedItem.PDIRECT; updated = true; }
  185:             if (this.LOOPSTAT != updatedItem.LOOPSTAT) { this.LOOPSTAT = updatedItem.LOOPSTAT; updated = true; }
  186:             if (this.TESTSTAT != updatedItem.TESTSTAT) { this.TESTSTAT = updatedItem.TESTSTAT; updated = true; }
  187:             if (this.FEC != updatedItem.FEC) { this.FEC = updatedItem.FEC; updated = true; }
  188:             if (this.RN != updatedItem.RN) { this.RN = updatedItem.RN; updated = true; }
  189:             if (this.AState != updatedItem.AState) { this.AState = updatedItem.AState; updated = true; }
  190:             if (this.EmsBoard != updatedItem.EmsBoard) { this.EmsBoard = updatedItem.EmsBoard; updated = true; }
  191:  
  192:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  193:  
  194:             return updated;
  195:         }
  196:  
  197:         ////////////////////////////////////////////////////////////////////////////
  198:         ////////////////////////////////////////////////////////////////////////////
  199:  
  200:         /// <summary>
  201:         ///
  202:         /// </summary>
  203:         public string ToSimpleTextString()
  204:         {
  205:             return Ia.Ftn.Cl.Models.Data.Huawei.Port.ToSimpleTextString(this);
  206:         }
  207:  
  208:         ////////////////////////////////////////////////////////////////////////////
  209:         ////////////////////////////////////////////////////////////////////////////
  210:     }
  211:  
  212:     ////////////////////////////////////////////////////////////////////////////
  213:     ////////////////////////////////////////////////////////////////////////////
  214: }