You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
5.5 KiB

3 years ago
  1. var noAppletOnClicked = 1;
  2. var appletMsg = "";
  3. var waitWin;
  4. var oldIn = oldOut = oldGbl = oldIsp = oldVcc = oldGnd = oldProhibit = oldUnuse = oldNc = 1;
  5. var oldInfo = oldWarn = oldError = 1;
  6. var verbose = 0;
  7. var dispPage, mapLogPage, mapInPage, unLogPage, unInPage;
  8. var javaPermission = 0;
  9. var abelEqn = vhdlEqn = verEqn = "";
  10. function IsNS() {
  11. return ((navigator.appName.indexOf("Netscape") >= 0) &&
  12. (parseFloat(navigator.appVersion) >= 4)) ? true : false;
  13. }
  14. function openWait() {
  15. waitWin = window.open("wait.htm", "wait",
  16. "toolbar=no,location=no,"+
  17. "directories=no,status=no,menubar=no,scrollbars=no,"+
  18. "resizable=no,width=300,height=50" );
  19. }
  20. function closeWait() { if (waitWin) waitWin.close(); }
  21. function popHTML(name, str) {
  22. document.options.htmlStr.value = str;
  23. if (name.indexOf(":") > -1)
  24. name = name.substring(0,name.indexOf(":")) + "_COLON_" +
  25. name.substring(name.indexOf(":")+1,name.length);
  26. if (name.indexOf(".") > -1)
  27. name = name.substring(0,name.indexOf(".")) + "_DOT_" +
  28. name.substring(name.indexOf(".")+1,name.length);
  29. var win = window.open("result.htm", "win_"+name,
  30. "toolbar=no,location=no,"+
  31. "directories=no,status=no,menubar=no,scrollbars=yes,"+
  32. "resizable=yes,width=300,height=200" );
  33. win.focus();
  34. }
  35. function setAppletPermission() { appletPermission = 1; }
  36. function getAppletPermission() { return( appletPermission); }
  37. function getAppletMsg() { return(appletMsg); }
  38. function setAppletMsg(msg) { appletMsg = msg; }
  39. function showHTML(page, html) {
  40. dispPage = html;
  41. document.options.currPage.value = page;
  42. parent.content.location.href = html;
  43. }
  44. function showTop() { showHTML(document.options.currPage.value, dispPage); }
  45. function setVerbose(value) { verbose = value; }
  46. function showLegend(url, w, h) {
  47. if (verbose == 1) {
  48. url = url.substring(0,name.indexOf(".htm")) + "V.htm";
  49. }
  50. var win = window.open(url, 'win',
  51. 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h);
  52. win.focus();
  53. }
  54. function showSummary() { showHTML("summary", "summary.htm"); }
  55. function showOptions() { showHTML("options", "options.htm"); }
  56. function showFBSum() { showHTML("fbs", "fbs.htm"); }
  57. function showFB(fb) { showHTML("fbs_FB", "fbs_"+fb+".htm"); }
  58. function showPinOut() { showHTML("pins", "pins.htm"); }
  59. function showError() { showHTML("errors", "errs.htm"); }
  60. function showFailTable() { showHTML("failtable", "failtable.htm"); }
  61. function showEqnAll() {
  62. openWait();
  63. parent.eqns.setOper(currEqnType);
  64. if (currEqnType == defEqnType) showHTML("equations", "defeqns.htm");
  65. else if (currEqnType == 0) {
  66. if (abelEqn == "") abelEqn = parent.eqns.getEqnList();
  67. document.options.htmlStr.value = abelEqn;
  68. showHTML("equations", "equations.htm");
  69. }
  70. else if (currEqnType == 1) {
  71. if (vhdlEqn == "") vhdlEqn = parent.eqns.getEqnList();
  72. document.options.htmlStr.value = vhdlEqn;
  73. showHTML("equations", "equations.htm");
  74. }
  75. else {
  76. if (verEqn == "") verEqn = parent.eqns.getEqnList();
  77. document.options.htmlStr.value = verEqn;
  78. showHTML("equations", "equations.htm");
  79. }
  80. closeWait();
  81. }
  82. function showEqn(sig) {
  83. popHTML(sig, parent.eqns.getEqn(sig));
  84. }
  85. function showPterm(pterm, type) {
  86. popHTML(pterm, parent.eqns.getPterm(pterm, type));
  87. }
  88. function showAscii() { showHTML("ascii", "ascii.htm"); }
  89. function showHelp() {
  90. var helpDoc = document.options.currPage.value + "doc.htm";
  91. popWin(helpDoc);
  92. }
  93. function getMapParam(type) {
  94. var paramStr = "";
  95. switch(type) {
  96. case 1: paramStr += "10"; break;
  97. case 2: paramStr += "01"; break;
  98. case 3: paramStr += "11"; break;
  99. case 4: paramStr += "02"; break;
  100. case 5: paramStr += "12"; break;
  101. default: paramStr += "00";
  102. }
  103. return paramStr;
  104. }
  105. function showMappedLogics(type) {
  106. showHTML("maplogic", "maplogic_" + getMapParam(type) + ".htm");
  107. }
  108. function showMappedInputs(type) {
  109. showHTML("mapinput", "mapinput_" + getMapParam(type) + ".htm");
  110. }
  111. function showUnMappedLogics(type) {
  112. showHTML("unmaplogic", "unmaplogic_" + getMapParam(type) + ".htm");
  113. }
  114. function showLogicLeft() { showHTML("logicleft", "logicleft.htm"); }
  115. function showUnMappedInputs(type) {
  116. showHTML("unmapinput", "unmapinput_" + getMapParam(type) + ".htm");
  117. }
  118. function showInputLeft() { showHTML("inputleft", "inputleft.htm"); }
  119. function doEqnFormat() {
  120. var type = document.options.eqnType.options[document.options.eqnType.options.selectedIndex].value;
  121. currEqnType = type;
  122. parent.eqns.setOper(currEqnType);
  123. if (document.options.currPage.value == "equations") showEqnAll();
  124. }
  125. function showNoAppletAlert() {
  126. window.alert("No Applet supported for this session!!!");
  127. }
  128. function showAppletMC(mc) {
  129. if (parent.applets) parent.applets.showAppletGraphicMC(mc);
  130. else showNoAppletAlert();
  131. }
  132. function showAppletFB(fb) {
  133. if (parent.applets) parent.applets.showAppletGraphicFB(fb);
  134. else showNoAppletAlert();
  135. }
  136. function showAppletPin(pin) {
  137. if (parent.applets) parent.applets.showAppletGraphicPin(pin);
  138. else showNoAppletAlert();
  139. }
  140. function printAppletPkg() {
  141. if (parent.applets) parent.applets.printAppletPkg();
  142. else showNoAppletAlert();
  143. }
  144. function popWin(url) {
  145. var win = window.open(url, 'win',
  146. 'location=yes,directories=yes,menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=800,height=600');
  147. win.focus();
  148. }