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 | <Compile Include="Properties\AssemblyInfo.cs" /> | 60 | <Compile Include="Properties\AssemblyInfo.cs" /> |
| 61 | <Compile Include="RandomValueInputAdapter.cs" /> | 61 | <Compile Include="RandomValueInputAdapter.cs" /> |
| 62 | <Compile Include="SampleActionAdapter.cs" /> | 62 | <Compile Include="SampleActionAdapter.cs" /> |
| 63 | <Compile Include="SetFlagsFilterAdapter.cs" /> | ||
| 63 | <Compile Include="VirtualActionAdapter.cs" /> | 64 | <Compile Include="VirtualActionAdapter.cs" /> |
| 64 | <Compile Include="VirtualInputAdapter.cs" /> | 65 | <Compile Include="VirtualInputAdapter.cs" /> |
| 65 | <Compile Include="VirtualOutputAdapter.cs" /> | 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 | using GSF.Collections; | 32 | using GSF.Collections; |
| 33 | using GSF.Configuration; | 33 | using GSF.Configuration; |
| 34 | using GSF.Diagnostics; | 34 | using GSF.Diagnostics; |
| 35 | using System.Collections.Generic; | ||
| 35 | 36 | ||
| 36 | // ReSharper disable InconsistentlySynchronizedField | 37 | // ReSharper disable InconsistentlySynchronizedField |
| 37 | namespace GSF.TimeSeries.Adapters | 38 | namespace GSF.TimeSeries.Adapters |
| @@ -117,6 +118,7 @@ namespace GSF.TimeSeries.Adapters · 79 unmodified lines | |||
| 117 | private Guid m_nodeID; | 118 | private Guid m_nodeID; |
| 118 | private RoutingTables m_routingTables; | 119 | private RoutingTables m_routingTables; |
| 119 | private AllAdaptersCollection m_allAdapters; | 120 | private AllAdaptersCollection m_allAdapters; |
| 121 | private FilterAdapterCollection m_filterAdapters; | ||
| 120 | private InputAdapterCollection m_inputAdapters; | 122 | private InputAdapterCollection m_inputAdapters; |
| 121 | private ActionAdapterCollection m_actionAdapters; | 123 | private ActionAdapterCollection m_actionAdapters; |
| 122 | private OutputAdapterCollection m_outputAdapters; | 124 | private OutputAdapterCollection m_outputAdapters; |
| @@ -183,12 +185,17 @@ namespace GSF.TimeSeries.Adapters · 60 unmodified lines | |||
| 183 | m_allAdapters.ConfigurationChanged += ConfigurationChangedHandler; | 185 | m_allAdapters.ConfigurationChanged += ConfigurationChangedHandler; |
| 184 | m_allAdapters.Disposed += DisposedHandler; | 186 | m_allAdapters.Disposed += DisposedHandler; |
| 185 | 187 | ||
| 188 | // Create filter adapters collection | ||
| 189 | m_filterAdapters = new FilterAdapterCollection(); | ||
| 190 | |||
| 186 | // Create input adapters collection | 191 | // Create input adapters collection |
| 187 | m_inputAdapters = new InputAdapterCollection(); | 192 | m_inputAdapters = new InputAdapterCollection(); |
| 193 | m_inputAdapters.NewMeasurements += NewMeasurementsHandler; | ||
| 188 | m_inputAdapters.ProcessingComplete += ProcessingCompleteHandler; | 194 | m_inputAdapters.ProcessingComplete += ProcessingCompleteHandler; |
| 189 | 195 | ||
| 190 | // Create action adapters collection | 196 | // Create action adapters collection |
| 191 | m_actionAdapters = new ActionAdapterCollection(); | 197 | m_actionAdapters = new ActionAdapterCollection(); |
| 198 | m_actionAdapters.NewMeasurements += NewMeasurementsHandler; | ||
| 192 | m_actionAdapters.UnpublishedSamples += UnpublishedSamplesHandler; | 199 | m_actionAdapters.UnpublishedSamples += UnpublishedSamplesHandler; |
| 193 | m_actionAdapters.RequestTemporalSupport += RequestTemporalSupportHandler; | 200 | m_actionAdapters.RequestTemporalSupport += RequestTemporalSupportHandler; |
| 194 | 201 | ||
| @@ -201,10 +208,11 @@ namespace GSF.TimeSeries.Adapters · 6 unmodified lines | |||
| 201 | m_routingTables.ActionAdapters = m_actionAdapters; | 208 | m_routingTables.ActionAdapters = m_actionAdapters; |
| 202 | m_routingTables.OutputAdapters = m_outputAdapters; | 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 | 211 | // We group these adapters such that they are initialized in the following order: output, filter, input, action. |
| 205 | // is done so that the archival capabilities will be setup before we start receiving input and the input data | 212 | // This is done so that the archival capabilities will be setup before we start receiving input and the input |
| 206 | // will be flowing before any actions get established for the input - at least generally. | 213 | // data will be flowing before any actions get established for the input - at least generally. |
| 207 | m_allAdapters.Add(m_outputAdapters); | 214 | m_allAdapters.Add(m_outputAdapters); |
| 215 | m_allAdapters.Add(m_filterAdapters); | ||
| 208 | m_allAdapters.Add(m_inputAdapters); | 216 | m_allAdapters.Add(m_inputAdapters); |
| 209 | m_allAdapters.Add(m_actionAdapters); | 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 | /// <summary> | 256 | /// <summary> |
| 238 | /// Gets the input adapter collection for this <see cref="IaonSession"/>. | 257 | /// Gets the input adapter collection for this <see cref="IaonSession"/>. |
| 239 | /// </summary> | 258 | /// </summary> |
| @@ -347,6 +366,13 @@ namespace GSF.TimeSeries.Adapters · 107 unmodified lines | |||
| 347 | { | 366 | { |
| 348 | StringBuilder status = new StringBuilder(); | 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 | status.AppendLine(); | 376 | status.AppendLine(); |
| 351 | status.AppendLine(">> Input Adapters:"); | 377 | status.AppendLine(">> Input Adapters:"); |
| 352 | status.AppendLine(); | 378 | status.AppendLine(); |
| @@ -399,19 +425,29 @@ namespace GSF.TimeSeries.Adapters · 46 unmodified lines | |||
| 399 | { | 425 | { |
| 400 | DataSet dataSource = DataSource; | 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 | // Dispose input adapters collection | 436 | // Dispose input adapters collection |
| 403 | if (m_inputAdapters != null) | 437 | if ((object)m_inputAdapters != null) |
| 404 | { | 438 | { |
| 405 | m_inputAdapters.Stop(); | 439 | m_inputAdapters.Stop(); |
| 440 | m_inputAdapters.NewMeasurements -= NewMeasurementsHandler; | ||
| 406 | m_inputAdapters.ProcessingComplete -= ProcessingCompleteHandler; | 441 | m_inputAdapters.ProcessingComplete -= ProcessingCompleteHandler; |
| 407 | m_inputAdapters.Dispose(); | 442 | m_inputAdapters.Dispose(); |
| 408 | } | 443 | } |
| 409 | m_inputAdapters = null; | 444 | m_inputAdapters = null; |
| 410 | 445 | ||
| 411 | // Dispose action adapters collection | 446 | // Dispose action adapters collection |
| 412 | if (m_actionAdapters != null) | 447 | if ((object)m_actionAdapters != null) |
| 413 | { | 448 | { |
| 414 | m_actionAdapters.Stop(); | 449 | m_actionAdapters.Stop(); |
| 450 | m_actionAdapters.NewMeasurements -= NewMeasurementsHandler; | ||
| 415 | m_actionAdapters.UnpublishedSamples -= UnpublishedSamplesHandler; | 451 | m_actionAdapters.UnpublishedSamples -= UnpublishedSamplesHandler; |
| 416 | m_actionAdapters.RequestTemporalSupport -= RequestTemporalSupportHandler; | 452 | m_actionAdapters.RequestTemporalSupport -= RequestTemporalSupportHandler; |
| 417 | m_actionAdapters.Dispose(); | 453 | m_actionAdapters.Dispose(); |
| @@ -419,7 +455,7 @@ namespace GSF.TimeSeries.Adapters · 1 unmodified line | |||
| 419 | m_actionAdapters = null; | 455 | m_actionAdapters = null; |
| 420 | 456 | ||
| 421 | // Dispose output adapters collection | 457 | // Dispose output adapters collection |
| 422 | if (m_outputAdapters != null) | 458 | if ((object)m_outputAdapters != null) |
| 423 | { | 459 | { |
| 424 | m_outputAdapters.Stop(); | 460 | m_outputAdapters.Stop(); |
| 425 | m_outputAdapters.UnprocessedMeasurements -= UnprocessedMeasurementsHandler; | 461 | m_outputAdapters.UnprocessedMeasurements -= UnprocessedMeasurementsHandler; |
| @@ -840,6 +876,16 @@ namespace GSF.TimeSeries.Adapters · 414 unmodified lines | |||
| 840 | OnUnprocessedMeasurements(sender, e.Argument); | 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 | /// <summary> | 889 | /// <summary> |
| 844 | /// Event handler for processing complete notifications from input adapters. | 890 | /// Event handler for processing complete notifications from input adapters. |
| 845 | /// </summary> | 891 | /// </summary> |
| @@ -38,7 +38,7 @@ USE GSFSchema; · 37 unmodified lines | |||
| 38 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! | 38 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 39 | -- ******************************************************************************************* | 39 | -- ******************************************************************************************* |
| 40 | CREATE VIEW SchemaVersion AS | 40 | CREATE VIEW SchemaVersion AS |
| 41 | SELECT 6 AS VersionNumber; | 41 | SELECT 7 AS VersionNumber; |
| 42 | 42 | ||
| 43 | CREATE TABLE ErrorLog( | 43 | CREATE TABLE ErrorLog( |
| 44 | ID INT AUTO_INCREMENT NOT NULL, | 44 | ID INT AUTO_INCREMENT NOT NULL, |
| @@ -503,6 +503,22 @@ CREATE TABLE CustomInputAdapter( · 458 unmodified lines | |||
| 503 | CONSTRAINT PK_CustomInputAdapter PRIMARY KEY (ID ASC) | 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 | CREATE TABLE OutputStream( | 522 | CREATE TABLE OutputStream( |
| 507 | NodeID NCHAR(36) NOT NULL, | 523 | NodeID NCHAR(36) NOT NULL, |
| 508 | ID INT AUTO_INCREMENT NOT NULL, | 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 | ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE; | 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 | ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE; | 856 | ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE; |
| 839 | 857 | ||
| 840 | ALTER TABLE PowerCalculation ADD CONSTRAINT FK_PowerCalculation_Measurement1 FOREIGN KEY(ApparentPowerOutputSignalID) REFERENCES Measurement (SignalID) ON DELETE CASCADE ON UPDATE CASCADE; | 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 | WHERE (CustomInputAdapter.Enabled <> 0) | 976 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 959 | ORDER BY CustomInputAdapter.LoadOrder; | 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 | CREATE VIEW RuntimeOutputStreamDevice | 988 | CREATE VIEW RuntimeOutputStreamDevice |
| 962 | AS | 989 | AS |
| 963 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, | 990 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1095,6 +1122,11 @@ FROM RuntimeCalculatedMeasurement · 131 unmodified lines | |||
| 1095 | UNION | 1122 | UNION |
| 1096 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | 1123 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1097 | FROM RuntimeCustomActionAdapter; | 1124 | FROM RuntimeCustomActionAdapter; |
| 1125 | |||
| 1126 | CREATE VIEW IaonFilterAdapter | ||
| 1127 | AS | ||
| 1128 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | ||
| 1129 | FROM RuntimeCustomFilterAdapter; | ||
| 1098 | 1130 | ||
| 1099 | CREATE VIEW MeasurementDetail | 1131 | CREATE VIEW MeasurementDetail |
| 1100 | AS | 1132 | AS |
| @@ -1202,6 +1234,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE( · 101 unmodified lines | |||
| 1202 | CA.Enabled, N.Name AS NodeName | 1234 | CA.Enabled, N.Name AS NodeName |
| 1203 | FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; | 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 | CREATE VIEW IaonTreeView AS | 1242 | CREATE VIEW IaonTreeView AS |
| 1206 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | 1243 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1207 | FROM IaonActionAdapter | 1244 | FROM IaonActionAdapter |
| @@ -1210,7 +1247,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, T · 2 unmodified lines | |||
| 1210 | FROM IaonInputAdapter | 1247 | FROM IaonInputAdapter |
| 1211 | UNION ALL | 1248 | UNION ALL |
| 1212 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | 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 | CREATE VIEW OtherDeviceDetail AS | 1255 | CREATE VIEW OtherDeviceDetail AS |
| 1216 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, | 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 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter | 1400 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter |
| 1361 | FOR EACH ROW DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = N'CustomOutputAdapter'; | 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 | DELIMITER $$ | 1409 | DELIMITER $$ |
| 1364 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device FOR EACH ROW | 1410 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device FOR EACH ROW |
| 1365 | BEGIN | 1411 | BEGIN |
| @@ -1421,6 +1467,9 @@ FOR EACH ROW SET NEW.CreatedBy = COALESCE(NEW.CreatedBy, USER()), NEW.CreatedOn · 55 unmodified lines | |||
| 1421 | CREATE TRIGGER CustomOutputAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapter | 1467 | CREATE TRIGGER CustomOutputAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapter |
| 1422 | 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()); | 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 | CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device | 1473 | CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device |
| 1425 | 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()); | 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 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); | 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); |
| 40 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); | 40 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 41 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 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('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 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('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 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('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 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('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 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('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 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('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 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('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 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('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 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('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 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('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 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('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 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('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 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('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 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('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 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('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 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('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 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 | 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 | 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 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); | 71 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 71 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); | 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 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! | 38 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 39 | -- ******************************************************************************************* | 39 | -- ******************************************************************************************* |
| 40 | CREATE VIEW SchemaVersion AS | 40 | CREATE VIEW SchemaVersion AS |
| 41 | SELECT 6 AS VersionNumber | 41 | SELECT 7 AS VersionNumber |
| 42 | FROM dual; | 42 | FROM dual; |
| 43 | 43 | ||
| 44 | CREATE TABLE ErrorLog( | 44 | CREATE TABLE ErrorLog( |
| @@ -755,6 +755,32 @@ CREATE TRIGGER AI_CustomInputAdapter BEFORE INSERT ON CustomInputAdapter · 710 unmodified lines | |||
| 755 | END; | 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 | CREATE TABLE OutputStream( | 784 | CREATE TABLE OutputStream( |
| 759 | NodeID VARCHAR2(36) NOT NULL, | 785 | NodeID VARCHAR2(36) NOT NULL, |
| 760 | ID NUMBER NOT NULL, | 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 | ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE; | 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 | ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE; | 1211 | ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE; |
| 1184 | 1212 | ||
| 1185 | ALTER TABLE PowerCalculation ADD CONSTRAINT FK_PowerCalculation_Measurement1 FOREIGN KEY(ApparentPowerOutputSignalID) REFERENCES Measurement (SignalID) ON DELETE CASCADE; | 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 | WHERE (CustomInputAdapter.Enabled <> 0) | 1361 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 1334 | ORDER BY CustomInputAdapter.LoadOrder; | 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 | CREATE VIEW RuntimeOutputStreamDevice | 1373 | CREATE VIEW RuntimeOutputStreamDevice |
| 1337 | AS | 1374 | AS |
| 1338 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, | 1375 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1471,6 +1508,11 @@ FROM RuntimeCalculatedMeasurement · 132 unmodified lines | |||
| 1471 | UNION ALL | 1508 | UNION ALL |
| 1472 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | 1509 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1473 | FROM RuntimeCustomActionAdapter; | 1510 | FROM RuntimeCustomActionAdapter; |
| 1511 | |||
| 1512 | CREATE VIEW IaonFilterAdapter | ||
| 1513 | AS | ||
| 1514 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | ||
| 1515 | FROM RuntimeCustomFilterAdapter; | ||
| 1474 | 1516 | ||
| 1475 | CREATE VIEW MeasurementDetail | 1517 | CREATE VIEW MeasurementDetail |
| 1476 | AS | 1518 | AS |
| @@ -1582,6 +1624,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, CA.Connec · 105 unmodified lines | |||
| 1582 | CA.Enabled, N.Name AS NodeName | 1624 | CA.Enabled, N.Name AS NodeName |
| 1583 | FROM CustomOutputAdapter CA INNER JOIN Node N ON CA.NodeID = N.ID; | 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 | CREATE VIEW IaonTreeView AS | 1632 | CREATE VIEW IaonTreeView AS |
| 1586 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString | 1633 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString |
| 1587 | FROM IaonActionAdapter | 1634 | FROM IaonActionAdapter |
| @@ -1590,7 +1637,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, T · 2 unmodified lines | |||
| 1590 | FROM IaonInputAdapter | 1637 | FROM IaonInputAdapter |
| 1591 | UNION ALL | 1638 | UNION ALL |
| 1592 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString | 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 | CREATE VIEW OtherDeviceDetail AS | 1645 | CREATE VIEW OtherDeviceDetail AS |
| 1596 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, | 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 | END; | 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 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device | 1863 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device |
| 1804 | FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(:NEW.ID, 'Device'); | 1864 | FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(:NEW.ID, 'Device'); |
| 1805 | END; | 1865 | END; |
| @@ -2015,6 +2075,25 @@ CREATE TRIGGER CustomOutAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapt · 209 unmodified lines | |||
| 2015 | END; | 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 | CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device FOR EACH ROW BEGIN | 2097 | CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device FOR EACH ROW BEGIN |
| 2019 | IF :NEW.UniqueID IS NULL THEN | 2098 | IF :NEW.UniqueID IS NULL THEN |
| 2020 | SELECT NEW_GUID() INTO :NEW.UniqueID FROM dual; | 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 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas &' || ' Electric', 37); | 37 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas &' || ' Electric', 37); |
| 38 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); | 38 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 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('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 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('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 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('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 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('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 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('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 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('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 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('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 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('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 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('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 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('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 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('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 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('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 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('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 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('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 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('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 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('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 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 | 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 | 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 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); | 69 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 69 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); | 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 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! | 36 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 37 | -- ******************************************************************************************* | 37 | -- ******************************************************************************************* |
| 38 | CREATE VIEW SchemaVersion AS | 38 | CREATE VIEW SchemaVersion AS |
| 39 | SELECT 6 AS VersionNumber; | 39 | SELECT 7 AS VersionNumber; |
| 40 | 40 | ||
| 41 | CREATE EXTENSION "uuid-ossp"; | 41 | CREATE EXTENSION "uuid-ossp"; |
| 42 | 42 | ||
| @@ -555,6 +555,22 @@ CREATE TABLE CustomInputAdapter( · 512 unmodified lines | |||
| 555 | CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE | 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 | CREATE TABLE PowerCalculation( | 574 | CREATE TABLE PowerCalculation( |
| 559 | NodeID NCHAR(36) NULL, | 575 | NodeID NCHAR(36) NULL, |
| 560 | ID SERIAL NOT NULL PRIMARY KEY, | 576 | ID SERIAL NOT NULL PRIMARY KEY, |
| @@ -871,6 +887,15 @@ FROM CustomInputAdapter LEFT OUTER JOIN · 310 unmodified lines | |||
| 871 | WHERE (CustomInputAdapter.Enabled <> 0) | 887 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 872 | ORDER BY CustomInputAdapter.LoadOrder; | 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 | CREATE VIEW RuntimeOutputStreamDevice | 899 | CREATE VIEW RuntimeOutputStreamDevice |
| 875 | AS | 900 | AS |
| 876 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, | 901 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1013,6 +1038,11 @@ FROM RuntimeCalculatedMeasurement · 136 unmodified lines | |||
| 1013 | UNION | 1038 | UNION |
| 1014 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | 1039 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1015 | FROM RuntimeCustomActionAdapter; | 1040 | FROM RuntimeCustomActionAdapter; |
| 1041 | |||
| 1042 | CREATE VIEW IaonFilterAdapter | ||
| 1043 | AS | ||
| 1044 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | ||
| 1045 | FROM RuntimeCustomFilterAdapter; | ||
| 1016 | 1046 | ||
| 1017 | CREATE VIEW MeasurementDetail | 1047 | CREATE VIEW MeasurementDetail |
| 1018 | AS | 1048 | AS |
| @@ -1124,6 +1154,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALE · 105 unmodified lines | |||
| 1124 | CA.Enabled, N.Name AS NodeName | 1154 | CA.Enabled, N.Name AS NodeName |
| 1125 | FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; | 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 | CREATE VIEW IaonTreeView AS | 1162 | CREATE VIEW IaonTreeView AS |
| 1128 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | 1163 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1129 | FROM IaonActionAdapter | 1164 | FROM IaonActionAdapter |
| @@ -1132,7 +1167,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyNam · 2 unmodified lines | |||
| 1132 | FROM IaonInputAdapter | 1167 | FROM IaonInputAdapter |
| 1133 | UNION ALL | 1168 | UNION ALL |
| 1134 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | 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 | CREATE VIEW OtherDeviceDetail AS | 1175 | CREATE VIEW OtherDeviceDetail AS |
| 1138 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, | 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 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter | 1370 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter |
| 1333 | FOR EACH ROW EXECUTE PROCEDURE CustomOutputAdapter_RuntimeSync_DeleteFn(); | 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 | -- Device_RuntimeSync_Insert -- | 1397 | -- Device_RuntimeSync_Insert -- |
| 1336 | CREATE FUNCTION Device_RuntimeSync_InsertFn() RETURNS TRIGGER | 1398 | CREATE FUNCTION Device_RuntimeSync_InsertFn() RETURNS TRIGGER |
| 1337 | AS $Device_RuntimeSync_InsertFn$ | 1399 | AS $Device_RuntimeSync_InsertFn$ |
| @@ -37,33 +37,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 36 unmodified lines | |||
| 37 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); | 37 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); |
| 38 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); | 38 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 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('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 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('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 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('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 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('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 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('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 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('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 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('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 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('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 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('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 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('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 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('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 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('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 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('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 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('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 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('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 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('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 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 | 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 | 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 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); | 69 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 69 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); | 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 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! | 116 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 117 | -- ******************************************************************************************* | 117 | -- ******************************************************************************************* |
| 118 | CREATE VIEW [dbo].[SchemaVersion] AS | 118 | CREATE VIEW [dbo].[SchemaVersion] AS |
| 119 | SELECT 6 AS VersionNumber | 119 | SELECT 7 AS VersionNumber |
| 120 | GO | 120 | GO |
| 121 | 121 | ||
| 122 | SET ANSI_NULLS ON | 122 | SET ANSI_NULLS ON |
| @@ -1015,6 +1015,63 @@ BEGIN · 892 unmodified lines | |||
| 1015 | END | 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 | GO | 1075 | GO |
| 1019 | SET ANSI_NULLS ON | 1076 | SET ANSI_NULLS ON |
| 1020 | GO | 1077 | GO |
| @@ -1955,6 +2012,20 @@ FROM dbo.CustomInputAdapter WITH (NOLOCK) LEFT OUTER JOIN · 934 unmodified lines | |||
| 1955 | WHERE (dbo.CustomInputAdapter.Enabled <> 0) | 2012 | WHERE (dbo.CustomInputAdapter.Enabled <> 0) |
| 1956 | ORDER BY dbo.CustomInputAdapter.LoadOrder | 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 | GO | 2029 | GO |
| 1959 | SET ANSI_NULLS ON | 2030 | SET ANSI_NULLS ON |
| 1960 | GO | 2031 | GO |
| @@ -2167,6 +2238,16 @@ UNION · 206 unmodified lines | |||
| 2167 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | 2238 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 2168 | FROM dbo.RuntimeCustomActionAdapter WITH (NOLOCK) | 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 | GO | 2251 | GO |
| 2171 | CREATE VIEW [dbo].[HistorianMetadata] | 2252 | CREATE VIEW [dbo].[HistorianMetadata] |
| 2172 | AS | 2253 | AS |
| @@ -2316,6 +2397,12 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, ISNUL · 143 unmodified lines | |||
| 2316 | FROM dbo.CustomOutputAdapter AS CA WITH (NOLOCK) INNER JOIN | 2397 | FROM dbo.CustomOutputAdapter AS CA WITH (NOLOCK) INNER JOIN |
| 2317 | dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID | 2398 | dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID |
| 2318 | GO | 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 | CREATE VIEW [dbo].[IaonTreeView] AS | 2406 | CREATE VIEW [dbo].[IaonTreeView] AS |
| 2320 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString | 2407 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString |
| 2321 | FROM dbo.IaonActionAdapter WITH (NOLOCK) | 2408 | FROM dbo.IaonActionAdapter WITH (NOLOCK) |
| @@ -2325,6 +2412,9 @@ FROM dbo.IaonInputAdapter WITH (NOLOCK) · 3 unmodified lines | |||
| 2325 | UNION ALL | 2412 | UNION ALL |
| 2326 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString | 2413 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString |
| 2327 | FROM dbo.IaonOutputAdapter WITH (NOLOCK) | 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 | GO | 2418 | GO |
| 2329 | CREATE VIEW [dbo].[OtherDeviceDetail] AS | 2419 | CREATE VIEW [dbo].[OtherDeviceDetail] AS |
| 2330 | SELECT OD.ID, OD.Acronym, ISNULL(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, | 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 | ON UPDATE CASCADE | 2629 | ON UPDATE CASCADE |
| 2540 | ON DELETE CASCADE | 2630 | ON DELETE CASCADE |
| 2541 | GO | 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 | ALTER TABLE [dbo].[OutputStream] WITH CHECK ADD CONSTRAINT [FK_OutputStream_Node] FOREIGN KEY([NodeID]) | 2637 | ALTER TABLE [dbo].[OutputStream] WITH CHECK ADD CONSTRAINT [FK_OutputStream_Node] FOREIGN KEY([NodeID]) |
| 2543 | REFERENCES [dbo].[Node] ([ID]) | 2638 | REFERENCES [dbo].[Node] ([ID]) |
| 2544 | ON UPDATE CASCADE | 2639 | ON UPDATE CASCADE |
| @@ -118,85 +118,88 @@ GO · 117 unmodified lines | |||
| 118 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39) | 118 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39) |
| 119 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 143 | GO |
| 144 | 144 | ||
| 145 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48) | 145 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48) |
| 146 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 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 | GO | 203 | GO |
| 201 | 204 | ||
| 202 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1) | 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 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! | 33 | -- IMPORTANT NOTE: When making updates to this schema, please increment the version number! |
| 34 | -- ******************************************************************************************* | 34 | -- ******************************************************************************************* |
| 35 | CREATE VIEW SchemaVersion AS | 35 | CREATE VIEW SchemaVersion AS |
| 36 | SELECT 6 AS VersionNumber; | 36 | SELECT 7 AS VersionNumber; |
| 37 | 37 | ||
| 38 | CREATE TABLE ErrorLog( | 38 | CREATE TABLE ErrorLog( |
| 39 | ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | 39 | ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, |
| @@ -507,6 +507,22 @@ CREATE TABLE CustomInputAdapter( · 467 unmodified lines | |||
| 507 | CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE | 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 | CREATE TABLE OutputStream( | 526 | CREATE TABLE OutputStream( |
| 511 | NodeID NCHAR(36) NOT NULL, | 527 | NodeID NCHAR(36) NOT NULL, |
| 512 | ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | 528 | ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, |
| @@ -862,6 +878,15 @@ FROM CustomInputAdapter LEFT OUTER JOIN · 349 unmodified lines | |||
| 862 | WHERE (CustomInputAdapter.Enabled <> 0) | 878 | WHERE (CustomInputAdapter.Enabled <> 0) |
| 863 | ORDER BY CustomInputAdapter.LoadOrder; | 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 | CREATE VIEW RuntimeOutputStreamDevice | 890 | CREATE VIEW RuntimeOutputStreamDevice |
| 866 | AS | 891 | AS |
| 867 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, | 892 | SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, |
| @@ -1004,6 +1029,11 @@ FROM RuntimeCalculatedMeasurement · 136 unmodified lines | |||
| 1004 | UNION | 1029 | UNION |
| 1005 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | 1030 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString |
| 1006 | FROM RuntimeCustomActionAdapter; | 1031 | FROM RuntimeCustomActionAdapter; |
| 1032 | |||
| 1033 | CREATE VIEW IaonFilterAdapter | ||
| 1034 | AS | ||
| 1035 | SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString | ||
| 1036 | FROM RuntimeCustomFilterAdapter; | ||
| 1007 | 1037 | ||
| 1008 | CREATE VIEW MeasurementDetail | 1038 | CREATE VIEW MeasurementDetail |
| 1009 | AS | 1039 | AS |
| @@ -1115,6 +1145,11 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALE · 105 unmodified lines | |||
| 1115 | CA.Enabled, N.Name AS NodeName | 1145 | CA.Enabled, N.Name AS NodeName |
| 1116 | FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID; | 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 | CREATE VIEW IaonTreeView AS | 1153 | CREATE VIEW IaonTreeView AS |
| 1119 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | 1154 | SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString |
| 1120 | FROM IaonActionAdapter | 1155 | FROM IaonActionAdapter |
| @@ -1123,7 +1158,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyNam · 2 unmodified lines | |||
| 1123 | FROM IaonInputAdapter | 1158 | FROM IaonInputAdapter |
| 1124 | UNION ALL | 1159 | UNION ALL |
| 1125 | SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString | 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 | CREATE VIEW OtherDeviceDetail AS | 1166 | CREATE VIEW OtherDeviceDetail AS |
| 1129 | SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, | 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 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter | 1317 | CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter |
| 1280 | FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomOutputAdapter'; END; | 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 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device | 1326 | CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device |
| 1283 | FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'Device'); END; | 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 | UPDATE CustomOutputAdapter SET UpdatedOn = strftime('%Y-%m-%d %H:%M:%f') WHERE ROWID = NEW.ROWID AND UpdatedOn = ''; | 1410 | UPDATE CustomOutputAdapter SET UpdatedOn = strftime('%Y-%m-%d %H:%M:%f') WHERE ROWID = NEW.ROWID AND UpdatedOn = ''; |
| 1367 | END; | 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 | CREATE TRIGGER Device_InsertDefault AFTER INSERT ON Device | 1420 | CREATE TRIGGER Device_InsertDefault AFTER INSERT ON Device |
| 1370 | FOR EACH ROW | 1421 | FOR EACH ROW |
| 1371 | BEGIN | 1422 | BEGIN |
| @@ -39,33 +39,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 38 unmodified lines | |||
| 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); | 39 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37); |
| 40 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); | 40 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38); |
| 41 | INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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); | 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('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 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('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 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('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 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('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 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('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 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('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 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('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 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('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 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('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 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('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 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('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 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('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 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('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 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('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 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('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 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('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 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('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 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 | 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 | 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 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); | 71 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1); |
| 71 | INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1); | 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 | <ItemGroup> | 77 | <ItemGroup> |
| 78 | <Compile Include="Adapters\ConnectionStringParameterAttribute.cs" /> | 78 | <Compile Include="Adapters\ConnectionStringParameterAttribute.cs" /> |
| 79 | <Compile Include="Adapters\CustomConfigurationEditorAttribute.cs" /> | 79 | <Compile Include="Adapters\CustomConfigurationEditorAttribute.cs" /> |
| 80 | <Compile Include="Adapters\FilterAdapterBase.cs" /> | ||
| 81 | <Compile Include="Adapters\FilterAdapterCollection.cs" /> | ||
| 80 | <Compile Include="Adapters\IaonSession.cs" /> | 82 | <Compile Include="Adapters\IaonSession.cs" /> |
| 83 | <Compile Include="Adapters\IFilterAdapter.cs" /> | ||
| 81 | <Compile Include="Adapters\IOptimizedRoutingConsumer.cs" /> | 84 | <Compile Include="Adapters\IOptimizedRoutingConsumer.cs" /> |
| 82 | <Compile Include="Adapters\IRouteMappingTables.cs" /> | 85 | <Compile Include="Adapters\IRouteMappingTables.cs" /> |
| 83 | <Compile Include="Adapters\RoutingPassthroughMethod.cs" /> | 86 | <Compile Include="Adapters\RoutingPassthroughMethod.cs" /> |
| @@ -1649,6 +1649,9 @@ namespace GSF.TimeSeries · 1648 unmodified lines | |||
| 1649 | if (requestInfo.Request.Arguments.Exists("O")) | 1649 | if (requestInfo.Request.Arguments.Exists("O")) |
| 1650 | return m_iaonSession.OutputAdapters; | 1650 | return m_iaonSession.OutputAdapters; |
| 1651 | 1651 | ||
| 1652 | if (requestInfo.Request.Arguments.Exists("F")) | ||
| 1653 | return m_iaonSession.FilterAdapters; | ||
| 1654 | |||
| 1652 | return m_iaonSession.InputAdapters; | 1655 | return m_iaonSession.InputAdapters; |
| 1653 | } | 1656 | } |
| 1654 | 1657 | ||
| @@ -58,6 +58,13 @@ namespace GSF.TimeSeries.UI.DataModels · 57 unmodified lines | |||
| 58 | /// </remarks> | 58 | /// </remarks> |
| 59 | Action, | 59 | Action, |
| 60 | /// <summary> | 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 | /// Input Adapter. | 68 | /// Input Adapter. |
| 62 | /// </summary> | 69 | /// </summary> |
| 63 | /// <remarks> | 70 | /// <remarks> |
| @@ -362,6 +369,8 @@ namespace GSF.TimeSeries.UI.DataModels · 298 unmodified lines | |||
| 362 | 369 | ||
| 363 | if (adapterType == AdapterType.Action) | 370 | if (adapterType == AdapterType.Action) |
| 364 | viewName = "CustomActionAdapterDetail"; | 371 | viewName = "CustomActionAdapterDetail"; |
| 372 | else if (adapterType == AdapterType.Filter) | ||
| 373 | viewName = "CustomFilterAdapterDetail"; | ||
| 365 | else if (adapterType == AdapterType.Input) | 374 | else if (adapterType == AdapterType.Input) |
| 366 | viewName = "CustomInputAdapterDetail"; | 375 | viewName = "CustomInputAdapterDetail"; |
| 367 | else | 376 | else |
| @@ -412,6 +421,8 @@ namespace GSF.TimeSeries.UI.DataModels · 44 unmodified lines | |||
| 412 | 421 | ||
| 413 | if (adapterType == AdapterType.Action) | 422 | if (adapterType == AdapterType.Action) |
| 414 | viewName = "CustomActionAdapterDetail"; | 423 | viewName = "CustomActionAdapterDetail"; |
| 424 | else if (adapterType == AdapterType.Filter) | ||
| 425 | viewName = "CustomFilterAdapterDetail"; | ||
| 415 | else if (adapterType == AdapterType.Input) | 426 | else if (adapterType == AdapterType.Input) |
| 416 | viewName = "CustomInputAdapterDetail"; | 427 | viewName = "CustomInputAdapterDetail"; |
| 417 | else | 428 | else |
| @@ -485,6 +496,8 @@ namespace GSF.TimeSeries.UI.DataModels · 67 unmodified lines | |||
| 485 | 496 | ||
| 486 | if (adapterType == AdapterType.Action) | 497 | if (adapterType == AdapterType.Action) |
| 487 | tableName = "CustomActionAdapter"; | 498 | tableName = "CustomActionAdapter"; |
| 499 | else if (adapterType == AdapterType.Filter) | ||
| 500 | tableName = "CustomFilterAdapter"; | ||
| 488 | else if (adapterType == AdapterType.Input) | 501 | else if (adapterType == AdapterType.Input) |
| 489 | tableName = "CustomInputAdapter"; | 502 | tableName = "CustomInputAdapter"; |
| 490 | else | 503 | else |
| @@ -523,6 +536,8 @@ namespace GSF.TimeSeries.UI.DataModels · 32 unmodified lines | |||
| 523 | 536 | ||
| 524 | if (adapter.Type == AdapterType.Action) | 537 | if (adapter.Type == AdapterType.Action) |
| 525 | tableName = "CustomActionAdapter"; | 538 | tableName = "CustomActionAdapter"; |
| 539 | else if (adapter.Type == AdapterType.Filter) | ||
| 540 | tableName = "CustomFilterAdapter"; | ||
| 526 | else if (adapter.Type == AdapterType.Input) | 541 | else if (adapter.Type == AdapterType.Input) |
| 527 | tableName = "CustomInputAdapter"; | 542 | tableName = "CustomInputAdapter"; |
| 528 | else | 543 | else |
| @@ -576,6 +591,8 @@ namespace GSF.TimeSeries.UI.DataModels · 47 unmodified lines | |||
| 576 | 591 | ||
| 577 | if (adapterType == AdapterType.Action) | 592 | if (adapterType == AdapterType.Action) |
| 578 | tableName = "CustomActionAdapter"; | 593 | tableName = "CustomActionAdapter"; |
| 594 | else if (adapterType == AdapterType.Filter) | ||
| 595 | tableName = "CustomFilterAdapter"; | ||
| 579 | else if (adapterType == AdapterType.Input) | 596 | else if (adapterType == AdapterType.Input) |
| 580 | tableName = "CustomInputAdapter"; | 597 | tableName = "CustomInputAdapter"; |
| 581 | else | 598 | else |
| @@ -78,6 +78,9 @@ · 77 unmodified lines | |||
| 78 | <AutoGen>True</AutoGen> | 78 | <AutoGen>True</AutoGen> |
| 79 | <DesignTime>True</DesignTime> | 79 | <DesignTime>True</DesignTime> |
| 80 | </Compile> | 80 | </Compile> |
| 81 | <Compile Include="UserControls\CustomFilterAdapterUserControl.xaml.cs"> | ||
| 82 | <DependentUpon>CustomFilterAdapterUserControl.xaml</DependentUpon> | ||
| 83 | </Compile> | ||
| 81 | <Compile Include="UserControls\DeviceStatusUserControl.xaml.cs"> | 84 | <Compile Include="UserControls\DeviceStatusUserControl.xaml.cs"> |
| 82 | <DependentUpon>DeviceStatusUserControl.xaml</DependentUpon> | 85 | <DependentUpon>DeviceStatusUserControl.xaml</DependentUpon> |
| 83 | </Compile> | 86 | </Compile> |
| @@ -271,6 +274,10 @@ · 187 unmodified lines | |||
| 271 | <Generator>MSBuild:Compile</Generator> | 274 | <Generator>MSBuild:Compile</Generator> |
| 272 | <SubType>Designer</SubType> | 275 | <SubType>Designer</SubType> |
| 273 | </Page> | 276 | </Page> |
| 277 | <Page Include="UserControls\CustomFilterAdapterUserControl.xaml"> | ||
| 278 | <Generator>MSBuild:Compile</Generator> | ||
| 279 | <SubType>Designer</SubType> | ||
| 280 | </Page> | ||
| 274 | <Page Include="UserControls\DeviceStatusUserControl.xaml"> | 281 | <Page Include="UserControls\DeviceStatusUserControl.xaml"> |
| 275 | <SubType>Designer</SubType> | 282 | <SubType>Designer</SubType> |
| 276 | <Generator>MSBuild:Compile</Generator> | 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 | if (m_adapterType == AdapterType.Action) | 551 | if (m_adapterType == AdapterType.Action) |
| 552 | RuntimeID = CommonFunctions.GetRuntimeID("CustomActionAdapter", CurrentItem.ID); | 552 | RuntimeID = CommonFunctions.GetRuntimeID("CustomActionAdapter", CurrentItem.ID); |
| 553 | else if (m_adapterType == AdapterType.Filter) | ||
| 554 | RuntimeID = CommonFunctions.GetRuntimeID("CustomFilterAdapter", CurrentItem.ID); | ||
| 553 | else if (m_adapterType == AdapterType.Input) | 555 | else if (m_adapterType == AdapterType.Input) |
| 554 | RuntimeID = CommonFunctions.GetRuntimeID("CustomInputAdapter", CurrentItem.ID); | 556 | RuntimeID = CommonFunctions.GetRuntimeID("CustomInputAdapter", CurrentItem.ID); |
| 555 | else | 557 | else |
| @@ -590,6 +592,8 @@ namespace GSF.TimeSeries.UI.ViewModels · 34 unmodified lines | |||
| 590 | { | 592 | { |
| 591 | switch (type) | 593 | switch (type) |
| 592 | { | 594 | { |
| 595 | case AdapterType.Filter: | ||
| 596 | return typeof(IFilterAdapter); | ||
| 593 | case AdapterType.Input: | 597 | case AdapterType.Input: |
| 594 | return typeof(IInputAdapter); | 598 | return typeof(IInputAdapter); |
| 595 | case AdapterType.Action: | 599 | case AdapterType.Action: |