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,38 @@
CREATE PROCEDURE [dbo].[sp_ChannelsDelete_98]
@Id BIGINT = NULL,
@GroupId INT = NULL,
@DASId INT = NULL,
@SensorId INT = NULL,
@TestSetupId INT = NULL,
@TestSetupName [NVARCHAR] (255) = NULL,
@errorNumber INT OUTPUT,
@errorMessage NVARCHAR (255) OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SET @errorNumber=0
SET @errorMessage=''
exec sp_GroupChannelSettingsDelete
@Id,
NULL -- Remove all settings
,@errorNumber output, @errorMessage output
IF(@@error != 0)
BEGIN
SET @errorNumber = error_number()
SET @errorMessage = error_message()
END
ELSE
BEGIN
DELETE FROM [dbo].[ROIPeriodChannels] WHERE [ChannelId]=@Id
DELETE FROM [dbo].[LevelTriggers] WHERE [ChannelId]=@Id
DELETE FROM [dbo].[Channels] WHERE [Id]=@Id
END
IF(@@error != 0)
BEGIN
SET @errorNumber = error_number()
SET @errorMessage = error_message()
END
END

View File

@@ -0,0 +1,27 @@
CREATE PROCEDURE [dbo].[sp_SensorCalibrationsSensitivityInspectionSet]
@SensorId INT,
@SensorCalibrationId INT,
@SensitivityInspection INT,
@CalibrationNote NVARCHAR(2048),
@errorNumber INT OUTPUT,
@errorMessage NVARCHAR (255) OUTPUT
AS
BEGIN
SET NOCOUNT ON
SET @errorNumber = 0
SET @errorMessage = ''
IF (@CalibrationNote IS NULL or @CalibrationNote = '')
BEGIN
UPDATE [dbo].[SensorCalibrations] SET [SensitivityInspection] = @SensitivityInspection WHERE [SensorId]= @SensorId AND [SensorCalibrationId]=@SensorCalibrationId ;
END
ELSE
BEGIN
UPDATE [dbo].[SensorCalibrations] SET [SensitivityInspection] = @SensitivityInspection, [CalibrationNote] = @CalibrationNote WHERE [SensorId]= @SensorId AND [SensorCalibrationId]=@SensorCalibrationId ;
END
IF(@@error != 0)
BEGIN
SET @errorNumber = error_number()
SET @errorMessage = error_message()
END
END

View File

@@ -0,0 +1,31 @@
CREATE PROCEDURE [dbo].[sp_TestHistoryGet]
@TestHistoryId BIGINT = NULL,
@TestSetupId INT = NULL,
@TestSetupName NVARCHAR(50)=NULL,
@Destructive BIT = NULL
AS
BEGIN
SET NOCOUNT ON;
IF @TestSetupId IS NOT NULL
BEGIN
SELECT [TestHistoryId], [TestSetupId], [TestSetupName], [TestSetupDescription], [TestId], [Destructive], [ArmTime], [TestSetup] FROM [dbo].TestHistory WHERE [TestSetupId]=@TestSetupId
END
ELSE
BEGIN
IF @Destructive IS NOT NULL
BEGIN
SELECT [TestHistoryId], [TestSetupId], [TestSetupName], [TestSetupDescription], [TestId], [Destructive], [ArmTime], [TestSetup] FROM [dbo].TestHistory WHERE [Destructive]=@Destructive
END
ELSE
BEGIN
IF @TestHistoryId IS NOT NULL
BEGIN
SELECT [TestHistoryId], [TestSetupId], [TestSetupName], [TestSetupDescription], [TestId], [Destructive], [ArmTime], [TestSetup] FROM [dbo].TestHistory WHERE [TestHistoryId]=@TestHistoryId
END
ELSE
BEGIN
SELECT [TestHistoryId], [TestSetupId], [TestSetupName], [TestSetupDescription], [TestId], [Destructive], [ArmTime], [TestSetup] FROM [dbo].TestHistory WHERE [TestSetupName]=@TestSetupName
END
END
END
END

View File

@@ -0,0 +1,41 @@
ALTER PROCEDURE [dbo].[sp_CalculatedChannelsUpdate]
@id int = 0
,@Operation int
,@CalculatedChannelValueCode nvarchar(255)
,@InputChannelIds varbinary(max)
,@CFCForInputChannels nvarchar(255)
,@CFCForOutput nvarchar(255)
,@TestSetupName nvarchar(255) = null
,@CCName nvarchar(255)
,@ClipLength int
,@ViewInRealtime bit
,@errorNumber int output
,@errorMessage nvarchar(250) output
AS
BEGIN
SET NOCOUNT ON;
set @errorNumber = 0
set @errorMessage = space(0)
if(@id = 0 or @Operation is null or @TestSetupName is null)
begin
RAISERROR(15600,-1,-1, 'sp_CalculatedChannelsUpdate') /* Error 1560 - An invalid parameter or option was specified for procedure*/
end
else
begin
declare @TestSetupId int
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
UPDATE [dbo].[CalculatedChannels]
SET [Operation] = @Operation
,[CalculatedChannelValueCode] = @CalculatedChannelValueCode
,[InputChannelIds] = @InputChannelIds
,[CFCForInputChannels] = @CFCForInputChannels
,[CFCForOutput] = @CFCForOutput
,[TestSetupId] = @TestSetupId
,[CCName] = @CCName
,[ViewInRealtime] = @ViewInRealtime
,[ClipLength] = @ClipLength
WHERE [Id] = @id
end
END