Browse Source

优化444

茶饮新(现场)
fyf 1 year ago
parent
commit
7ae8fe354a
4 changed files with 41 additions and 30 deletions
  1. +9
    -5
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +10
    -7
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/wdsz_adapter.java
  3. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  4. +21
    -17
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_lsjy_fragment.java

+ 9
- 5
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -247,9 +247,11 @@ public class ExecuteTheRecipe {
// ListeningValue.put(key, val); // ListeningValue.put(key, val);
// } // }
// } // }
ReadCode();
ReadPLCStatus();

if(!IsMakeGood)
{
ReadCode();
ReadPLCStatus();
}
} catch (Exception ex) { } catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage()); ToastUtils.error("异常信息:" + ex.getMessage());
} }
@@ -266,7 +268,10 @@ public class ExecuteTheRecipe {
@Override @Override
public void Run() throws InterruptedException { public void Run() throws InterruptedException {
try { try {
AutoJR();
if(!IsMakeGood)
{
AutoJR();
}
} catch (Exception ex) { } catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage()); ToastUtils.error("异常信息:" + ex.getMessage());
} }
@@ -283,7 +288,6 @@ public class ExecuteTheRecipe {
@Override @Override
public void Run() throws InterruptedException { public void Run() throws InterruptedException {
try { try {

ChargeSignal(); ChargeSignal();
} catch (Exception ex) { } catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage()); ToastUtils.error("异常信息:" + ex.getMessage());


+ 10
- 7
app/src/main/java/com/bonait/bnframework/modules/home/adapter/wdsz_adapter.java View File

@@ -92,17 +92,20 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
while (ConfigName.getInstance().PlcIsConnect) {
while(true)
{
try { try {
Object obj= ExecuteTheRecipe.ReadPLC(goodsMake.name);
if(obj!=null)
if(ConfigName.getInstance().PlcIsConnect && !ExecuteTheRecipe.IsMakeGood)
{ {
temp[0] =String.valueOf(obj);
mHandler.sendEmptyMessage(0);
Object obj= ExecuteTheRecipe.ReadPLC(goodsMake.name);
if(obj!=null)
{
temp[0] =String.valueOf(obj);
mHandler.sendEmptyMessage(0);
}
} }
Thread.sleep(100);
Thread.sleep(200);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e);
} }
} }
} }


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java View File

@@ -420,7 +420,7 @@ public class MakeGoodFragment extends BaseFragment {
public void run() { public void run() {
while (true) { while (true) {
try { try {
if(ConfigName.getInstance().PlcIsConnect)
if(ConfigName.getInstance().PlcIsConnect && !ExecuteTheRecipe.IsMakeGood)
{ {
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量"); Object obj= ExecuteTheRecipe.ReadPLC("称当前重量");
if(obj!=null) if(obj!=null)


+ 21
- 17
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_lsjy_fragment.java View File

@@ -395,29 +395,33 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
while (ConfigName.getInstance().PlcIsConnect) {
while(true)
{
try { try {
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量");
Object obj1= ExecuteTheRecipe.ReadPLC("出料口检测");

if(obj!=null)
if(ConfigName.getInstance().PlcIsConnect && !ExecuteTheRecipe.IsMakeGood)
{ {
zhongliangxianshi=(int)obj;//
mHandler.sendEmptyMessage(0);
}
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量");
Object obj1= ExecuteTheRecipe.ReadPLC("出料口检测");

if(obj!=null)
{
zhongliangxianshi=(int)obj;//
mHandler.sendEmptyMessage(0);
}


clk=obj1==null?false:(boolean) obj1;
clk=obj1==null?false:(boolean) obj1;


if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度");
Object obj3= ExecuteTheRecipe.ReadPLC("果糖右温度");
gt1wd=obj2==null?0:(int)obj2;
gt2wd=obj3==null?0:(int)obj3;
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度");
Object obj3= ExecuteTheRecipe.ReadPLC("果糖右温度");
gt1wd=obj2==null?0:(int)obj2;
gt2wd=obj3==null?0:(int)obj3;
}
} }
Thread.sleep(200);

Thread.sleep(100);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e);
} }
} }
} }


Loading…
Cancel
Save