History

GSF.TimeSeries: Added filter adapters to modify measurement properties before routing.

StephenCWills committed 8 years ago

Commit 4ff56a01 parent b308b3223 files · +1077 −149Browse files

Unified · Split

23 files
  1. Source/Libraries/Adapters/TestingAdapters/SetFlagsFilterAdapter.cs +103 −0
  2. Source/Libraries/Adapters/TestingAdapters/TestingAdapters.csproj +1 −0
  3. Source/Libraries/GSF.TimeSeries/Adapters/FilterAdapterBase.cs +146 −0
  4. Source/Libraries/GSF.TimeSeries/Adapters/FilterAdapterCollection.cs +159 −0
  5. Source/Libraries/GSF.TimeSeries/Adapters/IFilterAdapter.cs +45 −0
  6. Source/Libraries/GSF.TimeSeries/Adapters/IaonSession.cs +52 −6
  7. Source/Libraries/GSF.TimeSeries/Data/MySQL/GSFSchema.sql +51 −2
  8. Source/Libraries/GSF.TimeSeries/Data/MySQL/InitialDataSet.sql +28 −27
  9. Source/Libraries/GSF.TimeSeries/Data/Oracle/GSFSchema.sql +81 −2
  10. Source/Libraries/GSF.TimeSeries/Data/Oracle/InitialDataSet.sql +28 −27
  11. Source/Libraries/GSF.TimeSeries/Data/PostgreSQL/GSFSchema.sql +64 −2
  12. Source/Libraries/GSF.TimeSeries/Data/PostgreSQL/InitialDataSet.sql +28 −27
  13. Source/Libraries/GSF.TimeSeries/Data/SQL Server/GSFSchema.sql +96 −1
  14. Source/Libraries/GSF.TimeSeries/Data/SQL Server/InitialDataSet.sql +29 −26
  15. Source/Libraries/GSF.TimeSeries/Data/SQLite/GSFSchema.sql +53 −2
  16. Source/Libraries/GSF.TimeSeries/Data/SQLite/InitialDataSet.sql +28 −27
  17. Source/Libraries/GSF.TimeSeries/GSF.TimeSeries.csproj +3 −0
  18. Source/Libraries/GSF.TimeSeries/ServiceHostBase.cs +3 −0
  19. Source/Libraries/GSF.TimeSeries/UI/DataModels/Adapter.cs +17 −0
  20. Source/Libraries/GSF.TimeSeries/UI/WPF/GSF.TimeSeries.UI.WPF.csproj +7 −0
  21. Source/Libraries/GSF.TimeSeries/UI/WPF/UserControls/CustomFilterAdapterUserControl.xaml +8 −0
  22. Source/Libraries/GSF.TimeSeries/UI/WPF/UserControls/CustomFilterAdapterUserControl.xaml.cs +43 −0
  23. Source/Libraries/GSF.TimeSeries/UI/WPF/ViewModels/Adapters.cs +4 −0
