@@ -0,0 +1,10 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="deploymentTargetSelector"> | |||
<selectionStates> | |||
<SelectionState runConfigName="app"> | |||
<option name="selectionMode" value="DROPDOWN" /> | |||
</SelectionState> | |||
</selectionStates> | |||
</component> | |||
</project> |
@@ -0,0 +1,15 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="GitToolBoxProjectSettings"> | |||
<option name="commitMessageIssueKeyValidationOverride"> | |||
<BoolValueOverride> | |||
<option name="enabled" value="true" /> | |||
</BoolValueOverride> | |||
</option> | |||
<option name="commitMessageValidationEnabledOverride"> | |||
<BoolValueOverride> | |||
<option name="enabled" value="true" /> | |||
</BoolValueOverride> | |||
</option> | |||
</component> | |||
</project> |
@@ -5,7 +5,7 @@ | |||
<option name="linkedExternalProjectsSettings"> | |||
<GradleProjectSettings> | |||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | |||
<option name="gradleJvm" value="corretto-11" /> | |||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> | |||
<option name="modules"> | |||
<set> | |||
<option value="$PROJECT_DIR$" /> | |||
@@ -0,0 +1,10 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="ProjectMigrations"> | |||
<option name="MigrateToGradleLocalJavaHome"> | |||
<set> | |||
<option value="$PROJECT_DIR$" /> | |||
</set> | |||
</option> | |||
</component> | |||
</project> |
@@ -1,4 +1,3 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK" /> | |||
<component name="VisualizationToolProject"> | |||
@@ -1,6 +1,12 @@ | |||
import java.text.DateFormat | |||
import java.text.SimpleDateFormat | |||
apply plugin: 'com.android.application' | |||
//apply plugin: 'com.jakewharton.butterknife' | |||
def releaseTime() { | |||
DateFormat df = new SimpleDateFormat("yyyyMMddHHmm") | |||
return df.format(Calendar.getInstance(Locale.CHINA).getTime()) | |||
} | |||
android { | |||
compileSdk rootProject.ext.compileSdkVersion | |||
@@ -51,6 +57,11 @@ android { | |||
} | |||
} | |||
applicationVariants.all { variant -> | |||
variant.outputs.all { | |||
outputFileName = "boluobatai-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk" | |||
} | |||
} | |||
} | |||
dependencies { | |||
@@ -118,7 +129,7 @@ dependencies { | |||
//leak 内存泄漏检测 | |||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3' | |||
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3' | |||
//Modbus | |||
implementation 'com.github.licheedev:Modbus4Android:2.0.2' | |||
@@ -146,6 +146,7 @@ | |||
<activity | |||
android:name=".modules.home.activity.BottomNavigationMainActivity" | |||
android:exported="false" | |||
android:launchMode="singleTask" | |||
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" | |||
/> | |||
<activity | |||
@@ -6,41 +6,66 @@ import android.content.Context; | |||
import android.content.DialogInterface; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import java.lang.ref.WeakReference; | |||
public class WaitDialog { | |||
static Context context; | |||
static Activity activity; | |||
static ProgressDialog progressDialog; | |||
private WeakReference<Activity> activityWeakReference; | |||
private WeakReference<Context> contextWeakReference; | |||
private ProgressDialog progressDialog; | |||
private static WaitDialog mInstance; //实例变量设置私有,防止直接通过类名访问 | |||
private WaitDialog() { | |||
//默认构造函数私有,防止类外直接new创建对象 | |||
} | |||
public static void Show(String title,String msg,Context _context,Activity _activity){ | |||
context=_context; | |||
activity=_activity; | |||
if(context==null) return; | |||
progressDialog = new ProgressDialog(context); | |||
public static synchronized WaitDialog getInstance() { //静态同步方法作为唯一的实例对象获取方式 | |||
if (mInstance==null) { | |||
synchronized (WaitDialog.class ){ | |||
if(mInstance==null){ | |||
mInstance = new WaitDialog(); | |||
} | |||
} | |||
} | |||
return mInstance; | |||
} | |||
//end | |||
public void Show(String title,String msg,Context _context,Activity _activity){ | |||
contextWeakReference=new WeakReference<>(_context); | |||
activityWeakReference = new WeakReference<>(_activity); | |||
if(_context==null) return; | |||
if(progressDialog!=null){ | |||
progressDialog.dismiss(); | |||
} | |||
progressDialog = new ProgressDialog(_context); | |||
progressDialog.setTitle(title); | |||
progressDialog.setCancelable(false); | |||
progressDialog.setMessage(msg); | |||
progressDialog.show(); | |||
} | |||
public static void AddText(String info){ | |||
if(context==null) return; | |||
if(activity==null) return; | |||
public void AddText(String info){ | |||
if(contextWeakReference.get()==null) return; | |||
if(activityWeakReference.get()==null) return; | |||
if(progressDialog==null) return; | |||
activity.runOnUiThread(()->{ progressDialog.setMessage(info);}); | |||
activityWeakReference.get().runOnUiThread(()->{ progressDialog.setMessage(info);}); | |||
} | |||
public static void Dismiss(){ | |||
if(activity==null) return; | |||
public void Dismiss(){ | |||
if(activityWeakReference.get()==null) return; | |||
if(progressDialog==null) return; | |||
activity.runOnUiThread(()->{ progressDialog.dismiss();}); | |||
activityWeakReference.get().runOnUiThread(()->{ progressDialog.dismiss();}); | |||
} | |||
public static void TimeOut(String info){ | |||
if(activity==null) return; | |||
public void TimeOut(String info){ | |||
if(activityWeakReference.get()==null) return; | |||
if(progressDialog==null) return; | |||
Dismiss(); | |||
DialogManager.showError(activity,info,AlertDialogButton.OK,null); | |||
DialogManager.showError(activityWeakReference.get(),info,AlertDialogButton.OK,null); | |||
} | |||
} |
@@ -29,7 +29,7 @@ public class Unity { | |||
Delay(100); | |||
if(timeOut>0&&(System.currentTimeMillis()-startTime)>timeOut) break; | |||
} | |||
if(!tag) MessageLog.ShowInfo("任务超时,超时时间:"+String.valueOf(timeOut)+"/"+String.valueOf(System.currentTimeMillis()-startTime)); | |||
if(!tag) MessageLog.ShowInfo("任务超时,超时时间:"+String.valueOf(timeOut)+"/"+String.valueOf(System.currentTimeMillis()-startTime)); | |||
// System.out.println("任务超时,超时时间:"+String.valueOf(timeOut)+"/"+String.valueOf(System.currentTimeMillis()-startTime)); | |||
return tag?OperateResult.CreateSuccess():OperateResult.CreateFailed("任务超时"); | |||
@@ -87,7 +87,18 @@ public class Unity { | |||
*/ | |||
public static float Scale( float InputValue, float InputMax, float InputMin, float OutMax, float OutMin) | |||
{ | |||
MessageLog.ShowInfo("AnalogConvert measureCookTime InputValue="+InputValue+" InputMax="+InputMax+";InputMin="+InputMin+";OutMax="+OutMax+";OutMin="+OutMin); | |||
if(InputValue<=0|| InputMax<=0||InputMin<=0){ | |||
return 0; | |||
} | |||
if(((InputMax - InputMin) + OutMin)==0){ | |||
return 0; | |||
} | |||
float value = ((OutMax - OutMin) * (InputValue - InputMin)) / (InputMax - InputMin) + OutMin; | |||
if(value<=0){ | |||
value = 0; | |||
} | |||
String formattedNum = String.format("%.2f", value); | |||
return Float.parseFloat(formattedNum); | |||
} | |||
@@ -997,6 +997,7 @@ public class ConfigData { | |||
} | |||
//endregion | |||
} | |||
@@ -40,6 +40,7 @@ import com.bonait.bnframework.common.helper.ThreadManager; | |||
import com.bonait.bnframework.common.modbus.ModbusTcpServer; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.http.utils.LogUtils; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
@@ -295,7 +296,7 @@ public class ExecuteTheRecipe { | |||
} catch (Exception ex) { | |||
ToastUtils.error("PLC设备数据监听异常:" + ex.getMessage()); | |||
} | |||
Thread.sleep(1); | |||
Thread.sleep(50); | |||
} | |||
@Override | |||
@@ -509,6 +510,12 @@ public class ExecuteTheRecipe { | |||
} | |||
}); | |||
} | |||
public static void releaseListening(){ | |||
ThreadManager.Get().Stop("PLC设备数据监听"); | |||
ThreadManager.Get().Stop("PLC设备数据监听-信号检测"); | |||
ThreadManager.Get().Stop("商品制作线程"); | |||
} | |||
//endregion | |||
//region PLC基础控制类 | |||
@@ -520,9 +527,12 @@ public class ExecuteTheRecipe { | |||
* @param value | |||
*/ | |||
public static void WritePLC(String name, Object value, IWriteCallBack callback) { | |||
MessageLog.ShowInfo("WritePLC name="+name +";value="+value.toString()); | |||
try { | |||
if (ConfigName.getInstance().PLC_Address.containsKey(name)) { | |||
BPA_PLCADDRESS plcaddress = ConfigName.getInstance().PLC_Address.get(name); | |||
MessageLog.ShowInfo("WritePLC name="+name + ";plcaddress.address="+plcaddress.address.toString()+";value="+value.toString()); | |||
if (!plcaddress.address.isEmpty() && ConfigName.getInstance().PlcIsConnect) { | |||
if (plcaddress.address.toUpperCase().startsWith("VD"))//int | |||
{ | |||
@@ -563,6 +573,7 @@ public class ExecuteTheRecipe { | |||
} | |||
public static void Write(Object plcName,Object value,IWriteCallBack callBack){ | |||
MessageLog.ShowInfo("WritePLC plcName=" +plcName.toString() +";value="+value.toString()); | |||
WritePLC(plcName.toString(),value,callBack); | |||
} | |||
@@ -573,10 +584,12 @@ public class ExecuteTheRecipe { | |||
* @return | |||
*/ | |||
public static Object ReadPLC(String name) { | |||
final Object[] ReturnsVariable = {null}; | |||
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()); | |||
if (!plcaddress.address.isEmpty() && ConfigName.getInstance().PlcIsConnect) { | |||
if (plcaddress.address.toUpperCase().startsWith("VD"))//int | |||
{ | |||
@@ -611,16 +624,23 @@ public class ExecuteTheRecipe { | |||
ReturnsVariable[0] = val[0]; | |||
}); | |||
} | |||
if ((plcaddress.address.toUpperCase().equals("VW82"))){ | |||
MessageLog.ShowInfo("ReadPLC 称当前重量 name=" +name+" ReturnsVariable[0]="+ReturnsVariable[0] ); | |||
OutletWeigh = (short)ReturnsVariable[0]; | |||
} | |||
} | |||
} | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} finally { | |||
MessageLog.ShowInfo("ReadPLC name=" +name+" ReturnsVariable[0]="+ReturnsVariable[0] ); | |||
return ReturnsVariable[0]; | |||
} | |||
} | |||
public static boolean ReadBool(Object plcName){ | |||
MessageLog.ShowInfo("ReadBool plcName=" +plcName.toString() ); | |||
try{ | |||
if(ListeningValue.containsKey(plcName)){ | |||
return Boolean.parseBoolean(ListeningValue.get(plcName).toString()); | |||
@@ -633,11 +653,16 @@ public class ExecuteTheRecipe { | |||
} | |||
public static short ReadShort(Object plcName){ | |||
MessageLog.ShowInfo("ReadShort "+plcName.toString()); | |||
try{ | |||
if(ListeningValue.containsKey(plcName)){ | |||
return Short.parseShort(ListeningValue.get(plcName).toString()); | |||
short result = Short.parseShort(ListeningValue.get(plcName).toString()); | |||
MessageLog.ShowInfo(plcName.toString()+" result="+result); | |||
return result; | |||
}else{ | |||
return Short.parseShort(ReadPLC(plcName.toString()).toString()); | |||
short result = Short.parseShort(ReadPLC(plcName.toString()).toString()); | |||
MessageLog.ShowInfo(plcName.toString()+" result="+result); | |||
return result; | |||
} | |||
}catch(Exception e){ | |||
return 0; | |||
@@ -956,7 +981,7 @@ public class ExecuteTheRecipe { | |||
final boolean[] issucess3 = {false}; | |||
//写校准模式 | |||
WritePLC("砝码校准模式", true, new IWriteCallBack() { | |||
WritePLC("校准模式", true, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
issucess1[0] =true; | |||
@@ -1000,7 +1025,7 @@ public class ExecuteTheRecipe { | |||
final boolean[] issucess2 = {false}; | |||
//写校准模式 | |||
WritePLC("砝码校准模式", false, new IWriteCallBack() { | |||
WritePLC("校准模式", false, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
issucess1[0] =true; | |||
@@ -2,7 +2,7 @@ package com.bonait.bnframework.business; | |||
public enum PLCName { | |||
重量清零, | |||
当前重量, | |||
称当前重量, | |||
外置仓1出料时间, | |||
外置仓2出料时间, | |||
外置仓3出料时间, | |||
@@ -52,6 +52,7 @@ public class BaseActivity extends QMUIActivity implements EasyPermissions.Permis | |||
@Override | |||
protected void onDestroy() { | |||
super.onDestroy(); | |||
ActiveMax.destroy(this); | |||
/*LocalCacheUtils.Get().ClearBitmapFile();*/ | |||
} | |||
@@ -46,6 +46,7 @@ import java.util.concurrent.ConcurrentHashMap; | |||
* 配置文件 | |||
*/ | |||
public class ConfigName { | |||
public static final boolean TEST = true; | |||
//region 单例模式 | |||
private static ConfigName mInstance; //实例变量设置私有,防止直接通过类名访问 | |||
@@ -597,7 +598,7 @@ public class ConfigName { | |||
add(new Res_PLCADDRESS("电子秤", "-------------", 0, 0)); | |||
add(new Res_PLCADDRESS("称当前重量", "VW82", 1, 0)); | |||
add(new Res_PLCADDRESS("砝码值", "VW86", 1, 1)); | |||
add(new Res_PLCADDRESS("重量清零", "M20.2", 0, 1)); | |||
add(new Res_PLCADDRESS("重量清零", "M20.0", 0, 1)); | |||
add(new Res_PLCADDRESS("校准模式", "M20.1", 0, 1)); | |||
add(new Res_PLCADDRESS("关闭写保护", "M20.2", 0, 1)); | |||
add(new Res_PLCADDRESS("零点校准", "M20.3", 0, 1)); | |||
@@ -49,6 +49,11 @@ public class ActiveMax { | |||
// activity.getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(setOnSystemUiVisibilityChangeListener); | |||
} | |||
public static void destroy(Activity activity){ | |||
activities.remove(activity); | |||
activity.getWindow().getDecorView().getViewTreeObserver().removeOnGlobalLayoutListener(keyboardVisibilityListener); | |||
} | |||
/** | |||
* 状态栏变化后事件 | |||
*/ | |||
@@ -13,6 +13,8 @@ import android.os.SystemClock; | |||
import android.util.Log; | |||
import android.widget.Toast; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import java.io.File; | |||
import java.io.FileOutputStream; | |||
import java.io.FilenameFilter; | |||
@@ -85,6 +87,9 @@ public class CrashHandler implements UncaughtExceptionHandler { | |||
* @return true:��������˸��쳣��Ϣ; ����false. | |||
*/ | |||
private boolean handleException(Throwable ex) { | |||
if(ConfigName.TEST){ | |||
return false; | |||
} | |||
if (ex == null) | |||
return false; | |||
@@ -45,25 +45,26 @@ public class ToastUtils { | |||
private static final String TOAST_TYPEFACE = "sans-serif-condensed"; | |||
private static Toast currentToastThread; | |||
private static Toast currentToast; | |||
//***********************普通 使用ApplicationContext 方法*********************// | |||
private static long mExitTime; | |||
public static void normal(@NonNull String message) { | |||
normal(MainApplication.getContext(), message, Toast.LENGTH_SHORT, null, false).show(); | |||
normal(MainApplication.getContext(), message, Toast.LENGTH_SHORT, null, false);//.show(); | |||
} | |||
public static void normal(@NonNull String message, Drawable icon) { | |||
normal(MainApplication.getContext(), message, Toast.LENGTH_SHORT, icon, true).show(); | |||
normal(MainApplication.getContext(), message, Toast.LENGTH_SHORT, icon, true);//.show(); | |||
} | |||
public static void normal(@NonNull String message, int duration) { | |||
normal(MainApplication.getContext(), message, duration, null, false).show(); | |||
normal(MainApplication.getContext(), message, duration, null, false);//.show(); | |||
} | |||
public static void normal(@NonNull String message, int duration, Drawable icon) { | |||
normal(MainApplication.getContext(), message, duration, icon, true).show(); | |||
normal(MainApplication.getContext(), message, duration, icon, true);//.show(); | |||
} | |||
public static Toast normal(@NonNull String message, int duration, Drawable icon, boolean withIcon) { | |||
@@ -71,11 +72,11 @@ public class ToastUtils { | |||
} | |||
public static void warning(@NonNull String message) { | |||
warning(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show(); | |||
warning(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true);//.show(); | |||
} | |||
public static void warning(@NonNull String message, int duration) { | |||
warning(MainApplication.getContext(), message, duration, true).show(); | |||
warning(MainApplication.getContext(), message, duration, true);//.show(); | |||
} | |||
public static Toast warning(@NonNull String message, int duration, boolean withIcon) { | |||
@@ -83,11 +84,11 @@ public class ToastUtils { | |||
} | |||
public static void info(@NonNull String message) { | |||
info(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show(); | |||
info(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true);//.show(); | |||
} | |||
public static void info(@NonNull String message, int duration) { | |||
info(MainApplication.getContext(), message, duration, true).show(); | |||
info(MainApplication.getContext(), message, duration, true);//.show(); | |||
} | |||
public static Toast info(@NonNull String message, int duration, boolean withIcon) { | |||
@@ -95,26 +96,27 @@ public class ToastUtils { | |||
} | |||
public static void success(@NonNull String message) { | |||
success(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show(); | |||
success(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true);//.show(); | |||
} | |||
public static void success(@NonNull String message, int duration) { | |||
success(MainApplication.getContext(), message, duration, true).show(); | |||
success(MainApplication.getContext(), message, duration, true);//.show(); | |||
} | |||
public static Toast success(@NonNull String message, int duration, boolean withIcon) { | |||
return custom(MainApplication.getContext(), message, getDrawable(MainApplication.getContext(), R.mipmap.ic_check_white_48dp), DEFAULT_TEXT_COLOR, SUCCESS_COLOR, duration, withIcon, true); | |||
} | |||
//***********************// | |||
public static void error(@NonNull String message) { | |||
error(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true).show(); | |||
error(MainApplication.getContext(), message, Toast.LENGTH_SHORT, true);//.show(); | |||
} | |||
//===========================================使用ApplicationContext 方法========================= | |||
//*******************************************常规方法******************************************** | |||
public static void error(@NonNull String message, int duration) { | |||
error(MainApplication.getContext(), message, duration, true).show(); | |||
error(MainApplication.getContext(), message, duration, true);//.show(); | |||
} | |||
public static Toast error(@NonNull String message, int duration, boolean withIcon) { | |||
@@ -259,14 +261,14 @@ public class ToastUtils { | |||
// currentToast.setGravity(Gravity.RIGHT | Gravity.TOP, 0, 0);//右上角 | |||
// currentToast.setGravity(Gravity.LEFT | Gravity.BOTTOM, 0, 0);//左下角 | |||
// currentToast.setGravity(Gravity.RIGHT | Gravity.BOTTOM, 0, 100);//右下角 | |||
currentToast.show(); | |||
return currentToast; | |||
} else { | |||
mHandler.post(new Runnable() { | |||
@Override | |||
public void run() { | |||
if (currentToast == null) { | |||
currentToast = new Toast(context); | |||
if (currentToastThread == null) { | |||
currentToastThread = new Toast(context); | |||
} | |||
final View toastLayout = ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.toast_layout, null); | |||
final ImageView toastIcon = toastLayout.findViewById(R.id.toast_icon); | |||
@@ -293,11 +295,11 @@ public class ToastUtils { | |||
toastTextView.setText(message); | |||
toastTextView.setTypeface(Typeface.create(TOAST_TYPEFACE, Typeface.NORMAL)); | |||
currentToast.setView(toastLayout); | |||
currentToast.setDuration(duration); | |||
currentToast.setGravity(Gravity.TOP,0,100); | |||
currentToastThread.setView(toastLayout); | |||
currentToastThread.setDuration(duration); | |||
currentToastThread.setGravity(Gravity.TOP,0,100); | |||
currentToastThread.show(); | |||
// currentToast.setGravity(Gravity.LEFT | Gravity.TOP, 0, 0);//左上角 | |||
// currentToast.setGravity(Gravity.RIGHT | Gravity.TOP, 0, 0);//右上角 | |||
// currentToast.setGravity(Gravity.LEFT | Gravity.BOTTOM, 0, 0);//左下角 | |||
@@ -307,7 +309,7 @@ public class ToastUtils { | |||
} | |||
return currentToast; | |||
return null; | |||
} | |||
public static final Drawable tint9PatchDrawableFrame(@NonNull Context context, @ColorInt int tintColor) { | |||
@@ -43,7 +43,7 @@ public class UpdateAppUtils { | |||
/** | |||
* 当前版本号 | |||
*/ | |||
private static String myVersionCode = "1.0"; | |||
private static String myVersionCode = "1.2"; | |||
/** | |||
* 服务器的版本号 | |||
*/ | |||
@@ -99,10 +99,15 @@ public class UpdateAppUtils { | |||
mode.branchCode="1712279450412756993"; | |||
}else | |||
{ | |||
mode.productCode="1679307017135329280"; | |||
mode.moduleCode="newtwbt"; | |||
mode.serverCode="1680767784879656960";//服务器 | |||
mode.branchCode="1712279534630187009"; | |||
// mode.productCode="1679307017135329280"; | |||
// mode.moduleCode="newtwbt"; | |||
// mode.serverCode="1680767784879656960";//服务器 | |||
// mode.branchCode="1712279534630187009"; | |||
mode.productCode="1769564215952125952"; | |||
mode.moduleCode="desktopplbt"; | |||
mode.serverCode="1769564338190921728";//服务器 | |||
mode.branchCode="1789857238682284033"; | |||
} | |||
//调味吧台 | |||
@@ -397,4 +397,10 @@ public class AddGoodDialog extends Dialog { | |||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); | |||
} | |||
}; | |||
@Override | |||
public void dismiss() { | |||
super.dismiss(); | |||
MessageManager.getInstance().unRegisterMessageReceiver(activity_ma); | |||
} | |||
} |
@@ -20,6 +20,7 @@ import android.widget.RelativeLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.business.OrderServer; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
@@ -140,6 +141,9 @@ public class BottomNavigationMainActivity extends BaseActivity{ | |||
ConfigData.getInstance().ColsePLC(); | |||
MediaPlayerHelper.getInstance().Release(); | |||
MQTT.get().ConnMqttBroken(false);//释放mqtt | |||
ThreadManager.Get().Stop("PLC断线重连线程"); | |||
ThreadManager.Get().Stop("心跳服务"); | |||
ExecuteTheRecipe.releaseListening(); | |||
super.onDestroy(); | |||
Glide.get(this).clearMemory(); | |||
@@ -7,6 +7,7 @@ import android.view.ViewGroup; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.ImageView; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import androidx.annotation.NonNull; | |||
@@ -43,8 +44,8 @@ public class goodpf_apapter extends ArrayAdapter<BPA_GOODSRECIPENAME> { | |||
View view = LayoutInflater.from(getContext()).inflate(resource1, parent, false); | |||
//分别获取 image view 和 textview 的实例 | |||
TextView name = view.findViewById(R.id.name); | |||
ImageView button = view.findViewById(R.id.button_item); | |||
ImageView button_update = view.findViewById(R.id.button_update); | |||
RelativeLayout button = view.findViewById(R.id.button_item); | |||
RelativeLayout button_update = view.findViewById(R.id.button_update); | |||
// 设置要显示的图片和文字 | |||
name.setText(bpa_goodsrecipename.name); | |||
@@ -1,9 +1,11 @@ | |||
package com.bonait.bnframework.modules.home.adapter; | |||
import android.app.Activity; | |||
import android.app.Application; | |||
import android.content.Context; | |||
import android.content.ContextWrapper; | |||
import android.media.MediaPlayer; | |||
import android.os.Handler; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
@@ -18,6 +20,7 @@ import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import com.bonait.bnframework.MainApplication; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
@@ -30,6 +33,7 @@ import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.helper.MediaPlayerHelper; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.http.utils.LogUtils; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
@@ -46,15 +50,16 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH | |||
private MyClickListener mListener; | |||
private ArrayList<ResGoodsMake> datas= DataBus.getInstance().GoodsMake; | |||
int resource1; | |||
public Context conmain; | |||
public Activity activity; | |||
// public Context conmain; | |||
// public Activity activity; | |||
private final LayoutInflater mLayoutInflater; | |||
Handler handler = new Handler(); | |||
public loadinggood_adapter(Context context,MyClickListener myClickListener,Activity ac) { | |||
this.conmain = context; | |||
activity=ac; | |||
public loadinggood_adapter(Context context,MyClickListener myClickListener) { | |||
// this.conmain = context; | |||
// activity=ac; | |||
mListener=myClickListener; | |||
mLayoutInflater = LayoutInflater.from(context); | |||
} | |||
@@ -86,7 +91,7 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH | |||
break; | |||
case "制作中": | |||
// myViewHolder.quxiaozhizuo.setVisibility(View.VISIBLE);//取消制作 | |||
myViewHolder.loading_status.setTextColor(conmain.getResources().getColor(R.color.green_primary_dark)); | |||
myViewHolder.loading_status.setTextColor(myViewHolder.loading_status.getContext().getResources().getColor(R.color.green_primary_dark)); | |||
break; | |||
case "制作完成": | |||
// myViewHolder.quxiaozhizuo.setVisibility(View.VISIBLE);//取消制作 | |||
@@ -105,7 +110,7 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH | |||
public void onClick(View view) { | |||
String title = "温馨提示!"; | |||
String message = "客官确定要取消制作【"+goodsMake.good.name+"】吗?"; | |||
AlertDialogUtils.showDialog(conmain, title, message, new QMUIDialogAction.ActionListener() { | |||
AlertDialogUtils.showDialog(MainApplication.getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
DataBus.getInstance().DeleteGoodsMake(goodsMake.subOrder.id); | |||
@@ -134,16 +139,17 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH | |||
* @param | |||
*/ | |||
public void refresh() { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
if(handler!=null){ | |||
handler.postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
datas= DataBus.getInstance().GoodsMake; | |||
notifyDataSetChanged(); | |||
} catch (Exception e) { | |||
LogUtils.error("****","刷新 size="+datas.size()); | |||
} | |||
} | |||
}); | |||
},500); | |||
} | |||
} | |||
/** | |||
@@ -67,6 +67,7 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
myViewHolder.control_switch_bs.setChecked(false); | |||
if(goodsMake.name.equals("水池温度")) | |||
{ | |||
myViewHolder.zdbs1.setVisibility(View.VISIBLE); | |||
myViewHolder.zdbs2.setVisibility(View.VISIBLE); | |||
@@ -322,6 +323,10 @@ public class wdsz_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
* 保存值 | |||
*/ | |||
Button save_value; | |||
/** | |||
* 父容器 | |||
*/ | |||
RelativeLayout root; | |||
RelativeLayout zdbs1,zdbs2,zdbs3,show_wdsz,show_wd; | |||
public WDSZViewHolder(View view) { | |||
@@ -7,6 +7,7 @@ import android.view.ViewGroup; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.ImageView; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import androidx.annotation.NonNull; | |||
@@ -43,8 +44,8 @@ public class wl_adapter extends ArrayAdapter<BPA_MATERIAL> { | |||
View view = LayoutInflater.from(getContext()).inflate(resource1, parent, false); | |||
//分别获取 image view 和 textview 的实例 | |||
TextView name = view.findViewById(R.id.name); | |||
ImageView button = view.findViewById(R.id.button_item); | |||
ImageView button_update = view.findViewById(R.id.button_update); | |||
RelativeLayout button = view.findViewById(R.id.button_item); | |||
RelativeLayout button_update = view.findViewById(R.id.button_update); | |||
// 设置要显示的图片和文字 | |||
name.setText(bpa_material.name); | |||
@@ -16,6 +16,7 @@ import android.content.res.Resources; | |||
import android.graphics.Color; | |||
import android.os.Bundle; | |||
import android.os.Handler; | |||
import android.os.Looper; | |||
import android.os.Message; | |||
import android.os.ResultReceiver; | |||
import android.text.Editable; | |||
@@ -81,15 +82,8 @@ import com.bonait.bnframework.common.message.MessageManager; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.loadinggood_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.wl_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SerialInter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SerialManage; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SerialPortRead; | |||
import com.bonait.bnframework.modules.home.fragment.mode.ShaoMaSave; | |||
//import com.bonait.bnframework.modules.home.fragment.mode.ShaomaTest; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_makegood_control; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_manguan_control; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_pf_control; | |||
import com.bumptech.glide.Glide; | |||
import com.litao.slider.NiftySlider; | |||
import com.orhanobut.logger.Logger; | |||
@@ -171,7 +165,16 @@ public class MakeGoodFragment extends BaseFragment { | |||
RelativeLayout loadgoodliebiao; | |||
private Handler handler = new Handler(Looper.getMainLooper()){ | |||
@Override | |||
public void handleMessage(@NonNull Message msg) { | |||
super.handleMessage(msg); | |||
if(msg.what == 1){ | |||
DataBus.getInstance().loadinggoodAdapter = new loadinggood_adapter(context, myClickListener); | |||
datatab_paiduishangping.setAdapter(DataBus.getInstance().loadinggoodAdapter); | |||
} | |||
} | |||
}; | |||
private Context context; | |||
@@ -309,10 +312,12 @@ public class MakeGoodFragment extends BaseFragment { | |||
// LinearLayoutManager layoutManager = new LinearLayoutManager(context); | |||
// layoutManager.setOrientation(LinearLayoutManager.VERTICAL); | |||
// datatab_paiduishangping.setLayoutManager(layoutManager); | |||
datatab_paiduishangping.setLayoutManager(new WrapContentLinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL,false)); | |||
DataBus.getInstance().loadinggoodAdapter = new loadinggood_adapter(context, myClickListener, getActivity()); | |||
datatab_paiduishangping.setAdapter(DataBus.getInstance().loadinggoodAdapter); | |||
handler.removeMessages(1); | |||
handler.sendEmptyMessageDelayed(1,200); | |||
} | |||
@@ -464,6 +469,8 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
} | |||
}; | |||
datatab_paiduishangping.setLayoutManager(new WrapContentLinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL,false)); | |||
} | |||
@OnClick({R.id.good_gengxin, R.id.cheng_clear, R.id.loadgood}) | |||
@@ -477,6 +484,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
@Override | |||
public void onSuccess() { | |||
ToastUtils.info("清零成功!"); | |||
mHandler.sendEmptyMessage(0); | |||
} | |||
@Override | |||
@@ -504,7 +512,8 @@ public class MakeGoodFragment extends BaseFragment { | |||
case 0: | |||
plc_status.setText(ConfigName.getInstance().PlcIsConnect ? "正常" : "异常"); | |||
plc_status.setTextColor(ConfigName.getInstance().PlcIsConnect ? Color.parseColor("#4CAF50") : Color.parseColor("#D32F2F")); | |||
wendu1.setText(ExecuteTheRecipe.WaterTemp + "°C"); | |||
// wendu1.setText(ExecuteTheRecipe.WaterTemp + "°C"); | |||
MessageLog.ShowInfo("重量 ExecuteTheRecipe.OutletWeigh="+ExecuteTheRecipe.OutletWeigh); | |||
dianzichen.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||
break; | |||
case 1: | |||
@@ -666,11 +675,16 @@ public class MakeGoodFragment extends BaseFragment { | |||
//接收扫码信息 | |||
ExecuteTheRecipe.OnScanTheCodeInformationT = new IRunT<String>() { | |||
@Override | |||
public void Run(String msg) { | |||
public void Run(String msg2) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
String msg = msg2; | |||
if(ConfigName.TEST){ | |||
msg = " |03cb1364-8b85-446a-b00b-d3657de1a19f| | "; | |||
} | |||
if ((msg != null) && (((String) msg).length() > 2) && ((String) msg).contains("|")) { | |||
//拿到扫码数据 | |||
//例如 ORD001|P0003|A001,M002,T001|2 | |||
@@ -712,8 +726,11 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
} catch (Exception ex) { | |||
} | |||
BPA_GOODS good = QueryDB.GetGoodsforeignKeyId(goodid); | |||
ConfigName.getInstance(); | |||
if(ConfigName.TEST){ | |||
good = QueryDB.GetGoodsId(goodid); | |||
} | |||
if (good == null) { | |||
message = "没有查询到该商品!"; | |||
mHandler.sendEmptyMessage(1); | |||
@@ -816,6 +833,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
rv_right.setAdapter(null); | |||
Glide.get(getContext()).clearMemory(); | |||
MessageManager.getInstance().unRegisterMessageReceiver(getActivity()); | |||
} | |||
/** | |||
@@ -75,7 +75,7 @@ public class SheZhifragment extends BaseFragment { | |||
skipToActivity(DzcjyActivity.class); | |||
break; | |||
case R.id.wdsz://温度设置 | |||
skipToActivity(WdszActivity.class); | |||
// skipToActivity(WdszActivity.class); | |||
break; | |||
} | |||
} | |||
@@ -83,7 +83,7 @@ public class DzcjyActivity extends BaseActivity { | |||
String outres = edittext_zl.getText().toString().trim(); | |||
if (!outres.equals("")) { | |||
ExecuteTheRecipe.WritePLC("砝码值", Short.parseShort(outres), new IWriteCallBack() { | |||
ExecuteTheRecipe.WritePLC("砝码值", Short.parseShort(outres)*10, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("砝码值写入",true,null); | |||
@@ -420,9 +420,12 @@ public class GoodPeiFangActivity extends BaseActivity { | |||
@Override | |||
public void onDestroy() { | |||
add_pf.destroy(); | |||
add_good.destroy(); | |||
super.onDestroy(); | |||
rv_right.setAdapter(null); | |||
Glide.get(this).clearMemory(); | |||
MessageManager.getInstance().unRegisterMessageReceiver(this); | |||
} | |||
@Override | |||
@@ -144,7 +144,7 @@ public class SilosNewActivity extends BaseActivity { | |||
} else if (k == 4) { | |||
//校准 | |||
silos_jz.SetData((lcMode) data, activity); | |||
silos_jz.setVisibility(View.VISIBLE); | |||
silos_jz.show(); | |||
} else if (k == 5) { | |||
// | |||
} else if (k == 6) { | |||
@@ -162,7 +162,7 @@ public class SilosNewActivity extends BaseActivity { | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
if (k == 0) { | |||
silos_jz.setVisibility(View.GONE); | |||
silos_jz.close(); | |||
} | |||
} | |||
}; | |||
@@ -228,6 +228,8 @@ public class SilosNewActivity extends BaseActivity { | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
silos_jz.close(); | |||
MessageManager.getInstance().unRegisterMessageReceiver(this); | |||
} | |||
@Override | |||
@@ -469,7 +469,7 @@ public class GoodInformation extends LinearLayout implements MyClickListener { | |||
{ | |||
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids, Data.id); | |||
if (goodsrecipename != null) { | |||
ToastUtils.warning("已有改做法配方,不能在新增了!"); | |||
ToastUtils.warning("已有该做法配方,不能再新增了!"); | |||
return; | |||
} | |||
} | |||
@@ -538,7 +538,7 @@ public class GoodInformation extends LinearLayout implements MyClickListener { | |||
//判断配方是否有相同规格的了 | |||
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids, Data.id); | |||
if (goodsrecipename != null) { | |||
ToastUtils.warning("已有改做法配方,不能在新增了!"); | |||
ToastUtils.warning("已有该做法配方,不能再新增了!"); | |||
return; | |||
} | |||
//新增配方名称 | |||
@@ -114,6 +114,7 @@ public class Silos_item_fragment extends BaseFragment { | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
MessageManager.getInstance().unRegisterMessageReceiver(getActivity()); | |||
} | |||
/** | |||
@@ -207,11 +207,14 @@ public class Silos_item_jiaoyan_fragment extends LinearLayout { | |||
ExecuteTheRecipe.WeighComplete = new IRun() { | |||
@Override | |||
public void Run() { | |||
mHandler.sendEmptyMessage(0); | |||
if (ExecuteTheRecipe.OutletWeigh >= (zl[0] + 2))//当前重量大于2g | |||
{ | |||
mHandler.sendEmptyMessage(1); | |||
if(mHandler!=null){ | |||
mHandler.sendEmptyMessage(0); | |||
if (ExecuteTheRecipe.OutletWeigh >= (zl[0] + 2))//当前重量大于2g | |||
{ | |||
mHandler.sendEmptyMessage(1); | |||
} | |||
} | |||
} | |||
}; | |||
//通道校准完成 | |||
@@ -285,6 +288,17 @@ public class Silos_item_jiaoyan_fragment extends LinearLayout { | |||
}).start(); | |||
} | |||
public void destroy(){ | |||
if(mHandler!=null){ | |||
mHandler = null; | |||
} | |||
if(activity!=null){ | |||
activity = null; | |||
} | |||
ExecuteTheRecipe.OnChargeMixtureComNotPar = null; | |||
ExecuteTheRecipe.WeighComplete = null; | |||
} | |||
//endregion | |||
//region 刷新界面 | |||
@@ -227,6 +227,10 @@ public class add_good_control extends LinearLayout { | |||
}); | |||
} | |||
public void destroy(){ | |||
MessageManager.getInstance().unRegisterMessageReceiver(activity_ma); | |||
} | |||
public String ids=""; | |||
/** | |||
* 数据验证 | |||
@@ -317,6 +317,13 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||
} | |||
} | |||
public void destroy(){ | |||
Activity activity = findActivity(acontext); | |||
if (activity != null) { | |||
MessageManager.getInstance().unRegisterMessageReceiver(activity); | |||
} | |||
} | |||
/** | |||
* 保存数据 | |||
*/ | |||
@@ -439,7 +446,7 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||
{ | |||
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids,Good.id); | |||
if (goodsrecipename != null) { | |||
ToastUtils.warning("已有改做法配方,不能在新增了!"); | |||
ToastUtils.warning("已有该做法配方,不能再新增了!"); | |||
return isSuceess; | |||
} | |||
} | |||
@@ -48,6 +48,7 @@ import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.concurrent.Delayed; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
@@ -347,11 +348,21 @@ public class add_silos_ck extends LinearLayout { | |||
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { | |||
Log.e("鼠标", "按下:2222 "); | |||
ExecuteTheRecipe.WritePLC("清洗模式", true,null); | |||
try { | |||
Thread.sleep(100L);//避免启动的时候还是按时间出料 | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
ExecuteTheRecipe.WritePLC(name, true, null); | |||
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { | |||
Log.e("鼠标", "松开:33333 "); | |||
ExecuteTheRecipe.WritePLC("清洗模式", false,null); | |||
ExecuteTheRecipe.WritePLC(name, false, null); | |||
try { | |||
Thread.sleep(100L);//避免启动的时候还是按时间出料 | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
ExecuteTheRecipe.WritePLC("清洗模式", false,null); | |||
} | |||
return false; | |||
}); | |||
@@ -1,30 +1,18 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.app.Activity; | |||
import android.app.ProgressDialog; | |||
import android.content.Context; | |||
import android.content.DialogInterface; | |||
import android.graphics.Color; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.os.SystemClock; | |||
import android.provider.ContactsContract; | |||
import android.util.AttributeSet; | |||
import android.util.Log; | |||
import android.view.LayoutInflater; | |||
import android.view.MotionEvent; | |||
import android.view.View; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.Chronometer; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.RelativeLayout; | |||
import android.widget.Spinner; | |||
import android.widget.TextView; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.fragment.app.FragmentManager; | |||
@@ -32,38 +20,21 @@ import com.bonait.bnframework.HBL.Dialog.AlertDialogButton; | |||
import com.bonait.bnframework.HBL.Dialog.DialogManager; | |||
import com.bonait.bnframework.HBL.Dialog.WaitDialog; | |||
import com.bonait.bnframework.HBL.Executor; | |||
import com.bonait.bnframework.HBL.Interface.IFunc; | |||
import com.bonait.bnframework.HBL.Trig.TTrig; | |||
import com.bonait.bnframework.HBL.Unity; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.business.PLCName; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.IRun; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.model.mode.ResMenuLeft; | |||
import com.bonait.bnframework.common.helper.MessageLog; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.from.SilosNewActivity; | |||
import com.qmuiteam.qmui.arch.QMUIFragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.tab.QMUIBasicTabSegment; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import com.suke.widget.SwitchButton; | |||
import java.io.Console; | |||
import java.math.BigDecimal; | |||
import java.text.DecimalFormat; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Timer; | |||
import java.util.TimerTask; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
@@ -90,20 +61,23 @@ public class silos_jiaoyan extends LinearLayout { | |||
private View root; | |||
@BindView(R.id.min_time) | |||
EditText min_time; | |||
EditText min_time; | |||
@BindView(R.id.min_weight) | |||
EditText min_weight; | |||
EditText min_weight; | |||
@BindView(R.id.max_time) | |||
EditText max_time; | |||
EditText max_time; | |||
@BindView(R.id.max_weight) | |||
EditText max_weight; | |||
EditText max_weight; | |||
@BindView(R.id.sim_discharge_weight) | |||
EditText sim_discharge_weight; | |||
@BindView(R.id.current_weight) | |||
TextView current_weight; | |||
// @BindView(R.id.controlStatus) | |||
// TextView controlStatus; | |||
//endregion | |||
@@ -169,11 +143,11 @@ public class silos_jiaoyan extends LinearLayout { | |||
if(res!=null){ | |||
min_time.setText(String.valueOf(res.outputTimeMin)); | |||
max_time.setText(String.valueOf(res.outputTimeMax)); | |||
min_weight.setText(String.valueOf(res.inputWightMin)); | |||
max_weight.setText(String.valueOf(res.inputWightMax)); | |||
min_weight.setText(res.inputWightMin+""); | |||
max_weight.setText(res.inputWightMax+""); | |||
}else{ | |||
min_time.setText("2"); | |||
max_time.setText("2"); | |||
max_time.setText("5"); | |||
min_weight.setText("0"); | |||
max_weight.setText("0"); | |||
} | |||
@@ -201,43 +175,36 @@ public class silos_jiaoyan extends LinearLayout { | |||
ExecuteTheRecipe.WeighComplete = new IRun() { | |||
@Override | |||
public void Run() { | |||
mHandler.sendEmptyMessage(0); | |||
if(mHandler!=null){ | |||
mHandler.sendEmptyMessage(0); | |||
} | |||
} | |||
}; | |||
//通道校准完成 | |||
ExecuteTheRecipe.OnChargeMixtureComNotPar = new IRun() { | |||
@Override | |||
public void Run() { | |||
final int kkk = lcMode.num; | |||
try { | |||
if(activity!=null) | |||
{ | |||
activity.runOnUiThread(new Runnable() { | |||
if(mHandler!=null){ | |||
final int kkk = lcMode.num; | |||
try { | |||
mHandler.postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
new Handler().postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
// 在2秒后执行按钮操作 | |||
int zhongliangxianshi = ExecuteTheRecipe.OutletWeigh; | |||
ExecuteTheRecipe.WritePLC("校准值" + kkk, (short) zhongliangxianshi, null); | |||
String s = String.valueOf(zhongliangxianshi); | |||
String zll = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
// 在2秒后执行按钮操作 | |||
int zhongliangxianshi = ExecuteTheRecipe.OutletWeigh; | |||
ExecuteTheRecipe.WritePLC("校准值" + kkk, (short) zhongliangxianshi, null); | |||
String s = String.valueOf(zhongliangxianshi); | |||
String zll = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
// wljz3.setText(zll + ""); | |||
lcMode.jValue = zll; | |||
QueryDB.UpdateJYZ(lcMode.id, zll); | |||
ToastUtils.warning("通道校准完成!"); | |||
} | |||
}, 2000); | |||
} catch (Exception e) { | |||
ToastUtils.error("重量解析显示异常!" + e.getMessage()); | |||
} | |||
lcMode.jValue = zll; | |||
QueryDB.UpdateJYZ(lcMode.id, zll); | |||
ToastUtils.warning("通道校准完成!"); | |||
} | |||
}); | |||
}, 2000); | |||
} catch (Exception e) { | |||
ToastUtils.error("重量解析显示异常!" + e.getMessage()); | |||
} | |||
} catch (Exception ex) { | |||
Log.d("dsds", "Run: " + ex.getMessage()); | |||
} | |||
} | |||
}; | |||
@@ -264,11 +231,48 @@ public class silos_jiaoyan extends LinearLayout { | |||
*/ | |||
private Handler mHandler = new Handler() { | |||
public void handleMessage(Message msg) { | |||
if(msg.what == 1){ | |||
} | |||
} | |||
}; | |||
//endregion | |||
private Timer timer; | |||
private TimerTask timerTask; | |||
public void show(){ | |||
close(); | |||
setVisibility(VISIBLE); | |||
timer = new Timer(); | |||
timerTask = new TimerTask() { | |||
@Override | |||
public void run() { | |||
activity.runOnUiThread(()->{ | |||
float resultWeight = (float) (ExecuteTheRecipe.ReadShort(PLCName.称当前重量)/10.0); | |||
current_weight.setText(resultWeight+"g"); | |||
}); | |||
} | |||
}; | |||
timer.schedule(timerTask,500,500); | |||
} | |||
public void close(){ | |||
setVisibility(GONE); | |||
if(mHandler!=null){ | |||
mHandler.removeCallbacksAndMessages(null); | |||
mHandler = null; | |||
} | |||
ExecuteTheRecipe.WeighComplete = null; | |||
ExecuteTheRecipe.OnChargeMixtureComNotPar = null; | |||
if(timer!=null){ | |||
timer.cancel(); | |||
timer = null; | |||
} | |||
if(timerTask!=null){ | |||
timerTask.cancel(); | |||
timerTask = null; | |||
} | |||
} | |||
private float EditTextValidate(EditText et,String info){ | |||
@@ -297,33 +301,55 @@ public class silos_jiaoyan extends LinearLayout { | |||
if(time<0) return; | |||
DialogManager.showWarn(activity,"校准前请确认是否准备就绪?\r\n是否开始校准?", AlertDialogButton.YesNo,s->{ | |||
if(s){ | |||
WaitDialog.Show("最小校准","开始校准",getContext(),activity); | |||
WaitDialog.getInstance().Show(view.getId()==R.id.min_time?"最小校准":"最大校准","开始校准",getContext(),activity); | |||
Executor.get().runThread(()->{ | |||
WaitDialog.AddText("电子秤清零"); | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
WaitDialog.AddText("等待清零完成"); | |||
WaitDialog.getInstance().AddText("电子秤清零"); | |||
try { | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
Thread.sleep(100); | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
Thread.sleep(100); | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
Thread.sleep(100); | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
WaitDialog.getInstance().AddText("等待清零完成"); | |||
//等待清零完成 | |||
Unity.Wait(()->{return ExecuteTheRecipe.ReadShort(PLCName.当前重量)==0;},3000).OnSource(()->{ | |||
Unity.Wait(()->{ | |||
return ExecuteTheRecipe.ReadShort(PLCName.称当前重量)>-20&&ExecuteTheRecipe.ReadShort(PLCName.称当前重量)<=20;},3000).OnSource(()->{ | |||
WaitDialog.AddText("下发参数,开始校准"); | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"出料时间",time,null);//下发出料时间 | |||
WaitDialog.getInstance().AddText("下发参数,开始校准"); | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"出料时间",((int) time)*100,null);//下发出料时间 | |||
long startTime = System.currentTimeMillis(); | |||
MessageLog.ShowInfo("下发参数,开始校准 当前时间:"+startTime +" 出料时间"+((int) time)*100); | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"启停控制",true,null);//下发启动信号 | |||
WaitDialog.AddText("等待校准完成"); | |||
WaitDialog.getInstance().AddText("等待校准完成"); | |||
String name = lcMode.name+lcMode.num+"启停控制"; | |||
//等待出料完成 | |||
Unity.Wait(()->{return TTrig.get(name).Start(ExecuteTheRecipe.ReadBool(name));},(int)(time+2000)).OnSource(()->{ | |||
Unity.Wait(()->{return TTrig.get(name).Start(ExecuteTheRecipe.ReadBool(name));},(int)(time*1000+2000)).OnSource(()->{ | |||
//获取电子秤重量,并填充到对应位置 | |||
try { | |||
Thread.sleep(500); | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
MessageLog.ShowInfo("下发参数,结束校准 结束时间:"+(System.currentTimeMillis()-startTime) +" 读取启停控制 false"); | |||
activity.runOnUiThread(()->{ | |||
if(view.getId()==R.id.min_time) min_time.setText(ExecuteTheRecipe.ReadShort(PLCName.当前重量)); | |||
else max_time.setText(ExecuteTheRecipe.ReadShort(PLCName.当前重量)); | |||
float weight = (float) (ExecuteTheRecipe.ReadShort(PLCName.称当前重量)/10.0); | |||
MessageLog.ShowInfo("下发参数,结束校准 校准重量:"+weight); | |||
if(view.getId()==R.id.btn_min_standard) min_weight.setText(weight+""); | |||
else max_weight.setText(weight+""); | |||
}); | |||
WaitDialog.getInstance().Dismiss(); | |||
DialogManager.showInfo(activity,"校准完成",AlertDialogButton.OK,null); | |||
}).OnFailed(msg->{WaitDialog.TimeOut("等待校准完成超时,请退出后重试!");}); | |||
}).OnFailed(msg->{WaitDialog.getInstance().TimeOut("等待校准完成超时,请退出后重试!");}); | |||
TTrig.Remove(name); | |||
}).OnFailed((msg)->{WaitDialog.TimeOut("等待清零超时,请退出后重试!");}); | |||
}).OnFailed((msg)->{WaitDialog.getInstance().TimeOut("等待清零超时,请退出后重试!");}); | |||
}); | |||
} | |||
}); | |||
@@ -333,43 +359,63 @@ public class silos_jiaoyan extends LinearLayout { | |||
float minWeight = Float.parseFloat(min_weight.getText().toString()); | |||
float weight = Float.parseFloat(sim_discharge_weight.getText().toString()); | |||
float maxweight = Float.parseFloat(max_weight.getText().toString()); | |||
if(weight<minWeight){ | |||
DialogManager.showError(activity,"模拟出料重量小于最小出料重量,请重新输入模拟出料重量",AlertDialogButton.OK,null); | |||
return; | |||
} | |||
if(weight>maxweight){ | |||
DialogManager.showError(activity,"模拟出料重量大于最大出料重量,请重新输入模拟出料重量",AlertDialogButton.OK,null); | |||
return; | |||
} | |||
// if(weight<minWeight){ | |||
// DialogManager.showError(activity,"模拟出料重量小于最小出料重量,请重新输入模拟出料重量",AlertDialogButton.OK,null); | |||
// return; | |||
// } | |||
// | |||
// if(weight>maxweight){ | |||
// DialogManager.showError(activity,"模拟出料重量大于最大出料重量,请重新输入模拟出料重量",AlertDialogButton.OK,null); | |||
// return; | |||
// } | |||
}catch(Exception e){} | |||
WaitDialog.getInstance().Show("模拟","模拟出料",getContext(),activity); | |||
DialogManager.showWarn(activity,"模拟出料前请将容器放入指定位置!\r\n请问是否继续",AlertDialogButton.YesNo,(s->{ | |||
if(s){ | |||
try{ | |||
float weight = Float.parseFloat(sim_discharge_weight.getText().toString()); | |||
BPA_SILOS_CALIBRATE res = QueryDB.GetSilosCalibrateByNum(lcMode.num); | |||
if(res!=null){ | |||
float outValue = Unity.Scale(weight,res.inputWightMax,res.inputWightMin,res.outputTimeMax,res.outputTimeMin); | |||
WaitDialog.Show("模拟出料","启动模拟出料",getContext(),activity); | |||
Executor.get().runThread(()->{ | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"出料时间",(short)(outValue*100),null);//下发出料时间 | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"启停控制",true,null);//下发启动信号 | |||
WaitDialog.AddText("等待出料完成"); | |||
String name = lcMode.name+lcMode.num+"启停控制"; | |||
Unity.Wait(()->{return TTrig.get(name).Start(ExecuteTheRecipe.ReadBool(name));},(int)(outValue*1000)+2000).OnSource(()->{ | |||
WaitDialog.Dismiss(); | |||
}).OnFailed(msg->{WaitDialog.TimeOut("等待出料完成超时,请退出后重试!");}); | |||
TTrig.Remove(name); | |||
}); | |||
WaitDialog.getInstance().AddText("电子秤清零"); | |||
try { | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
Thread.sleep(100); | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
Thread.sleep(100); | |||
ExecuteTheRecipe.Write(PLCName.重量清零, true, null);//电子秤重量清零 | |||
Thread.sleep(100); | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
WaitDialog.getInstance().AddText("等待清零完成"); | |||
//等待清零完成 | |||
Unity.Wait(()->{ | |||
return ExecuteTheRecipe.ReadShort(PLCName.称当前重量)>-20&&ExecuteTheRecipe.ReadShort(PLCName.称当前重量)<=20;},2000).OnSource(()->{ | |||
float outValue = Unity.Scale(weight,res.inputWightMax,res.inputWightMin,res.outputTimeMax,res.outputTimeMin); | |||
WaitDialog.getInstance().Show("模拟出料","启动模拟出料",getContext(),activity); | |||
Executor.get().runThread(()->{ | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"出料时间",(short)(outValue*100),null);//下发出料时间 | |||
ExecuteTheRecipe.Write(lcMode.name+lcMode.num+"启停控制",true,null);//下发启动信号 | |||
WaitDialog.getInstance().AddText("等待出料完成"); | |||
String name = lcMode.name+lcMode.num+"启停控制"; | |||
try { | |||
Thread.sleep((int)(outValue*1000)+500); | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
WaitDialog.getInstance().Dismiss(); | |||
TTrig.Remove(name); | |||
}); | |||
}).OnFailed((msg)->{WaitDialog.getInstance().TimeOut("等待清零超时,请退出后重试!");}); | |||
}else{ | |||
DialogManager.showWarn(activity,"料仓参数未校准,请校准后再试!",AlertDialogButton.OK,null); | |||
} | |||
}catch(Exception e){ | |||
DialogManager.showError(activity,"模拟出料失败,"+e.getMessage(),AlertDialogButton.OK,null); | |||
} | |||
}else { | |||
WaitDialog.getInstance().Dismiss(); | |||
} | |||
})); | |||
break; | |||
@@ -57,25 +57,25 @@ | |||
android:layout_weight="1" | |||
android:background="@drawable/border"> | |||
<RelativeLayout | |||
android:id="@+id/button_update" | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="1"> | |||
<ImageView | |||
android:id="@+id/button_update" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:src="@mipmap/new_update" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:id="@+id/button_item" | |||
android:layout_width="0dp" | |||
android:layout_height="30dp" | |||
android:layout_height="50dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/border"> | |||
<ImageView | |||
android:layout_centerInParent="true" | |||
android:id="@+id/button_item" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/new_delete"/> | |||
@@ -133,7 +133,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:fontFamily="sans-serif-condensed-medium" | |||
android:text="饮料配方管理" | |||
android:text="配方管理" | |||
android:textColor="@color/white" | |||
android:textSize="26dp" | |||
android:focusable="false"/> | |||
@@ -243,13 +243,24 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue" > | |||
<Button | |||
android:id="@+id/btn_sync" | |||
<FrameLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="20dp" | |||
android:background="@mipmap/yxz" | |||
android:textSize="16sp" | |||
android:layout_centerHorizontal="true"/> | |||
android:layout_height="?attr/qmui_topbar_height"> | |||
<Button | |||
android:id="@+id/btn_sync" | |||
android:layout_width="100dp" | |||
android:layout_height="?attr/qmui_topbar_height" | |||
android:background="#00000000" | |||
android:textSize="16sp" | |||
android:layout_centerHorizontal="true"/> | |||
<ImageView | |||
android:layout_width="wrap_content" | |||
android:layout_height="?attr/qmui_topbar_height" | |||
android:src="@mipmap/yxz" | |||
android:layout_gravity="center" | |||
android:scaleType="fitCenter" | |||
/> | |||
</FrameLayout> | |||
</com.qmuiteam.qmui.widget.QMUITopBarLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -66,13 +66,14 @@ | |||
android:id="@+id/rv_right" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginRight="250dp" | |||
android:orientation="vertical" | |||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_width="200dp" | |||
android:layout_width="250dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<ImageView | |||
@@ -84,7 +85,7 @@ | |||
<RelativeLayout | |||
android:id="@+id/loadgoodliebiao" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="200dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
@@ -147,6 +148,7 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_margin="5dp" | |||
android:text="水箱:" | |||
android:visibility="gone" | |||
android:textSize="@dimen/TitleSize" /> | |||
<TextView | |||
@@ -154,6 +156,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_margin="5dp" | |||
android:visibility="gone" | |||
android:text="89.9°C" | |||
android:textColor="@color/green_primary" | |||
android:textSize="@dimen/TitleSize" /> | |||
@@ -164,6 +167,7 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_margin="5dp" | |||
android:text="称(单击清零):" | |||
android:paddingTop="15dp" | |||
android:textSize="@dimen/TitleSize" /> | |||
<TextView | |||
@@ -78,6 +78,7 @@ | |||
android:layout_height="match_parent" | |||
android:layout_margin="20dp" | |||
android:layout_weight="1" | |||
android:visibility="gone" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
@@ -157,6 +158,14 @@ | |||
android:textSize="26dp" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_margin="20dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical"/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
@@ -11,7 +11,7 @@ | |||
<RelativeLayout | |||
android:layout_centerInParent="true" | |||
android:layout_margin="20dp" | |||
android:layout_width="400dp" | |||
android:layout_width="500dp" | |||
android:layout_height="400dp" | |||
android:background="@drawable/common_bg_with_radius_and_border"> | |||
@@ -22,12 +22,11 @@ | |||
</RelativeLayout> | |||
<Button | |||
android:id="@+id/close_from" | |||
android:layout_width="32dp" | |||
android:layout_height="32dp" | |||
android:layout_width="50dp" | |||
android:layout_height="50dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_alignParentTop="true" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:background="@mipmap/newdelete" | |||
android:textSize="14dp" | |||
android:textColor="@color/white"/> | |||
@@ -139,8 +138,8 @@ | |||
android:orientation="vertical"> | |||
<Button | |||
android:id="@+id/control_switch_shoudong" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:layout_width="120dp" | |||
android:layout_height="70dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/silosbuttonbj" | |||
android:text="出料" | |||
@@ -150,8 +149,8 @@ | |||
<Button | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:id="@+id/control_huishou" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:layout_width="120dp" | |||
android:layout_height="70dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/silosbuttonbj" | |||
android:text="回收" | |||
@@ -211,6 +210,7 @@ | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="满管" | |||
android:visibility="gone" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
@@ -10,7 +10,7 @@ | |||
<RelativeLayout | |||
android:id="@+id/loading_main" | |||
android:layout_width="match_parent" | |||
android:layout_height="70dp"> | |||
android:layout_height="100dp"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
@@ -36,11 +36,12 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="10dp" | |||
android:textSize="16sp" | |||
android:text="01"></TextView> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginRight="60dp" | |||
android:layout_marginRight="100dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
@@ -54,6 +55,7 @@ | |||
android:layout_height="wrap_content" | |||
android:text="金牡丹菠萝奶茶茶饮" | |||
android:textAlignment="center" | |||
android:textSize="16sp" | |||
/> | |||
<TextView | |||
@@ -61,6 +63,7 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="中杯/去冰/无糖" | |||
android:textSize="16sp" | |||
android:textAlignment="center" /> | |||
<TextView | |||
android:visibility="gone" | |||
@@ -73,29 +76,32 @@ | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_width="100dp" | |||
android:gravity="right" | |||
android:layout_alignParentRight="true" | |||
android:layout_height="match_parent"> | |||
<TextView | |||
android:id="@+id/loading_status" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_marginBottom="30dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="center" | |||
android:layout_width="100dp" | |||
android:textSize="16sp" | |||
android:layout_height="50dp" | |||
android:text="制作中"></TextView> | |||
<Button | |||
android:layout_alignParentBottom="true" | |||
android:id="@+id/quxiaozhizuo" | |||
android:layout_width="50dp" | |||
android:layout_height="30dp" | |||
android:layout_width="100dp" | |||
android:layout_height="40dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_marginBottom="5dp" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="取消" | |||
android:textSize="16sp" | |||
android:textColor="@color/white" | |||
android:textSize="14sp"/> | |||
/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_alignParentBottom="true" | |||
@@ -1,13 +1,14 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="220dp" | |||
android:layout_width="205dp" | |||
android:layout_height="180dp"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="5dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
@@ -3,6 +3,7 @@ | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:clickable="true" | |||
android:focusable="true" | |||
android:background="@color/black"> | |||
@@ -26,6 +27,20 @@ | |||
android:text="通道校准" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="60dp" | |||
android:text="当前重量:" | |||
android:textSize="20sp"/> | |||
<TextView | |||
android:id="@+id/current_weight" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
tools:text="实际出料重量:" | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<Button | |||
@@ -45,7 +60,7 @@ | |||
android:id="@+id/title_bc" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginLeft="20dp" | |||
android:layout_marginTop="15dp" | |||
android:text="11 豆瓣酱" | |||
android:textAlignment="center" | |||
@@ -107,7 +122,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="最小出料时间:" | |||
android:textSize="25sp"/> | |||
android:textSize="20sp"/> | |||
<EditText | |||
android:id="@+id/min_time" | |||
@@ -115,26 +130,26 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/edit_bord" | |||
android:digits="0123456789" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="numberDecimal|number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2" | |||
android:textSize="25dp"/> | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginTop="20dp" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="最小出料重量:" | |||
android:textSize="25sp"/> | |||
android:textSize="20sp"/> | |||
<EditText | |||
android:id="@+id/min_weight" | |||
@@ -142,25 +157,25 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/edit_bord" | |||
android:digits="0123456789" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="numberDecimal|number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2" | |||
android:textSize="25dp"/> | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/btn_min_standard" | |||
android:layout_width="match_parent" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginTop="20dp" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="最小校准" | |||
android:textColor="@color/white" | |||
android:textSize="25sp"/> | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -179,7 +194,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="最大出料时间:" | |||
android:textSize="25sp"/> | |||
android:textSize="20sp"/> | |||
<EditText | |||
android:id="@+id/max_time" | |||
@@ -187,26 +202,26 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/edit_bord" | |||
android:digits="0123456789" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="numberDecimal|number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2" | |||
android:textSize="25dp"/> | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginTop="20dp" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="最大出料重量:" | |||
android:textSize="25sp"/> | |||
android:textSize="20sp"/> | |||
<EditText | |||
android:id="@+id/max_weight" | |||
@@ -214,30 +229,46 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/edit_bord" | |||
android:digits="0123456789" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="numberDecimal|number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2" | |||
android:textSize="25dp"/> | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<Button | |||
android:layout_marginTop="30dp" | |||
android:layout_marginTop="20dp" | |||
android:id="@+id/btn_max_standard" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="最大校准" | |||
android:textColor="@color/white" | |||
android:textSize="25sp" /> | |||
android:textSize="20sp" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="650dp" | |||
android:layout_height="1dp" | |||
android:layout_marginTop="20dp" | |||
android:background="@color/gray"/> | |||
<Button | |||
android:layout_marginTop="20dp" | |||
android:id="@+id/btn_save" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="保存参数" | |||
android:textColor="@color/white" | |||
android:textSize="20sp" /> | |||
<View | |||
android:layout_width="650dp" | |||
android:layout_height="1dp" | |||
@@ -247,7 +278,7 @@ | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="30dp" | |||
android:layout_marginTop="20dp" | |||
android:orientation="horizontal"> | |||
<LinearLayout | |||
@@ -258,7 +289,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="模拟出料重量:" | |||
android:textSize="25sp"/> | |||
android:textSize="20sp"/> | |||
<EditText | |||
android:id="@+id/sim_discharge_weight" | |||
@@ -266,13 +297,13 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/edit_bord" | |||
android:digits="0123456789" | |||
android:digits="0123456789." | |||
android:hint="请输入" | |||
android:inputType="number|numberDecimal" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2" | |||
android:textSize="25dp"/> | |||
android:text="10" | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
@@ -284,32 +315,20 @@ | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="模拟出料" | |||
android:textColor="@color/white" | |||
android:textSize="25sp" /> | |||
android:textSize="20sp" /> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="650dp" | |||
android:layout_height="1dp" | |||
android:layout_marginTop="20dp" | |||
android:background="@color/gray"/> | |||
<Button | |||
android:layout_marginTop="30dp" | |||
android:id="@+id/btn_save" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="保存参数" | |||
android:textColor="@color/white" | |||
android:textSize="25sp" /> | |||
<!-- <TextView--> | |||
<!-- android:id="@+id/controlStatus"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="match_parent"--> | |||
<!-- android:text="控制状态:"--> | |||
<!-- android:textSize="20sp"/>--> | |||
<!-- <TextView--> | |||
<!-- android:id="@+id/controlStatus"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="match_parent"--> | |||
<!-- android:text="控制状态:"--> | |||
<!-- android:textSize="20sp"/>--> | |||
</LinearLayout> | |||
@@ -2,6 +2,7 @@ | |||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
android:layout_width="wrap_content" | |||
android:id="@+id/root" | |||
android:layout_height="match_parent"> | |||
@@ -35,8 +35,8 @@ task clean(type: Delete) { | |||
ext { // 统一版本入口 | |||
//App版本号 | |||
versionCode = 1 | |||
versionName = "1.0.0" | |||
versionCode = 12 | |||
versionName = "1.2.0" | |||
// 支持Android版本 | |||
buildToolsVersion = "33.0.0" | |||
@@ -6,7 +6,7 @@ | |||
# http://www.gradle.org/docs/current/userguide/build_environment.html | |||
# Specifies the JVM arguments used for the daemon process. | |||
# The setting is particularly useful for tweaking memory settings. | |||
org.gradle.jvmargs=-Xmx1536m | |||
org.gradle.jvmargs=-Xmx2048m | |||
# When configured, Gradle will run in incubating parallel mode. | |||
# This option should only be used with decoupled projects. More details, visit | |||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | |||