Kaynağa Gözat

556000

茶饮新(现场)
fyf 11 ay önce
ebeveyn
işleme
d75142bd89
24 değiştirilmiş dosya ile 1138 ekleme ve 319 silme
  1. +57
    -27
      app/src/main/AndroidManifest.xml
  2. +0
    -1
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  3. +172
    -136
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  4. +140
    -89
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  5. +1
    -3
      app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java
  6. +18
    -0
      app/src/main/java/com/bonait/bnframework/common/db/res/Res_ZDSF.java
  7. +191
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/clsfbc_adapter.java
  8. +1
    -21
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/wdsz_adapter.java
  9. +13
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/JiaoYanFragment.java
  10. +102
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_clsfbc_fragment.java
  11. +82
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_clxs_fragment.java
  12. +1
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/sdkz_control.java
  13. +3
    -1
      app/src/main/res/layout/activity_orderlist.xml
  14. +0
    -10
      app/src/main/res/layout/activity_silos.xml
  15. +22
    -0
      app/src/main/res/layout/fragment_jiaoyan_clsfbc.xml
  16. +187
    -0
      app/src/main/res/layout/fragment_jiaoyan_clxs.xml
  17. +147
    -0
      app/src/main/res/layout/item/layout/item_clsfbc.xml
  18. +1
    -31
      app/src/main/res/layout/item/layout/wdsz_item.xml
  19. BIN
     
  20. BIN
     
  21. BIN
     
  22. BIN
     
  23. BIN
     
  24. BIN
     

+ 57
- 27
app/src/main/AndroidManifest.xml Dosyayı Görüntüle

@@ -33,81 +33,112 @@
tools:ignore="GoogleAppIndexingWarning"
tools:node="merge"
tools:replace="android:icon">
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_clsfbc_fragment"
android:exported="false" />
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_clxs_fragment"
android:exported="false" />
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_sdkz_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_zdqx_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_wdsz_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_lsjy_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_dzcjy_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.OrderListActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.SalesStatisticsActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.DeviceInformationActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.ImageSourceActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.SystemParameterActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.PlcControl_kz_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.PlcControl_pz_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.RealTimeActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.LogActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.PlcControlActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.GoodPeiFangActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.SilosActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.Jcsjgl_sxgl_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.Jcsjgl_wl_fragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.JcsjglActivity"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.SheZhifragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.GuanLifragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.DingDanfragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.JiaoYanFragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.GongnengFragment"
android:exported="false" tools:ignore="Instantiatable"/>
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.MakeGoodFragment"
android:exported="false"
@@ -167,8 +198,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
-->
</activity>
<!-- <service android:name="org.eclipse.paho.android.service.MqttService" /> -->
</activity> <!-- <service android:name="org.eclipse.paho.android.service.MqttService" /> -->
<receiver
android:name=".common.base.BootReceiver"
android:exported="true">


+ 0
- 1
app/src/main/java/com/bonait/bnframework/business/ConfigData.java Dosyayı Görüntüle

@@ -111,7 +111,6 @@ public class ConfigData {
LoadingPZ();
//3.初始化业务
//4.初始化日志上报adad
PLC_Init();
}

