Exemplo n.º 1
0
        public UpdateResult TestApplyDeltaInsert()
        {
            string message = "Apply update method started.";

            Console.WriteLine(message);
            CommonTrace.WriteTrace(CommonTrace.TraceInfo, message);


            UpdateResult updateResult = null;

            try
            {
                Dictionary <DMSType, ResourceDescription> updates = CreateResourcesToInsert();
                Delta delta = new Delta();

                foreach (ResourceDescription rd in updates.Values)
                {
                    delta.AddDeltaOperation(DeltaOpType.Insert, rd, true);
                }

                updateResult = GdaQueryProxy.ApplyUpdate(delta);

                message = "Apply update method finished. \n" + updateResult.ToString();
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceInfo, message);
            }
            catch (Exception ex)
            {
                message = string.Format("Apply update method failed. {0}\n", ex.Message);

                if (updateResult != null)
                {
                    message += updateResult.ToString();
                }

                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(updateResult);
        }
Exemplo n.º 2
0
        public UpdateResult TestApplyDeltaDelete(List <long> gids)
        {
            string message = "Testing apply delta delete method started.";

            Console.WriteLine(message);
            CommonTrace.WriteTrace(CommonTrace.TraceInfo, message);

            UpdateResult updateResult = null;

            try
            {
                Delta delta            = new Delta();
                ResourceDescription rd = null;

                foreach (long gid in gids)
                {
                    rd = new ResourceDescription(gid);
                    delta.AddDeltaOperation(DeltaOpType.Delete, rd, true);
                }

                updateResult = GdaQueryProxy.ApplyUpdate(delta);

                message = "Testing apply delta delete method finished. \n" + updateResult.ToString();
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceInfo, message);
            }
            catch (Exception ex)
            {
                message = string.Format("Testing apply delta delete method failed. {0}\n", ex.Message);

                if (updateResult != null)
                {
                    message += updateResult.ToString();
                }

                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(updateResult);
        }
