protected E099TagRWSimEngine(string partID, IValuesInterconnection ivi)
            : base(partID, initialSettings: SimpleActivePartBaseSettings.DefaultVersion2.Build(partBaseIVI: ivi))
        {
            ActionLoggingConfig = Modular.Action.ActionLoggingConfig.Info_Error_Trace_Trace;    // redefine the log levels for actions

            IVI = ivi ?? Values.Instance;

            //This part is a simulated primary part
            PrivateBaseState = new BaseState(true, true)
            {
                ConnState = ConnState.NotApplicable
            };

            TagRWSimEngineConfig defaultConfig = new TagRWSimEngineConfig()
            {
                ReaderType = ReaderType.TIRIS, Mode = E099TagRWSimEngineMode.IDOnly
            };

            configAccessAdapter = new ConfigValueSetAdapter <TagRWSimEngineConfig>()
            {
                ValueSet = defaultConfig, SetupIssueEmitter = Log.Error, UpdateIssueEmitter = Log.Error, ValueNoteEmitter = Log.Debug
            }.Setup(PartID + ".");
            configAccessAdapter.UpdateNotificationList.AddItem(threadWakeupNotifier);
            AddExplicitDisposeAction(() => configAccessAdapter.UpdateNotificationList.RemoveItem(threadWakeupNotifier));

            InitializePrivateState();

            PublishBaseState("Constructor.Complete");
        }
示例#2
0
        public LPMSimConfigSetAndArrayItems UpdateFromModularConfig(string prefixStr, Logging.IMesgEmitter issueEmitter = null, Logging.IMesgEmitter valueEmitter = null, IConfig configInstance = null)
        {
            ConfigValueSetAdapter <LPMSimConfigSetAndArrayItems> adapter = new ConfigValueSetAdapter <LPMSimConfigSetAndArrayItems>(configInstance)
            {
                ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter
            }.Setup(prefixStr);

            return(this);
        }
        public ProcessPerformancePartConfig Setup(string prefixName = "ProcessPerf.", IConfig config = null, Logging.IMesgEmitter issueEmitter = null, Logging.IMesgEmitter valueEmitter = null)
        {
            var adapter = new ConfigValueSetAdapter <ProcessPerformancePartConfig>(config)
            {
                ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter
            }.Setup(prefixName);

            return(this);
        }
示例#4
0
 void SetupConfig()
 {
     configAdapter = new ConfigValueSetAdapter <ConfigValues>()
     {
         ValueSet = configValues, SetupIssueEmitter = Log.Debug, UpdateIssueEmitter = Log.Debug, ValueNoteEmitter = Log.Debug
     }.Setup("{0}.".CheckedFormat(PartID));
     configAdapter.UpdateNotificationList.AddItem(this);
     AddExplicitDisposeAction(() => configAdapter.UpdateNotificationList.RemoveItem(this));
 }
示例#5
0
        /// <summary>
        /// Update this object's ConfigItem marked public properties from corresponingly named config keys (using the namePrefix)
        /// </summary>
        public PassiveTimers Setup(string namePrefix, Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter <PassiveTimers> adapter = new ConfigValueSetAdapter <PassiveTimers>()
            {
                ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter
            }.Setup(namePrefix);

            return(this);
        }
示例#6
0
        /// <summary>
        /// Uses Modular.Config to Setup portions of this instance.  Requires and issueEmitter and a valueEmitter to use (use null or Logging.NullEmitter to suppress output).
        /// Prefixes this object's Name with period in front of the annotated members that can be filled in from config keys.  All such config keys are ReadOnlyOnce = true and IsOptional = true.
        /// </summary>
        public ScanEnginePartConfig Setup(Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter <ScanEnginePartConfig> adapter;

            Name = Name ?? String.Empty;

            // update values from any lpmInstanceName derived keys.
            adapter = new ConfigValueSetAdapter <ScanEnginePartConfig>()
            {
                ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter
            }.Setup(Name + ".");

            return(this);
        }
示例#7
0
        public BCRSimPartConfigBase Setup(Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter <BCRSimPartConfigBase> adapter;

            BCRName = BCRName ?? String.Empty;

            // update values from any lpmInstanceName derived keys.
            adapter = new ConfigValueSetAdapter <BCRSimPartConfigBase>()
            {
                ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter
            }.Setup(BCRName + ".");

            return(this);
        }
