version 1.6, 1999/11/10 21:25:48 |
version 1.10, 2000/04/02 19:24:40 |
|
|
/** |
/** |
* $OpenXM: OpenXM/src/OpenMath/PolyCalc.java,v 1.5 1999/11/02 15:58:11 tam Exp $ |
* $OpenXM: OpenXM/src/OpenMath/PolyCalc.java,v 1.9 2000/03/16 12:28:42 tam Exp $ |
*/ |
*/ |
|
|
import JP.ac.kobe_u.math.tam.OpenXM.*; |
import JP.ac.kobe_u.math.tam.OpenXM.*; |
Line 119 class PolyCalc extends Applet implements ActionListene |
|
Line 119 class PolyCalc extends Applet implements ActionListene |
|
public void run(){ // for debug |
public void run(){ // for debug |
try{ |
try{ |
while(true){ |
while(true){ |
CMO tmp; |
OXmessage tmp = oxm.receive(); |
|
|
|
textarea.append("=> "+ tmp +"\n"); |
Thread.yield(); |
Thread.yield(); |
|
|
switch(oxm.receiveOXtag()){ |
|
case OpenXM.OX_COMMAND: |
|
oxm.receiveSM(); |
|
break; |
|
|
|
case OpenXM.OX_DATA: |
|
tmp = oxm.receiveCMO(); |
|
textarea.append("=> "+ tmp +"\n"); |
|
break; |
|
} |
|
} |
} |
}catch(java.io.IOException e){} |
}catch(java.io.IOException e){} |
} |
} |
Line 146 class PolyCalc extends Applet implements ActionListene |
|
Line 136 class PolyCalc extends Applet implements ActionListene |
|
}else if(arg.equals("grobner base")){ |
}else if(arg.equals("grobner base")){ |
try{ |
try{ |
debug("poly A: "+ poly1.getText()); |
debug("poly A: "+ poly1.getText()); |
oxm.sendCMO(new CMO_STRING("[[("+ poly1.getText() +") ("+ poly2.getText() +")] (x,y)] gb")); |
oxm.send(new CMO_STRING("[[("+ poly1.getText() +") ("+ poly2.getText() +")] (x,y)] gb")); |
oxm.sendSM(new SM(SM.SM_executeStringByLocalParser)); |
oxm.send(new SM(SM.SM_executeStringByLocalParser)); |
oxm.sendSM(new SM(SM.SM_popString)); |
oxm.send(new SM(SM.SM_popString)); |
}catch(java.io.IOException e){} |
}catch(java.io.IOException e){ |
|
}catch(MathcapViolation e){ |
|
} |
} |
} |
/* |
/* |
if ("first".equals(arg)) { |
if ("first".equals(arg)) { |
Line 171 class PolyCalc extends Applet implements ActionListene |
|
Line 163 class PolyCalc extends Applet implements ActionListene |
|
+"("+ ControlPort +","+ DataPort +")\n"); |
+"("+ ControlPort +","+ DataPort +")\n"); |
|
|
try{ |
try{ |
|
/* |
|
Runtime r = Runtime.getRuntime(); |
|
|
|
r.exec("ox -ox ox_sm1"); |
|
*/ |
oxm = new OpenXM(host,ControlPort,DataPort); |
oxm = new OpenXM(host,ControlPort,DataPort); |
textarea.append("Connected.\n"); |
textarea.append("Connected.\n"); |
oxm.sendCMO(new CMO_STRING("(cohom.sm1) run ;\n")); |
oxm.send(new CMO_STRING("(cohom.sm1) run ;\n")); |
oxm.sendSM(new SM(SM.SM_executeStringByLocalParser)); |
oxm.send(new SM(SM.SM_executeStringByLocalParser)); |
|
|
thread = new Thread(this); |
thread = new Thread(this); |
thread.start(); |
thread.start(); |
}catch(java.io.IOException e){ |
}catch(java.io.IOException e){ |
textarea.append("failed.\n"); |
textarea.append("failed.\n"); |
stop(); |
stop(); |
|
}catch(MathcapViolation e){ |
} |
} |
} |
} |
|
|