@@ -116,6 +116,38 @@ public class ExecuteTheRecipe { | |||
* 当前制作商品 | |||
*/ | |||
public static ResGoodsMake GoodMake=null; | |||
/** | |||
* 出料口重量 | |||
*/ | |||
public static int OutletWeigh=0; | |||
/** | |||
* 杯子检测 | |||
*/ | |||
public static boolean IsCup=false; | |||
/** | |||
* 水池温度 | |||
*/ | |||
public static int WaterTemp=0; | |||
/** | |||
* 果糖左温度 | |||
*/ | |||
public static int SugarTempLeft=0; | |||
/** | |||
* 果糖右温度 | |||
*/ | |||
public static int SugarTempRight=0; | |||
/** | |||
* 重量刷新提示 | |||
*/ | |||
public static IRun WeighComplete; | |||
/** | |||
* 温度刷新提示 | |||
*/ | |||
public static IRun TempComplete; | |||
//endregion | |||
//region 执行配方 | |||
@@ -264,6 +296,50 @@ public class ExecuteTheRecipe { | |||
} | |||
}); | |||
ThreadManager.Get().StartLong("PLC设备-温度重量", true, new IThread() { | |||
@Override | |||
public void Run() throws InterruptedException { | |||
try { | |||
if(!IsMakeGood) | |||
{ | |||
Object zl= ExecuteTheRecipe.ReadPLC("称当前重量"); | |||
OutletWeigh=zl==null?0:(int)zl; | |||
Object bz= ExecuteTheRecipe.ReadPLC("出料口检测"); | |||
IsCup=bz==null?false:(boolean) bz; | |||
Object obj1= ExecuteTheRecipe.ReadPLC("水池温度"); | |||
WaterTemp=obj1==null?0:(int)obj1; | |||
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | |||
{ | |||
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度"); | |||
Object obj3= ExecuteTheRecipe.ReadPLC("果糖右温度"); | |||
SugarTempLeft=obj2==null?0:(int)obj2; | |||
SugarTempRight=obj3==null?0:(int)obj3; | |||
} | |||
if (WeighComplete!=null) | |||
{ | |||
WeighComplete.Run(); | |||
} | |||
if (TempComplete!=null) | |||
{ | |||
TempComplete.Run(); | |||
} | |||
} | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} | |||
Thread.sleep(200); | |||
} | |||
@Override | |||
public void RunComplete() throws InterruptedException { | |||
} | |||
}); | |||
ThreadManager.Get().StartLong("PLC设备-自动加热补水", true, new IThread() { | |||
@Override | |||
public void Run() throws InterruptedException { | |||
@@ -423,18 +423,18 @@ public class ConfigName { | |||
//手动控制 | |||
add(new Res_PLCADDRESS("手动控制", "-------------", 0, 0)); | |||
add(new Res_PLCADDRESS("M_蠕动泵1", "M50.0", 1, 1)); | |||
add(new Res_PLCADDRESS("M_蠕动泵2", "M50.1", 1, 1)); | |||
add(new Res_PLCADDRESS("M_蠕动泵3", "M50.2", 1, 1)); | |||
add(new Res_PLCADDRESS("M_蠕动泵4", "M50.3", 1, 1)); | |||
add(new Res_PLCADDRESS("M_蠕动泵5", "M50.4", 1, 1)); | |||
add(new Res_PLCADDRESS("M_隔膜泵1", "M50.5", 1, 1)); | |||
add(new Res_PLCADDRESS("M_隔膜泵2", "M50.6", 1, 1)); | |||
add(new Res_PLCADDRESS("M_隔膜泵3", "M50.7", 1, 1)); | |||
add(new Res_PLCADDRESS("M_隔膜泵4", "M51.0", 1, 1)); | |||
add(new Res_PLCADDRESS("M_隔膜泵5", "M51.1", 1, 1)); | |||
add(new Res_PLCADDRESS("M_果糖泵1", "M51.2", 1, 1)); | |||
add(new Res_PLCADDRESS("M_果糖泵2", "M51.3", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制1", "M50.0", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制2", "M50.1", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制3", "M50.2", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制4", "M50.3", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制5", "M50.4", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制6", "M50.5", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制7", "M50.6", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制8", "M50.7", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制9", "M51.0", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制10", "M51.1", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制11", "M51.2", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制12", "M51.3", 1, 1)); | |||
add(new Res_PLCADDRESS("M_清洗液泵", "M51.4", 1, 1)); | |||
add(new Res_PLCADDRESS("M_排水阀开", "M53.4", 1, 1)); | |||
@@ -734,27 +734,26 @@ public class ConfigName { | |||
//手动控制 | |||
add(new Res_PLCADDRESS("手动控制", "-------------", 0, 0)); | |||
add(new Res_PLCADDRESS("M_蠕动泵1", "M50.0", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓1正转", "M50.0", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓2正转", "M50.1", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓3正转", "M50.2", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓4正转", "M50.3", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓5正转", "M50.4", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓6正转", "M50.5", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制1", "M50.0", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制2", "M50.1", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制3", "M50.2", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制4", "M50.3", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制5", "M50.4", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制6", "M50.5", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制7", "M51.4", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制8", "M51.5", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制9", "M51.6", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制10", "M51.7", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制11", "M52.0", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制12", "M52.1", 1, 1)); | |||
add(new Res_PLCADDRESS("手动控制13", "M52.2", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓1反转", "M50.6", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓2反转", "M50.7", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓3反转", "M51.0", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓4反转", "M51.1", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓5反转", "M51.2", 1, 1)); | |||
add(new Res_PLCADDRESS("M_外置仓6反转", "M51.3", 1, 1)); | |||
add(new Res_PLCADDRESS("M_粉料通道1", "M51.4", 1, 1)); | |||
add(new Res_PLCADDRESS("M_粉料通道2", "M51.5", 1, 1)); | |||
add(new Res_PLCADDRESS("M_粉料通道3", "M51.6", 1, 1)); | |||
add(new Res_PLCADDRESS("M_酱油通道", "M51.7", 1, 1)); | |||
add(new Res_PLCADDRESS("M_醋通道", "M52.0", 1, 1)); | |||
add(new Res_PLCADDRESS("M_猪油通道", "M52.1", 1, 1)); | |||
add(new Res_PLCADDRESS("M_牛油通道", "M52.2", 1, 1)); | |||
add(new Res_PLCADDRESS("M_保温池进水阀", "M53.4", 1, 1)); | |||
add(new Res_PLCADDRESS("M_保温池排水阀", "M53.5", 1, 1)); | |||
@@ -338,6 +338,8 @@ public class DataBus { | |||
// String s = String.valueOf(val); | |||
mode.jzkg= false;//kg==null?false:(boolean) kg; | |||
mode.Value="0.0";// //String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
mode.mgtime=silo.bValue; | |||
mode.id=silo.id; | |||
SilosLsjy.add(mode); | |||
} | |||
} | |||
@@ -405,6 +405,19 @@ public class QueryDB { | |||
} | |||
return data; | |||
} | |||
/** | |||
* 修改满管时间 | |||
* | |||
* @param id | |||
* @param data | |||
*/ | |||
public static void UpdateMGTime(String id, int data) { | |||
BPA_SILOS silos = GetSilosID(id); | |||
if (silos != null) { | |||
silos.bValue = data; | |||
Update(BPA_SILOS.class, silos); | |||
} | |||
} | |||
/** | |||
* 修改校准值 | |||
@@ -14,8 +14,8 @@ public class BPA_SILOS extends ModeBase { | |||
//下线阈值:20g | |||
public int thrsoleValue; | |||
//PLC控制信号量 | |||
public String plcValue; | |||
//标准值 标准 1s出多少g(出场标准) | |||
public String plcValue;// | |||
//标准值 标准 1s出多少g(出场标准) 更改为 满管 需要时间 | |||
public int bValue; | |||
//校准值 实际校准1s出多少g | |||
public int jValue; | |||
@@ -17,4 +17,7 @@ public class SilosLsjyMode { | |||
public boolean jzkg; | |||
//通道校准值 | |||
public String Value; | |||
public String id;//料仓id | |||
public int mgtime;//满管时间 | |||
} |
@@ -3,13 +3,17 @@ package com.bonait.bnframework.modules.home.adapter; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.ContextWrapper; | |||
import android.os.SystemClock; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
import android.widget.Button; | |||
import android.widget.Chronometer; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.ProgressBar; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import androidx.annotation.NonNull; | |||
@@ -18,11 +22,14 @@ import androidx.recyclerview.widget.RecyclerView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.res.SilosLsjyMode; | |||
import com.bonait.bnframework.common.helper.I.IRun; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.suke.widget.SwitchButton; | |||
import java.sql.Struct; | |||
import java.util.List; | |||
/** | |||
@@ -53,25 +60,23 @@ public class lsjy_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | |||
try { | |||
if (holder instanceof MyGoodLCViewHolder) { | |||
MyGoodLCViewHolder myViewHolder = (MyGoodLCViewHolder) holder; | |||
SilosLsjyMode goodsMake= mainGoods.get(position); | |||
String name= "通道"+goodsMake.num+"(" +goodsMake.name+")"; | |||
myViewHolder.num=goodsMake.num; | |||
myViewHolder.name.setText(name+""); | |||
myViewHolder.wlname.setText(goodsMake.materialName+""); | |||
// myViewHolder.edittext_xs.setText(goodsMake.xs+""); | |||
myViewHolder.control_switch.setChecked(goodsMake.jzkg); | |||
myViewHolder.edittext_tdzl.setText(goodsMake.Value+""); | |||
myViewHolder.edittext_mgsj.setText(goodsMake.mgtime+""); | |||
myViewHolder.control_switch.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() { | |||
@Override | |||
public void onCheckedChanged(SwitchButton view, boolean isChecked) { | |||
//boolean ischick= myViewHolder.control_switch.isChecked(); | |||
DataBus.getInstance().SilosLsjy.get(position).jzkg=isChecked; | |||
ExecuteTheRecipe.WritePLC("通道" + goodsMake.num+"校准开关", isChecked, null); | |||
//goodsMake.jzkg=ischick; | |||
//notifyDataSetChanged(); | |||
// ExecuteTheRecipe.WritePLC("通道1校准开关",ischick,null); | |||
// ToastUtils.info("写入地址:"+model.address+"成功!状态:"+(ischick?"打开":"关闭")); | |||
} | |||
}); | |||
@@ -79,16 +84,11 @@ public class lsjy_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
@Override | |||
public void onClick(View view) { | |||
String value = myViewHolder.edittext_tdzl.getText().toString(); | |||
//String value1=myViewHolder.edittext_xs.getText().toString(); | |||
Short val = 0; | |||
//float xs= 1.0F; | |||
try { | |||
val = (short) Math.round((Double.parseDouble(value) * 10)); | |||
//xs=Float.parseFloat(value1); | |||
} catch (Exception e) { | |||
} | |||
//ExecuteTheRecipe.WritePLC("出料系数"+goodsMake.num,xs,null); | |||
ExecuteTheRecipe.WritePLC("校准值" + goodsMake.num, val, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
@@ -101,13 +101,109 @@ public class lsjy_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
} | |||
}); | |||
String value1 = myViewHolder.edittext_mgsj.getText().toString(); | |||
int val1 = 0; | |||
try { | |||
val1 =(value1==null|| value1.isEmpty())?0:Integer.parseInt(value1); | |||
QueryDB.UpdateMGTime(DataBus.getInstance().SilosLsjy.get(position).id,val1); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}); | |||
final int[] time = {0}; | |||
final int[] zl = {0}; | |||
//开始计算满管时间 | |||
myViewHolder.save_mg.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
zl[0] =ExecuteTheRecipe.OutletWeigh; | |||
StartTime(myViewHolder); | |||
} | |||
}); | |||
//为Chronomter绑定事件监听器,超过一小时自动日内告知 | |||
myViewHolder.runtime.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { | |||
@Override | |||
public void onChronometerTick(Chronometer chronometer) { | |||
//如果计时到现在超过了一小时秒 10s | |||
if (SystemClock.elapsedRealtime() - myViewHolder.runtime.getBase() > 10 * 1000) { | |||
time[0] =StopTime(myViewHolder); | |||
DataBus.getInstance().SilosLsjy.get(position).mgtime=time[0]; | |||
QueryDB.UpdateMGTime(DataBus.getInstance().SilosLsjy.get(position).id,time[0]); | |||
} | |||
} | |||
}); | |||
ExecuteTheRecipe.WeighComplete=new IRun() { | |||
@Override | |||
public void Run() { | |||
if(ExecuteTheRecipe.OutletWeigh >=(zl[0]+2)) | |||
{ | |||
time[0] =StopTime(myViewHolder); | |||
DataBus.getInstance().SilosLsjy.get(position).mgtime=time[0]; | |||
QueryDB.UpdateMGTime(DataBus.getInstance().SilosLsjy.get(position).id,time[0]); | |||
} | |||
} | |||
}; | |||
} | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
} | |||
} | |||
/** | |||
* 启动定时器 | |||
*/ | |||
public void StartTime(MyGoodLCViewHolder myGoodLCViewHolder) { | |||
myGoodLCViewHolder.jishiqi.setVisibility(View.VISIBLE); | |||
myGoodLCViewHolder.main_laout.setVisibility(View.GONE); | |||
myGoodLCViewHolder.runtime.setBase(SystemClock.elapsedRealtime()); | |||
myGoodLCViewHolder.runtime.start(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
//自动模式 | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
//开启 | |||
ExecuteTheRecipe.WritePLC("手动控制"+myGoodLCViewHolder.num,true,null); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
/** | |||
* 停止定时器 | |||
*/ | |||
public int StopTime(MyGoodLCViewHolder myGoodLCViewHolder) { | |||
myGoodLCViewHolder.jishiqi.setVisibility(View.GONE); | |||
myGoodLCViewHolder.main_laout.setVisibility(View.VISIBLE); | |||
long elapsedMillis = SystemClock.elapsedRealtime() - myGoodLCViewHolder.runtime.getBase(); | |||
myGoodLCViewHolder.runtime.stop(); | |||
int time=(int) (elapsedMillis / 1000); | |||
myGoodLCViewHolder.edittext_mgsj.setText(time+""); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("手动控制"+myGoodLCViewHolder.num,false,null); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
return time;//当前点击多少秒 | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
if (context instanceof Activity) { | |||
return (Activity) context; | |||
@@ -152,10 +248,6 @@ public class lsjy_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
* 物料名称 | |||
*/ | |||
TextView wlname; | |||
/** | |||
* 系数 | |||
*/ | |||
//EditText edittext_xs; | |||
/** | |||
* 校准开关 | |||
*/ | |||
@@ -168,6 +260,16 @@ public class lsjy_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
* 保存值 | |||
*/ | |||
Button save_value; | |||
EditText edittext_mgsj; | |||
Button save_mg; | |||
RelativeLayout jishiqi; | |||
LinearLayout main_laout; | |||
Chronometer runtime; | |||
int num=0; | |||
public MyGoodLCViewHolder(View view) { | |||
super(view); | |||
name = (TextView) view.findViewById(R.id.name); | |||
@@ -176,6 +278,14 @@ public class lsjy_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
control_switch = (SwitchButton)view.findViewById(R.id.control_switch); | |||
edittext_tdzl=(EditText) view.findViewById(R.id.edittext_tdzl); | |||
save_value=(Button) view.findViewById(R.id.save_value); | |||
edittext_mgsj=(EditText) view.findViewById(R.id.edittext_mgsj); | |||
save_mg=(Button) view.findViewById(R.id.save_mg); | |||
jishiqi=view.findViewById(R.id.jishiqi); | |||
main_laout=view.findViewById(R.id.main_laout); | |||
runtime=view.findViewById(R.id.runtime); | |||
} | |||
} | |||
} |
@@ -24,6 +24,7 @@ import com.bonait.bnframework.common.constant.ConfigName; | |||
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.IRun; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.helper.InputFilterMinMax; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
@@ -72,12 +73,18 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
myViewHolder.temp.setText(goodsMake.temp+""); | |||
myViewHolder.control_switch.setChecked(goodsMake.autoheat); | |||
final String[] temp = {"0"}; | |||
Handler mHandler = new Handler() { | |||
public void handleMessage(Message msg) { | |||
switch (msg.what) { | |||
case 0: | |||
myViewHolder.temp.setText(temp[0]+""); | |||
if(goodsMake.name.equals("水池温度")) | |||
{ | |||
myViewHolder.temp.setText(ExecuteTheRecipe.WaterTemp+""); | |||
} else if (goodsMake.name.equals("果糖左温度")) { | |||
myViewHolder.temp.setText(ExecuteTheRecipe.SugarTempLeft+""); | |||
}else if (goodsMake.name.equals("果糖右温度")) { | |||
myViewHolder.temp.setText(ExecuteTheRecipe.SugarTempRight+""); | |||
} | |||
break; | |||
case 1: | |||
@@ -89,28 +96,12 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
} | |||
}; | |||
new Thread(new Runnable() { | |||
ExecuteTheRecipe.TempComplete=new IRun() { | |||
@Override | |||
public void run() { | |||
while(true) | |||
{ | |||
try { | |||
if(ConfigName.getInstance().PlcIsConnect && !ExecuteTheRecipe.IsMakeGood) | |||
{ | |||
Object obj= ExecuteTheRecipe.ReadPLC(goodsMake.name); | |||
if(obj!=null) | |||
{ | |||
temp[0] =String.valueOf(obj); | |||
mHandler.sendEmptyMessage(0); | |||
} | |||
} | |||
Thread.sleep(200); | |||
} catch (InterruptedException e) { | |||
} | |||
} | |||
public void Run() { | |||
mHandler.sendEmptyMessage(0); | |||
} | |||
}).start(); | |||
}; | |||
myViewHolder.control_switch.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() { | |||
@Override | |||
public void onCheckedChanged(SwitchButton view, boolean isChecked) { | |||
@@ -35,8 +35,10 @@ import com.bonait.bnframework.common.db.res.ResGoodProperty; | |||
import com.bonait.bnframework.common.db.res.ResGoodsMake; | |||
import com.bonait.bnframework.common.db.res.SilosLsjyMode; | |||
import com.bonait.bnframework.common.helper.I.IRun; | |||
import com.bonait.bnframework.common.helper.I.IThread; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.helper.ThreadManager; | |||
import com.bonait.bnframework.common.linktab.LinkMode; | |||
import com.bonait.bnframework.common.linktab.TopItemDecoration; | |||
import com.bonait.bnframework.common.linktab.good.GoodLeftAdapter; | |||
@@ -50,6 +52,7 @@ import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.loadinggood_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.wl_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_makegood_control; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_manguan_control; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_pf_control; | |||
import com.litao.slider.NiftySlider; | |||
import com.orhanobut.logger.Logger; | |||
@@ -100,11 +103,12 @@ public class MakeGoodFragment extends BaseFragment { | |||
@BindView(R.id.add_makegood) | |||
add_makegood_control add_makegood; | |||
@BindView(R.id.add_manguan) | |||
add_manguan_control add_manguan; | |||
@BindView(R.id.good_gengxin) | |||
Button good_gengxin; | |||
/** | |||
* 当前温度 | |||
*/ | |||
@@ -265,7 +269,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
return; | |||
} | |||
if (!clk) | |||
if (!ExecuteTheRecipe.IsCup) | |||
{ | |||
ToastUtils.warning("出料口没有检测到器皿!"); | |||
return; | |||
@@ -279,7 +283,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
Object sx=ExecuteTheRecipe.ReadPLC("果糖左温度设置"); | |||
int wdsz=sx==null?0:(int)sx; | |||
if(gt1wd<wdsz) | |||
if(ExecuteTheRecipe.SugarTempLeft<wdsz) | |||
{ | |||
ToastUtils.warning("果糖左仓温度未达到设置值,不允许出料..."); | |||
return; | |||
@@ -290,7 +294,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
Object sx=ExecuteTheRecipe.ReadPLC("果糖右温度设置"); | |||
int wdsz=sx==null?0:(int)sx; | |||
if(gt2wd<wdsz) | |||
if(ExecuteTheRecipe.SugarTempRight<wdsz) | |||
{ | |||
ToastUtils.warning("果糖右仓温度未达到设置值,不允许出料..."); | |||
return; | |||
@@ -330,7 +334,13 @@ public class MakeGoodFragment extends BaseFragment { | |||
*/ | |||
private void initTopBar() { | |||
mTopBar.setTitle("智慧菠萝点餐系统"); | |||
mTopBar.addRightTextButton("料仓满管",1).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
add_manguan.SetData(); | |||
add_manguan.setVisibility(View.VISIBLE); | |||
} | |||
}); | |||
//打开 | |||
MessageManager.getInstance().registerMessageReceiver(getActivity(), MessageName.ClickMakeGoodNew, new MessageLooper.OnMessageListener() { | |||
@Override | |||
@@ -343,7 +353,17 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
} | |||
}); | |||
add_manguan.mListener=new MyClickListener() { | |||
@Override | |||
public void clickListener(View v, Object data) { | |||
} | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
add_manguan.setVisibility(View.GONE); | |||
} | |||
}; | |||
add_makegood.mListener=new MyClickListener() { | |||
@Override | |||
public void clickListener(View v, Object data) { | |||
@@ -389,8 +409,8 @@ public class MakeGoodFragment extends BaseFragment { | |||
case 0: | |||
plc_status.setText(ConfigName.getInstance().PlcIsConnect?"正常":"异常"); | |||
plc_status.setTextColor(ConfigName.getInstance().PlcIsConnect? Color.parseColor("#4CAF50"):Color.parseColor("#D32F2F")); | |||
wendu1.setText(tempwd); | |||
dianzichen.setText(zhongliangxianshi); | |||
wendu1.setText(ExecuteTheRecipe.WaterTemp+"°C"); | |||
dianzichen.setText(String.valueOf((int)ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||
break; | |||
case 1: | |||
@@ -402,58 +422,27 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
}; | |||
String zhongliangxianshi="0g"; | |||
String tempwd="0°C"; | |||
int gt1wd=0; | |||
int gt2wd=0; | |||
boolean clk=false; | |||
/** | |||
* 实时显示线程 | |||
*/ | |||
public void Run() { | |||
new Thread(new Runnable() { | |||
ThreadManager.Get().StartLong("刷新显示主页面", true, new IThread() { | |||
@Override | |||
public void run() { | |||
while (true) { | |||
try { | |||
if(ConfigName.getInstance().PlcIsConnect && !ExecuteTheRecipe.IsMakeGood) | |||
{ | |||
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量"); | |||
if(obj!=null) | |||
{ | |||
zhongliangxianshi=String.valueOf((int)obj / 10.0) + " g"; | |||
} | |||
Object obj122= ExecuteTheRecipe.ReadPLC("出料口检测"); | |||
clk=obj122==null?false:(boolean) obj122; | |||
Object obj1= ExecuteTheRecipe.ReadPLC("水池温度"); | |||
if(obj1!=null) | |||
{ | |||
tempwd=String.valueOf(obj1) + "°C"; | |||
} | |||
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; | |||
} | |||
} | |||
mHandler.sendEmptyMessage(0); | |||
Thread.sleep(100); | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
public void Run() throws InterruptedException { | |||
try { | |||
mHandler.sendEmptyMessage(0); | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} | |||
Thread.sleep(200); | |||
} | |||
}).start(); | |||
@Override | |||
public void RunComplete() throws InterruptedException { | |||
} | |||
}); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
@@ -186,7 +186,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
Object sx=ExecuteTheRecipe.ReadPLC("果糖左温度设置"); | |||
int wdsz=sx==null?0:(int)sx; | |||
if(gt1wd<wdsz) | |||
if(ExecuteTheRecipe.SugarTempLeft<wdsz) | |||
{ | |||
ToastUtils.warning("果糖左仓温度未达到设置值,不允许校准..."); | |||
return; | |||
@@ -195,7 +195,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
{ | |||
Object sx=ExecuteTheRecipe.ReadPLC("果糖右温度设置"); | |||
int wdsz=sx==null?0:(int)sx; | |||
if(gt2wd<wdsz) | |||
if(ExecuteTheRecipe.SugarTempRight<wdsz) | |||
{ | |||
ToastUtils.warning("果糖右仓温度未达到设置值,不允许校准..."); | |||
return; | |||
@@ -203,21 +203,28 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
} | |||
} | |||
ExecuteTheRecipe.WritePLC("校准完成",false,null); | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
ExecuteTheRecipe.WritePLC("通道校准", true, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.info("启动通道校准成功!"); | |||
} | |||
new Thread(new Runnable() { | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.error("启动通道校准失败!"); | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("校准完成",false,null); | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
ExecuteTheRecipe.WritePLC("通道校准", true, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.info("启动通道校准成功!"); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.error("启动通道校准失败!"); | |||
} | |||
}); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}); | |||
}).start(); | |||
break; | |||
case R.id.kscl://开始出料 | |||
String zltext = edittext_cl.getText().toString(); | |||
@@ -239,7 +246,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
return; | |||
} | |||
if (!clk) | |||
if (!ExecuteTheRecipe.IsCup) | |||
{ | |||
ToastUtils.warning("出料口没有检测到器皿!"); | |||
return; | |||
@@ -262,20 +269,30 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
ToastUtils.warning("请打开通道开关!"); | |||
return; | |||
} | |||
ExecuteTheRecipe.WritePLC("配料完成",false,null); | |||
ExecuteTheRecipe.WritePLC("手自切换", true,null); | |||
ExecuteTheRecipe.WritePLC("需求值" + selectIndexSilos, (short) ((int) (zl * 10)), new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.warning("需求值下发成功!开始配料......"); | |||
ExecuteTheRecipe.WritePLC("配料启动", true, null); | |||
} | |||
short kkk=(short) ((int) (zl * 10)); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.error("需求值下发失败!请稍后重试......"); | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("配料完成",false,null); | |||
ExecuteTheRecipe.WritePLC("手自切换", true,null); | |||
ExecuteTheRecipe.WritePLC("需求值" + selectIndexSilos,kkk,new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("配料启动", true, null); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
} | |||
}); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}); | |||
}).start(); | |||
ToastUtils.warning("需求值下发成功!开始配料......"); | |||
break; | |||
} | |||
} | |||
@@ -372,7 +389,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
public void handleMessage(Message msg) { | |||
switch (msg.what) { | |||
case 0: | |||
zhongliang.setText(String.valueOf((int)zhongliangxianshi / 10.0) + " g"); | |||
zhongliang.setText(String.valueOf((int)ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||
break; | |||
case 1: | |||
@@ -384,48 +401,17 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
} | |||
}; | |||
int zhongliangxianshi=0; | |||
boolean clk=false; | |||
int gt1wd=0; | |||
int gt2wd=0; | |||
/** | |||
* 实时显示线程 | |||
*/ | |||
public void Run() { | |||
new Thread(new Runnable() { | |||
ExecuteTheRecipe.WeighComplete=new IRun() { | |||
@Override | |||
public void run() { | |||
while(true) | |||
{ | |||
try { | |||
if(ConfigName.getInstance().PlcIsConnect && !ExecuteTheRecipe.IsMakeGood) | |||
{ | |||
Object obj= ExecuteTheRecipe.ReadPLC("称当前重量"); | |||
Object obj1= ExecuteTheRecipe.ReadPLC("出料口检测"); | |||
if(obj!=null) | |||
{ | |||
zhongliangxianshi=(int)obj;// | |||
mHandler.sendEmptyMessage(0); | |||
} | |||
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; | |||
} | |||
} | |||
Thread.sleep(200); | |||
} catch (InterruptedException e) { | |||
} | |||
} | |||
public void Run() { | |||
mHandler.sendEmptyMessage(0); | |||
} | |||
}).start(); | |||
}; | |||
ExecuteTheRecipe.OnChargeMixtureComNotPar = new IRun() { | |||
@Override | |||
@@ -444,6 +430,7 @@ public class JiaoYan_lsjy_fragment extends BaseFragment { | |||
ToastUtils.warning("通道校准完成!"); | |||
// 在2秒后执行按钮操作 | |||
int zhongliangxianshi=ExecuteTheRecipe.OutletWeigh; | |||
ExecuteTheRecipe.WritePLC("校准值"+kkk,(short) zhongliangxianshi,null); | |||
String s = String.valueOf(zhongliangxianshi); | |||
@@ -0,0 +1,201 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.content.Context; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.os.SystemClock; | |||
import android.util.AttributeSet; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.Button; | |||
import android.widget.Chronometer; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import androidx.annotation.Nullable; | |||
import androidx.recyclerview.widget.LinearLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME; | |||
import com.bonait.bnframework.common.db.mode.BPA_ORDER; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER; | |||
import com.bonait.bnframework.common.db.res.ResGoodProperty; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.lsjy_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.pfsx_adapter; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class add_manguan_control extends LinearLayout { | |||
@BindView(R.id.quzhizuo) | |||
Button quzhizuo; | |||
@BindView(R.id.close_from_good) | |||
Button close_from_good; | |||
@BindView(R.id.image_gz) | |||
ImageView image_gz; | |||
@BindView(R.id.jishiqi) | |||
RelativeLayout jishiqi; | |||
@BindView(R.id.runtime) | |||
Chronometer runtime; | |||
public ArrayList<BPA_SILOS> siloslist=new ArrayList<>(); | |||
/** | |||
* 点击事件 | |||
*/ | |||
public MyClickListener mListener = null; | |||
private View root; | |||
private Context contextMian; | |||
public add_manguan_control(Context context, @Nullable AttributeSet attrs) { | |||
super(context, attrs); | |||
contextMian=context; | |||
root = LayoutInflater.from(context).inflate(R.layout.dialog_add_manguan, this); | |||
ButterKnife.bind(this, root); | |||
Init(); | |||
} | |||
public void Init() { | |||
//初始化界面控件的事件 | |||
initEvent(); | |||
} | |||
private void initData() { | |||
//2.填充规则数据,查询所有属性大类 | |||
siloslist= QueryDB.GetSilosALL(); | |||
} | |||
/** | |||
* 设置数据 | |||
* | |||
* @param | |||
*/ | |||
public void SetData() { | |||
try { | |||
initData(); | |||
} catch (Exception ex) { | |||
} | |||
} | |||
private void initEvent() { | |||
quzhizuo.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
SaveData(); | |||
} | |||
}); | |||
close_from_good.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
if (mListener != null) { | |||
mListener.clickListenerNew(v, 0, null); | |||
} | |||
} | |||
}); | |||
//为Chronomter绑定事件监听器,超过一小时自动日内告知 | |||
runtime.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { | |||
@Override | |||
public void onChronometerTick(Chronometer chronometer) { | |||
//如果计时到现在超过了一小时秒 10s | |||
if (SystemClock.elapsedRealtime() - runtime.getBase() > 120 * 1000) { | |||
StopTime(); | |||
} | |||
} | |||
}); | |||
} | |||
private Handler mHandler = new Handler() { | |||
public void handleMessage(Message msg) { | |||
switch (msg.what) { | |||
case 0: | |||
if(i>=siloslist.size()) | |||
{ | |||
StopTime(); | |||
ToastUtils.info("料仓满管完成!"); | |||
} | |||
break; | |||
case 1: | |||
break; | |||
case 2: | |||
break; | |||
} | |||
} | |||
}; | |||
int i=0; | |||
/** | |||
* 保存数据 | |||
*/ | |||
public boolean SaveData() { | |||
i=0; | |||
ToastUtils.info("料仓满管开始!"); | |||
StartTime(); | |||
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++; | |||
} | |||
}, time * 1000); | |||
} | |||
return false; | |||
} | |||
/** | |||
* 启动定时器 | |||
*/ | |||
public void StartTime() { | |||
jishiqi.setVisibility(View.VISIBLE); | |||
image_gz.setVisibility(View.GONE); | |||
runtime.setBase(SystemClock.elapsedRealtime()); | |||
runtime.start(); | |||
} | |||
/** | |||
* 停止定时器 | |||
*/ | |||
public int StopTime() { | |||
jishiqi.setVisibility(View.GONE); | |||
image_gz.setVisibility(View.VISIBLE); | |||
long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase(); | |||
runtime.stop(); | |||
int time=(int) (elapsedMillis / 1000); | |||
return time;//当前点击多少秒 | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<shape | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:shape="oval" | |||
android:useLevel="false"> | |||
<stroke | |||
android:width="3dp" | |||
android:color="#5200A8E1"/> | |||
<size android:width="80dp" | |||
android:height="80dp"/> | |||
</shape> |
@@ -12,22 +12,21 @@ | |||
android:background="@color/main_background" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_marginTop="@dimen/dp_40" | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:text="自动补水:" | |||
android:textAlignment="center" /> | |||
android:src="@mipmap/aibs"> | |||
</ImageView> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
android:layout_centerInParent="true" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
@@ -36,9 +35,15 @@ | |||
android:id="@+id/control_switch_zdbs" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true" | |||
/> | |||
android:focusable="true"/> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_centerInParent="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
@@ -61,18 +66,10 @@ | |||
android:text="0.0"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
</LinearLayout> | |||
<Button | |||
android:layout_marginLeft="285dp" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:id="@+id/save_time" | |||
android:layout_width="110dp" | |||
android:layout_width="260dp" | |||
android:layout_height="40dp" | |||
android:layout_alignParentLeft="true" | |||
android:background="@drawable/bg_btn_login_selected" |
@@ -97,7 +97,11 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:visibility="gone"/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.add_manguan_control | |||
android:id="@+id/add_manguan" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:visibility="gone"/> | |||
<LinearLayout | |||
android:layout_marginLeft="10dp" | |||
android:layout_width="match_parent" | |||
@@ -0,0 +1,158 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/dialogbj"> | |||
<RelativeLayout | |||
android:layout_centerInParent="true" | |||
android:layout_margin="50dp" | |||
android:layout_width="500dp" | |||
android:layout_height="700dp" | |||
android:background="@drawable/common_bg_with_radius_and_border"> | |||
<Button | |||
android:id="@+id/close_from_good" | |||
android:layout_width="32dp" | |||
android:layout_height="32dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_alignParentTop="true" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:background="@mipmap/close_image" | |||
android:textSize="14dp" | |||
android:textColor="@color/white"/> | |||
<TextView | |||
android:layout_centerHorizontal="true" | |||
android:id="@+id/makegoodtitle" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="料仓满管" | |||
android:textSize="20dp" | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
</TextView> | |||
<RelativeLayout | |||
android:layout_marginTop="46dp" | |||
android:layout_marginBottom="50dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginRight="30dp" | |||
android:orientation="vertical" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<!--菜谱名称行--> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
</LinearLayout> | |||
<!--边框分割细线--> | |||
<LinearLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="1dp" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
android:background="@color/color3" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginBottom="30dp"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<RelativeLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<ImageView | |||
android:clickable="false" | |||
android:layout_width="420dp" | |||
android:layout_height="420dp" | |||
android:src="@drawable/huanxing" /> | |||
<ImageView | |||
android:layout_centerInParent="true" | |||
android:clickable="false" | |||
android:layout_width="320dp" | |||
android:layout_height="320dp" | |||
android:src="@drawable/huanxing" /> | |||
<ImageView | |||
android:layout_centerInParent="true" | |||
android:clickable="false" | |||
android:layout_width="260dp" | |||
android:layout_height="260dp" | |||
android:src="@drawable/zailaiyibei" /> | |||
<ImageView | |||
android:id="@+id/image_gz" | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/manguangtubiao" | |||
/> | |||
<RelativeLayout | |||
android:visibility="gone" | |||
android:layout_centerInParent="true" | |||
android:id="@+id/jishiqi" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="用时: " | |||
android:textColor="@color/white" | |||
android:textSize="24dp"/> | |||
<Chronometer | |||
android:id="@+id/runtime" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="@color/purple_primary" | |||
android:textStyle="bold|italic" | |||
android:textSize="30dp" | |||
/> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text=" 秒" | |||
android:textColor="@color/white" | |||
android:textSize="24dp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<Button | |||
android:layout_alignParentBottom="true" | |||
android:id="@+id/quzhizuo" | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="65dp" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="满管" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</RelativeLayout> |
@@ -3,26 +3,56 @@ | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
> | |||
android:layout_height="match_parent"> | |||
<RelativeLayout | |||
android:id="@+id/jishiqi" | |||
android:visibility="gone" | |||
android:layout_marginTop="10dp" | |||
android:layout_marginLeft="20dp" | |||
android:layout_width="180dp" | |||
android:layout_height="250dp" | |||
android:orientation="horizontal" | |||
android:background="#4003AFFF"> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="正在计时: " | |||
android:textColor="@color/gray_deep"/> | |||
<Chronometer | |||
android:id="@+id/runtime" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="@color/purple_primary" | |||
android:textStyle="bold|italic"/> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text=" 秒" | |||
android:textColor="@color/gray_deep"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:id="@+id/main_laout" | |||
android:layout_marginLeft="20dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_marginTop="20dp" | |||
android:layout_marginTop="10dp" | |||
android:id="@+id/name" | |||
android:layout_width="wrap_content" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="通道一通道一通道一通道一通道一通道一" | |||
android:text="通道1(液料仓)" | |||
android:minWidth="140dp" | |||
android:textAlignment="center" | |||
android:textColor="@color/app_color_blue" | |||
android:textSize="@dimen/text_size_16" /> | |||
<TextView | |||
android:id="@+id/wlname" | |||
android:layout_marginTop="10dp" | |||
@@ -30,50 +60,59 @@ | |||
android:layout_height="wrap_content" | |||
android:textAlignment="center" | |||
android:text="牛奶"/> | |||
<LinearLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:text="满管时间(s)"/> | |||
<EditText | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_centerInParent="true" | |||
android:id="@+id/edittext_mgsj" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="number|numberDecimal" | |||
android:digits="0123456789" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="30"/> | |||
<!-- <RelativeLayout--> | |||
<!-- android:layout_marginTop="10dp"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="wrap_content">--> | |||
<!-- <LinearLayout--> | |||
<!-- android:layout_centerInParent="true"--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:orientation="horizontal">--> | |||
<!-- <TextView--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:text="系数:"--> | |||
<!-- android:textAlignment="center" />--> | |||
<!-- <EditText--> | |||
<!-- android:id="@+id/edittext_xs"--> | |||
<!-- android:layout_width="60dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:background="@drawable/input_bj"--> | |||
<!-- android:hint="请输入"--> | |||
<!-- android:inputType="number|numberDecimal"--> | |||
<!-- android:digits="0123456789."--> | |||
<!-- android:maxLines="1"--> | |||
<!-- android:padding="3dp"--> | |||
<!-- android:textSize="12dp"--> | |||
<!-- android:text="0.0"/>--> | |||
<!-- </LinearLayout>--> | |||
<!-- </RelativeLayout>--> | |||
<TextView | |||
</LinearLayout> | |||
<Button | |||
android:layout_marginTop="10dp" | |||
android:id="@+id/save_mg" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:textAlignment="center" | |||
android:text="校准开关"/> | |||
<RelativeLayout | |||
android:layout_height="25dp" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="时间校准" | |||
android:textColor="@color/white" | |||
android:textSize="14dp" /> | |||
<LinearLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent"> | |||
<TextView | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:text="校准开关" /> | |||
</RelativeLayout> | |||
<com.suke.widget.SwitchButton | |||
android:layout_centerInParent="true" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" | |||
app:sb_button_color="@color/app_color_blue" | |||
@@ -82,23 +121,24 @@ | |||
android:layout_height="wrap_content" | |||
android:focusable="true" | |||
/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<TextView | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:textAlignment="center" | |||
android:text="通道重量(g)"/> | |||
<RelativeLayout | |||
<LinearLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:text="通道重量(g)" | |||
android:textAlignment="center" /> | |||
<EditText | |||
android:layout_centerInParent="true" | |||
android:id="@+id/edittext_tdzl" | |||
android:layout_width="100dp" | |||
android:layout_width="95dp" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
@@ -108,15 +148,17 @@ | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0.0"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/save_value" | |||
android:layout_width="100dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="26dp" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
@@ -125,6 +167,5 @@ | |||
android:textSize="14dp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> |