Unified · Split
| @@ -0,0 +1,103 @@ | ||
| 1 | +//****************************************************************************************************** | |
| 2 | +// SetFlagsFilterAdapter.cs - Gbtc | |
| 3 | +// | |
| 4 | +// Copyright © 2017, Grid Protection Alliance. All Rights Reserved. | |
| 5 | +// | |
| 6 | +// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See | |
| 7 | +// the NOTICE file distributed with this work for additional information regarding copyright ownership. | |
| 8 | +// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may | |
| 9 | +// not use this file except in compliance with the License. You may obtain a copy of the License at: | |
| 10 | +// | |
| 11 | +// http://opensource.org/licenses/MIT | |
| 12 | +// | |
| 13 | +// Unless agreed to in writing, the subject software distributed under the License is distributed on an | |
| 14 | +// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the | |
| 15 | +// License for the specific language governing permissions and limitations. | |
| 16 | +// | |
| 17 | +// Code Modification History: | |
| 18 | +// ---------------------------------------------------------------------------------------------------- | |
| 19 | +// 11/17/2017 - Stephen C. Wills | |
| 20 | +// Generated original version of source code. | |
| 21 | +// | |
| 22 | +//****************************************************************************************************** | |
| 23 | + | |
| 24 | +using System; | |
| 25 | +using System.Collections.Generic; | |
| 26 | +using System.ComponentModel; | |
| 27 | +using GSF.TimeSeries; | |
| 28 | +using GSF.TimeSeries.Adapters; | |
| 29 | + | |
| 30 | +namespace TestingAdapters | |
| 31 | +{ | |
| 32 | + /// <summary> | |
| 33 | + /// Forces a set of flags to be turned on for a set of inputs. | |
| 34 | + /// </summary> | |
| 35 | + [Description("Set Flags: Forces a set of flags to be turned on for a set of inputs.")] | |
| 36 | + public class SetFlagsFilterAdapter : FilterAdapterBase | |
| 37 | + { | |
| 38 | + #region [ Members ] | |
| 39 | + | |
| 40 | + // Constants | |
| 41 | + | |
| 42 | + /// <summary> | |
| 43 | + /// Default value for the <see cref="Flags"/> property. | |
| 44 | + /// </summary> | |
| 45 | + public const MeasurementStateFlags DefaultFlags = MeasurementStateFlags.Normal; | |
| 46 | + | |
| 47 | + #endregion | |
| 48 | + | |
| 49 | + #region [ Properties ] | |
| 50 | + | |
| 51 | + /// <summary> | |
| 52 | + /// Gets or sets the set of flags to be forced on. | |
| 53 | + /// </summary> | |
| 54 | + [ConnectionStringParameter, | |
| 55 | + DefaultValue(DefaultFlags), | |
| 56 | + Description("Defines the set of flags to be forced on.")] | |
| 57 | + public MeasurementStateFlags Flags { get; set; } | |
| 58 | + | |
| 59 | + /// <summary> | |
| 60 | + /// Gets the flag indicating if this adapter supports temporal processing (it doesn't). | |
| 61 | + /// </summary> | |
| 62 | + public override bool SupportsTemporalProcessing | |
| 63 | + { | |
| 64 | + get | |
| 65 | + { | |
| 66 | + return false; | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + #endregion | |
| 71 | + | |
| 72 | + #region [ Methods ] | |
| 73 | + | |
| 74 | + /// <summary> | |
| 75 | + /// Initializes the adapter's settings. | |
| 76 | + /// </summary> | |
| 77 | + public override void Initialize() | |
| 78 | + { | |
| 79 | + base.Initialize(); | |
| 80 | + | |
| 81 | + Dictionary<string, string> settings = Settings; | |
| 82 | + string setting; | |
| 83 | + MeasurementStateFlags flags; | |
| 84 | + | |
| 85 | + if (settings.TryGetValue(nameof(Flags), out setting) && Enum.TryParse(setting, out flags)) | |
| 86 | + Flags = flags; | |
| 87 | + else | |
| 88 | + Flags = DefaultFlags; | |
| 89 | + } | |
| 90 | + | |
| 91 | + /// <summary> | |
| 92 | + /// Processes the measurements to apply the flags. | |
| 93 | + /// </summary> | |
| 94 | + /// <param name="measurements">The set of measurements to which to apply the flags.</param> | |
| 95 | + protected override void ProcessMeasurements(IEnumerable<IMeasurement> measurements) | |
| 96 | + { | |
| 97 | + foreach (IMeasurement measurement in measurements) | |
| 98 | + measurement.StateFlags |= Flags; | |
| 99 | + } | |
| 100 | + | |
| 101 | + #endregion | |
| 102 | + } | |
| 103 | +} | |
| @@ -60,6 +60,7 @@ · 59 unmodified lines | ||
| 60 | 60 | <Compile Include="Properties\AssemblyInfo.cs" /> |
| 61 | 61 | <Compile Include="RandomValueInputAdapter.cs" /> |
| 62 | 62 | <Compile Include="SampleActionAdapter.cs" /> |
| 63 | + <Compile Include="SetFlagsFilterAdapter.cs" /> | |
| 63 | 64 | <Compile Include="VirtualActionAdapter.cs" /> |
| 64 | 65 | <Compile Include="VirtualInputAdapter.cs" /> |
| 65 | 66 | <Compile Include="VirtualOutputAdapter.cs" /> |
| @@ -0,0 +1,146 @@ | ||
| 1 | +//****************************************************************************************************** | |
| 2 | +// FilterAdapterBase.cs - Gbtc | |
| 3 | +// | |
| 4 | +// Copyright © 2017, Grid Protection Alliance. All Rights Reserved. | |
| 5 | +// | |
| 6 | +// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See | |
| 7 | +// the NOTICE file distributed with this work for additional information regarding copyright ownership. | |
| 8 | +// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may | |
| 9 | +// not use this file except in compliance with the License. You may obtain a copy of the License at: | |
| 10 | +// | |
| 11 | +// http://opensource.org/licenses/MIT | |
| 12 | +// | |
| 13 | +// Unless agreed to in writing, the subject software distributed under the License is distributed on an | |
| 14 | +// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the | |
| 15 | +// License for the specific language governing permissions and limitations. | |
| 16 | +// | |
| 17 | +// Code Modification History: | |
| 18 | +// ---------------------------------------------------------------------------------------------------- | |
| 19 | +// 11/10/2017 - Stephen C. Wills | |
| 20 | +// Generated original version of source code. | |
| 21 | +// | |
| 22 | +//****************************************************************************************************** | |
| 23 | + | |
| 24 | +using System.Collections.Generic; | |
| 25 | +using System.ComponentModel; | |
| 26 | +using System.Linq; | |
| 27 | + | |
| 28 | +namespace GSF.TimeSeries.Adapters | |
| 29 | +{ | |
| 30 | + /// <summary> | |
| 31 | + /// Base class for the <see cref="IFilterAdapter"/> interface. | |
| 32 | + /// </summary> | |
| 33 | + public abstract class FilterAdapterBase : AdapterBase, IFilterAdapter | |
| 34 | + { | |
| 35 | + #region [ Members ] | |
| 36 | + | |
| 37 | + // Fields | |
| 38 | + private HashSet<MeasurementKey> m_inputMeasurementKeys; | |
| 39 | + | |
| 40 | + #endregion | |
| 41 | + | |
| 42 | + #region [ Constructors ] | |
| 43 | + | |
| 44 | + /// <summary> | |
| 45 | + /// Creates a new instance of the <see cref="FilterAdapterBase"/> class. | |
| 46 | + /// </summary> | |
| 47 | + public FilterAdapterBase() | |
| 48 | + { | |
| 49 | + m_inputMeasurementKeys = new HashSet<MeasurementKey>(); | |
| 50 | + } | |
| 51 | + | |
| 52 | + #endregion | |
| 53 | + | |
| 54 | + #region [ Properties ] | |
| 55 | + | |
| 56 | + /// <summary> | |
| 57 | + /// Gets or sets primary keys of input measurements the <see cref="AdapterBase"/> expects, if any. | |
| 58 | + /// </summary> | |
| 59 | + /// <remarks> | |
| 60 | + /// If your adapter needs to receive all measurements, you must explicitly set InputMeasurementKeys to null. | |
| 61 | + /// </remarks> | |
| 62 | + [ConnectionStringParameter, | |
| 63 | + DefaultValue(null), | |
| 64 | + Description("Defines primary keys of input measurements the adapter expects; can be one of a filter expression, measurement key, point tag or Guid."), | |
| 65 | + CustomConfigurationEditor("GSF.TimeSeries.UI.WPF.dll", "GSF.TimeSeries.UI.Editors.MeasurementEditor")] | |
| 66 | + public override MeasurementKey[] InputMeasurementKeys | |
| 67 | + { | |
| 68 | + get | |
| 69 | + { | |
| 70 | + return base.InputMeasurementKeys; | |
| 71 | + } | |
| 72 | + set | |
| 73 | + { | |
| 74 | + base.InputMeasurementKeys = value; | |
| 75 | + | |
| 76 | + if (!m_inputMeasurementKeys.SetEquals(value)) | |
| 77 | + m_inputMeasurementKeys = new HashSet<MeasurementKey>(value); | |
| 78 | + } | |
| 79 | + } | |
| 80 | + | |
| 81 | + /// <summary> | |
| 82 | + /// Gets or sets output measurements that the <see cref="AdapterBase"/> will produce, if any. | |
| 83 | + /// </summary> | |
| 84 | + [EditorBrowsable(EditorBrowsableState.Never)] | |
| 85 | + public override IMeasurement[] OutputMeasurements | |
| 86 | + { | |
| 87 | + get | |
| 88 | + { | |
| 89 | + return base.OutputMeasurements; | |
| 90 | + } | |
| 91 | + set | |
| 92 | + { | |
| 93 | + base.OutputMeasurements = value; | |
| 94 | + } | |
| 95 | + } | |
| 96 | + | |
| 97 | + /// <summary> | |
| 98 | + /// Gets or sets the values that determines the order in which filter adapters are executed. | |
| 99 | + /// </summary> | |
| 100 | + public virtual int ExecutionOrder { get; set; } | |
| 101 | + | |
| 102 | + #endregion | |
| 103 | + | |
| 104 | + #region [ Methods ] | |
| 105 | + | |
| 106 | + /// <summary> | |
| 107 | + /// Handler for new measurements that have not yet been routed. | |
| 108 | + /// </summary> | |
| 109 | + /// <param name="measurements">Measurements that have not yet been routed.</param> | |
| 110 | + public virtual void HandleNewMeasurements(ICollection<IMeasurement> measurements) | |
| 111 | + { | |
| 112 | + ProcessMeasurements(measurements.Where(measurement => IsInputMeasurement(measurement.Key))); | |
| 113 | + IncrementProcessedMeasurements(measurements.Count); | |
| 114 | + } | |
| 115 | + | |
| 116 | + /// <summary> | |
| 117 | + /// Determines if the given measurement key represents | |
| 118 | + /// a signal that is bound for this filter adapter. | |
| 119 | + /// </summary> | |
| 120 | + /// <param name="key">The key that identifies the signal.</param> | |
| 121 | + /// <returns>True if measurements for the given signal are bound for this filter adapter.</returns> | |
| 122 | + public virtual bool IsInputMeasurement(MeasurementKey key) | |
| 123 | + { | |
| 124 | + HashSet<MeasurementKey> inputMeasurementKeys = m_inputMeasurementKeys; | |
| 125 | + return inputMeasurementKeys.Contains(key); | |
| 126 | + } | |
| 127 | + | |
| 128 | + /// <summary> | |
| 129 | + /// Gets a short one-line status of this <see cref="AdapterBase"/>. | |
| 130 | + /// </summary> | |
| 131 | + /// <param name="maxLength">Maximum number of available characters for display.</param> | |
| 132 | + /// <returns>A short one-line summary of the current status of this <see cref="AdapterBase"/>.</returns> | |
| 133 | + public override string GetShortStatus(int maxLength) | |
| 134 | + { | |
| 135 | + return $"{ProcessedMeasurements} measurements processed so far...".CenterText(maxLength); | |
| 136 | + } | |
| 137 | + | |
| 138 | + /// <summary> | |
| 139 | + /// Processes the new measurements before they have been routed to other adapters. | |
| 140 | + /// </summary> | |
| 141 | + /// <param name="measurements">The new measurements that have not yet been routed.</param> | |
| 142 | + protected abstract void ProcessMeasurements(IEnumerable<IMeasurement> measurements); | |
| 143 | + | |
| 144 | + #endregion | |
| 145 | + } | |
| 146 | +} | |
| @@ -0,0 +1,159 @@ | ||
| 1 | +//****************************************************************************************************** | |
| 2 | +// FilterAdapterCollection.cs - Gbtc | |
| 3 | +// | |
| 4 | +// Copyright © 2017, Grid Protection Alliance. All Rights Reserved. | |
| 5 | +// | |
| 6 | +// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See | |
| 7 | +// the NOTICE file distributed with this work for additional information regarding copyright ownership. | |
| 8 | +// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may | |
| 9 | +// not use this file except in compliance with the License. You may obtain a copy of the License at: | |
| 10 | +// | |
| 11 | +// http://opensource.org/licenses/MIT | |
| 12 | +// | |
| 13 | +// Unless agreed to in writing, the subject software distributed under the License is distributed on an | |
| 14 | +// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the | |
| 15 | +// License for the specific language governing permissions and limitations. | |
| 16 | +// | |
| 17 | +// Code Modification History: | |
| 18 | +// ---------------------------------------------------------------------------------------------------- | |
| 19 | +// 11/10/2017 - Stephen C. Wills | |
| 20 | +// Generated original version of source code. | |
| 21 | +// | |
| 22 | +//****************************************************************************************************** | |
| 23 | + | |
| 24 | +using System; | |
| 25 | +using System.Collections.Generic; | |
| 26 | +using System.Collections.ObjectModel; | |
| 27 | +using System.Data; | |
| 28 | +using System.Linq; | |
| 29 | +using GSF.Data; | |
| 30 | + | |
| 31 | +namespace GSF.TimeSeries.Adapters | |
| 32 | +{ | |
| 33 | + /// <summary> | |
| 34 | + /// Represents a collection of <see cref="IFilterAdapter"/> implementations. | |
| 35 | + /// </summary> | |
| 36 | + public class FilterAdapterCollection : AdapterCollectionBase<IFilterAdapter>, IFilterAdapter | |
| 37 | + { | |
| 38 | + #region [ Members ] | |
| 39 | + | |
| 40 | + // Fields | |
| 41 | + private List<IFilterAdapter> m_sortedFilterAdapters; | |
| 42 | + | |
| 43 | + #endregion | |
| 44 | + | |
| 45 | + #region [ Constructors ] | |
| 46 | + | |
| 47 | + /// <summary> | |
| 48 | + /// Creates a new instance of the <see cref="FilterAdapterCollection"/>. | |
| 49 | + /// </summary> | |
| 50 | + public FilterAdapterCollection() | |
| 51 | + { | |
| 52 | + base.Name = "Filter Adapter Collection"; | |
| 53 | + base.DataMember = "FilterAdapters"; | |
| 54 | + base.MonitorTimerEnabled = true; | |
| 55 | + } | |
| 56 | + | |
| 57 | + #endregion | |
| 58 | + | |
| 59 | + #region [ Properties ] | |
| 60 | + | |
| 61 | + /// <summary> | |
| 62 | + /// Gets or sets the values that determines the order in which filter adapters are executed. | |
| 63 | + /// </summary> | |
| 64 | + public int ExecutionOrder { get; set; } | |
| 65 | + | |
| 66 | + #endregion | |
| 67 | + | |
| 68 | + #region [ Methods ] | |
| 69 | + | |
| 70 | + /// <summary> | |
| 71 | + /// Handler for new measurements that have not yet been routed. | |
| 72 | + /// </summary> | |
| 73 | + /// <param name="measurements">Measurements that have not yet been routed.</param> | |
| 74 | + public void HandleNewMeasurements(ICollection<IMeasurement> measurements) | |
| 75 | + { | |
| 76 | + List<IFilterAdapter> sortedFilterAdapters = m_sortedFilterAdapters; | |
| 77 | + | |
| 78 | + if ((object)sortedFilterAdapters == null) | |
| 79 | + { | |
| 80 | + lock (this) | |
| 81 | + { | |
| 82 | + // Because we entered a lock, some time may have passed since | |
| 83 | + // the first time we checked for null so we should check again | |
| 84 | + sortedFilterAdapters = m_sortedFilterAdapters; | |
| 85 | + | |
| 86 | + if ((object)sortedFilterAdapters == null) | |
| 87 | + { | |
| 88 | + sortedFilterAdapters = this | |
| 89 | + .Cast<IFilterAdapter>() | |
| 90 | + .OrderBy(adapter => adapter.ExecutionOrder) | |
| 91 | + .ToList(); | |
| 92 | + | |
| 93 | + m_sortedFilterAdapters = sortedFilterAdapters; | |
| 94 | + } | |
| 95 | + } | |
| 96 | + } | |
| 97 | + | |
| 98 | + foreach (IFilterAdapter adapter in sortedFilterAdapters) | |
| 99 | + { | |
| 100 | + if (adapter.Enabled) | |
| 101 | + adapter.HandleNewMeasurements(measurements); | |
| 102 | + } | |
| 103 | + } | |
| 104 | + | |
| 105 | + /// <summary> | |
| 106 | + /// Attempts to create an <see cref="IAdapter"/> from the specified <see cref="DataRow"/>. | |
| 107 | + /// </summary> | |
| 108 | + /// <param name="adapterRow"><see cref="DataRow"/> containing item information to initialize.</param> | |
| 109 | + /// <param name="adapter">Initialized adapter if successful; otherwise null.</param> | |
| 110 | + /// <returns><c>true</c> if item was successfully initialized; otherwise <c>false</c>.</returns> | |
| 111 | + /// <remarks> | |
| 112 | + /// See <see cref="AdapterCollectionBase{T}.DataSource"/> property for expected <see cref="DataRow"/> column names. | |
| 113 | + /// </remarks> | |
| 114 | + /// <exception cref="NullReferenceException"><paramref name="adapterRow"/> is null.</exception> | |
| 115 | + public override bool TryCreateAdapter(DataRow adapterRow, out IFilterAdapter adapter) | |
| 116 | + { | |
| 117 | + bool success = base.TryCreateAdapter(adapterRow, out adapter); | |
| 118 | + | |
| 119 | + if (success && adapterRow.Table.Columns.Contains("LoadOrder")) | |
| 120 | + adapter.ExecutionOrder = adapterRow.ConvertField<int>("LoadOrder"); | |
| 121 | + | |
| 122 | + return success; | |
| 123 | + } | |
| 124 | + | |
| 125 | + /// <summary> | |
| 126 | + /// Inserts an element into the <see cref="Collection{T}"/> the specified index. | |
| 127 | + /// </summary> | |
| 128 | + /// <param name="index">The zero-based index at which item should be inserted.</param> | |
| 129 | + /// <param name="item">The <see cref="IAdapter"/> implementation to insert.</param> | |
| 130 | + protected override void InsertItem(int index, IFilterAdapter item) | |
| 131 | + { | |
| 132 | + base.InsertItem(index, item); | |
| 133 | + m_sortedFilterAdapters = null; | |
| 134 | + } | |
| 135 | + | |
| 136 | + /// <summary> | |
| 137 | + /// Assigns a new element to the <see cref="Collection{T}"/> at the specified index. | |
| 138 | + /// </summary> | |
| 139 | + /// <param name="index">The zero-based index for which item should be assigned.</param> | |
| 140 | + /// <param name="item">The <see cref="IAdapter"/> implementation to assign.</param> | |
| 141 | + protected override void SetItem(int index, IFilterAdapter item) | |
| 142 | + { | |
| 143 | + base.SetItem(index, item); | |
| 144 | + m_sortedFilterAdapters = null; | |
| 145 | + } | |
| 146 | + | |
| 147 | + /// <summary> | |
| 148 | + /// Removes the element at the specified index of the <see cref="Collection{T}"/>. | |
| 149 | + /// </summary> | |
| 150 | + /// <param name="index">The zero-based index of the element to remove.</param> | |
| 151 | + protected override void RemoveItem(int index) | |
| 152 | + { | |
| 153 | + base.RemoveItem(index); | |
| 154 | + m_sortedFilterAdapters = null; | |
| 155 | + } | |
| 156 | + | |
| 157 | + #endregion | |
| 158 | + } | |
| 159 | +} | |
| @@ -0,0 +1,45 @@ | ||
| 1 | +//****************************************************************************************************** | |
| 2 | +// IFilterAdapter.cs - Gbtc | |
| 3 | +// | |
| 4 | +// Copyright © 2017, Grid Protection Alliance. All Rights Reserved. | |
| 5 | +// | |
| 6 | +// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See | |
| 7 | +// the NOTICE file distributed with this work for additional information regarding copyright ownership. | |
| 8 | +// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may | |
| 9 | +// not use this file except in compliance with the License. You may obtain a copy of the License at: | |
| 10 | +// | |
| 11 | +// http://opensource.org/licenses/MIT | |
| 12 | +// | |
| 13 | +// Unless agreed to in writing, the subject software distributed under the License is distributed on an | |
| 14 | +// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the | |
| 15 | +// License for the specific language governing permissions and limitations. | |
| 16 | +// | |
| 17 | +// Code Modification History: | |
| 18 | +// ---------------------------------------------------------------------------------------------------- | |
| 19 | +// 11/10/2017 - Stephen C. Wills | |
| 20 | +// Generated original version of source code. | |
| 21 | +// | |
| 22 | +//****************************************************************************************************** | |
| 23 | + | |
| 24 | +using System.Collections.Generic; | |
| 25 | + | |
| 26 | +namespace GSF.TimeSeries.Adapters | |
| 27 | +{ | |
| 28 | + /// <summary> | |
| 29 | + /// Represents a module that processes input measurements on | |
| 30 | + /// the way by before routing the measurements to other adapters. | |
| 31 | + /// </summary> | |
| 32 | + public interface IFilterAdapter : IAdapter | |
| 33 | + { | |
| 34 | + /// <summary> | |
| 35 | + /// Gets or sets the values that determines the order in which filter adapters are executed. | |
| 36 | + /// </summary> | |
| 37 | + int ExecutionOrder { get; set; } | |
| 38 | + | |
| 39 | + /// <summary> | |
| 40 | + /// Handler for new measurements that have not yet been routed. | |
| 41 | + /// </summary> | |
| 42 | + /// <param name="measurements">Measurements that have not yet been routed.</param> | |
| 43 | + void HandleNewMeasurements(ICollection<IMeasurement> measurements); | |
| 44 | + } | |
| 45 | +} | |
| @@ -32,6 +32,7 @@ using GSF.Annotations; · 31 unmodified lines | ||
| 32 | 32 | using GSF.Collections; |
| 33 | 33 | using GSF.Configuration; |
| 34 | 34 | using GSF.Diagnostics; |
| 35 | +using System.Collections.Generic; | |
| 35 | 36 | |
| 36 | 37 | // ReSharper disable InconsistentlySynchronizedField |
| 37 | 38 | namespace GSF.TimeSeries.Adapters |
| @@ -117,6 +118,7 @@ namespace GSF.TimeSeries.Adapters · 79 unmodified lines | ||
| 117 | 118 | private Guid m_nodeID; |
| 118 | 119 | private RoutingTables m_routingTables; |
| 119 | 120 | private AllAdaptersCollection m_allAdapters; |
| 121 | + private FilterAdapterCollection m_filterAdapters; | |
| 120 | 122 | private InputAdapterCollection m_inputAdapters; |
| 121 | 123 | private ActionAdapterCollection m_actionAdapters; |
| 122 | 124 | private OutputAdapterCollection m_outputAdapters; |
| @@ -183,12 +185,17 @@ namespace GSF.TimeSeries.Adapters · 60 unmodified lines | ||
| 183 | 185 | m_allAdapters.ConfigurationChanged += ConfigurationChangedHandler; |
| 184 | 186 | m_allAdapters.Disposed += DisposedHandler; |
| 185 | 187 | |
| 188 | + // Create filter adapters collection | |
| 189 | + m_filterAdapters = new FilterAdapterCollection(); | |
| 190 | + | |
| 186 | 191 | // Create input adapters collection |
| 187 | 192 | m_inputAdapters = new InputAdapterCollection(); |
| 193 | + m_inputAdapters.NewMeasurements += NewMeasurementsHandler; | |
| 188 | 194 | m_inputAdapters.ProcessingComplete += ProcessingCompleteHandler; |
| 189 | 195 | |
| 190 | 196 | // Create action adapters collection |
| 191 | 197 | m_actionAdapters = new ActionAdapterCollection(); |
| 198 | + m_actionAdapters.NewMeasurements += NewMeasurementsHandler; | |
| 192 | 199 | m_actionAdapters.UnpublishedSamples += UnpublishedSamplesHandler; |
| 193 | 200 | m_actionAdapters.RequestTemporalSupport += RequestTemporalSupportHandler; |
| 194 | 201 | |
| @@ -201,10 +208,11 @@ namespace GSF.TimeSeries.Adapters · 6 unmodified lines | ||
| 201 | 208 | m_routingTables.ActionAdapters = m_actionAdapters; |
| 202 | 209 | m_routingTables.OutputAdapters = m_outputAdapters; |
| 203 | 210 | |
| 204 | − // We group these adapters such that they are initialized in the following order: output, input, action. This | |
| 205 | − // is done so that the archival capabilities will be setup before we start receiving input and the input data | |
| 206 | − // will be flowing before any actions get established for the input - at least generally. | |
| 211 | + // We group these adapters such that they are initialized in the following order: output, filter, input, action. | |
| 212 | + // This is done so that the archival capabilities will be setup before we start receiving input and the input | |
| 213 | + // data will be flowing before any actions get established for the input - at least generally. | |
| 207 | 214 | m_allAdapters.Add(m_outputAdapters); |
| 215 | + m_allAdapters.Add(m_filterAdapters); | |
| 208 | 216 | m_allAdapters.Add(m_inputAdapters); |
| 209 | 217 | m_allAdapters.Add(m_actionAdapters); |
| 210 | 218 | |
| @@ -234,6 +242,17 @@ namespace GSF.TimeSeries.Adapters · 23 unmodified lines | ||
| 234 | 242 | } |
| 235 | 243 | } |
| 236 | 244 | |
| 245 | + /// <summary> | |
| 246 | + /// Gets the filter adapter collection for this <see cref="IaonSession"/>. | |
| 247 | + /// </summary> | |
| 248 | + public virtual FilterAdapterCollection FilterAdapters | |
| 249 | + { | |
| 250 | + get | |
| 251 | + { | |
| 252 | + return m_filterAdapters; | |
| 253 | + } | |
| 254 | + } | |
| 255 | + | |
| 237 | 256 | /// <summary> |
| 238 | 257 | /// Gets the input adapter collection for this <see cref="IaonSession"/>. |
| 239 | 258 | /// </summary> |
| @@ -347,6 +366,13 @@ namespace GSF.TimeSeries.Adapters · 107 unmodified lines | ||
| 347 | 366 | { |
| 348 | 367 | StringBuilder status = new StringBuilder(); |
| 349 | 368 | |
| 369 | + status.AppendLine(); | |
| 370 | + status.AppendLine(">> Filter Adapters:"); | |
| 371 | + status.AppendLine(); | |
| 372 | + | |
| 373 | + if (m_filterAdapters != null) | |
| 374 | + status.AppendLine(m_filterAdapters.Status); | |
| 375 | + | |
| 350 | 376 | status.AppendLine(); |
| 351 | 377 | status.AppendLine(">> Input Adapters:"); |
| 352 | 378 | status.AppendLine(); |
| @@ -399,19 +425,29 @@ namespace GSF.TimeSeries.Adapters · 46 unmodified lines | ||
| 399 | 425 | { |
| 400 | 426 | DataSet dataSource = DataSource; |
| 401 | 427 | |
| 428 | + // Dispose filter adapters collection | |
| 429 | + if ((object)m_filterAdapters != null) | |
| 430 | + { | |
| 431 | + m_filterAdapters.Stop(); | |
| 432 | + m_filterAdapters.Dispose(); | |
| 433 | + } | |
| 434 | + m_filterAdapters = null; | |
| 435 | + | |
| 402 | 436 | // Dispose input adapters collection |
| 403 | − if (m_inputAdapters != null) | |
| 437 | + if ((object)m_inputAdapters != null) | |
| 404 | 438 | { |
| 405 | 439 | m_inputAdapters.Stop(); |
| 440 | + m_inputAdapters.NewMeasurements -= NewMeasurementsHandler; | |
| 406 | 441 | m_inputAdapters.ProcessingComplete -= ProcessingCompleteHandler; |
| 407 | 442 | m_inputAdapters.Dispose(); |
| 408 | 443 | } |
| 409 | 444 | m_inputAdapters = null; |
| 410 | 445 | |
| 411 | 446 | // Dispose action adapters collection |
| 412 | − if (m_actionAdapters != null) | |
| 447 | + if ((object)m_actionAdapters != null) | |
| 413 | 448 | { |
| 414 | 449 | m_actionAdapters.Stop(); |
| 450 | + m_actionAdapters.NewMeasurements -= NewMeasurementsHandler; | |
| 415 | 451 | m_actionAdapters.UnpublishedSamples -= UnpublishedSamplesHandler; |
| 416 | 452 | m_actionAdapters.RequestTemporalSupport -= RequestTemporalSupportHandler; |
| 417 | 453 | m_actionAdapters.Dispose(); |
| @@ -419,7 +455,7 @@ namespace GSF.TimeSeries.Adapters · 1 unmodified line | ||
| 419 | 455 | m_actionAdapters = null; |
| 420 | 456 | |
| 421 | 457 | // Dispose output adapters collection |
| 422 | − if (m_outputAdapters != null) | |
| 458 | + if ((object)m_outputAdapters != null) | |
| 423 | 459 | { |
| 424 | 460 | m_outputAdapters.Stop(); |
| 425 | 461 | m_outputAdapters.UnprocessedMeasurements -= UnprocessedMeasurementsHandler; |
| @@ -840,6 +876,16 @@ namespace GSF.TimeSeries.Adapters · 414 unmodified lines | ||
| 840 | 876 | OnUnprocessedMeasurements(sender, e.Argument); |
| 841 | 877 | } |
| 842 | 878 | |
| 879 | + /// <summary> | |
| 880 | + /// Event handler for new measurement notifications from input adapters and action adapters. | |
| 881 | + /// </summary> | |
| 882 | + /// <param name="sender">Event source reference to the adapter that is reporting new measurements.</param> | |
| 883 | + /// <param name="e">Event arguments for event that contains references to the new measurements.</param> | |
| 884 | + public virtual void NewMeasurementsHandler(object sender, EventArgs<ICollection<IMeasurement>> e) | |
| 885 | + { | |
| 886 | + m_filterAdapters.HandleNewMeasurements(e.Argument); | |
| 887 | + } | |
| 888 | + | |
| 843 | 889 | /// <summary> |
| 844 | 890 | /// Event handler for processing complete notifications from input adapters. |
| 845 | 891 | /// </summary> |
| @@ -38,7 +38,7 @@ USE GSFSchema; · 37 unmodified lines | ||
| 38 | 38 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 39 | 39 | -- ******************************************************************************************* |
| 40 | 40 | CREATE VIEW SchemaVersion AS |
| 41 | −SELECT 6 AS VersionNumber; | |
| 41 | +SELECT 7 AS VersionNumber; | |
| 42 | 42 | |
| 43 | 43 | CREATE TABLE ErrorLog( |
| 44 | 44 | ID INT AUTO_INCREMENT NOT NULL, |
| @@ -503,6 +503,22 @@ CREATE TABLE CustomInputAdapter( · 458 unmodified lines | ||
| 503 | 503 | CONSTRAINT PK_CustomInputAdapter PRIMARY KEY (ID ASC) |
| 504 | 504 | ); |
| 505 | 505 | |
| 506 | +CREATE TABLE CustomFilterAdapter( | |
| 507 | + NodeID NCHAR(36) NOT NULL, | |
| 508 | + ID INT AUTO_INCREMENT NOT NULL, | |
| 509 | + AdapterName VARCHAR(200) NOT NULL, | |
| 510 | + AssemblyName TEXT NOT NULL, | |
| 511 | + TypeName TEXT NOT NULL, | |
| 512 | + ConnectionString TEXT NULL, | |
| 513 | + LoadOrder INT NOT NULL DEFAULT 0, | |
| 514 | + Enabled TINYINT NOT NULL DEFAULT 0, | |
| 515 | + CreatedOn DATETIME NULL, | |
| 516 | + CreatedBy VARCHAR(200) NULL, | |
| 517 | + UpdatedOn DATETIME NULL, | |
| 518 | + UpdatedBy VARCHAR(200) NULL, | |
| 519 | + CONSTRAINT PK_CustomFilterAdapter PRIMARY KEY (ID ASC) | |
| 520 | +); | |
| 521 | + | |
| 506 | 522 | CREATE TABLE OutputStream( |
| 507 | 523 | NodeID NCHAR(36) NOT NULL, |
| 508 | 524 | ID INT AUTO_INCREMENT NOT NULL, |
| @@ -835,6 +851,8 @@ ALTER TABLE Historian ADD CONSTRAINT FK_Historian_Node FOREIGN KEY(NodeID) REFER · 326 unmodified lines | ||
| 835 | 851 | |
| 836 | 852 | ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE; |
| 837 | 853 | |
| 854 | +ALTER TABLE CustomFilterAdapter ADD CONSTRAINT FK_CustomFilterAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE; | |
| 855 | + | |
| 838 | 856 | ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE; |
| 839 | 857 | |
| 840 | 858 | ALTER TABLE PowerCalculation ADD CONSTRAINT FK_PowerCalculation_Measurement1 FOREIGN KEY(ApparentPowerOutputSignalID) REFERENCES Measurement (SignalID) ON DELETE CASCADE ON UPDATE CASCADE; |
| @@ -958,6 +976,15 @@ FROM CustomInputAdapter LEFT OUTER JOIN · 117 unmodified lines | ||
| 958 | 976 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 959 | 977 | ORDER BY CustomInputAdapter.LoadOrder; |
| 960 | 978 | |
| 979 | +CREATE VIEW RuntimeCustomFilterAdapter | |
| 980 | +AS | |
| 981 | +SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName, | |
| 982 | + TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString | |
| 983 | +FROM CustomFilterAdapter LEFT OUTER JOIN | |
| 984 | + Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = N'CustomFilterAdapter' | |
| 985 | +WHERE (CustomFilterAdapter.Enabled <> 0) | |
| 986 | +ORDER BY CustomFilterAdapter.LoadOrder; | |
| 987 | + | |
| 961 | 988 | CREATE VIEW RuntimeOutputStreamDevice |
| 962 | 989 | AS |
| 963 | 990 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1095,6 +1122,11 @@ FROM RuntimeCalculatedMeasurement · 131 unmodified lines | ||
| 1095 | 1122 | UNION |
| 1096 | 1123 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1097 | 1124 | FROM RuntimeCustomActionAdapter; |
| 1125 | + | |
| 1126 | +CREATE VIEW IaonFilterAdapter | |
| 1127 | +AS | |
| 1128 | +SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | |
| 1129 | +FROM RuntimeCustomFilterAdapter; | |
| 1098 | 1130 | |
| 1099 | 1131 | CREATE VIEW MeasurementDetail |
| 1100 | 1132 | AS |
| @@ -1202,6 +1234,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE( · 101 unmodified lines | ||
| 1202 | 1234 | CA.Enabled, N.Name AS NodeName |
| 1203 | 1235 | FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; |
| 1204 | 1236 | |
| 1237 | +CREATE VIEW CustomFilterAdapterDetail AS | |
| 1238 | +SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder, | |
| 1239 | + CA.Enabled, N.Name AS NodeName | |
| 1240 | +FROM CustomFilterAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; | |
| 1241 | + | |
| 1205 | 1242 | CREATE VIEW IaonTreeView AS |
| 1206 | 1243 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1207 | 1244 | FROM IaonActionAdapter |
| @@ -1210,7 +1247,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, T · 2 unmodified lines | ||
| 1210 | 1247 | FROM IaonInputAdapter |
| 1211 | 1248 | UNION ALL |
| 1212 | 1249 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1213 | −FROM IaonOutputAdapter; | |
| 1250 | +FROM IaonOutputAdapter | |
| 1251 | +UNION ALL | |
| 1252 | +SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | |
| 1253 | +FROM IaonFilterAdapter; | |
| 1214 | 1254 | |
| 1215 | 1255 | CREATE VIEW OtherDeviceDetail AS |
| 1216 | 1256 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, |
| @@ -1360,6 +1400,12 @@ FOR EACH ROW INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, N'Custom · 143 unmodified lines | ||
| 1360 | 1400 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter |
| 1361 | 1401 | FOR EACH ROW DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = N'CustomOutputAdapter'; |
| 1362 | 1402 | |
| 1403 | +CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Insert AFTER INSERT ON CustomFilterAdapter | |
| 1404 | +FOR EACH ROW INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, N'CustomFilterAdapter'); | |
| 1405 | + | |
| 1406 | +CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomFilterAdapter | |
| 1407 | +FOR EACH ROW DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = N'CustomFilterAdapter'; | |
| 1408 | + | |
| 1363 | 1409 | DELIMITER $$ |
| 1364 | 1410 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device FOR EACH ROW |
| 1365 | 1411 | BEGIN |
| @@ -1421,6 +1467,9 @@ FOR EACH ROW SET NEW.CreatedBy = COALESCE(NEW.CreatedBy, USER()), NEW.CreatedOn · 55 unmodified lines | ||
| 1421 | 1467 | CREATE TRIGGER CustomOutputAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapter |
| 1422 | 1468 | FOR EACH ROW SET NEW.CreatedBy = COALESCE(NEW.CreatedBy, USER()), NEW.CreatedOn = COALESCE(NEW.CreatedOn, UTC_TIMESTAMP()), NEW.UpdatedBy = COALESCE(NEW.UpdatedBy, USER()), NEW.UpdatedOn = COALESCE(NEW.UpdatedOn, UTC_TIMESTAMP()); |
| 1423 | 1469 | |
| 1470 | +CREATE TRIGGER CustomFilterAdapter_InsertDefault BEFORE INSERT ON CustomFilterAdapter | |
| 1471 | +FOR EACH ROW SET NEW.CreatedBy = COALESCE(NEW.CreatedBy, USER()), NEW.CreatedOn = COALESCE(NEW.CreatedOn, UTC_TIMESTAMP()), NEW.UpdatedBy = COALESCE(NEW.UpdatedBy, USER()), NEW.UpdatedOn = COALESCE(NEW.UpdatedOn, UTC_TIMESTAMP()); | |
| 1472 | + | |
| 1424 | 1473 | CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device |
| 1425 | 1474 | FOR EACH ROW SET NEW.UniqueID = COALESCE(NEW.UniqueID, UUID()), NEW.CreatedBy = COALESCE(NEW.CreatedBy, USER()), NEW.CreatedOn = COALESCE(NEW.CreatedOn, UTC_TIMESTAMP()), NEW.UpdatedBy = COALESCE(NEW.UpdatedBy, USER()), NEW.UpdatedOn = COALESCE(NEW.UpdatedOn, UTC_TIMESTAMP()); |
| 1426 | 1475 | |
| @@ -39,33 +39,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 38 unmodified lines | ||
| 39 | 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); |
| 40 | 40 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 41 | 41 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39); |
| 42 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 43 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 44 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 45 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 46 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 47 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 48 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 49 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 50 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 51 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1); | |
| 52 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1); | |
| 53 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1); | |
| 54 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1); | |
| 55 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1); | |
| 56 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1); | |
| 57 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1); | |
| 58 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1); | |
| 59 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1); | |
| 60 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1); | |
| 61 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1); | |
| 62 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1); | |
| 63 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1); | |
| 64 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1); | |
| 65 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1); | |
| 66 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1); | |
| 67 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1); | |
| 68 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1); | |
| 42 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 43 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 44 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 45 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 46 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 47 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 48 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 49 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 50 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 51 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1); | |
| 52 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1); | |
| 53 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1); | |
| 54 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1); | |
| 55 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1); | |
| 56 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1); | |
| 57 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1); | |
| 58 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1); | |
| 59 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1); | |
| 60 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1); | |
| 61 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1); | |
| 62 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1); | |
| 63 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1); | |
| 64 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1); | |
| 65 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1); | |
| 66 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1); | |
| 67 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1); | |
| 68 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1); | |
| 69 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1); | |
| 69 | 70 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1); |
| 70 | 71 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 71 | 72 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); |
| @@ -38,7 +38,7 @@ · 37 unmodified lines | ||
| 38 | 38 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 39 | 39 | -- ******************************************************************************************* |
| 40 | 40 | CREATE VIEW SchemaVersion AS |
| 41 | −SELECT 6 AS VersionNumber | |
| 41 | +SELECT 7 AS VersionNumber | |
| 42 | 42 | FROM dual; |
| 43 | 43 | |
| 44 | 44 | CREATE TABLE ErrorLog( |
| @@ -755,6 +755,32 @@ CREATE TRIGGER AI_CustomInputAdapter BEFORE INSERT ON CustomInputAdapter · 710 unmodified lines | ||
| 755 | 755 | END; |
| 756 | 756 | / |
| 757 | 757 | |
| 758 | +CREATE TABLE CustomFilterAdapter( | |
| 759 | + NodeID VARCHAR2(36) NOT NULL, | |
| 760 | + ID NUMBER NOT NULL, | |
| 761 | + AdapterName VARCHAR2(200) NOT NULL, | |
| 762 | + AssemblyName VARCHAR2(4000) NOT NULL, | |
| 763 | + TypeName VARCHAR2(4000) NOT NULL, | |
| 764 | + ConnectionString VARCHAR2(4000) NULL, | |
| 765 | + LoadOrder NUMBER DEFAULT 0 NOT NULL, | |
| 766 | + Enabled NUMBER DEFAULT 0 NOT NULL, | |
| 767 | + CreatedOn DATE NOT NULL, | |
| 768 | + CreatedBy VARCHAR2(200) NOT NULL, | |
| 769 | + UpdatedOn DATE NOT NULL, | |
| 770 | + UpdatedBy VARCHAR2(200) NOT NULL | |
| 771 | +); | |
| 772 | + | |
| 773 | +CREATE UNIQUE INDEX IX_CustomFilterAdapter ON CustomFilterAdapter (ID ASC) TABLESPACE GSFSchema_INDEX; | |
| 774 | + | |
| 775 | +ALTER TABLE CustomFilterAdapter ADD CONSTRAINT PK_CustomFilterAdapter PRIMARY KEY (ID); | |
| 776 | + | |
| 777 | +CREATE SEQUENCE SEQ_CustomFilterAdapter START WITH 1 INCREMENT BY 1; | |
| 778 | + | |
| 779 | +CREATE TRIGGER AI_CustomFilterAdapter BEFORE INSERT ON CustomFilterAdapter | |
| 780 | + FOR EACH ROW BEGIN SELECT SEQ_CustomFilterAdapter.nextval INTO :NEW.ID FROM dual; | |
| 781 | +END; | |
| 782 | +/ | |
| 783 | + | |
| 758 | 784 | CREATE TABLE OutputStream( |
| 759 | 785 | NodeID VARCHAR2(36) NOT NULL, |
| 760 | 786 | ID NUMBER NOT NULL, |
| @@ -1180,6 +1206,8 @@ ALTER TABLE Historian ADD CONSTRAINT FK_Historian_Node FOREIGN KEY(NodeID) REFER · 419 unmodified lines | ||
| 1180 | 1206 | |
| 1181 | 1207 | ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE; |
| 1182 | 1208 | |
| 1209 | +ALTER TABLE CustomFilterAdapter ADD CONSTRAINT FK_CustomFilterAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE; | |
| 1210 | + | |
| 1183 | 1211 | ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE; |
| 1184 | 1212 | |
| 1185 | 1213 | ALTER TABLE PowerCalculation ADD CONSTRAINT FK_PowerCalculation_Measurement1 FOREIGN KEY(ApparentPowerOutputSignalID) REFERENCES Measurement (SignalID) ON DELETE CASCADE; |
| @@ -1333,6 +1361,15 @@ FROM CustomInputAdapter LEFT OUTER JOIN · 147 unmodified lines | ||
| 1333 | 1361 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 1334 | 1362 | ORDER BY CustomInputAdapter.LoadOrder; |
| 1335 | 1363 | |
| 1364 | +CREATE VIEW RuntimeCustomFilterAdapter | |
| 1365 | +AS | |
| 1366 | +SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName, | |
| 1367 | + TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString | |
| 1368 | +FROM CustomFilterAdapter LEFT OUTER JOIN | |
| 1369 | + Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = 'CustomFilterAdapter' | |
| 1370 | +WHERE (CustomFilterAdapter.Enabled <> 0) | |
| 1371 | +ORDER BY CustomFilterAdapter.LoadOrder; | |
| 1372 | + | |
| 1336 | 1373 | CREATE VIEW RuntimeOutputStreamDevice |
| 1337 | 1374 | AS |
| 1338 | 1375 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1471,6 +1508,11 @@ FROM RuntimeCalculatedMeasurement · 132 unmodified lines | ||
| 1471 | 1508 | UNION ALL |
| 1472 | 1509 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1473 | 1510 | FROM RuntimeCustomActionAdapter; |
| 1511 | + | |
| 1512 | +CREATE VIEW IaonFilterAdapter | |
| 1513 | +AS | |
| 1514 | +SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | |
| 1515 | +FROM RuntimeCustomFilterAdapter; | |
| 1474 | 1516 | |
| 1475 | 1517 | CREATE VIEW MeasurementDetail |
| 1476 | 1518 | AS |
| @@ -1582,6 +1624,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, CA.Connec · 105 unmodified lines | ||
| 1582 | 1624 | CA.Enabled, N.Name AS NodeName |
| 1583 | 1625 | FROM CustomOutputAdapter CA INNER JOIN Node N ON CA.NodeID = N.ID; |
| 1584 | 1626 | |
| 1627 | +CREATE VIEW CustomFilterAdapterDetail AS | |
| 1628 | +SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, CA.ConnectionString AS ConnectionString, CA.LoadOrder, | |
| 1629 | + CA.Enabled, N.Name AS NodeName | |
| 1630 | +FROM CustomFilterAdapter CA INNER JOIN Node N ON CA.NodeID = N.ID; | |
| 1631 | + | |
| 1585 | 1632 | CREATE VIEW IaonTreeView AS |
| 1586 | 1633 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString |
| 1587 | 1634 | FROM IaonActionAdapter |
| @@ -1590,7 +1637,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, T · 2 unmodified lines | ||
| 1590 | 1637 | FROM IaonInputAdapter |
| 1591 | 1638 | UNION ALL |
| 1592 | 1639 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString |
| 1593 | −FROM IaonOutputAdapter; | |
| 1640 | +FROM IaonOutputAdapter | |
| 1641 | +UNION ALL | |
| 1642 | +SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString | |
| 1643 | +FROM IaonFilterAdapter; | |
| 1594 | 1644 | |
| 1595 | 1645 | CREATE VIEW OtherDeviceDetail AS |
| 1596 | 1646 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, |
| @@ -1800,6 +1850,16 @@ CREATE TRIGGER CustOutAdaptr_RuntimeSync_Del BEFORE DELETE ON CustomOutputAdapte · 203 unmodified lines | ||
| 1800 | 1850 | END; |
| 1801 | 1851 | / |
| 1802 | 1852 | |
| 1853 | +CREATE TRIGGER CustFtrAdaptr_RuntimeSync_Insrt AFTER INSERT ON CustomFilterAdapter | |
| 1854 | + FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(:NEW.ID, 'CustomFilterAdapter'); | |
| 1855 | +END; | |
| 1856 | +/ | |
| 1857 | + | |
| 1858 | +CREATE TRIGGER CustFtrAdaptr_RuntimeSync_Del BEFORE DELETE ON CustomFilterAdapter | |
| 1859 | + FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = :OLD.ID AND SourceTable = 'CustomFilterAdapter'; | |
| 1860 | +END; | |
| 1861 | +/ | |
| 1862 | + | |
| 1803 | 1863 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device |
| 1804 | 1864 | FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(:NEW.ID, 'Device'); |
| 1805 | 1865 | END; |
| @@ -2015,6 +2075,25 @@ CREATE TRIGGER CustomOutAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapt · 209 unmodified lines | ||
| 2015 | 2075 | END; |
| 2016 | 2076 | / |
| 2017 | 2077 | |
| 2078 | +CREATE TRIGGER CustFtrAdapter_InsertDefault BEFORE INSERT ON CustomFilterAdapter FOR EACH ROW BEGIN | |
| 2079 | + IF :NEW.CreatedBy IS NULL THEN | |
| 2080 | + SELECT USER INTO :NEW.CreatedBy FROM dual; | |
| 2081 | + END IF; | |
| 2082 | + | |
| 2083 | + IF :NEW.CreatedOn IS NULL THEN | |
| 2084 | + SELECT SYSDATE INTO :NEW.CreatedOn FROM dual; | |
| 2085 | + END IF; | |
| 2086 | + | |
| 2087 | + IF :NEW.UpdatedBy IS NULL THEN | |
| 2088 | + SELECT USER INTO :NEW.UpdatedBy FROM dual; | |
| 2089 | + END IF; | |
| 2090 | + | |
| 2091 | + IF :NEW.UpdatedOn IS NULL THEN | |
| 2092 | + SELECT SYSDATE INTO :NEW.UpdatedOn FROM dual; | |
| 2093 | + END IF; | |
| 2094 | +END; | |
| 2095 | +/ | |
| 2096 | + | |
| 2018 | 2097 | CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device FOR EACH ROW BEGIN |
| 2019 | 2098 | IF :NEW.UniqueID IS NULL THEN |
| 2020 | 2099 | SELECT NEW_GUID() INTO :NEW.UniqueID FROM dual; |
| @@ -37,33 +37,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 36 unmodified lines | ||
| 37 | 37 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas &' || ' Electric', 37); |
| 38 | 38 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 39 | 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39); |
| 40 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 41 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 42 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 43 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 44 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 45 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 46 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 47 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 48 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 49 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1); | |
| 50 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1); | |
| 51 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1); | |
| 52 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1); | |
| 53 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1); | |
| 54 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1); | |
| 55 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1); | |
| 56 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1); | |
| 57 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1); | |
| 58 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1); | |
| 59 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1); | |
| 60 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1); | |
| 61 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1); | |
| 62 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1); | |
| 63 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1); | |
| 64 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1); | |
| 65 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1); | |
| 66 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1); | |
| 40 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 41 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 42 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 43 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 44 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 45 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 46 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 47 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 48 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 49 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1); | |
| 50 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1); | |
| 51 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1); | |
| 52 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1); | |
| 53 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1); | |
| 54 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1); | |
| 55 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1); | |
| 56 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1); | |
| 57 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1); | |
| 58 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1); | |
| 59 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1); | |
| 60 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1); | |
| 61 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1); | |
| 62 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1); | |
| 63 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1); | |
| 64 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1); | |
| 65 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1); | |
| 66 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1); | |
| 67 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1); | |
| 67 | 68 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1); |
| 68 | 69 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 69 | 70 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); |
| @@ -36,7 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 37 | 37 | -- ******************************************************************************************* |
| 38 | 38 | CREATE VIEW SchemaVersion AS |
| 39 | −SELECT 6 AS VersionNumber; | |
| 39 | +SELECT 7 AS VersionNumber; | |
| 40 | 40 | |
| 41 | 41 | CREATE EXTENSION "uuid-ossp"; |
| 42 | 42 | |
| @@ -555,6 +555,22 @@ CREATE TABLE CustomInputAdapter( · 512 unmodified lines | ||
| 555 | 555 | CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE |
| 556 | 556 | ); |
| 557 | 557 | |
| 558 | +CREATE TABLE CustomFilterAdapter( | |
| 559 | + NodeID NCHAR(36) NOT NULL, | |
| 560 | + ID SERIAL NOT NULL PRIMARY KEY, | |
| 561 | + AdapterName VARCHAR(200) NOT NULL, | |
| 562 | + AssemblyName TEXT NOT NULL, | |
| 563 | + TypeName TEXT NOT NULL, | |
| 564 | + ConnectionString TEXT NULL, | |
| 565 | + LoadOrder INTEGER NOT NULL DEFAULT 0, | |
| 566 | + Enabled SMALLINT NOT NULL DEFAULT 0, | |
| 567 | + CreatedOn TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 568 | + CreatedBy VARCHAR(200) NOT NULL DEFAULT '', | |
| 569 | + UpdatedOn TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 570 | + UpdatedBy VARCHAR(200) NOT NULL DEFAULT '', | |
| 571 | + CONSTRAINT FK_CustomFilterAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE | |
| 572 | +); | |
| 573 | + | |
| 558 | 574 | CREATE TABLE PowerCalculation( |
| 559 | 575 | NodeID NCHAR(36) NULL, |
| 560 | 576 | ID SERIAL NOT NULL PRIMARY KEY, |
| @@ -871,6 +887,15 @@ FROM CustomInputAdapter LEFT OUTER JOIN · 310 unmodified lines | ||
| 871 | 887 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 872 | 888 | ORDER BY CustomInputAdapter.LoadOrder; |
| 873 | 889 | |
| 890 | +CREATE VIEW RuntimeCustomFilterAdapter | |
| 891 | +AS | |
| 892 | +SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName, | |
| 893 | + TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString | |
| 894 | +FROM CustomFilterAdapter LEFT OUTER JOIN | |
| 895 | + Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = 'CustomFilterAdapter' | |
| 896 | +WHERE (CustomFilterAdapter.Enabled <> 0) | |
| 897 | +ORDER BY CustomFilterAdapter.LoadOrder; | |
| 898 | + | |
| 874 | 899 | CREATE VIEW RuntimeOutputStreamDevice |
| 875 | 900 | AS |
| 876 | 901 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1013,6 +1038,11 @@ FROM RuntimeCalculatedMeasurement · 136 unmodified lines | ||
| 1013 | 1038 | UNION |
| 1014 | 1039 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1015 | 1040 | FROM RuntimeCustomActionAdapter; |
| 1041 | + | |
| 1042 | +CREATE VIEW IaonFilterAdapter | |
| 1043 | +AS | |
| 1044 | +SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | |
| 1045 | +FROM RuntimeCustomFilterAdapter; | |
| 1016 | 1046 | |
| 1017 | 1047 | CREATE VIEW MeasurementDetail |
| 1018 | 1048 | AS |
| @@ -1124,6 +1154,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALE · 105 unmodified lines | ||
| 1124 | 1154 | CA.Enabled, N.Name AS NodeName |
| 1125 | 1155 | FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; |
| 1126 | 1156 | |
| 1157 | +CREATE VIEW CustomFilterAdapterDetail AS | |
| 1158 | +SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder, | |
| 1159 | + CA.Enabled, N.Name AS NodeName | |
| 1160 | +FROM CustomFilterAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; | |
| 1161 | + | |
| 1127 | 1162 | CREATE VIEW IaonTreeView AS |
| 1128 | 1163 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1129 | 1164 | FROM IaonActionAdapter |
| @@ -1132,7 +1167,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyNam · 2 unmodified lines | ||
| 1132 | 1167 | FROM IaonInputAdapter |
| 1133 | 1168 | UNION ALL |
| 1134 | 1169 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1135 | −FROM IaonOutputAdapter; | |
| 1170 | +FROM IaonOutputAdapter | |
| 1171 | +UNION ALL | |
| 1172 | +SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | |
| 1173 | +FROM IaonFilterAdapter; | |
| 1136 | 1174 | |
| 1137 | 1175 | CREATE VIEW OtherDeviceDetail AS |
| 1138 | 1176 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, |
| @@ -1332,6 +1370,30 @@ $CustomOutputAdapter_RuntimeSync_DeleteFn$ LANGUAGE plpgsql; · 193 unmodified lines | ||
| 1332 | 1370 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter |
| 1333 | 1371 | FOR EACH ROW EXECUTE PROCEDURE CustomOutputAdapter_RuntimeSync_DeleteFn(); |
| 1334 | 1372 | |
| 1373 | +-- CustomFilterAdapter_RuntimeSync_Insert -- | |
| 1374 | +CREATE FUNCTION CustomFilterAdapter_RuntimeSync_InsertFn() RETURNS TRIGGER | |
| 1375 | +AS $CustomFilterAdapter_RuntimeSync_InsertFn$ | |
| 1376 | +BEGIN | |
| 1377 | + INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'CustomFilterAdapter'); | |
| 1378 | + RETURN NEW; | |
| 1379 | +END; | |
| 1380 | +$CustomFilterAdapter_RuntimeSync_InsertFn$ LANGUAGE plpgsql; | |
| 1381 | + | |
| 1382 | +CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Insert AFTER INSERT ON CustomFilterAdapter | |
| 1383 | +FOR EACH ROW EXECUTE PROCEDURE CustomFilterAdapter_RuntimeSync_InsertFn(); | |
| 1384 | + | |
| 1385 | +-- CustomFilterAdapter_RuntimeSync_Delete -- | |
| 1386 | +CREATE FUNCTION CustomFilterAdapter_RuntimeSync_DeleteFn() RETURNS TRIGGER | |
| 1387 | +AS $CustomFilterAdapter_RuntimeSync_DeleteFn$ | |
| 1388 | +BEGIN | |
| 1389 | + DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomFilterAdapter'; | |
| 1390 | + RETURN OLD; | |
| 1391 | +END; | |
| 1392 | +$CustomFilterAdapter_RuntimeSync_DeleteFn$ LANGUAGE plpgsql; | |
| 1393 | + | |
| 1394 | +CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomFilterAdapter | |
| 1395 | +FOR EACH ROW EXECUTE PROCEDURE CustomFilterAdapter_RuntimeSync_DeleteFn(); | |
| 1396 | + | |
| 1335 | 1397 | -- Device_RuntimeSync_Insert -- |
| 1336 | 1398 | CREATE FUNCTION Device_RuntimeSync_InsertFn() RETURNS TRIGGER |
| 1337 | 1399 | AS $Device_RuntimeSync_InsertFn$ |
| @@ -37,33 +37,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 36 unmodified lines | ||
| 37 | 37 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); |
| 38 | 38 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 39 | 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39); |
| 40 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 41 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 42 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 43 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 44 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 45 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 46 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 47 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 48 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 49 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1); | |
| 50 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1); | |
| 51 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1); | |
| 52 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1); | |
| 53 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1); | |
| 54 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1); | |
| 55 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1); | |
| 56 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1); | |
| 57 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1); | |
| 58 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1); | |
| 59 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1); | |
| 60 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1); | |
| 61 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1); | |
| 62 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1); | |
| 63 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1); | |
| 64 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1); | |
| 65 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1); | |
| 66 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1); | |
| 40 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 41 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 42 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 43 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 44 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 45 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 46 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 47 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 48 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 49 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1); | |
| 50 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1); | |
| 51 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1); | |
| 52 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1); | |
| 53 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1); | |
| 54 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1); | |
| 55 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1); | |
| 56 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1); | |
| 57 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1); | |
| 58 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1); | |
| 59 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1); | |
| 60 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1); | |
| 61 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1); | |
| 62 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1); | |
| 63 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1); | |
| 64 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1); | |
| 65 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1); | |
| 66 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1); | |
| 67 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1); | |
| 67 | 68 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1); |
| 68 | 69 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 69 | 70 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); |
| @@ -116,7 +116,7 @@ GO · 115 unmodified lines | ||
| 116 | 116 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 117 | 117 | -- ******************************************************************************************* |
| 118 | 118 | CREATE VIEW [dbo].[SchemaVersion] AS |
| 119 | −SELECT 6 AS VersionNumber | |
| 119 | +SELECT 7 AS VersionNumber | |
| 120 | 120 | GO |
| 121 | 121 | |
| 122 | 122 | SET ANSI_NULLS ON |
| @@ -1015,6 +1015,63 @@ BEGIN · 892 unmodified lines | ||
| 1015 | 1015 | END |
| 1016 | 1016 | |
| 1017 | 1017 | |
| 1018 | +GO | |
| 1019 | +SET ANSI_NULLS ON | |
| 1020 | +GO | |
| 1021 | +SET QUOTED_IDENTIFIER ON | |
| 1022 | +GO | |
| 1023 | +CREATE TABLE [dbo].[CustomFilterAdapter]( | |
| 1024 | + [NodeID] [uniqueidentifier] NOT NULL, | |
| 1025 | + [ID] [int] IDENTITY(1,1) NOT NULL, | |
| 1026 | + [AdapterName] [varchar](200) NOT NULL, | |
| 1027 | + [AssemblyName] [varchar](max) NOT NULL, | |
| 1028 | + [TypeName] [varchar](max) NOT NULL, | |
| 1029 | + [ConnectionString] [varchar](max) NULL, | |
| 1030 | + [LoadOrder] [int] NOT NULL CONSTRAINT [DF_CustomFilterAdapter_LoadOrder] DEFAULT ((0)), | |
| 1031 | + [Enabled] [bit] NOT NULL CONSTRAINT [DF_CustomFilterAdapter_Enabled] DEFAULT ((0)), | |
| 1032 | + [CreatedOn] [datetime] NOT NULL CONSTRAINT [DF_CustomFilterAdapter_CreatedOn] DEFAULT (getutcdate()), | |
| 1033 | + [CreatedBy] [varchar](200) NOT NULL CONSTRAINT [DF_CustomFilterAdapter_CreatedBy] DEFAULT (suser_name()), | |
| 1034 | + [UpdatedOn] [datetime] NOT NULL CONSTRAINT [DF_CustomFilterAdapter_UpdatedOn] DEFAULT (getutcdate()), | |
| 1035 | + [UpdatedBy] [varchar](200) NOT NULL CONSTRAINT [DF_CustomFilterAdapter_UpdatedBy] DEFAULT (suser_name()), | |
| 1036 | + CONSTRAINT [PK_CustomFilterAdapter] PRIMARY KEY CLUSTERED | |
| 1037 | +( | |
| 1038 | + [ID] ASC | |
| 1039 | +)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] | |
| 1040 | +) ON [PRIMARY] | |
| 1041 | + | |
| 1042 | +GO | |
| 1043 | + | |
| 1044 | +SET ANSI_NULLS ON | |
| 1045 | +GO | |
| 1046 | + | |
| 1047 | +SET QUOTED_IDENTIFIER ON | |
| 1048 | +GO | |
| 1049 | + | |
| 1050 | +CREATE TRIGGER [dbo].[CustomFilterAdapter_RuntimeSync] | |
| 1051 | + ON [dbo].[CustomFilterAdapter] | |
| 1052 | + AFTER INSERT, DELETE | |
| 1053 | +AS | |
| 1054 | +BEGIN | |
| 1055 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
| 1056 | + -- interfering with SELECT statements. | |
| 1057 | + SET NOCOUNT ON; | |
| 1058 | + | |
| 1059 | + -- If a new record has been added | |
| 1060 | + IF EXISTS(SELECT * FROM INSERTED) | |
| 1061 | + BEGIN | |
| 1062 | + INSERT INTO Runtime (SourceID, SourceTable) | |
| 1063 | + SELECT ID, 'CustomFilterAdapter' FROM INSERTED | |
| 1064 | + END | |
| 1065 | + | |
| 1066 | + -- If a record has been deleted | |
| 1067 | + IF EXISTS(SELECT * FROM DELETED) | |
| 1068 | + BEGIN | |
| 1069 | + DELETE FROM Runtime WHERE SourceID IN (SELECT ID FROM DELETED) AND SourceTable = 'CustomFilterAdapter' | |
| 1070 | + END | |
| 1071 | + | |
| 1072 | +END | |
| 1073 | + | |
| 1074 | + | |
| 1018 | 1075 | GO |
| 1019 | 1076 | SET ANSI_NULLS ON |
| 1020 | 1077 | GO |
| @@ -1955,6 +2012,20 @@ FROM dbo.CustomInputAdapter WITH (NOLOCK) LEFT OUTER JOIN · 934 unmodified lines | ||
| 1955 | 2012 | WHERE (dbo.CustomInputAdapter.Enabled <> 0) |
| 1956 | 2013 | ORDER BY dbo.CustomInputAdapter.LoadOrder |
| 1957 | 2014 | |
| 2015 | +GO | |
| 2016 | +SET ANSI_NULLS ON | |
| 2017 | +GO | |
| 2018 | +SET QUOTED_IDENTIFIER ON | |
| 2019 | +GO | |
| 2020 | +CREATE VIEW [dbo].[RuntimeCustomFilterAdapter] | |
| 2021 | +AS | |
| 2022 | +SELECT TOP (100) PERCENT dbo.CustomFilterAdapter.NodeID, dbo.Runtime.ID, dbo.CustomFilterAdapter.AdapterName, | |
| 2023 | + LTRIM(RTRIM(dbo.CustomFilterAdapter.AssemblyName)) AS AssemblyName, LTRIM(RTRIM(dbo.CustomFilterAdapter.TypeName)) AS TypeName, dbo.CustomFilterAdapter.ConnectionString | |
| 2024 | +FROM dbo.CustomFilterAdapter WITH (NOLOCK) LEFT OUTER JOIN | |
| 2025 | + dbo.Runtime WITH (NOLOCK) ON dbo.CustomFilterAdapter.ID = dbo.Runtime.SourceID AND dbo.Runtime.SourceTable = N'CustomFilterAdapter' | |
| 2026 | +WHERE (dbo.CustomFilterAdapter.Enabled <> 0) | |
| 2027 | +ORDER BY dbo.CustomFilterAdapter.LoadOrder | |
| 2028 | + | |
| 1958 | 2029 | GO |
| 1959 | 2030 | SET ANSI_NULLS ON |
| 1960 | 2031 | GO |
| @@ -2167,6 +2238,16 @@ UNION · 206 unmodified lines | ||
| 2167 | 2238 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 2168 | 2239 | FROM dbo.RuntimeCustomActionAdapter WITH (NOLOCK) |
| 2169 | 2240 | |
| 2241 | +GO | |
| 2242 | +SET ANSI_NULLS ON | |
| 2243 | +GO | |
| 2244 | +SET QUOTED_IDENTIFIER ON | |
| 2245 | +GO | |
| 2246 | +CREATE VIEW [dbo].[IaonFilterAdapter] | |
| 2247 | +AS | |
| 2248 | +SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | |
| 2249 | +FROM dbo.RuntimeCustomFilterAdapter WITH (NOLOCK) | |
| 2250 | + | |
| 2170 | 2251 | GO |
| 2171 | 2252 | CREATE VIEW [dbo].[HistorianMetadata] |
| 2172 | 2253 | AS |
| @@ -2316,6 +2397,12 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, ISNUL · 143 unmodified lines | ||
| 2316 | 2397 | FROM dbo.CustomOutputAdapter AS CA WITH (NOLOCK) INNER JOIN |
| 2317 | 2398 | dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID |
| 2318 | 2399 | GO |
| 2400 | +CREATE VIEW [dbo].[CustomFilterAdapterDetail] AS | |
| 2401 | +SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, ISNULL(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder, | |
| 2402 | + CA.Enabled, N.Name AS NodeName | |
| 2403 | +FROM dbo.CustomFilterAdapter AS CA WITH (NOLOCK) INNER JOIN | |
| 2404 | + dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID | |
| 2405 | +GO | |
| 2319 | 2406 | CREATE VIEW [dbo].[IaonTreeView] AS |
| 2320 | 2407 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString |
| 2321 | 2408 | FROM dbo.IaonActionAdapter WITH (NOLOCK) |
| @@ -2325,6 +2412,9 @@ FROM dbo.IaonInputAdapter WITH (NOLOCK) · 3 unmodified lines | ||
| 2325 | 2412 | UNION ALL |
| 2326 | 2413 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString |
| 2327 | 2414 | FROM dbo.IaonOutputAdapter WITH (NOLOCK) |
| 2415 | +UNION ALL | |
| 2416 | +SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString | |
| 2417 | +FROM dbo.IaonFilterAdapter WITH (NOLOCK) | |
| 2328 | 2418 | GO |
| 2329 | 2419 | CREATE VIEW [dbo].[OtherDeviceDetail] AS |
| 2330 | 2420 | SELECT OD.ID, OD.Acronym, ISNULL(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, |
| @@ -2539,6 +2629,11 @@ REFERENCES [dbo].[Node] ([ID]) · 208 unmodified lines | ||
| 2539 | 2629 | ON UPDATE CASCADE |
| 2540 | 2630 | ON DELETE CASCADE |
| 2541 | 2631 | GO |
| 2632 | +ALTER TABLE [dbo].[CustomFilterAdapter] WITH CHECK ADD CONSTRAINT [FK_CustomFilterAdapter_Node] FOREIGN KEY([NodeID]) | |
| 2633 | +REFERENCES [dbo].[Node] ([ID]) | |
| 2634 | +ON UPDATE CASCADE | |
| 2635 | +ON DELETE CASCADE | |
| 2636 | +GO | |
| 2542 | 2637 | ALTER TABLE [dbo].[OutputStream] WITH CHECK ADD CONSTRAINT [FK_OutputStream_Node] FOREIGN KEY([NodeID]) |
| 2543 | 2638 | REFERENCES [dbo].[Node] ([ID]) |
| 2544 | 2639 | ON UPDATE CASCADE |
| @@ -118,85 +118,88 @@ GO · 117 unmodified lines | ||
| 118 | 118 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39) |
| 119 | 119 | GO |
| 120 | 120 | |
| 121 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40) | |
| 121 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40) | |
| 122 | 122 | GO |
| 123 | 123 | |
| 124 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41) | |
| 124 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41) | |
| 125 | 125 | GO |
| 126 | 126 | |
| 127 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42) | |
| 127 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42) | |
| 128 | 128 | GO |
| 129 | 129 | |
| 130 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43) | |
| 130 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43) | |
| 131 | 131 | GO |
| 132 | 132 | |
| 133 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44) | |
| 133 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44) | |
| 134 | 134 | GO |
| 135 | 135 | |
| 136 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45) | |
| 136 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45) | |
| 137 | 137 | GO |
| 138 | 138 | |
| 139 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46) | |
| 139 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46) | |
| 140 | 140 | GO |
| 141 | 141 | |
| 142 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47) | |
| 142 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47) | |
| 143 | 143 | GO |
| 144 | 144 | |
| 145 | 145 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48) |
| 146 | 146 | GO |
| 147 | 147 | |
| 148 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1) | |
| 148 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1) | |
| 149 | 149 | GO |
| 150 | 150 | |
| 151 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1) | |
| 151 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1) | |
| 152 | 152 | GO |
| 153 | 153 | |
| 154 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1) | |
| 154 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1) | |
| 155 | 155 | GO |
| 156 | 156 | |
| 157 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1) | |
| 157 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1) | |
| 158 | 158 | GO |
| 159 | 159 | |
| 160 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1) | |
| 160 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1) | |
| 161 | 161 | GO |
| 162 | 162 | |
| 163 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1) | |
| 163 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1) | |
| 164 | 164 | GO |
| 165 | 165 | |
| 166 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines the measurements in an output stream', 7, 1) | |
| 166 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1) | |
| 167 | 167 | GO |
| 168 | 168 | |
| 169 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1) | |
| 169 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines the measurements in an output stream', 8, 1) | |
| 170 | 170 | GO |
| 171 | 171 | |
| 172 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1) | |
| 172 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1) | |
| 173 | 173 | GO |
| 174 | 174 | |
| 175 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1) | |
| 175 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1) | |
| 176 | 176 | GO |
| 177 | 177 | |
| 178 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1) | |
| 178 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1) | |
| 179 | 179 | GO |
| 180 | 180 | |
| 181 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1) | |
| 181 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1) | |
| 182 | 182 | GO |
| 183 | 183 | |
| 184 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1) | |
| 184 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1) | |
| 185 | 185 | GO |
| 186 | 186 | |
| 187 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1) | |
| 187 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1) | |
| 188 | 188 | GO |
| 189 | 189 | |
| 190 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1) | |
| 190 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1) | |
| 191 | 191 | GO |
| 192 | 192 | |
| 193 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1) | |
| 193 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1) | |
| 194 | 194 | GO |
| 195 | 195 | |
| 196 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1) | |
| 196 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1) | |
| 197 | 197 | GO |
| 198 | 198 | |
| 199 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1) | |
| 199 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1) | |
| 200 | +GO | |
| 201 | + | |
| 202 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1) | |
| 200 | 203 | GO |
| 201 | 204 | |
| 202 | 205 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1) |
| @@ -33,7 +33,7 @@ PRAGMA foreign_keys = ON; · 32 unmodified lines | ||
| 33 | 33 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 34 | 34 | -- ******************************************************************************************* |
| 35 | 35 | CREATE VIEW SchemaVersion AS |
| 36 | −SELECT 6 AS VersionNumber; | |
| 36 | +SELECT 7 AS VersionNumber; | |
| 37 | 37 | |
| 38 | 38 | CREATE TABLE ErrorLog( |
| 39 | 39 | ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, |
| @@ -507,6 +507,22 @@ CREATE TABLE CustomInputAdapter( · 467 unmodified lines | ||
| 507 | 507 | CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE |
| 508 | 508 | ); |
| 509 | 509 | |
| 510 | +CREATE TABLE CustomFilterAdapter( | |
| 511 | + NodeID NCHAR(36) NOT NULL, | |
| 512 | + ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | |
| 513 | + AdapterName VARCHAR(200) NOT NULL, | |
| 514 | + AssemblyName TEXT NOT NULL, | |
| 515 | + TypeName TEXT NOT NULL, | |
| 516 | + ConnectionString TEXT NULL, | |
| 517 | + LoadOrder INTEGER NOT NULL DEFAULT 0, | |
| 518 | + Enabled BOOLEAN NOT NULL DEFAULT 0, | |
| 519 | + CreatedOn DATETIME NOT NULL DEFAULT '', | |
| 520 | + CreatedBy VARCHAR(200) NOT NULL DEFAULT '', | |
| 521 | + UpdatedOn DATETIME NOT NULL DEFAULT '', | |
| 522 | + UpdatedBy VARCHAR(200) NOT NULL DEFAULT '', | |
| 523 | + CONSTRAINT FK_CustomFilterAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE | |
| 524 | +); | |
| 525 | + | |
| 510 | 526 | CREATE TABLE OutputStream( |
| 511 | 527 | NodeID NCHAR(36) NOT NULL, |
| 512 | 528 | ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, |
| @@ -862,6 +878,15 @@ FROM CustomInputAdapter LEFT OUTER JOIN · 349 unmodified lines | ||
| 862 | 878 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 863 | 879 | ORDER BY CustomInputAdapter.LoadOrder; |
| 864 | 880 | |
| 881 | +CREATE VIEW RuntimeCustomFilterAdapter | |
| 882 | +AS | |
| 883 | +SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName, | |
| 884 | + TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString | |
| 885 | +FROM CustomFilterAdapter LEFT OUTER JOIN | |
| 886 | + Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = 'CustomFilterAdapter' | |
| 887 | +WHERE (CustomFilterAdapter.Enabled <> 0) | |
| 888 | +ORDER BY CustomFilterAdapter.LoadOrder; | |
| 889 | + | |
| 865 | 890 | CREATE VIEW RuntimeOutputStreamDevice |
| 866 | 891 | AS |
| 867 | 892 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1004,6 +1029,11 @@ FROM RuntimeCalculatedMeasurement · 136 unmodified lines | ||
| 1004 | 1029 | UNION |
| 1005 | 1030 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1006 | 1031 | FROM RuntimeCustomActionAdapter; |
| 1032 | + | |
| 1033 | +CREATE VIEW IaonFilterAdapter | |
| 1034 | +AS | |
| 1035 | +SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | |
| 1036 | +FROM RuntimeCustomFilterAdapter; | |
| 1007 | 1037 | |
| 1008 | 1038 | CREATE VIEW MeasurementDetail |
| 1009 | 1039 | AS |
| @@ -1115,6 +1145,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALE · 105 unmodified lines | ||
| 1115 | 1145 | CA.Enabled, N.Name AS NodeName |
| 1116 | 1146 | FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; |
| 1117 | 1147 | |
| 1148 | +CREATE VIEW CustomFilterAdapterDetail AS | |
| 1149 | +SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder, | |
| 1150 | + CA.Enabled, N.Name AS NodeName | |
| 1151 | +FROM CustomFilterAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; | |
| 1152 | + | |
| 1118 | 1153 | CREATE VIEW IaonTreeView AS |
| 1119 | 1154 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1120 | 1155 | FROM IaonActionAdapter |
| @@ -1123,7 +1158,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyNam · 2 unmodified lines | ||
| 1123 | 1158 | FROM IaonInputAdapter |
| 1124 | 1159 | UNION ALL |
| 1125 | 1160 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1126 | −FROM IaonOutputAdapter; | |
| 1161 | +FROM IaonOutputAdapter | |
| 1162 | +UNION ALL | |
| 1163 | +SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | |
| 1164 | +FROM IaonFilterAdapter; | |
| 1127 | 1165 | |
| 1128 | 1166 | CREATE VIEW OtherDeviceDetail AS |
| 1129 | 1167 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, |
| @@ -1279,6 +1317,12 @@ FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'C · 149 unmodified lines | ||
| 1279 | 1317 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter |
| 1280 | 1318 | FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomOutputAdapter'; END; |
| 1281 | 1319 | |
| 1320 | +CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Insert AFTER INSERT ON CustomFilterAdapter | |
| 1321 | +FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'CustomFilterAdapter'); END; | |
| 1322 | + | |
| 1323 | +CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomFilterAdapter | |
| 1324 | +FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomFilterAdapter'; END; | |
| 1325 | + | |
| 1282 | 1326 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device |
| 1283 | 1327 | FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'Device'); END; |
| 1284 | 1328 | |
| @@ -1366,6 +1410,13 @@ BEGIN · 81 unmodified lines | ||
| 1366 | 1410 | UPDATE CustomOutputAdapter SET UpdatedOn = strftime('%Y-%m-%d %H:%M:%f') WHERE ROWID = NEW.ROWID AND UpdatedOn = ''; |
| 1367 | 1411 | END; |
| 1368 | 1412 | |
| 1413 | +CREATE TRIGGER CustomFilterAdapter_InsertDefault AFTER INSERT ON CustomFilterAdapter | |
| 1414 | +FOR EACH ROW | |
| 1415 | +BEGIN | |
| 1416 | + UPDATE CustomFilterAdapter SET CreatedOn = strftime('%Y-%m-%d %H:%M:%f') WHERE ROWID = NEW.ROWID AND CreatedOn = ''; | |
| 1417 | + UPDATE CustomFilterAdapter SET UpdatedOn = strftime('%Y-%m-%d %H:%M:%f') WHERE ROWID = NEW.ROWID AND UpdatedOn = ''; | |
| 1418 | +END; | |
| 1419 | + | |
| 1369 | 1420 | CREATE TRIGGER Device_InsertDefault AFTER INSERT ON Device |
| 1370 | 1421 | FOR EACH ROW |
| 1371 | 1422 | BEGIN |
| @@ -39,33 +39,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 38 unmodified lines | ||
| 39 | 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); |
| 40 | 40 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 41 | 41 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39); |
| 42 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 43 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 44 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 45 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 46 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 47 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 48 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 49 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 50 | −INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 51 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1); | |
| 52 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1); | |
| 53 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1); | |
| 54 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1); | |
| 55 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1); | |
| 56 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1); | |
| 57 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1); | |
| 58 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1); | |
| 59 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1); | |
| 60 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1); | |
| 61 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1); | |
| 62 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1); | |
| 63 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1); | |
| 64 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1); | |
| 65 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1); | |
| 66 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1); | |
| 67 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1); | |
| 68 | −INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1); | |
| 42 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); | |
| 43 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); | |
| 44 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); | |
| 45 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); | |
| 46 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); | |
| 47 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); | |
| 48 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); | |
| 49 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); | |
| 50 | +INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); | |
| 51 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1); | |
| 52 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1); | |
| 53 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1); | |
| 54 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1); | |
| 55 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1); | |
| 56 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1); | |
| 57 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1); | |
| 58 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1); | |
| 59 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1); | |
| 60 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1); | |
| 61 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1); | |
| 62 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1); | |
| 63 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1); | |
| 64 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1); | |
| 65 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1); | |
| 66 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1); | |
| 67 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1); | |
| 68 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1); | |
| 69 | +INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1); | |
| 69 | 70 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1); |
| 70 | 71 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 71 | 72 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); |
| @@ -77,7 +77,10 @@ · 76 unmodified lines | ||
| 77 | 77 | <ItemGroup> |
| 78 | 78 | <Compile Include="Adapters\ConnectionStringParameterAttribute.cs" /> |
| 79 | 79 | <Compile Include="Adapters\CustomConfigurationEditorAttribute.cs" /> |
| 80 | + <Compile Include="Adapters\FilterAdapterBase.cs" /> | |
| 81 | + <Compile Include="Adapters\FilterAdapterCollection.cs" /> | |
| 80 | 82 | <Compile Include="Adapters\IaonSession.cs" /> |
| 83 | + <Compile Include="Adapters\IFilterAdapter.cs" /> | |
| 81 | 84 | <Compile Include="Adapters\IOptimizedRoutingConsumer.cs" /> |
| 82 | 85 | <Compile Include="Adapters\IRouteMappingTables.cs" /> |
| 83 | 86 | <Compile Include="Adapters\RoutingPassthroughMethod.cs" /> |
| @@ -1649,6 +1649,9 @@ namespace GSF.TimeSeries · 1648 unmodified lines | ||
| 1649 | 1649 | if (requestInfo.Request.Arguments.Exists("O")) |
| 1650 | 1650 | return m_iaonSession.OutputAdapters; |
| 1651 | 1651 | |
| 1652 | + if (requestInfo.Request.Arguments.Exists("F")) | |
| 1653 | + return m_iaonSession.FilterAdapters; | |
| 1654 | + | |
| 1652 | 1655 | return m_iaonSession.InputAdapters; |
| 1653 | 1656 | } |
| 1654 | 1657 | |
| @@ -58,6 +58,13 @@ namespace GSF.TimeSeries.UI.DataModels · 57 unmodified lines | ||
| 58 | 58 | /// </remarks> |
| 59 | 59 | Action, |
| 60 | 60 | /// <summary> |
| 61 | + /// Filter Adapter. | |
| 62 | + /// </summary> | |
| 63 | + /// <remarks> | |
| 64 | + /// Use this option to modify incoming data before routing to other adapters. | |
| 65 | + /// </remarks> | |
| 66 | + Filter, | |
| 67 | + /// <summary> | |
| 61 | 68 | /// Input Adapter. |
| 62 | 69 | /// </summary> |
| 63 | 70 | /// <remarks> |
| @@ -362,6 +369,8 @@ namespace GSF.TimeSeries.UI.DataModels · 298 unmodified lines | ||
| 362 | 369 | |
| 363 | 370 | if (adapterType == AdapterType.Action) |
| 364 | 371 | viewName = "CustomActionAdapterDetail"; |
| 372 | + else if (adapterType == AdapterType.Filter) | |
| 373 | + viewName = "CustomFilterAdapterDetail"; | |
| 365 | 374 | else if (adapterType == AdapterType.Input) |
| 366 | 375 | viewName = "CustomInputAdapterDetail"; |
| 367 | 376 | else |
| @@ -412,6 +421,8 @@ namespace GSF.TimeSeries.UI.DataModels · 44 unmodified lines | ||
| 412 | 421 | |
| 413 | 422 | if (adapterType == AdapterType.Action) |
| 414 | 423 | viewName = "CustomActionAdapterDetail"; |
| 424 | + else if (adapterType == AdapterType.Filter) | |
| 425 | + viewName = "CustomFilterAdapterDetail"; | |
| 415 | 426 | else if (adapterType == AdapterType.Input) |
| 416 | 427 | viewName = "CustomInputAdapterDetail"; |
| 417 | 428 | else |
| @@ -485,6 +496,8 @@ namespace GSF.TimeSeries.UI.DataModels · 67 unmodified lines | ||
| 485 | 496 | |
| 486 | 497 | if (adapterType == AdapterType.Action) |
| 487 | 498 | tableName = "CustomActionAdapter"; |
| 499 | + else if (adapterType == AdapterType.Filter) | |
| 500 | + tableName = "CustomFilterAdapter"; | |
| 488 | 501 | else if (adapterType == AdapterType.Input) |
| 489 | 502 | tableName = "CustomInputAdapter"; |
| 490 | 503 | else |
| @@ -523,6 +536,8 @@ namespace GSF.TimeSeries.UI.DataModels · 32 unmodified lines | ||
| 523 | 536 | |
| 524 | 537 | if (adapter.Type == AdapterType.Action) |
| 525 | 538 | tableName = "CustomActionAdapter"; |
| 539 | + else if (adapter.Type == AdapterType.Filter) | |
| 540 | + tableName = "CustomFilterAdapter"; | |
| 526 | 541 | else if (adapter.Type == AdapterType.Input) |
| 527 | 542 | tableName = "CustomInputAdapter"; |
| 528 | 543 | else |
| @@ -576,6 +591,8 @@ namespace GSF.TimeSeries.UI.DataModels · 47 unmodified lines | ||
| 576 | 591 | |
| 577 | 592 | if (adapterType == AdapterType.Action) |
| 578 | 593 | tableName = "CustomActionAdapter"; |
| 594 | + else if (adapterType == AdapterType.Filter) | |
| 595 | + tableName = "CustomFilterAdapter"; | |
| 579 | 596 | else if (adapterType == AdapterType.Input) |
| 580 | 597 | tableName = "CustomInputAdapter"; |
| 581 | 598 | else |
| @@ -78,6 +78,9 @@ · 77 unmodified lines | ||
| 78 | 78 | <AutoGen>True</AutoGen> |
| 79 | 79 | <DesignTime>True</DesignTime> |
| 80 | 80 | </Compile> |
| 81 | + <Compile Include="UserControls\CustomFilterAdapterUserControl.xaml.cs"> | |
| 82 | + <DependentUpon>CustomFilterAdapterUserControl.xaml</DependentUpon> | |
| 83 | + </Compile> | |
| 81 | 84 | <Compile Include="UserControls\DeviceStatusUserControl.xaml.cs"> |
| 82 | 85 | <DependentUpon>DeviceStatusUserControl.xaml</DependentUpon> |
| 83 | 86 | </Compile> |
| @@ -271,6 +274,10 @@ · 187 unmodified lines | ||
| 271 | 274 | <Generator>MSBuild:Compile</Generator> |
| 272 | 275 | <SubType>Designer</SubType> |
| 273 | 276 | </Page> |
| 277 | + <Page Include="UserControls\CustomFilterAdapterUserControl.xaml"> | |
| 278 | + <Generator>MSBuild:Compile</Generator> | |
| 279 | + <SubType>Designer</SubType> | |
| 280 | + </Page> | |
| 274 | 281 | <Page Include="UserControls\DeviceStatusUserControl.xaml"> |
| 275 | 282 | <SubType>Designer</SubType> |
| 276 | 283 | <Generator>MSBuild:Compile</Generator> |
| @@ -0,0 +1,8 @@ | ||
| 1 | +<UserControl x:Class="GSF.TimeSeries.UI.UserControls.CustomFilterAdapterUserControl" | |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| 6 | + > | |
| 7 | + | |
| 8 | +</UserControl> | |
| @@ -0,0 +1,43 @@ | ||
| 1 | +//****************************************************************************************************** | |
| 2 | +// CustomFilterAdapterUserControl.xaml.cs - Gbtc | |
| 3 | +// | |
| 4 | +// Copyright © 2017, Grid Protection Alliance. All Rights Reserved. | |
| 5 | +// | |
| 6 | +// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See | |
| 7 | +// the NOTICE file distributed with this work for additional information regarding copyright ownership. | |
| 8 | +// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may | |
| 9 | +// not use this file except in compliance with the License. You may obtain a copy of the License at: | |
| 10 | +// | |
| 11 | +// http://opensource.org/licenses/MIT | |
| 12 | +// | |
| 13 | +// Unless agreed to in writing, the subject software distributed under the License is distributed on an | |
| 14 | +// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the | |
| 15 | +// License for the specific language governing permissions and limitations. | |
| 16 | +// | |
| 17 | +// Code Modification History: | |
| 18 | +// ---------------------------------------------------------------------------------------------------- | |
| 19 | +// 11/17/2017 - Stephen C. Wills | |
| 20 | +// Generated original version of source code. | |
| 21 | +// | |
| 22 | +//****************************************************************************************************** | |
| 23 | + | |
| 24 | +using System.Windows.Controls; | |
| 25 | +using GSF.TimeSeries.UI.DataModels; | |
| 26 | + | |
| 27 | +namespace GSF.TimeSeries.UI.UserControls | |
| 28 | +{ | |
| 29 | + /// <summary> | |
| 30 | + /// Interaction logic for CustomFilterAdapterUserControl.xaml | |
| 31 | + /// </summary> | |
| 32 | + public partial class CustomFilterAdapterUserControl : UserControl | |
| 33 | + { | |
| 34 | + /// <summary> | |
| 35 | + /// Creates an instance of <see cref="CustomFilterAdapterUserControl"/> class. | |
| 36 | + /// </summary> | |
| 37 | + public CustomFilterAdapterUserControl() | |
| 38 | + { | |
| 39 | + InitializeComponent(); | |
| 40 | + this.AddChild(new AdapterUserControl(AdapterType.Filter)); | |
| 41 | + } | |
| 42 | + } | |
| 43 | +} | |
| @@ -550,6 +550,8 @@ namespace GSF.TimeSeries.UI.ViewModels · 549 unmodified lines | ||
| 550 | 550 | { |
| 551 | 551 | if (m_adapterType == AdapterType.Action) |
| 552 | 552 | RuntimeID = CommonFunctions.GetRuntimeID("CustomActionAdapter", CurrentItem.ID); |
| 553 | + else if (m_adapterType == AdapterType.Filter) | |
| 554 | + RuntimeID = CommonFunctions.GetRuntimeID("CustomFilterAdapter", CurrentItem.ID); | |
| 553 | 555 | else if (m_adapterType == AdapterType.Input) |
| 554 | 556 | RuntimeID = CommonFunctions.GetRuntimeID("CustomInputAdapter", CurrentItem.ID); |
| 555 | 557 | else |
| @@ -590,6 +592,8 @@ namespace GSF.TimeSeries.UI.ViewModels · 34 unmodified lines | ||
| 590 | 592 | { |
| 591 | 593 | switch (type) |
| 592 | 594 | { |
| 595 | + case AdapterType.Filter: | |
| 596 | + return typeof(IFilterAdapter); | |
| 593 | 597 | case AdapterType.Input: |
| 594 | 598 | return typeof(IInputAdapter); |
| 595 | 599 | case AdapterType.Action: |