
--   Add a configuration to the 10% test stand hardware
--   ***********************************************************************************
--
--   Oracle PL/SQL Script For Testing of D0 SMT Online Database
--
--   This Script Inserts Testing Values into D0 SMT Online Database
--
--   To Run This Script, Login Your Oracle Account. Assume This Script
--   (SMT_OnlineDB_Test.sql) Is Located Under D:\fanxl\oracle\, Type:
--
--          @D:\fanxl\oracle\SMT_OnlineDB_Test.sql
--
--   Author: Xiaoling Fan
--   Institution: Northwestern University
--
--   Creation Date: Jan 4, 2000
--
--   Modified: Harald Fox,  Mar 29, 2000
--   ************************************************************************************



--   -----------------------------------------------------------------------------------
--
--   Part 1, SMT Crate Configuration
--
--   -----------------------------------------------------------------------------------

-- table SMT_VRB_CRATE

insert into SMT_VRB_CRATE
       (CRATE_SERIAL_NO, CRATE_ID, DESCRIPTION, EPICS_NAME, CONTROLLER_NAME, CONTROLLER_TYPE,
        HOST_NAME, STATUS)
       values
       ('SMT-VRBCR-40', 40, 'VRB_CRATE-1PER', 'D0OLCTL41', 'd0olctl41', 'mv2300', 'sdfsg7', 'test');

-- table SMT_SEQ_CRATE

insert into SMT_SEQ_CRATE
       (CRATE_SERIAL_NO, CRATE_ID, DESCRIPTION, STATUS)
       values
       ('SEQCR-40', 40, 'SEQ_CRATE-01PER', 'test');

-- table SMT_INT_CRATE

insert into SMT_INTERFACE_CRATE
       (CRATE_SERIAL_NO, CRATE_ID, DESCRIPTION, STATUS)
       values
       ('INTCR-40', 40, 'INT_CRATE-01PER', 'test');




--   -----------------------------------------------------------------------------------
--
--   Part 2, SMT SVX chips
--
--   -----------------------------------------------------------------------------------


-- table SMT_SVX_CHIP

insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_00');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_01');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_02');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_03');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_04');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_05');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_06');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_07');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-57_08');

insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_00');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_01');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_02');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_03');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_04');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_05');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_06');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_07');
insert into SMT_SVX_CHIP (SVX_SERIAL_NO) values ('3954-83_08');




--   -----------------------------------------------------------------------------------
--
--   Part 3, SMT Detector Configuration Database Testing
--
--   -----------------------------------------------------------------------------------


insert into SMT_DAQ_VRBC
       (VRBC_SERIAL_NO, VRBC_ID, DESCRIPTION, CRATE_SERIAL_NO, LOCATOR, EPICS_NAME, STATUS)
       values
       ('VRBC-40', 40, 'VRBC-01PER', 'SMT-VRBCR-40', 14, 'SMT_VRBC_4014', 'test');

-- table SMT_DAQ_SEQC

-- insert into SMT_DAQ_SEQC
-- 	  (SEQC_SERIAL_NO, SEQC_ID, DESCRIPTION, CRATE_SERIAL_NO, LOCATOR, EPICS_NAME, STATUS)
-- 	  values
-- 	  ('SEQC-40', 40, 'SEQC-01PER', 'SEQCR-40', 1, 'SMT_SEQC_4001', 'test');


-- table SMT_DAQ_VBD

insert into SMT_DAQ_VBD
       (VBD_SERIAL_NO, VBD_ID, DESCRIPTION, CRATE_SERIAL_NO, LOCATOR, EPICS_NAME, STATUS)
       values
       ('VBD-40', 40, 'VBD-01PER', 'SMT-VRBCR-40', 4, 'SMT_VBD_4004', 'test');



-- table SMT_DAQ_HDI

insert into SMT_DAQ_HDI
       (HDI_SERIAL_NO, LOCATOR, DESCRIPTION, CAL_ID, ENABLE,
        HDI_TYPE, BARREL$SECTOR, LAYER$DISK, LADDER$WEDGE, NUMBER_OF_SVX_CHIP, 
        HDI_VIEW, STATUS)
       values
       ('3954-83', 'A', 'HDI-1PER-83 A', 4000, 1, 'R30', 1, 1, 1, 9, 'TOP', 'test');


