@@ -43,10 +43,7 @@ | |||
<activity | |||
android:name=".modules.mine.fragment.from.UserActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.JiaoYan_clsfbc_fragment" | |||
android:exported="false" | |||
tools:ignore="Instantiatable" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.JiaoYan_sdkz_fragment" | |||
android:exported="false" | |||
@@ -59,10 +56,7 @@ | |||
android:name=".modules.home.fragment.from.WdszActivity" | |||
android:exported="false" | |||
tools:ignore="Instantiatable" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.JiaoYan_lsjy_fragment" | |||
android:exported="false" | |||
tools:ignore="Instantiatable" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.DzcjyActivity" | |||
android:exported="false" | |||
@@ -111,10 +105,6 @@ | |||
android:name=".modules.home.fragment.from.GoodPeiFangActivity" | |||
android:exported="false" | |||
tools:ignore="Instantiatable" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.SilosActivity" | |||
android:exported="false" | |||
tools:ignore="Instantiatable" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.Jcsjgl_sxgl_fragment" | |||
android:exported="false" | |||
@@ -2,6 +2,7 @@ package com.bonait.bnframework.modules.home.fragment.from; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
@@ -57,11 +58,12 @@ public class SilosNewActivity extends BaseActivity { | |||
private Context context; | |||
ArrayList<lcMode> lcModes = new ArrayList<>(); | |||
Activity activity; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_silos_new); | |||
activity=this; | |||
ButterKnife.bind(this); | |||
context = getContext(); | |||
initTopBar(); | |||
@@ -126,7 +128,7 @@ public class SilosNewActivity extends BaseActivity { | |||
//设置 | |||
} else if (k == 4) { | |||
//校准 | |||
silos_jz.SetData((lcMode) data, getSupportFragmentManager()); | |||
silos_jz.SetData((lcMode) data, activity); | |||
silos_jz.setVisibility(View.VISIBLE); | |||
} else if (k == 5) { | |||
// | |||
@@ -145,6 +147,7 @@ public class SilosNewActivity extends BaseActivity { | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
if (k == 0) { | |||
InitData(); | |||
silos_jz.setVisibility(View.GONE); | |||
} | |||
} | |||
@@ -178,8 +181,6 @@ public class SilosNewActivity extends BaseActivity { | |||
List<Object> value = map.get(key); | |||
LinkMode linkMode = new LinkMode(key.toString(), value, i == 0 ? true : false); | |||
Fdata.add(linkMode); | |||
i++; | |||
} | |||
@@ -206,6 +207,7 @@ public class SilosNewActivity extends BaseActivity { | |||
viewpager_silos.setAdapter(adapter); | |||
tabs.setupWithViewPager(viewpager_silos, true); | |||
tabs.selectTab(0); | |||
adapter.notifyDataSetChanged(); | |||
} | |||
@@ -1,10 +1,12 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.os.SystemClock; | |||
import android.util.AttributeSet; | |||
import android.util.Log; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
@@ -40,7 +42,7 @@ import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
public class Silos_item_jiaoyan_fragment extends LinearLayout { | |||
//region 界面布局 | |||
@BindView(R.id.wuliaojiaozhun) | |||
@@ -109,7 +111,6 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
EditText bcjz_clsj; | |||
//endregion | |||
//region 变量 | |||
private Context context; | |||
/** | |||
@@ -123,20 +124,12 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
//endregion | |||
//region 界面实例 | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_silos_item_jiaoyan, null); | |||
private View root; | |||
public Silos_item_jiaoyan_fragment(Context _context, @Nullable AttributeSet attrs) { | |||
super(_context, attrs); | |||
root= LayoutInflater.from(context).inflate(R.layout.fragment_silos_item_jiaoyan, this); | |||
context=_context; | |||
ButterKnife.bind(this, root); | |||
context = getContext(); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
InitView(); | |||
} | |||
//endregion | |||
@@ -188,21 +181,19 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
}); | |||
} | |||
public QMUIFragment SetType(String type) { | |||
TypeName = type; | |||
return this; | |||
} | |||
public Activity activity=null; | |||
/** | |||
* 设置名称 | |||
* | |||
* @param | |||
*/ | |||
public QMUIFragment SetData(lcMode mode) { | |||
public void SetData(String type, lcMode mode, Activity ac) { | |||
TypeName = type; | |||
lcMode = mode; | |||
activity=ac; | |||
InitView(); | |||
Run(); | |||
return this; | |||
} | |||
//endregion | |||
@@ -229,29 +220,32 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
public void Run() { | |||
final int kkk = lcMode.num; | |||
try { | |||
getActivity().runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
new Handler().postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
// 在2秒后执行按钮操作 | |||
int zhongliangxianshi = ExecuteTheRecipe.OutletWeigh; | |||
ExecuteTheRecipe.WritePLC("校准值" + kkk, (short) zhongliangxianshi, null); | |||
String s = String.valueOf(zhongliangxianshi); | |||
String zll = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
wljz3.setText(zll + ""); | |||
lcMode.jValue = zll; | |||
QueryDB.UpdateJYZ(lcMode.id, zll); | |||
ToastUtils.warning("通道校准完成!"); | |||
} | |||
}, 2000); | |||
} catch (Exception e) { | |||
ToastUtils.error("重量解析显示异常!" + e.getMessage()); | |||
if(activity!=null) | |||
{ | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
new Handler().postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
// 在2秒后执行按钮操作 | |||
int zhongliangxianshi = ExecuteTheRecipe.OutletWeigh; | |||
ExecuteTheRecipe.WritePLC("校准值" + kkk, (short) zhongliangxianshi, null); | |||
String s = String.valueOf(zhongliangxianshi); | |||
String zll = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
wljz3.setText(zll + ""); | |||
lcMode.jValue = zll; | |||
QueryDB.UpdateJYZ(lcMode.id, zll); | |||
ToastUtils.warning("通道校准完成!"); | |||
} | |||
}, 2000); | |||
} catch (Exception e) { | |||
ToastUtils.error("重量解析显示异常!" + e.getMessage()); | |||
} | |||
} | |||
} | |||
}); | |||
}); | |||
} | |||
} catch (Exception ex) { | |||
Log.d("dsds", "Run: " + ex.getMessage()); | |||
} | |||
@@ -261,13 +255,10 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
while (!isAdded()) { | |||
try { | |||
Thread.sleep(100); | |||
} catch (InterruptedException e) { | |||
} | |||
} | |||
getActivity().runOnUiThread(new Runnable() { | |||
if(activity!=null) | |||
{ | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
exit_mgjz.setText(lcMode.bValue + ""); | |||
@@ -289,6 +280,7 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
bcjz_gxs.setText(tdclsj); | |||
} | |||
}); | |||
} | |||
} | |||
}).start(); | |||
@@ -620,12 +612,6 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
} | |||
//endregion | |||
//region 保存校准时间 | |||
public void SaveTime1() { | |||
} | |||
//endregion | |||
//region 定时器 | |||
/** | |||
@@ -671,36 +657,5 @@ public class Silos_item_jiaoyan_fragment extends BaseFragment { | |||
//endregion | |||
//region 关闭窗体事件 | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("通道" + lcMode.num + "校准开关", false, null); | |||
ExecuteTheRecipe.WritePLC("手自切换", true, null); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
//endregion | |||
} |
@@ -1,8 +1,12 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.DialogInterface; | |||
import android.graphics.Color; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.os.SystemClock; | |||
import android.util.AttributeSet; | |||
import android.util.Log; | |||
import android.view.LayoutInflater; | |||
@@ -10,6 +14,7 @@ import android.view.MotionEvent; | |||
import android.view.View; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.Chronometer; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
@@ -23,10 +28,12 @@ import androidx.fragment.app.FragmentManager; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.IRun; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.model.mode.ResMenuLeft; | |||
@@ -37,6 +44,7 @@ import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.tab.QMUIBasicTabSegment; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import com.suke.widget.SwitchButton; | |||
import java.math.BigDecimal; | |||
import java.text.DecimalFormat; | |||
@@ -45,18 +53,14 @@ import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class silos_jiaoyan extends LinearLayout { | |||
//region qita | |||
@BindView(R.id.close_from) | |||
Button close_from; | |||
@BindView(R.id.tabs_jiaozhun) | |||
QMUITabSegment tabs_jiaozhun; | |||
@BindView(R.id.title_bc) | |||
TextView title_bc; | |||
@BindView(R.id.viewpager_jiaozhun) | |||
QMUIViewPager viewpager_jiaozhun; | |||
/** | |||
* 当前料仓 | |||
*/ | |||
@@ -65,100 +69,716 @@ public class silos_jiaoyan extends LinearLayout { | |||
* 窗体 | |||
*/ | |||
public FragmentManager fragmentManager; | |||
/** | |||
* 空间 | |||
*/ | |||
public List<ResMenuLeft> froms=new ArrayList<>(); | |||
/** | |||
* 点击事件 | |||
*/ | |||
public MyClickListener mListener=null; | |||
private View root; | |||
//endregion | |||
//region 界面布局 | |||
@BindView(R.id.wuliaojiaozhun) | |||
LinearLayout wuliaojiaozhun; | |||
@BindView(R.id.manguanjiaozhun) | |||
LinearLayout manguanjiaozhun; | |||
@BindView(R.id.jiaoliaojiaozhun) | |||
LinearLayout jiaoliaojiaozhun; | |||
@BindView(R.id.buchangjiaozhun) | |||
LinearLayout buchangjiaozhun; | |||
//endregion | |||
//region 称相关 | |||
@BindView(R.id.dianzicheng1) | |||
TextView dianzicheng1; | |||
@BindView(R.id.dianzicheng2) | |||
TextView dianzicheng2; | |||
@BindView(R.id.dianzicheng3) | |||
TextView dianzicheng3; | |||
@BindView(R.id.chuliaokeshu1) | |||
EditText chuliaokeshu1; | |||
@BindView(R.id.chuliaokeshu2) | |||
EditText chuliaokeshu2; | |||
@BindView(R.id.chuliaokeshu3) | |||
EditText chuliaokeshu3; | |||
//endregion | |||
//region 满管 | |||
@BindView(R.id.runtime) | |||
Chronometer runtime; | |||
@BindView(R.id.exit_mgjz) | |||
EditText exit_mgjz; | |||
final int[] time = {0}; | |||
final int[] zl = {0}; | |||
//endregion | |||
//region 物料校准变量 | |||
@BindView(R.id.wljz1) | |||
EditText wljz1; | |||
@BindView(R.id.wljz2) | |||
EditText wljz2; | |||
@BindView(R.id.wljz3) | |||
EditText wljz3; | |||
@BindView(R.id.text_wljz) | |||
TextView text_wljz2; | |||
//endregion | |||
//region 通道补偿 | |||
@BindView(R.id.control_switch) | |||
SwitchButton control_switch; | |||
@BindView(R.id.bcjz_gxs) | |||
EditText bcjz_gxs; | |||
@BindView(R.id.bcjz_dxs) | |||
EditText bcjz_dxs; | |||
@BindView(R.id.bcjz_clsj) | |||
EditText bcjz_clsj; | |||
//endregion | |||
public silos_jiaoyan(Context context, @Nullable AttributeSet attrs) { | |||
super(context, attrs); | |||
root= LayoutInflater.from(context).inflate(R.layout.silos_jiaoyan_item, this); | |||
ButterKnife.bind(this, root); | |||
Init(); | |||
} | |||
public void Init() | |||
{ | |||
//初始化界面控件的事件 | |||
initEvent(); | |||
} | |||
@BindView(R.id.text_wlkz) | |||
TextView text_wlkz; | |||
@BindView(R.id.text_mgkz) | |||
TextView text_mgkz; | |||
@BindView(R.id.text_jlkz) | |||
TextView text_jlkz; | |||
@BindView(R.id.text_bckz) | |||
TextView text_bckz; | |||
@BindView(R.id.text_jlkz1) | |||
TextView text_jlkz1; | |||
@BindView(R.id.text_bckz1) | |||
TextView text_bckz1; | |||
/** | |||
* 初始化数据 | |||
*/ | |||
private void initData() | |||
{ | |||
title_bc.setText(lcMode.num+" "+lcMode.materialName); | |||
froms.clear(); | |||
Silos_item_jiaoyan_fragment jiaoyan_fragment=new Silos_item_jiaoyan_fragment(); | |||
if(lcMode.name.equals("外置仓")) | |||
{ | |||
froms.add(new ResMenuLeft(new Silos_item_jiaoyan_fragment().SetType("物料校准"),"物料校准",0,0,true)); | |||
froms.add(new ResMenuLeft(new Silos_item_jiaoyan_fragment().SetType("满管校准"),"满管校准",0,0,false)); | |||
froms.add(new ResMenuLeft(new Silos_item_jiaoyan_fragment().SetType("酱料校准"),"酱料校准",0,0,false)); | |||
froms.add(new ResMenuLeft(new Silos_item_jiaoyan_fragment().SetType("补偿校准"),"补偿校准",0,0,false)); | |||
}else | |||
{ | |||
froms.add(new ResMenuLeft(new Silos_item_jiaoyan_fragment().SetType("物料校准"),"物料校准",0,0,true)); | |||
froms.add(new ResMenuLeft(new Silos_item_jiaoyan_fragment().SetType("满管校准"),"满管校准",0,0,false)); | |||
text_jlkz.setVisibility(View.GONE); | |||
text_bckz.setVisibility(View.GONE); | |||
text_jlkz1.setVisibility(View.GONE); | |||
text_bckz1.setVisibility(View.GONE); | |||
} | |||
} | |||
QMUIFragmentPagerAdapter adapter = new QMUIFragmentPagerAdapter(fragmentManager) { | |||
private void initEvent() | |||
{ | |||
//关闭窗体 | |||
close_from.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public int getCount() { | |||
return froms.size(); | |||
public void onClick(View v) { | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("通道" + lcMode.num + "校准开关", false, null); | |||
ExecuteTheRecipe.WritePLC("手自切换", true, null); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
if (mListener != null) { | |||
mListener.clickListenerNew(v,0,null); | |||
} | |||
} | |||
}); | |||
text_wlkz.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public QMUIFragment createFragment(int position) { | |||
//显示数元 | |||
return ((Silos_item_jiaoyan_fragment)froms.get(position).fragment).SetData(lcMode); | |||
public void onClick(View v) { | |||
InitView("物料校准"); | |||
} | |||
}); | |||
text_mgkz.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
InitView("满管校准"); | |||
} | |||
}); | |||
text_jlkz.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
InitView("酱料校准"); | |||
} | |||
}); | |||
text_bckz.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
InitView("补偿校准"); | |||
} | |||
}); | |||
} | |||
Activity activity =null; | |||
/** | |||
* 设置数据 | |||
* @param | |||
*/ | |||
public void SetData(lcMode _lcMode,Activity ac) | |||
{ | |||
activity=ac; | |||
this.lcMode=_lcMode; | |||
initData(); | |||
InitView("物料校准"); | |||
Run(); | |||
} | |||
//region 初始化设置数据 | |||
public String TypeName="物料校准"; | |||
/** | |||
* 初始化界面 | |||
*/ | |||
public void InitView(String _TypeName) { | |||
TypeName=_TypeName; | |||
switch (TypeName) { | |||
case "满管校准": | |||
wuliaojiaozhun.setVisibility(View.GONE); | |||
manguanjiaozhun.setVisibility(View.VISIBLE); | |||
jiaoliaojiaozhun.setVisibility(View.GONE); | |||
buchangjiaozhun.setVisibility(View.GONE); | |||
text_wlkz.setTextColor(Color.BLACK); | |||
text_mgkz.setTextColor(Color.parseColor("#7dcce1")); | |||
text_jlkz.setTextColor(Color.BLACK); | |||
text_bckz.setTextColor(Color.BLACK); | |||
break; | |||
case "酱料校准": | |||
wuliaojiaozhun.setVisibility(View.GONE); | |||
manguanjiaozhun.setVisibility(View.GONE); | |||
jiaoliaojiaozhun.setVisibility(View.VISIBLE); | |||
buchangjiaozhun.setVisibility(View.GONE); | |||
text_wlkz.setTextColor(Color.BLACK); | |||
text_mgkz.setTextColor(Color.BLACK); | |||
text_jlkz.setTextColor(Color.parseColor("#7dcce1")); | |||
text_bckz.setTextColor(Color.BLACK); | |||
break; | |||
case "补偿校准": | |||
wuliaojiaozhun.setVisibility(View.GONE); | |||
manguanjiaozhun.setVisibility(View.GONE); | |||
jiaoliaojiaozhun.setVisibility(View.GONE); | |||
buchangjiaozhun.setVisibility(View.VISIBLE); | |||
text_wlkz.setTextColor(Color.BLACK); | |||
text_mgkz.setTextColor(Color.BLACK); | |||
text_jlkz.setTextColor(Color.BLACK); | |||
text_bckz.setTextColor(Color.parseColor("#7dcce1")); | |||
break; | |||
default: | |||
wuliaojiaozhun.setVisibility(View.VISIBLE); | |||
manguanjiaozhun.setVisibility(View.GONE); | |||
jiaoliaojiaozhun.setVisibility(View.GONE); | |||
buchangjiaozhun.setVisibility(View.GONE); | |||
text_wlkz.setTextColor(Color.parseColor("#7dcce1")); | |||
text_mgkz.setTextColor(Color.BLACK); | |||
text_jlkz.setTextColor(Color.BLACK); | |||
text_bckz.setTextColor(Color.BLACK); | |||
break; | |||
} | |||
/** | |||
* 计时器超时 | |||
*/ | |||
runtime.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { | |||
@Override | |||
public CharSequence getPageTitle(int position) { | |||
return froms.get(position).name.toString(); | |||
public void onChronometerTick(Chronometer chronometer) { | |||
//如果计时到现在超过了一小时秒 20s | |||
if (SystemClock.elapsedRealtime() - runtime.getBase() > 20 * 1000) { | |||
mHandler.sendEmptyMessage(1); | |||
} | |||
} | |||
}); | |||
} | |||
//endregion | |||
//region 外部消息通知 | |||
/** | |||
* 通知事件 | |||
*/ | |||
public void Run() { | |||
//重量通知 | |||
ExecuteTheRecipe.WeighComplete = new IRun() { | |||
@Override | |||
public void Run() { | |||
mHandler.sendEmptyMessage(0); | |||
if (ExecuteTheRecipe.OutletWeigh >= (zl[0] + 2))//当前重量大于2g | |||
{ | |||
mHandler.sendEmptyMessage(1); | |||
} | |||
} | |||
}; | |||
//通道校准完成 | |||
ExecuteTheRecipe.OnChargeMixtureComNotPar = new IRun() { | |||
@Override | |||
public int getItemPosition(@NonNull Object object) { | |||
return super.getItemPosition(object); | |||
public void Run() { | |||
final int kkk = lcMode.num; | |||
try { | |||
if(activity!=null) | |||
{ | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
new Handler().postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
// 在2秒后执行按钮操作 | |||
int zhongliangxianshi = ExecuteTheRecipe.OutletWeigh; | |||
ExecuteTheRecipe.WritePLC("校准值" + kkk, (short) zhongliangxianshi, null); | |||
String s = String.valueOf(zhongliangxianshi); | |||
String zll = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
wljz3.setText(zll + ""); | |||
lcMode.jValue = zll; | |||
QueryDB.UpdateJYZ(lcMode.id, zll); | |||
ToastUtils.warning("通道校准完成!"); | |||
} | |||
}, 2000); | |||
} catch (Exception e) { | |||
ToastUtils.error("重量解析显示异常!" + e.getMessage()); | |||
} | |||
} | |||
}); | |||
} | |||
} catch (Exception ex) { | |||
Log.d("dsds", "Run: " + ex.getMessage()); | |||
} | |||
} | |||
}; | |||
viewpager_jiaozhun.setAdapter(adapter); | |||
tabs_jiaozhun.setupWithViewPager(viewpager_jiaozhun, true); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
if(activity!=null) | |||
{ | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
exit_mgjz.setText(lcMode.bValue + ""); | |||
//填充校准时间 | |||
String time = lcMode.jTime == null ? "0.0" : lcMode.jTime; | |||
String ftime = lcMode.fTime == null ? "0.0" : lcMode.fTime; | |||
String jvalue = lcMode.jValue == null ? "0.0" : lcMode.jValue; | |||
wljz1.setText(time); | |||
wljz2.setText(ftime); | |||
wljz3.setText(jvalue); | |||
String Gxs = lcMode.Gxs == null ? "0.0" : lcMode.Gxs; | |||
String Lxs = lcMode.Lxs == null ? "0.0" : lcMode.Lxs; | |||
String tdclsj = lcMode.tdclsj == null ? "0.0" : lcMode.tdclsj; | |||
control_switch.setChecked(lcMode.isOpenbcsf == 1); | |||
bcjz_gxs.setText(Gxs); | |||
bcjz_dxs.setText(Lxs); | |||
bcjz_clsj.setText(tdclsj); | |||
} | |||
}); | |||
} | |||
} | |||
}).start(); | |||
} | |||
//endregion | |||
private void initEvent() | |||
{ | |||
//关闭窗体 | |||
close_from.setOnClickListener(new View.OnClickListener() { | |||
//region 刷新界面 | |||
/** | |||
* 界面刷新 | |||
*/ | |||
private Handler mHandler = new Handler() { | |||
public void handleMessage(Message msg) { | |||
switch (msg.what) { | |||
case 0: | |||
dianzicheng1.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||
dianzicheng2.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||
dianzicheng3.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||
break; | |||
case 1: | |||
time[0] = StopTime(); | |||
lcMode.bValue = time[0]; | |||
exit_mgjz.setText(time[0] + ""); | |||
QueryDB.UpdateMGTime(lcMode.id, time[0]); | |||
break; | |||
case 2: | |||
break; | |||
} | |||
} | |||
}; | |||
//endregion | |||
//region 点击事件 | |||
@OnClick({ | |||
R.id.qingling1, R.id.qingling2, R.id.qingling3, | |||
R.id.chuliao1, R.id.chuliao2, R.id.chuliao3, | |||
R.id.click_mgjz, R.id.click_mgjz_save, | |||
R.id.click_wljz, R.id.click_wljz_save, | |||
R.id.control_switch, R.id.click_bcjz_save, | |||
}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.qingling1: | |||
case R.id.qingling2: | |||
case R.id.qingling3: | |||
dzcql(); | |||
break; | |||
case R.id.chuliao1: | |||
case R.id.chuliao2: | |||
case R.id.chuliao3: | |||
mncl(); | |||
break; | |||
case R.id.click_mgjz://满管校准 | |||
zl[0] = ExecuteTheRecipe.OutletWeigh; | |||
StartTime(); | |||
break; | |||
case R.id.click_mgjz_save://满管校准 保存参数 | |||
String value1 = exit_mgjz.getText().toString(); | |||
int val1 = 0; | |||
try { | |||
val1 = (value1 == null || value1.isEmpty()) ? 0 : Integer.parseInt(value1); | |||
lcMode.bValue = val1; | |||
QueryDB.UpdateMGTime(lcMode.id, val1); | |||
ToastUtils.info("校准时间保存成功!"); | |||
} catch (Exception e) { | |||
} | |||
break; | |||
case R.id.click_wljz://物料校准 | |||
WLJZ(); | |||
break; | |||
case R.id.click_wljz_save://物料校准 保存参数 | |||
SaveWLJZ(); | |||
break; | |||
case R.id.control_switch://通道开关 | |||
boolean isopen = control_switch.isChecked(); | |||
if (ConfigName.getInstance().PlcIsConnect) { | |||
lcMode.isOpenbcsf=isopen?1:0; | |||
ExecuteTheRecipe.WritePLC("通道" + lcMode.num + "补偿开关", isopen, null); | |||
QueryDB.UpdateSilosisOpenbcsf(lcMode.id, isopen); | |||
ToastUtils.info(lcMode.name.toString() + (isopen ? "打开" : "关闭") + "成功!"); | |||
} else { | |||
ToastUtils.warning(lcMode.name.toString() + (isopen ? "打开" : "关闭") + "失败!PLC未连接!!"); | |||
} | |||
break; | |||
case R.id.click_bcjz_save://补偿校准 保存参数 | |||
SaveBCJZ(); | |||
break; | |||
} | |||
} | |||
//endregion | |||
//region 电子秤清零 | |||
/** | |||
* 电子秤清零 | |||
*/ | |||
public void dzcql() { | |||
ExecuteTheRecipe.WritePLC("重量清零", true, new IWriteCallBack() { | |||
@Override | |||
public void onClick(View v) { | |||
if (mListener != null) { | |||
mListener.clickListenerNew(v,0,null); | |||
public void onSuccess() { | |||
ToastUtils.info("清零成功!"); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.error("清零失败!"); | |||
} | |||
}); | |||
} | |||
//endregion | |||
//region 模拟出料 | |||
/** | |||
* 模拟出料 | |||
*/ | |||
public void mncl() { | |||
String zltext = chuliaokeshu1.getText().toString(); | |||
if (TypeName.equals("物料校准")) { | |||
zltext = chuliaokeshu1.getText().toString(); | |||
} else if (TypeName.equals("酱料校准")) { | |||
zltext = chuliaokeshu2.getText().toString(); | |||
} else if (TypeName.equals("补偿校准")) { | |||
zltext = chuliaokeshu3.getText().toString(); | |||
} | |||
if (zltext.equals("")) { | |||
ToastUtils.warning("出料重量不能为空!"); | |||
return; | |||
} | |||
double zl = 0; | |||
try { | |||
zl = Double.parseDouble(zltext); | |||
} catch (Exception e) { | |||
ToastUtils.warning("出料重量获取异常!" + e.getMessage()); | |||
return; | |||
} | |||
if (zl <= 0) { | |||
ToastUtils.warning("出料重量至少大于0g!"); | |||
return; | |||
} | |||
if (!ExecuteTheRecipe.IsCup) { | |||
ToastUtils.warning("出料口没有检测到器皿!"); | |||
return; | |||
} | |||
short kkk = (short) ((int) (zl * 10)); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("配料完成", false, null); | |||
ExecuteTheRecipe.WritePLC("手自切换", true, null); | |||
ExecuteTheRecipe.WritePLC("需求值" + lcMode.num, kkk, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("配料启动", true, null); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
} | |||
}); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
ToastUtils.info("需求值下发成功!开始配料......"); | |||
} | |||
//endregion | |||
//region 保存物料校准参数 | |||
public void SaveWLJZ() { | |||
String stime = wljz1.getText().toString(); | |||
String ftime = wljz2.getText().toString(); | |||
String zl = wljz3.getText().toString(); | |||
if (stime.equals("")) { | |||
ToastUtils.warning("校准基准时间不能为空!"); | |||
return; | |||
} | |||
if (zl.equals("")) { | |||
ToastUtils.warning("校准重量不能为空!"); | |||
return; | |||
} | |||
int stime_1 = 0; | |||
int ftime_1 = 0; | |||
try { | |||
stime_1 = (int) Math.round((Double.parseDouble(stime) * 10)); | |||
} catch (Exception e) { | |||
ToastUtils.error("时间异常!" + e.getMessage()); | |||
return; | |||
} | |||
try { | |||
Double.parseDouble(zl); | |||
} catch (Exception e) { | |||
ToastUtils.error("重量异常!" + e.getMessage()); | |||
return; | |||
} | |||
if (!ConfigName.getInstance().versionSelectionEnum.equals("奶茶机")) { | |||
if (ftime.equals("")) { | |||
ToastUtils.warning("反转基准时间不能为空!"); | |||
return; | |||
} | |||
try { | |||
ftime_1 = (int) Math.round((Double.parseDouble(ftime) * 10)); | |||
} catch (Exception e) { | |||
ToastUtils.error("时间异常!" + e.getMessage()); | |||
return; | |||
} | |||
ExecuteTheRecipe.WritePLC("反转时间", (short) ftime_1, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.info("反转时间保存成功!"); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.error("反转时间保存失败!"); | |||
} | |||
}); | |||
} | |||
lcMode.fTime=ftime; | |||
lcMode.jTime=stime; | |||
lcMode.jValue=zl; | |||
QueryDB.UpdateSilosJZTime(lcMode.id, stime, ftime); | |||
QueryDB.UpdateJYZ(lcMode.id, zl); | |||
ExecuteTheRecipe.WritePLC("基准时间", (short) stime_1, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.info("校准基准时间保存成功!"); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.error("校准基准时间保存失败!"); | |||
} | |||
}); | |||
} | |||
//endregion | |||
//region 物料校准 | |||
public void WLJZ() { | |||
//判断是否为果糖->判断温度 | |||
if (ConfigName.getInstance().versionSelectionEnum.equals("奶茶机")) { | |||
if (lcMode.num == 11) { | |||
if (ExecuteTheRecipe.SugarTempLeft < ExecuteTheRecipe.SugarTempLeft_SZ) { | |||
ToastUtils.warning("果糖左仓温度未达到设置值,不允许校准..."); | |||
return; | |||
} | |||
} else if (lcMode.num == 12) { | |||
if (ExecuteTheRecipe.SugarTempRight < ExecuteTheRecipe.SugarTempRight_SZ) { | |||
ToastUtils.warning("果糖右仓温度未达到设置值,不允许校准..."); | |||
return; | |||
} | |||
} | |||
} | |||
new Thread(new Runnable() { | |||
@Override | |||
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(); | |||
} | |||
//endregion | |||
//region 补偿校准 | |||
public void SaveBCJZ() { | |||
Short H = 0; | |||
Short L = 0; | |||
Short time = 0; | |||
try { | |||
H = Short.parseShort(bcjz_gxs.getText().toString()); | |||
L = Short.parseShort(bcjz_dxs.getText().toString()); | |||
int ftime = (int) Math.round((Double.parseDouble(bcjz_clsj.getText().toString()) * 10)); | |||
time = (short) ftime; | |||
} catch (Exception ex) { | |||
ToastUtils.error("数据不合法,保存变量失败!" + ex.getMessage()); | |||
return; | |||
} | |||
Short finalH = H; | |||
Short finalL = L; | |||
Short finalTime = time; | |||
lcMode.Gxs = bcjz_gxs.getText().toString(); | |||
lcMode.Lxs = bcjz_dxs.getText().toString(); | |||
lcMode.tdclsj = bcjz_clsj.getText().toString(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("高系数" + lcMode.num, finalH, null); | |||
ExecuteTheRecipe.WritePLC("低系数" + lcMode.num, finalL, null); | |||
ExecuteTheRecipe.WritePLC("补偿" + lcMode.num + "时间", finalTime, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.info("保存变量成功!"); | |||
QueryDB.UpdateSilosisOpenbcsf(lcMode.id, bcjz_gxs.getText().toString(), | |||
bcjz_dxs.getText().toString(), bcjz_clsj.getText().toString()); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
ToastUtils.warning("保存变量失败!"); | |||
} | |||
}); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
//endregion | |||
//region 定时器 | |||
/** | |||
* 设置数据 | |||
* @param | |||
* 启动定时器 | |||
*/ | |||
public void SetData(lcMode _lcMode, FragmentManager _fragmentManager) | |||
{ | |||
this.lcMode=_lcMode; | |||
this.fragmentManager=_fragmentManager; | |||
public void StartTime() { | |||
runtime.setBase(SystemClock.elapsedRealtime()); | |||
runtime.start(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
//自动模式 | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
//开启 | |||
ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, true, null); | |||
} catch (Exception e) { | |||
initData(); | |||
} | |||
} | |||
}).start(); | |||
} | |||
/** | |||
* 停止定时器 | |||
*/ | |||
public int StopTime() { | |||
long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase(); | |||
runtime.stop(); | |||
int time = (int) (elapsedMillis / 1000); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, false, null); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
return time;//当前点击多少秒 | |||
} | |||
//endregion | |||
} |
@@ -4,7 +4,7 @@ | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.mode.Silos_item_jiaoyan_fragment"> | |||
> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -14,20 +14,75 @@ | |||
android:layout_margin="10dp" | |||
android:background="@drawable/common_bg_with_radius_and_border"> | |||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment | |||
android:id="@+id/tabs_jiaozhun" | |||
android:layout_width="500dp" | |||
android:layout_height="43dp" | |||
android:layout_marginTop="10dp" | |||
<LinearLayout | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
android:textSize="14sp" | |||
app:qmui_tab_selected_text_size="16sp" | |||
app:qmui_tab_normal_text_size="14sp" | |||
app:qmui_tab_indicator_height="2dp" | |||
app:qmui_tab_indicator_top="false" | |||
app:qmui_tab_has_indicator="true" | |||
/> | |||
android:layout_marginTop="15dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:id="@+id/text_wlkz" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="物料校准" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/text_mgkz1" | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="/" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/text_mgkz" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="满管校准" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/text_jlkz1" | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="/" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/text_jlkz" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="酱料校准" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/text_bckz1" | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="/" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/text_bckz" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="补偿校准" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/close_from" | |||
android:layout_width="32dp" | |||
@@ -57,43 +112,800 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:id="@+id/viewpager_jiaozhun" | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginBottom="10dp"/> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:id="@+id/jishiqi" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:orientation="horizontal" | |||
android:visibility="gone"> | |||
<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:textSize="30dp" | |||
android:textStyle="bold|italic" /> | |||
android:layout_height="match_parent"> | |||
<!-- 物料校准 --> | |||
<LinearLayout | |||
android:visibility="gone" | |||
android:id="@+id/wuliaojiaozhun" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/main_background"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:layout_marginTop="5dp" | |||
android:text="校准后可模拟出料" | |||
android:textAlignment="center" | |||
android:textSize="19dp"/> | |||
<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> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginBottom="5dp" | |||
android:text="1.清零 2.写时间 3.开始校准 4.保存" | |||
android:textAlignment="center" | |||
android:textColor="@color/red_primary_dark"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:background="@color/white" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="校准时间" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/wljz1" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
/> | |||
<TextView | |||
android:id="@+id/text_wljz" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="反转时间" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/wljz2" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
/> | |||
<Button | |||
android:id="@+id/click_wljz" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="开始校准" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="校准重量(g)" | |||
android:textAlignment="center" | |||
android:textSize="16dp" | |||
/> | |||
<EditText | |||
android:id="@+id/wljz3" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<Button | |||
android:id="@+id/click_wljz_save" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="保存" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:text="称" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="120dp"> | |||
<ImageView | |||
android:layout_width="120dp" | |||
android:layout_height="120dp" | |||
android:src="@drawable/jishiqibj"> | |||
</ImageView> | |||
<TextView | |||
android:id="@+id/dianzicheng1" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:fontFamily="sans-serif-medium" | |||
android:text="128.0g" | |||
android:textSize="20dp" | |||
android:textStyle="bold|italic" | |||
android:textColor="@color/white"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<Button | |||
android:id="@+id/qingling1" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/button1" | |||
android:text="清零" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="60dp" | |||
android:text="模拟出料(g)" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/chuliaokeshu1" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="60dp" | |||
/> | |||
<Button | |||
android:id="@+id/chuliao1" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="出料" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<!-- 满管校准 --> | |||
<LinearLayout | |||
android:visibility="gone" | |||
android:id="@+id/manguanjiaozhun" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/main_background"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:layout_marginTop="5dp" | |||
android:text="请将原料装满料桶后执行该操作" | |||
android:textAlignment="center" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginBottom="5dp" | |||
android:text="1.点校准 2.查看校准时间 3.保存" | |||
android:textAlignment="center" | |||
android:textColor="@color/red_primary_dark"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:background="@color/white" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<Button | |||
android:id="@+id/click_mgjz" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="校准" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
/> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="120dp"> | |||
<ImageView | |||
android:layout_width="120dp" | |||
android:layout_height="120dp" | |||
android:src="@drawable/jishiqibj"> | |||
</ImageView> | |||
<Chronometer | |||
android:layout_centerInParent="true" | |||
android:id="@+id/runtime" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="@color/purple_primary" | |||
android:textSize="24dp" | |||
android:textStyle="bold|italic" /> | |||
</RelativeLayout> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="校准时间" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/exit_mgjz" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="16dp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<Button | |||
android:id="@+id/click_mgjz_save" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="保存" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<!-- 酱料校准 --> | |||
<LinearLayout | |||
android:visibility="gone" | |||
android:id="@+id/jiaoliaojiaozhun" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/main_background"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:layout_marginTop="5dp" | |||
android:text="校准后可模拟出料" | |||
android:textAlignment="center" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginBottom="5dp" | |||
android:text="1.清零 2.填入校准重量范围(50g-100g) 3.填入校准频率 4.开始校准" | |||
android:textAlignment="center" | |||
android:textColor="@color/red_primary_dark"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:background="@color/white" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="10dp" | |||
android:text="校准重量范围(g)" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<RelativeLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="2dp" | |||
android:layout_height="30dp" | |||
android:background="@color/color3"/> | |||
</RelativeLayout> | |||
<EditText | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="10dp" | |||
android:text="校准频率(s)" | |||
android:textAlignment="center" | |||
android:textSize="16dp" | |||
/> | |||
<EditText | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<Button | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="开始校准" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:text="称" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="120dp"> | |||
<ImageView | |||
android:layout_width="120dp" | |||
android:layout_height="120dp" | |||
android:src="@drawable/jishiqibj"> | |||
</ImageView> | |||
<TextView | |||
android:id="@+id/dianzicheng2" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:fontFamily="sans-serif-medium" | |||
android:text="128.0g" | |||
android:textSize="20dp" | |||
android:textStyle="bold|italic" | |||
android:textColor="@color/white"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<Button | |||
android:id="@+id/qingling2" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/button1" | |||
android:text="清零" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="60dp" | |||
android:text="模拟出料(g)" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/chuliaokeshu2" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="60dp" | |||
/> | |||
<Button | |||
android:id="@+id/chuliao2" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="出料" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:focusable="true" | |||
android:clickable="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="#BE000000"> | |||
<TextView | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="研发中..." | |||
android:textSize="40dp" | |||
android:textColor="#DA1CD7"></TextView> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<!-- 补偿校准 --> | |||
<LinearLayout | |||
android:id="@+id/buchangjiaozhun" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/main_background"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:layout_marginTop="5dp" | |||
android:text="设置补偿校准参数后模拟出料" | |||
android:textAlignment="center" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginBottom="5dp" | |||
android:text="1.清零 2.填入校准重量范围(50g-100g) 3.填入校准频率 4.开始校准" | |||
android:textAlignment="center" | |||
android:textColor="@color/red_primary_dark"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:background="@color/white" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="通道补偿开关" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
android:id="@+id/control_switch" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:focusable="true" | |||
app:sb_button_color="@color/app_color_blue" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" /> | |||
</RelativeLayout> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="高范围系数" | |||
android:textAlignment="center" | |||
android:textSize="16dp" | |||
/> | |||
<EditText | |||
android:id="@+id/bcjz_gxs" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="低范围系数" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/bcjz_dxs" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="通道出料时间(s)" | |||
android:textAlignment="center" | |||
android:textSize="16dp" | |||
/> | |||
<EditText | |||
android:id="@+id/bcjz_clsj" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="numberDecimal" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
/> | |||
<Button | |||
android:id="@+id/click_bcjz_save" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="保存" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:text="称" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="120dp"> | |||
<ImageView | |||
android:layout_width="120dp" | |||
android:layout_height="120dp" | |||
android:src="@drawable/jishiqibj"> | |||
</ImageView> | |||
<TextView | |||
android:id="@+id/dianzicheng3" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:fontFamily="sans-serif-medium" | |||
android:text="128.0g" | |||
android:textSize="20dp" | |||
android:textStyle="bold|italic" | |||
android:textColor="@color/white"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<Button | |||
android:id="@+id/qingling3" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/button1" | |||
android:text="清零" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="60dp" | |||
android:text="模拟出料(g)" | |||
android:textAlignment="center" | |||
android:textSize="16dp"/> | |||
<EditText | |||
android:id="@+id/chuliaokeshu3" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/input_bj" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="0" | |||
android:textSize="12dp" | |||
android:layout_marginBottom="60dp" | |||
/> | |||
<Button | |||
android:id="@+id/chuliao3" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="出料" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" | |||
android:layout_marginBottom="10dp" | |||
/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<!-- <com.bonait.bnframework.modules.home.fragment.mode.Silos_item_jiaoyan_fragment--> | |||
<!-- android:id="@+id/viewpager_jiaozhun"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="match_parent">--> | |||
<!-- </com.bonait.bnframework.modules.home.fragment.mode.Silos_item_jiaoyan_fragment>--> | |||
<!-- <com.qmuiteam.qmui.widget.QMUIViewPager--> | |||
<!-- android:id="@+id/viewpager_jiaozhun"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="match_parent"--> | |||
<!-- android:layout_marginBottom="10dp"/>--> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> |