init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
INSERT INTO [dbo].[DefaultProperties]
|
||||
([PropertyId]
|
||||
,[PropertyName]
|
||||
,[DefaultValue])
|
||||
VALUES
|
||||
(306
|
||||
,'DefaultSensorCalibrationBehavior'
|
||||
,'NonLinearIfAvailable')
|
||||
|
||||
UPDATE dbo.TestSetups SET CalibrationBehavior = 1
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE DAS SET MaxSampleRate = 20000, MinSampleRate = 100 WHERE TYPE = 40 OR TYPE = 41
|
||||
@@ -0,0 +1,29 @@
|
||||
CREATE PROCEDURE [dbo].[sp_GroupChannelSettingsUpdateInsert_93]
|
||||
@ChannelId BIGINT,
|
||||
@SettingId INT,
|
||||
@SettingValue NVARCHAR (255),
|
||||
@errorNumber INT OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
|
||||
if(exists(select ChannelId from [dbo].[GroupChannelSettings] where ChannelId = @ChannelId and SettingId = @SettingId))
|
||||
begin
|
||||
exec dbo.sp_GroupChannelSettingsUpdate_93
|
||||
@ChannelId
|
||||
,@SettingId
|
||||
,@SettingValue
|
||||
,@errorNumber output, @errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
exec dbo.sp_GroupChannelSettingsInsert_93
|
||||
@ChannelId
|
||||
,@SettingId
|
||||
,@SettingValue
|
||||
,@errorNumber output, @errorMessage output
|
||||
end
|
||||
END
|
||||
@@ -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,85 @@
|
||||
--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]
|
||||
,[ClockSyncProfileMaster]
|
||||
,[ClockSyncProfileSlave]
|
||||
,[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,54 @@
|
||||
ALTER PROCEDURE [dbo].[sp_GroupsUpdateInsert]
|
||||
@SerialNumber nvarchar(255) = null
|
||||
,@Picture NVARCHAR(255) = null
|
||||
,@DisplayName nvarchar(255)
|
||||
,@Description nvarchar(255)
|
||||
,@Embedded bit
|
||||
,@LastModified datetime
|
||||
,@LastModifiedBy nvarchar(50)
|
||||
,@StaticGroupId int = NULL
|
||||
,@ExtraProperties nvarchar(max)
|
||||
,@new_id int output
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
set @errorNumber = 0; set @errorMessage = space(0);
|
||||
|
||||
declare @GroupId int
|
||||
set @GroupId = dbo.foo_IdGetGroup(@SerialNumber)
|
||||
|
||||
--declare @TemplateId int
|
||||
--set @TemplateId = dbo.foo_IdGetTemplate(@Template)
|
||||
|
||||
if(exists(select Id from [dbo].[Groups] where Id = @GroupId))
|
||||
begin
|
||||
set @new_id = @GroupId;
|
||||
exec dbo.sp_GroupsUpdate @GroupId
|
||||
,@SerialNumber
|
||||
,@Picture
|
||||
,@DisplayName
|
||||
,@Description
|
||||
,@Embedded
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@StaticGroupId
|
||||
,@ExtraProperties
|
||||
,@errorNumber output, @errorMessage output
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
exec dbo.sp_GroupsInsert @SerialNumber
|
||||
,@Picture
|
||||
,@DisplayName
|
||||
,@Embedded
|
||||
,@Description
|
||||
,@LastModified
|
||||
,@LastModifiedBy
|
||||
,@StaticGroupId
|
||||
,@ExtraProperties
|
||||
,@errorNumber output, @errorMessage output, @new_id output
|
||||
end
|
||||
END
|
||||
Reference in New Issue
Block a user