Ejemplo n.º 1
0
        public ConfigIVIBridge(ConfigIVIBridgeConfig config)
            : base(config.PartID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion2.Build(waitTimeLimit: TimeSpan.FromSeconds((config.MinSyncInterval != TimeSpan.Zero) ? 0.05: 0.2), partBaseIVI: config.PartBaseIVI, disableBusyBehavior: true))
        {
            BridgeConfig = new ConfigIVIBridgeConfig(config);

            ActionLoggingReference.Config = BridgeConfig.ActionLoggingConfig;

            useNominalSyncHoldoffTimer = (BridgeConfig.MinSyncInterval != TimeSpan.Zero);
            if (useNominalSyncHoldoffTimer)
            {
                nominalSyncHoldoffTimer.TriggerInterval = BridgeConfig.MinSyncInterval;
            }

            IssueEmitter      = Log.Emitter(BridgeConfig.IssueLogMesgType);
            ValueTraceEmitter = Log.Emitter(BridgeConfig.ValueUpdateTraceLogMesgType);

            IVI          = BridgeConfig.IVI;    // BridgeConfig Copy constructor converts passed nulls to singleton instance
            Config       = BridgeConfig.Config; // BridgeConfig Copy constructor converts passed nulls to singleton instance
            ReferenceSet = BridgeConfig.ReferenceSet;

            IVI.NotificationList.AddItem(this);
            Config.ChangeNotificationList.AddItem(this);

            AddExplicitDisposeAction(() =>
            {
                IVI.NotificationList.RemoveItem(this);
                Config.ChangeNotificationList.RemoveItem(this);
            });

            PerformMainLoopService();
        }
Ejemplo n.º 2
0
        public ConfigIVIBridgeConfig(ConfigIVIBridgeConfig other)
        {
            PartID = other.PartID;

            MinSyncInterval        = other.MinSyncInterval.Clip(TimeSpan.Zero, TimeSpan.FromSeconds(0.2));
            MinLookAtLaterInterval = other.MinLookAtLaterInterval;

            IssueLogMesgType             = other.IssueLogMesgType;
            ValueUpdateTraceLogMesgType  = other.ValueUpdateTraceLogMesgType;
            UseEnsureExists              = other.UseEnsureExists;
            DefaultConfigKeyProviderName = other.DefaultConfigKeyProviderName;

            PartBaseIVI  = other.PartBaseIVI ?? other.IVI ?? Modular.Interconnect.Values.Values.Instance;
            IVI          = other.IVI ?? Modular.Interconnect.Values.Values.Instance;
            Config       = other.Config ?? Modular.Config.Config.Instance;
            ReferenceSet = other.ReferenceSet;

            if (other.IVAPropagateNameMatchRuleSet != null)
            {
                IVAPropagateNameMatchRuleSet = new MatchRuleSet(other.IVAPropagateNameMatchRuleSet);
            }
            IVAMapNameFromTo = other.IVAMapNameFromTo;

            if (other.CKAPropagateKeyMatchRuleSet != null)
            {
                CKAPropagateKeyMatchRuleSet = new MatchRuleSet(other.CKAPropagateKeyMatchRuleSet);
            }
            CKAPropagateFilterPredicate = other.CKAPropagateFilterPredicate;
            CKAMapNameFromTo            = other.CKAMapNameFromTo;

            ActionLoggingConfig = other.ActionLoggingConfig;
        }