init
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
INSERT INTO [dbo].[Settings]
|
||||
([PropertyId]
|
||||
,[PropertyType]
|
||||
,[PropertyValue]
|
||||
,[UserId])
|
||||
VALUES
|
||||
('EnableClockSourceSelect'
|
||||
,2
|
||||
,'False'
|
||||
,'SYSTEM');
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE dbo.SensorsSquib
|
||||
ADD DefineDelayInTest bit NOT NULL
|
||||
CONSTRAINT DF_SensorsSquib_DefineDelayInTest
|
||||
DEFAULT 1
|
||||
WITH VALUES;
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE dbo.TestSetupHardware
|
||||
ADD IsClockMaster bit NOT NULL
|
||||
CONSTRAINT TestSetupHardwareInputClockSource_Constraint
|
||||
DEFAULT 0
|
||||
WITH VALUES;
|
||||
@@ -0,0 +1,17 @@
|
||||
ALTER TABLE dbo.TestSetups
|
||||
ADD InputClockSourceMaster nvarchar(50) NOT NULL
|
||||
CONSTRAINT TestSetupsInputClockSourceMaster_Constraint
|
||||
DEFAULT 'None'
|
||||
WITH VALUES;
|
||||
|
||||
ALTER TABLE dbo.TestSetups
|
||||
ADD OutputClockSourceMaster nvarchar(50) NOT NULL
|
||||
CONSTRAINT TestSetupsOutputClockSourceMaster_Constraint
|
||||
DEFAULT 'None'
|
||||
WITH VALUES;
|
||||
|
||||
ALTER TABLE dbo.TestSetups
|
||||
ADD InputClockSourceSlave nvarchar(50) NOT NULL
|
||||
CONSTRAINT TestSetupsInputClockSourceSlave_Constraint
|
||||
DEFAULT 'None'
|
||||
WITH VALUES;
|
||||
@@ -0,0 +1,29 @@
|
||||
ALTER PROCEDURE [dbo].[sp_SensorsSquibGet]
|
||||
@ID INT = NULL,
|
||||
@SerialNumber NVARCHAR (50) = null,
|
||||
@EID NVARCHAR (50) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
IF(@ID IS NULL )
|
||||
BEGIN
|
||||
IF NULLIF(@SerialNumber, '') IS NULL
|
||||
BEGIN
|
||||
IF (@EID IS NULL )
|
||||
BEGIN
|
||||
SELECT B.id, B.SerialNumber, A.ArticleId, A.BypassCurrentFilter, A.BypassCurrentFilter, A.BypassVoltageFilter, A.DelayMS, A.DurationMS, A.FireMode, A.IsoChannelName, A.IsoCode, A.LastModified, A.LastModifiedBy, A.LimitDuration, A.DefineDelayInTest, A.MeasurementType, A.SquibOutputCurrent, A.SquibToleranceHigh, A.SquibToleranceLow, A.UserChannelName, A.UserCode, A.UserTags, A.UserValue1, A.UserValue2, A.UserValue3, A.Version, A.Broken, A.DoNotUse FROM SensorsSquib AS A INNER JOIN Sensors AS B ON A.SensorId = B.id INNER JOIN [dbo].[SensorsType] AS C ON B.SensorType=C.TypeId WHERE C.SensorType='Squib'
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT B.id, B.SerialNumber, A.ArticleId, A.BypassCurrentFilter, A.BypassCurrentFilter, A.BypassVoltageFilter, A.DelayMS, A.DurationMS, A.FireMode, A.IsoChannelName, A.IsoCode, A.LastModified, A.LastModifiedBy, A.LimitDuration, A.DefineDelayInTest, A.MeasurementType, A.SquibOutputCurrent, A.SquibToleranceHigh, A.SquibToleranceLow, A.UserChannelName, A.UserCode, A.UserTags, A.UserValue1, A.UserValue2, A.UserValue3, A.Version, A.Broken, A.DoNotUse FROM SensorsSquib AS A INNER JOIN Sensors AS B ON A.SensorId = B.id INNER JOIN [dbo].[SensorsType] AS C ON B.SensorType=C.TypeId WHERE C.SensorType='Squib' AND A.ArticleId=@EID
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT B.id, B.SerialNumber, A.ArticleId, A.BypassCurrentFilter, A.BypassCurrentFilter, A.BypassVoltageFilter, A.DelayMS, A.DurationMS, A.FireMode, A.IsoChannelName, A.IsoCode, A.LastModified, A.LastModifiedBy, A.LimitDuration, A.DefineDelayInTest, A.MeasurementType, A.SquibOutputCurrent, A.SquibToleranceHigh, A.SquibToleranceLow, A.UserChannelName, A.UserCode, A.UserTags, A.UserValue1, A.UserValue2, A.UserValue3, A.Version, A.Broken, A.DoNotUse FROM SensorsSquib AS A INNER JOIN Sensors AS B ON A.SensorId = B.id INNER JOIN [dbo].[SensorsType] AS C ON B.SensorType=C.TypeId WHERE C.SensorType='Squib' AND B.SerialNumber=@SerialNumber
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT B.id, B.SerialNumber, A.ArticleId, A.BypassCurrentFilter, A.BypassCurrentFilter, A.BypassVoltageFilter, A.DelayMS, A.DurationMS, A.FireMode, A.IsoChannelName, A.IsoCode, A.LastModified, A.LastModifiedBy, A.LimitDuration, A.DefineDelayInTest, A.MeasurementType, A.SquibOutputCurrent, A.SquibToleranceHigh, A.SquibToleranceLow, A.UserChannelName, A.UserCode, A.UserTags, A.UserValue1, A.UserValue2, A.UserValue3, A.Version, A.Broken, A.DoNotUse FROM SensorsSquib AS A INNER JOIN Sensors AS B ON A.SensorId = B.id INNER JOIN [dbo].[SensorsType] AS C ON B.SensorType=C.TypeId WHERE C.SensorType='Squib' AND B.id=@ID
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,141 @@
|
||||
ALTER PROCEDURE [dbo].[sp_SensorsSquibUpdateInsert]
|
||||
@Id INT = NULL,
|
||||
@SerialNumber NVARCHAR (255),
|
||||
@BypassCurrentFilter BIT,
|
||||
@BypassVoltageFilter BIT,
|
||||
@DelayMS FLOAT,
|
||||
@DurationMS FLOAT,
|
||||
@FireMode SMALLINT,
|
||||
@IsoCode NVARCHAR (50),
|
||||
@IsoChannelName NVARCHAR (255),
|
||||
@UserCode NVARCHAR (50),
|
||||
@UserChannelName NVARCHAR (255),
|
||||
@MeasurementType SMALLINT,
|
||||
@SquibOutputCurrent FLOAT,
|
||||
@SquibToleranceLow FLOAT,
|
||||
@SquibToleranceHigh FLOAT,
|
||||
@LimitDuration BIT,
|
||||
@DefineDelayInTest BIT,
|
||||
@ArticleId NVARCHAR (50),
|
||||
@Version INT,
|
||||
@LastModified DATETIME,
|
||||
@LastModifiedBy NVARCHAR (50),
|
||||
@UserValue1 NVARCHAR (255),
|
||||
@UserValue2 NVARCHAR (255),
|
||||
@UserValue3 NVARCHAR (255),
|
||||
@UserTags VARBINARY (MAX),
|
||||
@Broken BIT,
|
||||
@DoNotUse BIT,
|
||||
@new_id INT OUTPUT,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SET @errorNumber = 0
|
||||
SET @errorMessage = ''
|
||||
|
||||
DECLARE @SensorType AS TINYINT
|
||||
DECLARE @SensorId AS INT
|
||||
|
||||
SELECT @SensorType = [TypeId] FROM [dbo].[SensorsType] WHERE [SensorType]='Squib'
|
||||
|
||||
SELECT @SensorId = A.[Id] from [dbo].[Sensors] AS A INNER JOIN [dbo].SensorsType AS B ON A.SensorType=B.TypeId WHERE B.SensorType='Squib' AND A.SerialNumber=@SerialNumber
|
||||
|
||||
IF( @SensorId IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[Sensors] (SensorType, SerialNumber) VALUES (@SensorType, @SerialNumber)
|
||||
SELECT @SensorId = SCOPE_IDENTITY()
|
||||
SET @new_id = @SensorId
|
||||
INSERT INTO [dbo].[SensorsSquib] (
|
||||
[SensorId],
|
||||
[BypassCurrentFilter],
|
||||
[BypassVoltageFilter],
|
||||
[DelayMS],
|
||||
[DurationMS],
|
||||
[FireMode],
|
||||
[IsoCode],
|
||||
[IsoChannelName],
|
||||
[UserCode],
|
||||
[UserChannelName],
|
||||
[MeasurementType],
|
||||
[SquibOutputCurrent],
|
||||
[SquibToleranceLow],
|
||||
[SquibToleranceHigh],
|
||||
[LimitDuration],
|
||||
[DefineDelayInTest],
|
||||
[ArticleId],
|
||||
[Version],
|
||||
[LastModified],
|
||||
[LastModifiedBy],
|
||||
[UserValue1],
|
||||
[UserValue2],
|
||||
[UserValue3],
|
||||
[UserTags],
|
||||
[Broken],
|
||||
[DoNotUse])
|
||||
VALUES (
|
||||
@SensorId,
|
||||
@BypassCurrentFilter,
|
||||
@BypassVoltageFilter,
|
||||
@DelayMS,
|
||||
@DurationMS,
|
||||
@FireMode,
|
||||
@IsoCode,
|
||||
@IsoChannelName,
|
||||
@UserCode,
|
||||
@UserChannelName,
|
||||
@MeasurementType,
|
||||
@SquibOutputCurrent,
|
||||
@SquibToleranceLow,
|
||||
@SquibToleranceHigh,
|
||||
@LimitDuration,
|
||||
@DefineDelayInTest,
|
||||
@ArticleId,
|
||||
@Version,
|
||||
@LastModified,
|
||||
@LastModifiedBy,
|
||||
@UserValue1,
|
||||
@UserValue2,
|
||||
@UserValue3,
|
||||
@UserTags,
|
||||
@Broken,
|
||||
@DoNotUse)
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SET @new_id = @SensorId
|
||||
UPDATE [dbo].[SensorsSquib] SET
|
||||
[BypassCurrentFilter]=@BypassCurrentFilter,
|
||||
[BypassVoltageFilter]=@BypassVoltageFilter,
|
||||
[DelayMS]=@DelayMS,
|
||||
[DurationMS]=@DurationMS,
|
||||
[FireMode]=@FireMode,
|
||||
[IsoCode]=@IsoCode,
|
||||
[IsoChannelName]=@IsoChannelName,
|
||||
[UserCode]=@UserCode,
|
||||
[UserChannelName]=@UserChannelName,
|
||||
[MeasurementType]=@MeasurementType,
|
||||
[SquibOutputCurrent]=@SquibOutputCurrent,
|
||||
[SquibToleranceLow]=@SquibToleranceLow,
|
||||
[SquibToleranceHigh]=@SquibToleranceHigh,
|
||||
[LimitDuration]=@LimitDuration,
|
||||
[DefineDelayInTest] = @DefineDelayInTest,
|
||||
[ArticleId]=@ArticleId,
|
||||
[Version]=@Version,
|
||||
[LastModified] =@LastModified,
|
||||
[LastModifiedBy]=@LastModifiedBy,
|
||||
[UserValue1]=@UserValue1,
|
||||
[UserValue2]=@UserValue2,
|
||||
[UserValue3]=@UserValue3,
|
||||
[UserTags]=@UserTags,
|
||||
[Broken]=@Broken,
|
||||
[DoNotUse]=@DoNotUse WHERE [SensorId]=@SensorId
|
||||
END
|
||||
END
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = error_number()
|
||||
SET @errorMessage = error_message()
|
||||
SET @new_id = @SensorId
|
||||
END
|
||||
@@ -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;
|
||||
@@ -0,0 +1,21 @@
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupHardwareInsert]
|
||||
@DASId INT,
|
||||
@TestSetupId INT,
|
||||
@AddOrRemove BIT,
|
||||
@SamplesPerSecond FLOAT,
|
||||
@IsClockMaster BIT,
|
||||
@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]) VALUES (@DASId, @TestSetupId, @AddOrRemove, @SamplesPerSecond, @IsClockMaster)
|
||||
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = ERROR_NUMBER()
|
||||
SET @errorMessage = ERROR_MESSAGE()
|
||||
END
|
||||
END;
|
||||
@@ -0,0 +1,21 @@
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupHardwareUpdate]
|
||||
@DASId INT,
|
||||
@TestSetupId INT,
|
||||
@AddOrRemove BIT,
|
||||
@SamplesPerSecond FLOAT,
|
||||
@IsClockMaster BIT,
|
||||
@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 WHERE [DASId]=@DASId AND [TestSetupId]=@TestSetupId
|
||||
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = ERROR_NUMBER()
|
||||
SET @errorMessage = ERROR_MESSAGE()
|
||||
END
|
||||
END;
|
||||
@@ -0,0 +1,86 @@
|
||||
--Get
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupsGet]
|
||||
@TestSetupId int = null,
|
||||
@TestSetupName nvarchar(50) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
if(@TestSetupName is not null)
|
||||
begin
|
||||
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
|
||||
end
|
||||
|
||||
SELECT [TestSetupId]
|
||||
,[TestSetupName] as 'SetupName'
|
||||
,[SetupDescription]
|
||||
,[AutomaticTestProgression]
|
||||
,[AutomaticProgressionDelayMS]
|
||||
,[InvertTrigger]
|
||||
,[InvertStart]
|
||||
,[ViewDiagnostics]
|
||||
,[VerifyChannels]
|
||||
,[AutoVerifyChannels]
|
||||
,[VerifyChannelsDelayMS]
|
||||
,[RecordingMode]
|
||||
,[SamplesPerSecond]
|
||||
,[PreTriggerSeconds]
|
||||
,[PostTriggerSeconds]
|
||||
,[StrictDiagnostics]
|
||||
,[RequireConfirmationOnErrors]
|
||||
,[ROIDownload]
|
||||
,[ViewROIDownload]
|
||||
,[DownloadAll]
|
||||
,[ViewRealtime]
|
||||
,[RealtimePlotCount]
|
||||
,[RegionsOfInterest]
|
||||
,[ROIStart]
|
||||
,[ROIEnd]
|
||||
,[ViewDownloadAll]
|
||||
,[Export]
|
||||
,[ExportFormat]
|
||||
,[LabDetails]
|
||||
,[UseLabDetails]
|
||||
,[CustomerDetails]
|
||||
,[UseCustomerDetails]
|
||||
,[AllowMissingSensors]
|
||||
,[AllowSensorIdToBlankChannel]
|
||||
,[CalibrationBehavior]
|
||||
,[LocalOnly]
|
||||
,[LastModified]
|
||||
,[LastModifiedBy]
|
||||
,[TurnOffExcitation]
|
||||
,[TriggerCheckRealtime]
|
||||
,[TriggerCheckStep]
|
||||
,[PostTestDiagnostics]
|
||||
,[ExportFolder]
|
||||
,[DownloadFolder]
|
||||
,[CommonStatusLine]
|
||||
,[SameAsDownloadFolder]
|
||||
,[UploadData]
|
||||
,[UploadDataFolder]
|
||||
,[UploadExportsOnly]
|
||||
,[Settings]
|
||||
,[WarnOnBatteryFail]
|
||||
,[Dirty]
|
||||
,[Complete]
|
||||
,[ErrorMessage]
|
||||
|
||||
,[TestEngineerDetails]
|
||||
,[UseTestEngineerDetails]
|
||||
,[UserTags]
|
||||
,isnull([DoAutoArm], 0) as [DoAutoArm]
|
||||
,isnull([CheckoutMode], 0) as [CheckoutMode]
|
||||
,isnull([ISFFile], 0) as [ISFFile]
|
||||
,isnull([QuitTestWithoutWarning], 0) as [QuitTestWithoutWarning]
|
||||
,isnull([NotAllChannelsRealTime], 0) as [NotAllChannelsRealTime]
|
||||
,isnull([NotAllChannelsViewer], 0) as [NotAllChannelsViewer]
|
||||
,isnull([SuppressMissingSensorsWarning], 0) as [SuppressMissingSensorsWarning]
|
||||
,isnull([DoStreaming], 0) as [DoStreaming]
|
||||
,[InputClockSourceMaster]
|
||||
,[OutputClockSourceMaster]
|
||||
,[InputClockSourceSlave]
|
||||
,[TestSetup]
|
||||
from [dbo].[TestSetups]
|
||||
where ((@TestSetupId is null or @TestSetupId= 0) or TestSetupId = @TestSetupId)
|
||||
and (@TestSetupName is null or TestSetupName = @TestSetupName)
|
||||
END;
|
||||
@@ -0,0 +1,230 @@
|
||||
--InsertUpdate
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupsInsertUpdate]
|
||||
@TestSetupName nvarchar(50) = Null
|
||||
,@SetupDescription nvarchar(50)
|
||||
,@AutomaticTestProgression bit
|
||||
,@AutomaticProgressionDelayMS int
|
||||
,@InvertTrigger bit
|
||||
,@InvertStart bit
|
||||
,@ViewDiagnostics bit
|
||||
,@VerifyChannels bit
|
||||
,@AutoVerifyChannels bit
|
||||
,@VerifyChannelsDelayMS int
|
||||
,@RecordingMode smallint
|
||||
,@SamplesPerSecond float
|
||||
,@PreTriggerSeconds float
|
||||
,@PostTriggerSeconds float
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@RegionsOfInterest nvarchar(MAX)
|
||||
,@ROIStart float
|
||||
,@ROIEnd float
|
||||
,@ViewDownloadAll bit
|
||||
,@Export bit
|
||||
,@ExportFormat bigint
|
||||
,@LabDetails nvarchar(50)
|
||||
,@UseLabDetails bit
|
||||
,@CustomerDetails nvarchar(50)
|
||||
,@UseCustomerDetails bit
|
||||
,@AllowMissingSensors bit
|
||||
,@AllowSensorIdToBlankChannel bit
|
||||
,@CalibrationBehavior smallint
|
||||
,@LocalOnly bit
|
||||
,@LastModified datetime
|
||||
,@LastModifiedBy nvarchar(50)
|
||||
,@TurnOffExcitation bit
|
||||
,@TriggerCheckRealtime bit
|
||||
,@TriggerCheckStep bit
|
||||
,@PostTestDiagnostics int
|
||||
,@ExportFolder nvarchar(150)
|
||||
,@DownloadFolder nvarchar(150)
|
||||
,@CommonStatusLine bit
|
||||
,@SameAsDownloadFolder bit
|
||||
,@UploadData bit
|
||||
,@UploadDataFolder nvarchar(150)
|
||||
,@UploadExportsOnly bit
|
||||
,@Settings nvarchar(4000)
|
||||
,@WarnOnBatteryFail bit
|
||||
,@Dirty bit
|
||||
,@Complete bit
|
||||
,@Error nvarchar(255)
|
||||
,@TestEngineerDetails nvarchar(50)
|
||||
,@UseTestEngineerDetails bit
|
||||
,@UserTags varbinary(max)
|
||||
,@DoAutoArm bit
|
||||
,@CheckoutMode bit
|
||||
,@ISFFile nvarchar(4000)
|
||||
,@QuitTestWithoutWarning bit
|
||||
,@NotAllChannelsRealTime bit
|
||||
,@NotAllChannelsViewer bit
|
||||
,@SuppressMissingSensorsWarning bit
|
||||
,@DoStreaming bit
|
||||
,@InputClockSourceMaster nvarchar(50)
|
||||
,@OutputClockSourceMaster nvarchar(50)
|
||||
,@InputClockSourceSlave nvarchar(50)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@new_id int output
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
declare @TestSetupId int
|
||||
|
||||
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
|
||||
|
||||
if(exists(select TestSetupId from [dbo].[TestSetups] where TestSetupId = @TestSetupId))
|
||||
begin
|
||||
set @new_id = @TestSetupId
|
||||
exec dbo.sp_TestSetupsUpdate @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@RegionsOfInterest
|
||||
,@ROIStart
|
||||
,@ROIEnd
|
||||
,@ViewDownloadAll
|
||||
,@Export
|
||||
,@ExportFormat
|
||||
,@LabDetails
|
||||
,@UseLabDetails
|
||||
,@CustomerDetails
|
||||
,@UseCustomerDetails
|
||||
,@AllowMissingSensors
|
||||
,@AllowSensorIdToBlankChannel
|
||||
,@CalibrationBehavior
|
||||
,@LocalOnly
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@TurnOffExcitation
|
||||
,@TriggerCheckRealtime
|
||||
,@TriggerCheckStep
|
||||
,@PostTestDiagnostics
|
||||
,@ExportFolder
|
||||
,@DownloadFolder
|
||||
,@CommonStatusLine
|
||||
,@SameAsDownloadFolder
|
||||
,@UploadData
|
||||
,@UploadDataFolder
|
||||
,@UploadExportsOnly
|
||||
,@Settings
|
||||
,@WarnOnBatteryFail
|
||||
,@Dirty
|
||||
,@Complete
|
||||
,@Error
|
||||
,@TestEngineerDetails
|
||||
,@UseTestEngineerDetails
|
||||
,@UserTags
|
||||
,@DoAutoArm
|
||||
,@CheckoutMode
|
||||
,@ISFFile
|
||||
,@QuitTestWithoutWarning
|
||||
,@NotAllChannelsRealTime
|
||||
,@NotAllChannelsViewer
|
||||
,@SuppressMissingSensorsWarning
|
||||
,@DoStreaming
|
||||
,@InputClockSourceMaster
|
||||
,@OutputClockSourceMaster
|
||||
,@InputClockSourceSlave
|
||||
,@TestSetup
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
exec dbo.sp_TestSetupsInsert @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@RegionsOfInterest
|
||||
,@ROIStart
|
||||
,@ROIEnd
|
||||
,@ViewDownloadAll
|
||||
,@Export
|
||||
,@ExportFormat
|
||||
,@LabDetails
|
||||
,@UseLabDetails
|
||||
,@CustomerDetails
|
||||
,@UseCustomerDetails
|
||||
,@AllowMissingSensors
|
||||
,@AllowSensorIdToBlankChannel
|
||||
,@CalibrationBehavior
|
||||
,@LocalOnly
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@TurnOffExcitation
|
||||
,@TriggerCheckRealtime
|
||||
,@TriggerCheckStep
|
||||
,@PostTestDiagnostics
|
||||
,@ExportFolder
|
||||
,@DownloadFolder
|
||||
,@CommonStatusLine
|
||||
,@SameAsDownloadFolder
|
||||
,@UploadData
|
||||
,@UploadDataFolder
|
||||
,@UploadExportsOnly
|
||||
,@Settings
|
||||
,@WarnOnBatteryFail
|
||||
,@Dirty
|
||||
,@Complete
|
||||
,@Error
|
||||
,@TestEngineerDetails
|
||||
,@UseTestEngineerDetails
|
||||
,@UserTags
|
||||
,@DoAutoArm
|
||||
,@CheckoutMode
|
||||
,@ISFFile
|
||||
,@QuitTestWithoutWarning
|
||||
,@NotAllChannelsRealTime
|
||||
,@NotAllChannelsViewer
|
||||
,@SuppressMissingSensorsWarning
|
||||
,@DoStreaming
|
||||
,@InputClockSourceMaster
|
||||
,@OutputClockSourceMaster
|
||||
,@InputClockSourceSlave
|
||||
,@TestSetup
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
END;
|
||||
@@ -0,0 +1,266 @@
|
||||
--Insert
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupsInsert]
|
||||
@TestSetupName nvarchar(50) = Null
|
||||
,@SetupDescription nvarchar(50)
|
||||
,@AutomaticTestProgression bit
|
||||
,@AutomaticProgressionDelayMS int
|
||||
,@InvertTrigger bit
|
||||
,@InvertStart bit
|
||||
,@ViewDiagnostics bit
|
||||
,@VerifyChannels bit
|
||||
,@AutoVerifyChannels bit
|
||||
,@VerifyChannelsDelayMS int
|
||||
,@RecordingMode smallint
|
||||
,@SamplesPerSecond float
|
||||
,@PreTriggerSeconds float
|
||||
,@PostTriggerSeconds float
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@RegionsOfInterest nvarchar(MAX)
|
||||
,@ROIStart float
|
||||
,@ROIEnd float
|
||||
,@ViewDownloadAll bit
|
||||
,@Export bit
|
||||
,@ExportFormat bigint
|
||||
,@LabDetails nvarchar(50)
|
||||
,@UseLabDetails bit
|
||||
,@CustomerDetails nvarchar(50)
|
||||
,@UseCustomerDetails bit
|
||||
,@AllowMissingSensors bit
|
||||
,@AllowSensorIdToBlankChannel bit
|
||||
,@CalibrationBehavior smallint
|
||||
,@LocalOnly bit
|
||||
,@LastModified datetime
|
||||
,@LastModifiedBy nvarchar(50)
|
||||
,@TurnOffExcitation bit
|
||||
,@TriggerCheckRealtime bit
|
||||
,@TriggerCheckStep bit
|
||||
,@PostTestDiagnostics int
|
||||
,@ExportFolder nvarchar(150)
|
||||
,@DownloadFolder nvarchar(150)
|
||||
,@CommonStatusLine bit
|
||||
,@SameAsDownloadFolder bit
|
||||
,@UploadData bit
|
||||
,@UploadDataFolder nvarchar(150)
|
||||
,@UploadExportsOnly bit
|
||||
,@Settings nvarchar(4000)
|
||||
,@WarnOnBatteryFail bit
|
||||
,@Dirty bit
|
||||
,@Complete bit
|
||||
,@Error nvarchar(255)
|
||||
,@TestEngineerDetails nvarchar(50)
|
||||
,@UseTestEngineerDetails bit
|
||||
,@UserTags varbinary(max)
|
||||
,@DoAutoArm bit
|
||||
,@CheckoutMode bit
|
||||
,@ISFFile nvarchar(4000)
|
||||
,@QuitTestWithoutWarning bit
|
||||
,@NotAllChannelsRealTime bit
|
||||
,@NotAllChannelsViewer bit
|
||||
,@SuppressMissingSensorsWarning bit
|
||||
,@DoStreaming bit
|
||||
,@InputClockSourceMaster nvarchar(50)
|
||||
,@OutputClockSourceMaster nvarchar(50)
|
||||
,@InputClockSourceSlave nvarchar(50)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@new_id int output
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
|
||||
/* Table (and stored procedure) is too big... */
|
||||
begin try
|
||||
if(@TestSetupName is null)
|
||||
begin
|
||||
set @errorMessage = 'An invalid parameter or option was specified for procedure'
|
||||
set @errorNumber = 15600
|
||||
end
|
||||
else
|
||||
begin
|
||||
SET NOCOUNT ON;
|
||||
declare @TestEngineerId int
|
||||
declare @LabratoryId int
|
||||
declare @CustomerId int
|
||||
|
||||
set @CustomerId = dbo.foo_IdGetCustomer(@CustomerDetails)
|
||||
IF @CustomerId <= 0
|
||||
BEGIN
|
||||
SET @CustomerId = null
|
||||
END
|
||||
set @LabratoryId = dbo.foo_IdGetLabratory(@LabDetails)
|
||||
IF @LabratoryId <= 0
|
||||
BEGIN
|
||||
SET @LabratoryId = null
|
||||
END
|
||||
set @TestEngineerId = dbo.foo_IdGetEngineer(@TestEngineerDetails);
|
||||
IF @TestEngineerId <= 0
|
||||
BEGIN
|
||||
SET @TestEngineerId = null
|
||||
END
|
||||
|
||||
insert into [dbo].[TestSetups]
|
||||
([TestSetupName]
|
||||
,[SetupDescription]
|
||||
,[AutomaticTestProgression]
|
||||
,[AutomaticProgressionDelayMS]
|
||||
,[InvertTrigger]
|
||||
,[InvertStart]
|
||||
,[ViewDiagnostics]
|
||||
,[VerifyChannels]
|
||||
,[AutoVerifyChannels]
|
||||
,[VerifyChannelsDelayMS]
|
||||
,[RecordingMode]
|
||||
,[SamplesPerSecond]
|
||||
,[PreTriggerSeconds]
|
||||
,[PostTriggerSeconds]
|
||||
,[StrictDiagnostics]
|
||||
,[RequireConfirmationOnErrors]
|
||||
,[ROIDownload]
|
||||
,[ViewROIDownload]
|
||||
,[DownloadAll]
|
||||
,[ViewRealtime]
|
||||
,[RealtimePlotCount]
|
||||
,[RegionsOfInterest]
|
||||
,[ROIStart]
|
||||
,[ROIEnd]
|
||||
,[ViewDownloadAll]
|
||||
,[Export]
|
||||
,[ExportFormat]
|
||||
|
||||
,[CustomerId]
|
||||
,[LabratoryId]
|
||||
,[TestEngineerId]
|
||||
,[LabDetails]
|
||||
,[UseLabDetails]
|
||||
,[CustomerDetails]
|
||||
,[UseCustomerDetails]
|
||||
,[TestEngineerDetails]
|
||||
,[UseTestEngineerDetails]
|
||||
|
||||
,[AllowMissingSensors]
|
||||
,[AllowSensorIdToBlankChannel]
|
||||
,[CalibrationBehavior]
|
||||
,[LocalOnly]
|
||||
,[LastModified]
|
||||
,[LastModifiedBy]
|
||||
,[TurnOffExcitation]
|
||||
,[TriggerCheckRealtime]
|
||||
,[TriggerCheckStep]
|
||||
,[PostTestDiagnostics]
|
||||
,[ExportFolder]
|
||||
,[DownloadFolder]
|
||||
,[CommonStatusLine]
|
||||
,[SameAsDownloadFolder]
|
||||
,[UploadData]
|
||||
,[UploadDataFolder]
|
||||
,[UploadExportsOnly]
|
||||
,[Settings]
|
||||
,[WarnOnBatteryFail]
|
||||
,[Dirty]
|
||||
,[Complete]
|
||||
,[ErrorMessage]
|
||||
,[UserTags]
|
||||
,[DoAutoArm]
|
||||
,[CheckoutMode]
|
||||
,[ISFFile]
|
||||
,[QuitTestWithoutWarning]
|
||||
,[NotAllChannelsRealTime]
|
||||
,[NotAllChannelsViewer]
|
||||
,[SuppressMissingSensorsWarning]
|
||||
,[DoStreaming]
|
||||
,[InputClockSourceMaster]
|
||||
,[OutputClockSourceMaster]
|
||||
,[InputClockSourceSlave]
|
||||
,[TestSetup])
|
||||
VALUES
|
||||
( @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@RegionsOfInterest
|
||||
,@ROIStart
|
||||
,@ROIEnd
|
||||
,@ViewDownloadAll
|
||||
,@Export
|
||||
,@ExportFormat
|
||||
|
||||
,@CustomerId
|
||||
,@LabratoryId
|
||||
,@TestEngineerId
|
||||
,@LabDetails
|
||||
,@UseLabDetails
|
||||
,@CustomerDetails
|
||||
,@UseCustomerDetails
|
||||
,@TestEngineerDetails
|
||||
,@UseTestEngineerDetails
|
||||
|
||||
,@AllowMissingSensors
|
||||
,@AllowSensorIdToBlankChannel
|
||||
,@CalibrationBehavior
|
||||
,@LocalOnly
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@TurnOffExcitation
|
||||
,@TriggerCheckRealtime
|
||||
,@TriggerCheckStep
|
||||
,@PostTestDiagnostics
|
||||
,@ExportFolder
|
||||
,@DownloadFolder
|
||||
,@CommonStatusLine
|
||||
,@SameAsDownloadFolder
|
||||
,@UploadData
|
||||
,@UploadDataFolder
|
||||
,@UploadExportsOnly
|
||||
,@Settings
|
||||
,@WarnOnBatteryFail
|
||||
,@Dirty
|
||||
,@Complete
|
||||
,@Error
|
||||
|
||||
,@UserTags
|
||||
,@DoAutoArm
|
||||
,@CheckoutMode
|
||||
,@ISFFile
|
||||
,@QuitTestWithoutWarning
|
||||
,@NotAllChannelsRealTime
|
||||
,@NotAllChannelsViewer
|
||||
,@SuppressMissingSensorsWarning
|
||||
,@DoStreaming
|
||||
,@InputClockSourceMaster
|
||||
,@OutputClockSourceMaster
|
||||
,@InputClockSourceSlave
|
||||
,@TestSetup)
|
||||
|
||||
set @new_id = scope_identity()
|
||||
end
|
||||
end try
|
||||
begin catch
|
||||
set @errorMessage = error_message()
|
||||
set @errorNumber = error_number()
|
||||
end catch;
|
||||
|
||||
END;
|
||||
@@ -0,0 +1,230 @@
|
||||
--UpdateInsert
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupsUpdateInsert]
|
||||
@TestSetupName nvarchar(50) = Null
|
||||
,@SetupDescription nvarchar(50)
|
||||
,@AutomaticTestProgression bit
|
||||
,@AutomaticProgressionDelayMS int
|
||||
,@InvertTrigger bit
|
||||
,@InvertStart bit
|
||||
,@ViewDiagnostics bit
|
||||
,@VerifyChannels bit
|
||||
,@AutoVerifyChannels bit
|
||||
,@VerifyChannelsDelayMS int
|
||||
,@RecordingMode smallint
|
||||
,@SamplesPerSecond float
|
||||
,@PreTriggerSeconds float
|
||||
,@PostTriggerSeconds float
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@RegionsOfInterest nvarchar(MAX)
|
||||
,@ROIStart float
|
||||
,@ROIEnd float
|
||||
,@ViewDownloadAll bit
|
||||
,@Export bit
|
||||
,@ExportFormat bigint
|
||||
,@LabDetails nvarchar(50)
|
||||
,@UseLabDetails bit
|
||||
,@CustomerDetails nvarchar(50)
|
||||
,@UseCustomerDetails bit
|
||||
,@AllowMissingSensors bit
|
||||
,@AllowSensorIdToBlankChannel bit
|
||||
,@CalibrationBehavior smallint
|
||||
,@LocalOnly bit
|
||||
,@LastModified datetime
|
||||
,@LastModifiedBy nvarchar(50)
|
||||
,@TurnOffExcitation bit
|
||||
,@TriggerCheckRealtime bit
|
||||
,@TriggerCheckStep bit
|
||||
,@PostTestDiagnostics int
|
||||
,@ExportFolder nvarchar(150)
|
||||
,@DownloadFolder nvarchar(150)
|
||||
,@CommonStatusLine bit
|
||||
,@SameAsDownloadFolder bit
|
||||
,@UploadData bit
|
||||
,@UploadDataFolder nvarchar(150)
|
||||
,@UploadExportsOnly bit
|
||||
,@Settings nvarchar(4000)
|
||||
,@WarnOnBatteryFail bit
|
||||
,@Dirty bit
|
||||
,@Complete bit
|
||||
,@Error nvarchar(255)
|
||||
,@TestEngineerDetails nvarchar(50)
|
||||
,@UseTestEngineerDetails bit
|
||||
,@UserTags varbinary(max)
|
||||
,@DoAutoArm bit
|
||||
,@CheckoutMode bit
|
||||
,@ISFFile nvarchar(4000)
|
||||
,@QuitTestWithoutWarning bit
|
||||
,@NotAllChannelsRealTime bit
|
||||
,@NotAllChannelsViewer bit
|
||||
,@SuppressMissingSensorsWarning bit
|
||||
,@DoStreaming bit
|
||||
,@InputClockSourceMaster nvarchar(50)
|
||||
,@OutputClockSourceMaster nvarchar(50)
|
||||
,@InputClockSourceSlave nvarchar(50)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@new_id int output
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
declare @TestSetupId int
|
||||
|
||||
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
|
||||
|
||||
if(exists(select TestSetupId from [dbo].[TestSetups] where TestSetupId = @TestSetupId))
|
||||
begin
|
||||
set @new_id = @TestSetupId
|
||||
exec dbo.sp_TestSetupsUpdate @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@RegionsOfInterest
|
||||
,@ROIStart
|
||||
,@ROIEnd
|
||||
,@ViewDownloadAll
|
||||
,@Export
|
||||
,@ExportFormat
|
||||
,@LabDetails
|
||||
,@UseLabDetails
|
||||
,@CustomerDetails
|
||||
,@UseCustomerDetails
|
||||
,@AllowMissingSensors
|
||||
,@AllowSensorIdToBlankChannel
|
||||
,@CalibrationBehavior
|
||||
,@LocalOnly
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@TurnOffExcitation
|
||||
,@TriggerCheckRealtime
|
||||
,@TriggerCheckStep
|
||||
,@PostTestDiagnostics
|
||||
,@ExportFolder
|
||||
,@DownloadFolder
|
||||
,@CommonStatusLine
|
||||
,@SameAsDownloadFolder
|
||||
,@UploadData
|
||||
,@UploadDataFolder
|
||||
,@UploadExportsOnly
|
||||
,@Settings
|
||||
,@WarnOnBatteryFail
|
||||
,@Dirty
|
||||
,@Complete
|
||||
,@Error
|
||||
,@TestEngineerDetails
|
||||
,@UseTestEngineerDetails
|
||||
,@UserTags
|
||||
,@DoAutoArm
|
||||
,@CheckoutMode
|
||||
,@ISFFile
|
||||
,@QuitTestWithoutWarning
|
||||
,@NotAllChannelsRealTime
|
||||
,@NotAllChannelsViewer
|
||||
,@SuppressMissingSensorsWarning
|
||||
,@DoStreaming
|
||||
,@InputClockSourceMaster
|
||||
,@OutputClockSourceMaster
|
||||
,@InputClockSourceSlave
|
||||
,@TestSetup
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
exec dbo.sp_TestSetupsInsert @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@RegionsOfInterest
|
||||
,@ROIStart
|
||||
,@ROIEnd
|
||||
,@ViewDownloadAll
|
||||
,@Export
|
||||
,@ExportFormat
|
||||
,@LabDetails
|
||||
,@UseLabDetails
|
||||
,@CustomerDetails
|
||||
,@UseCustomerDetails
|
||||
,@AllowMissingSensors
|
||||
,@AllowSensorIdToBlankChannel
|
||||
,@CalibrationBehavior
|
||||
,@LocalOnly
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@TurnOffExcitation
|
||||
,@TriggerCheckRealtime
|
||||
,@TriggerCheckStep
|
||||
,@PostTestDiagnostics
|
||||
,@ExportFolder
|
||||
,@DownloadFolder
|
||||
,@CommonStatusLine
|
||||
,@SameAsDownloadFolder
|
||||
,@UploadData
|
||||
,@UploadDataFolder
|
||||
,@UploadExportsOnly
|
||||
,@Settings
|
||||
,@WarnOnBatteryFail
|
||||
,@Dirty
|
||||
,@Complete
|
||||
,@Error
|
||||
,@TestEngineerDetails
|
||||
,@UseTestEngineerDetails
|
||||
,@UserTags
|
||||
,@DoAutoArm
|
||||
,@CheckoutMode
|
||||
,@ISFFile
|
||||
,@QuitTestWithoutWarning
|
||||
,@NotAllChannelsRealTime
|
||||
,@NotAllChannelsViewer
|
||||
,@SuppressMissingSensorsWarning
|
||||
,@DoStreaming
|
||||
,@InputClockSourceMaster
|
||||
,@OutputClockSourceMaster
|
||||
,@InputClockSourceSlave
|
||||
,@TestSetup
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
END;
|
||||
@@ -0,0 +1,192 @@
|
||||
--Update
|
||||
ALTER PROCEDURE [dbo].[sp_TestSetupsUpdate]
|
||||
@TestSetupName nvarchar(50) = Null
|
||||
,@SetupDescription nvarchar(50)
|
||||
,@AutomaticTestProgression bit
|
||||
,@AutomaticProgressionDelayMS int
|
||||
,@InvertTrigger bit
|
||||
,@InvertStart bit
|
||||
,@ViewDiagnostics bit
|
||||
,@VerifyChannels bit
|
||||
,@AutoVerifyChannels bit
|
||||
,@VerifyChannelsDelayMS int
|
||||
,@RecordingMode smallint
|
||||
,@SamplesPerSecond float
|
||||
,@PreTriggerSeconds float
|
||||
,@PostTriggerSeconds float
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@RegionsOfInterest nvarchar(MAX)
|
||||
,@ROIStart float
|
||||
,@ROIEnd float
|
||||
,@ViewDownloadAll bit
|
||||
,@Export bit
|
||||
,@ExportFormat bigint
|
||||
,@LabDetails nvarchar(50)
|
||||
,@UseLabDetails bit
|
||||
,@CustomerDetails nvarchar(50)
|
||||
,@UseCustomerDetails bit
|
||||
,@AllowMissingSensors bit
|
||||
,@AllowSensorIdToBlankChannel bit
|
||||
,@CalibrationBehavior smallint
|
||||
,@LocalOnly bit
|
||||
,@LastModified datetime
|
||||
,@LastModifiedBy nvarchar(50)
|
||||
,@TurnOffExcitation bit
|
||||
,@TriggerCheckRealtime bit
|
||||
,@TriggerCheckStep bit
|
||||
,@PostTestDiagnostics int
|
||||
,@ExportFolder nvarchar(150)
|
||||
,@DownloadFolder nvarchar(150)
|
||||
,@CommonStatusLine bit
|
||||
,@SameAsDownloadFolder bit
|
||||
,@UploadData bit
|
||||
,@UploadDataFolder nvarchar(150)
|
||||
,@UploadExportsOnly bit
|
||||
,@Settings nvarchar(4000)
|
||||
,@WarnOnBatteryFail bit
|
||||
,@Dirty bit
|
||||
,@Complete bit
|
||||
,@Error nvarchar(255)
|
||||
,@TestEngineerDetails nvarchar(50)
|
||||
,@UseTestEngineerDetails bit
|
||||
,@UserTags varbinary(max)
|
||||
,@DoAutoArm bit
|
||||
,@CheckoutMode bit
|
||||
,@ISFFile nvarchar(4000)
|
||||
,@QuitTestWithoutWarning bit
|
||||
,@NotAllChannelsRealTime bit
|
||||
,@NotAllChannelsViewer bit
|
||||
,@SuppressMissingSensorsWarning bit
|
||||
,@DoStreaming bit
|
||||
,@InputClockSourceMaster nvarchar(50)
|
||||
,@OutputClockSourceMaster nvarchar(50)
|
||||
,@InputClockSourceSlave nvarchar(50)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@new_id int output
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0; set @errorMessage = space(0); set @new_id = 0;
|
||||
|
||||
/* Table (ans stored procedure) is too big... */
|
||||
|
||||
begin try
|
||||
if(@TestSetupName is null)
|
||||
begin
|
||||
set @errorMessage = 'An invalid parameter or option was specified for procedure'
|
||||
set @errorNumber = 15600
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
declare @TestSetupId int
|
||||
declare @TestEngineerId int
|
||||
declare @LabratoryId int
|
||||
declare @CustomerId int
|
||||
|
||||
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
|
||||
set @CustomerId = dbo.foo_IdGetCustomer(@CustomerDetails)
|
||||
IF @CustomerId <= 0
|
||||
BEGIN
|
||||
SET @CustomerId = null
|
||||
END
|
||||
set @LabratoryId = dbo.foo_IdGetLabratory(@LabDetails)
|
||||
IF @LabratoryId <= 0
|
||||
BEGIN
|
||||
SET @LabratoryId = null
|
||||
END
|
||||
set @TestEngineerId = dbo.foo_IdGetEngineer(@TestEngineerDetails);
|
||||
IF @TestEngineerId <= 0
|
||||
BEGIN
|
||||
SET @TestEngineerId = null
|
||||
END
|
||||
|
||||
set @new_id = @TestSetupId
|
||||
|
||||
UPDATE [dbo].[TestSetups]
|
||||
SET [SetupDescription] = @SetupDescription
|
||||
,[AutomaticTestProgression] = @AutomaticTestProgression
|
||||
,[AutomaticProgressionDelayMS] = @AutomaticProgressionDelayMS
|
||||
,[InvertTrigger] = @InvertTrigger
|
||||
,[InvertStart] = @InvertStart
|
||||
,[ViewDiagnostics] = @ViewDiagnostics
|
||||
,[VerifyChannels] = @VerifyChannels
|
||||
,[AutoVerifyChannels] = @AutoVerifyChannels
|
||||
,[VerifyChannelsDelayMS] = @VerifyChannelsDelayMS
|
||||
,[RecordingMode] = @RecordingMode
|
||||
,[SamplesPerSecond] = @SamplesPerSecond
|
||||
,[PreTriggerSeconds] = @PreTriggerSeconds
|
||||
,[PostTriggerSeconds] = @PostTriggerSeconds
|
||||
,[StrictDiagnostics] = @StrictDiagnostics
|
||||
,[RequireConfirmationOnErrors] = @RequireConfirmationOnErrors
|
||||
,[ROIDownload] = @ROIDownload
|
||||
,[ViewROIDownload] = @ViewROIDownload
|
||||
,[DownloadAll] = @DownloadAll
|
||||
,[ViewRealtime] = @ViewRealtime
|
||||
,[RealtimePlotCount] = @RealtimePlotCount
|
||||
,[RegionsOfInterest] = @RegionsOfInterest
|
||||
,[ROIStart] = @ROIStart
|
||||
,[ROIEnd] = @ROIEnd
|
||||
,[ViewDownloadAll] = @ViewDownloadAll
|
||||
,[Export] = @Export
|
||||
,[ExportFormat] = @ExportFormat
|
||||
,[CustomerId] = @CustomerId
|
||||
,[LabratoryId] = @LabratoryId
|
||||
,[TestEngineerId] = @TestEngineerId
|
||||
,[LabDetails] = @LabDetails
|
||||
,[UseLabDetails] = @UseLabDetails
|
||||
,[CustomerDetails] = @CustomerDetails
|
||||
,[UseCustomerDetails] = @UseCustomerDetails
|
||||
,[AllowMissingSensors] = @AllowMissingSensors
|
||||
,[AllowSensorIdToBlankChannel] = @AllowSensorIdToBlankChannel
|
||||
,[CalibrationBehavior] = @CalibrationBehavior
|
||||
,[LocalOnly] = @LocalOnly
|
||||
,[LastModified] = @LastModified
|
||||
,[LastModifiedBy] = @LastModifiedBy
|
||||
,[TurnOffExcitation] = @TurnOffExcitation
|
||||
,[TriggerCheckRealtime] = @TriggerCheckRealtime
|
||||
,[TriggerCheckStep] = @TriggerCheckStep
|
||||
,[PostTestDiagnostics] = @PostTestDiagnostics
|
||||
,[ExportFolder] = @ExportFolder
|
||||
,[DownloadFolder] = @DownloadFolder
|
||||
,[CommonStatusLine] = @CommonStatusLine
|
||||
,[SameAsDownloadFolder] = @SameAsDownloadFolder
|
||||
,[UploadData] = @UploadData
|
||||
,[UploadDataFolder] = @UploadDataFolder
|
||||
,[UploadExportsOnly] = @UploadExportsOnly
|
||||
,[Settings] = @Settings
|
||||
,[WarnOnBatteryFail] = @WarnOnBatteryFail
|
||||
,[Dirty] = @Dirty
|
||||
,[Complete] = @Complete
|
||||
,[ErrorMessage] = @Error
|
||||
,[TestEngineerDetails] = @TestEngineerDetails
|
||||
,[UseTestEngineerDetails] = @UseTestEngineerDetails
|
||||
,[UserTags] = @UserTags
|
||||
,[DoAutoArm] = @DoAutoArm
|
||||
,[CheckoutMode] = @CheckoutMode
|
||||
,[ISFFile] = @ISFFile
|
||||
,[QuitTestWithoutWarning] = @QuitTestWithoutWarning
|
||||
,[NotAllChannelsRealTime] = @NotAllChannelsRealTime
|
||||
,[NotAllChannelsViewer] = @NotAllChannelsViewer
|
||||
,[SuppressMissingSensorsWarning] = @SuppressMissingSensorsWarning
|
||||
,[DoStreaming] = @DoStreaming
|
||||
,[InputClockSourceMaster] = @InputClockSourceMaster
|
||||
,[OutputClockSourceMaster] = @OutputClockSourceMaster
|
||||
,[InputClockSourceSlave] = @InputClockSourceSlave
|
||||
,[TestSetup] = @TestSetup
|
||||
WHERE [TestSetupId] = @TestSetupId
|
||||
end
|
||||
end try
|
||||
begin catch
|
||||
set @errorMessage = error_message()
|
||||
set @errorNumber = error_number()
|
||||
end catch;
|
||||
END;
|
||||
Reference in New Issue
Block a user