更改驱动

idata
wanghao 7 months ago
parent 586a4a2c41
commit ef9ad2c0a1

@ -16,7 +16,7 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {
// SO // SO
abiFilters 'armeabi' , 'armeabi-v7a' abiFilters 'arm64-v8a' , 'armeabi' , 'armeabi-v7a'
} }
} }
@ -41,8 +41,14 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0' implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation files('libs\\uhflonger_v1.3.jar') implementation files('libs\\App_Demo_API.jar')
implementation files('libs\\DeviceAPIver20150204.jar')
implementation files('libs\\logutil-1.5.1.1.jar')
implementation files('libs\\ModuleAPI_J.jar') implementation files('libs\\ModuleAPI_J.jar')
implementation files('libs\\reader(1).jar')
implementation files('libs\\UHF67_v3.6.jar')
// implementation files('libs\\uhflonger_v1.3.jar')
// implementation files('libs\\ModuleAPI_J.jar')
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@ -15,11 +16,15 @@
android:roundIcon="@drawable/logo" android:roundIcon="@drawable/logo"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Beijingdaxing" android:theme="@style/Theme.Beijingdaxing"
android:usesCleartextTraffic="true"
tools:targetApi="31"> tools:targetApi="31">
<receiver <receiver
android:name=".broadcast.MyNetWorkReceiver" android:name=".base.BaseActivity$MyReceiver"
android:enabled="true" android:enabled="true"
android:exported="true"> android:exported="true">
<intent-filter>
<action android:name="android.rfid.FUN_KEY"/>
</intent-filter>
</receiver> </receiver>
<activity <activity

