刀具余量信息输出,基本可以算完整吧,哪里不对希望指正
之前发过贴,求助论坛的坛友有关余量代码信息, 通过论坛朋友不断的提醒帮助,(当然自己还是不会写),用百度AI算是给写出来了, 测试也没有发现什么问题,先把以前大多数人用的代码和问题说出来。 这个差不多是之前多数人用的代码和问题。global mom_stock_part mom_stock_floor mom_operation_type
if { ! } {
set mom_stock_floor 0
} else {
if { $mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling" } {
MOM_output_literal "(XY= "0"]mm Z= "0"]mm)"
}
}这个是修改后的代码
global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use
global sidestock floorstock mom_operation_type
if {} {
set sidestock $mom_stock_part
if { && $mom_wall_stock != 0} {
set sidestock $mom_wall_stock
}
} else {
set sidestock 0
}
if {} {
if { && $mom_stock_part_use == 1 && } {
set floorstock $mom_stock_part
} else {
set floorstock $mom_stock_floor
}
} else {
set floorstock 0
}
if {( && $sidestock != 0) || ( && $floorstock != 0)} {
if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} {
MOM_output_literal "(XY= "0"]mm Z= "0"]mm)"
}
}
global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use
global sidestock floorstock mom_operation_type
if {} {
set sidestock $mom_stock_part
if { && $mom_wall_stock != 0} {
set sidestock $mom_wall_stock
}
} else {
set sidestock 0
}
if {} {
if { && $mom_stock_part_use == 1 && } {
set floorstock $mom_stock_part
} else {
set floorstock $mom_stock_floor
}
} else {
set floorstock 0
}
if {( && $sidestock != 0) || ( && $floorstock != 0)} {
if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} {
MOM_output_literal "(XY= "0"]mm Z= "0"]mm)"
}
} 不知道为代码哪里有问题会出现以下情况,
global mom_operation_type
global mom_stock_part
global mom_stock_floor
global mom_stock_part_use
global xy xy1 z1
if {!} {
set mom_stock_floor 0
}
if {!} {
set xy 0
} else {
set xy1 $mom_stock_part
}
if {! || $mom_stock_part_use != 1} {
if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} {
MOM_output_literal "(XY= mm Z= mm)"
}
} else {
set xy1 $mom_stock_part
set z1 $mom_stock_part
MOM_output_literal "(XY= mm Z= mm)"
}
上面的代码比较乱, 重新发一个global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use global sidestock floorstock mom_operation_type if {} { set sidestock $mom_stock_part if { && $mom_wall_stock != 0} { set sidestock $mom_wall_stock } } else { set sidestock 0 } if {} { if { && $mom_stock_part_use == 1 && } { set floorstock $mom_stock_part } else { set floorstock $mom_stock_floor } } else { set floorstock 0 } if {( && $sidestock != 0) || ( && $floorstock != 0)} { if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} { MOM_output_literal "(XY= "0"]mm Z= "0"]mm)" } } global mom_stock_part mom_stock_floor mom_operation_typeif { ! } { set mom_stock_floor 0 } else { if { $mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling" } { MOM_output_literal "(XY= Z=)" } } 张思颖 发表于 2024-8-24 11:46
上面的代码比较乱, 重新发一个global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use ...
更乱了{:titter:}global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use
global sidestock floorstock mom_operation_type
if {} {
set sidestock $mom_stock_part
if { && $mom_wall_stock != 0} {
set sidestock $mom_wall_stock
}
} else {
set sidestock 0
}
if {} {
if { && $mom_stock_part_use == 1 && } {
set floorstock $mom_stock_part
} else {
set floorstock $mom_stock_floor
}
} else {
set floorstock 0
}
if {( && $sidestock != 0) || ( && $floorstock != 0)} {
if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} {
MOM_output_literal "(XY= "0"]mm Z= "0"]mm)"
}
}
global mom_stock_part mom_stock_floor mom_operation_type
if { ! } {
set mom_stock_floor 0
} else {
if { $mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling" } {
MOM_output_literal "(XY= Z=)"
}
}
这代码是不是多的有东西怎么输出两行余量呢? 13526775595 发表于 2024-8-24 14:29
这代码是不是多的有东西怎么输出两行余量呢?
global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use
global sidestock floorstock mom_operation_type
if {} {
set sidestock $mom_stock_part
if { && $mom_wall_stock != 0} {
set sidestock $mom_wall_stock
}
} else {
set sidestock 0
}
if {} {
if { && $mom_stock_part_use == 1 && } {
set floorstock $mom_stock_part
} else {
set floorstock $mom_stock_floor
}
} else {
set floorstock 0
}
if {( && $sidestock != 0) || ( && $floorstock != 0)} {
if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} {
MOM_output_literal "(XY= "0"]mm Z= "0"]mm)"
}
} 精光的时候,侧底余量都是零。就不显示了吗? snowa* 发表于 2024-8-24 14:42
精光的时候,侧底余量都是零。就不显示了吗?
是的, ,具体是怎么回事, 我也搞不清楚,我本来就不会写代码的
张思颖 发表于 2024-8-24 14:33
global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use
global sidestock floorstock ...
不错不错,终于搞{:lol:}出来了,代码还是那个代码对吧,只要反过来就好了 本帖最后由 13526775595 于 2024-8-24 15:11 编辑
snowa* 发表于 2024-8-24 14:42
精光的时候,侧底余量都是零。就不显示了吗?
我试了一下把上面的那个代码屏蔽一下,下面这个代码在余量为零的时候是可以正常输出的。