home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / VPR_DATA / DOGA / SOURCES / PASM.LZH / FXG.CPP < prev    next >
C/C++ Source or Header  |  1996-06-19  |  4KB  |  144 lines

  1. #include <owl\owlpch.h>
  2. #pragma hdrstop
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <dos.h>
  6. #include <cstring.h>
  7. #include <dir.h>
  8. #include "matrix.h"
  9. #include "suflib.h"
  10. #include "parts.h"
  11. #include "profile.h"
  12. #include "files.h"
  13.  
  14. #include "log.h"
  15.  
  16. static char *indfile = "_temp1.ind";
  17. //static char *indfile2 = "_temp2.ind";
  18. //static char *agcfile = "_temp.agc";
  19. static char *frmfile = "_temp.frm";
  20. //static char *sclfile = "Scale.Dat";
  21. static char *cSufView = "_aview.bat";
  22. static char *cSuf2Agc = "suf2agc.exe";
  23. //static char *cAgcView = "agcvexec.exe";
  24. static char *cExec = "exec_bin.exe";
  25. static char *cview = "agcview.bin";
  26.  
  27.  
  28. void FXG_Show(Parts *parts)
  29. {
  30.     char str[256];
  31.     FILE *fp;
  32.     static int first = FALSE;
  33.  
  34.     sprintf(str, "%s%s", fxgdir.c_str(), indfile);
  35.     if ((fp = fopen(str, "w")) == NULL) {
  36.         return;
  37.     }
  38.     sprintf(str, "%s%s", fxgdir.c_str(), frmfile);
  39.     parts->FileWrite(NULL, str, NULL);
  40.  
  41.     fprintf(fp, "-fxga-pa\n");
  42.     fprintf(fp, "%s\n", fxg_atrfile.c_str());
  43.     fprintf(fp, "%s%s\n", fxgdir.c_str(), frmfile);
  44.     for (Parts *p = parts; p != NULL; p = p->next) {
  45.         for (Parts *op = parts; op != p && op != NULL; op = op->next) {
  46.             if (op->object == p->object) {
  47.                 break;
  48.             }
  49.         }
  50.         if (op == p || op == NULL) {
  51.             char *f = p->object->filename;
  52.             if (strncmpi(f, partsdir.c_str(), partsdir.length()) == 0) {
  53.                 fprintf(fp, "%s%s\n", simplepartsdir.c_str(), f+partsdir.length());
  54.             } else if (f[1] == ':' || f[0] == '\\') {
  55.                 fprintf(fp, "%s\n", f);
  56.             } else {
  57.                 fprintf(fp, "%s%s\n", simplepartsdir.c_str(), f);
  58.             }
  59.         }
  60.     }
  61.     fclose(fp);
  62.  
  63.     sprintf(str, "%s%s", fxgdir.c_str(), cSufView);
  64.     if ((fp = fopen(str, "w")) == NULL) {
  65.         return;
  66.     }
  67.     if (first == FALSE) {
  68.         fprintf(fp, "%s%s %s%s 8000 8100\n", fxgdir.c_str(), cExec, fxgdir.c_str(), cview);
  69.         first = TRUE;
  70.     }
  71.     fprintf(fp, "%s%s @%s%s\n",
  72.                  fxgdir.c_str(), cSuf2Agc,
  73.                  fxgdir.c_str(), indfile);
  74.     fclose(fp);
  75.     WinExec(str, SW_SHOWMINIMIZED);
  76. }
  77.  
  78.  
  79. #if 0
  80. void FXG_Show(Parts *parts)
  81. {
  82.     char str[256];
  83.     FILE *fp;
  84.     static int first = FALSE;
  85.  
  86.     sprintf(str, "%s%s", fxgdir.c_str(), indfile);
  87.     if ((fp = fopen(str, "w")) == NULL) {
  88.         return;
  89.     }
  90.     sprintf(str, "%s%s", fxgdir.c_str(), frmfile);
  91.     parts->FileWrite(NULL, str, NULL);
  92.  
  93.     fprintf(fp, "%s\n", fxg_atrfile.c_str());
  94.     fprintf(fp, "%s%s\n", fxgdir.c_str(), frmfile);
  95.     for (Parts *p = parts; p != NULL; p = p->next) {
  96.         for (Parts *op = parts; op != p && op != NULL; op = op->next) {
  97.             if (op->object == p->object) {
  98.                 break;
  99.             }
  100.         }
  101.         if (op == p || op == NULL) {
  102.             char *f = p->object->filename;
  103.             if (f[1] == ':' || f[0] == '\\') {
  104.                 fprintf(fp, "%s\n", f);
  105.             } else {
  106.                 fprintf(fp, "%s%s\n", simplepartsdir.c_str(), f);
  107.             }
  108.         }
  109.     }
  110.     fprintf(fp, "-z%s%s\n", fxgdir.c_str(), sclfile);
  111.     fprintf(fp, "-o%s%s\n", fxgdir.c_str(), agcfile);
  112.     fclose(fp);
  113.  
  114.     sprintf(str, "%s%s", fxgdir.c_str(), indfile2);
  115.     if ((fp = fopen(str, "w")) == NULL) {
  116.         return;
  117.     }
  118.     fprintf(fp, "-z%s%s\n", fxgdir.c_str(), sclfile);
  119.     fprintf(fp, "%s%s\n", fxgdir.c_str(), agcfile);
  120.     fprintf(fp, "%s\n", fxg_colfile.c_str());
  121.     sprintf(str, "%s%s", fxgdir.c_str(), cSufView);
  122.     fclose(fp);
  123.     if ((fp = fopen(str, "w")) == NULL) {
  124.         return;
  125.     }
  126.     if (first == FALSE) {
  127.         fprintf(str, "%s%s %s%s\n", fxgdir.c_str(), cExec, fxgdir.c_str(), cview);
  128.         first = TRUE;
  129.     }
  130.     fprintf(fp, "%s%s @%s%s\n",
  131.                  fxgdir.c_str(), cSuf2Agc,
  132.                  fxgdir.c_str(), indfile);
  133.     fprintf(fp, "%s%s @%s%s\n",
  134.                  fxgdir.c_str(), cAgcView,
  135.                  fxgdir.c_str(), indfile2);
  136.     fclose(fp);
  137.     WinExec(str, SW_SHOWMINIMIZED);
  138. }
  139. #endif
  140.  
  141.  
  142.  
  143.  
  144.