瀏覽代碼

777

tags/old_version_1
fyf 11 月之前
父節點
當前提交
49aaf4a3e4
共有 7 個檔案被更改,包括 111 行新增66 行删除
  1. +2
    -2
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +3
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationNewActivity.java
  3. +2
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  4. +33
    -25
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java
  5. +36
    -26
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java
  6. +23
    -13
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java
  7. +12
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_qupenren.java

+ 2
- 2
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java 查看文件

@@ -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;
/**


+ 3
- 0
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationNewActivity.java 查看文件

@@ -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() {


+ 2
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java 查看文件

@@ -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() {


+ 33
- 25
app/src/main/java/com/bonait/bnframework/modules/home/fragment/HomeFragmentSBKZ.java 查看文件

@@ -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 + "档");
}

/**


+ 36
- 26
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DishTestActivity.java 查看文件

@@ -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未连接!!!");
}

}

/**


+ 23
- 13
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyMemoryActivity.java 查看文件

@@ -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)
{


+ 12
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_qupenren.java 查看文件

@@ -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);
}


Loading…
取消
儲存