【废弃存档】检测线路连接
来源:互联网 发布:官路淘宝txt下载 编辑:程序博客网 时间:2024/04/30 21:10
RobotInc_线路合法性检测
线路需按照类型12345顺序排列,且必须有0开始,5结束,返回true
public void StartCheckLine() //按照一定顺序,检测线路前后链接是否正确,目前停用
{print("start to check the line!");
if (startId != -1) {
ProdLinePart startPart = curLinePartList.Find(item => item.itemId == startId); //找到线路core部位作为起始位置
print("find start part, and it's id is " + startPart.itemId+", and it's type is " + startPart.type+", and it's outid is " + startPart.outId);
if (CheckProdLine(startPart, 1))
{
//secceedPanel.SetActive(true);
print("succeed!");
}
else
{
failToBuildPanel.SetActive(true);
}
}
else
{
print("no core built");
}
}
bool CheckProdLine(ProdLinePart curEndPart, int curLineType)
{
print("------start to check-----" + curEndPart.itemId + " , " + curLineType);
if(curEndPart.type == 5 ) //如果到了结束part,检测
{
if(curLineType > 1)
{
print("it's over!");
return true;
}
}
else //当前part非结束part
{
if (curEndPart.outId != -1)
{
print("current part out id is not -1");
ProdLinePart nextPart = curLinePartList.Find(item => item.itemId == curEndPart.outId);
print("find next part in list is " + nextPart.itemId);
if (curEndPart.type == 0)
{
print("current item is a transfer");
if (nextPart.type == 0)
{
print("next part is also a transfer");
return CheckProdLine(nextPart, curLineType);
}
else
{
print("next part is not a transfer");
if (curLineType < nextPart.type) //机器必须按照顺序的做法
{
print(" current type is " + curLineType + " , and next type is " + nextPart.type);
curLineType = nextPart.type;
return CheckProdLine(nextPart, curLineType);
}
}
}
else // current part type != 0
{
if (nextPart.type == 0)
{
return CheckProdLine(nextPart, curLineType);
}
}
}
}
return false;
}
阅读全文
0 0
- 【废弃存档】检测线路连接
- 存档 检查网络连接
- 微信学习连接存档
- 存档
- 存档
- 存档
- 存档
- 存档
- 存档
- 线路
- 线路
- 存档存档.....
- [存档]在Eclipse中用JDBC连接Sql Server 2005总结
- TCP连接吞吐率和线路效率的总结
- HTTP连接信息检测
- 检测网络连接
- 如何检测网络连接?
- 检测UDP连接
- 数组中出现次数超过一半的数字
- ES6 —(Set 和 Map 数据结构)
- 游戏AI中的搜索与寻路
- IO流
- jQuery 选择器(:nth-child(n))详解
- 【废弃存档】检测线路连接
- POJ-2046---Gap (bfs+hash)
- C++编程规范(不断更新)
- 北京台历印刷厂家
- 使用sqoop1.99.6将mysql数据导入到hdfs
- 批量替换mysql数据库字段里的字符串
- 使用Echarts的时候,使用AJAX异步记载数据的时候,出现了 series chart type has not been defined 错误
- Ubuntu 14.04 LTS 修改服务器 ssh 端口号
- 缓冲字符copy