Browse Source

修改料仓设置界面

调味吧台
liup 6 months ago
parent
commit
6c2961ff2f
22 changed files with 88 additions and 53 deletions
  1. +2
    -2
      .idea/deploymentTargetSelector.xml
  2. +5
    -4
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  3. +3
    -0
      app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java
  4. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  5. +3
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/SilosSettingFragment.java
  6. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java
  7. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_silos_ck.java
  8. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/silos_jiaoyan.java
  9. BIN
     
  10. +23
    -8
      app/src/main/res/layout/activity_silos_new.xml
  11. +1
    -0
      app/src/main/res/layout/item/layout/layout_cookie.xml
  12. +19
    -8
      app/src/main/res/layout/item/layout/layout_device_back.xml
  13. +5
    -4
      app/src/main/res/layout/item/layout/layout_device_left.xml
  14. +2
    -2
      app/src/main/res/layout/item/layout/layout_device_right.xml
  15. +16
    -16
      app/src/main/res/layout/item/layout/layout_device_top.xml
  16. BIN
     
  17. BIN
     
  18. BIN
     
  19. BIN
     
  20. BIN
     
  21. BIN
     
  22. +2
    -1
      app/src/main/res/values/styles.xml

+ 2
- 2
.idea/deploymentTargetSelector.xml View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-06-08T07:52:37.356736400Z">
<DropdownSelection timestamp="2024-06-17T03:40:11.626864500Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=24123a83" />
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=36578987" />
</handle>
</Target>
</DropdownSelection>


+ 5
- 4
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -610,7 +610,7 @@ public class ExecuteTheRecipe {
try {
if (ConfigName.getInstance().PLC_Address.containsKey(name)) {
BPA_PLCADDRESS plcaddress = ConfigName.getInstance().PLC_Address.get(name);
MessageLog.ShowInfo("ReadPLC name=" +name +" plcaddress="+plcaddress.address.toString());
// MessageLog.ShowInfo("ReadPLC name=" +name +" plcaddress="+plcaddress.address.toString());
if (!plcaddress.address.isEmpty() && ConfigName.getInstance().PlcIsConnect) {
if (plcaddress.address.toUpperCase().startsWith("VD"))//int
{
@@ -646,16 +646,17 @@ public class ExecuteTheRecipe {
});
}
if ((plcaddress.address.toUpperCase().equals("VW82"))){
MessageLog.ShowInfo("ReadPLC 称当前重量 name=" +name+" ReturnsVariable[0]="+ReturnsVariable[0] );
// MessageLog.ShowInfo("ReadPLC 称当前重量 name=" +name+" ReturnsVariable[0]="+ReturnsVariable[0] );
OutletWeigh = (short)ReturnsVariable[0];

}
}
}
} catch (Exception ex) {
ToastUtils.error("异常信息:" + ex.getMessage());
// ToastUtils.error("异常信息:" + ex.getMessage());
LogUtils.d("异常信息:" + ex.getMessage());
} finally {
MessageLog.ShowInfo("ReadPLC name=" +name+" ReturnsVariable[0]="+ReturnsVariable[0] );
// MessageLog.ShowInfo("ReadPLC name=" +name+" ReturnsVariable[0]="+ReturnsVariable[0] );
return ReturnsVariable[0];
}
}


+ 3
- 0
app/src/main/java/com/bonait/bnframework/common/modbus/ModbusTcpServer.java View File

