|
@@ -18,12 +18,15 @@ import android.widget.RelativeLayout; |
|
|
import android.widget.TextView; |
|
|
import android.widget.TextView; |
|
|
|
|
|
|
|
|
import com.bonait.bnframework.R; |
|
|
import com.bonait.bnframework.R; |
|
|
|
|
|
import com.bonait.bnframework.business.ExecuteTest; |
|
|
import com.bonait.bnframework.business.ExecuteTheRecipe; |
|
|
import com.bonait.bnframework.business.ExecuteTheRecipe; |
|
|
import com.bonait.bnframework.common.base.BaseFragment; |
|
|
import com.bonait.bnframework.common.base.BaseFragment; |
|
|
|
|
|
import com.bonait.bnframework.common.constant.ConfigName; |
|
|
import com.bonait.bnframework.common.constant.DataBus; |
|
|
import com.bonait.bnframework.common.constant.DataBus; |
|
|
import com.bonait.bnframework.common.constant.MessageName; |
|
|
import com.bonait.bnframework.common.constant.MessageName; |
|
|
import com.bonait.bnframework.common.db.mode.BPA_GOODS; |
|
|
import com.bonait.bnframework.common.db.mode.BPA_GOODS; |
|
|
import com.bonait.bnframework.common.db.res.MakeStatus; |
|
|
import com.bonait.bnframework.common.db.res.MakeStatus; |
|
|
|
|
|
import com.bonait.bnframework.common.db.res.StatusMode; |
|
|
import com.bonait.bnframework.common.helper.I.MyClickListener; |
|
|
import com.bonait.bnframework.common.helper.I.MyClickListener; |
|
|
import com.bonait.bnframework.common.image.MyBitmapUtils; |
|
|
import com.bonait.bnframework.common.image.MyBitmapUtils; |
|
|
import com.bonait.bnframework.common.message.MessageManager; |
|
|
import com.bonait.bnframework.common.message.MessageManager; |
|
@@ -34,7 +37,9 @@ import com.bonait.bnframework.modules.home.fragment.from.Cpxz1Activity; |
|
|
import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity; |
|
|
import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity; |
|
|
import com.orhanobut.logger.Logger; |
|
|
import com.orhanobut.logger.Logger; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
import butterknife.BindView; |
|
|
import butterknife.BindView; |
|
@@ -64,7 +69,11 @@ public class AutoTestMoreFragment extends BaseFragment { |
|
|
@BindView(R.id.jieshutuichu) |
|
|
@BindView(R.id.jieshutuichu) |
|
|
ImageView jieshutuichu;//结束退出 |
|
|
ImageView jieshutuichu;//结束退出 |
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.miaoshu) |
|
|
|
|
|
EditText miaoshu;// |
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.qingkong) |
|
|
|
|
|
Button qingkong;// |
|
|
//endregion |
|
|
//endregion |
|
|
|
|
|
|
|
|
//region 界面 |
|
|
//region 界面 |
|
@@ -130,7 +139,12 @@ public class AutoTestMoreFragment extends BaseFragment { |
|
|
skipToActivity(Cpxz1Activity.class); |
|
|
skipToActivity(Cpxz1Activity.class); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
qingkong.setOnClickListener(new View.OnClickListener() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onClick(View view) { |
|
|
|
|
|
ClearMiaosShu(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
DataBus.getInstance().mListener1 = new MyClickListener() { |
|
|
DataBus.getInstance().mListener1 = new MyClickListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void clickListener(View v, Object data) { |
|
|
public void clickListener(View v, Object data) { |
|
@@ -178,7 +192,38 @@ public class AutoTestMoreFragment extends BaseFragment { |
|
|
} |
|
|
} |
|
|
}).start(); |
|
|
}).start(); |
|
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
while (true) { |
|
|
|
|
|
try { |
|
|
|
|
|
//故障信息 |
|
|
|
|
|
for (StatusMode item: ConfigName.getInstance().statusModes) |
|
|
|
|
|
{ |
|
|
|
|
|
if(ExecuteTheRecipe.getConcurrentHash(item.sort)) |
|
|
|
|
|
{ |
|
|
|
|
|
SetMiaosShu1(item.Name); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String x1= ConfigName.getInstance().statusModes_电机.get(ExecuteTheRecipe.getConcurrentHash_dj("搅拌电机")); |
|
|
|
|
|
String x2= ConfigName.getInstance().statusModes_电机.get(ExecuteTheRecipe.getConcurrentHash_dj("翻转电机")); |
|
|
|
|
|
if(!x1.equals("无故障")) |
|
|
|
|
|
{ |
|
|
|
|
|
SetMiaosShu1("搅拌电机故障代码:"+x1); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!x2.equals("无故障")) |
|
|
|
|
|
{ |
|
|
|
|
|
SetMiaosShu1("翻转电机故障代码:"+x2); |
|
|
|
|
|
} |
|
|
|
|
|
Thread.sleep(2000); |
|
|
|
|
|
} catch (Exception ex) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}).start(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -267,5 +312,43 @@ public class AutoTestMoreFragment extends BaseFragment { |
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); |
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); |
|
|
startActivity(intent); |
|
|
startActivity(intent); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 不重复 |
|
|
|
|
|
* @param text |
|
|
|
|
|
*/ |
|
|
|
|
|
public void SetMiaosShu1(String text) { |
|
|
|
|
|
getActivity().runOnUiThread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
String YL= miaoshu.getText().toString(); |
|
|
|
|
|
if(!YL.isEmpty() && YL.contains(text)) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
}else |
|
|
|
|
|
{ |
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
String tempMsg = YL+ formatter.format(date) + ":" + text + "\n"; |
|
|
|
|
|
miaoshu.setText(tempMsg); |
|
|
|
|
|
ToastUtils.warning(formatter.format(date) + ":" + text); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 清空显示 |
|
|
|
|
|
* |
|
|
|
|
|
* @param |
|
|
|
|
|
*/ |
|
|
|
|
|
public void ClearMiaosShu() { |
|
|
|
|
|
getActivity().runOnUiThread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
miaoshu.setText(""); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
//endregion |
|
|
//endregion |
|
|
} |
|
|
} |