Browse Source

更新333rt

tags/old_version_1
fyf 1 year ago
parent
commit
8e834ab73b
6 changed files with 110 additions and 116 deletions
  1. +83
    -109
      app/src/main/java/com/bonait/bnframework/business/DeviceData.java
  2. +14
    -0
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  3. +11
    -0
      app/src/main/java/com/bonait/bnframework/business/address/PlcAddress.java
  4. +1
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  5. +0
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home2Fragment.java
  6. +1
    -0
      app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java

+ 83
- 109
app/src/main/java/com/bonait/bnframework/business/DeviceData.java View File

@@ -62,115 +62,89 @@ public class DeviceData {
@Override
public void Run() throws InterruptedException {

//获取校准值-增加两个果糖通道
ModbusTcpServer.get().ReadShort("VW100", 12, (shorts) -> {
for (int i = 0; i < shorts.length; i++) {
CalibrationValue.put(i + 1, shorts[i]);
}
});

//获取称当前重量
ModbusTcpServer.get().ReadInt("VD260", 9, ints -> {
for (int i = 0; i < ints.length; i++) {
CallCurrentWeight.put(i + 1, ints[i]);
}
});

//获取校准基准时间
ModbusTcpServer.get().ReadInt("VD124", 1, ints -> {
CalibrationReferenceTime = ints[0];
});

//获取温度参数
ModbusTcpServer.get().ReadInt("VD310", 3, ints -> {
FructoseTemperature1=ints[0];
FructoseTemperature2=ints[1];
WashTheTankTemperature=ints[2];
});

//获取温度上下限
ModbusTcpServer.get().ReadInt("VD388", 6, ints -> {
FructoseTemperature1_up=ints[0];
FructoseTemperature1_down=ints[1];
FructoseTemperature2_up=ints[2];
FructoseTemperature2_down=ints[3];
WashTheTankTemperature_up=ints[4];
WashTheTankTemperature_down=ints[5];
});

//获取清洗参数
ModbusTcpServer.get().ReadShort("VW140", 5, shorts -> {
DrainageTime = shorts[0];
AddCleaningAgentTime = shorts[1];
InletTime = shorts[2];
CyclicCleaningTime = shorts[3];
CleaningAndHeatingTime = shorts[4];
});

//获取清洗参数
ModbusTcpServer.get().ReadBool("M6.5", 1, booleans -> {
WeightCalibrationMode = booleans[0];
});

ModbusTcpServer.get().ReadBool("M6.5", 1, booleans -> {
WeightCalibrationMode = booleans[0];
});
//IoStatus

//读取1号果糖机按钮状态
ModbusTcpServer.get().ReadBool("M51.7", 1, booleans -> {
ReheatSwitch1 = booleans[0];
});

//读取2号果糖机按钮状态
ModbusTcpServer.get().ReadBool("M52.0", 1, booleans -> {
ReheatSwitch2 = booleans[0];
});

//读取当前扫码信息
ModbusTcpServer.get().ReadString("VW342", 20, (data) -> {

if(!Code.equals(data))
{
if(!data.isEmpty() && OnScanTheCodeInformationT!=null)
{
MessageLog.ShowInfo("当前扫码信息:"+data);
OnScanTheCodeInformationT.Run(data);
}
Code=data;
}
//1.查询订单信息
//2.展示订单界面
//3.制作订单信息
//4.回馈订单信息
});

//读取实时状态
ModbusTcpServer.get().ReadStatus("VW382", 3, data -> {
for (int i = 0; i < data.length; i++) {
byte status=data[i];//0x92
IoStatus.put(i*8+0, ByteHelper.getBit(status,0)==1);
IoStatus.put(i*8+1, ByteHelper.getBit(status,1)==1);
IoStatus.put(i*8+2, ByteHelper.getBit(status,2)==1);
IoStatus.put(i*8+3, ByteHelper.getBit(status,3)==1);
IoStatus.put(i*8+4, ByteHelper.getBit(status,4)==1);
IoStatus.put(i*8+5, ByteHelper.getBit(status,5)==1);
IoStatus.put(i*8+6, ByteHelper.getBit(status,6)==1);
IoStatus.put(i*8+7, ByteHelper.getBit(status,7)==1);
}
});

//配料完成 M0.3
CompleteListen("M0.3", "配料完成", OnChargeMixtureCompleteNotify);

//清洗完成 M0.6
CompleteListen("M0.6", "清洗完成", OnCleaningCompleteNotify);

//去皮完成 M1.3
CompleteListen("M1.3", "去皮完成", OnPeelingCompleteNotify);

//扫码信号 M1.5
//CompleteListen("M1.5", "扫码信号", OnScanTheCodeInformation);
// //获取校准值-增加两个果糖通道
// ModbusTcpServer.get().ReadShort("VW100", 12, (shorts) -> {
// for (int i = 0; i < shorts.length; i++) {
// CalibrationValue.put(i + 1, shorts[i]);
// }
// });
//
// //获取称当前重量
// ModbusTcpServer.get().ReadInt("VD260", 9, ints -> {
// for (int i = 0; i < ints.length; i++) {
// CallCurrentWeight.put(i + 1, ints[i]);
// }
// });
//
// //获取温度参数
// ModbusTcpServer.get().ReadInt("VD310", 3, ints -> {
// FructoseTemperature1=ints[0];
// FructoseTemperature2=ints[1];
// WashTheTankTemperature=ints[2];
// });
//
//
// //获取清洗参数
// ModbusTcpServer.get().ReadShort("VW140", 5, shorts -> {
// DrainageTime = shorts[0];
// AddCleaningAgentTime = shorts[1];
// InletTime = shorts[2];
// CyclicCleaningTime = shorts[3];
// CleaningAndHeatingTime = shorts[4];
// });
//
// //获取清洗参数
// ModbusTcpServer.get().ReadBool("M6.5", 1, booleans -> {
// WeightCalibrationMode = booleans[0];
// });
//
// ModbusTcpServer.get().ReadBool("M6.5", 1, booleans -> {
// WeightCalibrationMode = booleans[0];
// });
// //IoStatus
//
//
// //读取当前扫码信息
// ModbusTcpServer.get().ReadString("VW342", 20, (data) -> {
//
// if(!Code.equals(data))
// {
// if(!data.isEmpty() && OnScanTheCodeInformationT!=null)
// {
// MessageLog.ShowInfo("当前扫码信息:"+data);
// OnScanTheCodeInformationT.Run(data);
// }
// Code=data;
// }
// //1.查询订单信息
// //2.展示订单界面
// //3.制作订单信息
// //4.回馈订单信息
// });
//
// //读取实时状态
// ModbusTcpServer.get().ReadStatus("VW382", 3, data -> {
// for (int i = 0; i < data.length; i++) {
// byte status=data[i];//0x92
// IoStatus.put(i*8+0, ByteHelper.getBit(status,0)==1);
// IoStatus.put(i*8+1, ByteHelper.getBit(status,1)==1);
// IoStatus.put(i*8+2, ByteHelper.getBit(status,2)==1);
// IoStatus.put(i*8+3, ByteHelper.getBit(status,3)==1);
// IoStatus.put(i*8+4, ByteHelper.getBit(status,4)==1);
// IoStatus.put(i*8+5, ByteHelper.getBit(status,5)==1);
// IoStatus.put(i*8+6, ByteHelper.getBit(status,6)==1);
// IoStatus.put(i*8+7, ByteHelper.getBit(status,7)==1);
// }
// });
//
// //配料完成 M0.3
// CompleteListen("M0.3", "配料完成", OnChargeMixtureCompleteNotify);
//
// //清洗完成 M0.6
// CompleteListen("M0.6", "清洗完成", OnCleaningCompleteNotify);
//
// //去皮完成 M1.3
// CompleteListen("M1.3", "去皮完成", OnPeelingCompleteNotify);

Thread.sleep(10);
}


+ 14
- 0
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -436,5 +436,19 @@ public class ExecuteTheRecipe {
ToastUtils.error("异常信息:" + ex.getMessage());
}
}
/**
* 火力点击
* @param data
*/
public static void Write_PLC_HuoLI(int data)
{
try
{
ToastUtils.info("火力按钮点击,当前级别:" + data);
}catch (Exception ex)
{
ToastUtils.error("异常信息:" + ex.getMessage());
}
}
//endregion
}

