发帖
 找回密码
 立即注册
搜索
2 0 0

发生器的创建触发中依次设置临时实体类型和颜色,设置颜色,创建和初始化标签出错

历史版块_9 2 2 2012-12-3 14:05:01
[i=s] 本帖最后由 zorsite 于 2012-12-4 08:54 编辑 [/i]

版本为Flexsim6.02中文版
具体操作见GIF附件。


[color=Red]编译器控制台出错提示:[/color]
Flexscript Error        MAIN:/project/model/发生器3>variables/creationtrigger        line 30        syntax error, unexpected '}', expecting end of code check for the proper number of parentheses/braces
Could not finish parsing because of previous errors.


[color=Red]系统控制台出错提示:[/color]
exception: parse error at line number 31: syntax error, unexpected '}', expecting end of code
exception: parse error at line number 31: syntax error, unexpected '}', expecting end of code


[color=Red]系统生成的代码:[/color][code]treenode item = parnode(1);
treenode current = ownerobject(c);
int rownumber = parval(2);  //row number of the schedule/sequence table
{ //************* PickOption Start *************\\
/***popup:SetTypeAndColor*/
/**设置临时实体类型和颜色*/
/** \nFlowitem: */
treenode involved = /***tag:involved*//**/item/**/;
/** \nItemtype: */
double newtype = /***tag:type*//**/duniform(1,3)/**/;
/**\n\n*/
setitemtype(involved,newtype);
colorarray(involved,newtype);

} //******* PickOption End *******\\{ //************* PickOption Start *************\\
/***popup:SetColor:hasitem=1*/
/**设置颜色*/
/** \n值: */
int value = /***tag:item*//**/getitemtype(item)/**/;
switch(value)
{
        /***tagex:data*//**\nCase: */case /**/1/**/: /** Color: */ /**/colorred(item)/**/;break;
/**\nCase: */case /**/2/**/: /** Color: */ /**/colorblue(item)/**/;break;
/**\nCase: */case /**/3/**/: /** Color: */ /**/colorgreen(item)/**/;break;
/***/
        /** \n默认值: */
        default: /***tag:default_value*//**/colorarray(item, value)/**/;break;
}
/**\n\n*/
} //******* PickOption End *******\\
//************* PickOption Start *************\\
{
/***popup:CreateInitializeLabel*/
/**创建和初始化标签*/
/** \n实体: */
treenode involved = /***tag:involved*//**/item/**/;
/** \n标签: */
string labelname = /***tag:labelname*//**/"newlabel"/**/;
/** \n值: */
double newvalue = /***tag:newvalue*//**/duniform(1,3)/**/;
/**\n\n*/
set(assertlabel(involved,labelname,DATATYPE_NUMBER),newvalue);
}
//******* PickOption End *******\\
[/code]
──── 0人觉得很赞 ────

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
2012-12-3 14:25:39
我觉得这是flexsim的一个bug。
如果“设置临时实体类型和颜色”之后紧接着“设置颜色”,就会导致代码错误。
原因在于第15行:[code]} //******* PickOption End *******\\{ //************* PickOption Start *************\\[/code]在这里flexsim没有正确地换行,正确的代码应该是:[code]} //******* PickOption End *******\\
{ //************* PickOption Start *************\\[/code]
2012-12-3 14:48:37
确是BUG,感谢提出
您需要登录后才可以回帖 立即登录
高级模式
返回
历史版块_9
热门问答
查看更多
1
流水作业线的仿真
流水作业线的仿真
33
83
2
Flexsim初级建模工程师水平标准
Flexsim初级建模工程师水平标准
33
234
3
厂区生产线布局优化案例!新做的!
厂区生产线布局优化案例!新做的!
29
224
4
图形用户界面(GUI)教学视频
图形用户界面(GUI)教学视频
26
75
5
flexsim中文教程,pdf文档已整理-重新整理
flexsim中文教程,pdf文档已整理-重新整理
25
114
博主榜
+ 5