Browse Source

44

味魔方Android
fyf 10 months ago
parent
commit
8162819d9e
12 changed files with 1462 additions and 20 deletions
  1. +15
    -1
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java
  3. +13
    -0
      app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java
  4. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_SILOS.java
  5. +2
    -1
      app/src/main/java/com/bonait/bnframework/common/db/res/lcMode.java
  6. +2
    -8
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  7. +617
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_jiaoyan_fragment.java
  8. +3
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java
  9. +14
    -0
      app/src/main/res/drawable/jishiqibj.xml
  10. +6
    -5
      app/src/main/res/layout/activity_dzcjy.xml
  11. +785
    -0
      app/src/main/res/layout/item/layout/fragment_silos_item_jiaoyan.xml
  12. +1
    -0
      app/src/main/res/layout/item/layout/silos_jiaoyan_item.xml

+ 15
- 1
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -140,6 +140,15 @@ public class ExecuteTheRecipe {
* 果糖右温度
*/
public static int SugarTempRight=0;

/**
* 果糖左温度
*/
public static int SugarTempLeft_SZ=0;
/**
* 果糖右温度
*/
public static int SugarTempRight_SZ=0;
/**
* 重量刷新提示
*/
@@ -262,12 +271,17 @@ public class ExecuteTheRecipe {
Object obj1= ExecuteTheRecipe.ReadPLC("水池温度");
WaterTemp=obj1==null?0:(int)obj1;

if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
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;

Object obj21= ExecuteTheRecipe.ReadPLC("果糖左温度设置");
Object obj31= ExecuteTheRecipe.ReadPLC("果糖右温度设置");
SugarTempLeft_SZ=obj21==null?0:(int)obj21;
SugarTempRight_SZ=obj31==null?0:(int)obj31;
}

if (WeighComplete!=null)


+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java View File

@@ -79,9 +79,9 @@ public class DataBus {
for (BPA_SILOS silo : bpa_silos) {
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id);
if (m.size() > 0) {
lc.add(new lcMode(silo.id, silo.num, m.get(0).name, silo.silosmargin, silo.siloszl, m.get(0).id,m.get(0).type, silo.warningValue, silo.thrsoleValue,silo.name.isEmpty()?"":silo.name,silo.status));
lc.add(new lcMode(silo.id, silo.num, m.get(0).name, silo.silosmargin, silo.siloszl, m.get(0).id,m.get(0).type, silo.warningValue, silo.thrsoleValue,silo.name.isEmpty()?"":silo.name,silo.status,silo.bValue));
} else {
lc.add(new lcMode(silo.id, silo.num, "未设置", silo.silosmargin, silo.siloszl, "",0, silo.warningValue, silo.thrsoleValue,silo.name.isEmpty()?"":silo.name,silo.status));
lc.add(new lcMode(silo.id, silo.num, "未设置", silo.silosmargin, silo.siloszl, "",0, silo.warningValue, silo.thrsoleValue,silo.name.isEmpty()?"":silo.name,silo.status,silo.bValue));
}
}
}


+ 13
- 0
app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java View File

@@ -487,6 +487,19 @@ public class QueryDB {
Update(BPA_SILOS.class, silos);
}
}

/**
* 料仓校准时间
* @param id
* @param data
*/
public static void UpdateSilosJZTime(String id, String data) {
BPA_SILOS silos = GetSilosID(id);
if (silos != null) {
silos.plcValue = data;
Update(BPA_SILOS.class, silos);
}
}
//endregion

//region BPA_SILOSANDMATERIAL 料仓物料关联表


+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_SILOS.java View File

