1 2 package SOFA.SOFAnode.Made.Tools; 3 import java.io.File ; 4 5 import SOFA.SOFAnode.Run.SpecFile; 6 7 11 public class CallConGen { 12 13 14 22 public static void main(String [] argv) { 23 if (argv.length < 1) { 24 System.out.println("too few arguments"); 25 System.exit(1); 26 } 27 28 String trDir = System.getProperty("sofa.tr.dir", null); 29 if (trDir == null) { 30 System.out.println("Specify TR directrory (java property \"sofa.tr.dir\")"); 31 System.exit(1); 32 } 33 34 SpecFile specFile = null; 35 try { 36 specFile = SpecFile.getSpecFileFromFile(argv[0]); 37 } catch (java.io.IOException e) { 38 System.out.println("IOException: "+e.getMessage()); 39 System.exit(1); 40 } catch (javax.xml.parsers.ParserConfigurationException e) { 41 System.out.println("ParserConfigurationException: "+e.getMessage() ); 42 System.exit(1); 43 } catch (org.xml.sax.SAXException e) { 44 System.out.println("SAXException: "+e.getMessage() ); 45 System.exit(1); 46 } 47 48 String arch = specFile.getFullArchName(); 49 arch = arch.substring(0, arch.indexOf('?')); 50 String version = specFile.getImplVersion(); 51 String sdir = trDir+File.separator+"impl"+File.separator+InstallToTR.fullNameToFileName(arch)+File.separator+version+File.separator; 52 String inArgv[] = new String [2]; 54 inArgv[0] = sdir + "run.dc"; 55 inArgv[1] = sdir + "run.dd"; 56 57 try { 58 SOFA.Connector.ECG.test.main(inArgv); 59 } catch (Exception e) { 60 e.printStackTrace(); 61 System.exit(1); 62 } 63 64 } 65 } 66 | Popular Tags |