Exemplo n.º 3
0
        public List <Tuple <double, DateTime> > ReadMeasurementsFromDb(long gid, DateTime startTime, DateTime endTime)
        {
            List <Tuple <double, DateTime> > retVal = new List <Tuple <double, DateTime> >();

            try
            {
                var dataFromDb = DbManager.Instance.GetHistoryMeasurements().Where(x => x.Gid == gid && x.MeasurementTime >= startTime && x.MeasurementTime <= endTime).ToList();
                foreach (var item in dataFromDb)
                {
                    retVal.Add(new Tuple <double, DateTime>(item.MeasurementValue, item.MeasurementTime));
                }
            }
            catch (Exception e)
            {
                string message = string.Format("Failed read Measurements from database. {0}", e.Message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                Console.WriteLine(message);
            }

            return(retVal);
        }
Exemplo n.º 4
0
        private bool UpdateAlarmAckStatusIntoDb(AlarmHelper alarm)
        {
            bool success = true;

            try
            {
                var tmpAlarm = DbManager.Instance.GetAlarms().FirstOrDefault(a => a.Gid == alarm.Gid && a.AlarmType == alarm.Type && a.CurrentState.Contains(State.Active.ToString()));
                tmpAlarm.AckState = alarm.AckState;
                DbManager.Instance.SaveChanges();
            }
            catch (Exception e)
            {
                success = false;
                string message = string.Format("Failed to update alarm into database. {0}", e.Message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                Console.WriteLine(message);
            }


            return(success);
        }
Exemplo n.º 5
0
        private List <ResourceDescription> CollectData(List <long> resultIDs)
        {
            try
            {
                List <ResourceDescription> result = new List <ResourceDescription>();

                List <ModelCode> propertyIds = null;
                foreach (long globalId in resultIDs)
                {
                    propertyIds = class2PropertyIDs[(DMSType)ModelCodeHelper.ExtractTypeFromGlobalId(globalId)];
                    result.Add(networkModel.GetValues(globalId, propertyIds));
                }

                return(result);
            }
            catch (Exception ex)
            {
                CommonTrace.WriteTrace(CommonTrace.TraceError, "Collecting ResourceDescriptions failed. Exception: " + ex.Message);
                throw;
            }
        }
Exemplo n.º 6
0
        public UpdateResult TestApplyDeltaUpdate(List <long> gids)
        {
            string message = "Testing apply delta update method started.";

            Console.WriteLine(message);
            CommonTrace.WriteTrace(CommonTrace.TraceInfo, message);

            UpdateResult updateResult = null;

            try
            {
                Dictionary <DMSType, ResourceDescription> updates = CreateResourcesForUpdate(gids);
                Delta delta = new Delta();

                foreach (ResourceDescription rd in updates.Values)
                {
                    delta.AddDeltaOperation(DeltaOpType.Update, rd, true);
                }

                updateResult = ProxyToNMServiceFabric.InvokeWithRetry(client => client.Channel.ApplyUpdate(delta));

                message = "Testing apply delta update method finished. \n" + updateResult.ToString();
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceInfo, message);
            }
            catch (Exception ex)
            {
                message = string.Format("Testing apply delta update method failed. {0}\n", ex.Message);

                if (updateResult != null)
                {
                    message += updateResult.ToString();
                }

                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(updateResult);
        }
Exemplo n.º 7
0
        public List <AORGroup> GetGroupsForAgr(long groupGid)
        {
            List <AORGroup> resultIds = new List <AORGroup>();

            int         numberOfResources = 500;
            Association association       = new Association(ModelCode.AOR_AGAGGREGATOR_AORGROUPS, 0, false);

            try
            {
                List <ModelCode> properties = modelResourcesDesc.GetAllPropertyIds(ModelCode.AOR_GROUP);

                int iteratorId    = GdaQueryProxy.GetRelatedValues(groupGid, properties, association);
                int resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);

                while (resourcesLeft > 0)
                {
                    List <ResourceDescription> rds = GdaQueryProxy.IteratorNext(numberOfResources, iteratorId);

                    foreach (ResourceDescription rd in rds)
                    {
                        AORGroup tempGroup = new AORGroup(rd.Id);
                        resultIds.Add(tempGroup.ConvertFromRD(rd));
                    }

                    resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);
                }

                GdaQueryProxy.IteratorClose(iteratorId);

                CommonTrace.WriteTrace(CommonTrace.TraceError, "Getting extent values method successfully finished.");
            }
            catch (Exception e)
            {
                string message = string.Format("Getting related values method  failed for sourceGlobalId = {0} and association (propertyId = {1}, type = {2}). Reason: {3}", groupGid, association.PropertyId, association.Type, e.Message);
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(resultIds);
        }
Exemplo n.º 8
0
        public List <SynchronousMachine> GetSyncMachinesForAreaGroupGid(long areaGid)
        {
            List <SynchronousMachine> resultIds = new List <SynchronousMachine>();

            int         numberOfResources = 500;
            Association association       = new Association(ModelCode.AOR_GROUP_SYNCMACHINES, 0, false);

            try
            {
                List <ModelCode> properties = modelResourcesDesc.GetAllPropertyIds(ModelCode.SYNCMACHINE);

                int iteratorId    = GdaQueryProxy.GetRelatedValues(areaGid, properties, association);
                int resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);

                while (resourcesLeft > 0)
                {
                    List <ResourceDescription> rds = GdaQueryProxy.IteratorNext(numberOfResources, iteratorId);

                    foreach (ResourceDescription rd in rds)
                    {
                        SynchronousMachine tempSM = new SynchronousMachine(rd.Id);
                        resultIds.Add(tempSM.ConvertFromRD(rd));
                    }

                    resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);
                }

                GdaQueryProxy.IteratorClose(iteratorId);

                CommonTrace.WriteTrace(CommonTrace.TraceError, "Getting extent values method (GetSyncMachinesForAreaGid) successfully finished.");
            }
            catch (Exception e)
            {
                string message = string.Format("Getting related values method  failed for sourceGlobalId = {0} and association (propertyId = {1}, type = {2}). Reason: {3}", areaGid, association.PropertyId, association.Type, e.Message);
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(resultIds);
        }
        public static IdentifiedObject CreateEntity(long globalId)
        {
            short type = ModelCodeHelper.ExtractTypeFromGlobalId(globalId);

            IdentifiedObject io = null;

            switch ((DMSType)type)
            {
            case DMSType.ANALOG:
                io = new Analog(globalId);
                break;

            case DMSType.ENERGY_CONSUMER:
                io = new EnergyConsumer(globalId);
                break;

            case DMSType.DISCRETE:
                io = new Discrete(globalId);
                break;

            case DMSType.GENERATOR:
                io = new Generator(globalId);
                break;

            case DMSType.GEOGRAFICAL_REGION:
                io = new GeographicalRegion(globalId);
                break;

            case DMSType.SUBSTATION:
                io = new Substation(globalId);
                break;

            default:
                string message = String.Format("Failed to create entity because specified type ({0}) is not supported.", type);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                throw new Exception(message);
            }

            return(io);
        }