/**


+ 172
- 136
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java Dosyayı Görüntüle

@@ -200,89 +200,101 @@ public class ExecuteTheRecipe {
//endregion

//region PLC监听线程
static List<String> names=new ArrayList<>();
public static void Listening() {

// ConfigName.getInstance().PLC_Address.clear();
// ArrayList<BPA_PLCADDRESS> address = QueryDB.GetPlcaddressALL();
// for (BPA_PLCADDRESS item : address) {
// if (!item.address.isEmpty() && !item.address.equals("-------------")) {
// ConfigName.getInstance().PLC_Address.put(item.name, item);
// }
// }
//
// ThreadManager.Get().StartLong("PLC设备数据监听", true, new IThread() {
// @Override
// public void Run() throws InterruptedException {
// try {
// for (String item : ConfigName.getInstance().PLC_Address.keySet()) {
// String key = item;
// BPA_PLCADDRESS plcaddress = ConfigName.getInstance().PLC_Address.get(item);
// if (plcaddress.isread == 1) {
// Object val = ReadPLC(key);
// ListeningValue.put(key, val);
// }
// }
// } catch (Exception ex) {
// ToastUtils.error("异常信息:" + ex.getMessage());
// }
// Thread.sleep(100);
// }
//
// @Override
// public void RunComplete() throws InterruptedException {
//
// }
// });
//
// ThreadManager.Get().StartLong("PLC设备数据监听-扫码信息", true, new IThread() {
// @Override
// public void Run() throws InterruptedException {
// try {
// ReadCode();
// } catch (Exception ex) {
// ToastUtils.error("异常信息:" + ex.getMessage());
// }
// Thread.sleep(100);
// }
//
// @Override
// public void RunComplete() throws InterruptedException {
//
// }
// });
//
// ThreadManager.Get().StartLong("PLC设备数据监听-实时状态", true, new IThread() {
// @Override
// public void Run() throws InterruptedException {
// try {
// ReadPLCStatus();
// } catch (Exception ex) {
// ToastUtils.error("异常信息:" + ex.getMessage());
// }
// Thread.sleep(100);
// }
//
// @Override
// public void RunComplete() throws InterruptedException {
//
// }
// });
//
// ThreadManager.Get().StartLong("PLC设备数据监听-信号检测", true, new IThread() {
// @Override
// public void Run() throws InterruptedException {
// try {
// ChargeSignal();
// } catch (Exception ex) {
// ToastUtils.error("异常信息:" + ex.getMessage());
// }
// Thread.sleep(10);
// }
// @Override
// public void RunComplete() throws InterruptedException {
//
// }
// });
ConfigName.getInstance().PLC_Address.clear();
ArrayList<BPA_PLCADDRESS> address = QueryDB.GetPlcaddressALL();
for (BPA_PLCADDRESS item : address) {
if (!item.address.isEmpty() && !item.address.equals("-------------")) {
ConfigName.getInstance().PLC_Address.put(item.name, item);
}
}


if (ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) {
names.add("水池温度");
}else
{
names.add("水池温度");
names.add("果糖左温度");
names.add("果糖右温度");
}

ThreadManager.Get().StartLong("PLC设备数据监听", true, new IThread() {
@Override
public void Run() throws InterruptedException {
try {
for (String item : ConfigName.getInstance().PLC_Address.keySet()) {
String key = item;
BPA_PLCADDRESS plcaddress = ConfigName.getInstance().PLC_Address.get(item);
if (plcaddress.isread == 1) {
Object val = ReadPLC(key);
ListeningValue.put(key, val);
}
}

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

@Override
public void RunComplete() throws InterruptedException {

}
});

ThreadManager.Get().StartLong("PLC设备数据监听-扫码信息", true, new IThread() {
@Override
public void Run() throws InterruptedException {
try {
ReadCode();
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}
Thread.sleep(100);
}

@Override
public void RunComplete() throws InterruptedException {

}
});

ThreadManager.Get().StartLong("PLC设备数据监听-信号检测", true, new IThread() {
@Override
public void Run() throws InterruptedException {
try {
ChargeSignal();
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}
Thread.sleep(100);
}
@Override
public void RunComplete() throws InterruptedException {

}
});

ThreadManager.Get().StartLong("PLC设备数据监听-自动加热", true, new IThread() {
@Override
public void Run() throws InterruptedException {
try {
AutoJR();
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
}
Thread.sleep(1000);
}
@Override
public void RunComplete() throws InterruptedException {

}
});

ThreadManager.Get().StartLong("商品制作线程", true, new IThread() {
@Override
@@ -305,8 +317,8 @@ public class ExecuteTheRecipe {
for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) {

//复位完成信号
// WritePLC("手自切换", true,null);
// WritePLC("配料完成", false,null);
WritePLC("手自切换", true,null);
WritePLC("配料完成", false,null);
Thread.sleep(10);

final Integer key = entry.getKey();
@@ -340,17 +352,17 @@ public class ExecuteTheRecipe {
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value);
int _val = (int)Math.round((Double.parseDouble(recipe.value) * 10));

// WritePLC("需求值" + silos.num, (short) _val, new IWriteCallBack() {
// @Override
// public void onSuccess() {
// MessageLog.ShowInfo(message + "下发成功!");
// }
//
// @Override
// public void onFailure(String ErrorMsg) {
// MessageLog.ShowInfo(message + "下发失败!" + ErrorMsg);
// }
// });
WritePLC("需求值" + silos.num, (short) _val, new IWriteCallBack() {
@Override
public void onSuccess() {
MessageLog.ShowInfo(message + "下发成功!");
}
@Override
public void onFailure(String ErrorMsg) {
MessageLog.ShowInfo(message + "下发失败!" + ErrorMsg);
}
});
}
}
//endregion
@@ -366,22 +378,22 @@ public class ExecuteTheRecipe {
};

//启动配料
// WritePLC("配料启动",true,new IWriteCallBack() {
// @Override
// public void onSuccess() {
// MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料成功!");
// }
//
// @Override
// public void onFailure(String ErrorMsg) {
// MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料失败!");
// MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志, "[" + GoodMake.good.name + "]步骤【" + key + "】启动配料失败!");
// }
// });
WritePLC("配料启动",true,new IWriteCallBack() {
@Override
public void onSuccess() {
MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料成功!");
}
@Override
public void onFailure(String ErrorMsg) {
MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料失败!");
MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志, "[" + GoodMake.good.name + "]步骤【" + key + "】启动配料失败!");
}
});

long a = System.currentTimeMillis();
while (!IsComplete[0]) {
if ((System.currentTimeMillis() - a) > 1000 * 5) {
if ((System.currentTimeMillis() - a) > 1000 * 60) {
break;
}
Thread.sleep(100);//10 *6
@@ -693,6 +705,59 @@ public class ExecuteTheRecipe {
}
}

/**
* 自动加热
*/
public static void AutoJR() {
try {

if(ConfigName.getInstance().PlcIsConnect)
{

for (String item:names)
{
boolean isopen=false;
if(item.equals("水池温度"))
{
isopen=ConfigName.getInstance().AutomaticHeating;
}else if(item.equals("果糖左温度"))
{
isopen=ConfigName.getInstance().GT1_AutomaticHeating;
}else if(item.equals("果糖右温度"))
{
isopen=ConfigName.getInstance().GT2_AutomaticHeating;
}

if(isopen)
{
Object sc= getListingValue(item);
Object scsz= getListingValue(item+"设置");

int sx_temp=sc==null?0:(int)sc;//水箱温度
int sx_temp_sz=scsz==null?0:(int)scsz;//水箱温度设置值
if(sx_temp_sz>0)
{
if(sx_temp>=sx_temp_sz)
{
WritePLC(item+"加热",false,null);
}else
{
WritePLC(item+"加热",true,null);
}
}
}
}
if(ConfigName.getInstance().AutomaticHeating)
{

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

/**
* 完成信号监听
*
@@ -714,35 +779,6 @@ public class ExecuteTheRecipe {
}
//endregion

//region 获取基础挡位变量
/**
* 获取挡位变量
*
* @param name
* @param value
* @return
*/
public static int GetMXValue(String name, String value) {
final int[] ReturnsVariable = {0};
try {
if (name.contains("速度")) {
ReturnsVariable[0] = ConfigName.getInstance().StirringSpeed.get(value);
} else if (name.contains("功率")) {
ReturnsVariable[0] = ConfigName.getInstance().HeatingGear.get(value);
int max= ConfigName.getInstance().HeatingGear.get( ConfigName.getInstance().HuoLi);
if(ReturnsVariable[0]>max)
{
ReturnsVariable[0]=max;
}
}
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
} finally {
return ReturnsVariable[0];
}
}
//endregion

//region 电子称校验

/**


+ 140
- 89
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java Dosyayı Görüntüle

@@ -12,6 +12,7 @@ import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_USER;
import com.bonait.bnframework.common.db.mode.Res_PLCADDRESS;
import com.bonait.bnframework.common.db.res.Res_PLCADDRESS1;
import com.bonait.bnframework.common.db.res.Res_ZDSF;
import com.bonait.bnframework.common.db.res.StatusMode;
import com.bonait.bnframework.common.model.AddrType;
import com.bonait.bnframework.common.model.mode.CloudGood;
@@ -289,8 +290,10 @@ public class ConfigName {
add(new Res_PLCADDRESS("通道19校准开关", "M4.2", 1, 1));
add(new Res_PLCADDRESS("通道20校准开关", "M4.3", 1, 1));

add(new Res_PLCADDRESS("反转时间", "VW94", 0, 1));
add(new Res_PLCADDRESS("基准时间", "VW98", 0, 1));
add(new Res_PLCADDRESS("配料次数", "VW90", 1, 1));
//add(new Res_PLCADDRESS("反转时间", "VW94", 1, 1));//pl
add(new Res_PLCADDRESS("基准时间", "VW96", 1, 1));
//add(new Res_PLCADDRESS("基准时间", "VW98", 1, 1));

add(new Res_PLCADDRESS("通道校准", "M0.0", 0, 1));
add(new Res_PLCADDRESS("校准完成", "M0.7", 1, 0));
@@ -377,7 +380,8 @@ public class ConfigName {
//电子秤校验
add(new Res_PLCADDRESS("电子秤校验", "-------------", 0, 0));
add(new Res_PLCADDRESS("称当前重量", "VD344", 1, 0));
add(new Res_PLCADDRESS("砝码值", "VW96", 1, 1));
add(new Res_PLCADDRESS("砝码值", "VW94", 1, 1));
//add(new Res_PLCADDRESS("砝码值", "VW96", 1, 1));
add(new Res_PLCADDRESS("砝码校准模式", "M1.0", 1, 1));
add(new Res_PLCADDRESS("重量清零", "M1.1", 0, 1));
add(new Res_PLCADDRESS("关闭写保护", "M1.2", 0, 1));
@@ -387,21 +391,22 @@ public class ConfigName {

//温度监控
add(new Res_PLCADDRESS("温度控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("水池温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("水池温度上限", "VD360", 1, 1));
add(new Res_PLCADDRESS("水池温度下限", "VD368", 1, 1));
add(new Res_PLCADDRESS("水池温度加热", "M104.0", 1, 0));
add(new Res_PLCADDRESS("水池温度", "VD354", 1, 0));
add(new Res_PLCADDRESS("水池温度设置", "VD378", 1, 1));
add(new Res_PLCADDRESS("水池温度加热", "M104.1", 1, 0));

add(new Res_PLCADDRESS("果糖左温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("果糖左温度上限", "VD388", 1, 1));
add(new Res_PLCADDRESS("果糖左温度下限", "VD392", 1, 1));
add(new Res_PLCADDRESS("果糖左温度加热", "M104.0", 1, 0));
add(new Res_PLCADDRESS("果糖左温度", "VD358", 1, 0));
add(new Res_PLCADDRESS("果糖左温度设置", "VD382", 1, 1));
add(new Res_PLCADDRESS("果糖左温度加热", "M103.7", 1, 0));

add(new Res_PLCADDRESS("果糖右温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("果糖右温度上限", "VD396", 1, 1));
add(new Res_PLCADDRESS("果糖右温度下限", "VD400", 1, 1));
add(new Res_PLCADDRESS("果糖右温度", "VD362", 1, 0));
add(new Res_PLCADDRESS("果糖右温度设置", "VD386", 1, 1));
add(new Res_PLCADDRESS("果糖右温度加热", "M104.0", 1, 0));

// add(new Res_PLCADDRESS("水池温度", "VD352", 1, 0));
// add(new Res_PLCADDRESS("水池温度设置", "VD360", 1, 1));
// add(new Res_PLCADDRESS("水池温度加热", "M104.0", 1, 0));

//自动清洗
add(new Res_PLCADDRESS("自动清洗", "-------------", 0, 0));
add(new Res_PLCADDRESS("排水阀排水时间", "VW140", 1, 1));
@@ -412,37 +417,59 @@ public class ConfigName {
add(new Res_PLCADDRESS("清洗模式", "M0.4", 1, 1));
add(new Res_PLCADDRESS("自动清洗开始", "M0.5", 1, 1));
add(new Res_PLCADDRESS("自动清洗完成", "M0.6", 1, 1));
add(new Res_PLCADDRESS("清洗状态", "M1.6", 1, 0));


//手动控制
add(new Res_PLCADDRESS("手动控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("M_外置仓1正转", "M50.0", 1, 1));
add(new Res_PLCADDRESS("M_外置仓2正转", "M50.1", 1, 1));
add(new Res_PLCADDRESS("M_外置仓3正转", "M50.2", 1, 1));
add(new Res_PLCADDRESS("M_外置仓4正转", "M50.3", 1, 1));
add(new Res_PLCADDRESS("M_外置仓5正转", "M50.4", 1, 1));
add(new Res_PLCADDRESS("M_外置仓6正转", "M50.5", 1, 1));
add(new Res_PLCADDRESS("M_外置仓1反转", "M50.6", 1, 1));
add(new Res_PLCADDRESS("M_外置仓2反转", "M50.7", 1, 1));
add(new Res_PLCADDRESS("M_外置仓3反转", "M51.0", 1, 1));
add(new Res_PLCADDRESS("M_外置仓4反转", "M51.1", 1, 1));
add(new Res_PLCADDRESS("M_外置仓5反转", "M51.2", 1, 1));
add(new Res_PLCADDRESS("M_外置仓6反转", "M51.3", 1, 1));
add(new Res_PLCADDRESS("M_粉料通道1", "M51.4", 1, 1));
add(new Res_PLCADDRESS("M_粉料通道2", "M51.5", 1, 1));
add(new Res_PLCADDRESS("M_粉料通道3", "M51.6", 1, 1));
add(new Res_PLCADDRESS("M_酱油通道", "M51.7", 1, 1));
add(new Res_PLCADDRESS("M_醋通道", "M52.0", 1, 1));
add(new Res_PLCADDRESS("M_猪油通道", "M52.1", 1, 1));
add(new Res_PLCADDRESS("M_牛油通道", "M52.2", 1, 1));

add(new Res_PLCADDRESS("M_保温池进水阀", "M53.4", 1, 1));
add(new Res_PLCADDRESS("M_保温池排水阀", "M53.5", 1, 1));
add(new Res_PLCADDRESS("M_猪油管道保温", "M53.6", 1, 1));
add(new Res_PLCADDRESS("M_牛油管道保温", "M53.7", 1, 1));
add(new Res_PLCADDRESS("M_保温池加热", "M54.0", 1, 1));
add(new Res_PLCADDRESS("M_三色灯-绿", "M54.1", 1, 1));
add(new Res_PLCADDRESS("M_三色灯-红", "M54.2", 1, 1));
add(new Res_PLCADDRESS("M_蠕动泵1", "M50.0", 1, 1));
add(new Res_PLCADDRESS("M_蠕动泵2", "M50.1", 1, 1));
add(new Res_PLCADDRESS("M_蠕动泵3", "M50.2", 1, 1));
add(new Res_PLCADDRESS("M_蠕动泵4", "M50.3", 1, 1));
add(new Res_PLCADDRESS("M_蠕动泵5", "M50.4", 1, 1));
add(new Res_PLCADDRESS("M_隔膜泵1", "M50.5", 1, 1));
add(new Res_PLCADDRESS("M_隔膜泵2", "M50.6", 1, 1));
add(new Res_PLCADDRESS("M_隔膜泵3", "M50.7", 1, 1));
add(new Res_PLCADDRESS("M_隔膜泵4", "M51.0", 1, 1));
add(new Res_PLCADDRESS("M_隔膜泵5", "M51.1", 1, 1));
add(new Res_PLCADDRESS("M_果糖泵1", "M51.2", 1, 1));
add(new Res_PLCADDRESS("M_果糖泵2", "M51.3", 1, 1));
add(new Res_PLCADDRESS("M_清洗液泵", "M51.4", 1, 1));

add(new Res_PLCADDRESS("M_排水阀开", "M53.4", 1, 1));
add(new Res_PLCADDRESS("M_排水阀关", "M53.5", 1, 1));
add(new Res_PLCADDRESS("M_进水开关", "M53.6", 1, 1));
add(new Res_PLCADDRESS("M_果糖1加热", "M53.7", 1, 1));
add(new Res_PLCADDRESS("M_果糖2加热", "M54.0", 1, 1));
add(new Res_PLCADDRESS("M_清洗加热", "M54.1", 1, 1));

// add(new Res_PLCADDRESS("M_外置仓1正转", "M50.0", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓2正转", "M50.1", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓3正转", "M50.2", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓4正转", "M50.3", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓5正转", "M50.4", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓6正转", "M50.5", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓1反转", "M50.6", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓2反转", "M50.7", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓3反转", "M51.0", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓4反转", "M51.1", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓5反转", "M51.2", 1, 1));
// add(new Res_PLCADDRESS("M_外置仓6反转", "M51.3", 1, 1));
// add(new Res_PLCADDRESS("M_粉料通道1", "M51.4", 1, 1));
// add(new Res_PLCADDRESS("M_粉料通道2", "M51.5", 1, 1));
// add(new Res_PLCADDRESS("M_粉料通道3", "M51.6", 1, 1));
// add(new Res_PLCADDRESS("M_酱油通道", "M51.7", 1, 1));
// add(new Res_PLCADDRESS("M_醋通道", "M52.0", 1, 1));
// add(new Res_PLCADDRESS("M_猪油通道", "M52.1", 1, 1));
// add(new Res_PLCADDRESS("M_牛油通道", "M52.2", 1, 1));
//
// add(new Res_PLCADDRESS("M_保温池进水阀", "M53.4", 1, 1));
// add(new Res_PLCADDRESS("M_保温池排水阀", "M53.5", 1, 1));
// add(new Res_PLCADDRESS("M_猪油管道保温", "M53.6", 1, 1));
// add(new Res_PLCADDRESS("M_牛油管道保温", "M53.7", 1, 1));
// add(new Res_PLCADDRESS("M_保温池加热", "M54.0", 1, 1));
// add(new Res_PLCADDRESS("M_三色灯-绿", "M54.1", 1, 1));
// add(new Res_PLCADDRESS("M_三色灯-红", "M54.2", 1, 1));

add(new Res_PLCADDRESS("扫码数据读取", "-------------", 0, 0));
add(new Res_PLCADDRESS("扫码数据", "VW702", 1, 0));
@@ -488,28 +515,29 @@ public class ConfigName {

//硬件设备 初始化
add(new Res_PLCADDRESS1("-------------","","加热开关控制",1,0));
add(new Res_PLCADDRESS1("M11.7","M51.7","果糖仓加热(左)",1,1));
add(new Res_PLCADDRESS1("M12.0","M52.0","果糖仓加热(右)",1,1));
add(new Res_PLCADDRESS1("M12.1","M52.1","清洗池加热",1,1));
add(new Res_PLCADDRESS1("M53.7","M103.7","果糖仓加热(左)",1,1));
add(new Res_PLCADDRESS1("M54.0","M104.0","果糖仓加热(右)",1,1));
add(new Res_PLCADDRESS1("M54.1","M104.1","清洗池加热",1,1));
add(new Res_PLCADDRESS1("-------------","","果糖仓泵/清洗池泵",1,0));
add(new Res_PLCADDRESS1("M11.3","M51.3","进水阀",1,1));
add(new Res_PLCADDRESS1("M11.2","M51.2","排水阀(开)",1,1));
add(new Res_PLCADDRESS1("M12.2","M52.2","排水阀(关)",1,1));
add(new Res_PLCADDRESS1("M11.4","M51.4","清洗池泵",1,1));
add(new Res_PLCADDRESS1("M11.5","M51.5","果糖泵(左)",1,1));
add(new Res_PLCADDRESS1("M11.6","M51.6","果糖泵(右)",1,1));
add(new Res_PLCADDRESS1("-------------","","离心泵控制",1,0));
add(new Res_PLCADDRESS1("M10.5","M50.5","离心泵(一)",1,1));
add(new Res_PLCADDRESS1("M10.6","M50.6","离心泵(二)",1,1));
add(new Res_PLCADDRESS1("M10.7","M50.7","离心泵(三)",1,1));
add(new Res_PLCADDRESS1("M11.0","M51.0","离心泵(四)",1,1));
add(new Res_PLCADDRESS1("M11.1","M51.1","离心泵(五)",1,1));
add(new Res_PLCADDRESS1("M53.6","M103.6","进水阀",1,1));
add(new Res_PLCADDRESS1("M53.4","M103.4","排水阀(开)",1,1));
add(new Res_PLCADDRESS1("M53.5","M103.5","排水阀(关)",1,1));
add(new Res_PLCADDRESS1("M51.4","M101.4","清洗池泵",1,1));
add(new Res_PLCADDRESS1("M51.2","M101.2","果糖泵(左)",1,1));
add(new Res_PLCADDRESS1("M51.3","M101.3","果糖泵(右)",1,1));
add(new Res_PLCADDRESS1("-------------","","蠕动泵控制",1,0));
add(new Res_PLCADDRESS1("M10.0","M50.0","蠕动泵(一)",1,1));
add(new Res_PLCADDRESS1("M10.1","M50.1","蠕动泵(二)",1,1));
add(new Res_PLCADDRESS1("M10.2","M50.2","蠕动泵(三)",1,1));
add(new Res_PLCADDRESS1("M10.3","M50.3","蠕动泵(四)",1,1));
add(new Res_PLCADDRESS1("M10.4","M50.4","蠕动泵(五)",1,1));
add(new Res_PLCADDRESS1("M50.0","M100.0","蠕动泵(一)",1,1));
add(new Res_PLCADDRESS1("M50.1","M100.1","蠕动泵(二)",1,1));
add(new Res_PLCADDRESS1("M50.2","M100.2","蠕动泵(三)",1,1));
add(new Res_PLCADDRESS1("M50.3","M100.3","蠕动泵(四)",1,1));
add(new Res_PLCADDRESS1("M50.4","M100.4","蠕动泵(五)",1,1));
add(new Res_PLCADDRESS1("-------------","","隔膜泵控制",1,0));
add(new Res_PLCADDRESS1("M50.5","M100.5","隔膜泵(一)",1,1));
add(new Res_PLCADDRESS1("M50.6","M100.6","隔膜泵(二)",1,1));
add(new Res_PLCADDRESS1("M50.7","M100.7","隔膜泵(三)",1,1));
add(new Res_PLCADDRESS1("M51.0","M101.0","隔膜泵(四)",1,1));
add(new Res_PLCADDRESS1("M51.1","M101.1","隔膜泵(五)",1,1));

}};


@@ -562,8 +590,10 @@ public class ConfigName {
add(new Res_PLCADDRESS("通道19校准开关", "M4.2", 1, 1));
add(new Res_PLCADDRESS("通道20校准开关", "M4.3", 1, 1));

add(new Res_PLCADDRESS("反转时间", "VW94", 0, 1));
add(new Res_PLCADDRESS("基准时间", "VW98", 0, 1));
add(new Res_PLCADDRESS("配料次数", "VW90", 1, 1));
add(new Res_PLCADDRESS("反转时间", "VW94", 1, 1));//pl
//add(new Res_PLCADDRESS("基准时间", "VW96", 1, 1));
add(new Res_PLCADDRESS("基准时间", "VW98", 1, 1));

add(new Res_PLCADDRESS("通道校准", "M0.0", 0, 1));
add(new Res_PLCADDRESS("校准完成", "M0.7", 1, 0));
@@ -650,6 +680,7 @@ public class ConfigName {
//电子秤校验
add(new Res_PLCADDRESS("电子秤校验", "-------------", 0, 0));
add(new Res_PLCADDRESS("称当前重量", "VD344", 1, 0));
//add(new Res_PLCADDRESS("砝码值", "VW94", 1, 1));
add(new Res_PLCADDRESS("砝码值", "VW96", 1, 1));
add(new Res_PLCADDRESS("砝码校准模式", "M1.0", 1, 1));
add(new Res_PLCADDRESS("重量清零", "M1.1", 0, 1));
@@ -657,27 +688,42 @@ public class ConfigName {
add(new Res_PLCADDRESS("零点校准", "M1.3", 0, 1));
add(new Res_PLCADDRESS("砝码值写入", "M1.4", 0, 1));
add(new Res_PLCADDRESS("打开写保护", "M1.5", 0, 1));
add(new Res_PLCADDRESS("清洗状态", "M1.6", 1, 0));

//温度监控
add(new Res_PLCADDRESS("温度控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("水池温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("水池温度上限", "VD360", 1, 1));
add(new Res_PLCADDRESS("水池温度下限", "VD368", 1, 1));
add(new Res_PLCADDRESS("水池温度加热", "VD352", 1, 0));
// add(new Res_PLCADDRESS("水池温度", "VD354", 1, 0));
// add(new Res_PLCADDRESS("水池温度设置", "VD378", 1, 1));
// add(new Res_PLCADDRESS("水池温度加热", "M104.1", 1, 0));
//
// add(new Res_PLCADDRESS("果糖左温度", "VD358", 1, 0));
// add(new Res_PLCADDRESS("果糖左温度设置", "VD382", 1, 1));
// add(new Res_PLCADDRESS("果糖左温度加热", "M103.7", 1, 0));
//
// add(new Res_PLCADDRESS("果糖右温度", "VD362", 1, 0));
// add(new Res_PLCADDRESS("果糖右温度设置", "VD386", 1, 1));
// add(new Res_PLCADDRESS("果糖右温度加热", "M104.0", 1, 0));

add(new Res_PLCADDRESS("果糖左温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("果糖左温度上限", "VD388", 1, 1));
add(new Res_PLCADDRESS("果糖左温度下限", "VD392", 1, 1));
add(new Res_PLCADDRESS("果糖左温度加热", "VD352", 1, 0));
add(new Res_PLCADDRESS("水池温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("水池温度设置", "VD360", 1, 1));
add(new Res_PLCADDRESS("水池温度加热", "M104.0", 1, 0));

add(new Res_PLCADDRESS("果糖右温度", "VD352", 1, 0));
add(new Res_PLCADDRESS("果糖右温度上限", "VD396", 1, 1));
add(new Res_PLCADDRESS("果糖右温度下限", "VD400", 1, 1));
add(new Res_PLCADDRESS("果糖右温度加热", "VD352", 1, 0));
//自动清洗
add(new Res_PLCADDRESS("自动清洗", "-------------", 0, 0));
add(new Res_PLCADDRESS("排水阀排水时间", "VW140", 1, 1));
add(new Res_PLCADDRESS("排水阀进水时间", "VW142", 1, 1));
add(new Res_PLCADDRESS("清洗预加热时间", "VW144", 1, 1));
add(new Res_PLCADDRESS("加清洗剂时间", "VW146", 1, 1));
add(new Res_PLCADDRESS("循环清洗时间", "VW148", 1, 1));
add(new Res_PLCADDRESS("清洗模式", "M0.4", 1, 1));
add(new Res_PLCADDRESS("自动清洗开始", "M0.5", 1, 1));
add(new Res_PLCADDRESS("自动清洗完成", "M0.6", 1, 1));


//手动控制
add(new Res_PLCADDRESS("手动控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("M_蠕动泵1", "M50.0", 1, 1));

add(new Res_PLCADDRESS("M_外置仓1正转", "M50.0", 1, 1));
add(new Res_PLCADDRESS("M_外置仓2正转", "M50.1", 1, 1));
add(new Res_PLCADDRESS("M_外置仓3正转", "M50.2", 1, 1));
@@ -780,6 +826,25 @@ public class ConfigName {
add(new Res_PLCADDRESS1("M54.0","M104.0","水池加热",1,1));

}};

/**
* 出料算法
*/
public List<Res_ZDSF> zdsfs_出料算法=new ArrayList<Res_ZDSF>(){{
//硬件设备 初始化
add(new Res_ZDSF("外置通道(一)","VW194.0","VW144","VW44","VW168"));
add(new Res_ZDSF("外置通道(二)","VW194.1","VW146","VW46","VW170"));
add(new Res_ZDSF("外置通道(三)","VW194.2","VW148","VW48","VW172"));
add(new Res_ZDSF("外置通道(四)","VW194.3","VW150","VW50","VW174"));
add(new Res_ZDSF("外置通道(五)","VW194.4","VW152","VW52","VW176"));
add(new Res_ZDSF("外置通道(六)","VW194.5","VW154","VW54","VW178"));
// add(new Res_ZDSF("外置通道(七)","VW194.6","VW156","VW56","VW180"));
// add(new Res_ZDSF("外置通道(八)","VW194.7","VW158","VW58","VW182"));
// add(new Res_ZDSF("外置通道(九)","VW194.8","VW160","VW60","VW184"));
// add(new Res_ZDSF("外置通道(十)","VW194.9","VW162","VW62","VW186"));

}};

/**
* 根据名称获取变量
*
@@ -978,20 +1043,6 @@ public class ConfigName {
public FragmentAdapter fragmentAdapter = null;

public FragmentManager main = null;
/**
* 主页变量
*/
public List<Fragment> fragmentList = new ArrayList<Fragment>() {
{
add(new GongnengFragment());
add(new JiaoYanFragment());
add(new DingDanfragment());
add(new MakeGoodFragment());
add(new GuanLifragment());
add(new SheZhifragment());
add(new MyFragment());
}
};
//endregion

//region 是否自动加热


+ 1
- 3
app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java Dosyayı Görüntüle

@@ -280,10 +280,8 @@ public class DataBus {
wdszMode mode=new wdszMode();
mode.name=item;
mode.temp=0;
Object sx=ExecuteTheRecipe.getListingValue(item+"上限");
Object sx=ExecuteTheRecipe.getListingValue(item+"设置");
mode.tempup=sx==null?0:(int)sx;
Object xx=ExecuteTheRecipe.getListingValue(item+"下限");
mode.tempdown=xx==null?0:(int)xx;

if(item.equals("水池温度"))
{


+ 18
- 0
app/src/main/java/com/bonait/bnframework/common/db/res/Res_ZDSF.java Dosyayı Görüntüle

@@ -0,0 +1,18 @@
package com.bonait.bnframework.common.db.res;

public class Res_ZDSF {

public String name;//名称
public String kg_address;
public String H_address;
public String L_address;
public String time_address;
public Res_ZDSF(String _name, String _kg_address,String _H_address,String _L_address, String _time_address)
{
this.name=_name;
this.kg_address=_kg_address;
this.H_address=_H_address;
this.L_address=_L_address;
this.time_address=_time_address;
}
}

+ 191
- 0
app/src/main/java/com/bonait/bnframework/modules/home/adapter/clsfbc_adapter.java Dosyayı Görüntüle

@@ -0,0 +1,191 @@
package com.bonait.bnframework.modules.home.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Switch;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.res.Res_PLCADDRESS1;
import com.bonait.bnframework.common.db.res.Res_ZDSF;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.fragment.mode.image_sp;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.suke.widget.SwitchButton;

import java.util.ArrayList;
import java.util.List;

public class clsfbc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private final LayoutInflater mLayoutInflater;

private Context context;

List<Res_ZDSF> goods = new ArrayList<>();

/**
* 点击事件
*/
public MyClickListener mListener=null;

public clsfbc_adapter(Context context,List<Res_ZDSF> data) {
this.context = context;
mLayoutInflater = LayoutInflater.from(context);
goods=data;
}

@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View inflate = mLayoutInflater.inflate(R.layout.item_clsfbc, parent, false);
return new MyLCViewHolder1(inflate);

}

@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
try {
if (holder instanceof MyLCViewHolder1) {
MyLCViewHolder1 myViewHolder = (MyLCViewHolder1) holder;
Res_ZDSF sf= goods.get(position);
myViewHolder.td_text.setText(sf.name);
int index=position+1;
Object kg=ExecuteTheRecipe.ReadPLC("通道"+index+"补偿开关");
myViewHolder.switch1.setChecked(kg==null?false:((boolean) kg));


Object dxs=ExecuteTheRecipe.ReadPLC("高系数"+index);
myViewHolder.bc_text1.setText(dxs==null?"0":(dxs+""));
Object gxs=ExecuteTheRecipe.ReadPLC("低系数"+index);
myViewHolder.bc_text2.setText(gxs==null?"0":(gxs+""));

Object time=ExecuteTheRecipe.ReadPLC("补偿"+index+"时间");
myViewHolder.bc_text3.setText(time==null?"0.0":(String.format ("%.1f", (int)time/10.0)+""));

myViewHolder.save_botton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

Short H=0;
Short L=0;
Short time=0;
try {
H=Short.parseShort(myViewHolder.bc_text1.getText().toString()) ;
L=Short.parseShort(myViewHolder.bc_text2.getText().toString()) ;
//time=(Short)Math.round();
int ftime = (int)Math.round((Double.parseDouble(myViewHolder.bc_text3.getText().toString()) * 10));
time=(short) ftime;
}
catch (Exception ex)
{

}

ExecuteTheRecipe.WritePLC("高系数"+index,H,null);
ExecuteTheRecipe.WritePLC("低系数"+index,L,null);
ExecuteTheRecipe.WritePLC("补偿" + index + "时间", time, new IWriteCallBack() {
@Override
public void onSuccess() {
ToastUtils.info(sf.name.toString()+",保存变量成功!");
}

@Override
public void onFailure(String ErrorMsg) {
ToastUtils.warning( sf.name.toString()+",保存变量失败!");
}
});
}
});

myViewHolder.switch1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
boolean isopen= myViewHolder.switch1.isChecked();
if (ConfigName.getInstance().PlcIsConnect)
{
ExecuteTheRecipe.WritePLC("通道"+index+"补偿开关",isopen,null);
ToastUtils.info( sf.name.toString()+(isopen?"打开":"关闭")+"成功!");

}else
{
ToastUtils.warning( sf.name.toString()+(isopen?"打开":"关闭")+"失败!PLC未连接!!");
}
}
});
}
} catch (Exception e) {
e.printStackTrace();
}
}

