Browse Source

一拖二设备业务调整

master
pry 6 months ago
parent
commit
010a625723
6 changed files with 25 additions and 5 deletions
  1. +14
    -1
      .idea/deploymentTargetDropDown.xml
  2. +1
    -1
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  3. +4
    -0
      app/src/main/java/com/bonait/bnframework/common/helper/TcpClient.java
  4. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java
  5. +3
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationNewActivity.java
  6. +1
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java

+ 14
- 1
.idea/deploymentTargetDropDown.xml View File

@@ -3,7 +3,20 @@
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
<State>
<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-06-20T02:05:04.749775900Z" />
</State>
</entry>
</value>
</component>

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

@@ -1833,7 +1833,7 @@ public class ExecuteTheRecipe {
public static void WriteMainPLC(String name, String value) {
try {
if (ConfigName.getInstance().MainPlcAddress.containsKey(name)) {
Integer plcaddress = ConfigName.getInstance().MainPlcAddress.get(name) + (ConfigName.getInstance().DeviceHao - 1) * 20;
Integer plcaddress = ConfigName.getInstance().MainPlcAddress.get(name) + (ConfigName.getInstance().DeviceHao - 1) * 50;
if (ConfigName.getInstance().PlcMainIsConnect) {
ModbusTcpMainServer.get().WriteString(plcaddress, value, null);
}


+ 4
- 0
app/src/main/java/com/bonait/bnframework/common/helper/TcpClient.java View File

@@ -4,6 +4,7 @@ package com.bonait.bnframework.common.helper;
import android.util.Log;

import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_CRAFT;
@@ -11,6 +12,7 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
import com.bonait.bnframework.common.helper.I.IRunT;
import com.bonait.bnframework.common.helper.I.IThread;
import com.bonait.bnframework.common.message.MessageManager;
import com.google.gson.Gson;

import java.io.BufferedReader;
@@ -158,6 +160,8 @@ public class TcpClient {
else QueryDB.AddProcessModel(item);
});
}

// MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");
}
Thread.sleep(1000);
}


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

@@ -61,8 +61,8 @@ public class BottomNavigation2Activity extends BaseActivity {
viewPager.setOffscreenPageLimit(3);
bottomNavigationView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
Init();
TcpClient.getInstance().Connect(ConfigName.getInstance().MainAddress,40000);
if(ConfigName.getInstance().versionSelectionEnum.contains("一拖"))
TcpClient.getInstance().Connect(ConfigName.getInstance().MainAddress,40000);
}

@Override


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

@@ -101,7 +101,9 @@ public class BottomNavigationNewActivity extends BaseActivity {
}
};
viewPager.setCurrentItem(1);
TcpClient.getInstance().Connect(ConfigName.getInstance().MainAddress,40000);

if(ConfigName.getInstance().versionSelectionEnum.contains("一拖"))
TcpClient.getInstance().Connect(ConfigName.getInstance().MainAddress,40000);
}

@Override


+ 1
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java View File

@@ -144,6 +144,7 @@ public class CpActivity extends BaseActivity {
@Override
public void onMessage(Object msg) {
if (msg != null) {

mAdapter.setData(new ArrayList<QMUISection<SectionHeader, SectionItem>>());
mAdapter.setData(getList());
}


Loading…
Cancel
Save