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