insert into SMT_DAQ_HDI
       (HDI_SERIAL_NO, LOCATOR, DESCRIPTION, CAL_ID, ENABLE,
        HDI_TYPE, BARREL$SECTOR, LAYER$DISK, LADDER$WEDGE, NUMBER_OF_SVX_CHIP, 
        HDI_VIEW, STATUS)
       values
       ('3954-57', 'B', 'HDI-1PER-57 B', 4001, 1, 'R30', 1, 1, 1, 9, 'TOP', 'test');





-- table SMT_DAQ_INTERFACE

insert into SMT_DAQ_INTERFACE
       (INTERFACE_SERIAL_NO, INTERFACE_ID, DESCRIPTION, ENABLE, CRATE_SERIAL_NO, LOCATOR, 
        EPICS_NAME, STATUS)
       values
       ('INT-4001', 1, 'INTERFACE-01PER-4001', 1, 'INTCR-40', 1, 'SMT_INT_4001', 'test');



-- table SMT_DAQ_INTERFACE_CHANNEL


insert into SMT_DAQ_INTERFACE_CHANNEL
       (INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID, ENABLE, HDI_SERIAL_NO_A, HDI_SERIAL_NO_B)
       values
       ('INT-4001', 2, 1, '3954-83', '3954-57');



-- table SMT_DAQ_SEQ

insert into SMT_DAQ_SEQ
       (SEQ_SERIAL_NO, DESCRIPTION, ENABLE, CRATE_SERIAL_NO, LOCATOR,
	EPICS_NAME, CROSSING_WIDTH, SEQ_ID_1, SEQ_ID_2, STATUS)
        values
       ('SEQ-4004', 'SEQ-01PER-4004', 1, 'SEQCR-40', 9, 'SMT_SEQ_4004', 48, 40, 40, 'test');



-- table SMT_DAQ_SEQHALF

insert into SMT_DAQ_SEQHALF
       (SEQ_SERIAL_NO, SEQ_HALF, SEQ_ID, DESCRIPTION, HDI_MASK, POWER_CMD, STATUS)
        values
       ('SEQ-4004', 'A', 1, 'SEQ-01PER-4004 A', 3, 3, 'test');



-- table SMT_DAQ_SEQ_CHANNEL

insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ-4004', 1, 'INT-4001', 2);






-- table SMT_DAQ_VRB
 
insert into SMT_DAQ_VRB
       (VRB_SERIAL_NO, VRB_ID, DESCRIPTION, ENABLE, CRATE_SERIAL_NO, LOCATOR, EPICS_NAME, CHAN_ENABLE, PATTERN, STATUS)
       values
       ('VRB-4001', 1, 'VRB-01PER-4001', 1, 'SMT-VRBCR-40', 10, 'SMT_VRB_400A', 3, 0, 'test');





-- table SMT_DAQ_VRB_CHANNEL

insert into SMT_DAQ_VRB_CHANNEL
       (VRB_SERIAL_NO, VRB_CHANNEL_ID, SEQ_SERIAL_NO, SEQ_CHANNEL_ID)
        values
       ('VRB-4001', 1, 'SEQ-4004', 1);



-- table SMT_DAQ_SVX

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_00', '3954-57', 128, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_01', '3954-57', 129, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_02', '3954-57', 130, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_03', '3954-57', 131, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_04', '3954-57', 132, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_05', '3954-57', 133, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_06', '3954-57', 134, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_07', '3954-57', 135, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-57_08', '3954-57', 136, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');






insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_00', '3954-83', 128, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_01', '3954-83', 129, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_02', '3954-83', 130, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_03', '3954-83', 131, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_04', '3954-83', 132, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_05', '3954-83', 133, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_06', '3954-83', 134, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_07', '3954-83', 135, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');

insert into SMT_DAQ_SVX
       (SVX_SERIAL_NO, HDI_SERIAL_NO, SVX_ID, ADC_MAX, RAMP_TRIM, LAST_CHIP, 
        READ_NEIGHBOR, READ_ALL, POLARITY, PIPELINE, PREAMP_BAND, THRESHOLD, AVDD, 
	AVDD2, DVDD, V_DEPLETION, STATUS)
        values
        ('3954-83_08', '3954-83', 136, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');








                      
--   End of the Script
