Exemplo n.º 1
0
 public RedlineElement lookupRedlineElement(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   return penDataElemt.getRedlineElement();
 }
  public void transformBinary(PENDataElement penElement) throws Exception {

    String name = getCurrentItem();

    // get the current RemoteFile:
    // TODO: for now there is no reason why each element should have more than ONE RemoteFile in the
    // binary files list at any given point in time. If that becomes necesary, we need to have a way
    // to tell which of the RemoteFile objects we are looking for.
    int binCount = penElement.getSourceDataElement().getBinaryCollection().size();
    if (binCount == 0) {
      notificationSubject += " " + name;
      notificationMessage =
          "WARNING: "
              + "SourceDataElement for item "
              + name
              + " does not have a RemoteFile object. Cannot perform binary transformation!";
      logAndNotify();
      return;
    }
    if (binCount > 1) {
      notificationSubject += " " + name;
      notificationMessage =
          "WARNING: "
              + "SourceDataElement for item "
              + name
              + " has more than one RemoteFile object. Cannot perform binary transformation!";
      logAndNotify();
      return;
    }

    RemotePackage rf =
        (RemotePackage) penElement.getSourceDataElement().getBinaryCollection().get(0);
    String srcDesignFileName = rf.getName();

    if (!srcDesignFileName.endsWith(".asm") && !srcDesignFileName.endsWith(".prt")) {
      notificationSubject += " " + name;
      notificationMessage =
          "WARNING: " + "ProE-to-igs transformation is UNexpected for item " + name;
      logAndNotify();
      return;
    }

    String tgtDesignFileName = lookupLogicalName();
    if (null == tgtDesignFileName || "".equals(tgtDesignFileName.trim())) {
      tgtDesignFileName = srcDesignFileName;
      if (tgtDesignFileName.endsWith(".prt"))
        tgtDesignFileName = tgtDesignFileName.replace(".prt", ".igs");
      else if (tgtDesignFileName.endsWith(".asm"))
        tgtDesignFileName = tgtDesignFileName.replace(".asm", ".isg");
    }

    try {
      ChrysalisClient client = ChrysalisClient.materializeClient();
      RemotePackage xlation =
          client.translate(
              this.getQxCtx(),
              srcDesignFileName,
              null,
              rf,
              PROE_FORMAT_VALUE,
              IGES_FORMAT_VALUE,
              tgtDesignFileName);

      // put the RemoteFile of the translation into the Tx
      penElement.getTxDataElement().addBinaryFile(xlation);
    } catch (Exception e) {
      notificationSubject += " " + srcDesignFileName;
      notificationMessage = "WARNING: " + e.toString();
      logAndNotify();
    }
  }
Exemplo n.º 3
0
 public StatusElement lookupStatusElement(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   return penDataElemt.getStatusElement();
 }
Exemplo n.º 4
0
 public ECOElement lookupECOElement(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   return penDataElemt.getECOElement();
 }
Exemplo n.º 5
0
 public TargetDataElement lookupTargetDataElement(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   return penDataElemt.getTargetDataElement();
 }
Exemplo n.º 6
0
 public DocumentElement lookupDocumentElement(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   return penDataElemt.getDocumentElement();
 }
Exemplo n.º 7
0
 public Metadata lookupTargetMetadata(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   TargetDataElement targetElement = penDataElemt.getTargetDataElement();
   return targetElement.getTargetData();
 }
Exemplo n.º 8
0
 public Metadata lookupTxMetadata(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   TxDataElement txElement = penDataElemt.getTxDataElement();
   return txElement.getTxData();
 }
Exemplo n.º 9
0
 public Metadata lookupSrcMetadata(String name) {
   PENDataElement penDataElemt = (PENDataElement) getPenData().lookupPENDataElement(name);
   SourceDataElement srcElement = penDataElemt.getSourceDataElement();
   return srcElement.getSourceData();
 }