zooey 发表于 2016-3-7 12:34:17

simtalk程序调试不出来,帮忙看一下

is
        mark:boolean;
        dx,dy,ct:real;
    i,j,rows,lines:integer;
    machinename,bufname:string;
    machine,buf:object;
do
        current.eraselayer(1);
       
        if number_of_machine/=w_from_to_chart.YDim or number_of_machine/=d_from_to_chart.YDim then
                inspect messagebox("设施数目不对!请核查...,",50,13)
                when 16 then
                        print"yes";
                when 32 then
                        print"no";
                else
                        print"cancel";
                end;
                eventcontroller.stop;
        end;
       
        for i:=1 to number_of_machine loop
        machinename:=sprint("M",i);
        if existsobject(machinename) then
                machine:=str_to_obj(machinename);
                machine.deleteobject;
        end;
        bufname:=sprint("BF",i);
        if existsobject(bufname) then
                buf:=str_to_obj(bufname);
                buf.deleteobject;
        end;
        next;
       
        dx:=0;
        dy:=0;
        for i:=1 to number_of_machine loop
                rows:=str_to_num(omit(machinesequence,1,1));
                --mark:=false;
                if (dx+activityspace)>activityspace类型不匹配
                then
                        /*if(dx+activityspace)<activityspace
                        and activityspace<(1.05*y_max) then
                        print activityspace,",",activityspace;
                        ct:=activityspace;
                        activityspace:=activityspace;
                        activityspace:=ct;
                        mark:=true;
                        else*/
                        y_max:=y_max+dy;
                        dx:=0;
              dy:=0;
                        --end;
                end;
                d_from_to_chart:=(dx+activityspace/2)*xscale;
                d_from_to_chart:=(y_max+activityspace/2)*xscale;
          if activityspace>dy then
                        dy:=activityspace;
                end;
                dx:=dx+activityspace;
                /*if mark=true then
                ct:=activityspace;
                        activityspace:=activityspace;
                        activityspace:=ct;
                        end;*/
        next;
        y_max:=y_max+dy;
        current.drawrectangle(1,x_pos_init-5,y_pos_init-5,activityspace*xscale+10,y_max*xscale+10,228,174);
        current.drawrectangle(1,x_pos_init-7,y_pos_init-7,activityspace*xscale+14,y_max*xscale+14,238,176);
       
        rows:=0;
        lines:=0;
        for i:=1 to number_of_machine loop
                for j:=1 to number_of_machine loop
                        if j=i then
                                d_from_to_chart:=0;
                        else
                                dx:=d_from_to_chart-d_from_to_chart;
                                dy:=d_from_to_chart-d_from_to_chart;
                                d_from_to_chart:=abs(dx-dy);
                        end;
                next;
        next;
       
        lines:=0;
        partstable.delete;
       
        for i:=1 to number_of_machine loop
                rows:=str_to_num(omit(machinesequence,1,1));
                machinesequence:=rows;
                for j:=1 to number_of_machine loop
                        if w_from_to_chart>0 then
                        lines:=lines+1;
                        partstable:=str_to_obj(sprint(".",location.name,".parts"));
                        partstable:=w_from_to_chart;
                        partstable:=sprint("parts");
                        partstable:=rows;
                        partstable:=j;
                end;
        next;
        machinename:=sprint("M",rows);
        machine:=.materialflow.singleproc.createobject(current,x_pos_init+d_from_to_chart+15,y_pos_init+d_from_to_chart);
        machine.name:=machinename;标识符未知
        machine.proctime:=5;
        machine.label:=activityspace;
        machine.exitctrl:=ref(leave);
       
        bufname:=sprint("BF",rows);
        buf:=.materialflow.buffer.createobject(current,x_pos_init+d_from_to_chart-15,y_pos_init+d_from_to_chart);
        buf.name:=bufname;
        buf.capacity:=5000;
        buf.proctime:=0;
        .materialflow.connector.connect(buf,machine);
       
        dx:=x_pos_init+d_from_to_chart-activityspace*xscale/2;
dy:=y_pos_init+d_from_to_chart-activityspace*xscale/2;
current.drawrectangle(1,dx,dy,activityspace*xscale,activityspace*xscale,168,1);
next;
end;
页: [1]
查看完整版本: simtalk程序调试不出来,帮忙看一下