|
@@ -90,66 +90,86 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { |
|
|
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { |
|
|
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onClick(QMUIDialog dialog, int index) { |
|
|
public void onClick(QMUIDialog dialog, int index) { |
|
|
IsStart=false; |
|
|
|
|
|
bt_start.setText("开始清洗"); |
|
|
|
|
|
bt_start.setBackgroundResource(R.drawable.sz_bj); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getActivity().runOnUiThread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
IsStart=false; |
|
|
|
|
|
bt_start.setText("开始清洗"); |
|
|
|
|
|
bt_start.setBackgroundResource(R.drawable.sz_bj); |
|
|
|
|
|
|
|
|
|
|
|
for (BPA_SUGAR item: |
|
|
|
|
|
DataBus.getInstance().zdqx) { |
|
|
|
|
|
item.exp=""; |
|
|
|
|
|
} |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
dialog.dismiss(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
ToastUtils.warning("正在清洗中,请勿重复点击!"); |
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
ExecuteTheRecipe.WritePLC("清洗模式", true, new IWriteCallBack() { |
|
|
ExecuteTheRecipe.WritePLC("清洗模式", true, new IWriteCallBack() { |
|
|
@Override |
|
|
@Override |
|
|
public void onSuccess() { |
|
|
public void onSuccess() { |
|
|
IsStart=true; |
|
|
|
|
|
bt_start.setText("正在清洗"); |
|
|
|
|
|
bt_start.setBackgroundResource(R.drawable.cp_bj); |
|
|
|
|
|
} |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
for (BPA_SUGAR item: |
|
|
|
|
|
DataBus.getInstance().zdqx) { |
|
|
|
|
|
|
|
|
|
|
|
item.exp="执行中"; |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
|
|
|
|
|
|
getActivity().runOnUiThread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
IsStart=true; |
|
|
|
|
|
bt_start.setText("正在清洗"); |
|
|
|
|
|
bt_start.setBackgroundResource(R.drawable.cp_bj); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
final boolean[] IsStop = {false}; |
|
|
|
|
|
ExecuteTheRecipe.CleaningComplete=new IRun() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void Run() { |
|
|
|
|
|
IsStop[0] =true; |
|
|
|
|
|
|
|
|
new Thread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
try { |
|
|
|
|
|
ExecuteTheRecipe.WritePLC("管道自动排水完成",false,null); |
|
|
|
|
|
|
|
|
|
|
|
for (BPA_SUGAR item: |
|
|
|
|
|
DataBus.getInstance().zdqx) { |
|
|
|
|
|
ExecuteTheRecipe.WritePLC("自动清洗完成",false,null); |
|
|
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
|
|
item.exp="执行中"; |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
|
|
|
|
|
|
|
|
|
final boolean[] IsStop = {false}; |
|
|
|
|
|
ExecuteTheRecipe.CleaningComplete=new IRun() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void Run() { |
|
|
|
|
|
IsStop[0] =true; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
|
|
while (IsStart && !IsStop[0]) { |
|
|
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * 500) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
Thread.sleep(100);//10 *6 |
|
|
|
|
|
} |
|
|
|
|
|
item.exp="执行完成"; |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
long a = System.currentTimeMillis(); |
|
|
|
|
|
while (IsStart && !IsStop[0] && IsStart) { |
|
|
|
|
|
if ((System.currentTimeMillis() - a) > 1000 * 500) { |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
if(IsStart) |
|
|
|
|
|
{ |
|
|
|
|
|
ExecuteTheRecipe.WritePLC("管道自动排水",true,null); |
|
|
} |
|
|
} |
|
|
Thread.sleep(100);//10 *6 |
|
|
|
|
|
} |
|
|
|
|
|
item.exp="执行完成"; |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ExecuteTheRecipe.WritePLC("管道自动排水",true,null); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}).start(); |
|
|
|
|
|
} |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onFailure(String ErrorMsg) { |
|
|
|
|
|
ToastUtils.error("启动失败!"); |
|
|
} |
|
|
} |
|
|
}).start(); |
|
|
|
|
|
|
|
|
}); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -187,15 +207,22 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { |
|
|
ExecuteTheRecipe.AutoPaiShui=new IRun() { |
|
|
ExecuteTheRecipe.AutoPaiShui=new IRun() { |
|
|
@Override |
|
|
@Override |
|
|
public void Run() { |
|
|
public void Run() { |
|
|
IsStart=false; |
|
|
|
|
|
bt_start.setText("开始清洗"); |
|
|
|
|
|
bt_start.setBackgroundResource(R.drawable.sz_bj); |
|
|
|
|
|
|
|
|
getActivity().runOnUiThread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
ToastUtils.warning("清洗完成!"); |
|
|
|
|
|
IsStart=false; |
|
|
|
|
|
bt_start.setText("开始清洗"); |
|
|
|
|
|
bt_start.setBackgroundResource(R.drawable.sz_bj); |
|
|
|
|
|
|
|
|
|
|
|
for (BPA_SUGAR item: |
|
|
|
|
|
DataBus.getInstance().zdqx) { |
|
|
|
|
|
item.exp=""; |
|
|
|
|
|
} |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
for (BPA_SUGAR item: |
|
|
|
|
|
DataBus.getInstance().zdqx) { |
|
|
|
|
|
item.exp=""; |
|
|
|
|
|
} |
|
|
|
|
|
DataBus.getInstance().zdqxchidAdapter.refresh(); |
|
|
|
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|