init
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ALTER TABLE [TestSetups] ADD AlignUDPToPPS BIT default 0;
|
||||
@@ -0,0 +1,29 @@
|
||||
CREATE TABLE [dbo].[AnalogDiagnostics](
|
||||
[Id] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
[DiagnosticRunId] [bigint] NOT NULL,
|
||||
[Excitation] [float] NULL,
|
||||
[ExcitationStatus] [smallint] NOT NULL,
|
||||
[Offset] [float] NULL,
|
||||
[OffsetStatus] [smallint] NOT NULL,
|
||||
[ActualRange] [float] NULL,
|
||||
[ActualRangeStatus] [smallint] NOT NULL,
|
||||
[Noise] [float] NULL,
|
||||
[NoiseStatus] [smallint] NOT NULL,
|
||||
[Shunt] [float] NULL,
|
||||
[ShuntStatus] [smallint] NOT NULL,
|
||||
[SensorId] [int] NULL,
|
||||
[SensorSerialNumber] [nvarchar](50) NOT NULL,
|
||||
[DASId] [int] NULL,
|
||||
[DASSerialNumber] [nvarchar](50) NOT NULL,
|
||||
[DASChannelIdx] [smallint] NOT NULL,
|
||||
[UserCode] [nvarchar](50) NOT NULL,
|
||||
[UserChannelName] [nvarchar](50) NOT NULL,
|
||||
[IsoCode] [nvarchar](50) NOT NULL,
|
||||
[IsoChannelName] [nvarchar](50) NOT NULL,
|
||||
[ScaleFactor] [float] NOT NULL,
|
||||
[CalibrationRecordId] [int] NULL,
|
||||
[CalibrationRecordXML] [nvarchar](max) NOT NULL,
|
||||
[Timestamp] [DateTime] NOT NULL,
|
||||
PRIMARY KEY (Id),
|
||||
FOREIGN KEY (DiagnosticRunId) REFERENCES DiagnosticRuns(Id)
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE [dbo].[DiagnosticRuns](
|
||||
[Id] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
[DataPROUser] [nvarchar](50) NOT NULL,
|
||||
[TestId] [int] NULL,
|
||||
[TestName] [nvarchar](50) NOT NULL,
|
||||
[PreTest] [bit] NULL,
|
||||
PRIMARY KEY (Id)
|
||||
) ON [PRIMARY]
|
||||
@@ -0,0 +1,38 @@
|
||||
CREATE PROCEDURE [dbo].[sp_AnalogDiagnosticsGet]
|
||||
@Id bigint = null,
|
||||
@DiagnosticRunId bigint = null,
|
||||
@SensorId int = null,
|
||||
@SensorSerialNumber nvarchar = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
if( @Id IS NULL)
|
||||
BEGIN
|
||||
IF (@DiagnosticRunId is NULL)
|
||||
BEGIN
|
||||
IF(@SensorId IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@SensorSerialNumber, '') IS NULL
|
||||
BEGIN
|
||||
SELECT [Id], [DiagnosticRunId], [Excitation], [ExcitationStatus], [Offset], [OffsetStatus], [ActualRange], [ActualRangeStatus], [Noise], [NoiseStatus], [Shunt], [ShuntStatus], [SensorId], [SensorSerialNumber], [DASId], [DASSerialNumber], [DASChannelIdx], [UserCode], [UserChannelName], [IsoCode], [IsoChannelName], [ScaleFactor], [CalibrationRecordId], [CalibrationRecordXML], [Timestamp] FROM [dbo].AnalogDiagnostics;
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DiagnosticRunId], [Excitation], [ExcitationStatus], [Offset], [OffsetStatus], [ActualRange], [ActualRangeStatus], [Noise], [NoiseStatus], [Shunt], [ShuntStatus], [SensorId], [SensorSerialNumber], [DASId], [DASSerialNumber], [DASChannelIdx], [UserCode], [UserChannelName], [IsoCode], [IsoChannelName], [ScaleFactor], [CalibrationRecordId], [CalibrationRecordXML], [Timestamp] FROM [dbo].AnalogDiagnostics WHERE [SensorSerialNumber]=@SensorSerialNumber;
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DiagnosticRunId], [Excitation], [ExcitationStatus], [Offset], [OffsetStatus], [ActualRange], [ActualRangeStatus], [Noise], [NoiseStatus], [Shunt], [ShuntStatus], [SensorId], [SensorSerialNumber], [DASId], [DASSerialNumber], [DASChannelIdx], [UserCode], [UserChannelName], [IsoCode], [IsoChannelName], [ScaleFactor], [CalibrationRecordId], [CalibrationRecordXML], [Timestamp] FROM [dbo].AnalogDiagnostics WHERE [SensorId]=@SensorId;
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DiagnosticRunId], [Excitation], [ExcitationStatus], [Offset], [OffsetStatus], [ActualRange], [ActualRangeStatus], [Noise], [NoiseStatus], [Shunt], [ShuntStatus], [SensorId], [SensorSerialNumber], [DASId], [DASSerialNumber], [DASChannelIdx], [UserCode], [UserChannelName], [IsoCode], [IsoChannelName], [ScaleFactor], [CalibrationRecordId], [CalibrationRecordXML], [Timestamp] FROM [dbo].AnalogDiagnostics WHERE [DiagnosticRunId]=@DiagnosticRunId;
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DiagnosticRunId], [Excitation], [ExcitationStatus], [Offset], [OffsetStatus], [ActualRange], [ActualRangeStatus], [Noise], [NoiseStatus], [Shunt], [ShuntStatus], [SensorId], [SensorSerialNumber], [DASId], [DASSerialNumber], [DASChannelIdx], [UserCode], [UserChannelName], [IsoCode], [IsoChannelName], [ScaleFactor], [CalibrationRecordId], [CalibrationRecordXML], [Timestamp] FROM [dbo].AnalogDiagnostics WHERE [Id] = @Id;
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,55 @@
|
||||
CREATE PROCEDURE [dbo].[sp_AnalogDiagnosticsUpdateInsert]
|
||||
@Id BIGINT NULL,
|
||||
@DiagnosticRunId BIGINT,
|
||||
@Excitation Float NULL,
|
||||
@ExcitationStatus SmallInt,
|
||||
@Offset Float NULL,
|
||||
@OffsetStatus SmallInt,
|
||||
@ActualRange Float NULL,
|
||||
@ActualRangeStatus SmallInt,
|
||||
@Shunt Float NULL,
|
||||
@ShuntStatus SmallInt,
|
||||
@Noise Float NULL,
|
||||
@NoiseStatus SmallInt,
|
||||
@SensorId Int NULL,
|
||||
@SensorSerialNumber NVARCHAR(255),
|
||||
@DasId Int NULL,
|
||||
@DASSerialNumber NVARCHAR(50),
|
||||
@DASChannelIdx Int,
|
||||
@UserCode NVARCHAR(50),
|
||||
@UserChannelName NVARCHAR(50),
|
||||
@IsoCode NVARCHAR(50),
|
||||
@IsoChannelName NVARCHAR(50),
|
||||
@ScaleFactorMV Float,
|
||||
@CalibrationRecordId INT NULL,
|
||||
@CalibrationRecord NVARCHAR(MAX),
|
||||
@Timestamp DateTime,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT,
|
||||
@new_id BIGINT OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
|
||||
IF NOT EXISTS(SELECT [Id] FROM [dbo].[DiagnosticRuns] WHERE [Id]=@DiagnosticRunId)
|
||||
BEGIN
|
||||
SET @ErrorNumber = 100;
|
||||
SET @ErrorMessage ='Invalid Diagnostic Id';
|
||||
END
|
||||
ELSE if(exists(select Id from [dbo].[DiagnosticRuns] where Id = @Id))
|
||||
begin
|
||||
set @new_id = @Id;
|
||||
UPDATE [dbo].[AnalogDiagnostics] SET [Shunt]=@Shunt, [ShuntStatus]=@ShuntStatus, [Excitation]=@Excitation, [ExcitationStatus]=@ExcitationStatus, [Offset]=@Offset, [OffsetStatus]=@OffsetStatus, [ActualRange]=@ActualRange, [ActualRangeStatus]=@ActualRangeStatus,[Noise]=@Noise,[NoiseStatus]=@NoiseStatus,[SensorId]=@SensorId,[SensorSerialNumber]=@SensorSerialNumber, [DASId]=@DasId,[DASSerialNumber]=@DASSerialNumber, [DASChannelIdx]=@DASChannelIdx, [UserCode]=@UserCode, [UserChannelName]= @UserChannelName, [IsoCode]=@IsoCode, [IsoChannelName]=@IsoChannelName, [ScaleFactor]=@ScaleFactorMV, [CalibrationRecordId]=@CalibrationRecordId, [CalibrationRecordXML]=@CalibrationRecord, [Timestamp]=@Timestamp;
|
||||
end
|
||||
else
|
||||
begin
|
||||
INSERT INTO [dbo].[AnalogDiagnostics] ([Shunt], [ShuntStatus], [DiagnosticRunId], [Excitation], [ExcitationStatus], [Offset], [OffsetStatus], [ActualRange], [ActualRangeStatus], [Noise], [NoiseStatus], [SensorId], [SensorSerialNumber], [DASId], [DASSerialNumber], [DASChannelIdx], [UserCode], [UserChannelName], [IsoCode], [IsoChannelName], [ScaleFactor], [CalibrationRecordId], [CalibrationRecordXML], [Timestamp]) VALUES (@Shunt, @ShuntStatus, @DiagnosticRunId, @Excitation, @ExcitationStatus,@Offset,@OffsetStatus,@ActualRange,@ActualRangeStatus,@Noise,@NoiseStatus,@SensorId,@SensorSerialNumber,@DasId,@DASSerialNumber,@DASChannelIdx,@UserCode,@UserChannelName,@IsoCode,@IsoChannelName,@ScaleFactorMV,@CalibrationRecordId,@CalibrationRecord,@Timestamp);
|
||||
SET @new_id = SCOPE_IDENTITY();
|
||||
end
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = error_number()
|
||||
SET @errorMessage = error_message()
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,31 @@
|
||||
CREATE PROCEDURE [dbo].[sp_DiagnosticRunsUpdateInsert]
|
||||
@Id BIGINT NULL,
|
||||
@DataPROUser NVARCHAR(50),
|
||||
@TestId INT NULL,
|
||||
@TestName NVARCHAR(50),
|
||||
@PreTest BIT,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT,
|
||||
@new_id BIGINT OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
|
||||
|
||||
if(exists(select Id from [dbo].[DiagnosticRuns] where Id = @Id))
|
||||
begin
|
||||
set @new_id = @Id;
|
||||
UPDATE [dbo].[DiagnosticRuns] SET [DataPROUser]=@DataPROUser, [TestId]=@TestId, [TestName]=@TestName WHERE [Id]=@Id;
|
||||
end
|
||||
else
|
||||
begin
|
||||
INSERT INTO [dbo].[DiagnosticRuns] ([DataPROUser], [PreTest], [TestId], [TestName]) VALUES (@DataPROUser, @PreTest, @TestId, @TestName);
|
||||
SET @new_id = SCOPE_IDENTITY();
|
||||
end
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = error_number()
|
||||
SET @errorMessage = error_message()
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,37 @@
|
||||
CREATE PROCEDURE [dbo].[sp_DiagnosticRunsGet]
|
||||
@Id bigint = null,
|
||||
@TestId int = null,
|
||||
@TestName nvarchar = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
if( @Id IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@Id, '') IS NULL
|
||||
BEGIN
|
||||
IF NULLIF(@TestName, '') IS NULL
|
||||
BEGIN
|
||||
IF(@TestId IS NULL)
|
||||
BEGIN
|
||||
SELECT [Id], [DataPROUser], [TestId], [TestName], [PreTest] from [dbo].DiagnosticRuns;
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DataPROUser], [TestId], [TestName], [PreTest] from [dbo].DiagnosticRuns WHERE [TestId]=@TestId;
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DataPROUser], [TestId], [TestName], [PreTest] from [dbo].DiagnosticRuns WHERE [TestName]=@TestName;
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DataPROUser], [TestId], [TestName], [PreTest] from [dbo].DiagnosticRuns WHERE [Id]=@Id;
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT [Id], [DataPROUser], [TestId], [TestName], [PreTest] from [dbo].DiagnosticRuns;
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,97 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupsGet_98]
|
||||
@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]
|
||||
,[NumberOfEvents]
|
||||
,[StrictDiagnostics]
|
||||
,[RequireConfirmationOnErrors]
|
||||
,[ROIDownload]
|
||||
,[ViewROIDownload]
|
||||
,[DownloadAll]
|
||||
,[ViewRealtime]
|
||||
,[RealtimePlotCount]
|
||||
,[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]
|
||||
,[ClockSyncProfileMaster]
|
||||
,[ClockSyncProfileSlave]
|
||||
,[ExtraProperties]
|
||||
,isnull([MeasureSquibResistancesStep], 0) as [MeasureSquibResistancesStep]
|
||||
,[TestSetupUniqueId]
|
||||
,[TestSetup]
|
||||
,[WakeupAndTriggerOn]
|
||||
,[WakeupTrigger]
|
||||
,[WakeUpMotionTimeout]
|
||||
,[TimedIntervalFrequency]
|
||||
,[RTCScheduleStartDateTime]
|
||||
,[RTCScheduleDuration]
|
||||
,[StartWithEvent]
|
||||
,isnull([RepeatAutoArmOrStreaming], 0) as [RepeatAutoArmOrStreaming]
|
||||
,isnull([IgnoreShortedStart], 0) as [IgnoreShortedStart]
|
||||
,isnull([IgnoreShortedTrigger], 0) as [IgnoreShortedTrigger]
|
||||
,[AlignUDPToPPS]
|
||||
from [dbo].[TestSetups]
|
||||
where ((@TestSetupId is null or @TestSetupId= 0) or TestSetupId = @TestSetupId)
|
||||
and (@TestSetupName is null or TestSetupName = @TestSetupName);
|
||||
END
|
||||
@@ -0,0 +1,304 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupsInsert_98]
|
||||
@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
|
||||
,@NumberOfEvents int
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@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
|
||||
,@ClockSyncProfileMaster nvarchar(50)
|
||||
,@ClockSyncProfileSlave nvarchar(50)
|
||||
,@ExtraProperties nvarchar(max)
|
||||
,@MeasureSquibResistancesStep bit
|
||||
,@TestSetupUniqueId nvarchar(max)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@WakeupAndTriggerOn bit
|
||||
,@WakeupTrigger smallint
|
||||
,@WakeUpMotionTimeout int
|
||||
,@TimedIntervalFrequency int
|
||||
,@RTCScheduleStartDateTime datetime
|
||||
,@RTCScheduleDuration bigint
|
||||
,@StartWithEvent bit
|
||||
,@RepeatAutoArmOrStreaming bit
|
||||
,@IgnoreShortedStart bit
|
||||
,@IgnoreShortedTrigger bit
|
||||
,@AlignUDPToPPS bit
|
||||
,@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]
|
||||
,[NumberOfEvents]
|
||||
,[StrictDiagnostics]
|
||||
,[RequireConfirmationOnErrors]
|
||||
,[ROIDownload]
|
||||
,[ViewROIDownload]
|
||||
,[DownloadAll]
|
||||
,[ViewRealtime]
|
||||
,[RealtimePlotCount]
|
||||
,[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]
|
||||
,[ClockSyncProfileMaster]
|
||||
,[ClockSyncProfileSlave]
|
||||
,[ExtraProperties]
|
||||
,[MeasureSquibResistancesStep]
|
||||
,[TestSetupUniqueId]
|
||||
,[TestSetup]
|
||||
,[WakeupAndTriggerOn]
|
||||
,[WakeupTrigger]
|
||||
,[WakeUpMotionTimeout]
|
||||
,[TimedIntervalFrequency]
|
||||
,[RTCScheduleStartDateTime]
|
||||
,[RTCScheduleDuration]
|
||||
,[StartWithEvent]
|
||||
,[RepeatAutoArmOrStreaming]
|
||||
,[IgnoreShortedStart]
|
||||
,[IgnoreShortedTrigger]
|
||||
,[AlignUDPToPPS])
|
||||
VALUES
|
||||
( @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@NumberOfEvents
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@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
|
||||
,@ClockSyncProfileMaster
|
||||
,@ClockSyncProfileSlave
|
||||
,@ExtraProperties
|
||||
,@MeasureSquibResistancesStep
|
||||
,@TestSetupUniqueId
|
||||
,@TestSetup
|
||||
,@WakeupAndTriggerOn
|
||||
,@WakeupTrigger
|
||||
,@WakeUpMotionTimeout
|
||||
,@TimedIntervalFrequency
|
||||
,@RTCScheduleStartDateTime
|
||||
,@RTCScheduleDuration
|
||||
,@StartWithEvent
|
||||
,@RepeatAutoArmOrStreaming
|
||||
,@IgnoreShortedStart
|
||||
,@IgnoreShortedTrigger
|
||||
,@AlignUDPToPPS)
|
||||
|
||||
set @new_id = scope_identity()
|
||||
end
|
||||
end try
|
||||
begin catch
|
||||
set @errorMessage = error_message()
|
||||
set @errorNumber = error_number()
|
||||
end catch;
|
||||
END
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupsUpdateInsert_98]
|
||||
@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
|
||||
,@NumberOfEvents int
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@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
|
||||
,@ClockSyncProfileMaster nvarchar(50)
|
||||
,@ClockSyncProfileSlave nvarchar(50)
|
||||
,@ExtraProperties nvarchar(max)
|
||||
,@MeasureSquibResistancesStep bit
|
||||
,@TestSetupUniqueId nvarchar(max)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@WakeupAndTriggerOn bit
|
||||
,@WakeupTrigger smallint
|
||||
,@WakeUpMotionTimeout int
|
||||
,@TimedIntervalFrequency int
|
||||
,@RTCScheduleStartDateTime datetime
|
||||
,@RTCScheduleDuration bigint
|
||||
,@StartWithEvent bit
|
||||
,@RepeatAutoArmOrStreaming bit
|
||||
,@IgnoreShortedStart bit
|
||||
,@IgnoreShortedTrigger bit
|
||||
,@AlignUDPToPPS bit
|
||||
,@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_98 @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@NumberOfEvents
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@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
|
||||
,@ClockSyncProfileMaster
|
||||
,@ClockSyncProfileSlave
|
||||
,@ExtraProperties
|
||||
,@MeasureSquibResistancesStep
|
||||
,@TestSetupUniqueId
|
||||
,@TestSetup
|
||||
,@WakeupAndTriggerOn
|
||||
,@WakeupTrigger
|
||||
,@WakeUpMotionTimeout
|
||||
,@TimedIntervalFrequency
|
||||
,@RTCScheduleStartDateTime
|
||||
,@RTCScheduleDuration
|
||||
,@StartWithEvent
|
||||
,@RepeatAutoArmOrStreaming
|
||||
,@IgnoreShortedStart
|
||||
,@IgnoreShortedTrigger
|
||||
,@AlignUDPToPPS
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
exec dbo.sp_TestSetupsInsert_98 @TestSetupName
|
||||
,@SetupDescription
|
||||
,@AutomaticTestProgression
|
||||
,@AutomaticProgressionDelayMS
|
||||
,@InvertTrigger
|
||||
,@InvertStart
|
||||
,@ViewDiagnostics
|
||||
,@VerifyChannels
|
||||
,@AutoVerifyChannels
|
||||
,@VerifyChannelsDelayMS
|
||||
,@RecordingMode
|
||||
,@SamplesPerSecond
|
||||
,@PreTriggerSeconds
|
||||
,@PostTriggerSeconds
|
||||
,@NumberOfEvents
|
||||
,@StrictDiagnostics
|
||||
,@RequireConfirmationOnErrors
|
||||
,@ROIDownload
|
||||
,@ViewROIDownload
|
||||
,@DownloadAll
|
||||
,@ViewRealtime
|
||||
,@RealtimePlotCount
|
||||
,@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
|
||||
,@ClockSyncProfileMaster
|
||||
,@ClockSyncProfileSlave
|
||||
,@ExtraProperties
|
||||
,@MeasureSquibResistancesStep
|
||||
,@TestSetupUniqueId
|
||||
,@TestSetup
|
||||
,@WakeupAndTriggerOn
|
||||
,@WakeupTrigger
|
||||
,@WakeUpMotionTimeout
|
||||
,@TimedIntervalFrequency
|
||||
,@RTCScheduleStartDateTime
|
||||
,@RTCScheduleDuration
|
||||
,@StartWithEvent
|
||||
,@RepeatAutoArmOrStreaming
|
||||
,@IgnoreShortedStart
|
||||
,@IgnoreShortedTrigger
|
||||
,@AlignUDPToPPS
|
||||
,@new_id output
|
||||
,@errorNumber output
|
||||
,@errorMessage output
|
||||
end;
|
||||
END
|
||||
@@ -0,0 +1,220 @@
|
||||
CREATE PROCEDURE [dbo].[sp_TestSetupsUpdate_98]
|
||||
@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
|
||||
,@NumberOfEvents int
|
||||
,@StrictDiagnostics bit
|
||||
,@RequireConfirmationOnErrors bit
|
||||
,@ROIDownload bit
|
||||
,@ViewROIDownload bit
|
||||
,@DownloadAll bit
|
||||
,@ViewRealtime bit
|
||||
,@RealtimePlotCount smallint
|
||||
,@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
|
||||
,@ClockSyncProfileMaster nvarchar(50)
|
||||
,@ClockSyncProfileSlave nvarchar(50)
|
||||
,@ExtraProperties nvarchar(max)
|
||||
,@MeasureSquibResistancesStep bit
|
||||
,@TestSetupUniqueId nvarchar(max)
|
||||
,@TestSetup varbinary(MAX)
|
||||
,@WakeupAndTriggerOn bit
|
||||
,@WakeupTrigger smallint
|
||||
,@WakeUpMotionTimeout int
|
||||
,@TimedIntervalFrequency int
|
||||
,@RTCScheduleStartDateTime datetime
|
||||
,@RTCScheduleDuration bigint
|
||||
,@StartWithEvent bit
|
||||
,@RepeatAutoArmOrStreaming bit
|
||||
,@IgnoreShortedStart bit
|
||||
,@IgnoreShortedTrigger bit
|
||||
,@AlignUDPToPPS bit
|
||||
,@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
|
||||
,[NumberOfEvents] = @NumberOfEvents
|
||||
,[StrictDiagnostics] = @StrictDiagnostics
|
||||
,[RequireConfirmationOnErrors] = @RequireConfirmationOnErrors
|
||||
,[ROIDownload] = @ROIDownload
|
||||
,[ViewROIDownload] = @ViewROIDownload
|
||||
,[DownloadAll] = @DownloadAll
|
||||
,[ViewRealtime] = @ViewRealtime
|
||||
,[RealtimePlotCount] = @RealtimePlotCount
|
||||
,[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
|
||||
,[ClockSyncProfileMaster] = @ClockSyncProfileMaster
|
||||
,[ClockSyncProfileSlave] = @ClockSyncProfileSlave
|
||||
,[ExtraProperties] = @ExtraProperties
|
||||
,[MeasureSquibResistancesStep] = @MeasureSquibResistancesStep
|
||||
,[TestSetupUniqueId] = @TestSetupUniqueId
|
||||
,[TestSetup] = @TestSetup
|
||||
,[WakeupAndTriggerOn] = @WakeupAndTriggerOn
|
||||
,[WakeupTrigger] = @WakeupTrigger
|
||||
,[WakeUpMotionTimeout] = @WakeUpMotionTimeout
|
||||
,[TimedIntervalFrequency] = @TimedIntervalFrequency
|
||||
,[RTCScheduleStartDateTime] = @RTCScheduleStartDateTime
|
||||
,[RTCScheduleDuration] = @RTCScheduleDuration
|
||||
,[StartWithEvent] = @StartWithEvent
|
||||
,[RepeatAutoArmOrStreaming] = @RepeatAutoArmOrStreaming
|
||||
,[IgnoreShortedStart] = @IgnoreShortedStart
|
||||
,[IgnoreShortedTrigger] = @IgnoreShortedTrigger
|
||||
,[AlignUDPToPPS] = @AlignUDPToPPS
|
||||
WHERE [TestSetupId] = @TestSetupId
|
||||
end
|
||||
end try
|
||||
begin catch
|
||||
set @errorMessage = error_message()
|
||||
set @errorNumber = error_number()
|
||||
end catch;
|
||||
END
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE PROCEDURE [dbo].[sp_ROIPeriodChannelsGet_98]
|
||||
@TestSetupROIId int
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
SELECT
|
||||
[TestSetupROIId],
|
||||
[ChannelName],
|
||||
[ChannelId]
|
||||
FROM [dbo].[ROIPeriodChannels]
|
||||
WHERE TestSetupROIId = @TestSetupROIId
|
||||
END
|
||||
@@ -0,0 +1,35 @@
|
||||
CREATE PROCEDURE [dbo].[sp_ROIPeriodChannelsInsert_98]
|
||||
@TestSetupROIId int
|
||||
,@ChannelName nvarchar(4000)
|
||||
,@ChannelId bigint
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0
|
||||
set @errorMessage = space(0)
|
||||
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF (@TestSetupROIId IS NULL)
|
||||
BEGIN
|
||||
SET @errorNumber = 1
|
||||
SET @errorMessage = 'must contain a test setup id or a test setup name'
|
||||
return
|
||||
END
|
||||
|
||||
INSERT INTO [dbo].[ROIPeriodChannels]
|
||||
([TestSetupROIId],
|
||||
[ChannelName],
|
||||
[ChannelId])
|
||||
values
|
||||
(@TestSetupROIId,
|
||||
@ChannelName,
|
||||
@ChannelId)
|
||||
|
||||
if(@@error != 0)
|
||||
begin
|
||||
set @errorNumber = error_number()
|
||||
set @errorMessage = error_message()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
IF ((SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ROIPeriodChannels' AND COLUMN_NAME = 'ChannelID') = 0)
|
||||
ALTER TABLE [dbo].[ROIPeriodChannels] ADD ChannelId [bigint] NOT NULL DEFAULT 0;
|
||||
@@ -0,0 +1,3 @@
|
||||
IF ((SELECT COUNT(*) FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME = 'FK_ROIPeriodChannels_ChannelId') = 0)
|
||||
ALTER TABLE [dbo].[ROIPeriodChannels] WITH NOCHECK ADD CONSTRAINT [FK_ROIPeriodChannels_ChannelId] FOREIGN KEY([ChannelId])
|
||||
REFERENCES [dbo].[Channels] ([Id])
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE [dbo].[ROIPeriodChannels] CHECK CONSTRAINT [FK_ROIPeriodChannels_ChannelId]
|
||||
@@ -0,0 +1,4 @@
|
||||
DROP PROCEDURE [dbo].[sp_TestSetupsInsertUpdate];
|
||||
DROP PROCEDURE [dbo].[sp_TestSetupsInsertUpdate_92];
|
||||
DROP PROCEDURE [dbo].[sp_TestSetupsInsertUpdate_96];
|
||||
DELETE FROM [dbo].[StoredProcedureVersions] where [StoredProcedure] like '%sp_TestSetupsInsertUpdate%';
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE DAS SET SerialNumber = 'SLICE6 Falcon Prototype' WHERE SerialNumber = 'Falcon Prototype';
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE dbo.SensorCalibrations ADD
|
||||
SensitivityInspection int NULL,
|
||||
CalibrationNote nvarchar(2048) NULL,
|
||||
UsageCount int NOT NULL DEFAULT 0
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
ALTER PROCEDURE [dbo].[sp_SensorCalibrationsGet]
|
||||
@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.SensorCalibrationId, B.SerialNumber, A.CalibrationDate, A.Username, A.LocalOnly, A.NonLinear, A.CalibrationRecords, A.ModifyDate, A.IsProportional, A.RemoveOffset, A.ZeroMethod, A.CertificationDocuments, A.InitialOffset, A.SensitivityInspection, A.CalibrationNote, A.UsageCount FROM [dbo].SensorCalibrations as A INNER JOIN [dbo].Sensors AS B on A.SensorId=B.id
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.SensorCalibrationId, B.SerialNumber, A.CalibrationDate, A.Username, A.LocalOnly, A.NonLinear, A.CalibrationRecords, A.ModifyDate, A.IsProportional, A.RemoveOffset, A.ZeroMethod, A.CertificationDocuments, A.InitialOffset, A.SensitivityInspection, A.CalibrationNote, A.UsageCount FROM [dbo].SensorCalibrations as A INNER JOIN [dbo].Sensors AS B on A.SensorId=B.id WHERE B.SerialNumber=@SerialNumber
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.SensorCalibrationId, B.SerialNumber, A.CalibrationDate, A.Username, A.LocalOnly, A.NonLinear, A.CalibrationRecords, A.ModifyDate, A.IsProportional, A.RemoveOffset, A.ZeroMethod, A.CertificationDocuments, A.InitialOffset, A.SensitivityInspection, A.CalibrationNote, A.UsageCount FROM [dbo].SensorCalibrations as A INNER JOIN [dbo].Sensors AS B on A.SensorId=B.id WHERE B.id=@Id
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,30 @@
|
||||
ALTER PROCEDURE [dbo].[sp_SensorsAnalogGet]
|
||||
@Id INT = NULL,
|
||||
@SerialNumber NVARCHAR (50) = NULL,
|
||||
@EID NVARCHAR (50) = NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
IF( @Id IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@SerialNumber, '') IS NULL
|
||||
BEGIN
|
||||
IF( @EID IS NULL)
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, C.AxisNumber, C.BridgeLegMode, C.BridgeResistance, C.BridgeType, C.Broken, C.SensitivityTolerancePercent , C.BypassFilter, C.CalibrationSignal, C.CalInterval, C.Capacity, C.CheckOffset, C.Comment, C.CouplingMode, C.Created, C.DiagnosticsMode, C.DoNotUse, C.eId, C.ExternalShuntResistance, C.FilterClass, C.InitialEU, C.InternalShuntResistance, C.Invert, C.IsoChannelName, C.IsoCode, C.LastModified, C.LocalOnly, C.Manufacturer, C.MeasurementUnit, C.Model, C.ModifiedBy, C.NumberOfAxes, C.OffsetToleranceHigh, C.OffsetToleranceLow, C.RangeAve, C.RangeHigh, C.RangeLow, C.SensorCategory, C.SensorModelId, C.Shunt, C.[Status], C.SupportedExcitation, C.TimesUsed, C.UniPolar, C.UserChannelName, C.UserCode, C.UserSerialNumber, C.UserTags, C.UserValue1, C.UserValue2, C.UserValue3, C.[Version], C.LatestCalibrationId, C.FirstUseDate, C.ACCouplingModeEnabled, C.AssemblyName, C.UsageCount, C.MaximumUsage FROM [dbo].[Sensors] as A INNER JOIN [dbo].[SensorsType] as B ON A.SensorType=B.TypeId INNER JOIN [dbo].[SensorsAnalog] AS C on A.Id = C.SensorId WHERE B.SensorType='Analog'
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, C.AxisNumber, C.BridgeLegMode, C.BridgeResistance, C.BridgeType, C.Broken, C.SensitivityTolerancePercent , C.BypassFilter, C.CalibrationSignal, C.CalInterval, C.Capacity, C.CheckOffset, C.Comment, C.CouplingMode, C.Created, C.DiagnosticsMode, C.DoNotUse, C.eId, C.ExternalShuntResistance, C.FilterClass, C.InitialEU, C.InternalShuntResistance, C.Invert, C.IsoChannelName, C.IsoCode, C.LastModified, C.LocalOnly, C.Manufacturer, C.MeasurementUnit, C.Model, C.ModifiedBy, C.NumberOfAxes, C.OffsetToleranceHigh, C.OffsetToleranceLow, C.RangeAve, C.RangeHigh, C.RangeLow, C.SensorCategory, C.SensorModelId, C.Shunt, C.[Status], C.SupportedExcitation, C.TimesUsed, C.UniPolar, C.UserChannelName, C.UserCode, C.UserSerialNumber, C.UserTags, C.UserValue1, C.UserValue2, C.UserValue3, C.[Version], C.LatestCalibrationId, C.FirstUseDate, C.ACCouplingModeEnabled, C.AssemblyName, C.UsageCount, C.MaximumUsage FROM [dbo].[Sensors] as A INNER JOIN [dbo].[SensorsType] as B ON A.SensorType=B.TypeId INNER JOIN [dbo].[SensorsAnalog] AS C on A.Id = C.SensorId WHERE B.SensorType='Analog' AND C.eId=@EID
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, C.AxisNumber, C.BridgeLegMode, C.BridgeResistance, C.BridgeType, C.Broken, C.SensitivityTolerancePercent , C.BypassFilter, C.CalibrationSignal, C.CalInterval, C.Capacity, C.CheckOffset, C.Comment, C.CouplingMode, C.Created, C.DiagnosticsMode, C.DoNotUse, C.eId, C.ExternalShuntResistance, C.FilterClass, C.InitialEU, C.InternalShuntResistance, C.Invert, C.IsoChannelName, C.IsoCode, C.LastModified, C.LocalOnly, C.Manufacturer, C.MeasurementUnit, C.Model, C.ModifiedBy, C.NumberOfAxes, C.OffsetToleranceHigh, C.OffsetToleranceLow, C.RangeAve, C.RangeHigh, C.RangeLow, C.SensorCategory, C.SensorModelId, C.Shunt, C.[Status], C.SupportedExcitation, C.TimesUsed, C.UniPolar, C.UserChannelName, C.UserCode, C.UserSerialNumber, C.UserTags, C.UserValue1, C.UserValue2, C.UserValue3, C.[Version], C.LatestCalibrationId, C.FirstUseDate, C.ACCouplingModeEnabled, C.AssemblyName, C.UsageCount, C.MaximumUsage FROM [dbo].[Sensors] as A INNER JOIN [dbo].[SensorsType] as B ON A.SensorType=B.TypeId INNER JOIN [dbo].[SensorsAnalog] AS C on A.Id = C.SensorId WHERE B.SensorType='Analog' AND A.SerialNumber=@SerialNumber
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, C.AxisNumber, C.BridgeLegMode, C.BridgeResistance, C.BridgeType, C.Broken, C.SensitivityTolerancePercent , C.BypassFilter, C.CalibrationSignal, C.CalInterval, C.Capacity, C.CheckOffset, C.Comment, C.CouplingMode, C.Created, C.DiagnosticsMode, C.DoNotUse, C.eId, C.ExternalShuntResistance, C.FilterClass, C.InitialEU, C.InternalShuntResistance, C.Invert, C.IsoChannelName, C.IsoCode, C.LastModified, C.LocalOnly, C.Manufacturer, C.MeasurementUnit, C.Model, C.ModifiedBy, C.NumberOfAxes, C.OffsetToleranceHigh, C.OffsetToleranceLow, C.RangeAve, C.RangeHigh, C.RangeLow, C.SensorCategory, C.SensorModelId, C.Shunt, C.[Status], C.SupportedExcitation, C.TimesUsed, C.UniPolar, C.UserChannelName, C.UserCode, C.UserSerialNumber, C.UserTags, C.UserValue1, C.UserValue2, C.UserValue3, C.[Version], C.LatestCalibrationId, C.FirstUseDate, C.ACCouplingModeEnabled, C.AssemblyName, C.UsageCount, C.MaximumUsage FROM [dbo].[Sensors] as A INNER JOIN [dbo].[SensorsType] as B ON A.SensorType=B.TypeId INNER JOIN [dbo].[SensorsAnalog] AS C on A.Id = C.SensorId WHERE B.SensorType='Analog' AND A.id=@id
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,95 @@
|
||||
CREATE PROCEDURE [dbo].[sp_SensorCalibrationsInsert_98]
|
||||
@Id INT = NULL,
|
||||
@SensorSerialNumber NVARCHAR (50) = NULL,
|
||||
@SensorType TinyInt = NULL,
|
||||
@CalibrationDate DATETIME,
|
||||
@Username NVARCHAR (50),
|
||||
@LocalOnly BIT,
|
||||
@NonLinear BIT,
|
||||
@ModifyDate DATETIME,
|
||||
@IsProportional BIT,
|
||||
@RemoveOffset BIT,
|
||||
@ZeroMethod NVARCHAR (255),
|
||||
@CertificationDocuments NVARCHAR (2048),
|
||||
@InitialOffset NVARCHAR (MAX),
|
||||
@CalibrationRecords NVARCHAR (255),
|
||||
@SetLatestCalibrationId BIT,
|
||||
@SensitivityInspection INT = NULL,
|
||||
@CalibrationNote NVARCHAR (2048),
|
||||
@UsageCount INT = NULL,
|
||||
@new_id INT OUTPUT,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
SET @errorNumber = 0
|
||||
SET @errorMessage = space(0)
|
||||
DECLARE @SensorId AS INT
|
||||
SET @SensorId = @Id
|
||||
IF( @Id IS NULL)
|
||||
BEGIN
|
||||
SELECT @SensorId = [Id] FROM [dbo].[Sensors] WHERE [SensorType]=@SensorType AND [SerialNumber]=@SensorSerialNumber
|
||||
END
|
||||
IF( @SensorId IS NULL)
|
||||
BEGIN
|
||||
SET @errorNumber=1
|
||||
SET @errorMessage='Sensor not found'
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
DECLARE @CalibrationTypeId AS INT
|
||||
|
||||
SET @CalibrationTypeId = [dbo].[foo_IdGetCalibrationType](@NonLinear, @CalibrationRecords)
|
||||
|
||||
INSERT INTO [dbo].[SensorCalibrations] (
|
||||
[SensorId],
|
||||
[CalibrationDate],
|
||||
[Username],
|
||||
[LocalOnly],
|
||||
[NonLinear],
|
||||
[CalibrationTypeId],
|
||||
[CalibrationRecords],
|
||||
[ModifyDate],
|
||||
[IsProportional],
|
||||
[RemoveOffset],
|
||||
[ZeroMethod],
|
||||
[CertificationDocuments],
|
||||
[InitialOffset],
|
||||
[SensitivityInspection],
|
||||
[CalibrationNote],
|
||||
[UsageCount])
|
||||
VALUES (
|
||||
@SensorId,
|
||||
@CalibrationDate,
|
||||
@Username,
|
||||
@LocalOnly,
|
||||
@NonLinear,
|
||||
@CalibrationTypeId,
|
||||
@CalibrationRecords,
|
||||
@ModifyDate,
|
||||
@IsProportional,
|
||||
@RemoveOffset,
|
||||
@ZeroMethod,
|
||||
@CertificationDocuments,
|
||||
@InitialOffset,
|
||||
@SensitivityInspection,
|
||||
@CalibrationNote,
|
||||
@UsageCount)
|
||||
|
||||
SET @new_id = SCOPE_IDENTITY()
|
||||
|
||||
IF (@SetLatestCalibrationId = 1 )
|
||||
BEGIN
|
||||
UPDATE [dbo].[SensorsAnalog] SET [LatestCalibrationId]=@new_id WHERE [SensorId]=@SensorId
|
||||
END
|
||||
--IF(@CalibrationRecords != space(0) AND @SensorId !=0 AND @CalibrationTypeId != 0 AND @new_id !=0 )
|
||||
--BEGIN
|
||||
-- EXEC [dbo].[sp_SensorCalibrationRecordProsess] @SensorId, @new_id, @CalibrationTypeId, @CalibrationRecords, @errorNumber output, @errorMessage output
|
||||
--END
|
||||
IF(@@error!=0)
|
||||
BEGIN
|
||||
SET @errorNumber = error_number()
|
||||
SET @errorMessage = error_message()
|
||||
END
|
||||
END
|
||||
END
|
||||
@@ -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
|
||||
@@ -0,0 +1,62 @@
|
||||
CREATE PROCEDURE [dbo].[sp_SensorCalibrationsUpdate_98]
|
||||
@SensorSerialNumber nvarchar(50) = null
|
||||
,@CalibrationDate datetime
|
||||
,@Username nvarchar(50)
|
||||
,@LocalOnly bit
|
||||
,@NonLinear bit
|
||||
,@CalibrationRecords nvarchar(255)
|
||||
,@ModifyDate datetime
|
||||
,@IsProportional bit
|
||||
,@RemoveOffset bit
|
||||
,@ZeroMethod nvarchar(255)
|
||||
,@CertificationDocuments nvarchar(2048)
|
||||
,@InitialOffset nvarchar(50)
|
||||
,@SensitivityInspection int = null
|
||||
,@CalibrationNote nvarchar(2048) = null
|
||||
,@UsageCount int = null
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0
|
||||
set @errorMessage = space(0)
|
||||
|
||||
if(@SensorSerialNumber is null)
|
||||
begin
|
||||
set @errorNumber = 15600
|
||||
set @errorMessage = 'An invalid parameter or option was specified for procedure'
|
||||
end
|
||||
else
|
||||
begin
|
||||
declare @SensorId int
|
||||
declare @CalibrationTypeId int
|
||||
|
||||
set @SensorId = dbo.foo_IdGetSensor(@SensorSerialNumber)
|
||||
set @CalibrationTypeId = [dbo].[foo_IdGetCalibrationType](@NonLinear, @CalibrationRecords)
|
||||
|
||||
|
||||
UPDATE [dbo].[SensorCalibrations]
|
||||
SET [CalibrationDate] = @CalibrationDate
|
||||
,[Username] = @Username
|
||||
,[LocalOnly] = @LocalOnly
|
||||
,[NonLinear] = @NonLinear
|
||||
,[CalibrationRecords] = @CalibrationRecords
|
||||
,[ModifyDate] = @ModifyDate
|
||||
,[IsProportional] = @IsProportional
|
||||
,[RemoveOffset] = @RemoveOffset
|
||||
,[ZeroMethod] = @ZeroMethod
|
||||
,[CertificationDocuments] = @CertificationDocuments
|
||||
,[InitialOffset] = @InitialOffset
|
||||
,[SensitivityInspection] = @SensitivityInspection
|
||||
,[CalibrationNote] = @CalibrationNote
|
||||
,[UsageCount] = @UsageCount
|
||||
|
||||
WHERE SensorId = @SensorId
|
||||
|
||||
if(@@error!=0)
|
||||
begin
|
||||
set @errorNumber = error_number()
|
||||
set @errorMessage = error_message()
|
||||
end
|
||||
end
|
||||
END
|
||||
@@ -0,0 +1,20 @@
|
||||
CREATE PROCEDURE [dbo].[sp_SensorCalibrationsUsageCountUpdate]
|
||||
@SensorId INT,
|
||||
@SensorCalibrationId INT,
|
||||
@UsageCount INT,
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SET @errorNumber = 0
|
||||
SET @errorMessage = ''
|
||||
|
||||
UPDATE [dbo].[SensorCalibrations] SET [UsageCount] = @UsageCount WHERE [SensorId]=@SensorId AND [SensorCalibrationId]=@SensorCalibrationId ;
|
||||
|
||||
if(@@error != 0)
|
||||
begin
|
||||
set @errorNumber = error_number()
|
||||
set @errorMessage = error_message()
|
||||
end
|
||||
END
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_ChannelsDelete', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_ROIPeriodChannelsGet', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_ROIPeriodChannelsInsert', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_SensorsAnalogInsert', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_SensorsAnalogUpdate', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_SensorsAnalogUpdateInsert', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_SensorCalibrationsInsert', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_SensorCalibrationsUpdate', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_SensorCalibrationsGet', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupsGet', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupsInsert', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupsUpdate', 98)
|
||||
INSERT INTO [StoredProcedureVersions] ([StoredProcedure], [Version]) VALUES ('sp_TestSetupsUpdateInsert', 98)
|
||||
Reference in New Issue
Block a user