Browse Source

调整蓝牙设备链接逻辑

master
白凤吉 4 months ago
parent
commit
45e0bb3990
  1. 4
      app/build.gradle
  2. 4
      app/src/main/assets/web/asset-manifest.json
  3. 2
      app/src/main/assets/web/index.html
  4. 4
      app/src/main/assets/web/static/js/main.6d38614b.js
  5. 0
      app/src/main/assets/web/static/js/main.6d38614b.js.LICENSE.txt
  6. 2
      app/src/main/java/com/iflytop/profilometer/ProfilometerApplication.java
  7. 6
      app/src/main/java/com/iflytop/profilometer/api/ble/BleApi.java
  8. 44
      app/src/main/java/com/iflytop/profilometer/api/system/SystemApi.java
  9. 3
      app/src/main/java/com/iflytop/profilometer/api/system/SystemRoutes.kt
  10. 1
      app/src/main/java/com/iflytop/profilometer/common/constant/SystemConfigType.java
  11. 23
      app/src/main/java/com/iflytop/profilometer/core/bluetooth/BleDeviceDriver.java
  12. 4
      app/src/main/java/com/iflytop/profilometer/core/bluetooth/BleManager.java
  13. 5
      app/src/main/java/com/iflytop/profilometer/core/migration/channel/BleDeviceUartChannel.java
  14. 90
      app/src/main/java/com/iflytop/profilometer/core/migration/factory/TPMIPacketFactory.java
  15. 57
      app/src/main/java/com/iflytop/profilometer/core/migration/type/protocol/TPMIPacket.java
  16. 1
      app/src/main/java/com/iflytop/profilometer/model/bo/RailProfileMeasureTaskState.java
  17. 9
      app/src/main/java/com/iflytop/profilometer/model/vo/SystemConfigVO.java
  18. 3
      app/src/main/java/com/iflytop/profilometer/service/RailProfileDrawerService.java

4
app/build.gradle

