@@ -47,7 +47,7 @@ public class ExecuteTheRecipe { | |||
/** | |||
* 等待超时时间 | |||
*/ | |||
public static int whileTime = 5; | |||
public static int whileTime = 40; | |||
/** | |||
* 监听变量值 | |||
@@ -67,7 +67,7 @@ public class ExecuteTheRecipe { | |||
/** | |||
* 当前配方 | |||
*/ | |||
static ArrayList<BPA_GOODSRECIPE> all_list = new ArrayList<>(); | |||
public static ArrayList<BPA_GOODSRECIPE> all_list = new ArrayList<>(); | |||
static BPA_GOODSRECIPE selectpf; | |||
/** | |||
@@ -342,7 +342,10 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
long endTime = System.currentTimeMillis(); //结束时间 | |||
int time=(int) ((endTime-startTime)/1000); | |||
Log.e("运行时长",String.format("方法使用时间 %d s",time)); | |||
if (!ExecuteTheRecipe.IsForcedEnd){QueryDB.UpdateGoodsMakeTime(goods.id,time);} | |||
ExecuteTheRecipe.all_list=new ArrayList<>(); | |||
runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
@@ -539,6 +539,8 @@ public class Home1Fragment extends BaseFragment { | |||
if (!ExecuteTheRecipe.IsForcedEnd){QueryDB.UpdateGoodsMakeTime(good.id,time);} | |||
ExecuteTheRecipe.all_list=new ArrayList<>(); | |||
Activity activity = getActivity(); | |||
if (activity != null) { | |||
activity.runOnUiThread(new Runnable() { | |||
@@ -210,7 +210,7 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
chuchan.mListener = myClickListener; | |||
DataBus.getInstance().SilosRefresh=new IRun() { | |||
DataBus.getInstance().SilosRefresh = new IRun() { | |||
@Override | |||
public void Run() { | |||
RefreshLiquidSilo(); | |||
@@ -225,8 +225,7 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
SetStirFrySpeed(SpeedEnum.停, false); | |||
RefreshLiquidSilo(); | |||
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) | |||
{ | |||
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) { | |||
touliao_k.setVisibility(View.GONE); | |||
touliao_m.setVisibility(View.GONE); | |||
} | |||
@@ -235,15 +234,14 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
/** | |||
* 刷新液料仓 | |||
*/ | |||
public void RefreshLiquidSilo() | |||
{ | |||
yeliao1.setTag(ConfigName.getInstance().SilosDisplayMaterial.get(1)+""); | |||
public void RefreshLiquidSilo() { | |||
yeliao1.setTag(ConfigName.getInstance().SilosDisplayMaterial.get(1) + ""); | |||
yeliao1.Init(); | |||
yeliao2.setTag(ConfigName.getInstance().SilosDisplayMaterial.get(2)+""); | |||
yeliao2.setTag(ConfigName.getInstance().SilosDisplayMaterial.get(2) + ""); | |||
yeliao2.Init(); | |||
yeliao3.setTag(ConfigName.getInstance().SilosDisplayMaterial.get(3)+""); | |||
yeliao3.setTag(ConfigName.getInstance().SilosDisplayMaterial.get(3) + ""); | |||
yeliao3.Init(); | |||
} | |||
@@ -496,7 +494,7 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
*/ | |||
public void PumpWater(boolean isselectd) { | |||
ExecuteTheRecipe.WritePLC("炒锅抽水", isselectd, null); | |||
ToastUtils.warning("锅内加水:" + (isselectd?"打开":"关闭")); | |||
ToastUtils.warning("锅内加水:" + (isselectd ? "打开" : "关闭")); | |||
} | |||
/** | |||
@@ -506,7 +504,7 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
*/ | |||
public void PotWashingWater(boolean isselectd) { | |||
ExecuteTheRecipe.WritePLC("炒锅放水", isselectd, null); | |||
ToastUtils.warning("洗锅水枪:" + (isselectd?"打开":"关闭")); | |||
ToastUtils.warning("洗锅水枪:" + (isselectd ? "打开" : "关闭")); | |||
} | |||
public boolean isMake = false; | |||
@@ -517,21 +515,31 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
* @param num | |||
*/ | |||
public void MainDish(int num) { | |||
if (isMake == false) { | |||
isMake = true; | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
BPA_GOODSRECIPE data1 = Get位置("最高", "炒菜位1"); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); | |||
BPA_GOODSRECIPE data = Get主料(num); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data.processname, data.processvalue); | |||
ToastUtils.warning("主料:" + num+"号仓投放"); | |||
isMake = false; | |||
Object sb = ExecuteTheRecipe.ReadPLC("平移轴在1号位"); | |||
if (sb != null) { | |||
if ((boolean) (sb)) { | |||
if (isMake == false) { | |||
isMake = true; | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
BPA_GOODSRECIPE data1 = Get位置("最高", "炒菜位1"); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); | |||
BPA_GOODSRECIPE data = Get主料(num); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data.processname, data.processvalue); | |||
ToastUtils.warning("主料:" + num + "号仓投放"); | |||
isMake = false; | |||
} | |||
}).start(); | |||
} | |||
}).start(); | |||
} else { | |||
ToastUtils.warning("平移轴未复位!!!"); | |||
} | |||
} else { | |||
ToastUtils.warning("PLC未连接!!!"); | |||
} | |||
} | |||
/** | |||
@@ -542,7 +550,7 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
public void Pumping(int num, boolean isselectd) { | |||
ExecuteTheRecipe.WritePLC("料仓" + (num) + "手动开关", isselectd, null); | |||
ToastUtils.warning("料仓:" + num + "," + (isselectd?"打开":"关闭")); | |||
ToastUtils.warning("料仓:" + num + "," + (isselectd ? "打开" : "关闭")); | |||
} | |||
/** | |||
@@ -552,7 +560,7 @@ public class HomeFragmentSBKZ extends BaseFragment { | |||
*/ | |||
public void SetFire(int data) { | |||
ExecuteTheRecipe.Write_PLC_HuoLI((int) data); | |||
ToastUtils.warning("设置火力:" + data+"档"); | |||
ToastUtils.warning("设置火力:" + data + "档"); | |||
} | |||
/** | |||
@@ -849,38 +849,48 @@ public class DishTestActivity extends BaseActivity { | |||
* @param num | |||
*/ | |||
public void MainDish(int num) { | |||
SetZhiXingZhong(true); | |||
Object sb = ExecuteTheRecipe.ReadPLC("平移轴在1号位"); | |||
if (sb != null) { | |||
if ((boolean) (sb)) { | |||
SetZhiXingZhong(true); | |||
int time = (int) ((SystemClock.elapsedRealtime() - runtime.getBase()) / 1000);//当前点击多少秒 | |||
int time_c = time - ClikTime; | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
int time = (int) ((SystemClock.elapsedRealtime() - runtime.getBase()) / 1000);//当前点击多少秒 | |||
int time_c = time - ClikTime; | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
BPA_GOODSRECIPE data1 = Get位置("最高", "炒菜位1"); | |||
//DataBus.getInstance().bpa_goodsrecipes.add(data1); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); | |||
BPA_GOODSRECIPE data1 = Get位置("最高", "炒菜位1"); | |||
//DataBus.getInstance().bpa_goodsrecipes.add(data1); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data1.processname, data1.processvalue); | |||
BPA_GOODSRECIPE data = Get主料(num); | |||
BPA_GOODSRECIPE data = Get主料(num); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data.processname, data.processvalue); | |||
ExecuteTheRecipe.ExecuteOperationSteps(data.processname, data.processvalue); | |||
runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
if (time_c > 0)//如果大于0,那么加一个延迟 | |||
{ | |||
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); | |||
} | |||
DataBus.getInstance().bpa_goodsrecipes.add(data); | |||
ToastUtils.warning("主料:" + num + "号仓投放"); | |||
SetZhiXingZhong(false); | |||
//刷新工序 | |||
RefreshProcedure(); | |||
runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
if (time_c > 0)//如果大于0,那么加一个延迟 | |||
{ | |||
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); | |||
} | |||
DataBus.getInstance().bpa_goodsrecipes.add(data); | |||
ToastUtils.warning("主料:" + num + "号仓投放"); | |||
SetZhiXingZhong(false); | |||
//刷新工序 | |||
RefreshProcedure(); | |||
} | |||
}); | |||
} | |||
}); | |||
}).start(); | |||
} else { | |||
ToastUtils.warning("平移轴未复位!!!"); | |||
} | |||
}).start(); | |||
} else { | |||
ToastUtils.warning("PLC未连接!!!"); | |||
} | |||
} | |||
/** | |||
@@ -335,22 +335,32 @@ public class DiyMemoryActivity extends BaseActivity { | |||
} | |||
public void ClickZL(int time,int time_c,int num) | |||
{ | |||
if(isRunClick()) | |||
{ | |||
if(time_c>0)//如果大于0,那么加一个延迟 | |||
{ | |||
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); | |||
} | |||
Object sb = ExecuteTheRecipe.ReadPLC("平移轴在1号位"); | |||
if (sb != null) { | |||
if ((boolean) (sb)) { | |||
if(isRunClick()) | |||
{ | |||
if(time_c>0)//如果大于0,那么加一个延迟 | |||
{ | |||
DataBus.getInstance().bpa_goodsrecipes.add(Get延迟(time_c)); | |||
} | |||
//控制去炒菜位 | |||
BPA_GOODSRECIPE data1=Get位置("最高","炒菜位1"); | |||
DataBus.getInstance().bpa_goodsrecipes.add(data1); | |||
//控制去炒菜位 | |||
BPA_GOODSRECIPE data1=Get位置("最高","炒菜位1"); | |||
DataBus.getInstance().bpa_goodsrecipes.add(data1); | |||
BPA_GOODSRECIPE data=Get主料(num); | |||
DataBus.getInstance().bpa_goodsrecipes.add(data); | |||
MakeRecipe(data);//执行主料 | |||
ClikTime=time; | |||
BPA_GOODSRECIPE data=Get主料(num); | |||
DataBus.getInstance().bpa_goodsrecipes.add(data); | |||
MakeRecipe(data);//执行主料 | |||
ClikTime=time; | |||
} | |||
} else { | |||
ToastUtils.warning("平移轴未复位!!!"); | |||
} | |||
} else { | |||
ToastUtils.warning("PLC未连接!!!"); | |||
} | |||
} | |||
public void ClickWZ(int time,int time_c,String name) | |||
{ | |||
@@ -22,6 +22,7 @@ import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.NetworkUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.from.DiyUpdateActivity; | |||
import java.util.ArrayList; | |||
@@ -145,6 +146,17 @@ public class add_qupenren extends LinearLayout { | |||
quzhizuo.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (!ConfigName.getInstance().PlcIsConnect) { | |||
ToastUtils.warning("PLC未准备就绪!!!"); | |||
return; | |||
} | |||
Object chushiover = ExecuteTheRecipe.getListingValue("初始化完成"); | |||
//Object jiting = ExecuteTheRecipe.getListingValue("设备急停"); | |||
if (chushiover == null || !(boolean) chushiover) { | |||
ToastUtils.warning("设备未初始化,请先手动初始化设备!!!"); | |||
return; | |||
} | |||
if (mListener != null) { | |||
mListener.clickListenerNew(view, 5, mode); | |||
} | |||