private Activity findActivity(@NonNull Context context) {
if (context instanceof Activity) {
return (Activity) context;
} else if (context instanceof ContextWrapper) {
return findActivity(((ContextWrapper) context).getBaseContext());
} else {
return null;
}
}

/**
* 刷新
*
* @param
*/
public void refresh() {
Activity activity = findActivity(context);
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
try {
notifyDataSetChanged();
} catch (Exception e) {

}
}
});
}
}

@Override
public int getItemCount() {
return goods.size();
}

public static class MyLCViewHolder1 extends RecyclerView.ViewHolder {
TextView td_text;//标题
SwitchButton switch1;
EditText bc_text1,bc_text2,bc_text3;

Button save_botton;

public MyLCViewHolder1(View view) {
super(view);
td_text=view.findViewById(R.id.td_text);
bc_text1=view.findViewById(R.id.bc_text1);
bc_text2=view.findViewById(R.id.bc_text2);
bc_text3=view.findViewById(R.id.bc_text3);
save_botton=view.findViewById(R.id.save_botton);
}
}
}

+ 1
- 21
app/src/main/java/com/bonait/bnframework/modules/home/adapter/wdsz_adapter.java Dosyayı Görüntüle

@@ -57,7 +57,6 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>

myViewHolder.name.setText(goodsMake.name+"");
myViewHolder.edittext_sx.setText(goodsMake.tempup+"");
myViewHolder.edittext_xx.setText(goodsMake.tempdown+"");
myViewHolder.temp.setText(goodsMake.temp+"");
myViewHolder.control_switch.setChecked(goodsMake.autoheat);