@ -17,9 +17,9 @@ android {
versionName "1.0"
//
versionCode 2
versionCode 5
//
versionName "1.1.2"
versionName "1.1.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

4
app/src/main/assets/web/asset-manifest.json

@ -1,7 +1,7 @@
{
"files": {
"main.css": "./static/css/main.3543332f.css",
"main.js": "./static/js/main.7ec89011.js",
"main.js": "./static/js/main.6d38614b.js",
"static/js/206.d71bd05f.chunk.js": "./static/js/206.d71bd05f.chunk.js",
"static/media/icon_tab3_u.svg": "./static/media/icon_tab3_u.6d18cbd7c4dc6a54f745fdfcc7716050.svg",
"static/media/icon_tab3_s.svg": "./static/media/icon_tab3_s.b0a9cbf5ecee59829c9de63a2e9de169.svg",
@ -22,6 +22,6 @@
},
"entrypoints": [
"static/css/main.3543332f.css",
"static/js/main.7ec89011.js"
"static/js/main.6d38614b.js"
]
}

2
app/src/main/assets/web/index.html

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><title>廓形仪</title><script defer="defer" src="./static/js/main.7ec89011.js"></script><link href="./static/css/main.3543332f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>function setupWebViewJavascriptBridge(e){if(window.WebViewJavascriptBridge)return e(WebViewJavascriptBridge);if(/android/i.test(navigator.userAgent))document.addEventListener("WebViewJavascriptBridgeReady",(function(){e(WebViewJavascriptBridge)}),!1);else{if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var i=document.createElement("iframe");i.style.display="none",i.src="https://__bridge_loaded__",document.documentElement.appendChild(i),setTimeout((function(){document.documentElement.removeChild(i)}),0)}}setupWebViewJavascriptBridge((function(e){window.bridge=e}));var SyncBridgeJS={call:function(e,i){return prompt("sync/syncBridge/"+e,i)}}</script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><title>廓形仪</title><script defer="defer" src="./static/js/main.6d38614b.js"></script><link href="./static/css/main.3543332f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>function setupWebViewJavascriptBridge(e){if(window.WebViewJavascriptBridge)return e(WebViewJavascriptBridge);if(/android/i.test(navigator.userAgent))document.addEventListener("WebViewJavascriptBridgeReady",(function(){e(WebViewJavascriptBridge)}),!1);else{if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var i=document.createElement("iframe");i.style.display="none",i.src="https://__bridge_loaded__",document.documentElement.appendChild(i),setTimeout((function(){document.documentElement.removeChild(i)}),0)}}setupWebViewJavascriptBridge((function(e){window.bridge=e}));var SyncBridgeJS={call:function(e,i){return prompt("sync/syncBridge/"+e,i)}}</script></body></html>

4
app/src/main/assets/web/static/js/main.6d38614b.js
File diff suppressed because it is too large
View File

0
app/src/main/assets/web/static/js/main.7ec89011.js.LICENSE.txt → app/src/main/assets/web/static/js/main.6d38614b.js.LICENSE.txt

2
app/src/main/java/com/iflytop/profilometer/ProfilometerApplication.java

@ -119,7 +119,7 @@ public class ProfilometerApplication extends Application {
"\t\t},\n" +
"\t\t\"radius\": 300,\n" +
"\t\t\"color\": \"#000000\",\n" +
"\t\t\"side\": \"right\"\n" +
"\t\t\"side\": \"left\"\n" +
"\t},\n" +
"\t{\n" +
"\t\t\"type\": \"arc\",\n" +

6
app/src/main/java/com/iflytop/profilometer/api/ble/BleApi.java

@ -59,12 +59,12 @@ public class BleApi {
BleWebsocketManager.getInstance().stopWsPush();
BleManager.getInstance().stopScan();//连接后停止扫描
BleManager.getInstance().connectToDevice(mac);
BlePingManager.getInstance().startPing();
// BlePingManager.getInstance().startPing();
return Result.success();
} catch (Exception e) {
BleWebsocketManager.getInstance().startWsPush();//链接失败后继续扫描并推送
BleManager.getInstance().startScan();
BlePingManager.getInstance().stopPing();
// BlePingManager.getInstance().stopPing();
Log.e(TAG, "链接蓝牙设备失败", e);
return Result.failed("链接蓝牙设备失败");
}
@ -76,7 +76,7 @@ public class BleApi {
public String disconnect() {
try {
BleManager.getInstance().disconnect();
BlePingManager.getInstance().stopPing();
// BlePingManager.getInstance().stopPing();
BleManager.getInstance().startScan();//断开连接后开始扫描
return Result.success();
} catch (Exception e) {

44
app/src/main/java/com/iflytop/profilometer/api/system/SystemApi.java

@ -1,9 +1,13 @@
package com.iflytop.profilometer.api.system;
import android.content.Context;
import android.util.Log;
import com.iflytop.profilometer.common.constant.SystemConfigType;
import com.iflytop.profilometer.common.result.Result;
import com.iflytop.profilometer.core.bluetooth.BleDeviceDriver;
import com.iflytop.profilometer.core.bluetooth.BleManager;
import com.iflytop.profilometer.core.system.SystemService;
import com.iflytop.profilometer.dao.SystemConfigDao;
import com.iflytop.profilometer.model.entity.SystemConfig;
import com.iflytop.profilometer.model.vo.SystemConfigVO;
@ -24,18 +28,46 @@ public class SystemApi {
SystemConfigVO systemConfigVO = new SystemConfigVO();
if (serverConfig != null) {
systemConfigVO.setServer(serverConfig.getConfigValue());
try {
if (BleManager.getInstance().isConnected()) {
BleDeviceDriver bleDeviceDriver = SystemService.getInstance().getBleDeviceDriver();
Integer standbyMinutesByDevice = bleDeviceDriver.getStandbyInactiveTime();
systemConfigVO.setStandbyMinutes(standbyMinutesByDevice / 60 / 1000);
}
} catch (Exception e) {
e.printStackTrace();
Log.e("SYSTEM API", "获取设备自动待机时间出错");
if (BleManager.getInstance().isConnected()) {
BleDeviceDriver bleDeviceDriver = SystemService.getInstance().getBleDeviceDriver();
Integer standbyMinutesByDevice = bleDeviceDriver.getStandbyInactiveTime();
systemConfigVO.setStandbyMinutes(standbyMinutesByDevice / 60 / 1000);
}
}
}
return Result.success(systemConfigVO);
}
public String save(String server) {
public String save(String server, Integer standbyMinutes) {
SystemConfigDao systemConfigDao = new SystemConfigDao(context);
SystemConfig systemConfig = new SystemConfig();
systemConfig.setConfigKey(SystemConfigType.SERVER);
systemConfig.setConfigValue(server);
int rows = systemConfigDao.updateSystemConfig(systemConfig);
SystemConfig serverConfig = new SystemConfig();
serverConfig.setConfigKey(SystemConfigType.SERVER);
serverConfig.setConfigValue(server);
int rows = systemConfigDao.updateSystemConfig(serverConfig);
if (rows < 1) {
systemConfigDao.insertSystemConfig(systemConfig);
systemConfigDao.insertSystemConfig(serverConfig);
}
try {
if (BleManager.getInstance().isConnected()) {
BleDeviceDriver bleDeviceDriver = SystemService.getInstance().getBleDeviceDriver();
bleDeviceDriver.setStandbyInactiveTime(standbyMinutes * 60 * 1000);
}
} catch (Exception e) {
e.printStackTrace();
Log.e("SYSTEM API", "保存设备自动待机时间出错");
if (BleManager.getInstance().isConnected()) {
BleDeviceDriver bleDeviceDriver = SystemService.getInstance().getBleDeviceDriver();
bleDeviceDriver.setStandbyInactiveTime(standbyMinutes * 60 * 1000);
}
}
return Result.success();
}

3
app/src/main/java/com/iflytop/profilometer/api/system/SystemRoutes.kt

@ -27,7 +27,8 @@ fun Routing.systemRoutes(context: Context) {
val requestBody = call.receiveText()
val jsonObj = JSONUtil.parseObj(requestBody)
val server = jsonObj.getStr("server")
val jsonResponse = api.save(server)
val standbyMinutes = jsonObj.getInt("standbyMinutes")
val jsonResponse = api.save(server, standbyMinutes)
call.respondText(jsonResponse, ContentType.Application.Json)
}
}

1
app/src/main/java/com/iflytop/profilometer/common/constant/SystemConfigType.java

@ -2,4 +2,5 @@ package com.iflytop.profilometer.common.constant;
public class SystemConfigType {
public static final String SERVER = "sync_server";
public static final String STANDBY_MINUTES = "standby_minutes";
}

23
app/src/main/java/com/iflytop/profilometer/core/bluetooth/BleDeviceDriver.java

@ -53,4 +53,27 @@ public class BleDeviceDriver {
return appearance;
}
public void unlockEEPROM() {
var packet = TPMIPacketFactory.buildUnlockEEPROMCmd();
uartChannel.sendCommand(packet);
}
public void lockEEPROM() {
var packet = TPMIPacketFactory.buildLockEEPROMCmd();
uartChannel.sendCommand(packet);
}
public synchronized void setStandbyInactiveTime(Integer time) {
unlockEEPROM();
var packet = TPMIPacketFactory.buildSetStandbyInactiveCmd(time);
uartChannel.sendCommand(packet);
lockEEPROM();
}
public Integer getStandbyInactiveTime() {
var packet = TPMIPacketFactory.buildGetStandbyInactiveTime();
var rx = uartChannel.sendCommand(packet);
return rx.getDataAsInt(0);
}
}

4
app/src/main/java/com/iflytop/profilometer/core/bluetooth/BleManager.java

@ -509,6 +509,7 @@ public class BleManager {
@SuppressLint("MissingPermission")
public void disconnect() {
if (bluetoothGatt != null) {
try{
bluetoothGatt.disconnect();
bluetoothGatt.close();
bluetoothGatt = null;
@ -521,6 +522,9 @@ public class BleManager {
editor.apply();
Log.d(TAG, "当前蓝牙设备已断开连接");
}catch (Exception e){
e.printStackTrace();
}
}
}

5
app/src/main/java/com/iflytop/profilometer/core/migration/channel/BleDeviceUartChannel.java

@ -87,11 +87,10 @@ public class BleDeviceUartChannel {
BleManager.getInstance().sendMessage(tx.rawpacket);
try {
ctCxt.waitCxt(10000);
ctCxt.waitCxt(5000);
} catch (InterruptedException ignored) {
}
var rxPacket = ctCxt.clearCtCxt();
return rxPacket;
return ctCxt.clearCtCxt();
}
private void handleReceivedData(byte[] data) {

90
app/src/main/java/com/iflytop/profilometer/core/migration/factory/TPMIPacketFactory.java

@ -8,25 +8,53 @@ import com.iflytop.profilometer.core.migration.utils.ZByteUtils;
public class TPMIPacketFactory {
static public TPMIPacket buildDeviceDetectCmd() {return buildCommand(TPMIPacket.Command.DEVICE_DETECT);}
static final public Integer CMD_OVERTIME = 50;
static public TPMIPacket buildPingCmd() {return buildCommand(TPMIPacket.Command.PING);}
static public TPMIPacket buildDeviceDetectCmd() {
return buildCommand(TPMIPacket.Command.DEVICE_DETECT);
}
static public TPMIPacket buildGetDeviceInfoCmd() {return buildCommand(TPMIPacket.Command.GET_DEVICE_INFO);}
static public TPMIPacket buildPingCmd() {
return buildCommand(TPMIPacket.Command.PING);
}
static public TPMIPacket buildGetDeviceAppearanceCmd() {return buildCommand(TPMIPacket.Command.GET_DEVICE_APPEARANCE);}
static public TPMIPacket buildGetDeviceInfoCmd() {
return buildCommand(TPMIPacket.Command.GET_DEVICE_INFO);
}
static public TPMIPacket buildGetDeviceCalibrationInfoCmd() {return buildCommand(TPMIPacket.Command.GET_DEVICE_CALIBRATION_INFO);}
static public TPMIPacket buildGetDeviceAppearanceCmd() {
return buildCommand(TPMIPacket.Command.GET_DEVICE_APPEARANCE);
}
static public TPMIPacket buildUnlockEEPROMCmd() {return buildCommand(TPMIPacket.Command.UNLOCK_EERPOM);}
static public TPMIPacket buildGetStandbyInactiveTime() {
return buildCommand(TPMIPacket.Command.GET_STANDBY_INACTIVE_TIME);
}
static public TPMIPacket buildLockEEPROMCmd() {return buildCommand(TPMIPacket.Command.LOCK_EERPOM);}
;
static public TPMIPacket buildResetMCUCmd() {return buildCommand(TPMIPacket.Command.RESET_MCU);}
static public TPMIPacket buildGetDeviceCalibrationInfoCmd() {
return buildCommand(TPMIPacket.Command.GET_DEVICE_CALIBRATION_INFO);
}
static public TPMIPacket buildStartPosSampleCmd(Integer period) {return buildCommand(TPMIPacket.Command.START_POS_SAMPLE, period);}
static public TPMIPacket buildUnlockEEPROMCmd() {
return buildCommand(TPMIPacket.Command.UNLOCK_EERPOM);
}
static public TPMIPacket buildLockEEPROMCmd() {
return buildCommand(TPMIPacket.Command.LOCK_EERPOM);
}
static public TPMIPacket buildResetMCUCmd() {
return buildCommand(TPMIPacket.Command.RESET_MCU);
}
static public TPMIPacket buildStartPosSampleCmd(Integer period) {
return buildCommand(TPMIPacket.Command.START_POS_SAMPLE, period);
}
static public TPMIPacket buildStopPosSampleCmd() {return buildCommand(TPMIPacket.Command.STOP_POS_SAMPLE);}
static public TPMIPacket buildStopPosSampleCmd() {
return buildCommand(TPMIPacket.Command.STOP_POS_SAMPLE);
}
// CALIBRATE_ENCODER1(18), // 校准编码器0位置
@ -38,15 +66,29 @@ public class TPMIPacketFactory {
// static public TPMIPacket buildCalibrateEncoderZeroPos() {return buildCommand(TPMIPacket.Command.CALIBRATE_ENCODER_ZERO_POS);}
// static public TPMIPacket buildCalibrateInclinatorZeroPos() {return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_ZERO_POS);}
static public TPMIPacket buildCalibrateEncoder1() {return buildCommand(TPMIPacket.Command.CALIBRATE_ENCODER1);}
static public TPMIPacket buildCalibrateEncoder1() {
return buildCommand(TPMIPacket.Command.CALIBRATE_ENCODER1);
}
static public TPMIPacket buildCalibrateEncoder2() {return buildCommand(TPMIPacket.Command.CALIBRATE_ENCODER2);}
static public TPMIPacket buildCalibrateEncoder2() {
return buildCommand(TPMIPacket.Command.CALIBRATE_ENCODER2);
}
static public TPMIPacket buildCalibrateInclinatorZeroPosX() {return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_X);}
static public TPMIPacket buildCalibrateInclinatorZeroPosX() {
return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_X);
}
static public TPMIPacket buildCalibrateInclinatorZeroPosY() {return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_Y);}
static public TPMIPacket buildCalibrateInclinatorZeroPosY() {
return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_Y);
}
static public TPMIPacket buildCalibrateInclinatorTemperature(Integer nowval) {return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_TEMPERATURE, nowval);}
static public TPMIPacket buildCalibrateInclinatorTemperature(Integer nowval) {
return buildCommand(TPMIPacket.Command.CALIBRATE_INCLINATOR_TEMPERATURE, nowval);
}
static public TPMIPacket buildSetStandbyInactiveCmd(int standbyInactiveTime) {
return buildCommand(TPMIPacket.Command.SET_STANDBY_INACTIVE_TIME, standbyInactiveTime);
}
static public TPMIPacket buildSetDeviceAppearanceCmd(Double pulleyRadius, Double profilometerHight, Double arm1Length, Double arm2Length) {
@ -61,13 +103,21 @@ public class TPMIPacketFactory {
// SET_ENCODER2_OFFSET(25), // 设置编码器2-零偏
// RESET_ENCODER2_OFFSET(26), // 重置编码器2-零偏
static public TPMIPacket buildSetEncoder1ffsetCmd(Integer offset) {return buildCommand(TPMIPacket.Command.SET_ENCODER1_OFFSET, offset);}
static public TPMIPacket buildSetEncoder1ffsetCmd(Integer offset) {
return buildCommand(TPMIPacket.Command.SET_ENCODER1_OFFSET, offset);
}
static public TPMIPacket buildGetEncoder1ffsetCmd() {return buildCommand(TPMIPacket.Command.GET_ENCODER1_OFFSET);}
static public TPMIPacket buildGetEncoder1ffsetCmd() {
return buildCommand(TPMIPacket.Command.GET_ENCODER1_OFFSET);
}
static public TPMIPacket buildSetEncoder2ffsetCmd(Integer offset) {return buildCommand(TPMIPacket.Command.SET_ENCODER2_OFFSET, offset);}
static public TPMIPacket buildSetEncoder2ffsetCmd(Integer offset) {
return buildCommand(TPMIPacket.Command.SET_ENCODER2_OFFSET, offset);
}
static public TPMIPacket buildGetEncoder2ffsetCmd() {return buildCommand(TPMIPacket.Command.GET_ENCODER2_OFFSET);}
static public TPMIPacket buildGetEncoder2ffsetCmd() {
return buildCommand(TPMIPacket.Command.GET_ENCODER2_OFFSET);
}
//
@ -243,7 +293,6 @@ public class TPMIPacketFactory {
return buildReceipt(rx, TPMIPacket.DataType.NONE, new byte[0]);
}
synchronized static public TPMIPacket parseRawRxPacketToResponse(byte[] rawpacket, int length) {
// SubDevicePacketUtils
if (isValidatePacket(rawpacket, length, 0).equals(PacketAnalysisResult.SUC)) {
@ -263,6 +312,7 @@ public class TPMIPacketFactory {
/**
* 解析接收到的数据包
*
* @param indata 接收到的数据包
* @param indatalen 接收到数据总长
* @param startoff 分析的起始位置

57
app/src/main/java/com/iflytop/profilometer/core/migration/type/protocol/TPMIPacket.java

@ -12,80 +12,83 @@ public class TPMIPacket {
public enum Command {
/**
* @brief
*
*
* DEVICE_DETECT, 设备探测
* @brief DEVICE_DETECT, 设备探测
* Parameters : void
* Receipt(int32_t) : sn
*
* <p>
* PING,PING
* Parameters : void
* Receipt(void) : void
*
* <p>
* GET_DEVICE_INFO,获取设备信息
* Parameters : void
* Receipt(int32_t) : sn, sfw_version, hfw_version
*
* <p>
* GET_DEVICE_APPEARANCE,获取设备信息
* Parameters : void
* Receipt(int32_t) : pulleyRadius, profilometerHight, arm0Length, arm1Length
*
* <p>
* GET_STANDBY_INACTIVE_TIME,获取无操作进入待机时间
* Parameters : void
* Receipt(int32_t) : standbyInactiveTime
* <p>
* GET_DEVICE_CALIBRATION_INFO,获取设备信息
* Parameters : void
* Receipt(int32_t) : calibration_year, calibration_mouth, calibration_day
*
* <p>
* UNLOCK_EERPOM,解锁EEPROM
* Parameters : void
* Receipt(void) : void
*
* <p>
* LOCK_EERPOM,锁定EEPROM
* Parameters : void
* Receipt(void) : void
*
* <p>
* RESET_MCU,复位MCU
* Parameters : void
* Receipt(void) : void
*
* <p>
* START_POS_SAMPLE,开始采样
* Parameters : int32_t report_period
* Receipt(void) : void
*
* <p>
* STOP_POS_SAMPLE,停止采样
* Parameters : void
* Receipt(void) : void
*
* <p>
* SAMPLE_VAL_REPORT,采样上报
* Report(int32_t) : armEcoder0, armEcoder1
*
* <p>
* BASIC_REPORT,基础状态上报
* Report(int32_t) : power, state, flag, inclinatorX, inclinatorY, temperature
*
* <p>
* CALIBRATE_ENCODER1,校准编码器0位置
* (void)->(void)
*
* <p>
* CALIBRATE_ENCODER2,校准编码器1位置
* (void)->(void)
*
* <p>
* CALIBRATE_INCLINATOR_X,校准水平仪_X
* (void)->(void)
*
* <p>
* CALIBRATE_INCLINATOR_Y,校准水平仪_Y
* (void)->(void)
*
* <p>
* CALIBRATE_INCLINATOR_TEMPERATURE,校准水平仪温度传感器
* Parameters : int32_t realTemperature
*
*
* <p>
* <p>
* SET_DEVICE_APPEARANCE,设置设备信息
* Parameters : pulley_radius, profilometer_hight, arm0Length, arm1Length
*
* <p>
* SET_CALIBRATION_TIME,设置设备信息
* Parameters : calibrate_year, calibrate_mouth, calibrate_day
*
* <p>
* SET_SN,设置SN
* Parameters : SN
*
* <p>
* SET_STANDBY_INACTIVE_TIME,设置无操作进入待机时间
* Parameters : standbyInactiveTime
*/
@ -93,6 +96,7 @@ public class TPMIPacket {
PING(1), // PING
GET_DEVICE_INFO(2), // 获取设备信息
GET_DEVICE_APPEARANCE(3), // 获取设备外形信息
GET_STANDBY_INACTIVE_TIME(5),
GET_DEVICE_CALIBRATION_INFO(4), // 获取设备校验时间
UNLOCK_EERPOM(7), // 解锁EEPROM
LOCK_EERPOM(8), // 锁定EEPROM
@ -116,7 +120,8 @@ public class TPMIPacket {
SET_DEVICE_APPEARANCE(50), // 设置设备外形信息
SET_CALIBRATION_TIME(51), // 设置校验时间
SET_SN(52); // 设置SN
SET_SN(52),// 设置SN
SET_STANDBY_INACTIVE_TIME(53); // 设置无操作进入待机时间
byte index = 0;

1
app/src/main/java/com/iflytop/profilometer/model/bo/RailProfileMeasureTaskState.java

@ -54,6 +54,7 @@ public class RailProfileMeasureTaskState {
*/
public void reset() {
this.leftPointSetList.clear();
this.rightPointSetList.clear();
this.taskStatus = RailProfileMeasureTaskStatus.IDLE;
this.measureSideCnt = 0;
this.isMeasuringLeftEnd = false;

9
app/src/main/java/com/iflytop/profilometer/model/vo/SystemConfigVO.java

@ -2,6 +2,7 @@ package com.iflytop.profilometer.model.vo;
public class SystemConfigVO {
private String server;
private Integer standbyMinutes;
public String getServer() {
return server;
@ -10,4 +11,12 @@ public class SystemConfigVO {
public void setServer(String server) {
this.server = server;
}
public Integer getStandbyMinutes() {
return standbyMinutes;
}
public void setStandbyMinutes(Integer standbyMinutes) {
this.standbyMinutes = standbyMinutes;
}
}

3
app/src/main/java/com/iflytop/profilometer/service/RailProfileDrawerService.java

@ -102,9 +102,6 @@ public class RailProfileDrawerService implements RailProfileDrawerListener {
if (side == MeasureSide.LEFT) {
map.put("data", RailProfileMeasureTaskEvent.FINISH_RECORD_LEFT);
taskState.setMeasuringLeftEnd(true);
//左侧测量完毕后将数据反转
// List<XYPoint> outlinePointSetList = taskState.getOutlinePointSetList();
// Collections.reverse(outlinePointSetList);
} else if (side == MeasureSide.RIGHT) {
map.put("data", RailProfileMeasureTaskEvent.FINISH_RECORD_RIGHT);
taskState.setMeasuringRightEnd(true);

Loading…
Cancel
Save