Procházet zdrojové kódy

更新液料 手动出料

tags/old_version_1
fyf před 1 rokem
rodič
revize
93f760a0e1
8 změnil soubory, kde provedl 228 přidání a 54 odebrání
  1. +16
    -0
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +76
    -12
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  3. +97
    -20
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/lc_adapter.java
  4. +4
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  5. +3
    -2
      app/src/main/res/layout/fragment_home1.xml
  6. +32
    -19
      app/src/main/res/layout/item/layout/item_liaochang.xml
  7. binární
     
  8. binární
     

+ 16
- 0
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java Zobrazit soubor

@@ -486,6 +486,22 @@ public class ExecuteTheRecipe {

}
}


//判断是否有烹饪时间
int val=0;
for (HashMap.Entry<String, String> entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if (key.contains("秒")) {
val = Integer.parseInt(value);
}
}
if(val>0)
{
Thread.sleep(val * 1000);
}

} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}


+ 76
- 12
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java Zobrazit soubor

@@ -240,25 +240,30 @@ public class ConfigName {
add(new Res_PLCADDRESS("搅拌", "M10.3", 0, 1));
add(new Res_PLCADDRESS("搅拌速度", "VW102", 1, 1));

//翻转正转模型 翻转反转模型
//翻转正转模型
add(new Res_PLCADDRESS("翻转正转", "M10.4", 0, 1));
add(new Res_PLCADDRESS("翻转反转", "M10.5", 0, 1));
add(new Res_PLCADDRESS("转动速度", "VW104", 1, 1));


//加热模型
add(new Res_PLCADDRESS("加热", "M10.6", 0, 1));
add(new Res_PLCADDRESS("加热功率", "VW100", 1, 1));

//主料
add(new Res_PLCADDRESS("主料", "M17.4", 0, 1));

//抽水放水
add(new Res_PLCADDRESS("炒锅抽水", "M10.7", 0, 1));
add(new Res_PLCADDRESS("炒锅放水", "M11.0", 0, 1));


//出菜模型
add(new Res_PLCADDRESS("出菜", "M11.5", 0, 1));


//位置动作
add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1));
add(new Res_PLCADDRESS("投料位", "M11.4", 0, 1));
add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1));
add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1));
add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1));
@@ -276,16 +281,20 @@ public class ConfigName {
add(new Res_PLCADDRESS("料仓2校准值", "VW116", 1, 1));
add(new Res_PLCADDRESS("料仓3校准值", "VW118", 1, 1));
add(new Res_PLCADDRESS("开始校正", "M12.6", 0, 1));
add(new Res_PLCADDRESS("料仓1下料手动", "M12.3", 0, 1));
add(new Res_PLCADDRESS("料仓2下料手动", "M12.4", 0, 1));
add(new Res_PLCADDRESS("料仓3下料手动", "M12.5", 0, 1));
add(new Res_PLCADDRESS("料仓1开关", "M12.3", 0, 1));
add(new Res_PLCADDRESS("料仓2开关", "M12.4", 0, 1));
add(new Res_PLCADDRESS("料仓3开关", "M12.5", 0, 1));

add(new Res_PLCADDRESS("料仓1需求值", "VW106", 1, 1));
add(new Res_PLCADDRESS("料仓2需求值", "VW108", 1, 1));
add(new Res_PLCADDRESS("料仓3需求值", "VW110", 1, 1));
add(new Res_PLCADDRESS("料仓1下料", "M11.1", 0, 1));
add(new Res_PLCADDRESS("料仓2需求值", "VW108", 1, 1));
add(new Res_PLCADDRESS("料仓2下料", "M11.2", 0, 1));
add(new Res_PLCADDRESS("料仓3需求值", "VW110", 1, 1));
add(new Res_PLCADDRESS("料仓3下料", "M11.3", 0, 1));

add(new Res_PLCADDRESS("料仓1开关", "M13.1", 1, 1));
add(new Res_PLCADDRESS("料仓2开关", "M13.2", 1, 1));
add(new Res_PLCADDRESS("料仓3开关", "M13.3", 1, 1));

//上下限
add(new Res_PLCADDRESS("位置上下限", "-------------", 0, 0));
@@ -348,7 +357,6 @@ public class ConfigName {
add(new Res_PLCADDRESS("搅拌电机", "VW350", 1, 0));
add(new Res_PLCADDRESS("翻转电机", "VW352", 1, 0));
add(new Res_PLCADDRESS("炒锅", "VW354", 1, 0));

}};
/**
* 大炒工序模型
@@ -431,6 +439,10 @@ public class ConfigName {
add(new Res_PLCADDRESS("料仓3需求值", "VW110", 1, 1));
add(new Res_PLCADDRESS("料仓3下料", "M11.3", 0, 1));

add(new Res_PLCADDRESS("料仓1开关", "M13.1", 1, 1));
add(new Res_PLCADDRESS("料仓2开关", "M13.2", 1, 1));
add(new Res_PLCADDRESS("料仓3开关", "M13.3", 1, 1));

//上下限
add(new Res_PLCADDRESS("位置上下限", "-------------", 0, 0));
add(new Res_PLCADDRESS("原点位置下限", "VD150", 1, 1));
@@ -474,8 +486,6 @@ public class ConfigName {
add(new Res_PLCADDRESS("平移-4号位置值", "VD248", 1, 1));
add(new Res_PLCADDRESS("平移-4#位置设定", "M15.3", 0, 1));



//自动投料-翻转轴
add(new Res_PLCADDRESS("翻转轴控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("翻转-伺服当前值", "VD260", 1, 1));
@@ -562,7 +572,7 @@ public class ConfigName {
add(new ProcessT("搅拌", Arrays.asList("搅拌速度", "延迟(秒)")));
add(new ProcessT("位置", Arrays.asList("转动速度", "位置动作", "延迟(秒)")));
add(new ProcessT("加热", Arrays.asList("加热功率", "延迟(秒)")));
add(new ProcessT("主料", Arrays.asList("主料名称", "主料位置", "主料重量", "投料动作")));
add(new ProcessT("主料", Arrays.asList("主料名称", "主料位置", "主料重量", "投料动作","烹饪(秒)")));
add(new ProcessT("液体料", new ArrayList<>()));
add(new ProcessT("延迟", Arrays.asList("延迟(秒)")));
add(new ProcessT("出菜", Arrays.asList("延迟(秒)")));
@@ -635,6 +645,10 @@ public class ConfigName {
add(new Res_PLCADDRESS("料仓3需求值", "VW110", 1, 1));
add(new Res_PLCADDRESS("料仓3下料", "M11.3", 0, 1));

add(new Res_PLCADDRESS("料仓1开关", "M13.1", 1, 1));
add(new Res_PLCADDRESS("料仓2开关", "M13.2", 1, 1));
add(new Res_PLCADDRESS("料仓3开关", "M13.3", 1, 1));

//上下限
add(new Res_PLCADDRESS("位置上下限", "-------------", 0, 0));
add(new Res_PLCADDRESS("原点位置下限", "VD150", 1, 1));
@@ -654,6 +668,56 @@ public class ConfigName {
add(new Res_PLCADDRESS("炒锅工作范围下限", "VD206", 1, 1));
add(new Res_PLCADDRESS("炒锅工作范围上限", "VD210", 1, 1));

//自动投料-平移轴
add(new Res_PLCADDRESS("平移轴控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("平移-伺服当前值", "VD220", 1, 1));
add(new Res_PLCADDRESS("平移-点动速度", "VD224", 1, 1));
add(new Res_PLCADDRESS("平移-回原点速度", "VD228", 1, 1));
add(new Res_PLCADDRESS("平移-定位运行速度", "VD232", 1, 1));

add(new Res_PLCADDRESS("平移-点动正转", "M14.0", 0, 1));
add(new Res_PLCADDRESS("平移-点动反转", "M14.1", 0, 1));
add(new Res_PLCADDRESS("平移-回原点", "M14.2", 0, 1));
add(new Res_PLCADDRESS("平移-去1号位", "M14.3", 0, 1));
add(new Res_PLCADDRESS("平移-去2号位", "M14.4", 0, 1));
add(new Res_PLCADDRESS("平移-去3号位", "M14.5", 0, 1));
add(new Res_PLCADDRESS("平移-去4号位", "M14.6", 0, 1));

add(new Res_PLCADDRESS("平移-1号位置值", "VD236", 1, 1));
add(new Res_PLCADDRESS("平移-1#位置设定", "M15.0", 0, 1));
add(new Res_PLCADDRESS("平移-2号位置值", "VD240", 1, 1));
add(new Res_PLCADDRESS("平移-2#位置设定", "M15.1", 0, 1));
add(new Res_PLCADDRESS("平移-3号位置值", "VD244", 1, 1));
add(new Res_PLCADDRESS("平移-3#位置设定", "M15.2", 0, 1));
add(new Res_PLCADDRESS("平移-4号位置值", "VD248", 1, 1));
add(new Res_PLCADDRESS("平移-4#位置设定", "M15.3", 0, 1));

//自动投料-翻转轴
add(new Res_PLCADDRESS("翻转轴控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("翻转-伺服当前值", "VD260", 1, 1));
add(new Res_PLCADDRESS("翻转-点动速度", "VD264", 1, 1));
add(new Res_PLCADDRESS("翻转-回原点速度", "VD268", 1, 1));
add(new Res_PLCADDRESS("翻转-定位运行速度", "VD272", 1, 1));

add(new Res_PLCADDRESS("翻转-点动正转", "M16.0", 0, 1));
add(new Res_PLCADDRESS("翻转-点动反转", "M16.1", 0, 1));
add(new Res_PLCADDRESS("翻转-回原点", "M16.2", 0, 1));
add(new Res_PLCADDRESS("翻转-去1号位", "M16.3", 0, 1));
add(new Res_PLCADDRESS("翻转-去2号位", "M16.4", 0, 1));
add(new Res_PLCADDRESS("翻转-去3号位", "M16.5", 0, 1));
add(new Res_PLCADDRESS("翻转-去4号位", "M16.6", 0, 1));

add(new Res_PLCADDRESS("翻转-1号位置值", "VD276", 1, 1));
add(new Res_PLCADDRESS("翻转-1#位置设定", "M17.0", 0, 1));
add(new Res_PLCADDRESS("翻转-2号位置值", "VD280", 1, 1));
add(new Res_PLCADDRESS("翻转-2#位置设定", "M17.1", 0, 1));
add(new Res_PLCADDRESS("翻转-3号位置值", "VD284", 1, 1));
add(new Res_PLCADDRESS("翻转-3#位置设定", "M17.2", 0, 1));
add(new Res_PLCADDRESS("翻转-4号位置值", "VD288", 1, 1));
add(new Res_PLCADDRESS("翻转-4#位置设定", "M17.3", 0, 1));
add(new Res_PLCADDRESS("倒菜启动", "M17.4", 0, 1));
add(new Res_PLCADDRESS("磁铁吸合", "M17.5", 0, 1));

//反馈信号
add(new Res_PLCADDRESS("反馈信号", "-------------", 0, 0));
add(new Res_PLCADDRESS("初始化完成", "M40.0", 1, 0));
@@ -714,7 +778,7 @@ public class ConfigName {
add(new ProcessT("搅拌", Arrays.asList("搅拌速度", "延迟(秒)")));
add(new ProcessT("位置", Arrays.asList("转动速度", "位置动作", "延迟(秒)")));
add(new ProcessT("加热", Arrays.asList("加热功率", "延迟(秒)")));
add(new ProcessT("主料", Arrays.asList("主料名称", "主料位置", "主料重量", "投料动作")));
add(new ProcessT("主料", Arrays.asList("主料名称", "主料位置", "主料重量", "投料动作","烹饪(秒)")));
add(new ProcessT("液体料", new ArrayList<>()));
add(new ProcessT("延迟", Arrays.asList("延迟(秒)")));
add(new ProcessT("出菜", Arrays.asList("延迟(秒)")));


+ 97
- 20
app/src/main/java/com/bonait/bnframework/modules/home/adapter/lc_adapter.java Zobrazit soubor

@@ -1,5 +1,6 @@
package com.bonait.bnframework.modules.home.adapter;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
@@ -12,12 +13,16 @@ import android.widget.ImageView;
import android.widget.LinearLayout;

import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.db.res.lcMode;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.qmuiteam.qmui.widget.textview.QMUILinkTextView;
import com.suke.widget.SwitchButton;

import java.util.List;

@@ -59,32 +64,103 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
{
bfb=((yl*100)/zl)>=100?100:((yl*100)/zl);
}
myViewHolder.bfb.setText(bfb+"%");
myViewHolder.type.setText((lcModes.get(position).materiallx==0?"液料":"酱料"));
myViewHolder.add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
show_jm(position);
}
});
//手动开关
myViewHolder.m_click_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
show_jm(position);
String kg= myViewHolder.imageView.getTag().toString();
if(kg.equals("关闭"))
{
kg="打开";
}else
{
kg="关闭";
}
String title = "料仓操作提示!";
String message = "请问客官确定要将["+lcModes.get(position).materialName+"]"+kg+"?";
String finalKg = kg;
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
if(finalKg.equals("打开"))
{
//打开
myViewHolder.imageView.setTag(finalKg);
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_g));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"开关", true, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
}else
{
//关闭
myViewHolder.imageView.setTag(finalKg);
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_k2));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"开关", false, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
}
dialog.dismiss();
}
});
}
});


myViewHolder.name.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
show_jm(position);
}
});
myViewHolder.type.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
show_jm(position);
String kg= myViewHolder.imageView.getTag().toString();
if(kg.equals("关闭"))
{
kg="打开";
}else
{
kg="关闭";
}
String title = "料仓操作提示!";
String message = "请问客官确定要将["+lcModes.get(position).materialName+"]"+kg+"?";
String finalKg = kg;
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
if(finalKg.equals("打开"))
{
//打开
myViewHolder.imageView.setTag(finalKg);
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_g));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"开关", true, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
}else
{
//关闭
myViewHolder.imageView.setTag(finalKg);
myViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(R.mipmap.shuiguan_k2));

ExecuteTheRecipe.WritePLC("料仓"+(position+1)+"开关", false, null);
ToastUtils.info("料仓"+(position+1)+"开关," + finalKg);
}
dialog.dismiss();
}
});
}
});
//myViewHolder.bfb.setText(bfb+"%");
// myViewHolder.add.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// String title = "料仓操作提示!";
// String message = "请问客官确定要将["+lcModes.get(position).materialName+"]加满吗?";
// AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
// @Override
// public void onClick(QMUIDialog dialog, int index) {
// DataBus.getInstance().TopUp(position);
// dialog.dismiss();
// }
// });
// }
// });
}
} catch (Exception e) {
e.printStackTrace();
@@ -146,20 +222,21 @@ public class lc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
}

public static class MyLCViewHolder extends RecyclerView.ViewHolder {
ImageView add;//加满按钮
//ImageView add;//加满按钮
QMUILinkTextView type;//物料类型
QMUILinkTextView name;//物料名称
QMUILinkTextView bfb;//料仓余量百分比
//QMUILinkTextView bfb;//料仓余量百分比
ImageView imageView;
LinearLayout m_click_layout;

public MyLCViewHolder(View view) {
super(view);
add=view.findViewById(R.id.add);
//add=view.findViewById(R.id.add);
type=view.findViewById(R.id.type);
name=view.findViewById(R.id.name);
bfb=view.findViewById(R.id.bfb);
//bfb=view.findViewById(R.id.bfb);
m_click_layout=view.findViewById(R.id.m_click_layout);
imageView=view.findViewById(R.id.imageView);
}
}
}

+ 4
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java Zobrazit soubor

@@ -248,7 +248,8 @@ public class Home1Fragment extends BaseFragment {
* Image Button 按钮点击事件
*/
public void ControlClicked() {
// //搅拌挡位
//region 临时屏蔽
// //搅拌挡位
// jiaoban_control.mListener = new MyClickListener() {
// @Override
// public void clickListener(View v, Object data) {
@@ -348,6 +349,8 @@ public class Home1Fragment extends BaseFragment {
//
// }
// };
//endregion

//抽水启动
choushui_control.mListener = new MyClickListener() {
@Override


+ 3
- 2
app/src/main/res/layout/fragment_home1.xml Zobrazit soubor

@@ -243,7 +243,8 @@ android:orientation="vertical">
android:id="@+id/btn_jiaoban"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:focusable="true"></com.suke.widget.SwitchButton>
android:focusable="true">
</com.suke.widget.SwitchButton>

<ImageView
android:layout_width="wrap_content"
@@ -422,8 +423,8 @@ android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="fitXY"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="@mipmap/chushihua" />
</RelativeLayout>
<RelativeLayout


+ 32
- 19
app/src/main/res/layout/item/layout/item_liaochang.xml Zobrazit soubor

@@ -1,5 +1,6 @@
<?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"
android:layout_width="95dp"
android:layout_height="95dp"
android:background="@drawable/common_bg_with_radius_and_border">
@@ -8,7 +9,7 @@
android:id="@+id/m_click_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="@dimen/dp_10"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
@@ -47,24 +48,36 @@
android:layout_centerHorizontal="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:id="@+id/bfb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="96%"
android:textSize="12dp"
android:layout_centerInParent="true"
android:textColor="@color/app_color_blue"/>
<!-- <com.qmuiteam.qmui.widget.textview.QMUILinkTextView-->
<!-- android:id="@+id/bfb"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="96%"-->
<!-- android:textSize="12dp"-->
<!-- android:layout_centerInParent="true"-->
<!-- android:textColor="@color/app_color_blue"/>-->
</RelativeLayout>
</LinearLayout>

<ImageView
android:id="@+id/add"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/dp_4"
android:layout_marginRight="@dimen/dp_4"
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@mipmap/jia"/>
<RelativeLayout
android:layout_marginTop="5dp"
android:layout_centerHorizontal="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:tag="关闭"
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:src="@mipmap/shuiguan_k2" />
</RelativeLayout>
<!-- <ImageView-->
<!-- android:id="@+id/add"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_marginBottom="@dimen/dp_4"-->
<!-- android:layout_marginRight="@dimen/dp_4"-->
<!-- android:layout_width="16dp"-->
<!-- android:layout_height="16dp"-->
<!-- android:src="@mipmap/jia"/>-->
</RelativeLayout>

binární
Zobrazit soubor


binární
Zobrazit soubor


Načítá se…
Zrušit
Uložit