This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
ALTER PROCEDURE [dbo].[sp_TagsDelete]
@TagId int
,@errorNumber int output
,@errorMessage nvarchar(250) output
AS
BEGIN
set @errorNumber = 0
set @errorMessage = space(0)
DELETE FROM [dbo].[TagAssignments] WHERE [TagID]=@TagId
delete from [dbo].[Tags] WHERE [TagId] = @TagId
END

View File

@@ -0,0 +1,35 @@
CREATE PROCEDURE [dbo].[sp_TestHistoryUpdateInsert]
@TestHistoryId bigint=NULL,
@TestSetupId int=NULL,
@TestSetupName nvarchar(50),
@TestSetupDescription nvarchar(50)=NULL,
@TestId nvarchar(MAX)=NULL,
@Destructive bit,
@ArmTime datetime,
@TestSetup varbinary(MAX)=NULL,
@new_id int output,
@errorNumber int output,
@errorMessage nvarchar(250) output
AS
BEGIN
set @errorNumber = 0;
set @errorMessage = space(0);
begin try
IF @TestHistoryId is NOT NULL
BEGIN
UPDATE [dbo].[TestHistory] SET [TestSetupId]=@TestSetupId, [TestSetupName]=@TestSetupName, [TestSetupDescription]=@TestSetupDescription, [TestId]=@TestId, [Destructive]=@Destructive, [ArmTime]=@ArmTime, [TestSetup]=@TestSetup
SET @new_id=@TestHistoryId
END
ELSE
BEGIN
INSERT INTO [dbo].[TestHistory] ([TestSetupId],[TestSetupName],[TestSetupDescription],[TestId],[Destructive],[ArmTime], [TestSetup])
VALUES
(@TestSetupId, @TestSetupName, @TestSetupDescription, @TestId, @Destructive, @ArmTime, @TestSetup)
set @new_id = scope_identity();
END
end try
begin catch
set @errorMessage = error_message()
set @errorNumber = error_number()
end catch;
END

View File

@@ -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)

View File

@@ -0,0 +1,7 @@
ALTER PROCEDURE [dbo].[sp_TestSetupHardwareGet]
@TestSetupId INT
AS
BEGIN
SET NOCOUNT ON;
SELECT TestSetupHardwareId, DASId, TestSetupId, AddOrRemove, SamplesPerSecond, IsClockMaster FROM [dbo].TestSetupHardware WHERE [TestSetupId]=@TestSetupId
END;

View File

@@ -0,0 +1,29 @@
CREATE PROCEDURE [dbo].[sp_SensorTestHistoryGet]
@SensorTestHistoryId BIGINT = NULL,
@TestHistoryId BIGINT = NULL,
@SensorId INT = NULL,
@SerialNumber NVARCHAR(MAX) = NULL
AS
BEGIN
SET NOCOUNT ON;
IF @SensorId IS NOT NULL
BEGIN
SELECT A.TestHistoryId, A.TestSetupId, A.TestSetupName, A.TestSetupDescription, A.TestId, A.Destructive, A.ArmTime, A.TestSetup, B.SensorTestHistoryId, B.SensorId, B.SerialNumber, B.Capacity, B.Range, B.CalibrationDate, B.HardwareChannelName, B.ISOChannelName, B.ISOCode, B.UserChannelName, B.UserCode, B.Sensitivity, B.FilterClass, B.IsProportional, B.LinearizationFormula, b.EID, B.MeasuredExcitation, B.MeasurementUnit, B.SamplesPerSecond, B.AAF
FROM [dbo].[TestHistory] AS A INNER JOIN [dbo].[SensorTestHistory] AS B ON A.TestHistoryId=B.TestHistoryId WHERE B.SensorId=@SensorId
END
ELSE IF @SensorTestHistoryId IS NOT NULL
BEGIN
SELECT A.TestHistoryId, A.TestSetupId, A.TestSetupName, A.TestSetupDescription, A.TestId, A.Destructive, A.ArmTime, A.TestSetup, B.SensorTestHistoryId, B.SensorId, B.SerialNumber, B.Capacity, B.Range, B.CalibrationDate, B.HardwareChannelName, B.ISOChannelName, B.ISOCode, B.UserChannelName, B.UserCode, B.Sensitivity, B.FilterClass, B.IsProportional, B.LinearizationFormula, b.EID, B.MeasuredExcitation, B.MeasurementUnit, B.SamplesPerSecond, B.AAF
FROM [dbo].[TestHistory] AS A INNER JOIN [dbo].[SensorTestHistory] AS B ON A.TestHistoryId=B.TestHistoryId WHERE B.SensorTestHistoryId=@SensorTestHistoryId
END
ELSE IF @TestHistoryId IS NOT NULL
BEGIN
SELECT A.TestHistoryId, A.TestSetupId, A.TestSetupName, A.TestSetupDescription, A.TestId, A.Destructive, A.ArmTime, A.TestSetup, B.SensorTestHistoryId, B.SensorId, B.SerialNumber, B.Capacity, B.Range, B.CalibrationDate, B.HardwareChannelName, B.ISOChannelName, B.ISOCode, B.UserChannelName, B.UserCode, B.Sensitivity, B.FilterClass, B.IsProportional, B.LinearizationFormula, b.EID, B.MeasuredExcitation, B.MeasurementUnit, B.SamplesPerSecond, B.AAF
FROM [dbo].[TestHistory] AS A INNER JOIN [dbo].[SensorTestHistory] AS B ON A.TestHistoryId=B.TestHistoryId WHERE B.TestHistoryId=@TestHistoryId
END
ELSE
BEGIN
SELECT A.TestHistoryId, A.TestSetupId, A.TestSetupName, A.TestSetupDescription, A.TestId, A.Destructive, A.ArmTime, A.TestSetup, B.SensorTestHistoryId, B.SensorId, B.SerialNumber, B.Capacity, B.Range, B.CalibrationDate, B.HardwareChannelName, B.ISOChannelName, B.ISOCode, B.UserChannelName, B.UserCode, B.Sensitivity, B.FilterClass, B.IsProportional, B.LinearizationFormula, b.EID, B.MeasuredExcitation, B.MeasurementUnit, B.SamplesPerSecond, B.AAF
FROM [dbo].[TestHistory] AS A INNER JOIN [dbo].[SensorTestHistory] AS B ON A.TestHistoryId=B.TestHistoryId WHERE B.SerialNumber=@SerialNumber
END
END