There are 3 tmcdb-related utilities in this module:

1) AntennaCloner, which clones antennas

Example usage: 

acsStartJava -noDirectory alma.obops.tmcdb.cloning.AntennaCloner DV03 DV01,DV04,DV05,DV06,DV07,DV08,DV09,DV14,DV15,DV16,DV17,DV18,DV19,DV20,DV21,DV22,DV23,DV24 
acsStartJava -noDirectory alma.obops.tmcdb.cloning.AntennaCloner CM01 CM02,CM03,CM04,CM05,CM06,CM07,CM08,CM09,CM10,CM11,CM12
acsStartJava -noDirectory alma.obops.tmcdb.cloning.AntennaCloner PM01 PM02
acsStartJava -noDirectory alma.obops.tmcdb.cloning.AntennaCloner DA41 DA42,DA43,DA44,DA45,DA46,DA47,DA48,DA49,DA50,DA51,DA52,DA53,DA54,DA55,DA56,DA57,DA58,DA59,DA60,DA61,DA62,DA63,DA64,DA65

2) PadImporter, which imports pads into a configuration

Example usage:

acsStartJava -noDirectory -DACS.logstdout=6 alma.obops.tmcdb.padimport.PadImporter <configuration_name> <pad_data_xml_file>

where:

	<configuration_name> is the name of the configuration in which you wish to import the pads
	<pad_data_xml_file> is an xml file defining the pads. This file must adhere to the schema config/Pads.xsd found in this module

Running this utility does the following:

If a pad specified in the XML file does *not* exist in the specified configuration, it will be created.
If a pad specified in the XML file *already exists* in the specified configuration, it will be updated.

3) TmcdbDiff, which compares 2 configurations (directly in the database _not_ using exported XML files!) for differences

Example usage:

acsStartJava -maxHeapSize 2g -noDirectory -DACS.logstdout=6 alma.obops.tmcdb.diff.TmcdbDiff <name-of-config1> <name-of-config2> [-swOnly?]

Running this utility will compare the 2 configurations for differences. It is a fairly long-running process. After it finishes, it will print (to stdout) a list of the differences found.

NOTE: if you wish to compare only the sw side, you can add the -swOnly flag

DISCLAIMER AND KNOWN BUGS: this tool is currently experimental; it has the following known quirks/limitations:

	* in some cases, diffing config-A against config-B may detect differences but not report _all_ of the details; for example
	  in collections, it may state that there are a different number of <X> (where X is containers, components, baseelements, 
	  or anything else in a collection) in the two configs, but it may not always state _what_ is missing. This is because
	  the tool is using a single pass and comparing A's collection(s) against B's collection(s). If A has an item that is 
	  missing in B, it will be noted clearly; whereas if B's collection(s) have an item that is missing in A, the details 
 	  may not be denoted (it may only say that the two collections have a different number of entries). We may refine the tool
	  to make a single pass do both of these (A->B and B->A), but a simple workaround - if necessary - is to run the tool 
	  twice: 1) compare A, B; and then, 2) compare B, A.

	* it's possible I've missed some things in the diff; there are 87(!!) database tables with many, many inter-relationships.
	  if you diff two configurations that are _known_ to have a difference, and the tool doesn't report a difference, please
	  open a Jira ticket or contact me (Steve).


4) SQL query to obtain PAD DATA. Notice that SWCONFIGURATIONID could change. Save the data in csv file and use parseTMC.py to obtain a xml for padimport
et linesize 200
%SELECT CONFIGURATIONID FROM CONFIGURATION WHERE CONFIGURATIONNAME='CURRENT.AOS';
%SELECT CONFIGURATIONID FROM HWCONFIGURATION WHERE SWCONFIGURATIONID = 1349;

SELECT b.baseelementname, round(p.xposition,2), round(p.yposition,2), round(p.zposition,2) FROM pad p, baseelement b WHERE p.baseelementid in (SELECT baseelementid FROM baseelement WHERE configurationid=1110 AND basetype='Pad') AND b.baseelementid = p.baseelementid;