@@ -209,6 +209,9 @@ public class ModbusTcpServer {
.setRetries(0)
.setEncapsulated(false)
.setKeepAlive(true);
if(ConfigName.TEST2){
ConfigData.getInstance().PLC_Init();
}
ModbusTcpHelper.get().init(param, new ModbusCallback<ModbusMaster>() {
@Override
public void onSuccess(ModbusMaster modbusMaster) {


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

@@ -568,7 +568,7 @@ public class MakeGoodFragment extends BaseFragment {
plc_status.setText(ConfigName.getInstance().PlcIsConnect ? "正常" : "异常");
plc_status.setTextColor(ConfigName.getInstance().PlcIsConnect ? Color.parseColor("#4CAF50") : Color.parseColor("#D32F2F"));
// wendu1.setText(ExecuteTheRecipe.WaterTemp + "°C");
MessageLog.ShowInfo("重量 ExecuteTheRecipe.OutletWeigh="+ExecuteTheRecipe.OutletWeigh);
// MessageLog.ShowInfo("重量 ExecuteTheRecipe.OutletWeigh="+ExecuteTheRecipe.OutletWeigh);
dianzichen.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g");
break;
case 1:
@@ -720,7 +720,7 @@ public class MakeGoodFragment extends BaseFragment {
if(mHandler!=null){
try {
mHandler.sendEmptyMessage(0);
if(time>=60) //60秒执行一次
if(time>=5*300) //300秒执行一次
{
ArrayList<lcMode> lcModes = DataBus.getInstance().ResGetLc();
String title="";


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

@@ -35,7 +35,9 @@ public class SilosSettingFragment extends BaseFragment {
@Override
protected View onCreateView() {
viewBinding = FragmentSilosSettingBinding.inflate(getLayoutInflater());
DisplayManager.scaleViewGroup(viewBinding.getRoot());
// if(viewBinding.includeDeviceLeft.title1.getTextSize()>28||viewBinding.includeDeviceLeft.title1.getTextSize()<24){
DisplayManager.scaleViewGroup(viewBinding.getRoot());
// }
return viewBinding.getRoot();
}



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

@@ -104,7 +104,7 @@ public class SilosNewActivity extends BaseActivity {
}

private void initTopBar() {
mTopBar.setTitle("料仓管理");
// mTopBar.setTitle("料仓管理");
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -269,7 +269,7 @@ public class SilosNewActivity extends BaseActivity {
context = null;
}

//接收图片选择事件
//通道选择事件
@Subscribe(threadMode = ThreadMode.MAIN)
public void onChannelClickEvent(SilosClickEvent event){
try{


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

@@ -156,8 +156,8 @@ public class add_silos_ck extends LinearLayout {
}

public void SetAdapter(Spinner spinner, List<String> map) {
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, map);
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text32_item, map);
adapter.setDropDownViewResource(R.layout.spinner_dropdown32_item);
spinner.setAdapter(adapter);
}



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

@@ -330,7 +330,7 @@ public class silos_jiaoyan extends LinearLayout {
if(time<0) return;
DialogManager.showWarn(activity,"校准前请确认是否准备就绪?\r\n是否开始校准?", AlertDialogButton.YesNo,s->{
if(s){
WaitDialog.getInstance().Show(view.getId()==R.id.min_time?"最小校准":"最大校准","开始校准",getContext(),activity);
WaitDialog.getInstance().Show(view.getId()==R.id.btn_min_standard?"最小校准":"最大校准","开始校准",getContext(),activity);
Executor.get().runThread(()->{

WaitDialog.getInstance().AddText("电子秤清零");


BIN
View File


+ 23
- 8
app/src/main/res/layout/activity_silos_new.xml View File

@@ -30,26 +30,30 @@
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="70dp"
android:background="@drawable/qmui_list_item_bg_with_border_bottom"
android:textSize="32sp"
android:textSize="20sp"
app:qmui_tab_has_indicator="true"
app:qmui_tab_indicator_height="2dp"
app:qmui_tab_indicator_top="false"
app:qmui_tab_normal_text_size="24sp"
app:qmui_tab_selected_text_size="26sp" />
app:qmui_tab_normal_text_size="20sp"
app:qmui_tab_selected_text_size="22sp" />
<RelativeLayout
android:layout_marginTop="50dp"
android:layout_marginTop="70dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager_silos"
android:layout_width="1050dp"
android:layout_height="650dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="45dp"
android:background="@color/white"
/>
<RelativeLayout
android:id="@+id/rl1"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -92,6 +96,7 @@
</RelativeLayout>

<RelativeLayout
android:id="@+id/rl2"
android:layout_width="130dp"
android:layout_height="match_parent"
android:background="@color/white">
@@ -163,5 +168,15 @@
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/app_color_blue"/>
android:background="@color/app_color_blue">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="料仓管理"
android:textColor="@color/white"
android:textSize="26sp"
/>
</com.qmuiteam.qmui.widget.QMUITopBarLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 1
- 0
app/src/main/res/layout/item/layout/layout_cookie.xml View File

@@ -34,6 +34,7 @@
android:layout_height="wrap_content"
android:maxLines="1"
android:text="Title"
android:ellipsize="end"
android:textAlignment="viewStart"
android:textColor="@android:color/white"
android:textSize="25dp"


+ 19
- 8
app/src/main/res/layout/item/layout/layout_device_back.xml View File

@@ -18,10 +18,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:textSize="26sp"
android:gravity="center"
android:textColor="#7B7774"
android:text="左侧液体仓"
android:text="(背面左侧液体仓)"
android:layout_marginLeft="40dp"
android:layout_marginTop="20dp"
app:layout_constraintLeft_toLeftOf="parent"
@@ -38,7 +38,7 @@
android:text="通道12"
android:background="@drawable/bg_device_position_btn"
android:layout_marginLeft="40dp"
android:layout_marginTop="100dp"
android:layout_marginTop="80dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
@@ -102,7 +102,7 @@
android:text="通道16"
android:background="@drawable/bg_device_position_btn"
android:layout_marginLeft="300dp"
android:layout_marginTop="100dp"
android:layout_marginTop="80dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
@@ -195,10 +195,21 @@
android:text="(液体仓)"
android:textColor="@color/white"
android:textSize="36sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="230dp"
android:layout_marginStart="600dp"
android:layout_marginEnd="300dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(可按需增加)"
android:textColor="#aaffffff"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="200dp"
android:layout_marginEnd="300dp"
/>
<TextView
android:layout_width="wrap_content"
@@ -206,10 +217,10 @@
android:text="(蠕动泵)"
android:textColor="@color/white"
android:textSize="36sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="230dp"
android:layout_marginStart="830dp"
android:layout_marginEnd="80dp"
/>



+ 5
- 4
app/src/main/res/layout/item/layout/layout_device_left.xml View File

@@ -15,12 +15,13 @@
app:layout_constraintTop_toTopOf="parent"
/>
<TextView
android:id="@+id/z"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:textSize="26sp"
android:gravity="center"
android:textColor="#7B7774"
android:text="设备左视图"
android:text="(设备左视图)"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
app:layout_constraintLeft_toLeftOf="parent"
@@ -93,10 +94,10 @@
android:textColor="#FFEB3B"
android:text="通道2"
android:background="@drawable/bg_device_position_btn"
android:layout_marginEnd="145dp"
android:layout_marginStart="645dp"
android:layout_marginTop="400dp"
android:layout_gravity="end"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

+ 2
- 2
app/src/main/res/layout/item/layout/layout_device_right.xml View File

@@ -17,10 +17,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:textSize="26sp"
android:gravity="center"
android:textColor="#7B7774"
android:text="设备右视图"
android:text="(设备右视图)"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
app:layout_constraintLeft_toLeftOf="parent"


+ 16
- 16
app/src/main/res/layout/item/layout/layout_device_top.xml View File

@@ -20,8 +20,8 @@
android:textSize="32sp"
android:gravity="center"
android:textColor="@color/white"
android:text="设备俯视图\n可放置鸡精、味精、盐等粉料"
android:layout_marginTop="15dp"
android:text="(设备俯视图)\n可放置鸡精、味精、盐等粉料"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -29,14 +29,14 @@
<TextView
android:id="@+id/channel6"
android:layout_width="220dp"
android:layout_height="100dp"
android:layout_height="90dp"
android:textSize="46sp"
android:gravity="center"
android:textColor="#FFEB3B"
android:text="通道6"
android:background="@drawable/bg_device_position_btn"
android:layout_marginLeft="180dp"
android:layout_marginTop="130dp"
android:layout_marginTop="140dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
@@ -44,7 +44,7 @@
<TextView
android:id="@+id/channel7"
android:layout_width="220dp"
android:layout_height="100dp"
android:layout_height="90dp"
android:textSize="46sp"
android:gravity="center"
android:textColor="#FFEB3B"
@@ -59,7 +59,7 @@
<TextView
android:id="@+id/channel8"
android:layout_width="220dp"
android:layout_height="100dp"
android:layout_height="90dp"
android:textSize="46sp"
android:gravity="center"
android:textColor="#FFEB3B"
@@ -74,21 +74,21 @@
<TextView
android:id="@+id/channel9"
android:layout_width="220dp"
android:layout_height="100dp"
android:textSize="46sp"
android:layout_height="90dp"
android:layout_marginLeft="650dp"
android:layout_marginTop="140dp"
android:background="@drawable/bg_device_position_btn"
android:gravity="center"
android:textColor="#FFEB3B"
android:text="通道9"
android:background="@drawable/bg_device_position_btn"
android:layout_marginLeft="650dp"
android:layout_marginTop="130dp"
android:textColor="#FFEB3B"
android:textSize="46sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/channel10"
android:layout_width="220dp"
android:layout_height="100dp"
android:layout_height="90dp"
android:textSize="46sp"
android:gravity="center"
android:textColor="#FFEB3B"
@@ -102,7 +102,7 @@
<TextView
android:id="@+id/channel11"
android:layout_width="220dp"
android:layout_height="100dp"
android:layout_height="90dp"
android:textSize="46sp"
android:gravity="center"
android:textColor="#FFEB3B"


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


+ 2
- 1
app/src/main/res/values/styles.xml View File

@@ -46,6 +46,7 @@
<item name="qmui_dialog_max_width">700dp</item>
<item name="qmui_dialog_min_width">550dp</item>
<item name="qmui_dialog_edit_content_style">@style/DialogTheme2ContentStyle</item>
<item name="qmui_skin_support_icon_mark">@drawable/ic_check</item>
<!-- <item name="android:windowAnimationStyle">@style/activityanim</item>-->

</style>
@@ -70,7 +71,7 @@
<item name="android:paddingTop">0dp</item>
<item name="android:paddingBottom">0dp</item>
<item name="qmui_dialog_action_container_justify_content">stretch</item>
<item name="qmui_dialog_action_height">56dp</item>
<item name="qmui_dialog_action_height">50dp</item>
<item name="qmui_dialog_action_space">8dp</item>
<item name="qmui_topDividerColor">?attr/qmui_skin_support_color_separator</item>
<item name="qmui_topDividerHeight">1px</item>


Loading…
Cancel
Save