Source/Libraries/Adapters/TestingAdapters/SetFlagsFilterAdapter.cs+103−0
@@ -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
24using System;
25using System.Collections.Generic;
26using System.ComponentModel;
27using GSF.TimeSeries;
28using GSF.TimeSeries.Adapters;
29
30namespace 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}
Source/Libraries/Adapters/TestingAdapters/TestingAdapters.csproj+1−0
@@ -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" />
Source/Libraries/GSF.TimeSeries/Adapters/FilterAdapterBase.cs+146−0
@@ -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
24using System.Collections.Generic;
25using System.ComponentModel;
26using System.Linq;
27
28namespace 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}
Source/Libraries/GSF.TimeSeries/Adapters/FilterAdapterCollection.cs+159−0
@@ -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
24using System;
25using System.Collections.Generic;
26using System.Collections.ObjectModel;
27using System.Data;
28using System.Linq;
29using GSF.Data;
30
31namespace 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}
Source/Libraries/GSF.TimeSeries/Adapters/IFilterAdapter.cs+45−0
@@ -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
24using System.Collections.Generic;
25
26namespace 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}
Source/Libraries/GSF.TimeSeries/Adapters/IaonSession.cs+52−6
@@ -32,6 +32,7 @@ using GSF.Annotations; · 31 unmodified lines
32using GSF.Collections;32using GSF.Collections;
33using GSF.Configuration;33using GSF.Configuration;
34using GSF.Diagnostics;34using GSF.Diagnostics;
35using System.Collections.Generic;
35 36
36// ReSharper disable InconsistentlySynchronizedField37// ReSharper disable InconsistentlySynchronizedField
37namespace GSF.TimeSeries.Adapters38namespace 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 collection191 // 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 collection196 // 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. This211 // 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 data212 // 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 collection436 // 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 collection446 // 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 collection457 // 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>
Source/Libraries/GSF.TimeSeries/Data/MySQL/GSFSchema.sql+51−2
@@ -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-- *******************************************************************************************
40CREATE VIEW SchemaVersion AS40CREATE VIEW SchemaVersion AS
41SELECT 6 AS VersionNumber;41SELECT 7 AS VersionNumber;
42 42
43CREATE TABLE ErrorLog(43CREATE 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
506CREATE 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
506CREATE TABLE OutputStream(522CREATE 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
836ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE;852ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE;
837 853
854ALTER TABLE CustomFilterAdapter ADD CONSTRAINT FK_CustomFilterAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE;
855
838ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE;856ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE ON UPDATE CASCADE;
839 857
840ALTER TABLE PowerCalculation ADD CONSTRAINT FK_PowerCalculation_Measurement1 FOREIGN KEY(ApparentPowerOutputSignalID) REFERENCES Measurement (SignalID) ON DELETE CASCADE ON UPDATE CASCADE;858ALTER 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
958WHERE (CustomInputAdapter.Enabled <> 0)976WHERE (CustomInputAdapter.Enabled <> 0)
959ORDER BY CustomInputAdapter.LoadOrder;977ORDER BY CustomInputAdapter.LoadOrder;
960 978
979CREATE VIEW RuntimeCustomFilterAdapter
980AS
981SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName,
982 TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString
983FROM CustomFilterAdapter LEFT OUTER JOIN
984 Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = N'CustomFilterAdapter'
985WHERE (CustomFilterAdapter.Enabled <> 0)
986ORDER BY CustomFilterAdapter.LoadOrder;
987
961CREATE VIEW RuntimeOutputStreamDevice988CREATE VIEW RuntimeOutputStreamDevice
962AS989AS
963SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, 990SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym,
@@ -1095,6 +1122,11 @@ FROM RuntimeCalculatedMeasurement · 131 unmodified lines
1095UNION1122UNION
1096SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString1123SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1097FROM RuntimeCustomActionAdapter;1124FROM RuntimeCustomActionAdapter;
1125
1126CREATE VIEW IaonFilterAdapter
1127AS
1128SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1129FROM RuntimeCustomFilterAdapter;
1098 1130
1099CREATE VIEW MeasurementDetail1131CREATE VIEW MeasurementDetail
1100AS1132AS
@@ -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 NodeName1234 CA.Enabled, N.Name AS NodeName
1203FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;1235FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;
1204 1236
1237CREATE VIEW CustomFilterAdapterDetail AS
1238SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder,
1239 CA.Enabled, N.Name AS NodeName
1240FROM CustomFilterAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;
1241
1205CREATE VIEW IaonTreeView AS1242CREATE VIEW IaonTreeView AS
1206SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString1243SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1207FROM IaonActionAdapter1244FROM IaonActionAdapter
@@ -1210,7 +1247,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, T · 2 unmodified lines
1210FROM IaonInputAdapter1247FROM IaonInputAdapter
1211UNION ALL1248UNION ALL
1212SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString1249SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1213FROM IaonOutputAdapter;1250FROM IaonOutputAdapter
1251UNION ALL
1252SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1253FROM IaonFilterAdapter;
1214 1254
1215CREATE VIEW OtherDeviceDetail AS1255CREATE VIEW OtherDeviceDetail AS
1216SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, 1256SELECT 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
1360CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter1400CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter
1361FOR EACH ROW DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = N'CustomOutputAdapter';1401FOR EACH ROW DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = N'CustomOutputAdapter';
1362 1402
1403CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Insert AFTER INSERT ON CustomFilterAdapter
1404FOR EACH ROW INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, N'CustomFilterAdapter');
1405
1406CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomFilterAdapter
1407FOR EACH ROW DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = N'CustomFilterAdapter';
1408
1363DELIMITER $$1409DELIMITER $$
1364CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device FOR EACH ROW1410CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device FOR EACH ROW
1365BEGIN1411BEGIN
@@ -1421,6 +1467,9 @@ FOR EACH ROW SET NEW.CreatedBy = COALESCE(NEW.CreatedBy, USER()), NEW.CreatedOn · 55 unmodified lines
1421CREATE TRIGGER CustomOutputAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapter1467CREATE TRIGGER CustomOutputAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapter
1422FOR 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());1468FOR 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
1470CREATE TRIGGER CustomFilterAdapter_InsertDefault BEFORE INSERT ON CustomFilterAdapter
1471FOR 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
1424CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device1473CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device
1425FOR 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());1474FOR 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
Source/Libraries/GSF.TimeSeries/Data/MySQL/InitialDataSet.sql+28−27
@@ -39,33 +39,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 38 unmodified lines
39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37);39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37);
40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);
41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);
42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); 42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40);
43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); 43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41);
44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); 44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42);
45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); 45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43);
46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); 46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44);
47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); 47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45);
48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); 48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46);
49INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); 49INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47);
50INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); 50INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48);
51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1);51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1);
52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1);52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1);
53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1);53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1);
54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1);54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1);
55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1);55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1);
56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1);56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1);
57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1);57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1);
58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1);58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1);
59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1);59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1);
60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1);60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1);
61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1);61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1);
62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1);62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1);
63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1);63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1);
64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1);64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1);
65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1);65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1);
66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1);66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1);
67INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1);67INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1);
68INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1);68INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1);
69INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1);
69INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);70INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);
70INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);71INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);
71INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);72INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);
Source/Libraries/GSF.TimeSeries/Data/Oracle/GSFSchema.sql+81−2
@@ -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-- *******************************************************************************************
40CREATE VIEW SchemaVersion AS40CREATE VIEW SchemaVersion AS
41SELECT 6 AS VersionNumber41SELECT 7 AS VersionNumber
42FROM dual;42FROM dual;
43 43
44CREATE TABLE ErrorLog(44CREATE TABLE ErrorLog(
@@ -755,6 +755,32 @@ CREATE TRIGGER AI_CustomInputAdapter BEFORE INSERT ON CustomInputAdapter · 710 unmodified lines
755END;755END;
756/756/
757 757
758CREATE 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
773CREATE UNIQUE INDEX IX_CustomFilterAdapter ON CustomFilterAdapter (ID ASC) TABLESPACE GSFSchema_INDEX;
774
775ALTER TABLE CustomFilterAdapter ADD CONSTRAINT PK_CustomFilterAdapter PRIMARY KEY (ID);
776
777CREATE SEQUENCE SEQ_CustomFilterAdapter START WITH 1 INCREMENT BY 1;
778
779CREATE TRIGGER AI_CustomFilterAdapter BEFORE INSERT ON CustomFilterAdapter
780 FOR EACH ROW BEGIN SELECT SEQ_CustomFilterAdapter.nextval INTO :NEW.ID FROM dual;
781END;
782/
783
758CREATE TABLE OutputStream(784CREATE 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
1181ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE;1207ALTER TABLE CustomInputAdapter ADD CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE;
1182 1208
1209ALTER TABLE CustomFilterAdapter ADD CONSTRAINT FK_CustomFilterAdapter_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE;
1210
1183ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE;1211ALTER TABLE OutputStream ADD CONSTRAINT FK_OutputStream_Node FOREIGN KEY(NodeID) REFERENCES Node (ID) ON DELETE CASCADE;
1184 1212
1185ALTER TABLE PowerCalculation ADD CONSTRAINT FK_PowerCalculation_Measurement1 FOREIGN KEY(ApparentPowerOutputSignalID) REFERENCES Measurement (SignalID) ON DELETE CASCADE;1213ALTER 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
1333WHERE (CustomInputAdapter.Enabled <> 0)1361WHERE (CustomInputAdapter.Enabled <> 0)
1334ORDER BY CustomInputAdapter.LoadOrder;1362ORDER BY CustomInputAdapter.LoadOrder;
1335 1363
1364CREATE VIEW RuntimeCustomFilterAdapter
1365AS
1366SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName,
1367 TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString
1368FROM CustomFilterAdapter LEFT OUTER JOIN
1369 Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = 'CustomFilterAdapter'
1370WHERE (CustomFilterAdapter.Enabled <> 0)
1371ORDER BY CustomFilterAdapter.LoadOrder;
1372
1336CREATE VIEW RuntimeOutputStreamDevice1373CREATE VIEW RuntimeOutputStreamDevice
1337AS1374AS
1338SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, 1375SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym,
@@ -1471,6 +1508,11 @@ FROM RuntimeCalculatedMeasurement · 132 unmodified lines
1471UNION ALL1508UNION ALL
1472SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString1509SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1473FROM RuntimeCustomActionAdapter;1510FROM RuntimeCustomActionAdapter;
1511
1512CREATE VIEW IaonFilterAdapter
1513AS
1514SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1515FROM RuntimeCustomFilterAdapter;
1474 1516
1475CREATE VIEW MeasurementDetail1517CREATE VIEW MeasurementDetail
1476AS1518AS
@@ -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 NodeName1624 CA.Enabled, N.Name AS NodeName
1583FROM CustomOutputAdapter CA INNER JOIN Node N ON CA.NodeID = N.ID;1625FROM CustomOutputAdapter CA INNER JOIN Node N ON CA.NodeID = N.ID;
1584 1626
1627CREATE VIEW CustomFilterAdapterDetail AS
1628SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, CA.ConnectionString AS ConnectionString, CA.LoadOrder,
1629 CA.Enabled, N.Name AS NodeName
1630FROM CustomFilterAdapter CA INNER JOIN Node N ON CA.NodeID = N.ID;
1631
1585CREATE VIEW IaonTreeView AS1632CREATE VIEW IaonTreeView AS
1586SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString1633SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString
1587FROM IaonActionAdapter1634FROM IaonActionAdapter
@@ -1590,7 +1637,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, T · 2 unmodified lines
1590FROM IaonInputAdapter1637FROM IaonInputAdapter
1591UNION ALL1638UNION ALL
1592SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString1639SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString
1593FROM IaonOutputAdapter;1640FROM IaonOutputAdapter
1641UNION ALL
1642SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString AS ConnectionString
1643FROM IaonFilterAdapter;
1594 1644
1595CREATE VIEW OtherDeviceDetail AS1645CREATE VIEW OtherDeviceDetail AS
1596SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, 1646SELECT 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
1800END;1850END;
1801/1851/
1802 1852
1853CREATE TRIGGER CustFtrAdaptr_RuntimeSync_Insrt AFTER INSERT ON CustomFilterAdapter
1854 FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(:NEW.ID, 'CustomFilterAdapter');
1855END;
1856/
1857
1858CREATE TRIGGER CustFtrAdaptr_RuntimeSync_Del BEFORE DELETE ON CustomFilterAdapter
1859 FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = :OLD.ID AND SourceTable = 'CustomFilterAdapter';
1860END;
1861/
1862
1803CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device1863CREATE 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');
1805END;1865END;
@@ -2015,6 +2075,25 @@ CREATE TRIGGER CustomOutAdapter_InsertDefault BEFORE INSERT ON CustomOutputAdapt · 209 unmodified lines
2015END;2075END;
2016/2076/
2017 2077
2078CREATE 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;
2094END;
2095/
2096
2018CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device FOR EACH ROW BEGIN2097CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device FOR EACH ROW BEGIN
2019 IF :NEW.UniqueID IS NULL THEN2098 IF :NEW.UniqueID IS NULL THEN
2020 SELECT NEW_GUID() INTO :NEW.UniqueID FROM dual;2099 SELECT NEW_GUID() INTO :NEW.UniqueID FROM dual;
Source/Libraries/GSF.TimeSeries/Data/Oracle/InitialDataSet.sql+28−27
@@ -37,33 +37,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 36 unmodified lines
37INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas &' || ' Electric', 37);37INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas &' || ' Electric', 37);
38INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);38INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);
39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);
40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); 40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40);
41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); 41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41);
42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); 42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42);
43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); 43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43);
44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); 44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44);
45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); 45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45);
46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); 46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46);
47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); 47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47);
48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); 48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48);
49INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1);49INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1);
50INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1);50INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1);
51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1);51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1);
52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1);52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1);
53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1);53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1);
54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1);54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1);
55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1);55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1);
56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1);56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1);
57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1);57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1);
58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1);58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1);
59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1);59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1);
60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1);60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1);
61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1);61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1);
62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1);62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1);
63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1);63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1);
64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1);64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1);
65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1);65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1);
66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1);66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1);
67INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1);
67INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);68INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);
68INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);69INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);
69INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);70INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);
Source/Libraries/GSF.TimeSeries/Data/PostgreSQL/GSFSchema.sql+64−2
@@ -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-- *******************************************************************************************
38CREATE VIEW SchemaVersion AS38CREATE VIEW SchemaVersion AS
39SELECT 6 AS VersionNumber;39SELECT 7 AS VersionNumber;
40 40
41CREATE EXTENSION "uuid-ossp";41CREATE 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 CASCADE555 CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE
556);556);
557 557
558CREATE 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
558CREATE TABLE PowerCalculation(574CREATE 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
871WHERE (CustomInputAdapter.Enabled <> 0)887WHERE (CustomInputAdapter.Enabled <> 0)
872ORDER BY CustomInputAdapter.LoadOrder;888ORDER BY CustomInputAdapter.LoadOrder;
873 889
890CREATE VIEW RuntimeCustomFilterAdapter
891AS
892SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName,
893 TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString
894FROM CustomFilterAdapter LEFT OUTER JOIN
895 Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = 'CustomFilterAdapter'
896WHERE (CustomFilterAdapter.Enabled <> 0)
897ORDER BY CustomFilterAdapter.LoadOrder;
898
874CREATE VIEW RuntimeOutputStreamDevice899CREATE VIEW RuntimeOutputStreamDevice
875AS900AS
876SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, 901SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym,
@@ -1013,6 +1038,11 @@ FROM RuntimeCalculatedMeasurement · 136 unmodified lines
1013UNION1038UNION
1014SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString1039SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1015FROM RuntimeCustomActionAdapter;1040FROM RuntimeCustomActionAdapter;
1041
1042CREATE VIEW IaonFilterAdapter
1043AS
1044SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1045FROM RuntimeCustomFilterAdapter;
1016 1046
1017CREATE VIEW MeasurementDetail1047CREATE VIEW MeasurementDetail
1018AS1048AS
@@ -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 NodeName1154 CA.Enabled, N.Name AS NodeName
1125FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;1155FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;
1126 1156
1157CREATE VIEW CustomFilterAdapterDetail AS
1158SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder,
1159 CA.Enabled, N.Name AS NodeName
1160FROM CustomFilterAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;
1161
1127CREATE VIEW IaonTreeView AS1162CREATE VIEW IaonTreeView AS
1128SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString1163SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1129FROM IaonActionAdapter1164FROM IaonActionAdapter
@@ -1132,7 +1167,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyNam · 2 unmodified lines
1132FROM IaonInputAdapter1167FROM IaonInputAdapter
1133UNION ALL1168UNION ALL
1134SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString1169SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1135FROM IaonOutputAdapter;1170FROM IaonOutputAdapter
1171UNION ALL
1172SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1173FROM IaonFilterAdapter;
1136 1174
1137CREATE VIEW OtherDeviceDetail AS1175CREATE VIEW OtherDeviceDetail AS
1138SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, 1176SELECT 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
1332CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter1370CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter
1333FOR EACH ROW EXECUTE PROCEDURE CustomOutputAdapter_RuntimeSync_DeleteFn();1371FOR EACH ROW EXECUTE PROCEDURE CustomOutputAdapter_RuntimeSync_DeleteFn();
1334 1372
1373-- CustomFilterAdapter_RuntimeSync_Insert --
1374CREATE FUNCTION CustomFilterAdapter_RuntimeSync_InsertFn() RETURNS TRIGGER
1375AS $CustomFilterAdapter_RuntimeSync_InsertFn$
1376BEGIN
1377 INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'CustomFilterAdapter');
1378 RETURN NEW;
1379END;
1380$CustomFilterAdapter_RuntimeSync_InsertFn$ LANGUAGE plpgsql;
1381
1382CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Insert AFTER INSERT ON CustomFilterAdapter
1383FOR EACH ROW EXECUTE PROCEDURE CustomFilterAdapter_RuntimeSync_InsertFn();
1384
1385-- CustomFilterAdapter_RuntimeSync_Delete --
1386CREATE FUNCTION CustomFilterAdapter_RuntimeSync_DeleteFn() RETURNS TRIGGER
1387AS $CustomFilterAdapter_RuntimeSync_DeleteFn$
1388BEGIN
1389 DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomFilterAdapter';
1390 RETURN OLD;
1391END;
1392$CustomFilterAdapter_RuntimeSync_DeleteFn$ LANGUAGE plpgsql;
1393
1394CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomFilterAdapter
1395FOR EACH ROW EXECUTE PROCEDURE CustomFilterAdapter_RuntimeSync_DeleteFn();
1396
1335-- Device_RuntimeSync_Insert --1397-- Device_RuntimeSync_Insert --
1336CREATE FUNCTION Device_RuntimeSync_InsertFn() RETURNS TRIGGER1398CREATE FUNCTION Device_RuntimeSync_InsertFn() RETURNS TRIGGER
1337AS $Device_RuntimeSync_InsertFn$1399AS $Device_RuntimeSync_InsertFn$
Source/Libraries/GSF.TimeSeries/Data/PostgreSQL/InitialDataSet.sql+28−27
@@ -37,33 +37,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 36 unmodified lines
37INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37);37INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37);
38INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);38INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);
39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);
40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); 40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40);
41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); 41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41);
42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); 42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42);
43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); 43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43);
44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); 44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44);
45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); 45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45);
46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); 46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46);
47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); 47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47);
48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); 48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48);
49INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1);49INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1);
50INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1);50INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1);
51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1);51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1);
52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1);52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1);
53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1);53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1);
54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1);54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1);
55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1);55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1);
56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1);56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1);
57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1);57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1);
58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1);58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1);
59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1);59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1);
60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1);60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1);
61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1);61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1);
62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1);62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1);
63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1);63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1);
64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1);64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1);
65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1);65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1);
66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1);66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1);
67INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1);
67INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);68INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);
68INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);69INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);
69INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);70INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);
Source/Libraries/GSF.TimeSeries/Data/SQL Server/GSFSchema.sql+96−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-- *******************************************************************************************
118CREATE VIEW [dbo].[SchemaVersion] AS118CREATE VIEW [dbo].[SchemaVersion] AS
119SELECT 6 AS VersionNumber119SELECT 7 AS VersionNumber
120GO120GO
121 121
122SET ANSI_NULLS ON122SET ANSI_NULLS ON
@@ -1015,6 +1015,63 @@ BEGIN · 892 unmodified lines
1015END1015END
1016 1016
1017 1017
1018GO
1019SET ANSI_NULLS ON
1020GO
1021SET QUOTED_IDENTIFIER ON
1022GO
1023CREATE 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
1042GO
1043
1044SET ANSI_NULLS ON
1045GO
1046
1047SET QUOTED_IDENTIFIER ON
1048GO
1049
1050CREATE TRIGGER [dbo].[CustomFilterAdapter_RuntimeSync]
1051 ON [dbo].[CustomFilterAdapter]
1052 AFTER INSERT, DELETE
1053AS
1054BEGIN
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
1072END
1073
1074
1018GO1075GO
1019SET ANSI_NULLS ON1076SET ANSI_NULLS ON
1020GO1077GO
@@ -1955,6 +2012,20 @@ FROM dbo.CustomInputAdapter WITH (NOLOCK) LEFT OUTER JOIN · 934 unmodified lines
1955WHERE (dbo.CustomInputAdapter.Enabled <> 0)2012WHERE (dbo.CustomInputAdapter.Enabled <> 0)
1956ORDER BY dbo.CustomInputAdapter.LoadOrder2013ORDER BY dbo.CustomInputAdapter.LoadOrder
1957 2014
2015GO
2016SET ANSI_NULLS ON
2017GO
2018SET QUOTED_IDENTIFIER ON
2019GO
2020CREATE VIEW [dbo].[RuntimeCustomFilterAdapter]
2021AS
2022SELECT 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
2024FROM 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'
2026WHERE (dbo.CustomFilterAdapter.Enabled <> 0)
2027ORDER BY dbo.CustomFilterAdapter.LoadOrder
2028
1958GO2029GO
1959SET ANSI_NULLS ON2030SET ANSI_NULLS ON
1960GO2031GO
@@ -2167,6 +2238,16 @@ UNION · 206 unmodified lines
2167SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString2238SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
2168FROM dbo.RuntimeCustomActionAdapter WITH (NOLOCK)2239FROM dbo.RuntimeCustomActionAdapter WITH (NOLOCK)
2169 2240
2241GO
2242SET ANSI_NULLS ON
2243GO
2244SET QUOTED_IDENTIFIER ON
2245GO
2246CREATE VIEW [dbo].[IaonFilterAdapter]
2247AS
2248SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
2249FROM dbo.RuntimeCustomFilterAdapter WITH (NOLOCK)
2250
2170GO2251GO
2171CREATE VIEW [dbo].[HistorianMetadata]2252CREATE VIEW [dbo].[HistorianMetadata]
2172AS2253AS
@@ -2316,6 +2397,12 @@ SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, ISNUL · 143 unmodified lines
2316FROM dbo.CustomOutputAdapter AS CA WITH (NOLOCK) INNER JOIN2397FROM dbo.CustomOutputAdapter AS CA WITH (NOLOCK) INNER JOIN
2317 dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID2398 dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID
2318GO2399GO
2400CREATE VIEW [dbo].[CustomFilterAdapterDetail] AS
2401SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, ISNULL(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder,
2402 CA.Enabled, N.Name AS NodeName
2403FROM dbo.CustomFilterAdapter AS CA WITH (NOLOCK) INNER JOIN
2404 dbo.Node AS N WITH (NOLOCK) ON CA.NodeID = N.ID
2405GO
2319CREATE VIEW [dbo].[IaonTreeView] AS2406CREATE VIEW [dbo].[IaonTreeView] AS
2320SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString2407SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString
2321FROM dbo.IaonActionAdapter WITH (NOLOCK)2408FROM dbo.IaonActionAdapter WITH (NOLOCK)
@@ -2325,6 +2412,9 @@ FROM dbo.IaonInputAdapter WITH (NOLOCK) · 3 unmodified lines
2325UNION ALL2412UNION ALL
2326SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString2413SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString
2327FROM dbo.IaonOutputAdapter WITH (NOLOCK)2414FROM dbo.IaonOutputAdapter WITH (NOLOCK)
2415UNION ALL
2416SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, ISNULL(ConnectionString, '') AS ConnectionString
2417FROM dbo.IaonFilterAdapter WITH (NOLOCK)
2328GO2418GO
2329CREATE VIEW [dbo].[OtherDeviceDetail] AS2419CREATE VIEW [dbo].[OtherDeviceDetail] AS
2330SELECT OD.ID, OD.Acronym, ISNULL(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, 2420SELECT 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
2539ON UPDATE CASCADE2629ON UPDATE CASCADE
2540ON DELETE CASCADE2630ON DELETE CASCADE
2541GO2631GO
2632ALTER TABLE [dbo].[CustomFilterAdapter] WITH CHECK ADD CONSTRAINT [FK_CustomFilterAdapter_Node] FOREIGN KEY([NodeID])
2633REFERENCES [dbo].[Node] ([ID])
2634ON UPDATE CASCADE
2635ON DELETE CASCADE
2636GO
2542ALTER TABLE [dbo].[OutputStream] WITH CHECK ADD CONSTRAINT [FK_OutputStream_Node] FOREIGN KEY([NodeID])2637ALTER TABLE [dbo].[OutputStream] WITH CHECK ADD CONSTRAINT [FK_OutputStream_Node] FOREIGN KEY([NodeID])
2543REFERENCES [dbo].[Node] ([ID])2638REFERENCES [dbo].[Node] ([ID])
2544ON UPDATE CASCADE2639ON UPDATE CASCADE
Source/Libraries/GSF.TimeSeries/Data/SQL Server/InitialDataSet.sql+29−26
@@ -118,85 +118,88 @@ GO · 117 unmodified lines
118INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39)118INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39)
119GO119GO
120 120
121INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40) 121INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40)
122GO122GO
123 123
124INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41) 124INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41)
125GO125GO
126 126
127INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42) 127INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42)
128GO128GO
129 129
130INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43) 130INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43)
131GO131GO
132 132
133INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44) 133INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44)
134GO134GO
135 135
136INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45) 136INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45)
137GO137GO
138 138
139INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46) 139INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46)
140GO140GO
141 141
142INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47) 142INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47)
143GO143GO
144 144
145INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48)145INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48)
146GO146GO
147 147
148INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1)148INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1)
149GO149GO
150 150
151INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1)151INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1)
152GO152GO
153 153
154INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1)154INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1)
155GO155GO
156 156
157INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1)157INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1)
158GO158GO
159 159
160INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1)160INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1)
161GO161GO
162 162
163INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1)163INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1)
164GO164GO
165 165
166INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines the measurements in an output stream', 7, 1)166INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1)
167GO167GO
168 168
169INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1)169INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines the measurements in an output stream', 8, 1)
170GO170GO
171 171
172INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1)172INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1)
173GO173GO
174 174
175INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1)175INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1)
176GO176GO
177 177
178INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1)178INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1)
179GO179GO
180 180
181INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1)181INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1)
182GO182GO
183 183
184INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1)184INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1)
185GO185GO
186 186
187INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1)187INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1)
188GO188GO
189 189
190INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1)190INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1)
191GO191GO
192 192
193INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1)193INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1)
194GO194GO
195 195
196INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1)196INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1)
197GO197GO
198 198
199INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1)199INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1)
200GO
201
202INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1)
200GO203GO
201 204
202INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1)205INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1)
Source/Libraries/GSF.TimeSeries/Data/SQLite/GSFSchema.sql+53−2
@@ -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-- *******************************************************************************************
35CREATE VIEW SchemaVersion AS35CREATE VIEW SchemaVersion AS
36SELECT 6 AS VersionNumber;36SELECT 7 AS VersionNumber;
37 37
38CREATE TABLE ErrorLog(38CREATE 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 CASCADE507 CONSTRAINT FK_CustomInputAdapter_Node FOREIGN KEY(NodeID) REFERENCES node (ID) ON DELETE CASCADE ON UPDATE CASCADE
508);508);
509 509
510CREATE 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
510CREATE TABLE OutputStream(526CREATE 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
862WHERE (CustomInputAdapter.Enabled <> 0)878WHERE (CustomInputAdapter.Enabled <> 0)
863ORDER BY CustomInputAdapter.LoadOrder;879ORDER BY CustomInputAdapter.LoadOrder;
864 880
881CREATE VIEW RuntimeCustomFilterAdapter
882AS
883SELECT CustomFilterAdapter.NodeID, Runtime.ID, CustomFilterAdapter.AdapterName,
884 TRIM(CustomFilterAdapter.AssemblyName) AS AssemblyName, TRIM(CustomFilterAdapter.TypeName) AS TypeName, CustomFilterAdapter.ConnectionString
885FROM CustomFilterAdapter LEFT OUTER JOIN
886 Runtime ON CustomFilterAdapter.ID = Runtime.SourceID AND Runtime.SourceTable = 'CustomFilterAdapter'
887WHERE (CustomFilterAdapter.Enabled <> 0)
888ORDER BY CustomFilterAdapter.LoadOrder;
889
865CREATE VIEW RuntimeOutputStreamDevice890CREATE VIEW RuntimeOutputStreamDevice
866AS891AS
867SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym, 892SELECT OutputStreamDevice.NodeID, Runtime.ID AS ParentID, OutputStreamDevice.ID, OutputStreamDevice.IDCode, OutputStreamDevice.Acronym,
@@ -1004,6 +1029,11 @@ FROM RuntimeCalculatedMeasurement · 136 unmodified lines
1004UNION1029UNION
1005SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString1030SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1006FROM RuntimeCustomActionAdapter;1031FROM RuntimeCustomActionAdapter;
1032
1033CREATE VIEW IaonFilterAdapter
1034AS
1035SELECT NodeID, ID, AdapterName, AssemblyName, TypeName, ConnectionString
1036FROM RuntimeCustomFilterAdapter;
1007 1037
1008CREATE VIEW MeasurementDetail1038CREATE VIEW MeasurementDetail
1009AS1039AS
@@ -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 NodeName1145 CA.Enabled, N.Name AS NodeName
1116FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;1146FROM CustomOutputAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;
1117 1147
1148CREATE VIEW CustomFilterAdapterDetail AS
1149SELECT CA.NodeID, CA.ID, CA.AdapterName, CA.AssemblyName, CA.TypeName, COALESCE(CA.ConnectionString, '') AS ConnectionString, CA.LoadOrder,
1150 CA.Enabled, N.Name AS NodeName
1151FROM CustomFilterAdapter AS CA INNER JOIN Node AS N ON CA.NodeID = N.ID;
1152
1118CREATE VIEW IaonTreeView AS1153CREATE VIEW IaonTreeView AS
1119SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString1154SELECT 'Action Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1120FROM IaonActionAdapter1155FROM IaonActionAdapter
@@ -1123,7 +1158,10 @@ SELECT 'Input Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyNam · 2 unmodified lines
1123FROM IaonInputAdapter1158FROM IaonInputAdapter
1124UNION ALL1159UNION ALL
1125SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString1160SELECT 'Output Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1126FROM IaonOutputAdapter;1161FROM IaonOutputAdapter
1162UNION ALL
1163SELECT 'Filter Adapters' AS AdapterType, NodeID, ID, AdapterName, AssemblyName, TypeName, COALESCE(ConnectionString, '') AS ConnectionString
1164FROM IaonFilterAdapter;
1127 1165
1128CREATE VIEW OtherDeviceDetail AS1166CREATE VIEW OtherDeviceDetail AS
1129SELECT OD.ID, OD.Acronym, COALESCE(OD.Name, '') AS Name, OD.IsConcentrator, OD.CompanyID, OD.VendorDeviceID, OD.Longitude, OD.Latitude, 1167SELECT 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
1279CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter1317CREATE TRIGGER CustomOutputAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomOutputAdapter
1280FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomOutputAdapter'; END;1318FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomOutputAdapter'; END;
1281 1319
1320CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Insert AFTER INSERT ON CustomFilterAdapter
1321FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'CustomFilterAdapter'); END;
1322
1323CREATE TRIGGER CustomFilterAdapter_RuntimeSync_Delete BEFORE DELETE ON CustomFilterAdapter
1324FOR EACH ROW BEGIN DELETE FROM Runtime WHERE SourceID = OLD.ID AND SourceTable = 'CustomFilterAdapter'; END;
1325
1282CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device1326CREATE TRIGGER Device_RuntimeSync_Insert AFTER INSERT ON Device
1283FOR EACH ROW BEGIN INSERT INTO Runtime (SourceID, SourceTable) VALUES(NEW.ID, 'Device'); END;1327FOR 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 = '';
1367END;1411END;
1368 1412
1413CREATE TRIGGER CustomFilterAdapter_InsertDefault AFTER INSERT ON CustomFilterAdapter
1414FOR EACH ROW
1415BEGIN
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 = '';
1418END;
1419
1369CREATE TRIGGER Device_InsertDefault AFTER INSERT ON Device1420CREATE TRIGGER Device_InsertDefault AFTER INSERT ON Device
1370FOR EACH ROW1421FOR EACH ROW
1371BEGIN1422BEGIN
Source/Libraries/GSF.TimeSeries/Data/SQLite/InitialDataSet.sql+28−27
@@ -39,33 +39,34 @@ INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('HEC', 'HEC', ' · 38 unmodified lines
39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37);39INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('OGE', 'OGE', 'Oklahoma Gas & Electric', 37);
40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);40INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ITC', 'ITC', 'International Transmission Company', 38);
41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);41INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('DUKE', 'DUK', 'Duke Power', 39);
42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40); 42INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('ME', 'ME', 'Central Maine Power Company', 40);
43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41); 43INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('UI', 'UI', 'United Illuminating Company', 41);
44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42); 44INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NH', 'NH', 'Public Service Company of New Hampshire', 42);
45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43); 45INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('VE', 'VE', 'Vermont Electric Company', 43);
46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44); 46INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('CX', 'CX', 'Northeast Utilities Services Company', 44);
47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45); 47INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('NE', 'NE', 'National Grid USA', 45);
48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46); 48INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BE', 'BE', 'NSTAR Electric', 46);
49INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47); 49INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('BH', 'BH', 'Bangor Hydro-Electric Company', 47);
50INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48); 50INSERT INTO Company(Acronym, MapAcronym, Name, LoadOrder) VALUES('SDGE', 'SDGE', 'San Diego Gas & Electric', 48);
51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 1, 1);51INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonFilterAdapter', 'FilterAdapters', 'Defines IFilterAdapter definitions for a PDC node', 1, 1);
52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 2, 1);52INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonInputAdapter', 'InputAdapters', 'Defines IInputAdapter definitions for a PDC node', 2, 1);
53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 3, 1);53INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonActionAdapter', 'ActionAdapters', 'Defines IActionAdapter definitions for a PDC node', 3, 1);
54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 4, 1);54INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('IaonOutputAdapter', 'OutputAdapters', 'Defines IOutputAdapter definitions for a PDC node', 4, 1);
55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 5, 1);55INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('ActiveMeasurement', 'ActiveMeasurements', 'Defines active system measurements for a PDC node', 5, 1);
56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 6, 1);56INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeInputStreamDevice', 'InputStreamDevices', 'Defines input stream devices associated with a concentrator', 6, 1);
57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 7, 1);57INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamDevice', 'OutputStreamDevices', 'Defines output stream devices defined for a concentrator', 7, 1);
58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 8, 1);58INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeOutputStreamMeasurement', 'OutputStreamMeasurements', 'Defines output stream measurements for an output stream', 8, 1);
59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 9, 1);59INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDevicePhasor', 'OutputStreamDevicePhasors', 'Defines phasors for output stream devices', 9, 1);
60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 10, 1);60INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceAnalog', 'OutputStreamDeviceAnalogs', 'Defines analog values for output stream devices', 10, 1);
61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 11, 1);61INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('OutputStreamDeviceDigital', 'OutputStreamDeviceDigitals', 'Defines digital values for output stream devices', 11, 1);
62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 12, 1);62INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('RuntimeStatistic', 'Statistics', 'Defines statistics that are monitored for devices and output streams', 12, 1);
63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 13, 1);63INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Subscriber', 'Subscribers', 'Defines subscribers that can request streaming points from a Gateway node', 13, 1);
64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 14, 1);64INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurement', 'SubscriberMeasurements', 'Defines measurements associated with a Gateway subscriber', 14, 1);
65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 15, 1);65INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('SubscriberMeasurementGroup', 'SubscriberMeasurementGroups', 'Defines measurement groups associated with a Gateway subscriber', 15, 1);
66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 16, 1);66INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroup', 'MeasurementGroups', 'Defines a group of measurements', 16, 1);
67INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 17, 1);67INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('MeasurementGroupMeasurement', 'MeasurementGroupMeasurements', 'Defines the measurements in a measurement group', 17, 1);
68INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1);68INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('Alarm', 'Alarms', 'Defines alarms that monitor the values of measurements', 18, 1);
69INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 19, 1);
69INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);70INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Time Series Startup Operations', 'GSF.TimeSeries.dll', 'GSF.TimeSeries.TimeSeriesStartupOperations', 'PerformTimeSeriesStartupOperations', '', 0, 1);
70INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);71INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Phasor Data Source Validation', 'PhasorProtocolAdapters.dll', 'PhasorProtocolAdapters.CommonPhasorServices', 'PhasorDataSourceValidation', '', 1, 1);
71INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);72INSERT INTO DataOperation(Description, AssemblyName, TypeName, MethodName, Arguments, LoadOrder, Enabled) VALUES('Optimize Local Historian Settings', 'HistorianAdapters.dll', 'HistorianAdapters.LocalOutputAdapter', 'OptimizeLocalHistorianSettings', '', 2, 1);
Source/Libraries/GSF.TimeSeries/GSF.TimeSeries.csproj+3−0
@@ -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" />
Source/Libraries/GSF.TimeSeries/ServiceHostBase.cs+3−0
@@ -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
Source/Libraries/GSF.TimeSeries/UI/DataModels/Adapter.cs+17−0
@@ -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 else376 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 else428 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 else503 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 else543 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 else598 else
Source/Libraries/GSF.TimeSeries/UI/WPF/GSF.TimeSeries.UI.WPF.csproj+7−0
@@ -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>
Source/Libraries/GSF.TimeSeries/UI/WPF/UserControls/CustomFilterAdapterUserControl.xaml+8−0
@@ -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>
Source/Libraries/GSF.TimeSeries/UI/WPF/UserControls/CustomFilterAdapterUserControl.xaml.cs+43−0
@@ -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
24using System.Windows.Controls;
25using GSF.TimeSeries.UI.DataModels;
26
27namespace 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}
Source/Libraries/GSF.TimeSeries/UI/WPF/ViewModels/Adapters.cs+4−0
@@ -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 else557 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:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t