version 1.24, 2013/12/20 02:27:17 |
version 1.27, 2015/08/06 10:01:53 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/plot/ox_plot.c,v 1.23 2013/12/19 05:48:24 saito Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/plot/ox_plot.c,v 1.26 2014/06/27 07:58:29 saito Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 96 static void asir_do_cmd(unsigned int,unsigned int); |
|
Line 96 static void asir_do_cmd(unsigned int,unsigned int); |
|
static void process_ox(); |
static void process_ox(); |
static void asir_executeFunction(); |
static void asir_executeFunction(); |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
void ox_plot_main() |
void ox_plot_main() |
#else |
#else |
void ox_plot_main(int argc,char **argv) |
void ox_plot_main(int argc,char **argv) |
Line 107 void ox_plot_main(int argc,char **argv) |
|
Line 107 void ox_plot_main(int argc,char **argv) |
|
int n; |
int n; |
int use_x; |
int use_x; |
|
|
#if !defined(VISUAL) |
#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) |
ox_asir_init(argc,argv,"ox_plot"); |
ox_asir_init(argc,argv,"ox_plot"); |
use_x=init_plot_display(argc,argv); |
use_x=init_plot_display(argc,argv); |
if(use_x) ds=ConnectionNumber(display); |
if(use_x) ds=ConnectionNumber(display); |
Line 121 void ox_plot_main(int argc,char **argv) |
|
Line 121 void ox_plot_main(int argc,char **argv) |
|
ox_send_sync(0); |
ox_send_sync(0); |
} |
} |
while (1){ |
while (1){ |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
process_ox(); |
process_ox(); |
#else |
#else |
if(ox_data_is_available(0)) process_ox(); |
if(ox_data_is_available(0)) process_ox(); |
Line 151 static void process_ox(){ |
|
Line 151 static void process_ox(){ |
|
cmd=((USINT)obj)->body; |
cmd=((USINT)obj)->body; |
if(ox_flushing) break; |
if(ox_flushing) break; |
if(do_message) fprintf(stderr," %s\n",name_of_cmd(cmd)); |
if(do_message) fprintf(stderr," %s\n",name_of_cmd(cmd)); |
if(ret=SETJMP(main_env)){ |
ret=SETJMP(main_env); |
|
if(ret){ |
if(ret==1){ |
if(ret==1){ |
create_error(&err,serial,LastError,0); |
create_error(&err,serial,LastError,0); |
asir_push_one((Obj)err); |
asir_push_one((Obj)err); |
Line 231 static void asir_do_cmd(unsigned int cmd,unsigned int |
|
Line 232 static void asir_do_cmd(unsigned int cmd,unsigned int |
|
} |
} |
} |
} |
|
|
static void asir_executeFunction(int serial){ |
static void asir_executeFunction(int serial){ |
char *fn; |
char *fn; |
int argc,id; |
int argc,id,fno; |
FUNC f; |
FUNC f; |
Q ret; |
Q ret; |
VL vl; |
VL vl; |
Line 249 static void asir_executeFunction(int serial){ |
|
Line 250 static void asir_executeFunction(int serial){ |
|
} |
} |
if(n)NEXT(n1)=0; |
if(n)NEXT(n1)=0; |
id=-1; |
id=-1; |
if(!strcmp(fn,"plot")){ |
fno=modeNO(fn); |
id=plot(n,MODE_PLOT); |
switch (fno){ |
|
case 0://IFPLOT |
|
id=plot(n,fno); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"ifplot")){ |
break; |
id=plot(n,MODE_IFPLOT); |
case 1://CONPLOT |
|
id=plot(n,fno); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"conplot")){ |
break; |
id=plot(n,MODE_CONPLOT); |
case 2://PLOT |
|
id=plot(n,fno); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"polarplot")){ |
break; |
id=plot(n,MODE_POLARPLOT); |
case 4://POLARPLOT |
|
id=plot(n,fno); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"memory_plot")){ |
break; |
|
case 30://MEMORY_PLOT |
memory_plot(n,&bytes); |
memory_plot(n,&bytes); |
asir_push_one((Obj)bytes); |
asir_push_one((Obj)bytes); |
} else if(!strcmp(fn,"arrayplot")){ |
break; |
|
case 31://ARRAYPLOT |
id=arrayplot(n); |
id=arrayplot(n); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"open_canvas")){ |
break; |
|
case 32://OPEN_CANVAS |
id=open_canvas(n); |
id=open_canvas(n); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"plotover")){ |
break; |
|
case 5://PLOTOVER |
plotover(n); |
plotover(n); |
} else if(!strcmp(fn,"drawcircle")){ |
break; |
|
case 33://DRAWCIRCLE |
drawcircle(n); |
drawcircle(n); |
} else if(!strcmp(fn,"draw_obj")){ |
break; |
|
case 34://DRAW_OBJ |
if(draw_obj(n) < 0 ){ |
if(draw_obj(n) < 0 ){ |
create_error(&err,serial,LastError,0); |
create_error(&err,serial,LastError,0); |
asir_push_one((Obj)err); |
asir_push_one((Obj)err); |
} |
} |
} else if(!strcmp(fn,"draw_string")){ |
break; |
if(draw_string(n) < 0 ){ |
case 35://DRAW_STRING |
|
if(draw_string(n)<0){ |
create_error(&err,serial,LastError,0); |
create_error(&err,serial,LastError,0); |
asir_push_one((Obj)err); |
asir_push_one((Obj)err); |
} |
} |
} else if(!strcmp(fn,"clear_canvas")){ |
break; |
|
case 37://CLEAR_CANVAS |
clear_canvas(n); |
clear_canvas(n); |
#if defined(INTERVAL) |
break; |
// ifplotNG |
// ifplotNG |
} else if(!strcmp(fn,"objcp")){ |
case 36://OBJ_CP |
id=objcp(n); |
id=objcp(n); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!( |
break; |
strcmp(fn,"ifplotD")&strcmp(fn,"ifplotQ")&strcmp(fn,"ifplotB")& |
case 6://IFPLOTD |
strcmp(fn,"ineqnD")&strcmp(fn,"ineqnQ")&strcmp(fn,"ineqnB")& |
case 7://IFPLOTQ |
strcmp(fn,"conplotD")&strcmp(fn,"conplotQ")&strcmp(fn,"conplotB"))){ |
case 8://IFPLOTB |
id=ifplotNG(n,fn); |
case 9://INEQND |
|
case 10://INEQNQ |
|
case 11://INEQNB |
|
case 21://CONPLOTD |
|
case 22://CONPLOTQ |
|
case 23://CONPLOTB |
|
#if defined(INTERVAL) |
|
case 24://ITVIFPLOT |
|
#endif |
|
id=ifplotNG(n,fno); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!( |
break; |
strcmp(fn,"ineqnandD")&strcmp(fn,"ineqnandQ")&strcmp(fn,"ineqnandB")& |
case 12://INEQNDAND |
strcmp(fn,"ineqnorD")&strcmp(fn,"ineqnorQ")&strcmp(fn,"ineqnorB")& |
case 13://INEQNQAND |
strcmp(fn,"ineqnxorD")&strcmp(fn,"ineqnxorQ")&strcmp(fn,"ineqnxorB")& |
case 14://INEQNBAND |
strcmp(fn,"plotoverD")&strcmp(fn,"plotoverQ")&strcmp(fn,"plotoverB"))){ |
case 15://INEQNDOR |
id=ifplotOP(n,fn); |
case 16://INEQNQOR |
|
case 17://INEQNBOR |
|
case 18://INEQNDXOR |
|
case 19://INEQNQXOR |
|
case 20://INEQNBXOR |
|
case 25://PLOTOVERD |
|
case 26://PLOTOVERQ |
|
case 27://PLOTOVERB |
|
id=ifplotOP(n,fno); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
} else if(!strcmp(fn,"itvifplot")){ |
break; |
id=ifplotNG(n,fn); |
case 38://POLARPLOTD |
|
id=polarplotNG(n); |
STOQ(id,ret); |
STOQ(id,ret); |
asir_push_one((Obj)ret); |
asir_push_one((Obj)ret); |
#endif |
break; |
} |
} |
} |
} |