Index: mttroot/mtt/bin/trans/switch_txt2m ================================================================== --- mttroot/mtt/bin/trans/switch_txt2m +++ mttroot/mtt/bin/trans/switch_txt2m @@ -14,10 +14,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.14 2000/11/09 10:29:21 peterg +## open --> mtt_open +## ## Revision 1.13 2000/11/09 10:19:12 peterg ## Explicitly write out the open switches .... ## ## Revision 1.12 2000/11/09 09:52:07 peterg ## Removed [] from zero_state output @@ -98,18 +101,19 @@ for (i=1;i<=Nx;i++) printf("mttopen(%i) = 0; # Default to not open\n", i); } else{ printf("\n#== Switch: %s ==#\n",$1) - printf("if (%s_logic==0.0) \n", $1); - printf(" mttopen(%s) = 1;\n", $2); - printf("end;\n"); - printf("if (%s_logic<0.0)\n",$1); - printf(" if (%s<0.0)\n",$1); - printf(" mttopen(%s) = 1;\n", $2); - printf(" end;\n"); - printf("end;\n"); + printf("mttopen(%s) = (abs(%s_logic)<0.5)||((%s_logic<0.0)&&(%s<0.0));\n", $2, $1, $1, $1); +# printf("if (%s_logic==0.0) \n", $1); +# printf(" mttopen(%s) = 1;\n", $2); +# printf("end;\n"); +# printf("if (%s_logic<0.0)\n",$1); +# printf(" if (%s<0.0)\n",$1); +# printf(" mttopen(%s) = 1;\n", $2); +# printf(" end;\n"); +# printf("end;\n"); } }' Nx=$Nx < $1_switch.txt #>> $1_switchopen.m #echo Creating $1_switcha.m