)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » EmsPort (Ia.Ftn.Cl.Model.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.Model.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:     ///
   20:     /// 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
   21:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   22:     ///
   23:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   24:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   25:     /// 
   26:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   27:     /// 
   28:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   29:     /// </remarks> 
   30:     public class EmsPort
   31:     {
   32:         /*
   33:          * iManager_NCE_V200R014C60_TL1_NBI_User_Guide_13.pdf
   34:          * 14.1.10 Querying the Information About a Port (LST-PORT)
   35:          * 
   36:          * Usage Note
   37:          * 
   38:          * 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.
   39:          * 
   40:          * 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 
   41:          * 
   42:          */
   43:  
   44:         /// <summary/>
   45:         //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 }
   46:  
   47:         /// <summary/>
   48:         public EmsPort() { }
   49:  
   50:         /// <summary/>
   51:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   52:         public string Id { get; set; }
   53:  
   54:         /// <summary>
   55:         /// ALIAS OCTET STRING SIZE (64) Indicates the alias for the port.
   56:         /// </summary>
   57:         public string ALIAS { get; set; }
   58:  
   59:         /// <summary>
   60:         /// DID INTEGER - Indicates the device ID. 
   61:         /// </summary>
   62:         public int DID { get; set; }
   63:  
   64:         /// <summary>
   65:         /// FN INTEGER 0-255 Indicates the subrack ID. 
   66:         /// </summary>
   67:         public int FN { get; set; }
   68:  
   69:         /// <summary>
   70:         /// SN INTEGER 0-35 Indicates the slot ID. 
   71:         /// </summary>
   72:         public int SN { get; set; }
   73:  
   74:         /// <summary>
   75:         /// PN INTEGER 0-63 Indicates the port ID. 
   76:         /// </summary>
   77:         public int PN { get; set; }
   78:  
   79:         /// <summary>
   80:         /// 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. 
   81:         /// </summary>
   82:         public string PT { get; set; }
   83:  
   84:         /// <summary>
   85:         /// PSTAT OCTET STRING See D.5 Parameters Related To the Port Status. Indicates the status of the port. 
   86:         /// </summary>
   87:         public string PSTAT { get; set; }
   88:  
   89:         /// <summary>
   90:         /// NAME OCTET STRING SIZE (64) Indicates the port name. 
   91:         /// </summary>
   92:         public string NAME { get; set; }
   93:  
   94:         /// <summary>
   95:         /// PSPEED OCTET STRING SIZE (64) Indicates the port rate. Unit: bit/s. 
   96:         /// </summary>
   97:         public string PSPEED { get; set; }
   98:  
   99:         /// <summary>
  100:         /// PDIRECT OCTET STRING bidirectional Indicates the port direction. 
  101:         /// </summary>
  102:         public string PDIRECT { get; set; }
  103:  
  104:         /// <summary>
  105:         /// 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. 
  106:         /// </summary>
  107:         public string LOOPSTAT { get; set; }
  108:  
  109:         /// <summary>
  110:         /// TESTSTAT OCTET STRING l noTest l Test l unknown Indicates the test status of a port.
  111:         /// </summary>
  112:         public string TESTSTAT { get; set; }
  113:  
  114:         /// <summary>
  115:         /// FEC OCTET STRING l enable l disable l unknown Specifies whether the forward error correction (FEC) function is enabled. 
  116:         /// </summary>
  117:         public string FEC { get; set; }
  118:  
  119:         /// <summary>
  120:         /// RN OCTET STRING SIZE (64) Indicates the rack identifier. 
  121:         /// </summary>
  122:         public string RN { get; set; }
  123:  
  124:         /// <summary>
  125:         /// 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
  126:         /// </summary>
  127:         public string AState { get; set; }
  128:  
  129:         /// <summary/>
  130:         public DateTime Created { get; set; }
  131:  
  132:         /// <summary/>
  133:         public DateTime Updated { get; set; }
  134:  
  135:         /// <summary/>
  136:         [ForeignKey("EmsBoard_Id")]
  137:         public virtual Ia.Ftn.Cl.Model.Huawei.EmsBoard EmsBoard { get; set; }
  138:  
  139:         /// <summary/>
  140:         public virtual ICollection<Ia.Ftn.Cl.Model.Huawei.EmsOnt> EmsOnts { get; set; }
  141:  
  142:         ////////////////////////////////////////////////////////////////////////////
  143:  
  144:         /// <summary>
  145:         ///
  146:         /// </summary>
  147:         public bool Equal(Ia.Ftn.Cl.Model.Huawei.EmsPort b)
  148:         {
  149:             // below: this will not check the Id, Created, Updated fields
  150:             bool areEqual;
  151:  
  152:             if (this.ALIAS != b.ALIAS) areEqual = false;
  153:             else if (this.DID != b.DID) areEqual = false;
  154:             else if (this.FN != b.FN) areEqual = false;
  155:             else if (this.SN != b.SN) areEqual = false;
  156:             else if (this.PN != b.PN) areEqual = false;
  157:             else if (this.PT != b.PT) areEqual = false;
  158:             else if (this.PSTAT != b.PSTAT) areEqual = false;
  159:             else if (this.NAME != b.NAME) areEqual = false;
  160:             else if (this.PSPEED != b.PSPEED) areEqual = false;
  161:             else if (this.PDIRECT != b.PDIRECT) areEqual = false;
  162:             else if (this.LOOPSTAT != b.LOOPSTAT) areEqual = false;
  163:             else if (this.TESTSTAT != b.TESTSTAT) areEqual = false;
  164:             else if (this.FEC != b.FEC) areEqual = false;
  165:             else if (this.RN != b.RN) areEqual = false;
  166:             else if (this.AState != b.AState) areEqual = false;
  167:             else if (this.EmsBoard.Id != b.EmsBoard.Id) areEqual = false;
  168:             else areEqual = true;
  169:  
  170:             return areEqual;
  171:         }
  172:  
  173:         ////////////////////////////////////////////////////////////////////////////
  174:  
  175:         /// <summary>
  176:         ///
  177:         /// </summary>
  178:         public bool Update(Ia.Ftn.Cl.Model.Huawei.EmsPort updatedItem)
  179:         {
  180:             // below: this will not update Id, Created
  181:             bool updated;
  182:  
  183:             updated = false;
  184:  
  185:             if (this.ALIAS != updatedItem.ALIAS) { this.ALIAS = updatedItem.ALIAS; updated = true; }
  186:             if (this.DID != updatedItem.DID) { this.DID = updatedItem.DID; updated = true; }
  187:             if (this.FN != updatedItem.FN) { this.FN = updatedItem.FN; updated = true; }
  188:             if (this.SN != updatedItem.SN) { this.SN = updatedItem.SN; updated = true; }
  189:             if (this.PN != updatedItem.PN) { this.PN = updatedItem.PN; updated = true; }
  190:             if (this.PT != updatedItem.PT) { this.PT = updatedItem.PT; updated = true; }
  191:             if (this.PSTAT != updatedItem.PSTAT) { this.PSTAT = updatedItem.PSTAT; updated = true; }
  192:             if (this.NAME != updatedItem.NAME) { this.NAME = updatedItem.NAME; updated = true; }
  193:             if (this.PSPEED != updatedItem.PSPEED) { this.PSPEED = updatedItem.PSPEED; updated = true; }
  194:             if (this.PDIRECT != updatedItem.PDIRECT) { this.PDIRECT = updatedItem.PDIRECT; updated = true; }
  195:             if (this.LOOPSTAT != updatedItem.LOOPSTAT) { this.LOOPSTAT = updatedItem.LOOPSTAT; updated = true; }
  196:             if (this.TESTSTAT != updatedItem.TESTSTAT) { this.TESTSTAT = updatedItem.TESTSTAT; updated = true; }
  197:             if (this.FEC != updatedItem.FEC) { this.FEC = updatedItem.FEC; updated = true; }
  198:             if (this.RN != updatedItem.RN) { this.RN = updatedItem.RN; updated = true; }
  199:             if (this.AState != updatedItem.AState) { this.AState = updatedItem.AState; updated = true; }
  200:             if (this.EmsBoard != updatedItem.EmsBoard) { this.EmsBoard = updatedItem.EmsBoard; updated = true; }
  201:  
  202:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  203:  
  204:             return updated;
  205:         }
  206:  
  207:         ////////////////////////////////////////////////////////////////////////////
  208:         ////////////////////////////////////////////////////////////////////////////
  209:  
  210:         /// <summary>
  211:         ///
  212:         /// </summary>
  213:         public string ToSimpleTextString()
  214:         {
  215:             return Ia.Ftn.Cl.Model.Data.Huawei.Port.ToSimpleTextString(this);
  216:         }
  217:  
  218:         ////////////////////////////////////////////////////////////////////////////
  219:         ////////////////////////////////////////////////////////////////////////////
  220:     }
  221:  
  222:     ////////////////////////////////////////////////////////////////////////////
  223:     ////////////////////////////////////////////////////////////////////////////
  224: }