@@ -11,10 +11,15 @@ import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import com.bonait.bnframework.R;
@@ -26,9 +31,12 @@ import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.res.StatusMode;
import com.bonait.bnframework.common.db.res.lcMode;
import com.bonait.bnframework.common.helper.CountDownTimerExt;
import com.bonait.bnframework.common.helper.I.IRunT;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.message.MessageLooper;
@@ -43,6 +51,7 @@ import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.qmuiteam.qmui.widget.textview.QMUILinkTextView;
import com.suke.widget.SwitchButton;
import java.util.ArrayList;
import java.util.List;
@@ -88,6 +97,8 @@ public class MakeGoodFragment extends BaseFragment {
@BindView(R.id.dialog_jykz)
RelativeLayout dialog_jykz;
@BindView(R.id.gongxumiaoshu)
TextView gongxumiaoshu;//工序描述
/**
* 当前制作商品信息
@@ -116,7 +127,8 @@ public class MakeGoodFragment extends BaseFragment {
context = getContext();
initTopBar();
Initdata();
StatusThread();
StatusOrMakeGoodThread();
Init_弹窗();
}
/**
@@ -125,9 +137,21 @@ public class MakeGoodFragment extends BaseFragment {
private void initTopBar() {
mTopBar.setTitle("菠萝燃气炒菜系统" + ConfigName.getInstance().Version);
}
/**
* 设置下拉框
*
* @param spinner
* @param map
*/
private void SetAdapter(Spinner spinner, List<String> map) {
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, map);
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
spinner.setAdapter(adapter);
}
//endregion
//region 私有函数
//region 点击事件处理
/**
* 点击事件
@@ -138,9 +162,19 @@ public class MakeGoodFragment extends BaseFragment {
, R.id.btn_xtkz, R.id.btn_hlkz
, R.id.btn_sjkz, R.id.btn_jykz
, R.id.close_xtkz, R.id.close_hlkz
, R.id.close_kbkz, R.id.close_jykz})
, R.id.close_kbkz, R.id.close_jykz
, R.id.button_搅拌点动
, R.id.button_搅拌上升, R.id.button_搅拌下降
, R.id.button_锅前倾, R.id.button_锅后仰
, R.id.button_出料
, R.id.button_点火复位
})
public void onViewClicked(View view) {
switch (view.getId()) {
//region 界面的操作
case R.id.xzcp://选择菜谱按钮点击
skipToActivity(CpxzActivity.class);
ToastUtils.info("打开菜谱选择界面");
@@ -199,254 +233,188 @@ public class MakeGoodFragment extends BaseFragment {
});
}
break;
}
}
//endregion
//endregion
//region 公共函数
//region PLC操作
/**
* 初始化数据
*/
public void Initdata() {
//1.初始化状态数据
InitStatusdata();
//2.
SetProcesssUI(0);
startbutton.setText("开始烹饪");
startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected);
SetVisibility(0);
//3.接收选择菜谱事件
DataBus.getInstance().mListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
case R.id.button_搅拌上升:
ExecuteTheRecipe.BottomClick("搅拌上升");
break;
case R.id.button_搅拌下降:
ExecuteTheRecipe.BottomClick("搅拌下降");
break;
case R.id.button_锅前倾:
ExecuteTheRecipe.BottomClick("锅口向前");
break;
case R.id.button_锅后仰:
ExecuteTheRecipe.BottomClick("锅口向后");
break;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// if (!IsMake(true)) {
// return;
// }
good = (BPA_GOODS) data;
SetProcesssUI(0);
}
});
}
case R.id.button_出料:
String s1 = edit_设定重量.getText().toString();
String s2 = edit_提前量.getText().toString();
if (s1.isEmpty()) {
ToastUtils.warning("设定重量不能为空!");
return;
}
if (s2.isEmpty()) {
ToastUtils.warning("提前量不能为空!");
return;
}
int s1_1 = 0;
int s2_1 = 0;
try {
s1_1 = Integer.parseInt(s1);
s2_1 = Integer.parseInt(s2);
} catch (Exception ex) {
ToastUtils.warning("数据解析异常!" + ex.getMessage());
return;
}
ExecuteTheRecipe.WritePLC("设定重量", s1_1);
ExecuteTheRecipe.WritePLC("设定提前量", s2_1);
ExecuteTheRecipe.WritePLC("设定提前量", s2_1);
ExecuteTheRecipe.WritePLC("料仓1出料", true);
break;
@Override
public void clickListenerNew(View v, int k, Object data) {
case R.id.button_点火复位:
ExecuteTheRecipe.BottomClick("点火复位开关");
break;
}
};
//endregion
}
}
/**
* 状态线程
* 开关事件处理
*/
public void StatusThread() {
//商品制作线程
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
if (ExecuteTheRecipe.IsStart && good != null) {
long startTime = System.currentTimeMillis(); //起始时间
ExecuteTheRecipe.showlog("--------------------------------------");
ExecuteTheRecipe.showlog("开始烹饪菜谱【" + good.name + "】");
try {
//获取工艺
ArrayList<BPA_GOODSRECIPE> goodsrecipes = QueryDB.GetGoodsSrecipeID(good.id);
for (BPA_GOODSRECIPE item : goodsrecipes) {
ExecuteTheRecipe.Execute(item);
}
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
} finally {
long endTime = System.currentTimeMillis(); //结束时间
int time = (int) ((endTime - startTime) / 1000);
ExecuteTheRecipe.showlog("结束烹饪菜谱【" + good.name + "】,关闭搅拌、关闭加热," + String.format("方法使用时间 %d s", time));
if (!ExecuteTheRecipe.IsForcedEnd) {
QueryDB.UpdateGoodsMakeTime(good.id, time);
}
public SwitchButton.OnCheckedChangeListener checkedChangeListener = new SwitchButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(SwitchButton view, boolean isChecked) {
switch (view.getId()) {
case R.id.switch_系统启停:
ExecuteTheRecipe.WritePLC("系统启停开关", isChecked);
break;
case R.id.switch_超温停气:
ExecuteTheRecipe.WritePLC("超温停气开关", isChecked);
break;
case R.id.switch_搅拌控制:
if (isChecked) {
ExecuteTheRecipe.BottomClick("搅拌启动开关");
} else {
ExecuteTheRecipe.BottomClick("搅拌停止开关");
}
break;
case R.id.switch_抽油启停:
ExecuteTheRecipe.WritePLC("料仓1出料", isChecked);
break;
case R.id.switch_备用气缸:
ExecuteTheRecipe.WritePLC("料仓2出料", isChecked);
break;
case R.id.switch_点火控制:
ExecuteTheRecipe.WritePLC("点火启动开关", isChecked);
break;
Activity activity = getActivity();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
onRecordStop();
if (ExecuteTheRecipe.IsForcedEnd)//强制结束
{
ExecuteTheRecipe.showlog("菜谱【" + good.name + "】已强制结束...");
ExecuteTheRecipe.StopForcedEnd();//设置恢复强制结束
}
}
});
}
ExecuteTheRecipe.showlog("--------------------------------------");
}
}
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
};
public View.OnTouchListener touchListener=new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
boolean IsChick=false;
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
Log.e("鼠标", "按下: ");
IsChick=true;
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
Log.e("鼠标", "松开: ");
IsChick=false;
}
}
}
switch (view.getId()) {
case R.id.button_搅拌点动:
ExecuteTheRecipe.WritePLC("搅拌点动开关",IsChick);
break;
}
}).start();
return false;
}
};
//endregion
//region 计时器
private CountDownTimerExt countDownTimer = null;//计时器
//刷新UI监控
new Thread(new Runnable() {
/**
* 启动
*/
public void onRecordStart() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
while (true) {
try {
if (ConfigName.getInstance().PlcIsConnect) {
for (StatusMode mode : sbzt) {
Object obj = ExecuteTheRecipe.ReadPLC(mode.YName);
if (obj != null) {
mode.Status = (boolean) obj;
}
if (good != null) {
startbutton.setText("强制结束");
startbutton.setBackgroundResource(R.drawable.bg_btn_login_red);
xzcp.setVisibility(View.INVISIBLE);
int time = good.maketime;
SetProcesssUI(0);
if (countDownTimer == null) {
countDownTimer = new CountDownTimerExt(time * 1000, 1000) {
@Override
public void onTimerTick(long value) {
int overtime = (int) ((value) / 1000);//剩余时间
SetProcesssUI(time - overtime);
}
for (StatusMode mode : gzzt) {
Object obj = ExecuteTheRecipe.ReadPLC(mode.YName);
if (obj != null) {
mode.Status = (boolean) obj;
}
@Override
public void onTimerFinish() {
SetProcesssUI(time);
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ReshData();
}
});
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
};
}
countDownTimer.start();
ExecuteTheRecipe.IsStart = true;
}
}
}).start() ;
});
}
//endregion
//region 设备监控状态
/**
* 设备状态
*/
public List<StatusMode> sbzt = new ArrayList<>();
public devicestatus_adapter adapter_sbzt = null;
/**
* 故障状态
*/
public List<StatusMode> gzzt = new ArrayList<>();
public devicestatus_adapter adapter_gzzt = null;
/**
* 初始化数据
* 停止
*/
public void InitStatusdata() {
sbzt.clear();
sbzt.add(new StatusMode("急停按钮", "监控_急停按钮", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("搅拌上限", "监控_搅拌上限", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("搅拌下限", "监控_搅拌下限", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("锅后限位", "监控_锅后限位", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("搅拌原点", "监控_搅拌原点", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("点火正常", "监控_点火正常", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.clear();
gzzt.add(new StatusMode("急停按下", "急停按下!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("油泵故障", "油泵故障!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("搅拌故障", "搅拌故障!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("点火异常", "点火异常!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("高温报警", "高温报警!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("备用故障1", "备用故障1", false, R.mipmap.status_y, R.mipmap.status_z, 0));
StaggeredGridLayoutManager layout = new StaggeredGridLayoutManager
(3, StaggeredGridLayoutManager.VERTICAL);
recycler_view_sbzt.setLayoutManager(layout);
adapter_sbzt = new devicestatus_adapter(getContext(), sbzt);
recycler_view_sbzt.setAdapter(adapter_sbzt);
public void onRecordStop() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (good != null) {
startbutton.setText("开始烹饪");
startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected);
xzcp.setVisibility(View.VISIBLE);
SetProcesssUI(0);
StaggeredGridLayoutManager layout1 = new StaggeredGridLayoutManager
(3, StaggeredGridLayoutManager.VERTICAL);
recycler_view_gzzt.setLayoutManager(layout1);
adapter_gzzt = new devicestatus_adapter(getContext(), gzzt);
recycler_view_gzzt.setAdapter(adapter_gzzt);
}
if (countDownTimer != null) {
countDownTimer.stop();
countDownTimer = null;
}
ExecuteTheRecipe.IsStart = false;
}
}
});
/**
* 刷新数据
*/
public void ReshData() {
adapter_sbzt.refresh();
adapter_gzzt.refresh();
}
//endregion
//region 计时器
private CountDownTimerExt countDownTimer = null;//计时器
/**
* 启动
* 暂停
*/
public void onRecordStart() {
if (good != null) {
startbutton.setText("强制结束");
startbutton.setBackgroundResource(R.drawable.bg_btn_login_red);
xzcp.setVisibility(View.INVISIBLE);
int time = good.maketime;
SetProcesssUI(0);
if (countDownTimer == null) {
countDownTimer = new CountDownTimerExt(time * 1000, 1000) {
@Override
public void onTimerTick(long value) {
int overtime = (int) ((value) / 1000);//剩余时间
SetProcesssUI(time - overtime);
}
@Override
public void onTimerFinish() {
SetProcesssUI(time);
}
};
}
countDownTimer.start();
ExecuteTheRecipe.IsStart = true;
}
public void onRecordPause() {
countDownTimer.pause();
}
/**
* 停止
* 继续
*/
public void onRecordStop() {
if (good != null) {
startbutton.setText("开始烹饪");
startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected);
xzcp.setVisibility(View.VISIBLE);
SetProcesssUI(0);
if (countDownTimer != null) {
countDownTimer.stop();
countDownTimer = null;
}
ExecuteTheRecipe.IsStart = false;
}
public void onRecordPauseStart() {
countDownTimer.resume();
}
//endregion
@@ -565,5 +533,345 @@ public class MakeGoodFragment extends BaseFragment {
}
}
/**
* 设置工序描述
*
* @param text
*/
public void SetProcessDescription(String text) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
gongxumiaoshu.setText(text + "");
}
});
}
//endregion
//region 设备监控状态
/**
* 设备状态
*/
public List<StatusMode> sbzt = new ArrayList<>();
public devicestatus_adapter adapter_sbzt = null;
/**
* 故障状态
*/
public List<StatusMode> gzzt = new ArrayList<>();
public devicestatus_adapter adapter_gzzt = null;
/**
* 初始化数据
*/
public void InitStatusdata() {
sbzt.clear();
sbzt.add(new StatusMode("急停按钮", "监控_急停按钮", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("搅拌上限", "监控_搅拌上限", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("搅拌下限", "监控_搅拌下限", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("锅后限位", "监控_锅后限位", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("搅拌原点", "监控_搅拌原点", false, R.mipmap.status_y, R.mipmap.status_z, 0));
sbzt.add(new StatusMode("点火正常", "监控_点火正常", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.clear();
gzzt.add(new StatusMode("急停按下", "急停按下!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("油泵故障", "油泵故障!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("搅拌故障", "搅拌故障!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("点火异常", "点火异常!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("高温报警", "高温报警!", false, R.mipmap.status_y, R.mipmap.status_z, 0));
gzzt.add(new StatusMode("备用故障1", "备用故障1", false, R.mipmap.status_y, R.mipmap.status_z, 0));
StaggeredGridLayoutManager layout = new StaggeredGridLayoutManager
(3, StaggeredGridLayoutManager.VERTICAL);
recycler_view_sbzt.setLayoutManager(layout);
adapter_sbzt = new devicestatus_adapter(getContext(), sbzt);
recycler_view_sbzt.setAdapter(adapter_sbzt);
StaggeredGridLayoutManager layout1 = new StaggeredGridLayoutManager
(3, StaggeredGridLayoutManager.VERTICAL);
recycler_view_gzzt.setLayoutManager(layout1);
adapter_gzzt = new devicestatus_adapter(getContext(), gzzt);
recycler_view_gzzt.setAdapter(adapter_gzzt);
}
/**
* 刷新数据
*/
public void ReshData() {
adapter_sbzt.refresh();
adapter_gzzt.refresh();
}
//endregion
//region 公共函数
/**
* 初始化数据
*/
public void Initdata() {
//1.初始化状态数据
InitStatusdata();
//2.
SetProcesssUI(0);
startbutton.setText("开始烹饪");
startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected);
SetVisibility(0);
SetProcessDescription("等待开始...");
//3.接收选择菜谱事件
DataBus.getInstance().mListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// if (!IsMake(true)) {
// return;
// }
SetProcessDescription("等待开始...");
good = (BPA_GOODS) data;
SetProcesssUI(0);
}
});
}
@Override
public void clickListenerNew(View v, int k, Object data) {
}
};
}
//endregion
//region 状态显示或商品制作线程
/**
* 线程
*/
public void StatusOrMakeGoodThread() {
ExecuteTheRecipe.context = getContext();
//商品制作线程
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
if (ExecuteTheRecipe.IsStart && good != null) {
long startTime = System.currentTimeMillis(); //起始时间
ExecuteTheRecipe.showlog("--------------------------------------");
ExecuteTheRecipe.showlog("开始烹饪菜谱【" + good.name + "】");
ExecuteTheRecipe.HandTime = 0;//默认将手动操作时间复位
try {
//获取工艺
ArrayList<BPA_GOODSRECIPE> goodsrecipes = QueryDB.GetGoodsSrecipeID(good.id);
for (BPA_GOODSRECIPE item : goodsrecipes) {
SetProcessDescription("正在执行:" + item.processms);
ExecuteTheRecipe.Execute(item);
}
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
} finally {
int time = (int) ((System.currentTimeMillis() - startTime) / 1000);//使用总时间
ExecuteTheRecipe.showlog("结束烹饪菜谱【" + good.name + "】," + String.format("方法使用时间 %d s", time));
if (!ExecuteTheRecipe.IsForcedEnd) //不是强制结束,从写炒制时间
{
int ztime = time - ExecuteTheRecipe.HandTime;
good.maketime = ztime > 0 ? ztime : time;
QueryDB.UpdateGoodsMakeTime(good.id, good.maketime);
} else {
ExecuteTheRecipe.showlog("菜谱【" + good.name + "】已强制结束...");
}
onRecordStop();
ExecuteTheRecipe.StopForcedEnd();//设置恢复强制结束
ExecuteTheRecipe.showlog("--------------------------------------");
}
}
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
}
}).start();
//刷新UI监控
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
if (ConfigName.getInstance().PlcIsConnect) {
for (StatusMode mode : sbzt) {
Object obj = ExecuteTheRecipe.ReadPLC(mode.YName);
if (obj != null) {
mode.Status = (boolean) obj;
}
}
for (StatusMode mode : gzzt) {
Object obj = ExecuteTheRecipe.ReadPLC(mode.YName);
if (obj != null) {
mode.Status = (boolean) obj;
}
}
//读取锅体重量
Object zl = ExecuteTheRecipe.ReadPLC("炒锅当前重量");
if (zl != null) {
PanWeight.setText(zl + "");
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ReshData();
}
});
}
Thread.sleep(1000);
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
}
}
}
}).start();
//接收暂停计时器
ExecuteTheRecipe.NoticeHandSuspension = new IRunT() {
@Override
public void Run(Object o) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if ((boolean) o) {
onRecordPause();
} else {
onRecordPauseStart();
}
}
});
}
};
}
//endregion
//region 弹窗处理
@BindView(R.id.switch_系统启停)
SwitchButton switch_系统启停;
@BindView(R.id.switch_超温停气)
SwitchButton switch_超温停气;
@BindView(R.id.switch_搅拌控制)
SwitchButton switch_搅拌控制;
@BindView(R.id.switch_抽油启停)
SwitchButton switch_抽油启停;
@BindView(R.id.switch_备用气缸)
SwitchButton switch_备用气缸;
@BindView(R.id.editsp_物料)
Spinner editsp_物料;
@BindView(R.id.editsp_点火模式)
Spinner editsp_点火模式;
@BindView(R.id.switch_点火控制)
SwitchButton switch_点火控制;
@BindView(R.id.button_搅拌点动)
EditText button_搅拌点动;//button_搅拌点动
@BindView(R.id.image_搅拌上升)
ImageView image_搅拌上升;
@BindView(R.id.button_搅拌下降)
ImageView button_搅拌下降;
@BindView(R.id.image_锅前倾)
ImageView image_锅前倾;
@BindView(R.id.image_锅后仰)
ImageView image_锅后仰;
/**
* 初始化弹窗
*/
public void Init_弹窗() {
Init_弹窗_事件();
Init_弹窗_物料();
}
/**
* 初始化弹框中的事件
*/
public void Init_弹窗_事件() {
switch_系统启停.setOnCheckedChangeListener(checkedChangeListener);
switch_超温停气.setOnCheckedChangeListener(checkedChangeListener);
switch_搅拌控制.setOnCheckedChangeListener(checkedChangeListener);
switch_抽油启停.setOnCheckedChangeListener(checkedChangeListener);
switch_备用气缸.setOnCheckedChangeListener(checkedChangeListener);
switch_点火控制.setOnCheckedChangeListener(checkedChangeListener);
editsp_点火模式.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
String name =editsp_点火模式.getSelectedItem().toString();
if(name.equals("手动"))
{
ExecuteTheRecipe.WritePLC("点火手自动切换开关",true);
}else
{
ExecuteTheRecipe.WritePLC("点火手自动切换开关",false);
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
button_搅拌点动.setOnTouchListener(touchListener);
}
@BindView(R.id.PanWeight)
TextView PanWeight;//锅体的重量
@BindView(R.id.edit_设定重量)
EditText edit_设定重量;//设定重量
@BindView(R.id.edit_提前量)
EditText edit_提前量;//提前量
public ArrayList<BPA_MATERIAL> materials = new ArrayList<>();
public List<String> names = new ArrayList<>();
/**
* 初始化物料
*/
public void Init_弹窗_物料() {
materials.clear();
names.clear();
List<BPA_MATERIAL> bpa_materials = QueryDB.GetMaterialALL();
for (BPA_MATERIAL item : bpa_materials) {
materials.add(item);
names.add(item.name);
}
SetAdapter(editsp_物料, names);
List<String> ms = new ArrayList<>();
ms.add("手动");
ms.add("自动");
SetAdapter(editsp_点火模式, ms);
}
//endregion
}