+ 11
- 0
app/src/main/java/com/bonait/bnframework/business/address/PlcAddress.java View File

@@ -0,0 +1,11 @@
package com.bonait.bnframework.business.address;

/**
* PLC地址管理
*/
public interface PlcAddress {

//region 火力电机
String HuoLi="M30.0";
//endregion
}

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

@@ -143,7 +143,7 @@ public class Home1Fragment extends BaseFragment {
huoli.mListener = new MyClickListener() {
@Override
public void clickListener(View v, Object data) {
ToastUtils.info("火力按钮点击,当前级别:" + data);
ExecuteTheRecipe.Write_PLC_HuoLI((int)data);
}

@Override
@@ -163,7 +163,6 @@ public class Home1Fragment extends BaseFragment {

@Override
public void clickListenerNew(View v, int k, Object data) {
ToastUtils.info("刷新界面");
initData();
}
};


+ 0
- 5
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home2Fragment.java View File

@@ -63,23 +63,18 @@ public class Home2Fragment extends BaseFragment {
switch (view.getId()) {
case R.id.kshr://开始制作商品
MessageManager.getInstance().sendMessage(MessageName.SelectZY,"Open");
ToastUtils.info("打开烹饪界面");
break;
case R.id.diy://diy模式
skipToActivity(DiyActivity.class);
ToastUtils.info("打开diy界面");
break;
case R.id.cp://菜谱
skipToActivity(CpActivity.class);
ToastUtils.info("打开菜谱界面");
break;
case R.id.wh://维护界面
skipToActivity(WhActivity.class);
ToastUtils.info("打开维护界面界面");
break;
case R.id.sz://系统设置界面
skipToActivity(SzActivity.class);
ToastUtils.info("打开系统设置界面");
break;
}
}


+ 1
- 0
app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java View File

@@ -110,6 +110,7 @@ public class MyFragment extends BaseFragment {
}
private void initView() {
initData(ConfigName.getInstance().user);
stvUpdate.setRightString(ConfigName.getInstance().Version);
/*
* 版本更新,点击事件
* */


Loading…
Cancel
Save