@@ -14,11 +14,11 @@ public class BPA_SILOS extends ModeBase {
//下线阈值:20g
public int thrsoleValue;
//PLC控制信号量
public String plcValue;// 100g
public String plcValue;// 20s
//标准值 标准 1s出多少g(出场标准) 更改为 满管 需要时间
public int bValue;
//校准值 实际校准1s出多少g
public int jValue; //time 2 s
public int jValue; //100 g
//状态 状态:0 启用 1 禁用
public int status;
//优先级 优先出料顺序


+ 2
- 1
app/src/main/java/com/bonait/bnframework/common/db/res/lcMode.java View File

@@ -10,7 +10,7 @@ public class lcMode extends BPA_SILOS {
public String materialId;
//物料类型
public int materiallx;
public lcMode(String id, int num,String materialName, int silosmargin,int siloszl,String materialId,int materiallx,int warningValue,int thrsoleValue,String _name,int _sta) {
public lcMode(String id, int num,String materialName, int silosmargin,int siloszl,String materialId,int materiallx,int warningValue,int thrsoleValue,String _name,int _sta,int _bvalue) {
this.materialName = materialName;
this.silosmargin = silosmargin;
this.num = num;
@@ -22,5 +22,6 @@ public class lcMode extends BPA_SILOS {
this.siloszl=siloszl;
this.name=_name;
this.status=_sta;
this.bValue=_bvalue;
}
}

+ 2
- 8
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java View File

@@ -287,10 +287,7 @@ public class MakeGoodFragment extends BaseFragment {
{
if(makegood.Gt1)
{
Object sx=ExecuteTheRecipe.ReadPLC("果糖左温度设置");
int wdsz=sx==null?0:(int)sx;

if(ExecuteTheRecipe.SugarTempLeft<wdsz)
if(ExecuteTheRecipe.SugarTempLeft<ExecuteTheRecipe.SugarTempLeft_SZ)
{
ToastUtils.warning("果糖左仓温度未达到设置值,不允许出料...");
return;
@@ -298,10 +295,7 @@ public class MakeGoodFragment extends BaseFragment {
}
if(makegood.Gt2)
{
Object sx=ExecuteTheRecipe.ReadPLC("果糖右温度设置");
int wdsz=sx==null?0:(int)sx;

if(ExecuteTheRecipe.SugarTempRight<wdsz)
if(ExecuteTheRecipe.SugarTempRight<ExecuteTheRecipe.SugarTempRight_SZ)
{
ToastUtils.warning("果糖右仓温度未达到设置值,不允许出料...");
return;


+ 617
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_jiaoyan_fragment.java View File

@@ -0,0 +1,617 @@
package com.bonait.bnframework.modules.home.fragment.mode;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.res.SilosLsjyMode;
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.utils.ToastUtils;
import com.bonait.bnframework.modules.home.adapter.lsjy_adapter;
import com.bonait.bnframework.modules.home.fragment.from.LogActivity;
import com.bonait.bnframework.modules.home.fragment.from.PlcControlActivity;
import com.bonait.bnframework.modules.home.fragment.from.RealTimeActivity;
import com.orhanobut.logger.Logger;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class Silos_item_jiaoyan_fragment extends BaseFragment {

//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 edit_wljz1;

@BindView(R.id.wljz2)
EditText edit_wljz2;

@BindView(R.id.wljz3)
EditText edit_wljz3;

@BindView(R.id.text_wljz)
TextView text_wljz2;
//endregion

//region 变量
private Context context;
/**
* 当前料仓
*/
public lcMode lcMode = null;
/**
* 当前类型
*/
public String TypeName = "";
//endregion

//region 界面实例
@Override
protected View onCreateView() {

View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_silos_item_jiaoyan, null);
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();
InitData();
Run();
}
//endregion

//region 初始化设置数据

/**
* 初始化界面
*/
public void InitView() {
switch (TypeName) {
case "满管校准":
wuliaojiaozhun.setVisibility(View.GONE);
manguanjiaozhun.setVisibility(View.VISIBLE);
jiaoliaojiaozhun.setVisibility(View.GONE);
buchangjiaozhun.setVisibility(View.GONE);
break;
case "酱料校准":
wuliaojiaozhun.setVisibility(View.GONE);
manguanjiaozhun.setVisibility(View.GONE);
jiaoliaojiaozhun.setVisibility(View.VISIBLE);
buchangjiaozhun.setVisibility(View.GONE);
break;
case "补偿校准":
wuliaojiaozhun.setVisibility(View.GONE);
manguanjiaozhun.setVisibility(View.GONE);
jiaoliaojiaozhun.setVisibility(View.GONE);
buchangjiaozhun.setVisibility(View.VISIBLE);
break;
default:
wuliaojiaozhun.setVisibility(View.VISIBLE);
manguanjiaozhun.setVisibility(View.GONE);
jiaoliaojiaozhun.setVisibility(View.GONE);
buchangjiaozhun.setVisibility(View.GONE);
break;
}

/**
* 计时器超时
*/
runtime.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {
@Override
public void onChronometerTick(Chronometer chronometer) {
//如果计时到现在超过了一小时秒 20s
if (SystemClock.elapsedRealtime() - runtime.getBase() > 20 * 1000) {
mHandler.sendEmptyMessage(1);
}
}
});
}

/**
* 初始化数据
*/
public void InitData() {
exit_mgjz.setText(lcMode.bValue + "");
}

/**
* 设置名称
*
* @param type
*/
public void SetData(lcMode mode, String type) {
TypeName = type;
lcMode = mode;
}
//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 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() {
ToastUtils.warning("通道校准完成!");
// 在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));
edit_wljz3.setText(zll+"");
lcMode.jValue=zhongliangxianshi;
QueryDB.UpdateJYZ(lcMode.id,zhongliangxianshi);
}
}, 2000);
} catch (Exception e) {
ToastUtils.error("重量解析显示异常!" + e.getMessage());
}
}
});
} catch (Exception ex) {
Log.d("dsds", "Run: " + ex.getMessage());
}
}
};

