Browse Source

制作23

tags/old_version_1
fyf 1 year ago
parent
commit
778e9c4307
4 changed files with 106 additions and 8 deletions
  1. +78
    -0
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +10
    -8
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  3. +8
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/LocationStatus.java
  4. +10
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/MyStatus.java

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

@@ -5,6 +5,8 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_SILOS; import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.fragment.mode.LocationStatus;
import com.bonait.bnframework.modules.home.fragment.mode.MyStatus;


import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@@ -359,4 +361,80 @@ public class ExecuteTheRecipe {
} }
//endregion //endregion


//region 主页按钮

/**
* 点击清洗按钮
* @param data
*/
public static void Write_PLC_Clean(MyStatus data)
{
try
{
if(data==MyStatus.Start)
{
ToastUtils.info("点击启动搅拌清洗按钮");

}else if(data==MyStatus.Paused)
{
ToastUtils.info("点击暂停清洗按钮");

}else if(data==MyStatus.Stop)
{
ToastUtils.info("点击停止清洗按钮");
}
}catch (Exception ex)
{
ToastUtils.error("异常信息:" + ex.getMessage());
}
}

/**
* 点击清洗按钮
* @param data
*/
public static void Write_PLC_Location(LocationStatus data)
{
try
{
if(data==LocationStatus.InLocation)
{
ToastUtils.info("点击炒菜位按钮");

}else if(data==LocationStatus.OutLocation)
{
ToastUtils.info("点击出菜位按钮");

}else if(data==LocationStatus.PourWaterLocation)
{
ToastUtils.info("点击倒水位按钮");
}
}catch (Exception ex)
{
ToastUtils.error("异常信息:" + ex.getMessage());
}
}

/**
* 点击摇欠按钮
* @param data
*/
public static void Write_PLC_YaoQian(MyStatus data)
{
try
{
if(data==MyStatus.Start)
{
ToastUtils.info("点击摇浅按钮");

}else if(data==MyStatus.Stop)
{
ToastUtils.info("点击停摇按钮");
}
}catch (Exception ex)
{
ToastUtils.error("异常信息:" + ex.getMessage());
}
}
//endregion
} }

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

@@ -35,6 +35,8 @@ import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager; import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.modules.home.adapter.lc_adapter; import com.bonait.bnframework.modules.home.adapter.lc_adapter;
import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity; import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity;
import com.bonait.bnframework.modules.home.fragment.mode.LocationStatus;
import com.bonait.bnframework.modules.home.fragment.mode.MyStatus;
import com.bonait.bnframework.modules.home.fragment.mode.huoli_control; import com.bonait.bnframework.modules.home.fragment.mode.huoli_control;
import com.capton.colorfulprogressbar.ColorfulProgressbar; import com.capton.colorfulprogressbar.ColorfulProgressbar;
import com.orhanobut.logger.Logger; import com.orhanobut.logger.Logger;
@@ -325,28 +327,28 @@ public class Home1Fragment extends BaseFragment {
} }
break; break;
case R.id.qdjb: case R.id.qdjb:
ToastUtils.info("点击启动搅拌清洗按钮");
ExecuteTheRecipe.Write_PLC_Clean(MyStatus.Start);
break; break;
case R.id.ztjb: case R.id.ztjb:
ToastUtils.info("点击暂停清洗按钮");
ExecuteTheRecipe.Write_PLC_Clean(MyStatus.Paused);
break; break;
case R.id.tzjb: case R.id.tzjb:
ToastUtils.info("点击停止清洗按钮");
ExecuteTheRecipe.Write_PLC_Clean(MyStatus.Stop);
break; break;
case R.id.ccw: case R.id.ccw:
ToastUtils.info("点击炒菜位按钮");
ExecuteTheRecipe.Write_PLC_Location(LocationStatus.InLocation);
break; break;
case R.id.chucw: case R.id.chucw:
ToastUtils.info("点击出菜位按钮");
ExecuteTheRecipe.Write_PLC_Location(LocationStatus.OutLocation);
break; break;
case R.id.dsw: case R.id.dsw:
ToastUtils.info("点击倒水位按钮");
ExecuteTheRecipe.Write_PLC_Location(LocationStatus.PourWaterLocation);
break; break;
case R.id.yaoqian: case R.id.yaoqian:
ToastUtils.info("点击摇浅按钮");
ExecuteTheRecipe.Write_PLC_YaoQian(MyStatus.Start);
break; break;
case R.id.tingyao: case R.id.tingyao:
ToastUtils.info("点击停摇按钮");
ExecuteTheRecipe.Write_PLC_YaoQian(MyStatus.Stop);
break; break;
} }
} }


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

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


public enum LocationStatus {
InLocation,
OutLocation,
PourWaterLocation
}

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

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

/**
* 状态
*/
public enum MyStatus {
Start,
Paused,
Stop
}

Loading…
Cancel
Save