瀏覽代碼

343434

tags/old_version_1
fyf 1 年之前
父節點
當前提交
53e631dd90
共有 8 個檔案被更改,包括 224 行新增100 行删除
  1. +69
    -1
      app/src/main/java/com/bonait/bnframework/MainApplication.java
  2. +107
    -76
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  3. +5
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java
  4. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_gx.java
  5. +20
    -6
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc.java
  6. +1
    -1
      app/src/main/res/layout/fragment_system_cs_plc.xml
  7. +3
    -3
      app/src/main/res/layout/item/layout/fragment_item_gx.xml
  8. +16
    -5
      app/src/main/res/layout/item/layout/fragment_item_plc.xml

+ 69
- 1
app/src/main/java/com/bonait/bnframework/MainApplication.java 查看文件

@@ -134,7 +134,7 @@ public class MainApplication extends Application {
QueryDB.AddUser(user);
//10个料仓
if (QueryDB.GetSilosALL().size() == 0) {
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
BPA_SILOS silo = new BPA_SILOS();
silo.id = java.util.UUID.randomUUID().toString();
silo.num = i + 1;
@@ -172,6 +172,74 @@ public class MainApplication extends Application {
* 初始化工序模型表
*/
public void InitProcessData()
{
List<String> mxname=Arrays.asList("搅拌","位置","加热","主料","液体料","延迟","出菜");
Map<String,List<String>> mx=new IdentityHashMap<>();
mx.put("搅拌",Arrays.asList("搅拌速度","延迟(秒)"));
mx.put("位置",Arrays.asList("位置动作","延迟(秒)"));
mx.put("加热",Arrays.asList("加热功率","延迟(秒)"));
mx.put("主料",Arrays.asList("主料名称","主料重量","烹饪(秒)","投料动作"));
mx.put("液体料",new ArrayList<>());
mx.put("延迟",Arrays.asList("延迟(秒)"));
mx.put("出菜",Arrays.asList("时间(秒)"));

int index=1;
for (String key:mxname)
{
List<String> values= mx.get(key);
BPA_PROCESS process=new BPA_PROCESS();
process.sort=index;
process.name=key;
QueryDB.AddProcess(process);//增加模型

int chidindex=1;
for (String item:values)//模型
{
BPA_PROCESSModel processModel=new BPA_PROCESSModel();
processModel.processid=process.id;
processModel.name=item;
processModel.sort=chidindex;
if (item.equals("搅拌动作"))
{
processModel.datatype=2;
processModel.data="正转反转、一直正转、一直反转";
}
else if (item.equals("位置动作"))
{
processModel.datatype=2;
processModel.data="原点位、出餐位、倒菜位、抽料位、清洗位、炒菜位1、炒菜位2、炒菜位3";
}
else if (item.equals("投料动作"))
{
processModel.datatype=2;
processModel.data="投出抖动三次、投出等待三秒、直接投出、手动投料";
}
else if (item.equals("正转速度") || item.equals("反转速度") || item.equals("搅拌速度"))
{
processModel.datatype=2;
processModel.data="停止、最低、低速、中速、高速、最高、极高";
}else if (item.equals("加热功率") || item.equals("热锅功率"))
{
processModel.datatype=2;
processModel.data="停止、一档、二档、三档、四档、五档";
}else if (item.equals("主料名称"))
{
processModel.datatype=1;
}else
{
processModel.datatype=0;
}
QueryDB.AddProcessModel(processModel);
chidindex++;
}
index++;
}
}

/**
* 初始化工序模型表
*/
public void InitProcessData1()
{
List<String> mxname=Arrays.asList("搅拌","热油","主料","加热","液体料","延迟","勾芡","出菜","热锅");
Map<String,List<String>> mx=new IdentityHashMap<>();


+ 107
- 76
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java 查看文件

@@ -205,91 +205,122 @@ public class ConfigName {
public HashMap<String,String> PlcAddress=new HashMap<String,String>();
public LinkedHashMap<String,String> PlcAddress_ys=new LinkedHashMap<String,String>(){
{
//硬件设备 初始化
put("硬件设备","-------------");
put("初始化", "M10.0");
put("停止", "M10.1");
put("复位", "M10.2");


//搅拌模型
put("搅拌", "M1.0");
put("搅拌动作", "M1.0");
put("正转速度", "M1.0");
put("反转速度", "M1.0");
put("正转(秒)", "M1.0");
put("反转(秒)", "M1.0");
put("停止(秒)", "M1.0");
put("延迟(秒)", "M1.0");

//热油模型
put("热油", "M1.0");
put("加热功率", "M1.0");
put("热油(克)", "M1.0");

//主料模型
put("主料", "M1.0");
put("主料名称", "M1.0");
put("主料重量", "M1.0");
put("烹饪(秒)", "M1.0");
put("投料动作", "M1.0");
put("模型控制","-------------" );
put("搅拌", "M10.3"); //搅拌启停
put("搅拌速度", "VW102");

//翻转正转模型
put("翻转正转", "M10.4");
put("正转速度", "VW104");

//翻转反转模型
put("翻转反转", "M10.5");
put("反转速度", "VW104");

//加热模型
put("加热", "M1.0");
put("加热功率", "M1.0");
put("延迟(秒)", "M1.0");
put("加热", "M10.6");
put("加热功率", "VW100");

//勾芡模型
put("勾芡", "M1.0");
put("勾芡(克)", "M1.0");
//抽水放水
put("炒锅抽水", "M10.7");
put("炒锅放水", "M11.0");

//出菜模型
put("出菜", "M1.0");
put("时间(秒)", "M1.0");
put("出菜", "M11.5");

//位置动作
put("原点位", "M11.4");
put("出餐位", "M11.5");
put("倒菜位", "M12.7");
put("抽料位", "M11.7");
put("清洗位", "M13.0");
put("炒菜位1", "M12.0");
put("炒菜位2", "M12.1");
put("炒菜位3", "M12.2");

//热锅模型
put("热锅", "M1.0");
put("热锅功率", "M1.0");
put("炒锅清洗", "M11.6");

put("液体料","-------------" );
//液体料模型
put("校准时间", "M1.0");
put("料仓1", "M1.0");
put("料仓2", "M1.0");
put("料仓3", "M1.0");
put("料仓4", "M1.0");
put("料仓5", "M1.0");
put("料仓6", "M1.0");
put("料仓7", "M1.0");
put("料仓8", "M1.0");
put("料仓9", "M1.0");
put("料仓10", "M1.0");

put("料仓1校准值", "M1.0");
put("料仓2校准值", "M1.0");
put("料仓3校准值", "M1.0");
put("料仓4校准值", "M1.0");
put("料仓5校准值", "M1.0");
put("料仓6校准值", "M1.0");
put("料仓7校准值", "M1.0");
put("料仓8校准值", "M1.0");
put("料仓9校准值", "M1.0");
put("料仓10校准值", "M1.0");

put("料仓1出料值", "M1.0");
put("料仓2出料值", "M1.0");
put("料仓3出料值", "M1.0");
put("料仓4出料值", "M1.0");
put("料仓5出料值", "M1.0");
put("料仓6出料值", "M1.0");
put("料仓7出料值", "M1.0");
put("料仓8出料值", "M1.0");
put("料仓9出料值", "M1.0");
put("料仓10出料值", "M1.0");

//火力选择
put("火力", "M1.0");

//清洗
put("清洗", "M1.0");

//锅位
put("锅位", "M1.0");

//摇芡
put("摇芡", "M1.0");
put("开始校正", "M12.6");
put("校准时间", "VW112");
put("料仓1", "M11.1");
put("料仓2", "M11.2");
put("料仓3", "M11.3");
put("通道1手动", "M12.3");//手动
put("通道2手动", "M12.4");
put("通道3手动", "M12.5");

put("料仓1校准值", "VW114");
put("料仓2校准值", "VW116");
put("料仓3校准值", "VW118");


put("料仓1", "M11.1");
put("料仓2", "M11.2");
put("料仓3", "M11.3");

//上下限
put("位置上下限","-------------");
put("原点位置下限", "VD150");
put("原点位置上限", "VD152");
put("洗锅位置下限", "VD154");
put("洗锅位置上限", "VD156");
put("倒菜位置下限", "VD158");
put("倒菜位置上限", "VD160");
put("抽调料位置下限", "VD162");
put("抽调料位置上限", "VD164");
put("1#炒制位置下限", "VD166");
put("1#炒制位置上限", "VD168");
put("2#炒制位置下限", "VD170");
put("2#炒制位置上限", "VD172");
put("3#炒制位置下限", "VD174");
put("3#炒制位置上限", "VD176");
put("炒锅工作范围下限", "VD178");
put("炒锅工作范围上限", "VD180");

put("反馈信号-基本","-------------");
put("初始化完成", "M40.0");
put("设备急停", "M40.1");
put("炒锅在原点位置", "M40.2");
put("抽料位置反馈", "M40.3");
put("炒制位置1反馈", "M40.4");
put("炒制位置2反馈", "M40.5");
put("炒制位置3反馈", "M40.6");
put("炒锅在出餐倒菜位置反馈", "M40.7");
put("炒锅在投料位置反馈", "M41.0");
put("炒锅在洗锅位置反馈", "M41.1");
put("通道1出料完成", "M41.2");
put("通道2出料完成", "M41.3");
put("通道3出料完成", "M41.4");
put("清洗完成", "M41.5");
put("倒菜完成", "M41.6");
put("炒锅倒菜减速位", "M41.7");

put("监测信号-基本", "-------------");
put("当前锅底温度", "VW300");
put("炒锅搅拌转速", "VW302");
put("当前加热档位", "VW304");
put("炒锅当前电压", "VW306");
put("炒锅当前电流", "VW308");
put("炒锅当前功率", "VW310");
put("搅拌频率", "VW312");
put("搅拌电机电压", "VW314");
put("搅拌电机电流", "VW316");
put("搅拌变频器温度", "VW318");
put("翻转频率", "VW320");
put("翻转电机电压", "VW322");
put("翻转电机电流", "VW324");
put("翻转变频器温度", "VW326");
put("编码器当前位值", "VW328");
}
};
//endregion


+ 5
- 5
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java 查看文件

@@ -35,8 +35,8 @@ import butterknife.ButterKnife;
import butterknife.OnClick;

public class SystemCsPLCFragment extends BaseFragment {
@BindView(R.id.gxchid)
LinearLayout gxchid;//工序子集
@BindView(R.id.plcview)
LinearLayout plcview;//工序子集

private Context context;
@Override
@@ -59,12 +59,12 @@ public class SystemCsPLCFragment extends BaseFragment {
*/
public void Init()
{
gxchid.removeAllViews();
plcview.removeAllViews();
ArrayList<BPA_PLCADDRESS> arrayList= QueryDB.GetPlcaddressALL();
for (BPA_PLCADDRESS item:arrayList)
{
fragment_plc gongxu=new fragment_plc(context,null,item);
gxchid.addView(gongxu);
fragment_plc gongxu=new fragment_plc(getContext(),null,item);
plcview.addView(gongxu);
}
}



+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_gx.java 查看文件

@@ -30,12 +30,12 @@ import butterknife.ButterKnife;
public class fragment_gx extends LinearLayout {
@BindView(R.id.name)
TextView name;
@BindView(R.id.editsp)
@BindView(R.id.editsp_PF)
Spinner editsp;
Map<String,Integer> editsp_map = new LinkedHashMap<>();
@BindView(R.id.edittext)
@BindView(R.id.edittextPF)
EditText edittext;
@BindView(R.id.check)
@BindView(R.id.check_PF)
CheckBox check;
private View root;
public item_gx model;


+ 20
- 6
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_plc.java 查看文件

@@ -36,22 +36,36 @@ import butterknife.OnClick;
public class fragment_plc extends LinearLayout {
@BindView(R.id.name)
TextView name;
@BindView(R.id.name_PLC)
TextView name_PLC;
@BindView(R.id.update_plc)
Button update_plc;
@BindView(R.id.edittext_plc)
EditText edittext_plc;
private View root;
public BPA_PLCADDRESS model;
public fragment_plc(Context context, @Nullable AttributeSet attrs, BPA_PLCADDRESS mode) {
public fragment_plc(Context context, @Nullable AttributeSet attrs,BPA_PLCADDRESS _model) {
super(context, attrs);
root= LayoutInflater.from(context).inflate(R.layout.fragment_item_plc, this);
ButterKnife.bind(this, root);
model=mode;
model=_model;
Init();
}
public void Init()
{
name.setText(model.name);
((EditText)root.findViewById(R.id.edittext_plc)).setText(model.address.toString());
if (model.address.equals("-------------"))
{
name.setText("\n"+model.name+":");
edittext_plc.setVisibility(View.GONE);
update_plc.setVisibility(View.GONE);
}else
{
name_PLC.setText(model.name);
edittext_plc.setInputType(InputType.TYPE_CLASS_TEXT);
edittext_plc.setText(model.address.toCharArray(), 0, model.address.length());
}

}
public BPA_PLCADDRESS model=null;

@OnClick({R.id.update_plc})
public void onViewClicked(View view) {
@@ -65,7 +79,7 @@ public class fragment_plc extends LinearLayout {
}

String title = "温馨提示!";
String message = "客官确定要修改PLC地址吗,小菠萝温馨提示你,此操作将会影响到实际运行哦?";
String message = "客官确定要修改["+model.name+"]地址吗,小菠萝温馨提示你,此操作将会影响到实际运行哦?";
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {


+ 1
- 1
app/src/main/res/layout/fragment_system_cs_plc.xml 查看文件

@@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/gxchid"
android:id="@+id/plcview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">


+ 3
- 3
app/src/main/res/layout/item/layout/fragment_item_gx.xml 查看文件

@@ -7,7 +7,7 @@
android:layout_marginBottom="@dimen/dp_10"
android:orientation="horizontal">
<CheckBox
android:id="@+id/check"
android:id="@+id/check_PF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/radiusImageView_selected_mask_color"/>
@@ -17,14 +17,14 @@
android:layout_height="wrap_content"
android:text="搅拌动作:"/>
<Spinner
android:id="@+id/editsp"
android:id="@+id/editsp_PF"
style="@style/commonSpinnerStyle"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:visibility="gone"/>
<EditText
android:id="@+id/edittext"
android:id="@+id/edittextPF"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"


+ 16
- 5
app/src/main/res/layout/item/layout/fragment_item_plc.xml 查看文件

@@ -3,19 +3,30 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_height="wrap_content"
android:minHeight="30dp"
android:layout_marginBottom="@dimen/dp_10"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="90dp"
android:layout_width="160dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/name"
android:id="@+id/name_PLC"
android:layout_marginLeft="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:text="搅拌动作:"/>
android:layout_centerVertical="true"
android:text=""/>
<TextView
android:id="@+id/name"
android:layout_marginLeft="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="false"
android:layout_centerVertical="true"
android:text=""
android:textSize="19dp"/>
</RelativeLayout>

<EditText


Loading…
取消
儲存