# Conflicts: # app/src/main/java/com/bonait/bnframework/business/YJDeviceHelper.java # app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java鸿鹄中学一拖二
@@ -1,23 +1,17 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="deploymentTargetDropDown"> | |||
<value> | |||
<entry key="app"> | |||
<State> | |||
<targetSelectedWithDropDown> | |||
<Target> | |||
<type value="QUICK_BOOT_TARGET" /> | |||
<deviceKey> | |||
<Key> | |||
<type value="VIRTUAL_DEVICE_PATH" /> | |||
<value value="C:\Users\admin\.android\avd\bpa_API_30.avd" /> | |||
</Key> | |||
</deviceKey> | |||
</Target> | |||
</targetSelectedWithDropDown> | |||
<timeTargetWasSelectedWithDropDown value="2024-06-26T02:47:16.567878600Z" /> | |||
</State> | |||
</entry> | |||
</value> | |||
<runningDeviceTargetSelectedWithDropDown> | |||
<Target> | |||
<type value="RUNNING_DEVICE_TARGET" /> | |||
<deviceKey> | |||
<Key> | |||
<type value="SERIAL_NUMBER" /> | |||
<value value="127.0.0.1:7555" /> | |||
</Key> | |||
</deviceKey> | |||
</Target> | |||
</runningDeviceTargetSelectedWithDropDown> | |||
<timeTargetWasSelectedWithDropDown value="2024-07-19T02:34:44.522758700Z" /> | |||
</component> | |||
</project> |
@@ -1,10 +1,15 @@ | |||
package com.bonait.bnframework.HBL; | |||
import android.app.Notification; | |||
import com.bonait.bnframework.common.helper.I.IRunT; | |||
import com.bumptech.glide.disklrucache.DiskLruCache; | |||
import java.io.Serializable; | |||
import java.util.LinkedHashMap; | |||
import butterknife.Action; | |||
public class NotifyPropVar<T extends Serializable> { | |||
public NotifyPropVar(T defaultValue){ | |||
@@ -403,11 +403,11 @@ public abstract class ControlBase { | |||
if (completeNotify!=null) | |||
completeNotify.onComplete(key); | |||
MessageLog.ShowUserMessage( UserLogEnum.订单处理日志 ,"删除"+key+"号炒锅任务"); | |||
} | |||
} | |||
RemoveId.clear(); | |||
} | |||
/** | |||
* 机器人出餐控制 | |||
* @param FryingPanNum 炒锅位置 | |||
@@ -444,7 +444,9 @@ public abstract class ControlBase { | |||
//等待机器人出餐完成 | |||
while(!RobotData.FryingStatus.get((int)FryingPanNum).DiningOutComplete&&!ForceEnd[FryingPanNum-1]){Thread.sleep(100);} | |||
if(EndProcess(FryingPanNum)) return; | |||
if(PeripheralData.ConveyorLineInputBowl)YJDeviceHelper.getInstance().ConveyorLineControl(true);//启动输送线 | |||
if(PeripheralData.ConveyorLineInputBowl){ | |||
YJDeviceHelper.getInstance().ConveyorLineControl(true);//启动输送线 | |||
} | |||
PeripheralData.PutBlowComplete=true; | |||
MessageLog.ShowUserMessage( UserLogEnum.订单处理日志 ,"机器人出餐完成"); | |||
MbSlave.WriteBoolean(GetAddress(FryingPanNum,AddressData.RequestingMeaDelivery),false);; //复位炒菜完成,出餐请求 | |||
@@ -39,7 +39,7 @@ public class FryingPanPar { | |||
/** | |||
* 主料位置 | |||
*/ | |||
public int[] IngredientsLocs=new int[2]; | |||
public int[] IngredientsLocs=new int[3]; | |||
/** | |||
* 辅料位置 | |||
@@ -8,6 +8,7 @@ import androidx.viewpager.widget.ViewPager; | |||
import com.bonait.bnframework.HBL.Dialog.AlertDialogButton; | |||
import com.bonait.bnframework.HBL.Dialog.DialogHelper; | |||
import com.bonait.bnframework.HBL.Task; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.DoubleFryingpanControl; | |||
@@ -245,7 +246,6 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
//ConfigData.getInstance().GetOrganize(this); | |||
//判断连接环境 | |||
ConfigData.getInstance().ToggleEnvironment(); | |||
if(ConfigName.getInstance().versionSelectionEnum.equals("一拖四")){ | |||
RobotControl.getInstance().Init(); | |||
} | |||
@@ -253,12 +253,18 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
DoubleFryingpanControl.getInstance().Init(); | |||
PeripheralData.ConveyorLineOutputBowl.ChangeNotify=(s)->{ | |||
if( PeripheralData.PutBlowComplete){ | |||
DialogHelper.showError(this,"餐盆到位,请出餐!", AlertDialogButton.OK,null); | |||
DialogHelper.showInfo(this,"餐盆到位,请出餐!", AlertDialogButton.OK,null); | |||
PeripheralData.PutBlowComplete=false; | |||
YJDeviceHelper.getInstance().ConveyorLineControl(false);//停止输送线 | |||
} | |||
}; | |||
Task.Delay(3000); | |||
YJDeviceHelper.getInstance().ConveyorLineControl(false); | |||
}}; | |||
} | |||
// PeripheralData.OutPen.ChangeNotify = (s)->{ | |||
// if(s){ | |||
// | |||
// }; | |||
RobotData.EStop.ChangeNotify=(s)->{ | |||
if(s) DialogHelper.showError(this,"机器人急停中!", AlertDialogButton.OK,null); | |||
}; | |||
@@ -272,7 +278,6 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
// ReconnectModbus(); | |||
//MQTT数据监听 | |||
// OrderServer.Get().MqttInit(); | |||
} | |||
@@ -291,6 +291,13 @@ public class DoubleFryingpanFragment extends BaseFragment { | |||
} | |||
} | |||
if(fry.IngredientsLocs[2]>0){ | |||
if( !YJDeviceHelper.getInstance().MainMaterialLocVerify(fry.IngredientsLocs[2])){ | |||
DialogHelper.showError(getActivity(),"主料位置 "+fry.IngredientsLocs[2] +"未检测到有物料!",AlertDialogButton.OK,null); | |||
return; | |||
} | |||
} | |||
//辅料验证 | |||
if(fry.AccessoriesLocs[0]>0){ | |||
if( !YJDeviceHelper.getInstance().AccessoriesLocVerify(fry.AccessoriesLocs[0])){ | |||
@@ -359,6 +366,7 @@ public class DoubleFryingpanFragment extends BaseFragment { | |||
ParSetInit(R.id.location_selection_1,new String[] {"0", "1", "2", "3", "4","5","6"}); | |||
ParSetInit(R.id.location_selection_2,new String[] {"0", "1", "2", "3", "4","5","6"}); | |||
ParSetInit(R.id.location_selection_3,new String[] {"0", "1", "2", "3", "4","5","6"}); | |||
ParSetInit(R.id.accessories_selection_1,new String[] {"0", "1", "2", "3", "4","5","6"}); | |||
ParSetInit(R.id.accessories_selection_2,new String[] {"0", "1", "2", "3", "4","5","6"}); | |||
} | |||
@@ -502,7 +510,8 @@ public class DoubleFryingpanFragment extends BaseFragment { | |||
DialogHelper.showWarn(getActivity(),"机器人忙碌中,请稍后",AlertDialogButton.OK,null); | |||
} | |||
} | |||
else{ | |||
else | |||
{ | |||
RobotModbus.getInstance().WriteBool(DoubleFryingpanControl.getInstance().RobotAddress("M520"), true,1,null);//写入机器人主任务,指定入库位置 | |||
btn_maintenance.setText("维护"); | |||
} | |||
@@ -564,6 +573,9 @@ public class DoubleFryingpanFragment extends BaseFragment { | |||
else if (R.id.location_selection_2==id) { | |||
fry.IngredientsLocs[1]=Integer.parseInt(adapterView.getItemAtPosition(i).toString());; | |||
} | |||
else if (R.id.location_selection_3==id) { | |||
fry.IngredientsLocs[2]=Integer.parseInt(adapterView.getItemAtPosition(i).toString());; | |||
} | |||
else if (R.id.accessories_selection_1==id) { | |||
fry.AccessoriesLocs[0]=Integer.parseInt(adapterView.getItemAtPosition(i).toString());; | |||
} | |||
@@ -439,19 +439,31 @@ public class DiyUpdateActivity extends BaseActivity { | |||
{ | |||
if(goodsrecipe.processname.equals("加热")) | |||
{ | |||
boolean isfa=false; | |||
int isfa=0; | |||
for (BPA_GOODSRECIPE item:bpa_goodsrecipes) | |||
{ | |||
if(item.processname.equals("搅拌")) | |||
{ | |||
isfa=true; | |||
if (item.processname!=null){ | |||
if(item.processname.equals("搅拌")) | |||
{ | |||
isfa=1; | |||
} | |||
} | |||
else{ | |||
isfa =2; | |||
} | |||
} | |||
if(isfa==false) | |||
if(isfa==1) | |||
{ | |||
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!"); | |||
return; | |||
} | |||
else if (isfa == 2) | |||
{ | |||
ToastUtils.warning("工序名称不能为空,请检查后重新保存!"); | |||
return; | |||
} | |||
} | |||
bpa_goodsrecipes.add(GetSelectItemFromValue()); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
@@ -546,12 +558,17 @@ public class DiyUpdateActivity extends BaseActivity { | |||
ToastUtils.info("菜谱名称已存在!"); | |||
return; | |||
} | |||
if(!IsHotJ()) | |||
int isHotJ = IsHotJ(); | |||
if(isHotJ==0) | |||
{ | |||
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!"); | |||
return; | |||
} | |||
else if (isHotJ == 2) | |||
{ | |||
ToastUtils.warning("工序名称不能为空,请检查后重新保存!"); | |||
return; | |||
} | |||
//按钮点击 | |||
String title = "生成菜谱操作提示!"; | |||
@@ -607,11 +624,17 @@ public class DiyUpdateActivity extends BaseActivity { | |||
return; | |||
} | |||
if(!IsHotJ()) | |||
int isHotJ = IsHotJ(); | |||
if(isHotJ==0) | |||
{ | |||
ToastUtils.warning("加热工序之前,必须先添加搅拌工序!"); | |||
return; | |||
} | |||
else if (isHotJ == 2) | |||
{ | |||
ToastUtils.warning("工序名称不能为空,请检查后重新保存!"); | |||
return; | |||
} | |||
//按钮点击 | |||
String title = "保存菜谱操作提示!"; | |||
String message = "请问客官确定要保存["+name+"]菜谱吗?"; | |||
@@ -655,30 +678,34 @@ public class DiyUpdateActivity extends BaseActivity { | |||
/** | |||
* 判断数据是否合法 | |||
*/ | |||
public boolean IsHotJ() | |||
public int IsHotJ() | |||
{ | |||
int index=1; | |||
int k=0;int j=0; | |||
for(BPA_GOODSRECIPE item:bpa_goodsrecipes) | |||
{ | |||
if(item.processname.contains("搅拌") && k==0) | |||
{ | |||
k=index; | |||
} | |||
if(item.processname!=null){ | |||
if(item.processname.contains("搅拌") && k==0) | |||
{ | |||
k=index; | |||
} | |||
if(item.processname.contains("加热") && j==0) | |||
{ | |||
j=index; | |||
if(item.processname.contains("加热") && j==0) | |||
{ | |||
j=index; | |||
} | |||
index++; | |||
} | |||
index++; | |||
else | |||
return 2; | |||
} | |||
if(j<k) | |||
{ | |||
return false; | |||
return 0; | |||
}else | |||
{ | |||
return true; | |||
return 1; | |||
} | |||
} | |||
@@ -125,7 +125,7 @@ | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="150dp" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp"> | |||
<LinearLayout | |||
@@ -198,7 +198,8 @@ | |||
<!-- 数据 --> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
android:layout_height="match_parent" | |||
android:layout_marginBottom="30dp"> | |||
<ListView | |||
android:id="@+id/datatab_wl" | |||
android:layout_width="match_parent" | |||
@@ -96,7 +96,38 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="#000000" | |||
android:text="选择辅料1:"/> | |||
android:text=" 选择主料3:"/> | |||
<Spinner | |||
android:id="@+id/location_selection_3" | |||
android:layout_width="match_parent" | |||
android:spinnerMode="dropdown" | |||
android:layout_marginLeft="10dp" | |||
android:paddingLeft="0dp" | |||
android:paddingRight="0dp" | |||
android:dropDownWidth="match_parent" | |||
android:background="@drawable/spinner_br" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:dropDownVerticalOffset="0dp" | |||
android:dropDownSelector="@color/red_primary_dark" | |||
android:entries="@array/sp1" | |||
android:layout_height="wrap_content"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:orientation="horizontal" | |||
android:layout_marginLeft="20dp" | |||
android:layout_marginRight="20dp" | |||
android:layout_marginTop="10dp" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="#000000" | |||
android:text=" 选择辅料1:"/> | |||
<Spinner | |||
android:id="@+id/accessories_selection_1" | |||
@@ -126,7 +157,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="#000000" | |||
android:text="选择辅料2:"/> | |||
android:text=" 选择辅料2:"/> | |||
<Spinner | |||
android:id="@+id/accessories_selection_2" | |||