init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
DECLARE @UserId INT
|
||||
DECLARE @PropertyId INT
|
||||
DECLARE @PropertyValue [NVARCHAR] (MAX)
|
||||
|
||||
SELECT @UserId = ID FROM Users WHERE UserName = 'TSRAIRUser'
|
||||
IF (@UserId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultViewAll'
|
||||
IF (@PropertyId IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[DefaultProperties] (PropertyName, DefaultValue) VALUES ('DefaultViewAll', 'False')
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultViewAll'
|
||||
END
|
||||
IF (@PropertyId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyValue = PropertyValue FROM [dbo].[UserProperties] WHERE UserId = @UserId AND PropertyId = @PropertyId
|
||||
IF (@PropertyValue IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[UserProperties] VALUES (@UserId, @PropertyId, 'True')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE [dbo].[UserProperties] SET PropertyValue = 'True' WHERE UserId = @UserId AND PropertyId = @PropertyId;
|
||||
END
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,75 @@
|
||||
ALTER PROCEDURE [dbo].[sp_SensorModelsUpdate]
|
||||
@Model nvarchar(50)
|
||||
,@Manufacturer nvarchar(50)
|
||||
,@UserPartNumber nvarchar(50)
|
||||
,@Capacity float
|
||||
,@OffsetToleranceLow float
|
||||
,@OffsetToleranceHigh float
|
||||
,@MeasurementUnit nvarchar(50)
|
||||
,@Bridge smallint
|
||||
,@Shunt smallint
|
||||
,@BridgeResistance float
|
||||
,@FilterClass nvarchar(50)
|
||||
,@UniPolar bit
|
||||
,@IgnoreRange bit
|
||||
,@CouplingMode smallint
|
||||
,@Version int
|
||||
,@RangeLow float
|
||||
,@RangeAve float
|
||||
,@RangeHigh float
|
||||
,@LastModified datetime
|
||||
,@ModifiedBy nvarchar(50)
|
||||
,@LocalOnly bit
|
||||
,@NumberOfAxes smallint
|
||||
,@CalInterval int
|
||||
,@AxisNumber smallint
|
||||
,@Polarity nvarchar(10)
|
||||
,@Invert bit
|
||||
,@CheckOffset bit
|
||||
,@CalibrationRecord nvarchar(MAX)
|
||||
,@ISOCode nvarchar(20)
|
||||
,@SupportedExcitation nvarchar(255)
|
||||
,@InitialEU float
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
set @errorNumber = 0
|
||||
set @errorMessage = space(0)
|
||||
UPDATE [dbo].[SensorModels]
|
||||
SET [Model] = @Model
|
||||
,[Manufacturer] = @Manufacturer
|
||||
,[UserPartNumber] = @UserPartNumber
|
||||
,[Capacity] = @Capacity
|
||||
,[OffsetToleranceLow] = @OffsetToleranceLow
|
||||
,[OffsetToleranceHigh] = @OffsetToleranceHigh
|
||||
,[MeasurementUnit] = @MeasurementUnit
|
||||
,[Bridge] = @Bridge
|
||||
,[Shunt] = @Shunt
|
||||
,[BridgeResistance] = @BridgeResistance
|
||||
,[FilterClass] = @FilterClass
|
||||
,[UniPolar] = @UniPolar
|
||||
,[IgnoreRange] = @IgnoreRange
|
||||
,[CouplingMode] = @CouplingMode
|
||||
,[Version] = @Version
|
||||
,[RangeLow] = @RangeLow
|
||||
,[RangeAve] = @RangeAve
|
||||
,[RangeHigh] = @RangeHigh
|
||||
,[LastModified] = @LastModified
|
||||
,[ModifiedBy] = @ModifiedBy
|
||||
,[LocalOnly] = @LocalOnly
|
||||
,[NumberOfAxes] = @NumberOfAxes
|
||||
,[CalInterval] = @CalInterval
|
||||
,[AxisNumber] = @AxisNumber
|
||||
,[Polarity] = @Polarity
|
||||
,[Invert] = @Invert
|
||||
,[CheckOffset] = @CheckOffset
|
||||
,[CalibrationRecord] = @CalibrationRecord
|
||||
,[ISOCode] = @ISOCode
|
||||
,[SupportedExcitation] = @SupportedExcitation
|
||||
,[InitialEU] = @InitialEU
|
||||
WHERE [Model] = @Model
|
||||
and [Manufacturer] = @Manufacturer
|
||||
|
||||
END
|
||||
@@ -0,0 +1 @@
|
||||
INSERT INTO [dbo].[ChannelSettings]([SettingName], [DefaultValue]) VALUES ('BridgeType', 'FullBridge');
|
||||
@@ -0,0 +1 @@
|
||||
INSERT INTO Settings VALUES ('SLICE_PRO_Distributor_PowerSetting', 2, '10.0, 28.0, 10.0, 28.0, 22.0, 56.0, 22.0, 56.0, 8.5, 21.0, 29.0, 57.0, 10.8, 10.8, 28.0, 28.0', 'SYSTEM')
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user