init
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
CREATE PROCEDURE [dbo].[sp_ChannelsGet_99]
|
||||
@Id BIGINT = NULL,
|
||||
@GroupId INT = NULL,
|
||||
@DASId INT = NULL,
|
||||
@SensorId INT = NULL,
|
||||
@TestSetupId INT = NULL,
|
||||
@TestSetupName [NVARCHAR] (255) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF( @Id IS NULL)
|
||||
BEGIN
|
||||
IF( @GroupId IS NULL)
|
||||
BEGIN
|
||||
IF( @DASId IS NULL)
|
||||
BEGIN
|
||||
IF( @SensorId IS NULL)
|
||||
BEGIN
|
||||
IF( @TestSetupId IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@TestSetupName, '') IS NULL
|
||||
BEGIN
|
||||
SELECT [Id], [GroupId], [IsoCode], [IsoChannelName], [UserCode], [UserChannelName], [DASId], [DASChannelIndex], [GroupChannelOrder], [TestSetupOrder], [SensorId], [Disabled], [LastModified], [LastModifiedBy] FROM [dbo].[Channels]
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A inner join [dbo].Groups AS B ON A.GroupId=B.Id INNER JOIN [dbo].TestSetupGroups AS C ON B.Id=C.GroupId INNER JOIN [dbo].TestSetups AS D on C.TestSetupId=D.TestSetupId WHERE D.TestSetupName=@TestSetupName
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].Groups as B ON A.GroupId=B.Id INNER JOIN [dbo].TestSetupGroups AS C on B.Id=C.GroupId WHERE C.TestSetupId=@TestSetupId
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE A.[SensorId]=@SensorId
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A WHERE A.[DASId]=@DASId
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A WHERE A.[GroupId]=@GroupId
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A WHERE A.[Id]=@Id
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,45 @@
|
||||
CREATE PROCEDURE [dbo].[sp_DASGet_99]
|
||||
@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_99]
|
||||
@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,55 @@
|
||||
ALTER PROCEDURE [dbo].[sp_ChannelsGet]
|
||||
@Id BIGINT = NULL,
|
||||
@GroupId INT = NULL,
|
||||
@DASId INT = NULL,
|
||||
@SensorId INT = NULL,
|
||||
@TestSetupId INT = NULL,
|
||||
@TestSetupName [NVARCHAR] (255) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF( @Id IS NULL)
|
||||
BEGIN
|
||||
IF( @GroupId IS NULL)
|
||||
BEGIN
|
||||
IF( @DASId IS NULL)
|
||||
BEGIN
|
||||
IF( @SensorId IS NULL)
|
||||
BEGIN
|
||||
IF( @TestSetupId IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@TestSetupName, '') IS NULL
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE B.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A inner join [dbo].Groups AS B ON A.GroupId=B.Id INNER JOIN [dbo].TestSetupGroups AS C ON B.Id=C.GroupId INNER JOIN [dbo].TestSetups AS D on C.TestSetupId=D.TestSetupId INNER JOIN [dbo].DAS AS E ON A.DASId=E.DASId WHERE D.TestSetupName=@TestSetupName AND E.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].Groups as B ON A.GroupId=B.Id INNER JOIN [dbo].TestSetupGroups AS C on B.Id=C.GroupId INNER JOIN [dbo].DAS AS D ON A.DASId=D.DASId WHERE C.TestSetupId=@TestSetupId AND D.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE A.[SensorId]=@SensorId AND B.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE A.[DASId]=@DASId AND B.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE A.[GroupId]=@GroupId AND B.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.Id, A.GroupId, A.IsoCode, A.IsoChannelName, A.UserCode, A.UserChannelName, A.DASId, A.DASChannelIndex, A.GroupChannelOrder, A.TestSetupOrder, A.SensorId, A.[Disabled], A.LastModified, A.LastModifiedBy FROM [dbo].[Channels] AS A INNER JOIN [dbo].DAS AS B ON A.DASId=B.DASId WHERE A.[Id]=@Id AND B.Type != (SELECT Type FROM DAS WHERE SerialNumber = 'SLICE TC Prototype')
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,47 @@
|
||||
ALTER 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
|
||||
and
|
||||
Type!=59
|
||||
END
|
||||
@@ -0,0 +1,49 @@
|
||||
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
|
||||
and
|
||||
Type!=59
|
||||
END
|
||||
@@ -0,0 +1,14 @@
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupHardwareGet_95]
|
||||
@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!=59
|
||||
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!=59
|
||||
END
|
||||
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 AND B.Type!=59
|
||||
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 AND B.Type!=59
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1 @@
|
||||
INSERT INTO [dbo].[DAS] VALUES ('SLICE TC Prototype',59,3,0,2048,10,'00A0','2022-06-28 00:00:00.000',1,'2022-06-28 00:00:00.000','DATAPRO_SYSTEM',1,0,'2022-06-28 00:00:00.000','','',25,'Prototype','0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6',0,0,0,0,0,0,'',NULL,NULL,NULL,NULL,50000)
|
||||
@@ -0,0 +1,130 @@
|
||||
--Thermocoupler x 24
|
||||
--Module 1
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 0, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 1, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 2, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 3, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 4, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 5, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 6, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 7, 8, 50, -1, 0, 0, 0, 0, '', 0)
|
||||
|
||||
--Module 2
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 8, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 9, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 10, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 11, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 12, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 13, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 14, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 15, 8, 50, -1, 0, 0, 0, 0, '', 1)
|
||||
|
||||
--Module 3
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 16, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 17, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 18, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 19, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 20, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 21, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 22, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 23, 8, 50, -1, 0, 0, 0, 0, '', 2)
|
||||
|
||||
--Stream out channel
|
||||
INSERT INTO [dbo].[DASChannels]
|
||||
([DASId], [ChannelIdx], [SupportedBridges], [SupportedExcitations], [DASDisplayOrder], [LocalOnly], [SupportedDigitalInputModes], [SupportedSquibFireModes], [SupportedDigitalOutputModes], [ModuleSerialNumber], [ModuleArrayIndex])
|
||||
VALUES
|
||||
((SELECT DASId FROM [dbo].[DAS] WHERE SerialNumber = 'SLICE TC Prototype'), 24, 1024, 1, -1, 0, 0, 0, 0, '', 3)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
INSERT INTO SensorsType VALUES(7, 'Thermocoupler')
|
||||
INSERT INTO dbo.Sensors VALUES (7, 'TST_TestSpecific')
|
||||
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE [dbo].[SensorsThermocoupler](
|
||||
[Id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[SensorId] [int] NOT NULL,
|
||||
[LastModified] [datetime] NOT NULL,
|
||||
[LastModifiedBy] [nvarchar](50) NOT NULL,
|
||||
[UserTags] [varbinary](max) NOT NULL,
|
||||
[DoNotUse] [bit] NULL,
|
||||
[Broken] [bit] NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
|
||||
INSERT INTO SensorsThermocoupler VALUES((SELECT id FROM Sensors WHERE SerialNumber = 'TST_TestSpecific'), '20250731', 'System', 0x, 0, 0)
|
||||
@@ -0,0 +1,23 @@
|
||||
CREATE PROCEDURE [dbo].[sp_SensorsThermocouplerGet]
|
||||
@Id INT = null,
|
||||
@SerialNumber NVARCHAR (50) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF( @Id IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@SerialNumber, '') IS NULL
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, B.LastModified, B.LastModifiedBy, B.UserTags, B.Broken, B.DoNotUse FROM [dbo].[Sensors] AS A INNER JOIN [dbo].[SensorsThermocoupler] AS B ON A.id=B.SensorId INNER JOIN [dbo].SensorsType AS C ON A.SensorType=C.TypeId WHERE C.SensorType='Thermocoupler'
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, B.LastModified, B.LastModifiedBy, B.UserTags, B.Broken, B.DoNotUse FROM [dbo].[Sensors] AS A INNER JOIN [dbo].[SensorsThermocoupler] AS B ON A.id=B.SensorId INNER JOIN [dbo].SensorsType AS C ON A.SensorType=C.TypeId WHERE C.SensorType='Thermocoupler' AND A.SerialNumber=@SerialNumber
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, B.LastModified, B.LastModifiedBy, B.UserTags, B.Broken, B.DoNotUse FROM [dbo].[Sensors] AS A INNER JOIN [dbo].[SensorsThermocoupler] AS B ON A.id=B.SensorId INNER JOIN [dbo].SensorsType AS C ON A.SensorType=C.TypeId WHERE C.SensorType='Thermocoupler' AND A.id=@Id
|
||||
END
|
||||
END
|
||||
Reference in New Issue
Block a user