Exemplo n.º 10
0
        public List <Substation> GetSubstationsForSubRegion(long subregionGid)
        {
            List <Substation> resultIds = new List <Substation>();

            int         numberOfResources = 500;
            Association association       = new Association(ModelCode.SUBREGION_SUBSTATIONS, 0, false);

            try
            {
                List <ModelCode> properties = modelResourcesDesc.GetAllPropertyIds(ModelCode.SUBSTATION);

                int iteratorId    = GdaQueryProxy.GetRelatedValues(subregionGid, properties, association);
                int resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);

                while (resourcesLeft > 0)
                {
                    List <ResourceDescription> rds = GdaQueryProxy.IteratorNext(numberOfResources, iteratorId);

                    foreach (ResourceDescription rd in rds)
                    {
                        Substation substation = new Substation(rd.Id);
                        resultIds.Add(substation.ConvertFromRD(rd));
                    }

                    resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);
                }

                GdaQueryProxy.IteratorClose(iteratorId);

                CommonTrace.WriteTrace(CommonTrace.TraceError, "Getting extent values method successfully finished.");
            }
            catch (Exception e)
            {
                string message = string.Format("Getting related values method  failed for sourceGlobalId = {0} and association (propertyId = {1}, type = {2}). Reason: {3}", subregionGid, association.PropertyId, association.Type, e.Message);
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(resultIds);
        }
