init
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
ALTER PROCEDURE [dbo].[sp_ChannelSettingsGet_92]
|
||||
@Id int = NULL,
|
||||
@SettingName NVARCHAR (255) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF (@Id IS NOT NULL) OR (@SettingName IS NOT NULL)
|
||||
BEGIN
|
||||
IF (@Id IS NULL)
|
||||
BEGIN
|
||||
SELECT [Id], [DefaultValue] FROM [dbo].[ChannelSettings] where (SettingName = @SettingName) AND (SettingName <>'StreamOutTMATSIntervalMs' AND SettingName <>'BridgeType')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [SettingName] FROM [dbo].[ChannelSettings] where (Id = @Id) AND (SettingName <>'StreamOutTMATSIntervalMs' AND SettingName <>'BridgeType')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [SettingName], [DefaultValue] FROM [dbo].[ChannelSettings] WHERE (SettingName <>'StreamOutTMATSIntervalMs' AND SettingName <>'BridgeType')
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,22 @@
|
||||
ALTER PROCEDURE [dbo].[sp_ChannelSettingsGet_93]
|
||||
@Id int = NULL,
|
||||
@SettingName NVARCHAR (255) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF (@Id IS NOT NULL) OR (@SettingName IS NOT NULL)
|
||||
BEGIN
|
||||
IF (@Id IS NULL)
|
||||
BEGIN
|
||||
SELECT [Id], [DefaultValue] FROM [dbo].[ChannelSettings] where (SettingName = @SettingName) AND (SettingName <>'BridgeType')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [SettingName] FROM [dbo].[ChannelSettings] where (Id = @Id) AND (SettingName <>'BridgeType')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [SettingName], [DefaultValue] FROM [dbo].[ChannelSettings] WHERE (SettingName <>'BridgeType')
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,22 @@
|
||||
ALTER PROCEDURE [dbo].[sp_ChannelSettingsGet]
|
||||
@Id int = NULL,
|
||||
@SettingName NVARCHAR (255) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF (@Id IS NOT NULL) OR (@SettingName IS NOT NULL)
|
||||
BEGIN
|
||||
IF (@Id IS NULL)
|
||||
BEGIN
|
||||
SELECT [Id], [DefaultValue] FROM [dbo].[ChannelSettings] where (SettingName = @SettingName) AND (SettingName <> 'ACCouplingEnabled' AND SettingName <>'StreamOutTMATSIntervalMs' AND SettingName <>'BridgeType')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [SettingName] FROM [dbo].[ChannelSettings] where (Id = @Id) AND (SettingName <> 'ACCouplingEnabled' AND SettingName <>'StreamOutTMATSIntervalMs' AND SettingName <>'BridgeType')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [SettingName], [DefaultValue] FROM [dbo].[ChannelSettings] WHERE (SettingName <> 'ACCouplingEnabled' AND SettingName <>'StreamOutTMATSIntervalMs' AND SettingName <>'BridgeType')
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,22 @@
|
||||
CREATE PROCEDURE [dbo].[sp_ChannelSettingsGet_95]
|
||||
@Id int = NULL,
|
||||
@SettingName NVARCHAR (255) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF (@Id IS NOT NULL) OR (@SettingName IS NOT NULL)
|
||||
BEGIN
|
||||
IF (@Id IS NULL)
|
||||
BEGIN
|
||||
SELECT [Id], [DefaultValue] FROM [dbo].[ChannelSettings] where (SettingName = @SettingName)
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [SettingName] FROM [dbo].[ChannelSettings] where (Id = @Id)
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [SettingName], [DefaultValue] FROM [dbo].[ChannelSettings]
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1 @@
|
||||
INSERT INTO [dbo].[ChannelSettings]([SettingName], [DefaultValue]) VALUES ('BridgeType', 'FullBridge');
|
||||
@@ -0,0 +1,3 @@
|
||||
CREATE TYPE [dbo].[StringList] AS TABLE(
|
||||
[Item] [NVARCHAR](MAX) NULL
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
ALTER PROCEDURE [dbo].[sp_GroupChannelSettingsGet_93]
|
||||
@ChannelId BIGINT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT SettingId, SettingValue FROM [dbo].[GroupChannelSettings] WHERE [ChannelId]=@ChannelId
|
||||
AND SettingId <> (SELECT Id FROM ChannelSettings WHERE SettingName = 'BridgeType')
|
||||
END
|
||||
@@ -0,0 +1,6 @@
|
||||
CREATE PROCEDURE [dbo].[sp_GroupChannelSettingsGet_95]
|
||||
@ChannelIdList StringList READONLY
|
||||
AS
|
||||
BEGIN
|
||||
SELECT * FROM [dbo].[GroupChannelSettings] WHERE [ChannelId] in (SELECT l.Item FROM @ChannelIdList l);
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
ALTER PROCEDURE [dbo].[sp_GroupChannelSettingsGet]
|
||||
@ChannelId BIGINT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT SettingId, CASE WHEN SettingValue='UART_STREAM' THEN 'CH10_ANALOG_2HDR' ELSE SettingValue END as SettingValue FROM [dbo].[GroupChannelSettings] WHERE [ChannelId]=@ChannelId
|
||||
AND SettingId <> (SELECT Id FROM ChannelSettings WHERE SettingName = 'BridgeType')
|
||||
END
|
||||
@@ -0,0 +1,70 @@
|
||||
ALTER PROCEDURE [dbo].[sp_SettingsUpdateInsert]
|
||||
@PropertyId nvarchar(255)
|
||||
,@PropertyType int
|
||||
,@PropertyValue nvarchar(255)
|
||||
,@UserId nvarchar(255) = null
|
||||
,@new_id int output
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0
|
||||
set @errorMessage = space(0)
|
||||
|
||||
if(@UserId is null)
|
||||
begin
|
||||
RAISERROR(15600,-1,-1, '[sp_SettingsUpdateInsert]') /* Error 1560 - An invalid parameter or option was specified for procedure*/
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
if(exists(select * from [dbo].[Settings] where UserId = @UserId and PropertyId = @PropertyId))
|
||||
begin
|
||||
set @new_id = 0
|
||||
exec [dbo].[sp_SettingsUpdate] @PropertyId
|
||||
,@PropertyValue
|
||||
,@UserId
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
exec [dbo].[sp_SettingsInsert] @PropertyId
|
||||
,@PropertyType
|
||||
,@PropertyValue
|
||||
,@UserId
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
|
||||
--36831 The ImportCreateDynamicGroups setting has replaced the CSVImportCreateDynamicGroups setting, so
|
||||
--if a pre-Version 93 client sets the old setting, the new one should be set also, so that Version 93
|
||||
--clients will have the value reflected in their "Use dynamic groups with CSV, EQX import" checkbox
|
||||
--(Version 93 clients will set both settings when the new one is set).
|
||||
|
||||
--This ALTER script was added to the following migrations, since it wasn't added when the new setting first went in:
|
||||
--Versions 92, 93, 94, and 95. It also was not added to the starting database for 4.1, 4.2, and 4.3.
|
||||
if(@PropertyId = 'CSVImportCreateDynamicGroups')
|
||||
begin
|
||||
if(exists(select * from [dbo].[Settings] where UserId = @UserId and PropertyId = 'ImportCreateDynamicGroups'))
|
||||
begin
|
||||
exec [dbo].[sp_SettingsUpdate] 'ImportCreateDynamicGroups'
|
||||
,@PropertyValue
|
||||
,@UserId
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
exec [dbo].[sp_SettingsInsert] 'ImportCreateDynamicGroups'
|
||||
,@PropertyType
|
||||
,@PropertyValue
|
||||
,@UserId
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
end
|
||||
end
|
||||
END
|
||||
@@ -0,0 +1,23 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupHardwareInsert_95]
|
||||
@DASId INT,
|
||||
@TestSetupId INT,
|
||||
@AddOrRemove BIT,
|
||||
@SamplesPerSecond FLOAT,
|
||||
@IsClockMaster BIT,
|
||||
@AntiAliasFilterRate FLOAT,
|
||||
@PTPDomainId INT,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR(255) OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
SET @errorNumber = 0;
|
||||
SET @errorMessage = space(0);
|
||||
|
||||
INSERT INTO [dbo].[TestSetupHardware] ([DASId], [TestSetupId], [AddOrRemove], [SamplesPerSecond], [IsClockMaster], [AntiAliasFilterRate], [PTPDomainId]) VALUES (@DASId, @TestSetupId, @AddOrRemove, @SamplesPerSecond, @IsClockMaster, @AntiAliasFilterRate, @PTPDomainId)
|
||||
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = ERROR_NUMBER()
|
||||
SET @errorMessage = ERROR_MESSAGE()
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,23 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupHardwareUpdate_95]
|
||||
@DASId INT,
|
||||
@TestSetupId INT,
|
||||
@AddOrRemove BIT,
|
||||
@SamplesPerSecond FLOAT,
|
||||
@IsClockMaster BIT,
|
||||
@AntiAliasFilterRate FLOAT,
|
||||
@PTPDomainId INT,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR(255) OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
SET @errorNumber = 0;
|
||||
SET @errorMessage = space(0);
|
||||
|
||||
UPDATE [dbo].[TestSetupHardware] SET [AddOrRemove]=@AddOrRemove, [SamplesPerSecond]=@SamplesPerSecond, [IsClockMaster]=@IsClockMaster, [AntiAliasFilterRate]=@AntiAliasFilterRate, [PTPDomainId]=@PTPDomainId WHERE [DASId]=@DASId AND [TestSetupId]=@TestSetupId
|
||||
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = ERROR_NUMBER()
|
||||
SET @errorMessage = ERROR_MESSAGE()
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE [dbo].TestSetupHardware ADD PTPDomainId INT NOT NULL DEFAULT (0)
|
||||
@@ -0,0 +1,45 @@
|
||||
CREATE PROCEDURE [dbo].[sp_DASGet_95]
|
||||
@SerialNumber nvarchar(50) = null
|
||||
,@position nvarchar(10) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT [DASId]
|
||||
,[SerialNumber]
|
||||
,[Type]
|
||||
,[MaxModules]
|
||||
,[MaxMemory]
|
||||
,[MaxSampleRate]
|
||||
,[MinSampleRate]
|
||||
,[FirmwareVersion]
|
||||
,[CalDate]
|
||||
,[ProtocolVersion]
|
||||
,[LastModified]
|
||||
,[LastModifiedBy]
|
||||
,[Version]
|
||||
,[LocalOnly]
|
||||
,[LastUsed]
|
||||
,[LastUsedBy]
|
||||
,[Connection]
|
||||
,[Channels]
|
||||
,[Position]
|
||||
,[ChannelTypes]
|
||||
,[Reprogramable]
|
||||
,[Reconfigurable]
|
||||
,[IsModule]
|
||||
,isnull([PositionOnDistributor], 0) as [PositionOnDistributor]
|
||||
,isnull([PositionOnChain], 0) as [PositionOnChain]
|
||||
,isnull([Port],0) as [Port]
|
||||
,isnull([ParentDAS], space(0)) as [ParentDAS],
|
||||
[FirstUseDate],
|
||||
[TestId],
|
||||
[GroupId],
|
||||
[StandIn],
|
||||
[MaxAAFRate]
|
||||
|
||||
FROM [dbo].[DAS] where
|
||||
(@SerialNumber is null or DASId = dbo.foo_IdGetDAS(@SerialNumber))
|
||||
and
|
||||
Position = case when @position is null then space(0) else @position end
|
||||
END
|
||||
@@ -0,0 +1,14 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupHardwareGet_95]
|
||||
@TestSetupId INT = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF( @TestSetupId IS NULL)
|
||||
BEGIN
|
||||
SELECT TestSetupHardwareId, DASId, TestSetupId, AddOrRemove, SamplesPerSecond, IsClockMaster, AntiAliasFilterRate, PTPDomainId FROM [dbo].TestSetupHardware
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT TestSetupHardwareId, DASId, TestSetupId, AddOrRemove, SamplesPerSecond, IsClockMaster, AntiAliasFilterRate, PTPDomainId FROM [dbo].TestSetupHardware WHERE [TestSetupId]=@TestSetupId
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,47 @@
|
||||
ALTER PROCEDURE [dbo].[sp_DASGet]
|
||||
@SerialNumber nvarchar(50) = null
|
||||
,@position nvarchar(10) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT [DASId]
|
||||
,[SerialNumber]
|
||||
,[Type]
|
||||
,[MaxModules]
|
||||
,[MaxMemory]
|
||||
,[MaxSampleRate]
|
||||
,[MinSampleRate]
|
||||
,[FirmwareVersion]
|
||||
,[CalDate]
|
||||
,[ProtocolVersion]
|
||||
,[LastModified]
|
||||
,[LastModifiedBy]
|
||||
,[Version]
|
||||
,[LocalOnly]
|
||||
,[LastUsed]
|
||||
,[LastUsedBy]
|
||||
,[Connection]
|
||||
,[Channels]
|
||||
,[Position]
|
||||
,[ChannelTypes]
|
||||
,[Reprogramable]
|
||||
,[Reconfigurable]
|
||||
,[IsModule]
|
||||
,isnull([PositionOnDistributor], 0) as [PositionOnDistributor]
|
||||
,isnull([PositionOnChain], 0) as [PositionOnChain]
|
||||
,isnull([Port],0) as [Port]
|
||||
,isnull([ParentDAS], space(0)) as [ParentDAS],
|
||||
[FirstUseDate],
|
||||
[TestId],
|
||||
[GroupId],
|
||||
[StandIn],
|
||||
[MaxAAFRate]
|
||||
|
||||
FROM [dbo].[DAS] where
|
||||
(@SerialNumber is null or DASId = dbo.foo_IdGetDAS(@SerialNumber))
|
||||
and
|
||||
Position = case when @position is null then space(0) else @position end
|
||||
and
|
||||
Type!=58
|
||||
END
|
||||
@@ -0,0 +1,14 @@
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupHardwareGet]
|
||||
@TestSetupId INT = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF( @TestSetupId IS NULL)
|
||||
BEGIN
|
||||
SELECT TestSetupHardwareId, A.DASId, TestSetupId, AddOrRemove, SamplesPerSecond, IsClockMaster, AntiAliasFilterRate FROM [dbo].TestSetupHardware AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE B.Type!=58
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT TestSetupHardwareId, A.DASId, TestSetupId, AddOrRemove, SamplesPerSecond, IsClockMaster, AntiAliasFilterRate FROM [dbo].TestSetupHardware AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE [TestSetupId]=@TestSetupId AND B.Type!=58
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1 @@
|
||||
DELETE A FROM [dbo].[DASChannels] AS A INNER JOIN [dbo].[DAS] as B ON A.DASId=B.DASId WHERE B.SerialNumber='SLICE6 Falcon Prototype' AND SupportedBridges=512
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE A SET A.ChannelIdx=6 FROM [dbo].[DASChannels] AS A INNER JOIN [dbo].[DAS] as B ON A.DASId=B.DASId WHERE B.SerialNumber='SLICE6 Falcon Prototype' AND SupportedBridges=1024
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE [dbo].[DAS] SET ChannelTypes = '0,0,0,0,0,0,6' WHERE SerialNumber = 'SLICE6 Falcon Prototype'
|
||||
@@ -0,0 +1,17 @@
|
||||
--If any StreamOutput sensor already has an advanced Stream Profile, add (if non-existent)
|
||||
--or update, DefaultUseAdvancedUDPStreamProfiles = True, in the DefaultProperties table.
|
||||
--This will cause it to be set to True in the UserProperties table automatically, later when needed.
|
||||
IF ((SELECT COUNT(*) FROM SensorsStreamOutput WHERE StreamProfile <> 'CH10_ANALOG_2HDR' AND StreamProfile <> 'CH10_PCM_128BIT_2HDR') > 0)
|
||||
BEGIN
|
||||
--Add to or Update DefaultProperties table
|
||||
IF ((SELECT COUNT(*) FROM DefaultProperties WHERE PropertyName = 'DefaultUseAdvancedUDPStreamProfiles') = 0)
|
||||
BEGIN
|
||||
--Add to table
|
||||
INSERT INTO DefaultProperties VALUES (492, 'DefaultUseAdvancedUDPStreamProfiles', 'True');
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
--Update existing entry
|
||||
UPDATE DefaultProperties SET DefaultValue = 'True' WHERE PropertyName = 'DefaultUseAdvancedUDPStreamProfiles';
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,27 @@
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId]
|
||||
,[ChannelIdx]
|
||||
,[SupportedBridges]
|
||||
,[SupportedExcitations]
|
||||
,[DASDisplayOrder]
|
||||
,[LocalOnly]
|
||||
,[SupportedDigitalInputModes]
|
||||
,[SupportedSquibFireModes]
|
||||
,[SupportedDigitalOutputModes]
|
||||
,[ModuleSerialNumber]
|
||||
,[SettingId]
|
||||
,[ModuleArrayIndex])
|
||||
SELECT DAS.DASId,
|
||||
21,
|
||||
512,
|
||||
1,
|
||||
-1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
'',
|
||||
0,
|
||||
7
|
||||
FROM [dbo].[DAS]
|
||||
WHERE DAS.SerialNumber LIKE '%TSR Air%'
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE A SET A.ChannelIdx=22, A.ModuleArrayIndex=8 FROM [dbo].[DASChannels] AS A INNER JOIN [dbo].[DAS] as B ON A.DASId=B.DASId WHERE B.SerialNumber LIKE '%TSR Air%' AND SupportedBridges=1024
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE [dbo].[DAS] SET Channels=23, ChannelTypes='1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,5,6' WHERE SerialNumber LIKE '%TSR Air%'
|
||||
@@ -0,0 +1,6 @@
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_DASGet', 95)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupHardwareGet', 95)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupHardwareInsert', 95)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupHardwareUpdate', 95)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_GroupChannelSettingsGet', 95)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_ChannelSettingsGet', 95)
|
||||
Reference in New Issue
Block a user