Example #1
0
        protected bool HasLink(IIOContainer pinContainer)
        {
            try
            {
                var connected = pinContainer.GetPluginIO().IsConnected;

                foreach (var associated in pinContainer.AssociatedContainers)
                {
                    connected |= associated.GetPluginIO().IsConnected;
                }
                return(connected);
            }
            catch (InvalidComObjectException)
            {
                // [Import]s not yet ready. try another time.
                // its safe to assume that no pins have been created yet.
                FLogger.Log(LogType.Warning, "Not fully initialized [" + this.GetType().Name + "].");
                return(false);
            }
            catch (Exception)
            {
                string nodePath = PluginHost.GetNodePath(false);
                FLogger.Log(LogType.Error, "Failed to protect a " + this.GetType().Name + " node: " + nodePath);
                return(false);
            }
        }
Example #2
0
 //get connected enum for states
 public void Initialize()
 {
     if (init)
     {
         var pin = StatesEnum.GetPluginIO() as IPin;
         (pin as IEnumIn).SetSubType(AutomataUI[0].myGUID + "_States");
         init = false;
     }
 }
Example #3
0
 public InputBinSpreadStream(IIOFactory ioFactory, InputAttribute attribute, bool checkIfChanged, Func <IIOContainer <IInStream <int> > > binSizeIOContainerFactory)
 {
     // Don't do this, as spread max won't get computed for this pin
     //                attribute.AutoValidate = false;
     attribute.CheckIfChanged = checkIfChanged;
     FDataContainer           = ioFactory.CreateIOContainer <IInStream <T> >(attribute, false);
     FBinSizeContainer        = binSizeIOContainerFactory();
     FDataStream    = FDataContainer.IOObject;
     FBinSizeStream = FBinSizeContainer.IOObject;
     FDataIO        = FDataContainer.GetPluginIO();
 }
Example #4
0
 public void SetOrder(int order)
 {
     iiocontainer.GetPluginIO().Order = order;
     if (IsBinSized)
     {
         if (iiocontainer.AssociatedContainers != null)
         {
             iiocontainer.AssociatedContainers[0].GetPluginIO().Order = order;
         }
         if (iiocontainer.BaseContainer.AssociatedContainers != null)
         {
             iiocontainer.BaseContainer.AssociatedContainers[0].GetPluginIO().Order = order;
         }
     }
 }
Example #5
0
            public InputBinSpreadStream(IIOFactory ioFactory, InputAttribute attribute, bool checkIfChanged, Func <IIOContainer, IIOContainer <IInStream <int> > > binSizeIOContainerFactory)
            {
                // Don't do this, as spread max won't get computed for this pin
                // attribute.AutoValidate = false;
                attribute.CheckIfChanged = checkIfChanged;

                if (attribute.IsBinSizeEnabled)
                {
                    var container = ioFactory.CreateIOContainer <ISpread <T> >(attribute.DecreaseBinSizeWrapCount(), false); // Ask for a spread, otherwise we lose track of bin size wrapping
                    FDataContainer = container;
                    FDataStream    = container.IOObject.Stream;
                }
                else
                {
                    var container = ioFactory.CreateIOContainer <IInStream <T> >(attribute, false); // No need for another indirection, access the node input directly
                    FDataContainer = container;
                    FDataStream    = container.IOObject;
                }

                FBinSizeContainer = binSizeIOContainerFactory(FDataContainer);
                FBinSizeStream    = FBinSizeContainer.IOObject;
                FDataIO           = FDataContainer.GetPluginIO();
            }
        protected bool HasLink(IIOContainer pinContainer)
        {
            try
            {
                var connected = pinContainer.GetPluginIO().IsConnected;

                foreach (var associated in pinContainer.AssociatedContainers)
                {
                    connected |= associated.GetPluginIO().IsConnected;
                }
                return connected;
            }
            catch (InvalidComObjectException)
            {
                // [Import]s not yet ready. try another time.
                // its safe to assume that no pins have been created yet.
                FLogger.Log(LogType.Warning, "Not fully initialized [" + this.GetType().Name + "].");
                return false;
            }
            catch (Exception)
            {
                string nodePath = PluginHost.GetNodePath(false);
                FLogger.Log(LogType.Error, "Failed to protect a " + this.GetType().Name + " node: " + nodePath);
                return false;

            }
        }