new Thread(new Runnable() {
@Override
public void run() {
try {
//底部按钮信息
Object obj = ExecuteTheRecipe.ReadPLC("基准时间");
Object jzz = ExecuteTheRecipe.ReadPLC("校准值" + lcMode.num);
String time = obj == null ? "0" : obj.toString();
short val = jzz == null ? 0 : (short) jzz;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//校准时间
edit_wljz1.setText(String.format("%.1f", (Double.parseDouble(time) / 10)));
edit_wljz3.setText(String.format("%.1f", (Double.parseDouble(String.valueOf(val)) / 10)));
if (!ConfigName.getInstance().versionSelectionEnum.equals("奶茶机")) {
Object obj1 = ExecuteTheRecipe.ReadPLC("反转时间");
String fztime = obj1 == null ? "0" : obj1.toString();
edit_wljz2.setText(String.format("%.1f", (Double.parseDouble(fztime) / 10)));
} else {
edit_wljz2.setVisibility(View.GONE);
text_wljz2.setVisibility(View.GONE);
}
}
});
ExecuteTheRecipe.WritePLC("通道" + lcMode.num + "校准开关", true, null);
} catch (Exception e) {
}
}
}).start();
}
//endregion

//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
})
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;
}
}
//endregion

//region 电子秤清零

/**
* 电子秤清零
*/
public void dzcql() {
ExecuteTheRecipe.WritePLC("重量清零", true, new IWriteCallBack() {
@Override
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 = edit_wljz1.getText().toString();
String ftime = edit_wljz2.getText().toString();
if (stime.equals("")) {
ToastUtils.info("校准基准时间不能为空!");
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;
}

if (!ConfigName.getInstance().versionSelectionEnum.equals("奶茶机")) {
if (ftime.equals("")) {
ToastUtils.info("反转基准时间不能为空!");
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("反转时间保存失败!");
}
});
}
QueryDB.UpdateSilosJZTime(lcMode.id,ftime);
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 SaveTime1() {

}
//endregion


//region 定时器

/**
* 启动定时器
*/
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) {

}
}
}).start();
}

/**
* 停止定时器
*/
public int StopTime() {

long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase();
runtime.stop();

int time = (int) (elapsedMillis / 1000);
exit_mgjz.setText(time + "");
new Thread(new Runnable() {
@Override
public void run() {
try {
ExecuteTheRecipe.WritePLC("手动控制" + lcMode.num, false, null);
} catch (Exception e) {

}
}
}).start();
return time;//当前点击多少秒
}
//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
}

+ 3
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java View File

@@ -116,7 +116,9 @@ public class silos_jiaoyan extends LinearLayout {
@Override
public QMUIFragment createFragment(int position) {
//显示数元
return (QMUIFragment) froms.get(position).fragment;
Silos_item_jiaoyan_fragment jiaoyan_fragment=new Silos_item_jiaoyan_fragment();
jiaoyan_fragment.SetData(lcMode, froms.get(position).name);
return jiaoyan_fragment;
}

@Override


+ 14
- 0
app/src/main/res/drawable/jishiqibj.xml View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="#c6d7ed"/>

<stroke
android:width="5dp"
android:color="@color/white"/>

<size android:width="80dp"
android:height="80dp"/>
</shape>

+ 6
- 5
app/src/main/res/layout/activity_dzcjy.xml View File

@@ -71,20 +71,21 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:layout_centerInParent="true"
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/edittext_zl"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/input_bj"
android:digits="0123456789"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789"
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp"
android:text="0"/>
android:text="0"
android:textSize="12dp" />
</RelativeLayout>

<RelativeLayout


+ 785
- 0
app/src/main/res/layout/item/layout/fragment_silos_item_jiaoyan.xml View File

@@ -0,0 +1,785 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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">
<!-- 物料校准 -->
<LinearLayout
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"/>

<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: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:visibility="gone"
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: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"
android:id="@+id/control_switch"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:focusable="true"
/>
</RelativeLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="高范围系数"
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"
/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="低范围系数"
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"
/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
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"
/>
<Button
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>
</RelativeLayout>

+ 1
- 0
app/src/main/res/layout/item/layout/silos_jiaoyan_item.xml View File

@@ -19,6 +19,7 @@
android:layout_width="500dp"
android:layout_height="43dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:background="@drawable/qmui_list_item_bg_with_border_bottom"
android:textSize="14sp"
app:qmui_tab_selected_text_size="16sp"


Loading…
Cancel
Save