@@ -411,6 +411,8 @@ public class ConfigName { | |||
add(new Res_PLCADDRESS("自动清洗", "-------------", 0, 0)); | |||
add(new Res_PLCADDRESS("排水阀排水时间", "VW244", 1, 1)); | |||
add(new Res_PLCADDRESS("循环清洗时间", "VW246", 1, 1)); | |||
add(new Res_PLCADDRESS("加热时间", "VW248", 1, 1)); | |||
add(new Res_PLCADDRESS("清洗模式", "M0.4", 1, 1)); | |||
add(new Res_PLCADDRESS("自动清洗开始", "M0.5", 1, 1)); | |||
@@ -720,6 +722,8 @@ public class ConfigName { | |||
add(new Res_PLCADDRESS("自动清洗", "-------------", 0, 0)); | |||
add(new Res_PLCADDRESS("排水阀排水时间", "VW244", 1, 1)); | |||
add(new Res_PLCADDRESS("循环清洗时间", "VW246", 1, 1)); | |||
add(new Res_PLCADDRESS("加热时间", "VW248", 1, 1)); | |||
add(new Res_PLCADDRESS("清洗模式", "M0.4", 1, 1)); | |||
add(new Res_PLCADDRESS("自动清洗开始", "M0.5", 1, 1)); | |||
add(new Res_PLCADDRESS("自动清洗完成", "M0.6", 1, 1)); | |||
@@ -0,0 +1,32 @@ | |||
package com.bonait.bnframework.common.helper; | |||
import android.text.InputFilter; | |||
import android.text.Spanned; | |||
public class InputFilterMinMax implements InputFilter { | |||
private int min, max; | |||
public InputFilterMinMax(int min, int max) { | |||
this.min = min; | |||
this.max = max; | |||
} | |||
public InputFilterMinMax(String min, String max) { | |||
this.min = Integer.parseInt(min); | |||
this.max = Integer.parseInt(max); | |||
} | |||
@Override | |||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { | |||
try { | |||
int input = Integer.parseInt(dest.toString() + source.toString()); | |||
if (isInRange(min, max, input)) | |||
return null; | |||
} catch (NumberFormatException nfe) { } | |||
return ""; | |||
} | |||
private boolean isInRange(int a, int b, int c) { | |||
return b > a ? c >= a && c <= b : c >= b && c <= a; | |||
} | |||
} |
@@ -94,15 +94,15 @@ public class UpdateAppUtils { | |||
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | |||
{ | |||
mode.productCode="1679307017135329280"; | |||
mode.moduleCode="ncapp"; | |||
mode.serverCode="1680767784879656960"; | |||
mode.branchCode="1679307481578999809"; | |||
mode.moduleCode="newncapp"; | |||
mode.serverCode="1680767784879656960";//服务器 | |||
mode.branchCode="1712279450412756993"; | |||
}else | |||
{ | |||
mode.productCode="1679307017135329280"; | |||
mode.moduleCode="twbt"; | |||
mode.serverCode="1680767784879656960"; | |||
mode.branchCode="1679309003247325185"; | |||
mode.moduleCode="newtwbt"; | |||
mode.serverCode="1680767784879656960";//服务器 | |||
mode.branchCode="1712279534630187009"; | |||
} | |||
//调味吧台 | |||
@@ -5,6 +5,7 @@ import android.content.Context; | |||
import android.content.ContextWrapper; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.text.InputFilter; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
@@ -24,6 +25,7 @@ import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.res.SilosLsjyMode; | |||
import com.bonait.bnframework.common.db.res.wdszMode; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.helper.InputFilterMinMax; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.suke.widget.SwitchButton; | |||
@@ -59,6 +61,14 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
myViewHolder.name.setText(goodsMake.name+""); | |||
myViewHolder.edittext_sx.setText(goodsMake.tempup+""); | |||
if(goodsMake.name.equals("水池温度")) | |||
{ | |||
myViewHolder.edittext_sx.setFilters(new InputFilter[]{ new InputFilterMinMax("0", "45")}); | |||
} else if (goodsMake.name.equals("果糖左温度")) { | |||
myViewHolder.edittext_sx.setFilters(new InputFilter[]{ new InputFilterMinMax("0", "60")}); | |||
}else if (goodsMake.name.equals("果糖右温度")) { | |||
myViewHolder.edittext_sx.setFilters(new InputFilter[]{ new InputFilterMinMax("0", "60")}); | |||
} | |||
myViewHolder.temp.setText(goodsMake.temp+""); | |||
myViewHolder.control_switch.setChecked(goodsMake.autoheat); | |||
@@ -81,7 +81,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold | |||
myViewHolder.name.setText("步骤-"+(position+1)); | |||
myViewHolder.edittext_pssj.setText(pssj+""); | |||
myViewHolder.edittext_xhsj.setText(qxsj+""); | |||
myViewHolder.edittext_qxwd.setText(temp+""); | |||
myViewHolder.edittext_jrsj.setText(temp+""); | |||
if(goodsMake.exp==null || goodsMake.exp.isEmpty()) | |||
{ | |||
@@ -109,9 +109,9 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold | |||
Thread.sleep(50); | |||
} | |||
if (!myViewHolder.edittext_qxwd.getText().toString().equals("")) { | |||
int k= Integer.parseInt(myViewHolder.edittext_qxwd.getText().toString()); | |||
ExecuteTheRecipe.WritePLC("水池温度设置",k,null); | |||
if (!myViewHolder.edittext_jrsj.getText().toString().equals("")) { | |||
int k= (int)Math.round((Double.parseDouble(myViewHolder.edittext_jrsj.getText().toString()) * 10)); | |||
ExecuteTheRecipe.WritePLC("加热时间",(short)k,null); | |||
Thread.sleep(50); | |||
} | |||
@@ -129,7 +129,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold | |||
public void onClick(View view) { | |||
goodsMake.plcvar=myViewHolder.edittext_pssj.getText().toString()+"|" | |||
+myViewHolder.edittext_xhsj.getText().toString()+"|" | |||
+myViewHolder.edittext_qxwd.getText().toString(); | |||
+myViewHolder.edittext_jrsj.getText().toString(); | |||
QueryDB.UpdateSugar(goodsMake); | |||
ToastUtils.info("保存成功!"); | |||
@@ -184,7 +184,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold | |||
public static class ZDQXViewHolder extends RecyclerView.ViewHolder { | |||
EditText edittext_pssj;//排水阀排水时间 | |||
EditText edittext_xhsj;//循环清洗时间 | |||
EditText edittext_qxwd;//清洗温度 | |||
EditText edittext_jrsj;//加热时间 | |||
Button save_time;//保存时间 | |||
Button delete_time; | |||
@@ -197,7 +197,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold | |||
super(view); | |||
edittext_pssj =view.findViewById(R.id.edittext_pssj); | |||
edittext_xhsj =view.findViewById(R.id.edittext_xhsj); | |||
edittext_qxwd =view.findViewById(R.id.edittext_qxwd); | |||
edittext_jrsj =view.findViewById(R.id.edittext_jrsj); | |||
save_time =view.findViewById(R.id.save_time); | |||
delete_time=view.findViewById(R.id.delete_time); | |||
name =view.findViewById(R.id.name); | |||
@@ -109,7 +109,6 @@ public class JiaoYanFragment extends BaseFragment { | |||
menuModes.add(new ResMenuLeft(new JiaoYan_dzcjy_fragment(),"电子秤校验", R.mipmap.dzcjy, R.mipmap.dzcjy_select,true)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_lsjy_fragment(),"流速校验", R.mipmap.lsjy, R.mipmap.lsjy_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_wdsz_fragment(),"温度设置", R.mipmap.lsjy, R.mipmap.lsjy_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_zdqx_fragment(),"自动清洗", R.mipmap.zdqx1, R.mipmap.zdqx1_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_zdbs_fragment(),"自动补水", R.mipmap.zdbs, R.mipmap.zdbs_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_sdkz_fragment(),"手动控制", R.mipmap.sdkz, R.mipmap.sdkz_select,false)); | |||
} | |||
@@ -114,10 +114,10 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { | |||
ExecuteTheRecipe.WritePLC("清洗模式", true, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
DataBus.getInstance().ZDQX_IsStart=true; | |||
getActivity().runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
DataBus.getInstance().ZDQX_IsStart=true; | |||
bt_start.setText("正在清洗"); | |||
bt_start.setBackgroundResource(R.drawable.cp_bj); | |||
} | |||
@@ -131,6 +131,18 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { | |||
if(DataBus.getInstance().ZDQX_IsStart) | |||
{ | |||
ExecuteTheRecipe.WritePLC("管道自动排水完成",false,null); | |||
ExecuteTheRecipe.WritePLC("管道自动排水",true,null); | |||
final boolean[] IsStopPS = {false}; | |||
while (DataBus.getInstance().ZDQX_IsStart && !IsStopPS[0]) | |||
{ | |||
Object iswanc= ExecuteTheRecipe.ReadPLC("管道自动排水完成"); | |||
if(iswanc!=null && (boolean) iswanc) | |||
{ | |||
IsStopPS[0] =true; | |||
} | |||
} | |||
for (BPA_SUGAR item: | |||
DataBus.getInstance().zdqx) { | |||
@@ -158,7 +170,35 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { | |||
DataBus.getInstance().zdqxchidAdapter.refresh(); | |||
} | |||
} | |||
ExecuteTheRecipe.WritePLC("管道自动排水完成",false,null); | |||
ExecuteTheRecipe.WritePLC("管道自动排水",true,null); | |||
IsStopPS[0] =false; | |||
while (DataBus.getInstance().ZDQX_IsStart && !IsStopPS[0]) | |||
{ | |||
Object iswanc= ExecuteTheRecipe.ReadPLC("管道自动排水完成"); | |||
if(iswanc!=null && (boolean) iswanc) | |||
{ | |||
IsStopPS[0] =true; | |||
} | |||
} | |||
getActivity().runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
ToastUtils.warning("清洗完成!"); | |||
DataBus.getInstance().ZDQX_IsStart=false; | |||
bt_start.setText("开始清洗"); | |||
bt_start.setBackgroundResource(R.drawable.sz_bj); | |||
for (BPA_SUGAR item: | |||
DataBus.getInstance().zdqx) { | |||
item.exp=null; | |||
} | |||
DataBus.getInstance().zdqxchidAdapter.refresh(); | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
@@ -205,29 +245,6 @@ public class JiaoYan_zdqx_fragment extends BaseFragment { | |||
} | |||
} | |||
}).start(); | |||
ExecuteTheRecipe.AutoPaiShui=new IRun() { | |||
@Override | |||
public void Run() { | |||
getActivity().runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
ToastUtils.warning("清洗完成!"); | |||
DataBus.getInstance().ZDQX_IsStart=false; | |||
bt_start.setText("开始清洗"); | |||
bt_start.setBackgroundResource(R.drawable.sz_bj); | |||
for (BPA_SUGAR item: | |||
DataBus.getInstance().zdqx) { | |||
item.exp=null; | |||
} | |||
DataBus.getInstance().zdqxchidAdapter.refresh(); | |||
} | |||
}); | |||
} | |||
}; | |||
} catch (Exception e) { | |||
} | |||
@@ -53,12 +53,19 @@ | |||
android:layout_height="wrap_content" | |||
android:text="循环清洗时间" | |||
android:textAlignment="center" /> | |||
<TextView | |||
android:layout_marginTop="20dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="加热水池时间" | |||
android:textAlignment="center" /> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_width="2dp" | |||
android:layout_height="60dp" | |||
android:layout_height="100dp" | |||
android:background="@color/app_color_blue"> | |||
</RelativeLayout> | |||
<LinearLayout | |||
@@ -81,7 +88,7 @@ | |||
<EditText | |||
android:layout_marginLeft="20dp" | |||
android:layout_marginTop="17dp" | |||
android:layout_marginTop="16dp" | |||
android:id="@+id/edittext_xhsj" | |||
android:layout_width="110dp" | |||
android:layout_height="wrap_content" | |||
@@ -92,33 +99,28 @@ | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
<EditText | |||
android:layout_marginLeft="20dp" | |||
android:layout_marginTop="16dp" | |||
android:id="@+id/edittext_jrsj" | |||
android:layout_width="110dp" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:digits="0123456789." | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<TextView | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="② 清洗温度" | |||
android:textAlignment="center" /> | |||
<EditText | |||
android:layout_margin="@dimen/dp_10" | |||
android:id="@+id/edittext_qxwd" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:digits="0123456789" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="③ 保存时间或删除流程" | |||
android:text="② 保存时间或删除流程" | |||
android:textAlignment="center" /> | |||
<RelativeLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||