)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » EmsBoard (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 Board 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 Board Entity Framework class for Fixed Telecommunications Network (FTN) entity model.
   15:     /// </summary>
   16:     /// 
   17:     /// <remarks> 
   18:     /// Copyright © 2017-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 EmsBoard
   31:     {
   32:         /*
   33:          * iManager_NCE_V200R014C60_TL1_NBI_User_Guide_13.pdf
   34:          * 14.1.7 Querying the Information About a Board (LST-BOARD)
   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-BOARD::(DID=Device-ID|DEV=Device-name|(DEV=device-oltipaddress,ONULOCATEINFO=onu-locate-infomation))[,FN=Frame-num[,SN=Slot-num]] [,BT=board-type]:CTAG::[SHOWOPTION=optionof result's attributes];
   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 EmsBoard() { }
   49:  
   50:         /// <summary/>
   51:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   52:         public string Id { get; set; }
   53:  
   54:         /// <summary>
   55:         /// DID INTEGER - Indicates the device ID. 
   56:         /// </summary>
   57:         public int DID { get; set; }
   58:  
   59:         /// <summary>
   60:         /// FN INTEGER 0-255 Indicates the subrack ID.
   61:         /// </summary>
   62:         public int FN { get; set; }
   63:  
   64:         /// <summary>
   65:         /// SN INTEGER 0-35 Indicates the slot ID. 
   66:         /// </summary>
   67:         public int SN { get; set; }
   68:  
   69:         /// <summary>
   70:         /// BT OCTET STRING See D.2 Parameters Related To the Board Type. Indicates the type of the board. 
   71:         /// </summary>
   72:         public string BT { get; set; }
   73:  
   74:         /// <summary>
   75:         /// BVER OCTET STRING SIZE (64) Indicates the version of the board. 
   76:         /// </summary>
   77:         public string BVER { get; set; }
   78:  
   79:         /// <summary>
   80:         /// BSTAT OCTET STRING l Unknown l Uninstall l Normal l Fault l Forbidden l Discovery l Config l Offline l Abnormal Indicates the status of the board. 
   81:         /// </summary>
   82:         public string BSTAT { get; set; }
   83:  
   84:         /// <summary>
   85:         /// DEV OCTET STRING SIZE (192) Indicates the device name. By default, this parameter is not displayed. It is displayed only after you enter SHOWOPTION=DEV in the command. Indicates the device name by default. If the value of the configuration item DEVMEAN is 1, the DEV parameter indicates the IP address of the device. For details about how to modify configuration items, see C.7 How to Locate a Device According to the IP Address. 
   86:         /// </summary>
   87:         public string DEV { get; set; }
   88:  
   89:         /// <summary>
   90:         /// BNAME OCTET STRING SIZE (32) Indicates the subtype of the board. 
   91:         /// </summary>
   92:         public string BNAME { get; set; }
   93:  
   94:         /// <summary>
   95:         /// NAME OCTET STRING SIZE (255) Indicates the board name. 
   96:         /// </summary>
   97:         public string NAME { get; set; }
   98:  
   99:         /// <summary>
  100:         /// ALIAS OCTET STRING SIZE (64) Indicates the alias for the board. 
  101:         /// </summary>
  102:         public string ALIAS { get; set; }
  103:  
  104:         /// <summary>
  105:         /// ELABEL OCTET STRING SIZE (255) Indicates the sequence number of the board. 
  106:         /// </summary>
  107:         public string ELABEL { get; set; }
  108:  
  109:         /// <summary>
  110:         /// PCBVER OCTET STRING SIZE (255) Indicates the hardware version of the board.
  111:         /// </summary>
  112:         public string PCBVER { get; set; }
  113:  
  114:         /// <summary>
  115:         /// SWVER OCTET STRING SIZE (255) Indicates the software version of the board. 
  116:         /// </summary>
  117:         public string SWVER { get; set; }
  118:  
  119:         /// <summary>
  120:         /// ROLE OCTET STRING SIZE (255) Indicates the role of the board. The options are as follows: l UP: Indicates upstream transmission. l CAS: Indicates subtend. 
  121:         /// </summary>
  122:         public string ROLE { get; set; }
  123:  
  124:         /// <summary>
  125:         /// ALARM OCTET STRING l CRITICAL l MAJOR l MINOR l WARNING Indicates the alarm status of a board. Options are as follows: l CRITICAL: critical alarms l MAJOR: major alarms l MINOR: minor alarms l WARNING: warnings 
  126:         /// </summary>
  127:         public string ALARM { get; set; }
  128:  
  129:         /// <summary>
  130:         /// ST OCTET STRING l VOIP l ALL Indicates the service types that are supported by a board. Options are as follows: l VOIP: A board that houses POTS ports. POTS ports are used to carry voice over IP (VOIP) services. l ALL: A Board that houses other ports. 
  131:         /// </summary>
  132:         public string ST { get; set; }
  133:  
  134:         /// <summary>
  135:         /// PROTECTMODE OCTET STRING NONE Indicates the protection mode of a board. 
  136:         /// </summary>
  137:         public string PROTECTMODE { get; set; }
  138:  
  139:         /// <summary>
  140:         /// PORTCOUNT OCTET STRING SIZE(32) Indicates the port quantity on a board. 
  141:         /// </summary>
  142:         public string PORTCOUNT { get; set; }
  143:  
  144:         /// <summary>
  145:         /// PORTTYPE OCTET STRING Table D-4 Indicates the port type on a board. 
  146:         /// </summary>
  147:         public string PORTTYPE { get; set; }
  148:  
  149:         /// <summary>
  150:         /// WORKMODE OCTET STRING l active l standby l — Indicates the working mode of a board. Options are as follows: l active: active control board l standby: standby control board l —: non-control board 
  151:         /// </summary>
  152:         public string WORKMODE { get; set; }
  153:  
  154:         /// <summary>
  155:         /// REPLACE OCTET STRING Yes Specifies whether a board is replaceable.
  156:         /// </summary>
  157:         public string REPLACE { get; set; }
  158:  
  159:         /// <summary/>
  160:         public DateTime Created { get; set; }
  161:  
  162:         /// <summary/>
  163:         public DateTime Updated { get; set; }
  164:  
  165:         /// <summary/>
  166:         [ForeignKey("EmsDev_Id")]
  167:         public virtual Ia.Ftn.Cl.Models.Huawei.EmsDev EmsDev { get; set; }
  168:  
  169:         /// <summary/>
  170:         public virtual ICollection<Ia.Ftn.Cl.Models.Huawei.EmsPort> EmsPorts { get; set; }
  171:  
  172:         ////////////////////////////////////////////////////////////////////////////
  173:  
  174:         /// <summary>
  175:         ///
  176:         /// </summary>
  177:         public bool Equal(Ia.Ftn.Cl.Models.Huawei.EmsBoard b)
  178:         {
  179:             // below: this will not check the Id, Created, Updated fields
  180:             bool areEqual;
  181:  
  182:             if (this.DID != b.DID) areEqual = false;
  183:             else if (this.FN != b.FN) areEqual = false;
  184:             else if (this.SN != b.SN) areEqual = false;
  185:             else if (this.BT != b.BT) areEqual = false;
  186:             else if (this.BVER != b.BVER) areEqual = false;
  187:             else if (this.BSTAT != b.BSTAT) areEqual = false;
  188:             else if (this.DEV != b.DEV) areEqual = false;
  189:             else if (this.BNAME != b.BNAME) areEqual = false;
  190:             else if (this.NAME != b.NAME) areEqual = false;
  191:             else if (this.ALIAS != b.ALIAS) areEqual = false;
  192:             else if (this.ELABEL != b.ELABEL) areEqual = false;
  193:             else if (this.PCBVER != b.PCBVER) areEqual = false;
  194:             else if (this.SWVER != b.SWVER) areEqual = false;
  195:             else if (this.ROLE != b.ROLE) areEqual = false;
  196:             else if (this.ALARM != b.ALARM) areEqual = false;
  197:             else if (this.ST != b.ST) areEqual = false;
  198:             else if (this.PROTECTMODE != b.PROTECTMODE) areEqual = false;
  199:             else if (this.PORTCOUNT != b.PORTCOUNT) areEqual = false;
  200:             else if (this.PORTTYPE != b.PORTTYPE) areEqual = false;
  201:             else if (this.WORKMODE != b.WORKMODE) areEqual = false;
  202:             else if (this.REPLACE != b.REPLACE) areEqual = false;
  203:             else if (this.EmsDev.Id != b.EmsDev.Id) areEqual = false;
  204:             else areEqual = true;
  205:  
  206:             return areEqual;
  207:         }
  208:  
  209:         ////////////////////////////////////////////////////////////////////////////
  210:  
  211:         /// <summary>
  212:         ///
  213:         /// </summary>
  214:         public bool Update(Ia.Ftn.Cl.Models.Huawei.EmsBoard updatedItem)
  215:         {
  216:             // below: this will not update Id, Created
  217:             bool updated;
  218:  
  219:             updated = false;
  220:  
  221:             if (this.DID != updatedItem.DID) { this.DID = updatedItem.DID; updated = true; }
  222:             if (this.FN != updatedItem.FN) { this.FN = updatedItem.FN; updated = true; }
  223:             if (this.SN != updatedItem.SN) { this.SN = updatedItem.SN; updated = true; }
  224:             if (this.BT != updatedItem.BT) { this.BT = updatedItem.BT; updated = true; }
  225:             if (this.BVER != updatedItem.BVER) { this.BVER = updatedItem.BVER; updated = true; }
  226:             if (this.BSTAT != updatedItem.BSTAT) { this.BSTAT = updatedItem.BSTAT; updated = true; }
  227:             if (this.DEV != updatedItem.DEV) { this.DEV = updatedItem.DEV; updated = true; }
  228:             if (this.BNAME != updatedItem.BNAME) { this.BNAME = updatedItem.BNAME; updated = true; }
  229:             if (this.NAME != updatedItem.NAME) { this.NAME = updatedItem.NAME; updated = true; }
  230:             if (this.ALIAS != updatedItem.ALIAS) { this.ALIAS = updatedItem.ALIAS; updated = true; }
  231:             if (this.ELABEL != updatedItem.ELABEL) { this.ELABEL = updatedItem.ELABEL; updated = true; }
  232:             if (this.PCBVER != updatedItem.PCBVER) { this.PCBVER = updatedItem.PCBVER; updated = true; }
  233:             if (this.SWVER != updatedItem.SWVER) { this.SWVER = updatedItem.SWVER; updated = true; }
  234:             if (this.ROLE != updatedItem.ROLE) { this.ROLE = updatedItem.ROLE; updated = true; }
  235:             if (this.ALARM != updatedItem.ALARM) { this.ALARM = updatedItem.ALARM; updated = true; }
  236:             if (this.ST != updatedItem.ST) { this.ST = updatedItem.ST; updated = true; }
  237:             if (this.PROTECTMODE != updatedItem.PROTECTMODE) { this.PROTECTMODE = updatedItem.PROTECTMODE; updated = true; }
  238:             if (this.PORTCOUNT != updatedItem.PORTCOUNT) { this.PORTCOUNT = updatedItem.PORTCOUNT; updated = true; }
  239:             if (this.PORTTYPE != updatedItem.PORTTYPE) { this.PORTTYPE = updatedItem.PORTTYPE; updated = true; }
  240:             if (this.WORKMODE != updatedItem.WORKMODE) { this.WORKMODE = updatedItem.WORKMODE; updated = true; }
  241:             if (this.REPLACE != updatedItem.REPLACE) { this.REPLACE = updatedItem.REPLACE; updated = true; }
  242:             if (this.EmsDev != updatedItem.EmsDev) { this.EmsDev = updatedItem.EmsDev; updated = true; }
  243:  
  244:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  245:  
  246:             return updated;
  247:         }
  248:  
  249:         ////////////////////////////////////////////////////////////////////////////
  250:         ////////////////////////////////////////////////////////////////////////////
  251:  
  252:         /// <summary>
  253:         ///
  254:         /// </summary>
  255:         public string ToSimpleTextString()
  256:         {
  257:             return Ia.Ftn.Cl.Models.Data.Huawei.Board.ToSimpleTextString(this);
  258:         }
  259:  
  260:         ////////////////////////////////////////////////////////////////////////////
  261:         ////////////////////////////////////////////////////////////////////////////
  262:     }
  263:  
  264:     ////////////////////////////////////////////////////////////////////////////
  265:     ////////////////////////////////////////////////////////////////////////////
  266: }