This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
ALTER PROCEDURE [dbo].[sp_DASGet]
@SerialNumber nvarchar(50) = null
,@position nvarchar(10) = null
AS
BEGIN
SET NOCOUNT ON;
SELECT [DASId]
,[SerialNumber]
,[Type]
,[MaxModules]
,[MaxMemory]
,[MaxSampleRate]
,[MinSampleRate]
,[FirmwareVersion]
,[CalDate]
,[ProtocolVersion]
,[LastModified]
,[LastModifiedBy]
,[Version]
,[LocalOnly]
,[LastUsed]
,[LastUsedBy]
,[Connection]
,[Channels]
,[Position]
,[ChannelTypes]
,[Reprogramable]
,[Reconfigurable]
,[IsModule]
,isnull([PositionOnDistributor], 0) as [PositionOnDistributor]
,isnull([PositionOnChain], 0) as [PositionOnChain]
,isnull([Port],0) as [Port]
,isnull([ParentDAS], space(0)) as [ParentDAS],
[FirstUseDate],
[TestId],
[GroupId],
[StandIn],
[MaxAAFRate]
FROM [dbo].[DAS] where
(@SerialNumber is null or DASId = dbo.foo_IdGetDAS(@SerialNumber))
and
Position = case when @position is null then space(0) else @position end
and
Type!=58
END

View File

@@ -0,0 +1,65 @@
ALTER PROCEDURE [dbo].[sp_SensorsDigitalInInsert]
@SerialNumber nvarchar(50)
,@SettingMode int
,@ScaleMultiplier nvarchar(50)
,@LastModified datetime
,@LastModifiedBy nvarchar(50)
,@eId nvarchar(50)
,@UserValue1 nvarchar(255)
,@UserValue2 nvarchar(255)
,@UserValue3 nvarchar(255)
,@UserTags varbinary(max)
,@MeasurementUnit nvarchar(50)
,@new_id int output
,@errorNumber int output
,@errorMessage nvarchar(250) output
AS
BEGIN
set @errorNumber = 0
set @errorMessage = space(0)
if(@SerialNumber is null)
begin
set @errorNumber = 15600
set @errorMessage = 'An invalid parameter or option was specified for procedure'
end
else
begin
if(exists(select SerialNumber from v_SensorSerialNumber where SerialNumber = @SerialNumber))
begin
set @errorMessage = 'The sensor serial mumber - ' + ltrim(rtrim(@SerialNumber)) + ' is not unique';
set @errorNumber = -1
end
else
begin
INSERT INTO [dbo].[SensorsDigitalIn]
([SerialNumber]
,[SettingMode]
,[ScaleMultiplier]
,[LastModified]
,[LastModifiedBy]
,[eId]
,[UserValue1]
,[UserValue2]
,[UserValue3]
,[UserTags]
,[MeasurementUnit])
VALUES
(@SerialNumber
,@SettingMode
,@ScaleMultiplier
,@LastModified
,@LastModifiedBy
,isnull(@eId, space(0))
,@UserValue1
,@UserValue2
,@UserValue3
,@UserTags
,@MeasurementUnit)
set @new_id = scope_identity();
exec dbo.sp_SensorInsert @new_id, 1 /* see table dbo.SensorsType */
end
end
end

View File

@@ -0,0 +1,248 @@
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
,@NumberOfEvents int
,@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
,@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
,@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] = CASE WHEN
@ClockSyncProfileMaster='None' OR
@ClockSyncProfileMaster='Manual' OR
@ClockSyncProfileMaster='Slave_E2E' OR
@ClockSyncProfileMaster='Master_E2E' OR
@ClockSyncProfileMaster='Auto_E2E' OR
@ClockSyncProfileMaster='Master_E2E_IRIG' OR
@ClockSyncProfileMaster='Master_E2E_IRIG_EXT_PPS' OR
@ClockSyncProfileMaster='Master_E2E_GPS' OR
@ClockSyncProfileMaster='Master_E2E_GPS_EXT_PPS' OR
@ClockSyncProfileMaster='IRIG' OR
@ClockSyncProfileMaster='IRIG_EXT_PPS' OR
@ClockSyncProfileMaster='GPS' OR
@ClockSyncProfileMaster='GPS_EXT_PPS' OR
@ClockSyncProfileMaster='EXT_PPS'
THEN
@ClockSyncProfileMaster
ELSE
'None'
END
,[ClockSyncProfileSlave] = CASE WHEN
@ClockSyncProfileSlave='None' OR
@ClockSyncProfileSlave='Manual' OR
@ClockSyncProfileSlave='Slave_E2E' OR
@ClockSyncProfileSlave='Master_E2E' OR
@ClockSyncProfileSlave='Auto_E2E' OR
@ClockSyncProfileSlave='Master_E2E_IRIG' OR
@ClockSyncProfileSlave='Master_E2E_IRIG_EXT_PPS' OR
@ClockSyncProfileSlave='Master_E2E_GPS' OR
@ClockSyncProfileSlave='Master_E2E_GPS_EXT_PPS' OR
@ClockSyncProfileSlave='IRIG' OR
@ClockSyncProfileSlave='IRIG_EXT_PPS' OR
@ClockSyncProfileSlave='GPS' OR
@ClockSyncProfileSlave='GPS_EXT_PPS' OR
@ClockSyncProfileSlave='EXT_PPS'
THEN
@ClockSyncProfileSlave
ELSE
'None'
END
,[ExtraProperties] = @ExtraProperties
,[MeasureSquibResistancesStep] = @MeasureSquibResistancesStep
,[TestSetupUniqueId] = @TestSetupUniqueId
,[TestSetup] = @TestSetup
,[WakeupAndTriggerOn] = @WakeupAndTriggerOn
,[WakeupTrigger] = @WakeupTrigger
,[WakeUpMotionTimeout] = @WakeUpMotionTimeout
,[TimedIntervalFrequency] = @TimedIntervalFrequency
,[RTCScheduleStartDateTime] = @RTCScheduleStartDateTime
,[RTCScheduleDuration] = @RTCScheduleDuration
,[StartWithEvent] = @StartWithEvent
WHERE [TestSetupId] = @TestSetupId
end
end try
begin catch
set @errorMessage = error_message()
set @errorNumber = error_number()
end catch;
END