|
|
@@ -2,9 +2,11 @@ package com.bonait.bnframework.modules.home.fragment.mode; |
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
import android.os.Handler; |
|
|
|
import android.os.Looper; |
|
|
|
import android.os.Message; |
|
|
|
import android.os.SystemClock; |
|
|
|
import android.util.AttributeSet; |
|
|
|
import android.util.Log; |
|
|
|
import android.view.LayoutInflater; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.Button; |
|
|
@@ -119,7 +121,7 @@ public class add_manguan_control extends LinearLayout { |
|
|
|
@Override |
|
|
|
public void onChronometerTick(Chronometer chronometer) { |
|
|
|
//如果计时到现在超过了一小时秒 10s |
|
|
|
if (SystemClock.elapsedRealtime() - runtime.getBase() > 120 * 1000) { |
|
|
|
if (SystemClock.elapsedRealtime() - runtime.getBase() > 20 * 1000) { |
|
|
|
StopTime(); |
|
|
|
} |
|
|
|
} |
|
|
@@ -158,16 +160,28 @@ public class add_manguan_control extends LinearLayout { |
|
|
|
ExecuteTheRecipe.WritePLC("手自切换", false, null); |
|
|
|
for (BPA_SILOS item:siloslist) |
|
|
|
{ |
|
|
|
int time=item.bValue<=0?5:item.bValue;//默认5秒 |
|
|
|
ExecuteTheRecipe.WritePLC("手动控制"+item.num,true,null); |
|
|
|
new Handler().postDelayed(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
ExecuteTheRecipe.WritePLC("手动控制"+item.num,false,null); |
|
|
|
mHandler.sendEmptyMessage(0); |
|
|
|
i++; |
|
|
|
if(!item.name.equals("果糖仓") && !item.name.equals("粉料仓") ) |
|
|
|
{ |
|
|
|
int time=item.bValue<=0?5:item.bValue;//默认5秒 |
|
|
|
ExecuteTheRecipe.WritePLC("手动控制"+item.num,true,null); |
|
|
|
|
|
|
|
try { |
|
|
|
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
ExecuteTheRecipe.WritePLC("手动控制"+item.num,false,null); |
|
|
|
mHandler.sendEmptyMessage(0); |
|
|
|
i++; |
|
|
|
} |
|
|
|
}, time * 1000); |
|
|
|
}catch (Exception ex) |
|
|
|
{ |
|
|
|
Log.d("异常信息", ex.getMessage()); |
|
|
|
} |
|
|
|
}, time * 1000); |
|
|
|
}else |
|
|
|
{ |
|
|
|
i++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|