@ -17,9 +17,12 @@ import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.example.beijing_daxing.vm.BFWm; import com.example.beijing_daxing.vm.BFWm;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.List; import java.util.List;
import cn.pda.serialport.Tools;
public class BFActivity extends BaseActivity { public class BFActivity extends BaseActivity {
private BFWm wm; private BFWm wm;
@Override @Override
@ -31,12 +34,14 @@ public class BFActivity extends BaseActivity {
} }
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
var epc = epcs.get(0); var epc = epcs.get(0);
wm.setEpc(epc); byte[] epcId = epc.EpcId;
String epc1 = Tools.Bytes2HexString(epcId, epcId.length);
wm.setEpc(epc1);
OkGo.<MyResult>post(url+"/bf/select") OkGo.<MyResult>post(url+"/bf/select")
.tag(this) .tag(this)
.params("epc",epc) .params("epc",epc1)
.execute(new MyRecultCall(dialog,this){ .execute(new MyRecultCall(dialog,this){
@Override @Override
public void onSuccess(Response<MyResult> response) { public void onSuccess(Response<MyResult> response) {

@ -24,12 +24,15 @@ import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import cn.pda.serialport.Tools;
public class CheckActivity extends BaseActivity implements AdapterClickCall, InPutDialog.InPutDialogCall { public class CheckActivity extends BaseActivity implements AdapterClickCall, InPutDialog.InPutDialogCall {
private ActivityCheckBinding binding; private ActivityCheckBinding binding;
@ -48,7 +51,6 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
adapter = new CheckAdapter(this, this); adapter = new CheckAdapter(this, this);
state = new ObservableBoolean(); state = new ObservableBoolean();
checkState = new ObservableBoolean(); checkState = new ObservableBoolean();
binding.setAdapter(adapter); binding.setAdapter(adapter);
binding.setState(state); binding.setState(state);
binding.setCheckState(checkState); binding.setCheckState(checkState);
@ -99,7 +101,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
// 扫描到返回数据 // 扫描到返回数据
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
// var text = epcs.get(0); // var text = epcs.get(0);
// binding.checkEpc.setText(text); // binding.checkEpc.setText(text);
@ -113,13 +115,14 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
// subIndex = index; // subIndex = index;
epcs.forEach(t -> { epcs.forEach(t -> {
var epc= Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
if (tagList.contains(t)) { if (tagList.contains(t)) {
return; return;
} }
tagList.add(t); tagList.add(epc);
var stock = new Stock(); var stock = new Stock();
stock.setEpcCode(t); stock.setEpcCode(epc);
var index = list.indexOf(stock); var index = list.indexOf(stock);
if (index != -1) { if (index != -1) {
list.get(index).setState("正常"); list.get(index).setState("正常");
@ -196,7 +199,8 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
private Runnable runnable = new Runnable() { private Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
sendBroadcast(broadcastIntent); // sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 1000); handler.postDelayed(runnable, 1000);
} }
}; };

@ -17,9 +17,12 @@ import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.example.beijing_daxing.vm.FpInVm; import com.example.beijing_daxing.vm.FpInVm;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.List; import java.util.List;
import cn.pda.serialport.Tools;
public class FpInActivity extends BaseActivity { public class FpInActivity extends BaseActivity {
private FpInVm vm; private FpInVm vm;
@ -32,8 +35,9 @@ public class FpInActivity extends BaseActivity {
} }
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
var epc = epcs.get(0); Reader.TAGINFO taginfo = epcs.get(0);
var epc = Tools.Bytes2HexString(taginfo.EpcId,taginfo.EpcId.length);
vm.setEpc(epc); vm.setEpc(epc);
OkGo.<MyResult>post(url+"/fpin/select") OkGo.<MyResult>post(url+"/fpin/select")
.tag(this).params("epc",epc) .tag(this).params("epc",epc)

@ -23,10 +23,13 @@ import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.pda.serialport.Tools;
public class FpOutActivity extends BaseActivity { public class FpOutActivity extends BaseActivity {
private ObservableBoolean checkState; private ObservableBoolean checkState;
private List<Stock> list; private List<Stock> list;
@ -44,14 +47,16 @@ public class FpOutActivity extends BaseActivity {
private List<String> tagList; private List<String> tagList;
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
if (tagList==null) return;
epcs.forEach(t -> { epcs.forEach(t -> {
if (tagList.contains(t)){ var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
tagList.add(t); if (tagList.contains(epc)){
tagList.add(epc);
return; return;
} }
var stock = new Stock(); var stock = new Stock();
stock.setEpcCode(t); stock.setEpcCode(epc);
var index = list.indexOf(stock); var index = list.indexOf(stock);
if (index != -1) { if (index != -1) {
list.get(index).setState("Y"); list.get(index).setState("Y");
@ -122,7 +127,8 @@ public class FpOutActivity extends BaseActivity {
private Runnable runnable = new Runnable() { private Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
sendBroadcast(broadcastIntent); // sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 1000); handler.postDelayed(runnable, 1000);
} }
}; };

@ -61,6 +61,7 @@ public class HomePageActivity extends AppCompatActivity {
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
var uhfLongerManager = MyApplication.getUhfLongerManager(); var uhfLongerManager = MyApplication.getUhfLongerManager();
uhfLongerManager.asyncStopReading();
uhfLongerManager.close(); uhfLongerManager.close();
MyApplication.uhfLongerManager = null; MyApplication.uhfLongerManager = null;
// unregisterReceiver(myNetWorkReceiver); // unregisterReceiver(myNetWorkReceiver);

@ -19,10 +19,12 @@ import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.example.beijing_daxing.vm.InStoreVM; import com.example.beijing_daxing.vm.InStoreVM;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.pda.serialport.Tools;
import okhttp3.RequestBody; import okhttp3.RequestBody;
public class InActivity extends BaseActivity implements AdapterClickCall { public class InActivity extends BaseActivity implements AdapterClickCall {
@ -47,12 +49,13 @@ public class InActivity extends BaseActivity implements AdapterClickCall {
} }
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
// Log.e("TAG", "sanRfid:" + epcs); // Log.e("TAG", "sanRfid:" + epcs);
epcs.stream().forEach(t -> { epcs.stream().forEach(t -> {
if (!epcList.contains(t)) { var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
epcList.add(t); if (!epcList.contains(epc)) {
epcList.add(epc);
} }
}); });
vm.setSanLength(epcList.size()); vm.setSanLength(epcList.size());

@ -17,6 +17,7 @@ import com.example.beijing_daxing.vm.LoginVm;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback; import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.List; import java.util.List;
@ -38,7 +39,7 @@ public class MainActivity extends BaseActivity {
} }
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
} }

@ -18,6 +18,7 @@ import com.example.beijing_daxing.base.BaseActivity;
import com.example.beijing_daxing.been.RFIDLocation; import com.example.beijing_daxing.been.RFIDLocation;
import com.example.beijing_daxing.been.Stock; import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.databinding.ActivityOffLineCheckBinding; import com.example.beijing_daxing.databinding.ActivityOffLineCheckBinding;
import com.uhf.api.cls.Reader;
import org.litepal.LitePal; import org.litepal.LitePal;
@ -55,7 +56,7 @@ public class OffLineCheckActivity extends BaseActivity {
} }
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
} }
@ -79,7 +80,8 @@ public class OffLineCheckActivity extends BaseActivity {
private Runnable runnable = new Runnable() { private Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
sendBroadcast(broadcastIntent); // sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 1000); handler.postDelayed(runnable, 1000);
} }
}; };

@ -16,8 +16,12 @@ import com.example.beijing_daxing.vm.OutStoreVm;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.pda.serialport.Tools;
import okhttp3.RequestBody; import okhttp3.RequestBody;
public class OutActivity extends BaseActivity implements AdapterClickCall { public class OutActivity extends BaseActivity implements AdapterClickCall {
@ -39,10 +43,11 @@ public class OutActivity extends BaseActivity implements AdapterClickCall {
} }
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
epcs.stream().forEach(t -> { epcs.stream().forEach(t -> {
if (!epcList.contains(t)) { var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
epcList.add(t); if (!epcList.contains(epc)) {
epcList.add(epc);
} }
}); });
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();

@ -25,10 +25,12 @@ import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.pda.serialport.Tools;
import okhttp3.RequestBody; import okhttp3.RequestBody;
public class StoreCheckActivity extends BaseActivity { public class StoreCheckActivity extends BaseActivity {
@ -48,16 +50,20 @@ public class StoreCheckActivity extends BaseActivity {
binding.setAdapter(checkAdapter); binding.setAdapter(checkAdapter);
initRequest(); initRequest();
} }
private List<String> tagList; private List<String> tagList;
@Override @Override
protected void sanRfid(List<String> epcs) { protected void sanRfid(List<Reader.TAGINFO> epcs) {
if (tagList == null) return;
epcs.forEach(t -> { epcs.forEach(t -> {
if (tagList.contains(t)){ var epc = Tools.Bytes2HexString(t.EpcId, t.EpcId.length);
tagList.add(t); if (tagList.contains(epc)) {
tagList.add(epc);
return; return;
} }
var stock = new Stock(); var stock = new Stock();
stock.setEpcCode(t); stock.setEpcCode(epc);
var index = list.indexOf(stock); var index = list.indexOf(stock);
if (index != -1) { if (index != -1) {
list.get(index).setState("Y"); list.get(index).setState("Y");
@ -127,7 +133,9 @@ public class StoreCheckActivity extends BaseActivity {
private Runnable runnable = new Runnable() { private Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
sendBroadcast(broadcastIntent); Log.e("TAG", "发送广播读取RFID");
// sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 1000); handler.postDelayed(runnable, 1000);
} }
}; };

@ -18,7 +18,8 @@ import androidx.appcompat.app.AppCompatActivity;
import com.example.beijing_daxing.R; import com.example.beijing_daxing.R;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.handheld.UHFLonger.UHFLongerManager; import com.handheld.uhfr.*;
import com.uhf.api.cls.Reader;
import java.util.List; import java.util.List;
@ -26,14 +27,13 @@ import okhttp3.MediaType;
public abstract class BaseActivity extends AppCompatActivity { public abstract class BaseActivity extends AppCompatActivity {
// public static String url = "http://192.168.0.102:8090/api"; // public static String url = "http://192.168.0.102:8090/api";
public static String url = "http://175.27.215.92:8090/api"; public static String url = "http://119.45.202.115:8090/api";
public ProgressDialog dialog; public ProgressDialog dialog;
public Gson gson; public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8"); public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
public UHFLongerManager uhfLongerManager; public UHFRManager uhfLongerManager;
private MediaPlayer mediaPlayer; private MediaPlayer mediaPlayer;
public MyReceiver myReceiver; public MyReceiver myReceiver;
public Intent broadcastIntent; public Intent broadcastIntent;
@SuppressLint("UnspecifiedRegisterReceiverFlag") @SuppressLint("UnspecifiedRegisterReceiverFlag")
@ -43,9 +43,9 @@ public abstract class BaseActivity extends AppCompatActivity {
gson = new Gson(); gson = new Gson();
initDialog(); initDialog();
initSan(); initSan();
Intent intent = new Intent();
broadcastIntent = new Intent("android.rfid.FUN_KEY"); broadcastIntent = new Intent("android.rfid.FUN_KEY");
broadcastIntent.putExtra("keydown", false); broadcastIntent.putExtra("keydown", false);
// broadcastIntent.setComponent(new ComponentName("com.example.beijing_daxing",".base.BaseActivity$MyReceiver"));
} }
// private long readTime = 0; // private long readTime = 0;
@ -55,19 +55,24 @@ public abstract class BaseActivity extends AppCompatActivity {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
var keydown = intent.getBooleanExtra("keydown", false); var keydown = intent.getBooleanExtra("keydown", false);
Log.e("TAG", "接收到广播:" + keydown);
if (!keydown) { if (!keydown) {
// readTime = System.currentTimeMillis(); // readTime = System.currentTimeMillis();
List<String> strings = uhfLongerManager.inventoryRealTime(); sanEpc();
}
}
}
public void sanEpc(){
List<Reader.TAGINFO> strings = uhfLongerManager.tagInventoryRealTime();
Log.e("TAG", "驱动" + (uhfLongerManager == null)); Log.e("TAG", "驱动" + (uhfLongerManager == null));
if (strings == null || strings.isEmpty()) { if (strings == null || strings.isEmpty()) {
return; return;
} }
mediaPlayer.start(); mediaPlayer.start();
sanRfid(strings); sanRfid(strings);
} }
}
}
private void initDialog() { private void initDialog() {
dialog = new ProgressDialog(this); dialog = new ProgressDialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -75,15 +80,20 @@ public abstract class BaseActivity extends AppCompatActivity {
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("请求网络..."); dialog.setMessage("请求网络...");
} }
private void initSan() { private void initSan() {
uhfLongerManager = MyApplication.getUhfLongerManager(); uhfLongerManager = MyApplication.getUhfLongerManager();
// intentFilter.addAction("android.intent.action.FUN_KEY"); // intentFilter.addAction("android.intent.action.FUN_KEY");
uhfLongerManager.asyncStartReading();
myReceiver = new MyReceiver(); myReceiver = new MyReceiver();
IntentFilter intentFilter = new IntentFilter(); IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.rfid.FUN_KEY"); intentFilter.addAction("android.rfid.FUN_KEY");
registerReceiver(myReceiver, intentFilter); registerReceiver(myReceiver, intentFilter);
mediaPlayer = MediaPlayer.create(this, R.raw.msg); mediaPlayer = MediaPlayer.create(this, R.raw.msg);
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
@ -91,6 +101,5 @@ public abstract class BaseActivity extends AppCompatActivity {
} }
protected abstract void sanRfid(List<Reader.TAGINFO> epcs);
protected abstract void sanRfid(List<String> epcs);
} }

@ -1,9 +1,11 @@
package com.example.beijing_daxing.base; package com.example.beijing_daxing.base;
import android.app.Application; import android.app.Application;
import android.util.Log;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils; import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.handheld.UHFLonger.UHFLongerManager;
import com.handheld.uhfr.UHFRManager;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity; import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode; import com.lzy.okgo.cache.CacheMode;
@ -28,7 +30,7 @@ import okhttp3.OkHttpClient;
public class MyApplication extends Application { public class MyApplication extends Application {
MyApplication application; MyApplication application;
public static UHFLongerManager uhfLongerManager; public static UHFRManager uhfLongerManager;
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
@ -39,15 +41,16 @@ public class MyApplication extends Application {
getUhfLongerManager(); getUhfLongerManager();
} }
public static UHFLongerManager getUhfLongerManager() { public static UHFRManager getUhfLongerManager() {
if (uhfLongerManager==null){ if (uhfLongerManager==null){
try { try {
uhfLongerManager = UHFLongerManager.getInstance(); uhfLongerManager = UHFRManager.getInstance();
uhfLongerManager.setOutPower((short) 30); uhfLongerManager.setPower(33,33);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
return uhfLongerManager; return uhfLongerManager;
} }
// OKGO 初始化 // OKGO 初始化

@ -107,11 +107,11 @@
</LinearLayout> </LinearLayout>
<Button <Button
style="@style/button_style"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_margin="20dp" android:layout_margin="20dp"
android:onClick="bf_submit" android:onClick="bf_submit"
style="@style/button_style"
android:text="标记报废" /> android:text="标记报废" />
</LinearLayout> </LinearLayout>

@ -29,9 +29,10 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView2" android:id="@+id/recyclerView2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="500dp" android:layout_height="match_parent"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:background="@color/white" android:background="@color/white"
android:layout_weight="1"
android:padding="10dp" android:padding="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:adapter="@{adapter}" /> android:adapter="@{adapter}" />
@ -114,6 +115,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:text="提交" android:text="提交"
android:onClick="in_submit" android:onClick="in_submit"
app:layout_constraintTop_toBottomOf="@+id/linearLayout4" app:layout_constraintTop_toBottomOf="@+id/linearLayout4"

@ -27,9 +27,10 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="match_parent"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:background="@color/white" android:background="@color/white"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:adapter="@{adapter}" android:adapter="@{adapter}"
android:padding="10dp" /> android:padding="10dp" />
@ -79,8 +80,9 @@
<Button <Button
style="@style/button_style" style="@style/button_style"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="55dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:onClick="out_submit" android:onClick="out_submit"
android:text="提交" /> android:text="提交" />
</LinearLayout> </LinearLayout>

@ -12,7 +12,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="44dp" android:layout_height="50dp"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:background="#DEE3E6" android:background="#DEE3E6"
android:orientation="horizontal"> android:orientation="horizontal">

Loading…
Cancel
Save