예제 #1
0
        bool HandleLoadFlowChange(LoadFlowChanged m)
        {
            LoadFlowDownload download = new LoadFlowDownload();

            if (!download.Download())
            {
                return(false);
            }

            topology.UpdateLoadFlow(download);
            Notify(new ObservableMessage(EObservableMessageType.LoadFlowChanged));

            return(true);
        }
예제 #2
0
        public void UpdateLoadFlow(LoadFlowDownload download)
        {
            if (download?.Data == null)
            {
                return;
            }

            Dictionary <long, LoadFlowResult> loadFlow = new Dictionary <long, LoadFlowResult>();

            for (int i = 0; i < download.Data.Count; ++i)
            {
                KeyValuePair <long, LoadFlowResult> pair = download.Data[i];
                loadFlow.Add(pair.Key, pair.Value);
            }

            rwLock.EnterWriteLock();
            {
                this.loadFlow = loadFlow;
            }
            rwLock.ExitWriteLock();
        }