


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

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








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
       ('MCH-00', 'A', 'MCH-00', 4010, 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
       ('MCH-01', 'B', 'MCH-01', 4011, 1, 'R30', 1, 1, 1, 9, 'TOP', '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
        ('MCH-00_00', 'MCH-00', 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
        ('MCH-00_01', 'MCH-00', 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
        ('MCH-00_02', 'MCH-00', 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
        ('MCH-00_03', 'MCH-00', 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
        ('MCH-00_04', 'MCH-00', 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
        ('MCH-00_05', 'MCH-00', 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
        ('MCH-00_06', 'MCH-00', 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
        ('MCH-00_07', 'MCH-00', 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
        ('MCH-00_08', 'MCH-00', 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
        ('MCH-01_00', 'MCH-01', 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
        ('MCH-01_01', 'MCH-01', 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
        ('MCH-01_02', 'MCH-01', 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
        ('MCH-01_03', 'MCH-01', 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
        ('MCH-01_04', 'MCH-01', 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
        ('MCH-01_05', 'MCH-01', 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
        ('MCH-01_06', 'MCH-01', 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
        ('MCH-01_07', 'MCH-01', 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
        ('MCH-01_08', 'MCH-01', 136, 129, 512,
         1, 1, 0, 1, 2, 16, 4, 5.00, 3.50, 4.95, 40.00, 'test');








insert into SMT_DAQ_SVXE 
	(SVXE_SERIAL_NO, DESCRIPTION, ENABLE, EPICS_NAME, NSVXA, NSVXB, NSVXC, NSVXD, NSVXE, NSVXF, NSVXG, NSVXH)
	values
	('SVXE_MCH2_001', 'SVXE_MCH2_001', 1, 'MCH_SVXE_3021', 3, 3, 3, 3, 3, 3, 3, 3);
insert into SMT_DAQ_SVXE 
	(SVXE_SERIAL_NO, DESCRIPTION, ENABLE, EPICS_NAME, NSVXA, NSVXB, NSVXC, NSVXD, NSVXE, NSVXF, NSVXG, NSVXH)
	values
	('SVXE_MCH2_002', 'SVXE_MCH2_002', 1, 'MCH_SVXE_3022', 3, 3, 3, 3, 3, 3, 3, 3);
insert into SMT_DAQ_SVXE 
	(SVXE_SERIAL_NO, DESCRIPTION, ENABLE, EPICS_NAME, NSVXA, NSVXB, NSVXC, NSVXD, NSVXE, NSVXF, NSVXG, NSVXH)
	values
	('SVXE_MCH2_003', 'SVXE_MCH2_003', 1, 'MCH_SVXE_3023', 3, 3, 3, 3, 3, 3, 3, 3);



insert into SMT_INTERFACE_CRATE
       (CRATE_SERIAL_NO, CRATE_ID, DESCRIPTION, STATUS)
       values
       ('SMT_INTCR_MCH', 1, 'INTCR_MCH', 'test');
 

insert into SMT_DAQ_INTERFACE
       (INTERFACE_SERIAL_NO, INTERFACE_ID, DESCRIPTION, ENABLE, 
	CRATE_SERIAL_NO, LOCATOR,EPICS_NAME, STATUS)
       values
       ('INT_MCH_001', 1, 'INT_MCH_001', 1, 'SMT_INTCR_MCH', 1, 
	'MCH_IB_3008', 'test');




insert into SMT_DAQ_INTERFACE_CHANNEL
       (INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID, HDI_SERIAL_NO_A, 
	HDI_SERIAL_NO_B)
       values
       ('INT_MCH_001', 1, 'MCH-00', 'MCH-01');

insert into SMT_DAQ_INTERFACE_CHANNEL
       (INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID, HDI_SERIAL_NO_A, 
	HDI_SERIAL_NO_B)
       values
       ('INT_MCH_001', 2, 'B6-5-1', 'B6-6-12');

insert into SMT_DAQ_INTERFACE_CHANNEL
       (INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID, HDI_SERIAL_NO_A,
	 HDI_SERIAL_NO_B)
       values
       ('INT_MCH_001', 3, 'B6-2-1','B6-1-1');

insert into SMT_DAQ_INTERFACE_CHANNEL
       (INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('INT_MCH_001', 4);




insert into SMT_SEQ_CRATE
       (CRATE_SERIAL_NO, CRATE_ID, DESCRIPTION, STATUS)
       values
       ('SMT_SEQCR_MCH2', 1, 'SEQCR_MCH2', 'test');


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_MCH_001', 'MCH_001', 1, 'SMT_SEQCR_MCH2', 1, 'MCH_SEQ_3004', 40, 64, 64, 'test');

insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_001', 1, 'INT_MCH_001', 1);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_001', 2, 'INT_MCH_001', 2);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_001', 3, 'INT_MCH_001', 3);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_001', 4, 'INT_MCH_001', 4);

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_MCH_002', 'MCH_002', 1, 'SMT_SEQCR_MCH2', 1, 'MCH_SEQ_3007', 40, 65, 65, 'test');

insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_002', 1, 'INT_NW_1A02', 1);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_002', 2, 'INT_NW_1A02', 2);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_002', 3, 'INT_NW_1A02', 3);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_002', 4, 'INT_NW_1A02', 4);

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_MCH_003', 'MCH_003', 1, 'SMT_SEQCR_MCH2', 1, 'MCH_SEQ_3009', 40, 66, 66, 'test');

insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_003', 1, 'INT_NW_1A02', 1);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_003', 2, 'INT_NW_1A02', 2);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_003', 3, 'INT_NW_1A02', 3);
insert into SMT_DAQ_SEQ_CHANNEL
       (SEQ_SERIAL_NO, SEQ_CHANNEL_ID, INTERFACE_SERIAL_NO, INTERFACE_CHANNEL_ID)
       values
       ('SEQ_MCH_003', 4, 'INT_NW_1A02', 4);


insert into SMT_DAQ_SEQC
        (SEQC_SERIAL_NO, DESCRIPTION, CRATE_SERIAL_NO, EPICS_NAME, UPPER)
        values
        ('SEQC_MCH2', 'SEQC-MCH2', 'SMT_SEQCR_MCH2', 'MCH_SEQC_3001', 1);
 


update SMT_DAQ_VRB_CHANNEL set SEQ_SERIAL_NO='SEQ_MCH_001' where VRB_SERIAL_NO='VRB_6209';
update SMT_DAQ_VRB_CHANNEL set SEQ_CHANNEL_ID=4 where VRB_SERIAL_NO='VRB_6209' and VRB_CHANNEL_ID=4;


