/**
* 监听猎鹰任务事件
*
* @param taskEvent 猎鹰任务事件
*/
private void onFalconTaskEvent(FalconTaskEvent taskEvent) {
if ("MatLoaded".equals(taskEvent.eventName) ||
"MatUnloaded".equals(taskEvent.eventName)) {
// 当机器人完成取货或卸货
var data = taskEvent.eventData.split(",");
// 订单号
var orderId = data[0];
// 料号
var partId = data[1];
// 通知 ERP
notifyErpMatDone(taskEvent.eventName, orderId, partId);
}
}
def on_falcon_task_event(task_event):
"""
监听猎鹰任务事件
"""
event_name = task_event["eventName"]
if "MatLoaded" == event_name or "MatUnloaded" == event_name:
# 当机器人完成取货或卸货
# 订单号、料号
(order_id, part_id) = task_event["eventData"].split(",")
# 通知 ERP
notify_erp_mat_done(event_name, order_id, part_id)
// 监听猎鹰任务事件
func onFalconTaskEvent(event FalconTaskEvent) error {
if event.EventName == "MatLoaded" || event.EventName == "MatUnloaded" {
// 当机器人完成取货或卸货
var dataStr = event.EventData.(string);
var data = strings.Split(dataStr, ",");
// 订单号
var orderId = data[0];
// 料号
var partId = data[1];
// 通知 ERP
return notifyErpMatDone(event.EventName, orderId, partId);
}
return nil
}
private void onFalconTaskEvent(FalconTaskEvent taskEvent)
{
if ("MatLoaded".Equals(taskEvent.eventName) ||
"MatUnloaded".Equals(taskEvent.eventName))
{
// 当机器人完成取货或卸货
var data = taskEvent.eventData.split(",");
// 订单号
var orderId = data[0];
// 料号
var partId = data[1];
// 通知 ERP
notifyErpMatDone(taskEvent.eventName, orderId, partId);
}
}
/**
* 监听猎鹰任务事件
*
*/
function onFalconTaskEvent(taskEvent : FalconTaskEvent) {
if ("MatLoaded" == taskEvent.eventName || "MatUnloaded" == taskEvent.eventName) {
// 当机器人完成取货或卸货
// 订单号、料号
const [orderId, partId] = taskEvent.eventData.split(",");
// 通知 ERP
notifyErpMatDone(taskEvent.eventName, orderId, partId);
}
}
// 监听猎鹰任务事件
fn on_falcon_task_event(event: FalconTaskEvent) -> Result<(), BzError> {
if event.event_name == "MatLoaded" || event.event_data == "MatUnloaded" {
// 当机器人完成取货或卸货
// 订单号,料号
let data: Vec<&str> = event.event_data.split(",").collect();
let order_id = data[0].to_string();
let part_id = data[1].to_string();
// 通知 ERP
notify_erp_mat_done(event.event_name, order_id, part_id)?;
}
Ok(());
}