Пример #1
0
 /// <summary>
 /// Sets the origin parameter used by control commands.
 /// </summary>
 /// <param name='originator'>
 /// Originator. An arbitrary string identifying the controlling client.
 /// </param>
 /// <param name='originatorCategory'>
 /// Originator category.
 /// </param>
 public void SetOrigin(string originator, OrCat originatorCategory)
 {
     ControlObjectClient_setOrigin(self, originator, (int)originatorCategory);
 }
        public static void SetValue(int index, dynamic newValue, dynamic oldValue, ulong operTm, Client.Item61850 item, bool test, bool cheakInterlock, bool cheakSynchro, string originator, OrCat orCat)
        {
            var connection = ConnectionList[index];

            connection.SetValue(newValue, oldValue, operTm, item, test, cheakInterlock, cheakSynchro, originator, orCat);
        }
Пример #3
0
 /// <summary>
 /// Sets the origin parameter used by control commands.
 /// </summary>
 /// <param name='originator'>
 /// Originator. An arbitrary string identifying the controlling client.
 /// </param>
 /// <param name='originatorCategory'>
 /// Originator category.
 /// </param>
 public void SetOrigin(string originator, OrCat originatorCategory)
 {
     ControlObjectClient_setOrigin(controlObject, originator, (int) originatorCategory);
 }
Пример #4
0
        private void WithEnhancedSecuritySbo(dynamic newValue, dynamic oldValue, ulong operTm, string path, bool test, bool cheakInterlock, bool cheakSynchro, string originator, OrCat orCat)
        {
            if (GetPathDA($"{path}.Oper.ctlVal") == null)
            {
                return;
            }
            var controlObject = _connection.CreateControlObject(path);

            controlObject.EnableInterlockCheck();
            controlObject.SetInterlockCheck(cheakInterlock);

            controlObject.EnableSynchroCheck();
            controlObject.SetSynchroCheck(cheakSynchro);

            controlObject.SetTestMode(test);

            if (originator != null)
            {
                controlObject.SetOrigin(originator, orCat);
            }

            controlObject.SetCommandTerminationHandler((parameter, o) =>
            {
            }, null);

            if (controlObject.SelectWithValue(oldValue))
            {
                controlObject.Operate(newValue, operTm);
            }
            else
            {
                controlObject.Cancel();
            }
        }
Пример #5
0
        private void WithNormalSecuritySbo(dynamic value, ulong operTm, string path, bool test, bool cheakInterlock, bool cheakSynchro, string originator, OrCat orCat)
        {
            if (GetPathDA($"{path}.Oper.ctlVal") == null)
            {
                return;
            }
            var controlObject = _connection.CreateControlObject(path);

            controlObject.EnableInterlockCheck();
            controlObject.SetInterlockCheck(cheakInterlock);

            controlObject.EnableSynchroCheck();
            controlObject.SetSynchroCheck(cheakSynchro);

            controlObject.SetTestMode(test);

            if (originator != null)
            {
                controlObject.SetOrigin(originator, orCat);
            }

            if (controlObject.Select())
            {
                controlObject.Operate(value, operTm);
            }
            else
            {
                controlObject.Cancel();
            }
        }
Пример #6
0
        public void SetValue(dynamic newValue, dynamic oldValue, ulong operTm, Item61850 item, bool test, bool cheakInterlock, bool cheakSynchro, string originator, OrCat orCat)
        {
            if (item.path.Contains("Oper.ctlVal"))
            {
                var path = item.path.Replace(".Oper.ctlVal", "");

                var pathDA = new Item61850($"{path}.ctlModel", FunctionalConstraint.CF, MmsType.MMS_INTEGER);

                try
                {
                    var ctlModelValue = GetValue(pathDA);

                    if (ctlModelValue == 1)
                    {
                        DirectWithNormalSecurity(newValue, operTm, path, test, cheakInterlock, cheakSynchro, originator, orCat);
                    }
                    else if (ctlModelValue == 2)
                    {
                        WithNormalSecuritySbo(newValue, operTm, path, test, cheakInterlock, cheakSynchro, originator, orCat);
                    }
                    else if (ctlModelValue == 3)
                    {
                        DirectWithEnhancedSecurity(newValue, oldValue, operTm, path, test, cheakInterlock, cheakSynchro, originator, orCat);
                    }
                    else if (ctlModelValue == 4)
                    {
                        WithEnhancedSecuritySbo(newValue, oldValue, operTm, path, test, cheakInterlock, cheakSynchro, originator, orCat);
                    }
                }
                catch (Exception e)
                {
                    Log.Write(e, Log.Code.WARNING);
                }
            }
        }