示例#8
0
        public LPMSimPartConfigBase Setup(Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter <LPMSimPartConfigBase> adapter;

            LPMName = LPMName ?? String.Empty;

            // update values from any LPAll derived kesy.  We never log issues when trying to read from LPAll prefixed keys.
            adapter = new ConfigValueSetAdapter <LPMSimPartConfigBase>()
            {
                ValueSet = this, SetupIssueEmitter = Logging.NullEmitter, UpdateIssueEmitter = Logging.NullEmitter, ValueNoteEmitter = valueEmitter
            }.Setup("LPAll.");
            MapResultPattern.UpdateFromModularConfig("LPAll.MapResultPattern.", Logging.NullEmitter, valueEmitter);
            CarrierTypeSpec.UpdateFromModularConfig("LPAll.CarrierTypeSpec.", Logging.NullEmitter, valueEmitter);

            // update values from any lpmInstanceName derived keys.
            adapter = new ConfigValueSetAdapter <LPMSimPartConfigBase>()
            {
                ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter
            }.Setup(LPMName + ".");
            MapResultPattern.UpdateFromModularConfig(LPMName + ".MapResultPattern.", issueEmitter, valueEmitter);
            CarrierTypeSpec.UpdateFromModularConfig(LPMName + ".CarrierTypeSpec.", issueEmitter, valueEmitter);

            return(this);
        }
示例#9
0
        public BCRSimPartConfigBase Setup(Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter<BCRSimPartConfigBase> adapter;

            BCRName = BCRName ?? String.Empty;

            // update values from any lpmInstanceName derived keys.
            adapter = new ConfigValueSetAdapter<BCRSimPartConfigBase>() { ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter }.Setup(BCRName + ".");

            return this;
        }
示例#10
0
        public LPMSimPartConfigBase Setup(Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter<LPMSimPartConfigBase> adapter;

            LPMName = LPMName ?? String.Empty;

            // update values from any LPAll derived kesy.  We never log issues when trying to read from LPAll prefixed keys.
            adapter = new ConfigValueSetAdapter<LPMSimPartConfigBase>() { ValueSet = this, SetupIssueEmitter = Logging.NullEmitter, UpdateIssueEmitter = Logging.NullEmitter, ValueNoteEmitter = valueEmitter }.Setup("LPAll.");
            MapResultPattern.UpdateFromModularConfig("LPAll.MapResultPattern.", Logging.NullEmitter, valueEmitter);
            CarrierTypeSpec.UpdateFromModularConfig("LPAll.CarrierTypeSpec.", Logging.NullEmitter, valueEmitter);

            // update values from any lpmInstanceName derived keys.
            adapter = new ConfigValueSetAdapter<LPMSimPartConfigBase>() { ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter }.Setup(LPMName + ".");
            MapResultPattern.UpdateFromModularConfig(LPMName + ".MapResultPattern.", issueEmitter, valueEmitter);
            CarrierTypeSpec.UpdateFromModularConfig(LPMName + ".CarrierTypeSpec.", issueEmitter, valueEmitter);

            return this;
        }
示例#11
0
        public LPMSimConfigSetAndArrayItems UpdateFromModularConfig(string prefixStr, Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
        {
            ConfigValueSetAdapter<LPMSimConfigSetAndArrayItems> adapter = new ConfigValueSetAdapter<LPMSimConfigSetAndArrayItems>() { ValueSet = this, SetupIssueEmitter = issueEmitter, UpdateIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter }.Setup(prefixStr);

            return this;
        }
示例#12
0
            /// <summary>
            /// Use this method to read the stock set of ModularConfig points using the given configKeyPrefixStr and to update this ring configuration using the valid, non-zero values read from these keys.
            /// <para/>Keys are LogGate, DirectoryPath, MaxFilesToKeep, MaxFileAgeToKeepInDays, MaxTotalSizeToKeep, AdvanceAfterFileReachesSize, AdvanceAfterFileReachesAge
            /// </summary>
            public FileRotationLoggingConfig UpdateFromModularConfig(string configKeyPrefixStr, Logging.IMesgEmitter issueEmitter, Logging.IMesgEmitter valueEmitter)
            {
                ConfigValueSetAdapter<ConfigKeyValuesHelper> adapter = new ConfigValueSetAdapter<ConfigKeyValuesHelper>() { ValueSet = new ConfigKeyValuesHelper(), SetupIssueEmitter = issueEmitter, ValueNoteEmitter = valueEmitter }.Setup(configKeyPrefixStr);

                ConfigKeyValuesHelper configValues = adapter.ValueSet;

                logGate |= configValues.LogGate;

                if (!String.IsNullOrEmpty(configValues.DirectoryPath))
                    dirPath = configValues.DirectoryPath;

                if (configValues.MaxFilesToKeep != 0)
                    purgeRules.dirNumFilesLimit = configValues.MaxFilesToKeep;
                if (configValues.MaxFileAgeToKeep != TimeSpan.Zero)
                    purgeRules.FileAgeLimit = configValues.MaxFileAgeToKeep;
                if (configValues.MaxTotalSizeToKeep != 0)
                    purgeRules.dirTotalSizeLimit = configValues.MaxTotalSizeToKeep;

                if (configValues.AdvanceAfterFileReachesSize != 0)
                    advanceRules.fileSizeLimit = configValues.AdvanceAfterFileReachesSize;
                if (configValues.AdvanceAfterFileReachesAge != TimeSpan.Zero)
                    advanceRules.FileAgeLimit = configValues.AdvanceAfterFileReachesAge;

                return this;
            }