@@ -89,21 +88,7 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
ToastUtils.error("温度上限不能小于0!请调整后重试.");
return;
}

int down = Integer.parseInt((myViewHolder.edittext_xx.getText().toString().isEmpty() ? "0" : myViewHolder.edittext_xx.getText().toString()));
if (up <= 0) {
ToastUtils.error("温度下限不能小于0!请调整后重试.");
return;
}

if(up<=down)
{
ToastUtils.error("温度上限不能小于等于温度下限!请调整后重试.");
return;
}

ExecuteTheRecipe.WritePLC(goodsMake.name+"上限",up,null);
ExecuteTheRecipe.WritePLC(goodsMake.name + "下限", down, new IWriteCallBack() {
ExecuteTheRecipe.WritePLC(goodsMake.name + "设置", up, new IWriteCallBack() {
@Override
public void onSuccess() {
ToastUtils.info(goodsMake.name+"保存成功!");
@@ -167,10 +152,6 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
* 温度上限
*/
EditText edittext_sx;
/**
* 温度下限
*/
EditText edittext_xx;
/**
* 当前温度
*/
@@ -187,7 +168,6 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
super(view);
name = (TextView) view.findViewById(R.id.name);
edittext_sx=(EditText) view.findViewById(R.id.edittext_sx);
edittext_xx=(EditText) view.findViewById(R.id.edittext_xx);
temp = (TextView) view.findViewById(R.id.temp);
control_switch = (SwitchButton)view.findViewById(R.id.control_switch);
save_value=(Button) view.findViewById(R.id.save_value);


+ 13
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/JiaoYanFragment.java Dosyayı Görüntüle

@@ -27,6 +27,8 @@ import com.bonait.bnframework.common.model.mode.ResMenuLeft;
import com.bonait.bnframework.common.tabbar.MainNavigateTabBar;
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter;
import com.bonait.bnframework.modules.home.adapter.jiaoyan_adapter;
import com.bonait.bnframework.modules.home.fragment.from.fragment.JiaoYan_clsfbc_fragment;
import com.bonait.bnframework.modules.home.fragment.from.fragment.JiaoYan_clxs_fragment;
import com.bonait.bnframework.modules.home.fragment.from.fragment.JiaoYan_dzcjy_fragment;
import com.bonait.bnframework.modules.home.fragment.from.fragment.JiaoYan_lsjy_fragment;
import com.bonait.bnframework.modules.home.fragment.from.fragment.JiaoYan_sdkz_fragment;
@@ -89,8 +91,19 @@ public class JiaoYanFragment extends BaseFragment {
{
fragmentList = new ArrayList<>();
menuModes.clear();

// if (ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) {
// names.add("水池温度");
// }else
// {
// names.add("水池温度");
// names.add("果糖左温度");
// names.add("果糖右温度");
// }
menuModes.add(new ResMenuLeft(new JiaoYan_dzcjy_fragment(),"电子秤校验", R.mipmap.dzcjy, R.mipmap.dzcjy_select,true));
menuModes.add(new ResMenuLeft(new JiaoYan_lsjy_fragment(),"流速校验", R.mipmap.lsjy, R.mipmap.lsjy_select,false));
menuModes.add(new ResMenuLeft(new JiaoYan_clsfbc_fragment(),"出料算法补偿", R.mipmap.clsfbc, R.mipmap.clsfbc_selectd,false));

menuModes.add(new ResMenuLeft(new JiaoYan_wdsz_fragment(),"温度设置", R.mipmap.lsjy, R.mipmap.lsjy_select,false));
menuModes.add(new ResMenuLeft(new JiaoYan_zdqx_fragment(),"自动清洗", R.mipmap.zdqx1, R.mipmap.zdqx1_select,false));
menuModes.add(new ResMenuLeft(new JiaoYan_sdkz_fragment(),"手动控制", R.mipmap.sdkz, R.mipmap.sdkz_select,false));


+ 102
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_clsfbc_fragment.java Dosyayı Görüntüle

@@ -0,0 +1,102 @@
package com.bonait.bnframework.modules.home.fragment.from.fragment;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

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.helper.I.IRun;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.modules.home.adapter.clsfbc_adapter;
import com.bonait.bnframework.modules.home.adapter.image_sp_adapter;
import com.orhanobut.logger.Logger;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;

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

public class JiaoYan_clsfbc_fragment extends BaseFragment {


@BindView(R.id.recycler_clsfbc)
RecyclerView recycler_clsfbc;//出料算法补偿
private Context context;
@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_jiaoyan_clsfbc, null);
ButterKnife.bind(this, root);
return root;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Logger.d("我的fragment创建");
context = getContext();
InitView();
}
/**
* 初始化界面
*/
public void InitView() {
Initdata();
}

// boolean IsStart = false;
// @OnClick({R.id.save_time,R.id.bt_start})
// public void onViewClicked(View view) {
//
// }


//region 数据加载
/**
* 初始化数据加载
*/
public void Initdata() {
try {
MyLayoutManager layout = new MyLayoutManager();
layout.setAutoMeasureEnabled(true);
recycler_clsfbc.setLayoutManager(layout);
clsfbc_adapter spadapter = new clsfbc_adapter(context, ConfigName.getInstance().zdsfs_出料算法);
recycler_clsfbc.setAdapter(spadapter);


} catch (Exception e) {

}
}
//endregion

@Override
public void onDestroy() {
super.onDestroy();
Logger.d("我的fragment销毁");
}

/**
* 当在activity设置viewPager + BottomNavigation + fragment时,
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题,
* 必须加上此方法,禁止fragment左滑返回上一界面。
* <p>
* 切记!切记!切记!否则会闪退!
* <p>
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。
*/
@Override
protected boolean canDragBack() {
return false;
}
}

+ 82
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_clxs_fragment.java Dosyayı Görüntüle

@@ -0,0 +1,82 @@
package com.bonait.bnframework.modules.home.fragment.from.fragment;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseFragment;
import com.orhanobut.logger.Logger;

import butterknife.ButterKnife;

public class JiaoYan_clxs_fragment extends BaseFragment {


private Context context;
@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_jiaoyan_clxs, null);
ButterKnife.bind(this, root);
return root;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Logger.d("我的fragment创建");
context = getContext();
InitView();
}
/**
* 初始化界面
*/
public void InitView() {
Initdata();
}

// boolean IsStart = false;
// @OnClick({R.id.save_time,R.id.bt_start})
// public void onViewClicked(View view) {
//
// }


//region 数据加载
/**
* 初始化数据加载
*/
public void Initdata() {
try {

} catch (Exception e) {

}
}
//endregion

@Override
public void onDestroy() {
super.onDestroy();
Logger.d("我的fragment销毁");
}

/**
* 当在activity设置viewPager + BottomNavigation + fragment时,
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题,
* 必须加上此方法,禁止fragment左滑返回上一界面。
* <p>
* 切记!切记!切记!否则会闪退!
* <p>
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。
*/
@Override
protected boolean canDragBack() {
return false;
}
}

+ 1
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/sdkz_control.java Dosyayı Görüntüle

@@ -69,6 +69,7 @@ public class sdkz_control extends LinearLayout {
public void onClick(View view) {
boolean isopen= aSwitch.isChecked();
String addr= aSwitch.getTag().toString();
ExecuteTheRecipe.WritePLC("手自切换",false,null);
ExecuteTheRecipe.WritePLCSD(addr,isopen,null);
ToastUtils.info(aSwitch.getText().toString()+",地址:"+addr+".状态:"+isopen);
}


+ 3
- 1
app/src/main/res/layout/activity_orderlist.xml Dosyayı Görüntüle

@@ -14,7 +14,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_background"
/>
>

</RelativeLayout>

<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"


+ 0
- 10
app/src/main/res/layout/activity_silos.xml Dosyayı Görüntüle

@@ -55,16 +55,6 @@
android:layout_height="wrap_content"
android:text="料仓下发无物料名称,点击料仓图形绑定"
android:textColor="@color/red_primary_dark"/>
<ImageView
android:layout_marginLeft="40dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@mipmap/zhuyi"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="料仓下发无物料名称,点击料仓图形绑定"
android:textColor="@color/red_primary_dark"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>


+ 22
- 0
app/src/main/res/layout/fragment_jiaoyan_clsfbc.xml Dosyayı Görüntüle

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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.from.fragment.JiaoYan_clsfbc_fragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_background"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_clsfbc"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
</RelativeLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 187
- 0
app/src/main/res/layout/fragment_jiaoyan_clxs.xml Dosyayı Görüntüle

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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.from.fragment.JiaoYan_clxs_fragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_background"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="① 填入时间"
android:textAlignment="center" />
<ImageView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/jt_x"/>
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="排水阀排水时间"
android:textAlignment="center" />
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="排水阀进水时间"
android:textAlignment="center" />
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="清洗预加热时间"
android:textAlignment="center" />
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="加清洗剂时间"
android:textAlignment="center" />
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="循环清洗时间"
android:textAlignment="center" />
</LinearLayout>
<RelativeLayout
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_width="2dp"
android:layout_height="200dp"
android:background="@color/app_color_blue">
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:layout_marginLeft="20dp"
android:id="@+id/edittext_pssj"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789."
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp" />
<EditText
android:layout_marginLeft="20dp"
android:layout_marginTop="17dp"
android:id="@+id/edittext_jssj"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789."
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp" />
<EditText
android:layout_marginLeft="20dp"
android:layout_marginTop="17dp"
android:id="@+id/edittext_jrsj"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789."
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp" />
<EditText
android:layout_marginLeft="20dp"
android:layout_marginTop="17dp"
android:id="@+id/edittext_qxjsj"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789."
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp" />
<EditText
android:layout_marginLeft="20dp"
android:layout_marginTop="17dp"
android:id="@+id/edittext_xhsj"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789."
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>

<ImageView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/jt_x"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="② 点击保存"
android:textAlignment="center" />
<Button
android:id="@+id/save_time"
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="26dp"
android:layout_centerInParent="true"
android:background="@drawable/bg_btn_login_selected"
android:text="保存"
android:textColor="@color/white"
android:textSize="14dp" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/bt_start"
android:layout_marginTop="40dp"
android:layout_width="120dp"
android:layout_height="80dp"
android:background="@drawable/wh_bj"
android:layout_centerInParent="true"
android:text="开始清洗"
android:textColor="@color/white" />
</RelativeLayout>

</LinearLayout>
<!-- 物料信息管理 -->
</RelativeLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 147
- 0
app/src/main/res/layout/item/layout/item_clsfbc.xml Dosyayı Görüntüle

@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/white"
android:layout_marginBottom="10dp">
<TextView
android:id="@+id/td_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="通道1"
android:textStyle="bold"
android:textSize="24dp"/>
<RelativeLayout
android:layout_width="240dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="通道补偿启停:"
android:layout_margin="5dp"/>
<com.suke.widget.SwitchButton
android:layout_alignParentRight="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/switch1"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:focusable="true"
/>
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_centerVertical="true"

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="高范围系数:"
android:layout_margin="5dp"/>

<EditText
android:layout_marginLeft="20dp"
android:id="@+id/bc_text1"
android:layout_width="100dp"
android:minWidth="60dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789"
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp"
android:text="0"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="低范围系数:"
android:layout_margin="5dp"/>
<EditText
android:layout_marginLeft="20dp"
android:id="@+id/bc_text2"
android:layout_width="100dp"
android:minWidth="60dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789"
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp"
android:text="0"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/dp_10">
<TextView
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="通道出料时间:"
android:layout_margin="5dp"/>
<EditText
android:layout_marginLeft="20dp"
android:id="@+id/bc_text3"
android:layout_width="100dp"
android:minWidth="60dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:digits="0123456789."
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp"
android:text="0"/>
</RelativeLayout>

<Button
android:id="@+id/save_botton"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:layout_height="30dp"
android:layout_width="match_parent"
android:background="@drawable/button3"
android:text="保存"
/>

</LinearLayout>

</LinearLayout>

+ 1
- 31
app/src/main/res/layout/item/layout/wdsz_item.xml Dosyayı Görüntüle

@@ -40,7 +40,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="温度上限:"
android:text="温度设置:"
android:textAlignment="center" />
<EditText
android:id="@+id/edittext_sx"
@@ -57,36 +57,6 @@
</LinearLayout>
</RelativeLayout>

<RelativeLayout
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_marginLeft="40dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="温度下限:"
android:textAlignment="center" />
<EditText
android:id="@+id/edittext_xx"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="number"
android:digits="0123456789"
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp"
android:text="0"/>
</LinearLayout>
</RelativeLayout>

<RelativeLayout
android:layout_marginTop="10dp"
android:layout_marginLeft="40dp"








Yükleniyor…
İptal
Kaydet