Exemplo n.º 11
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.MEASUREMENTVALUE_SYNCMACHINE:

                if (measurements.Contains(globalId))
                {
                    measurements.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 12
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.RATIOTAPCHANGER_TRWINDING:

                if (RatioTapChanger == globalId)
                {
                    RatioTapChanger = 0;
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GID, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 13
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.SDTS_SEASON:

                if (switchSchedules.Contains(globalId))
                {
                    switchSchedules.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.CONTROL_REGULATINGCONDEQ:

                if (Controls.Contains(globalId))
                {
                    Controls.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 15
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.POWERTRWINDING_POWERTRW:

                if (transformerWindings.Contains(globalId))
                {
                    transformerWindings.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 16
0
        public List <ResourceDescription> GetRange(int index, int n)
        {
            try
            {
                if (n > maxReturnNo)
                {
                    n = maxReturnNo;
                }

                List <long> resultIDs = globalDs.GetRange(index, n);

                List <ResourceDescription> result = CollectData(resultIDs);

                return(result);
            }
            catch (Exception ex)
            {
                string message = string.Format("Failed to get range of ResourceDescription iterators. index:{0}, count:{1}. {2}", index, n, ex.Message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                throw new Exception(message);
            }
        }
Exemplo n.º 17
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.CURVEDATA_CURVE:

                if (CurveDatas.Contains(globalId))
                {
                    CurveDatas.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 18
0
        public List <Tuple <double, DateTime> > ReadProfitFromDb(DateTime startTime, DateTime endTime)
        {
            List <Tuple <double, DateTime> > retVal = new List <Tuple <double, DateTime> >();

            try
            {
                var list = DbManager.Instance.GetTotalProductions().Where(x => x.TimeOfCalculation >= startTime && x.TimeOfCalculation <= endTime).ToList();
                foreach (var item in list)
                {
                    retVal.Add(new Tuple <double, DateTime>(item.TotalGeneration, item.TimeOfCalculation));
                }
            }
            catch (Exception e)
            {
                string message = string.Format("Failed read Measurements from database. {0}", e.Message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                Console.WriteLine(message);
            }


            return(retVal);
        }
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.CONNECTNODE_CONNECTNODECONTAINER:

                if (connectivityNodes.Contains(globalId))
                {
                    connectivityNodes.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 20
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.ASSET_ASSETORGANISATIONROLE:

                if (assets.Contains(globalId))
                {
                    assets.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 21
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.SWITCHINGOPERATION_OUTAGESCHEDULE:

                if (SwitchingOperations.Contains(globalId))
                {
                    SwitchingOperations.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 22
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.EQUIPMENT_EQUIPCONTAINER:

                if (Equipments.Contains(globalId))
                {
                    Equipments.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GID, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 23
0
        public GeographicalRegion GetRegionByGid(long gid)
        {
            GeographicalRegion syncMachine = null;

            try
            {
                List <ModelCode> properties = modelResourcesDesc.GetAllPropertyIds(ModelCode.REGION);

                ResourceDescription rd = GdaQueryProxy.GetValues(gid, properties);
                syncMachine = new GeographicalRegion(rd.Id);
                syncMachine.ConvertFromRD(rd);
                CommonTrace.WriteTrace(CommonTrace.TraceError, "Getting extent values method successfully finished.");
            }
            catch (Exception e)
            {
                string message = string.Format("Getting extent values method failed for {0}.\n\t{1}", ModelCode.REGION, e.Message);
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(syncMachine);
        }
Exemplo n.º 24
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.ACLINESEGMENT_PERLENGTHIMP:

                if (ACLineSegments.Contains(globalId))
                {
                    ACLineSegments.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Metoda koja na osnovu gid-a vraca substation
        /// </summary>
        /// <param name="gid"></param>
        /// <returns></returns>
        public Substation GetSubstation(long gid)
        {
            Substation substation = null;

            try
            {
                List <ModelCode> properties = modelResourcesDesc.GetAllPropertyIds(ModelCode.SUBSTATION);

                ResourceDescription rd = GdaQueryProxy.GetValues(gid, properties);
                substation = new Substation(rd.Id);
                substation.ConvertFromRD(rd);
                CommonTrace.WriteTrace(CommonTrace.TraceError, "Getting extent values method successfully finished.");
            }
            catch (Exception e)
            {
                string message = string.Format("Getting extent values method failed for {0}.\n\t{1}", ModelCode.ANALOGVALUE, e.Message);
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }

            return(substation);
        }
Exemplo n.º 26
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.TERMINAL_CONNECTIVITYNODE:

                if (terminals.Contains(globalId))
                {
                    terminals.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 27
0
        private const int NUMBER_OF_ALLOWED_ATTEMPTS = 5; // number of allowed attempts to subscribe to the CE

        private void SubsrcibeToCE()
        {
            try
            {
                ceSubscribeProxy = new CeSubscribeProxy(CallbackAction);
                ceSubscribeProxy.Subscribe();
            }
            catch (Exception e)
            {
                CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Could not connect to Publisher Service! \n ");
                Thread.Sleep(1000);

                if (attemptsCount++ < NUMBER_OF_ALLOWED_ATTEMPTS)
                {
                    SubsrcibeToCE();
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceError, "Could not connect to Publisher Service!  \n {0}", e.Message);
                }
            }
        }
Exemplo n.º 28
0
        private List <AlarmHelper> SelectAlarmsFromDatabase()
        {
            List <AlarmHelper> alarms = new List <AlarmHelper>();

            EmsContext ems = new EmsContext();

            try
            {
                var alarmsdb = ems.Alarms.ToList();

                foreach (var item in alarmsdb)
                {
                    AlarmHelper alarm = new AlarmHelper
                    {
                        Gid          = item.Gid,
                        Severity     = (SeverityLevel)item.Severity,
                        Value        = item.AlarmValue,
                        MinValue     = item.MinValue,
                        MaxValue     = item.MaxValue,
                        TimeStamp    = item.AlarmTimeStamp,
                        CurrentState = item.CurrentState,
                        AckState     = (AckState)item.AckState,
                        PubStatus    = (PublishingStatus)item.PubStatus,
                        Type         = (AlarmType)item.AlarmType,
                        Message      = item.AlarmMessage,
                    };

                    alarms.Add(alarm);
                }
            }
            catch (Exception e)
            {
                string message = string.Format("Failed read alarms from database. {0}", e.Message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                Console.WriteLine(message);
            }

            return(alarms);
        }
Exemplo n.º 29
0
        public override void RemoveReference(ModelCode referenceId, long globalId)
        {
            switch (referenceId)
            {
            case ModelCode.REGUSCHEDULE_REGCONTR:

                if (regulationSchedule.Contains(globalId))
                {
                    regulationSchedule.Remove(globalId);
                }
                else
                {
                    CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId);
                }

                break;

            default:
                base.RemoveReference(referenceId, globalId);
                break;
            }
        }
Exemplo n.º 30
0
        public virtual void SetProperty(Property property)
        {
            switch (property.Id)
            {
            case ModelCode.IDOBJ_NAME:
                name = property.AsString();
                break;

            //case ModelCode.IDOBJ_DESCRIPTION:
            //	description = property.AsString();
            //	break;

            case ModelCode.IDOBJ_MRID:
                mrid = property.AsString();
                break;

            default:
                string message = string.Format("Unknown property id = {0} for entity (GID = 0x{1:x16}).", property.Id.ToString(), this.GlobalId);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                throw new Exception(message);
            }
        }