@@ -170,4 +170,10 @@ dependencies { | |||
//gif加载包 | |||
implementation 'com.github.bumptech.glide:glide:4.9.0' | |||
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' | |||
//曲线 | |||
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' | |||
// //sqlite orm 框架 | |||
// implementation 'org.greenrobot:greendao:3.2.2' | |||
} |
@@ -72,6 +72,11 @@ public class ConfigName { | |||
* Db文件路径 | |||
*/ | |||
public static String dbPath = ""; | |||
/** | |||
* 设备过程数据DB文件路径 | |||
*/ | |||
public static String DeviceDataDbPath=""; | |||
//endregion | |||
//region 店铺配置 | |||
@@ -0,0 +1,138 @@ | |||
package com.bonait.bnframework.common.db; | |||
import android.database.sqlite.SQLiteDatabase; | |||
import android.database.sqlite.SQLiteOpenHelper; | |||
import android.util.Log; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.file.Feild; | |||
import com.bonait.bnframework.common.db.file.Table; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import java.io.File; | |||
import java.lang.reflect.Field; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.concurrent.locks.Lock; | |||
import java.util.concurrent.locks.ReentrantLock; | |||
public class DbBase extends SQLiteOpenHelper { | |||
public DbBase(String path) { | |||
super(ConfigName.getInstance().dishesCon, path, null, 4); | |||
filePath = path; | |||
} | |||
private String filePath ; | |||
/** | |||
* 加锁 | |||
*/ | |||
public static Lock lock = new ReentrantLock(); //注意这个地方 | |||
private List<Class> tables = new ArrayList<>(); | |||
public void AddTable(Class table) | |||
{ | |||
tables.add(table); | |||
} | |||
public void Init(){ | |||
File file = new File(filePath); | |||
if(!file.exists())//文件不存在那么创建数据库 | |||
{ | |||
Log.i("日志","初始化数据库:文件不存在准备新建!"); | |||
//1.复制本地文件到SD卡 | |||
// copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); | |||
CreateTables();//2.创建数据库结构 | |||
} | |||
Log.i("日志","初始化数据库目录:"+filePath); | |||
} | |||
@Override | |||
public void onCreate(SQLiteDatabase sqLiteDatabase) { | |||
createTables(sqLiteDatabase, prepareTableInfo()); | |||
} | |||
@Override | |||
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { | |||
} | |||
private ArrayList<Table> prepareTableInfo() { | |||
ArrayList<Table> tables = new ArrayList<Table>(); | |||
Table t; | |||
return tables; | |||
} | |||
/** | |||
* 创建数据表 | |||
* @param db 数据库名称 | |||
* @param tables 所要创建的数据库表列表 | |||
*/ | |||
private void createTables(SQLiteDatabase db, ArrayList<Table> tables) { | |||
db.beginTransaction(); | |||
for (Table table : tables) { | |||
db.execSQL(table.createSQL("")); | |||
} | |||
db.setTransactionSuccessful(); | |||
db.endTransaction(); | |||
} | |||
/** | |||
* 开启外键约束 | |||
*/ | |||
private void ForeignKeys(){ | |||
SQLiteDatabase db =this.getWritableDatabase(); | |||
db.beginTransaction(); | |||
db.execSQL("PRAGMA foreign_keys = 1"); | |||
db.setTransactionSuccessful(); | |||
db.endTransaction(); | |||
} | |||
/** | |||
* 创建数据库表 | |||
*/ | |||
private void CreateTables() | |||
{ | |||
tables.forEach(item->{ | |||
CreateTablesAll(item,null); | |||
}); | |||
// CreateTablesAll(BPA_PRODUCTION_DATA.class,null);//创建过程数据表 | |||
ForeignKeys(); | |||
} | |||
/** | |||
* 创建数据库表 | |||
* @param c | |||
*/ | |||
private void CreateTablesAll(Class c,String premarykey) | |||
{ | |||
if (premarykey == null){ | |||
premarykey=""; | |||
} | |||
SQLiteDatabase db =this.getWritableDatabase(); | |||
db.beginTransaction(); | |||
String TabName= c.getSimpleName();//表名称 | |||
ArrayList<Table> tables = new ArrayList<Table>(); | |||
Table t; | |||
t = new Table(TabName); // 创建表名称 | |||
for (Field field : c.getFields()){ | |||
String name=field.getName(); | |||
String type=field.getType().getSimpleName(); | |||
if(type.equals("String") || type.equals("Date")) | |||
{ | |||
type="text"; | |||
} | |||
t.addFeild(new Feild(name, type)); // 字段名称 | |||
} | |||
tables.add(t); | |||
for (Table table : tables) { | |||
db.execSQL(table.createSQL(premarykey)); | |||
} | |||
db.setTransactionSuccessful(); | |||
db.endTransaction(); | |||
} | |||
} |
@@ -0,0 +1,321 @@ | |||
package com.bonait.bnframework.common.db; | |||
import android.content.ContentValues; | |||
import android.database.Cursor; | |||
import android.database.sqlite.SQLiteDatabase; | |||
import android.util.Log; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.mode.BPA_ALARM_DATA; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import com.bonait.bnframework.common.helper.SdCart; | |||
import com.bonait.bnframework.common.helper.Tools; | |||
import com.google.gson.Gson; | |||
import java.lang.reflect.Field; | |||
import java.text.DecimalFormat; | |||
import java.text.SimpleDateFormat; | |||
import java.util.ArrayList; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Random; | |||
public class DeviceDataDb extends DbBase { | |||
private volatile static DeviceDataDb instance; | |||
public synchronized static DeviceDataDb get() { | |||
if(instance==null){ | |||
String filePath = SdCart.getInstance().getDbPath("hblxiaochaodb","DeviceDataDb.db"); | |||
instance = new DeviceDataDb( filePath); | |||
} | |||
return instance; | |||
} | |||
private DeviceDataDb(String path) { | |||
super(path); | |||
AddTable(BPA_PRODUCTION_DATA.class);//添加过程数据表 | |||
AddTable(BPA_ALARM_DATA.class);//添加报警数据表 | |||
// Init(); | |||
} | |||
//region 过程数据 | |||
private List<BPA_PRODUCTION_DATA> Productions=new ArrayList<BPA_PRODUCTION_DATA>(); | |||
public void ResetProduction(){ | |||
Productions.clear(); | |||
} | |||
public void AddProduction(BPA_PRODUCTION_DATA data) { | |||
if (data == null) return; | |||
Productions.add(data); | |||
} | |||
public void SaveProduction(){ | |||
if(Productions==null||Productions.size()==0) return; | |||
List<BPA_PRODUCTION_DATA> temp=new ArrayList<BPA_PRODUCTION_DATA>(); | |||
BPA_PRODUCTION_DATA tempData = new BPA_PRODUCTION_DATA(); | |||
if(Productions.size()>0){ | |||
tempData.goodName=Productions.get(0).goodName; | |||
tempData.startTime=Productions.get(0).startTime; | |||
} | |||
List<Float> weight=new ArrayList<>(); | |||
List<Float>temperature=new ArrayList<>(); | |||
Productions.forEach(item->{ | |||
weight.add(Float.parseFloat(item.weight)); | |||
temperature.add(Float.parseFloat(item.temperature)); | |||
}); | |||
tempData.weight=new Gson().toJson(weight); | |||
tempData.temperature=new Gson().toJson(temperature); | |||
tempData.endTime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
temp.add(tempData); | |||
BatchAddProduction(temp); | |||
Productions.clear(); | |||
} | |||
public List<BPA_PRODUCTION_DATA> ReadProduction(String startTime, String endTime,String goodName){ | |||
return getProductionData(startTime,endTime,goodName); | |||
} | |||
/** | |||
* 批量新增 | |||
* @param data | |||
* @return | |||
*/ | |||
private boolean BatchAddProduction( List<BPA_PRODUCTION_DATA> data) { | |||
lock.lock(); | |||
boolean isSucess = false; | |||
SQLiteDatabase db = getWritableDatabase(); | |||
try { | |||
ContentValues cv = new ContentValues(); | |||
db.beginTransaction();//使用beginTransaction()方法开始事务操作。 | |||
long result=-1; | |||
for (int i = 0; i < data.size(); i++) { | |||
Map<String, Object> map = Tools.getObjValue(data.get(i)); | |||
for (String key : map.keySet()) { | |||
Object value = map.get(key); | |||
if (value instanceof String) { | |||
cv.put(key, (String) value); | |||
} else if (value instanceof Integer) { | |||
cv.put(key, ((Integer) value).intValue()); | |||
} else if (value instanceof Double) { | |||
cv.put(key, ((Double) value).doubleValue()); | |||
} else if (value instanceof Float) { | |||
cv.put(key, ((Float) value).floatValue()); | |||
} else if (value instanceof Long) { | |||
cv.put(key, ((Long) value).longValue()); | |||
} else if (value instanceof Boolean) { | |||
cv.put(key, ((Boolean) value).booleanValue()); | |||
} | |||
} | |||
result = db.insertOrThrow(BPA_PRODUCTION_DATA.class.getSimpleName(), null, cv); | |||
if (result == -1) { | |||
throw new Exception("Failed to insert data at index " + i); | |||
} | |||
} | |||
db.setTransactionSuccessful();//如果需要提交更改,则使用setTransactionSuccessful()方法标记当前事务已经成功。 | |||
isSucess= result > 0; | |||
} catch (Exception e) { | |||
db.close(); | |||
isSucess= false; | |||
}finally { | |||
db.endTransaction();//结束事务 | |||
db.close();//关闭连接 | |||
lock.unlock(); | |||
} | |||
db.close(); | |||
return isSucess; | |||
} | |||
/** | |||
* 根据条件获取数据 | |||
* @param startTime 开始时间 | |||
* @param endTime 结束时间 | |||
* @param goodName 配方名称 | |||
* @return | |||
*/ | |||
private List<BPA_PRODUCTION_DATA> getProductionData(String startTime, String endTime,String goodName){ | |||
lock.lock(); | |||
List<BPA_PRODUCTION_DATA> res = new ArrayList<>(); | |||
SQLiteDatabase db = getReadableDatabase(); | |||
try { | |||
List<String> col = new ArrayList<>(); | |||
for (Field field : BPA_PRODUCTION_DATA.class.getFields()) { | |||
col.add(field.getName()); | |||
} | |||
String[] columns = (String[]) col.toArray(new String[col.size()]); | |||
String orderby = "startTime";//出料顺序 | |||
String where=""; | |||
String[] args=new String[]{}; | |||
if(!startTime.isEmpty()){ | |||
where+="startTime>=?"; | |||
args=new String[]{startTime}; | |||
} | |||
if (!goodName.isEmpty()) { | |||
where+=" and goodName=?"; | |||
args=new String[]{startTime,endTime,goodName}; | |||
} | |||
if(where.isEmpty()) return new ArrayList<>(); | |||
if(args.length<=0) return new ArrayList<>(); | |||
Cursor cursor = db.query(BPA_PRODUCTION_DATA.class.getSimpleName(), columns, where, args, null,null, orderby, null); | |||
while (cursor.moveToNext()) { | |||
BPA_PRODUCTION_DATA data = new BPA_PRODUCTION_DATA(); | |||
switch (BPA_PRODUCTION_DATA.class.getSimpleName()) { | |||
case "BPA_PRODUCTION_DATA": | |||
((BPA_PRODUCTION_DATA) data).temperature = cursor.getString((int) cursor.getColumnIndex("temperature")); | |||
((BPA_PRODUCTION_DATA) data).weight = cursor.getString((int) cursor.getColumnIndex("weight")); | |||
((BPA_PRODUCTION_DATA) data).goodName = cursor.getString((int) cursor.getColumnIndex("goodName")); | |||
((BPA_PRODUCTION_DATA) data).startTime = cursor.getString((int) cursor.getColumnIndex("startTime")); | |||
((BPA_PRODUCTION_DATA) data).endTime = cursor.getString((int) cursor.getColumnIndex("endTime")); | |||
break; | |||
} | |||
res.add(data); | |||
} | |||
cursor.close(); | |||
db.close(); | |||
} catch (Exception e) { | |||
Log.d("查询异常", "查询异常: " + e.getMessage()); | |||
db.close(); | |||
} finally { | |||
lock.unlock(); | |||
} | |||
return res; | |||
} | |||
//endregion | |||
//region 报警数据 | |||
private List<BPA_ALARM_DATA> Alarms=new ArrayList<BPA_ALARM_DATA>(); | |||
public void AddAlarm(BPA_ALARM_DATA data) { | |||
if (data == null) return; | |||
Alarms.add(data); | |||
} | |||
public void SaveAlarm(){ | |||
if(Alarms==null||Alarms.size()==0) return; | |||
BatchAddAlarm(Alarms); | |||
Alarms.clear(); | |||
} | |||
public List<BPA_ALARM_DATA> ReadAlarm(String startTime, String endTime){ | |||
return getAlarms(startTime,endTime); | |||
} | |||
/** | |||
* 批量新增 | |||
* @param data | |||
* @return | |||
*/ | |||
private boolean BatchAddAlarm( List<BPA_ALARM_DATA> data) { | |||
lock.lock(); | |||
boolean isSucess = false; | |||
SQLiteDatabase db = getWritableDatabase(); | |||
try { | |||
ContentValues cv = new ContentValues(); | |||
db.beginTransaction();//使用beginTransaction()方法开始事务操作。 | |||
long result=-1; | |||
for (int i = 0; i < data.size(); i++) { | |||
Map<String, Object> map = Tools.getObjValue(data.get(i)); | |||
for (String key : map.keySet()) { | |||
Object value = map.get(key); | |||
if (value instanceof String) { | |||
cv.put(key, (String) value); | |||
} else if (value instanceof Integer) { | |||
cv.put(key, ((Integer) value).intValue()); | |||
} else if (value instanceof Double) { | |||
cv.put(key, ((Double) value).doubleValue()); | |||
} else if (value instanceof Float) { | |||
cv.put(key, ((Float) value).floatValue()); | |||
} else if (value instanceof Long) { | |||
cv.put(key, ((Long) value).longValue()); | |||
} else if (value instanceof Boolean) { | |||
cv.put(key, ((Boolean) value).booleanValue()); | |||
} | |||
} | |||
result = db.insertOrThrow(BPA_ALARM_DATA.class.getSimpleName(), null, cv); | |||
if (result == -1) { | |||
throw new Exception("Failed to insert data at index " + i); | |||
} | |||
} | |||
db.setTransactionSuccessful();//如果需要提交更改,则使用setTransactionSuccessful()方法标记当前事务已经成功。 | |||
isSucess= result > 0; | |||
} catch (Exception e) { | |||
db.close(); | |||
isSucess= false; | |||
}finally { | |||
db.endTransaction();//结束事务 | |||
db.close();//关闭连接 | |||
lock.unlock(); | |||
} | |||
db.close(); | |||
return isSucess; | |||
} | |||
/** | |||
* 根据条件获取数据 | |||
* @param startTime 开始时间 | |||
* @param endTime 结束时间 | |||
* @return | |||
*/ | |||
private List<BPA_ALARM_DATA> getAlarms(String startTime, String endTime){ | |||
lock.lock(); | |||
List<BPA_ALARM_DATA> res = new ArrayList<>(); | |||
SQLiteDatabase db = getReadableDatabase(); | |||
try { | |||
List<String> col = new ArrayList<>(); | |||
for (Field field : BPA_ALARM_DATA.class.getFields()) { | |||
col.add(field.getName()); | |||
} | |||
String[] columns = (String[]) col.toArray(new String[col.size()]); | |||
String orderby = "startTime"; | |||
String where=""; | |||
String[] args=new String[]{}; | |||
if(!startTime.isEmpty()){ | |||
where+="startTime>=?"; | |||
args=new String[]{startTime}; | |||
} | |||
if(!endTime.isEmpty()){ | |||
where+=" and endTime<=?"; | |||
args=new String[]{startTime,endTime}; | |||
} | |||
if(where.isEmpty()) return new ArrayList<>(); | |||
if(args.length<=0) return new ArrayList<>(); | |||
Cursor cursor = db.query(BPA_ALARM_DATA.class.getSimpleName(), columns, where, args, null,null, orderby, null); | |||
while (cursor.moveToNext()) { | |||
BPA_ALARM_DATA data = new BPA_ALARM_DATA(); | |||
switch (BPA_PRODUCTION_DATA.class.getSimpleName()) { | |||
case "BPA_PRODUCTION_DATA": | |||
((BPA_ALARM_DATA) data).grade = cursor.getString((int) cursor.getColumnIndex("grade")); | |||
((BPA_ALARM_DATA) data).info = cursor.getString((int) cursor.getColumnIndex("info")); | |||
((BPA_ALARM_DATA) data).value = cursor.getString((int) cursor.getColumnIndex("value")); | |||
((BPA_ALARM_DATA) data).startTime = cursor.getString((int) cursor.getColumnIndex("startTime")); | |||
break; | |||
} | |||
res.add(data); | |||
} | |||
cursor.close(); | |||
db.close(); | |||
} catch (Exception e) { | |||
Log.d("查询异常", "查询异常: " + e.getMessage()); | |||
db.close(); | |||
} finally { | |||
lock.unlock(); | |||
} | |||
return res; | |||
} | |||
//endregion | |||
} |
@@ -26,6 +26,7 @@ import com.bonait.bnframework.common.db.mode.BPA_ORDERLOGDESC; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
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_SUBORDER; | |||
@@ -2418,7 +2419,6 @@ public class QueryDB { | |||
} | |||
//endregion | |||
//region BPA_PLCADDRESS PLC地址管理表 | |||
/** | |||
* 新增工序模型表 | |||
@@ -2505,6 +2505,131 @@ public class QueryDB { | |||
} | |||
//endregion | |||
//region 过程数据表 | |||
/** | |||
* 批量新增 | |||
* @param data | |||
* @return | |||
*/ | |||
public static boolean BatchAddProduction( List<BPA_PRODUCTION_DATA> data) { | |||
lock.lock(); | |||
boolean isSucess = false; | |||
SQLiteDatabase db = helper.getWritableDatabase(); | |||
try { | |||
ContentValues cv = new ContentValues(); | |||
db.beginTransaction();//使用beginTransaction()方法开始事务操作。 | |||
long result=-1; | |||
for (int i = 0; i < data.size(); i++) { | |||
Map<String, Object> map = Tools.getObjValue(data.get(i)); | |||
for (String key : map.keySet()) { | |||
Object value = map.get(key); | |||
if (value instanceof String) { | |||
cv.put(key, (String) value); | |||
} else if (value instanceof Integer) { | |||
cv.put(key, ((Integer) value).intValue()); | |||
} else if (value instanceof Double) { | |||
cv.put(key, ((Double) value).doubleValue()); | |||
} else if (value instanceof Float) { | |||
cv.put(key, ((Float) value).floatValue()); | |||
} else if (value instanceof Long) { | |||
cv.put(key, ((Long) value).longValue()); | |||
} else if (value instanceof Boolean) { | |||
cv.put(key, ((Boolean) value).booleanValue()); | |||
} | |||
} | |||
result = db.insertOrThrow(BPA_PRODUCTION_DATA.class.getSimpleName(), null, cv); | |||
if (result == -1) { | |||
throw new Exception("Failed to insert data at index " + i); | |||
} | |||
} | |||
db.setTransactionSuccessful();//如果需要提交更改,则使用setTransactionSuccessful()方法标记当前事务已经成功。 | |||
isSucess= result > 0; | |||
} catch (Exception e) { | |||
db.close(); | |||
isSucess= false; | |||
}finally { | |||
db.endTransaction();//结束事务 | |||
db.close();//关闭连接 | |||
lock.unlock(); | |||
} | |||
db.close(); | |||
return isSucess; | |||
} | |||
public static List<BPA_PRODUCTION_DATA> getProductionData(String startTime, String endTime,String goodName){ | |||
lock.lock(); | |||
List<BPA_PRODUCTION_DATA> res = new ArrayList<>(); | |||
SQLiteDatabase db = helper.getReadableDatabase(); | |||
try { | |||
List<String> col = new ArrayList<>(); | |||
for (Field field : BPA_PRODUCTION_DATA.class.getFields()) { | |||
col.add(field.getName()); | |||
} | |||
String[] columns = (String[]) col.toArray(new String[col.size()]); | |||
String orderby = "startTime";//出料顺序 | |||
String where=""; | |||
String[] args=new String[]{}; | |||
if(!startTime.isEmpty()){ | |||
where+="startTime>=?"; | |||
args=new String[]{startTime}; | |||
} | |||
// if (!endTime.isEmpty()) { | |||
// where+=" and endTime<=?"; | |||
// args=new String[]{startTime,endTime}; | |||
// } | |||
if (!goodName.isEmpty()) { | |||
where+=" and goodName=?"; | |||
args=new String[]{startTime,endTime,goodName}; | |||
} | |||
if(where.isEmpty()) return new ArrayList<>(); | |||
if(args.length<=0) return new ArrayList<>(); | |||
// String where = "isDelete=? and createTime>=? and createTime<=?"; | |||
// String[] args = new String[]{"0", sta, stp}; | |||
// if (lx >= 0) { | |||
// where = "isDelete=? and createTime>=? and createTime<=? and status=?"; | |||
// args = new String[]{"0", sta, stp, String.valueOf(lx)}; | |||
// } | |||
// String where = "goodName!=?"; | |||
// String[] args = new String[]{""}; | |||
Cursor cursor = db.query(BPA_PRODUCTION_DATA.class.getSimpleName(), columns, where, args, null,null, orderby, null); | |||
while (cursor.moveToNext()) { | |||
BPA_PRODUCTION_DATA data = new BPA_PRODUCTION_DATA(); | |||
switch (BPA_PRODUCTION_DATA.class.getSimpleName()) { | |||
case "BPA_PRODUCTION_DATA": | |||
((BPA_PRODUCTION_DATA) data).temperature = cursor.getString((int) cursor.getColumnIndex("temperature")); | |||
((BPA_PRODUCTION_DATA) data).weight = cursor.getString((int) cursor.getColumnIndex("weight")); | |||
((BPA_PRODUCTION_DATA) data).goodName = cursor.getString((int) cursor.getColumnIndex("goodName")); | |||
((BPA_PRODUCTION_DATA) data).startTime = cursor.getString((int) cursor.getColumnIndex("startTime")); | |||
((BPA_PRODUCTION_DATA) data).endTime = cursor.getString((int) cursor.getColumnIndex("endTime")); | |||
break; | |||
} | |||
res.add(data); | |||
} | |||
cursor.close(); | |||
db.close(); | |||
} catch (Exception e) { | |||
Log.d("查询异常", "查询异常: " + e.getMessage()); | |||
db.close(); | |||
} finally { | |||
lock.unlock(); | |||
} | |||
return res; | |||
} | |||
//endregion | |||
//region 私有 | |||
/** | |||
@@ -22,6 +22,7 @@ import com.bonait.bnframework.common.db.mode.BPA_ORDERLOGDESC; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
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_SUBORDER; | |||
@@ -125,6 +126,8 @@ public class DBHelper extends SQLiteOpenHelper { | |||
CreateTablesAll(BPA_CLOUDDATA.class,null);//云端表 | |||
CreateTablesAll(BPA_PLCADDRESS.class,null);//工序模型表 | |||
CreateTablesAll(BPA_PRODUCTION_DATA.class,null);//创建过程数据表 | |||
ForeignKeys(); | |||
} | |||
/** | |||
@@ -0,0 +1,46 @@ | |||
package com.bonait.bnframework.common.db.mode; | |||
import java.text.SimpleDateFormat; | |||
import java.util.Date; | |||
public class BPA_ALARM_DATA { | |||
/** | |||
* 报警信息 | |||
*/ | |||
public String info; | |||
/** | |||
* 报警值 | |||
*/ | |||
public String value; | |||
/** | |||
* 报警级别 | |||
*/ | |||
public String grade; | |||
/** | |||
* 开始时间 | |||
*/ | |||
public String startTime; | |||
public BPA_ALARM_DATA(){ | |||
startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
} | |||
public BPA_ALARM_DATA(String _info,String _value,String _grade){ | |||
this.startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
this.info = _info; | |||
this.value = _value; | |||
this.grade = _grade; | |||
} | |||
public BPA_ALARM_DATA(String _info,String _value){ | |||
this.startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
this.info = _info; | |||
this.value = _value; | |||
this.grade = "一般报警"; | |||
} | |||
} |
@@ -0,0 +1,54 @@ | |||
package com.bonait.bnframework.common.db.mode; | |||
import java.text.SimpleDateFormat; | |||
import java.util.Date; | |||
/** | |||
* 生产数据 | |||
*/ | |||
public class BPA_PRODUCTION_DATA{ | |||
/** | |||
* 温度 | |||
*/ | |||
public String temperature; | |||
/** | |||
* 重量 | |||
*/ | |||
public String weight; | |||
/** | |||
* 商品名称 | |||
*/ | |||
public String goodName; | |||
/** | |||
* 开始时间 | |||
*/ | |||
public String startTime; | |||
/** | |||
* 结束时间 | |||
*/ | |||
public String endTime; | |||
public BPA_PRODUCTION_DATA(){ | |||
startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
} | |||
public BPA_PRODUCTION_DATA(String _goodName,String _temperature,String _weight){ | |||
startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
this.goodName=_goodName; | |||
this.temperature=_temperature; | |||
this.weight=_weight; | |||
} | |||
public BPA_PRODUCTION_DATA(String _goodName,Float _temperature,Float _weight){ | |||
startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); | |||
this.goodName=_goodName; | |||
this.temperature=_temperature.toString(); | |||
this.weight=_weight.toString(); | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
package com.bonait.bnframework.common.helper; | |||
import android.util.Log; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Random; | |||
public class ProductionHelper { | |||
private volatile static ProductionHelper instance = null; | |||
public static synchronized ProductionHelper get() { | |||
if (instance == null) { // 如果instance还未被实例化则进行实例化 | |||
instance = new ProductionHelper(); | |||
} | |||
return instance; | |||
} | |||
private List<BPA_PRODUCTION_DATA> Productions=new ArrayList<BPA_PRODUCTION_DATA>(); | |||
public void AddProduction(BPA_PRODUCTION_DATA data) { | |||
if (data == null) return; | |||
Productions.add(data); | |||
} | |||
public void Save(){ | |||
if(Productions==null||Productions.size()==0) return; | |||
QueryDB.BatchAddProduction(Productions); | |||
Productions.clear(); | |||
} | |||
public List<BPA_PRODUCTION_DATA> Read(String startTime, String endTime,String goodName){ | |||
return QueryDB.getProductionData(startTime,endTime,goodName); | |||
} | |||
} |
@@ -5,6 +5,7 @@ import android.os.Environment; | |||
import android.util.Log; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.DeviceDataDb; | |||
import com.bonait.bnframework.common.db.file.DBHelper; | |||
import java.io.File; | |||
@@ -28,6 +29,35 @@ public class SdCart { | |||
return mInstance; | |||
} | |||
public String getSdCardPath(){ | |||
File sdDir = null; | |||
boolean sdCardExist = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); | |||
if (sdCardExist) { | |||
sdDir = Environment.getExternalStorageDirectory(); | |||
ConfigName.getInstance().sdCardPath = sdDir.toString(); | |||
} | |||
return ConfigName.getInstance().sdCardPath; | |||
} | |||
public String getSdCardPath(String path){ | |||
File sdDir = null; | |||
boolean sdCardExist = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); | |||
if (sdCardExist) { | |||
sdDir = Environment.getExternalStorageDirectory(); | |||
ConfigName.getInstance().sdCardPath = sdDir.toString(); | |||
ConfigName.getInstance().appResRoot = sdDir.toString()+"/"+path; | |||
} | |||
File rootFile = new File(ConfigName.getInstance().appResRoot); | |||
//如果目录不存在就创建目录 | |||
if (!rootFile.exists()) { | |||
rootFile.mkdirs(); | |||
} | |||
return ConfigName.getInstance().appResRoot; | |||
} | |||
public String getDbPath(String DirPath,String fileName){ | |||
return getSdCardPath(DirPath)+"/"+fileName; | |||
} | |||
//endregion | |||
/** | |||
@@ -41,7 +71,7 @@ public class SdCart { | |||
sdDir = Environment.getExternalStorageDirectory(); | |||
ConfigName.getInstance().sdCardPath = sdDir.toString(); | |||
} | |||
DeviceDataDb.get().Init(); | |||
ConfigName.getInstance().appResRoot = ConfigName.getInstance().sdCardPath + "/hblxiaochaodb"; | |||
ConfigName.getInstance().dbPath = ConfigName.getInstance().appResRoot + "/hbl.db"; | |||
File rootFile = new File(ConfigName.getInstance().appResRoot); | |||
@@ -1,5 +1,11 @@ | |||
package com.bonait.bnframework.common.helper; | |||
public class Singleton<T extends Class> { | |||
// private static readonly | |||
private volatile T instance; | |||
public synchronized T getInstance() { | |||
if (instance == null) { // 如果instance还未被实例化则进行实例化 | |||
// instance = new T(); | |||
} | |||
return instance; | |||
} | |||
} |
@@ -21,6 +21,7 @@ import com.bonait.bnframework.common.utils.NetworkUtils; | |||
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter; | |||
import com.bonait.bnframework.modules.home.fragment.DingDanfragment; | |||
import com.bonait.bnframework.modules.home.fragment.GongnengFragment; | |||
import com.bonait.bnframework.modules.home.fragment.HandControlFragment; | |||
import com.bonait.bnframework.modules.home.fragment.MakeGoodFragment; | |||
import com.bonait.bnframework.modules.home.fragment.SheZhifragment; | |||
import com.bonait.bnframework.modules.mine.fragment.MyFragment; | |||
@@ -50,7 +51,9 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
mNavigateTabBar.onRestoreInstanceState(savedInstanceState); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(R.mipmap.gongneng, R.mipmap.gongneng_selected, "功能")); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(R.mipmap.dingdan, R.mipmap.dingdan_selected, "订单")); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(R.mipmap.dingdan, R.mipmap.dingdan_selected, "手动控制")); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(0, 0, "")); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(R.mipmap.dingdan, R.mipmap.dingdan_selected, "IO监控")); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(R.mipmap.shezhi, R.mipmap.shezhi_selected, "设置")); | |||
mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(R.mipmap.comui_tab_person, R.mipmap.comui_tab_person_selected, "我的")); | |||
mNavigateTabBar.setTabSelectListener(mOnNavigationItemSelectedListener); | |||
@@ -76,7 +79,9 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
fragmentList = new ArrayList<>(); | |||
fragmentList.add(new GongnengFragment()); | |||
fragmentList.add(new DingDanfragment()); | |||
fragmentList.add(new HandControlFragment()); | |||
fragmentList.add(new MakeGoodFragment()); | |||
fragmentList.add(new HandControlFragment()); | |||
fragmentList.add(new SheZhifragment()); | |||
fragmentList.add(new MyFragment()); | |||
ConfigName.getInstance().fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(), fragmentList); | |||
@@ -85,9 +90,9 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
//手指滑动 | |||
viewPager.addOnPageChangeListener(pageChangeListener); | |||
// 设置viewPager缓存多少个fragment | |||
viewPager.setOffscreenPageLimit(5); | |||
viewPager.setOffscreenPageLimit(7); | |||
// 再来一单 | |||
viewPager.setCurrentItem(2); | |||
viewPager.setCurrentItem(3); | |||
viewPager.setSwipeable(false);//禁用页面滑动功能 | |||
} | |||
@@ -157,7 +162,7 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
= new MainNavigateTabBar.OnTabSelectedListener() { | |||
@Override | |||
public void onTabSelected(MainNavigateTabBar.ViewHolder holder) { | |||
int _postion = 2; | |||
int _postion = 3; | |||
switch (holder.tag) { | |||
case "功能": | |||
_postion = 0; | |||
@@ -165,15 +170,22 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||
case "订单": | |||
_postion = 1; | |||
break; | |||
case "设置": | |||
case "手动控制": | |||
_postion = 2; | |||
break; | |||
case "": | |||
_postion = 3; | |||
break; | |||
case "我的": | |||
case "IO监控": | |||
_postion = 4; | |||
break; | |||
case "": | |||
_postion = 2; | |||
case "设置": | |||
_postion = 5; | |||
break; | |||
case "我的": | |||
_postion = 6; | |||
break; | |||
} | |||
viewPager.setCurrentItem(_postion); | |||
} | |||
@@ -7,24 +7,29 @@ import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.TextView; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import com.bonait.bnframework.common.db.res.SuOrderTJ; | |||
import com.bonait.bnframework.common.helper.I.IRunT; | |||
import java.util.List; | |||
public class ddtj_adapter extends ArrayAdapter<SuOrderTJ> { | |||
private List<SuOrderTJ> datas; | |||
public class ddtj_adapter extends ArrayAdapter<BPA_PRODUCTION_DATA> { | |||
private List<BPA_PRODUCTION_DATA> datas; | |||
private Context context; | |||
private int resource; | |||
public ddtj_adapter(@NonNull Context context, int resource, @NonNull List<SuOrderTJ> objects) { | |||
public IRunT<BPA_PRODUCTION_DATA> ButtonClick; | |||
public ddtj_adapter(@NonNull Context context, int resource, @NonNull List<BPA_PRODUCTION_DATA> objects) { | |||
super(context, resource, objects); | |||
this.context = context; | |||
this.resource=resource; | |||
@@ -34,19 +39,23 @@ public class ddtj_adapter extends ArrayAdapter<SuOrderTJ> { | |||
@NonNull | |||
@Override | |||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { | |||
SuOrderTJ order = (SuOrderTJ) getItem(position);//得到当前项选中item实例 | |||
BPA_PRODUCTION_DATA order = (BPA_PRODUCTION_DATA) getItem(position);//得到当前项选中item实例 | |||
//为每一个子项加载设定的布局 | |||
View view = LayoutInflater.from(getContext()).inflate(this.resource, parent, false); | |||
//分别获取 image view 和 textview 的实例 | |||
TextView name,ddzl,ddzl_yzz,ddzl_yc; | |||
TextView name,ddzl,ddzl_yzz; | |||
Button ddzl_yc; | |||
name = (TextView) view.findViewById(R.id.name); | |||
ddzl = (TextView) view.findViewById(R.id.ddzl); | |||
ddzl_yzz = (TextView) view.findViewById(R.id.ddzl_yzz); | |||
ddzl_yc = (TextView) view.findViewById(R.id.ddzl_yc); | |||
name.setText(order.name+""); | |||
ddzl.setText(order.Count+""); | |||
ddzl_yzz.setText(order.Yzz_Count+""); | |||
ddzl_yc.setText(order.Yc_Count+""); | |||
ddzl_yc = (Button) view.findViewById(R.id.ddzl_yc); | |||
name.setText(order.goodName+""); | |||
ddzl.setText(order.startTime+""); | |||
ddzl_yzz.setText(order.endTime+""); | |||
ddzl_yc.setOnClickListener((v)->{ | |||
if(ButtonClick!=null)ButtonClick.Run(order); | |||
}); | |||
// ddzl_yc.setText(order.Yc_Count+""); | |||
return view; | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
@@ -1,32 +1,98 @@ | |||
package com.bonait.bnframework.modules.home.fragment; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.graphics.Color; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
import android.widget.Button; | |||
import android.widget.EditText; | |||
import android.widget.ListView; | |||
import android.widget.TextView; | |||
import com.bigkoo.pickerview.TimePickerView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.db.DeviceDataDb; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import com.bonait.bnframework.common.helper.DateUtils; | |||
import com.bonait.bnframework.common.helper.ProductionHelper; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.ddtj_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.from.OrderListActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SalesStatisticsActivity; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import java.text.SimpleDateFormat; | |||
import java.util.ArrayList; | |||
import java.util.Calendar; | |||
import java.util.Date; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class DingDanfragment extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar;//顶部标题 | |||
/** | |||
* 输入框 | |||
*/ | |||
@BindView(R.id.edittext) | |||
TextView edittext; | |||
/** | |||
* 查询按钮 | |||
*/ | |||
@BindView(R.id.button) | |||
Button button; | |||
/** | |||
* 表格显示 | |||
*/ | |||
@BindView(R.id.datatab) | |||
ListView datatab; | |||
/** | |||
* 子订单数据 | |||
*/ | |||
List<BPA_PRODUCTION_DATA> subOrders = new ArrayList<>(); | |||
/** | |||
* 订单管理控制器 | |||
*/ | |||
ddtj_adapter adapter; | |||
/** | |||
* 日期选择器 | |||
*/ | |||
TimePickerView pvTime; | |||
/** | |||
* 开始时间-结束时间 | |||
*/ | |||
@BindView(R.id.starttime) | |||
EditText starttime; | |||
@BindView(R.id.stoptime) | |||
EditText stoptime; | |||
private Context context; | |||
private ViewGroup view; | |||
public static BPA_PRODUCTION_DATA getProductionData; | |||
public DingDanfragment() { | |||
} | |||
@@ -34,6 +100,10 @@ public class DingDanfragment extends BaseFragment { | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_ding_dan, null); | |||
ButterKnife.bind(this, root); | |||
// view=(ViewGroup)getWindow().getDecorView(); | |||
view=(ViewGroup)getView(); | |||
context = getContext(); | |||
Init(); | |||
return root; | |||
} | |||
@@ -48,23 +118,110 @@ public class DingDanfragment extends BaseFragment { | |||
* 初始化TopBar | |||
*/ | |||
private void initTopBar() { | |||
// mTopBar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.app_color_theme_4)); | |||
mTopBar.setTitle("订单管理"); | |||
mTopBar.setTitle("过程数据"); | |||
} | |||
@OnClick({R.id.ddgl,R.id.xltj}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.ddgl:// | |||
/** | |||
* 初始化 | |||
*/ | |||
private void Init(){ | |||
starttime.setText(new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date())); | |||
stoptime.setText(new SimpleDateFormat("yyyy-MM-dd 23:59:59").format(new Date())); | |||
starttime.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (pvTime != null) { | |||
pvTime.show(starttime); | |||
} | |||
} | |||
}); | |||
stoptime.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (pvTime != null) { | |||
pvTime.show(stoptime); | |||
} | |||
} | |||
}); | |||
CalendarTime(); | |||
// Initdata(); | |||
} | |||
/** | |||
* CalendarTime | |||
* 时间选择器 | |||
*/ | |||
public void CalendarTime() { | |||
//控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) | |||
//因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 | |||
Calendar selectedDate = Calendar.getInstance(); | |||
Calendar startDate = Calendar.getInstance(); | |||
startDate.set(2023, 0, 23); | |||
Calendar endDate = Calendar.getInstance(); | |||
endDate.set(2099, 11, 28); | |||
//时间选择器 | |||
pvTime = new TimePickerView.Builder(context, new TimePickerView.OnTimeSelectListener() { | |||
@Override | |||
public void onTimeSelect(Date date, View v) {//选中事件回调 | |||
// 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null | |||
TextView btn = (TextView) v; | |||
btn.setTextSize(25); | |||
btn.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)); | |||
} | |||
}) | |||
//年月日时分秒 的显示与否,不设置则默认全部显示 | |||
.setType(new boolean[]{true, true, true, true, true, false}) | |||
.setLabel("年", "月", "日", "时", "分", "秒") | |||
.isCenterLabel(true) | |||
.setDividerColor(Color.DKGRAY) | |||
.setContentSize(16)//字号 | |||
.setDate(selectedDate) | |||
.setRangDate(startDate, endDate) | |||
.setDecorView(view) | |||
.build(); | |||
} | |||
/** | |||
* 查询数据 | |||
*/ | |||
public void QueryData() { | |||
try { | |||
subOrders.clear(); | |||
String str= starttime.getText().toString(); | |||
String stop= stoptime.getText().toString(); | |||
if(DateUtils.compareDate(stop,str)) | |||
{ | |||
ToastUtils.warning("开始时间不能大于结束时间!!!"); | |||
return; | |||
} | |||
// subOrders= ProductionHelper.get().Read(str,stop,edittext.getText().toString()); | |||
subOrders= DeviceDataDb.get().ReadProduction(str,stop,edittext.getText().toString()); | |||
if(subOrders.size()<=0){ | |||
ToastUtils.warning("未找到匹配的数据!"); | |||
return; | |||
} | |||
adapter = new ddtj_adapter(context,R.layout.ddtj_item,subOrders); | |||
adapter.ButtonClick=(p)->{ | |||
getProductionData=p; | |||
skipToActivity(OrderListActivity.class); | |||
break; | |||
case R.id.xltj:// | |||
skipToActivity(SalesStatisticsActivity.class); | |||
break; | |||
}; | |||
datatab.setAdapter(adapter); | |||
} catch (Exception e) { | |||
} | |||
} | |||
@OnClick({R.id.button}) | |||
public void onViewClicked(View view) { | |||
QueryData(); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
@@ -0,0 +1,788 @@ | |||
package com.bonait.bnframework.modules.home.fragment; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.graphics.Color; | |||
import android.os.Bundle; | |||
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.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.RadioButton; | |||
import android.widget.RelativeLayout; | |||
import android.widget.Spinner; | |||
import android.widget.TextView; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import androidx.recyclerview.widget.StaggeredGridLayoutManager; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.DeviceDataDb; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import com.bonait.bnframework.common.db.res.StatusMode; | |||
import com.bonait.bnframework.common.helper.AlertDialogButton; | |||
import com.bonait.bnframework.common.helper.Convert; | |||
import com.bonait.bnframework.common.helper.CountDownTimerExt; | |||
import com.bonait.bnframework.common.helper.I.IRun; | |||
import com.bonait.bnframework.common.helper.I.IThread; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.helper.MessageLog; | |||
import com.bonait.bnframework.common.helper.ThreadManager; | |||
import com.bonait.bnframework.common.image.MyBitmapUtils; | |||
import com.bonait.bnframework.common.modbus.s7.CommHelper; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.devicestatus_adapter; | |||
import com.bumptech.glide.Glide; | |||
import com.litao.slider.NiftySlider; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.suke.widget.SwitchButton; | |||
import java.text.DecimalFormat; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Random; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class HandControlFragment extends BaseFragment { | |||
//region 变量 | |||
// @BindView(R.id.topbar) | |||
// QMUITopBarLayout mTopBar;//顶部标题 | |||
// @BindView(R.id.main_weight) | |||
// TextView main_weight; | |||
@BindView(R.id.IgnitionStatus) | |||
TextView IgnitionStatus; | |||
private Context context; | |||
public Activity activity; | |||
//endregion | |||
//region 界面 | |||
public HandControlFragment() { | |||
} | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_hand_control, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
activity = getActivity(); | |||
context = getContext(); | |||
ExecuteTheRecipe.mainContext=context; | |||
ExecuteTheRecipe.mainActivity=activity; | |||
AlertDialogUtils.getContext=context; | |||
NotifyProp(); | |||
Init_弹窗(); | |||
StatusOrMakeGoodThread(); | |||
} | |||
/** | |||
* 更新按钮背景和文本 | |||
* @param id | |||
* @param value | |||
* @param trueText | |||
* @param falseText | |||
*/ | |||
private synchronized void RefreshButton(int id,boolean value,String trueText,String falseText){ | |||
activity.runOnUiThread(()->{ | |||
Button button = activity.findViewById(id); | |||
if(!value){ | |||
button.setText(trueText); | |||
button.setBackgroundResource(R.drawable.bg_btn_false_color); | |||
}else{ | |||
button.setText(falseText); | |||
button.setBackgroundResource(R.drawable.bg_btn_login_selected); | |||
} | |||
}); | |||
} | |||
/** | |||
* 通知属性初始化 | |||
*/ | |||
private void NotifyProp(){ | |||
//系统启停状态更新 | |||
ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_系统启停,s,"启动","停止"); | |||
switch_系统启停.setEnabled(true); | |||
MessageLog.ShowInfo("更新开关状态:"+(s?"true":"false")); | |||
});}; | |||
//超温停气状态更新 | |||
ExecuteTheRecipe.getDeviceData.OverTemperatureShutdownNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_超温停气,s,"启用","禁用"); | |||
switch_超温停气.setEnabled(true); | |||
});}; | |||
//点火模式状态更新 | |||
ExecuteTheRecipe.getDeviceData.IgnideModeNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RB_Hand.setChecked(s?true:false); | |||
if(!s) RB_Auto.setChecked(true); | |||
});}; | |||
//小火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.SmallFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_小火.setValue( s,false); | |||
});}; | |||
//中火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.MediumFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_中火.setValue( s,false); | |||
});}; | |||
//大火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.HighFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_大火.setValue( s,false); | |||
});}; | |||
//强火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.StrongFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_强火.setValue( s,false); | |||
});}; | |||
//搅拌速度更新 | |||
ExecuteTheRecipe.getDeviceData.StirSpeedNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_搅拌频率.setValue( s,false); | |||
});}; | |||
//小火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.SmallFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_小火,s,"打开","关闭"); | |||
switch_小火.setEnabled(true); | |||
});}; | |||
//中火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.MediumFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_中火,s,"打开","关闭"); | |||
switch_中火.setEnabled(true); | |||
});}; | |||
//大火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.HighFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_大火,s,"打开","关闭"); | |||
switch_大火.setEnabled(true); | |||
});}; | |||
//强火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.StrongFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_强火,s,"打开","关闭"); | |||
switch_强火.setEnabled(true); | |||
});}; | |||
//点火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.IgnitionStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_点火控制,s,"点火","关火"); | |||
switch_点火控制.setEnabled(true); | |||
});}; | |||
//温度修正值更新 | |||
ExecuteTheRecipe.getDeviceData.TemperatureCorrectionValueNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_温度修正.setText(s.toString()); | |||
});}; | |||
//炒锅温度上限设置值更新 | |||
ExecuteTheRecipe.getDeviceData.UpperTemperatureLimitNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_温度上限.setText(s.toString()); | |||
});}; | |||
//搅拌控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_搅拌控制,s,"启动搅拌","停止搅拌"); | |||
switch_搅拌控制.setEnabled(true); | |||
});}; | |||
//抽油启停状态更新 | |||
ExecuteTheRecipe.getDeviceData.OilPumpingStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_抽油启停,s,"启动抽油","停止抽油"); | |||
switch_抽油启停.setEnabled(true); | |||
});}; | |||
//备用气缸起停状态更新 | |||
ExecuteTheRecipe.getDeviceData.StandbyCylinderStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RefreshButton(R.id.switch_备用气缸,s,"启动","停止"); | |||
switch_备用气缸.setEnabled(true); | |||
});}; | |||
//设定重量状态更新 | |||
ExecuteTheRecipe.getDeviceData.SetWeightNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_设定重量.setText(s.toString()); | |||
});}; | |||
//提前量状态更新 | |||
ExecuteTheRecipe.getDeviceData.LeadNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_提前量.setText(s.toString()); | |||
});}; | |||
//急停故障 | |||
// ExecuteTheRecipe.getDeviceData.EstopFaultNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// MessageLog.ShowError(s?"急停故障触发":"急停故障复位"); | |||
// });}; | |||
//油泵故障 | |||
// ExecuteTheRecipe.getDeviceData.OilPumpFault.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// MessageLog.ShowError(s?"油泵故障触发":"油泵故障复位"); | |||
// });}; | |||
//搅拌故障 | |||
// ExecuteTheRecipe.getDeviceData.MixingFailure.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// MessageLog.ShowError(s?"搅拌故障触发":"搅拌故障复位"); | |||
// });}; | |||
//点火异常故障 | |||
ExecuteTheRecipe.getDeviceData.IgnitionMalfunction.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
MessageLog.ShowError(s?"点火故障触发":"点火故障复位"); | |||
IgnitionStatus.setText(s?"点火失败":"点火正常"); | |||
});}; | |||
//高温报警故障 | |||
// ExecuteTheRecipe.getDeviceData.HighTemperatureAlarm.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// if(s) ExecuteTheRecipe.SetForcedEnd(); | |||
// MessageLog.ShowError(s?"高温故障触发":"高温故障复位"); | |||
// });}; | |||
//备用故障1 | |||
// ExecuteTheRecipe.getDeviceData.StandbyFailure.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// MessageLog.ShowError(s?"备用故障1触发":"备用故障1复位"); | |||
// });}; | |||
} | |||
//endregion | |||
//region 点击事件处理 | |||
/** | |||
* 点击事件 | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.button_写入参数, R.id.button_出料 , R.id.button_点火复位,R.id.button_重量清零 }) | |||
public void onViewClicked(View view) { | |||
CommHelper.get().siemens. CancelWrite=true; | |||
switch (view.getId()) { | |||
case R.id.button_出料: | |||
if (!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()) { | |||
AlertDialogUtils.showDialog(context, "提示", "系统未启动,请启动后重试!"); | |||
return ; | |||
} | |||
Convert.TryToFloat(edit_设定重量.getText()).OnSource((s)-> | |||
{ | |||
ExecuteTheRecipe.showlog("手动设定出料重量:"+s.Content); | |||
Convert.TryToFloat(edit_提前量.getText()).OnSource((t)-> | |||
{ | |||
ExecuteTheRecipe.showlog("手动设定提前量:"+t.Content); | |||
ExecuteTheRecipe.DischargeControlAsync(s.Content,t.Content); | |||
}).OnFailed(p->{ | |||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||
edit_提前量.setText("0.0"); | |||
}); | |||
}).OnFailed(f->{ | |||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||
edit_设定重量.setText("0.0"); | |||
}); | |||
break; | |||
case R.id.button_点火复位: | |||
ExecuteTheRecipe.showlog("手动操作点火复位开关"); | |||
ExecuteTheRecipe.BottomClickAsync("点火复位开关"); | |||
break; | |||
case R.id.button_写入参数: | |||
Convert.TryToFloat(edit_温度修正.getText()).OnSource((s)-> | |||
{ | |||
ExecuteTheRecipe.showlog("手动设置温度修正值:"+s.Content); | |||
ExecuteTheRecipe.WriteAsync("炒锅温度修正",s.Content); | |||
}).OnFailed(f->{ | |||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||
edit_温度修正.setText("0.0"); | |||
}); | |||
Convert.TryToFloat(edit_温度上限.getText()).OnSource((s)-> | |||
{ | |||
ExecuteTheRecipe.showlog("手动设置温度上限值:"+s.Content); | |||
ExecuteTheRecipe.WriteAsync("炒锅温度上限设置",s.Content); | |||
}).OnFailed(p->{ | |||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||
edit_温度上限.setText("0.0"); | |||
}); | |||
break; | |||
case R.id.button_重量清零: | |||
ExecuteTheRecipe.showlog("手动重量清零"); | |||
ExecuteTheRecipe.BottomClickAsync("重量清零"); | |||
break; | |||
} | |||
} | |||
public void InchingControl(View view,Boolean IsChick) | |||
{ | |||
CommHelper.get().siemens. CancelWrite=true; | |||
switch (view.getId()) { | |||
case R.id.button_搅拌点动: | |||
ExecuteTheRecipe.showlog("手动操作-搅拌点动开关,值:"+IsChick); | |||
ExecuteTheRecipe.WriteAsync("搅拌点动开关", IsChick); | |||
break; | |||
case R.id.button_搅拌上升: | |||
ExecuteTheRecipe.showlog("手动操作-搅拌上升开关,值:"+IsChick); | |||
ExecuteTheRecipe.WriteAsync("搅拌上升", IsChick); | |||
break; | |||
case R.id.button_搅拌下降: | |||
ExecuteTheRecipe.showlog("手动操作-搅拌下降开关,值:"+IsChick); | |||
ExecuteTheRecipe.WriteAsync("搅拌下降", IsChick); | |||
break; | |||
case R.id.button_锅前倾: | |||
ExecuteTheRecipe.showlog("手动操作-锅口向前开关,值:"+IsChick); | |||
ExecuteTheRecipe.WriteAsync("锅口向前", IsChick); | |||
break; | |||
case R.id.button_锅后仰: | |||
ExecuteTheRecipe.showlog("手动操作-锅口向后开关,值:"+IsChick); | |||
ExecuteTheRecipe.WriteAsync("锅口向后", IsChick); | |||
break; | |||
} | |||
} | |||
public View.OnTouchListener touchListener = new View.OnTouchListener() { | |||
@Override | |||
public boolean onTouch(View view, MotionEvent motionEvent) { | |||
if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | |||
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){ | |||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,(s)->{}); | |||
} | |||
return false; | |||
} | |||
boolean IsChick = false; | |||
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { | |||
InchingControl(view,true); | |||
MessageLog.ShowInfo("手指按下"); | |||
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { | |||
InchingControl(view,false); | |||
MessageLog.ShowInfo("手指松开"); | |||
} | |||
else if (motionEvent.getAction() == MotionEvent.ACTION_OUTSIDE){ | |||
MessageLog.ShowInfo("手指离开"); | |||
InchingControl(view,false); | |||
} | |||
return false; | |||
} | |||
}; | |||
//endregion | |||
private CountDownTimerExt countDownTimer = null;//计时器 | |||
//region 私有 | |||
/** | |||
* 设置显示变量 | |||
* | |||
* @param image | |||
* @param val | |||
*/ | |||
public void SetImageViewUrl(ImageView image, boolean val, int index) { | |||
activity.runOnUiThread(()->{ | |||
if (index == 1) { | |||
image.setBackgroundResource( val ? R.drawable.circular_green : R.drawable.circular_gray); | |||
} else { | |||
image.setImageResource(!val ? R.drawable.circular_green : R.drawable.circular_gray); | |||
} | |||
}); | |||
} | |||
//endregion | |||
//region 设备监控状态 | |||
/** | |||
* 设备状态 | |||
*/ | |||
public List<StatusMode> sbzt = new ArrayList<>(); | |||
public devicestatus_adapter adapter_sbzt = null; | |||
/** | |||
* 故障状态 | |||
*/ | |||
public List<StatusMode> gzzt = new ArrayList<>(); | |||
public devicestatus_adapter adapter_gzzt = null; | |||
/** | |||
* 刷新数据 | |||
*/ | |||
public void ReshData() { | |||
adapter_sbzt.refresh(); | |||
adapter_gzzt.refresh(); | |||
} | |||
//endregion | |||
//region 公共函数 | |||
//endregion | |||
//region 状态显示或商品制作线程 | |||
/** | |||
* 线程 | |||
*/ | |||
public void StatusOrMakeGoodThread() { | |||
ExecuteTheRecipe.context = getContext(); | |||
ThreadManager.Get().StartLong("UI刷新任务", true, new IThread() { | |||
@Override | |||
public void Run() throws InterruptedException { | |||
activity.runOnUiThread(()->{ | |||
PanWeight.setText(String.format("%.2f",ExecuteTheRecipe.getDeviceData.CurrentWeight) + " KG");//锅体重量 | |||
CurrentTemp.setText(String.format("%.2f",ExecuteTheRecipe.getDeviceData.CurrentTemperature) + " ℃");//锅体温度 | |||
}); | |||
SetImageViewUrl(image_搅拌上升, ExecuteTheRecipe.getDeviceData.MixingUpperLimit, 1); | |||
SetImageViewUrl(image_搅拌下降, ExecuteTheRecipe.getDeviceData.MixingLowerLimit, 1); | |||
SetImageViewUrl(image_锅后仰, ExecuteTheRecipe.getDeviceData.PostPotLimit, 1); | |||
SetImageViewUrl(image_锅前倾,ExecuteTheRecipe.getDeviceData.PostPotLimit, 0); | |||
Thread.sleep(1000); | |||
} | |||
@Override | |||
public void RunComplete() throws InterruptedException { | |||
} | |||
}); | |||
} | |||
//endregion | |||
//region 弹窗处理 | |||
@BindView(R.id.switch_系统启停) | |||
Button switch_系统启停; | |||
@BindView(R.id.switch_超温停气) | |||
Button switch_超温停气; | |||
@BindView(R.id.switch_搅拌控制) | |||
Button switch_搅拌控制; | |||
@BindView(R.id.switch_抽油启停) | |||
Button switch_抽油启停; | |||
@BindView(R.id.switch_备用气缸) | |||
Button switch_备用气缸; | |||
// @BindView(R.id.editsp_物料) | |||
// Spinner editsp_物料; | |||
// @BindView(R.id.editsp_点火模式) | |||
// Spinner editsp_点火模式; | |||
//点火模式:手动 | |||
@BindView(R.id.RB_Hand) | |||
RadioButton RB_Hand; | |||
//点火模式:自动 | |||
@BindView(R.id.RB_Auto) | |||
RadioButton RB_Auto; | |||
@BindView(R.id.switch_点火控制) | |||
Button switch_点火控制; | |||
@BindView(R.id.button_搅拌点动) | |||
Button button_搅拌点动;//button_搅拌点动 | |||
@BindView(R.id.button_搅拌上升) | |||
Button button_搅拌上升;// | |||
@BindView(R.id.button_搅拌下降) | |||
Button button_搅拌下降;// | |||
@BindView(R.id.button_锅前倾) | |||
Button button_锅前倾;// | |||
@BindView(R.id.button_锅后仰) | |||
Button button_锅后仰;// | |||
@BindView(R.id.image_搅拌上升) | |||
ImageView image_搅拌上升; | |||
@BindView(R.id.image_搅拌下降) | |||
ImageView image_搅拌下降; | |||
@BindView(R.id.image_锅前倾) | |||
ImageView image_锅前倾; | |||
@BindView(R.id.image_锅后仰) | |||
ImageView image_锅后仰; | |||
/** | |||
* 初始化弹窗 | |||
*/ | |||
public void Init_弹窗() { | |||
Init_弹窗_事件(); | |||
Init_弹窗_物料(); | |||
Init_火力(); | |||
} | |||
private void DeviceControl(boolean isChecked,String name){ | |||
if(isChecked&&!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | |||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||
} | |||
ExecuteTheRecipe.showlog("手动操作-"+name+",值:"+isChecked); | |||
ExecuteTheRecipe.WriteAsync(name,isChecked); | |||
} | |||
@OnClick({R.id.switch_系统启停, R.id.switch_超温停气 | |||
, R.id.switch_搅拌控制 | |||
, R.id.switch_抽油启停 | |||
,R.id.switch_备用气缸 | |||
, R.id.switch_点火控制 | |||
, R.id.switch_小火,R.id.switch_中火 | |||
, R.id.switch_大火,R.id.switch_强火 | |||
}) | |||
public void onButtonClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.switch_系统启停: | |||
ExecuteTheRecipe.showlog("手动操作-系统启停开关,值:"+!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()); | |||
ExecuteTheRecipe.WriteAsync("系统启停开关", !ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()); | |||
break; | |||
case R.id.switch_超温停气: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.OverTemperatureShutdownNotify.getValue(),"超温停气开关"); | |||
break; | |||
case R.id.switch_搅拌控制: | |||
boolean temp=!ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.getValue(); | |||
if (temp) { | |||
if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | |||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||
} | |||
ExecuteTheRecipe.showlog("手动启动搅拌"); | |||
ExecuteTheRecipe.BottomClickAsync("搅拌启动开关"); | |||
} else { | |||
ExecuteTheRecipe.showlog("手动停止搅拌"); | |||
ExecuteTheRecipe.BottomClickAsync("搅拌停止开关"); | |||
} | |||
break; | |||
case R.id.switch_抽油启停: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.OilPumpingStatusNotify.getValue(),"料仓1出料"); | |||
break; | |||
case R.id.switch_备用气缸: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.StandbyCylinderStatusNotify.getValue(),"料仓2出料"); | |||
break; | |||
case R.id.switch_点火控制: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.IgnitionStatusNotify.getValue(),"点火启动开关"); | |||
break; | |||
case R.id.switch_小火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.SmallFireStatusNotify.getValue(),"小火开关(一圈)"); | |||
break; | |||
case R.id.switch_中火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.MediumFireStatusNotify.getValue(),"中火开关(二圈)"); | |||
break; | |||
case R.id.switch_大火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.HighFireStatusNotify.getValue(),"大火开关(三圈)"); | |||
break; | |||
case R.id.switch_强火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.StrongFireStatusNotify.getValue(),"强火开关(四圈)"); | |||
break; | |||
} | |||
} | |||
/** | |||
* 初始化弹框中的事件 | |||
*/ | |||
public void Init_弹窗_事件() { | |||
RB_Hand.setOnClickListener((s)->{ | |||
ExecuteTheRecipe.showlog("手动切换为 手动点火"); | |||
ExecuteTheRecipe.WriteAsync("点火手自动切换开关", true); | |||
});//手动点火模式 | |||
RB_Auto.setOnClickListener((s)->{ | |||
ExecuteTheRecipe.showlog("手动切换为 自动点火"); | |||
ExecuteTheRecipe.WriteAsync("点火手自动切换开关", false); | |||
});//自动点火模式 | |||
button_搅拌点动.setOnTouchListener(touchListener); | |||
button_搅拌上升.setOnTouchListener(touchListener); | |||
button_搅拌下降.setOnTouchListener(touchListener); | |||
button_锅前倾.setOnTouchListener(touchListener); | |||
button_锅后仰.setOnTouchListener(touchListener); | |||
} | |||
@BindView(R.id.PanWeight) | |||
TextView PanWeight;//锅体的重量 | |||
@BindView(R.id.CurrentTemp) | |||
TextView CurrentTemp; | |||
@BindView(R.id.edit_设定重量) | |||
EditText edit_设定重量;//设定重量 | |||
@BindView(R.id.edit_提前量) | |||
EditText edit_提前量;//提前量 | |||
public ArrayList<BPA_MATERIAL> materials = new ArrayList<>(); | |||
public List<String> names = new ArrayList<>(); | |||
/** | |||
* 初始化物料 | |||
*/ | |||
public void Init_弹窗_物料() { | |||
materials.clear(); | |||
names.clear(); | |||
List<BPA_MATERIAL> bpa_materials = QueryDB.GetMaterialALL(); | |||
for (BPA_MATERIAL item : bpa_materials) { | |||
materials.add(item); | |||
names.add(item.name); | |||
} | |||
} | |||
@BindView(R.id.edit_温度修正) | |||
EditText edit_温度修正;//edit_温度修正 | |||
@BindView(R.id.edit_温度上限) | |||
EditText edit_温度上限;//edit_温度上限 | |||
@BindView(R.id.slider_小火) | |||
NiftySlider slider_小火; | |||
@BindView(R.id.slider_中火) | |||
NiftySlider slider_中火; | |||
@BindView(R.id.slider_大火) | |||
NiftySlider slider_大火; | |||
@BindView(R.id.slider_强火) | |||
NiftySlider slider_强火; | |||
@BindView(R.id.slider_搅拌频率) | |||
NiftySlider slider_搅拌频率; | |||
@BindView(R.id.switch_小火) | |||
Button switch_小火; | |||
@BindView(R.id.switch_中火) | |||
Button switch_中火; | |||
@BindView(R.id.switch_大火) | |||
Button switch_大火; | |||
@BindView(R.id.switch_强火) | |||
Button switch_强火; | |||
/** | |||
* 初始化火力 | |||
*/ | |||
public void Init_火力() { | |||
slider_小火.setOnValueChangeListener((n,v,b)->{slider_小火.setThumbText((int) v + "");}); | |||
slider_中火.setOnValueChangeListener((n,v,b)->{slider_中火.setThumbText((int) v + "");}); | |||
slider_大火.setOnValueChangeListener((n,v,b)->{slider_大火.setThumbText((int) v + "");}); | |||
slider_强火.setOnValueChangeListener((n,v,b)->{slider_强火.setThumbText((int) v + "");}); | |||
slider_搅拌频率.setOnValueChangeListener((n,v,b)->{slider_搅拌频率.setThumbText((int) v + "");}); | |||
slider_小火.setOnSliderTouchListener(new NiftySlider.OnSliderTouchListener() { | |||
@Override | |||
public void onStartTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
} | |||
@Override | |||
public void onStopTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
int temp = (int) slider_小火.getValue(); | |||
ExecuteTheRecipe.showlog("手动设置-小火比例值:"+temp); | |||
ExecuteTheRecipe.WriteAsync("小火比例阀开度", temp); | |||
ToastUtils.info("小火比例阀开度:" + temp); | |||
} | |||
}); | |||
slider_中火.setOnSliderTouchListener(new NiftySlider.OnSliderTouchListener() { | |||
@Override | |||
public void onStartTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
} | |||
@Override | |||
public void onStopTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
int temp = (int) slider_中火.getValue(); | |||
ExecuteTheRecipe.showlog("手动设置-中火比例值:"+temp); | |||
ExecuteTheRecipe.WriteAsync("中火比例阀开度", temp); | |||
ToastUtils.info("中火比例阀开度:" + temp); | |||
} | |||
}); | |||
slider_大火.setOnSliderTouchListener(new NiftySlider.OnSliderTouchListener() { | |||
@Override | |||
public void onStartTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
} | |||
@Override | |||
public void onStopTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
int temp = (int) slider_大火.getValue(); | |||
ExecuteTheRecipe.showlog("手动设置-大火比例值:"+temp); | |||
ExecuteTheRecipe.WriteAsync("大火比例阀开度", temp); | |||
ToastUtils.info("大火比例阀开度:" + temp); | |||
} | |||
}); | |||
slider_强火.setOnSliderTouchListener(new NiftySlider.OnSliderTouchListener() { | |||
@Override | |||
public void onStartTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
} | |||
@Override | |||
public void onStopTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
int temp = (int) slider_强火.getValue(); | |||
ExecuteTheRecipe.showlog("手动设置-强火比例值:"+temp); | |||
ExecuteTheRecipe.WriteAsync("强火比例阀开度", temp); | |||
ToastUtils.info("强火比例阀开度:" + temp); | |||
} | |||
}); | |||
slider_搅拌频率.setOnSliderTouchListener(new NiftySlider.OnSliderTouchListener() { | |||
@Override | |||
public void onStartTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
} | |||
@Override | |||
public void onStopTrackingTouch(@NonNull NiftySlider niftySlider) { | |||
int temp = (int) slider_搅拌频率.getValue(); | |||
ExecuteTheRecipe.showlog("手动设置-搅拌速度:"+temp); | |||
ExecuteTheRecipe.WriteAsync("搅拌速度", temp); | |||
ToastUtils.info("搅拌速度:" + temp); | |||
} | |||
}); | |||
} | |||
//endregion | |||
} |
@@ -13,6 +13,7 @@ import android.graphics.drawable.Animatable; | |||
import android.graphics.drawable.Drawable; | |||
import android.os.Build; | |||
import android.os.Bundle; | |||
import android.util.Log; | |||
import android.view.LayoutInflater; | |||
import android.view.MotionEvent; | |||
import android.view.View; | |||
@@ -31,10 +32,12 @@ import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.DeviceDataDb; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import com.bonait.bnframework.common.db.res.StatusMode; | |||
import com.bonait.bnframework.common.helper.AlertDialogButton; | |||
import com.bonait.bnframework.common.helper.CountDownTimerExt; | |||
@@ -55,14 +58,18 @@ import com.bonait.bnframework.modules.home.adapter.devicestatus_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity; | |||
import com.bumptech.glide.Glide; | |||
import com.capton.colorfulprogressbar.ColorfulProgressbar; | |||
import com.google.gson.Gson; | |||
import com.litao.slider.NiftySlider; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import com.suke.widget.SwitchButton; | |||
import java.text.DecimalFormat; | |||
import java.util.ArrayList; | |||
import java.util.LinkedList; | |||
import java.util.List; | |||
import java.util.Random; | |||
import java.util.stream.Stream; | |||
import butterknife.BindView; | |||
@@ -127,18 +134,6 @@ public class MakeGoodFragment extends BaseFragment { | |||
@BindView(R.id.IgnitionStatus) | |||
TextView IgnitionStatus; | |||
// @BindView(R.id.btn_xtkz) | |||
// Button button_xtkz; | |||
// @BindView(R.id.btn_hlkz) | |||
// Button button_hlkz; | |||
// @BindView(R.id.btn_sjkz) | |||
// Button button_sjkz; | |||
// @BindView(R.id.btn_jykz) | |||
// Button button_jykz; | |||
/** | |||
* 当前制作商品信息 | |||
*/ | |||
@@ -183,122 +178,142 @@ public class MakeGoodFragment extends BaseFragment { | |||
Init_弹窗(); | |||
} | |||
private synchronized void RefreshButton(int id,boolean value,String trueText,String falseText){ | |||
Button button = activity.findViewById(id); | |||
if(!value){ | |||
button.setText(trueText); | |||
}else{ | |||
button.setText(falseText); | |||
} | |||
} | |||
/** | |||
* 通知属性初始化 | |||
*/ | |||
private void NotifyProp(){ | |||
//系统启停状态更新 | |||
ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_系统启停.setChecked(s); | |||
switch_系统启停.setEnabled(true); | |||
MessageLog.ShowInfo("更新开关状态:"+(s?"true":"false")); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_系统启停.setText(s); | |||
// RefreshButton(R.id.switch_系统启停,s,"启动","停止"); | |||
// switch_系统启停.setEnabled(true); | |||
// MessageLog.ShowInfo("更新开关状态:"+(s?"true":"false")); | |||
// });}; | |||
//超温停气状态更新 | |||
ExecuteTheRecipe.getDeviceData.OverTemperatureShutdownNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_超温停气.setChecked(s); | |||
switch_超温停气.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.OverTemperatureShutdownNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_超温停气.setChecked(s); | |||
// RefreshButton(R.id.switch_超温停气,s,"启用","禁用"); | |||
// switch_超温停气.setEnabled(true); | |||
// });}; | |||
//点火模式状态更新 | |||
ExecuteTheRecipe.getDeviceData.IgnideModeNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
RB_Hand.setChecked(s?true:false); | |||
if(!s) RB_Auto.setChecked(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.IgnideModeNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// RB_Hand.setChecked(s?true:false); | |||
// if(!s) RB_Auto.setChecked(true); | |||
// });}; | |||
//小火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.SmallFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_小火.setValue( s,false); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.SmallFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// slider_小火.setValue( s,false); | |||
// });}; | |||
//中火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.MediumFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_中火.setValue( s,false); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.MediumFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// slider_中火.setValue( s,false); | |||
// });}; | |||
//大火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.HighFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_大火.setValue( s,false); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.HighFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// slider_大火.setValue( s,false); | |||
// });}; | |||
//强火比例阀开度更新 | |||
ExecuteTheRecipe.getDeviceData.StrongFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_强火.setValue( s,false); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.StrongFireProportionNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// slider_强火.setValue( s,false); | |||
// });}; | |||
//搅拌速度更新 | |||
ExecuteTheRecipe.getDeviceData.StirSpeedNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
slider_搅拌频率.setValue( s,false); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.StirSpeedNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// slider_搅拌频率.setValue( s,false); | |||
// });}; | |||
//小火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.SmallFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_小火.setChecked(s); | |||
switch_小火.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.SmallFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_小火.setChecked(s); | |||
// RefreshButton(R.id.switch_小火,s,"打开","关闭"); | |||
// switch_小火.setEnabled(true); | |||
// });}; | |||
//中火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.MediumFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_中火.setChecked(s); | |||
switch_中火.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.MediumFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_中火.setChecked(s); | |||
// RefreshButton(R.id.switch_中火,s,"打开","关闭"); | |||
// switch_中火.setEnabled(true); | |||
// });}; | |||
//大火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.HighFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_大火.setChecked(s); | |||
switch_大火.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.HighFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_大火.setChecked(s); | |||
// RefreshButton(R.id.switch_大火,s,"打开","关闭"); | |||
// switch_大火.setEnabled(true); | |||
// });}; | |||
//强火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.StrongFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_强火.setChecked(s); | |||
switch_强火.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.StrongFireStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_强火.setChecked(s); | |||
// RefreshButton(R.id.switch_强火,s,"打开","关闭"); | |||
// switch_强火.setEnabled(true); | |||
// });}; | |||
//点火控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.IgnitionStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_点火控制.setChecked(s); | |||
switch_点火控制.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.IgnitionStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_点火控制.setChecked(s); | |||
// RefreshButton(R.id.switch_点火控制,s,"点火","关火"); | |||
// switch_点火控制.setEnabled(true); | |||
// });}; | |||
//温度修正值更新 | |||
ExecuteTheRecipe.getDeviceData.TemperatureCorrectionValueNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_温度修正.setText(s.toString()); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.TemperatureCorrectionValueNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// edit_温度修正.setText(s.toString()); | |||
// });}; | |||
//炒锅温度上限设置值更新 | |||
ExecuteTheRecipe.getDeviceData.UpperTemperatureLimitNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_温度上限.setText(s.toString()); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.UpperTemperatureLimitNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// edit_温度上限.setText(s.toString()); | |||
// });}; | |||
//搅拌控制状态更新 | |||
ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_搅拌控制.setChecked(s); | |||
switch_搅拌控制.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_搅拌控制.setChecked(s); | |||
// RefreshButton(R.id.switch_搅拌控制,s,"启动搅拌","停止搅拌"); | |||
// switch_搅拌控制.setEnabled(true); | |||
// });}; | |||
//抽油启停状态更新 | |||
ExecuteTheRecipe.getDeviceData.OilPumpingStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_抽油启停.setChecked(s); | |||
switch_抽油启停.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.OilPumpingStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_抽油启停.setChecked(s); | |||
// RefreshButton(R.id.switch_抽油启停,s,"启动抽油","停止抽油"); | |||
// switch_抽油启停.setEnabled(true); | |||
// });}; | |||
//备用气缸起停状态更新 | |||
ExecuteTheRecipe.getDeviceData.StandbyCylinderStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
switch_备用气缸.setChecked(s); | |||
switch_备用气缸.setEnabled(true); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.StandbyCylinderStatusNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
//// switch_备用气缸.setChecked(s); | |||
// RefreshButton(R.id.switch_备用气缸,s,"启动","停止"); | |||
// switch_备用气缸.setEnabled(true); | |||
// });}; | |||
//设定重量状态更新 | |||
ExecuteTheRecipe.getDeviceData.SetWeightNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_设定重量.setText(s.toString()); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.SetWeightNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// edit_设定重量.setText(s.toString()); | |||
// });}; | |||
//提前量状态更新 | |||
ExecuteTheRecipe.getDeviceData.LeadNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
edit_提前量.setText(s.toString()); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.LeadNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// edit_提前量.setText(s.toString()); | |||
// });}; | |||
//急停故障 | |||
ExecuteTheRecipe.getDeviceData.EstopFaultNotify.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
@@ -316,10 +331,10 @@ public class MakeGoodFragment extends BaseFragment { | |||
});}; | |||
//点火异常故障 | |||
ExecuteTheRecipe.getDeviceData.IgnitionMalfunction.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
MessageLog.ShowError(s?"点火故障触发":"点火故障复位"); | |||
IgnitionStatus.setText(s?"点火失败":"点火正常"); | |||
});}; | |||
// ExecuteTheRecipe.getDeviceData.IgnitionMalfunction.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
// MessageLog.ShowError(s?"点火故障触发":"点火故障复位"); | |||
// IgnitionStatus.setText(s?"点火失败":"点火正常"); | |||
// });}; | |||
//高温报警故障 | |||
ExecuteTheRecipe.getDeviceData.HighTemperatureAlarm.ChangeNotify=(s)->{getActivity().runOnUiThread(()->{ | |||
@@ -377,7 +392,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
* @param view | |||
*/ | |||
@OnClick({R.id.xzcp, R.id.startbutton | |||
, R.id.btn_xtkz | |||
// , R.id.btn_xtkz | |||
// , R.id.btn_hlkz | |||
// , R.id.btn_sjkz, R.id.btn_jykz | |||
, R.id.close_xtkz | |||
@@ -392,7 +407,6 @@ public class MakeGoodFragment extends BaseFragment { | |||
switch (view.getId()) { | |||
case R.id.xzcp://选择菜谱按钮点击 | |||
skipToActivity(CpxzActivity.class); | |||
// ToastUtils.info("打开菜谱选择界面"); | |||
break; | |||
case R.id.btn_xtkz: | |||
SetVisibility(1); | |||
@@ -431,6 +445,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
}); | |||
} | |||
break; | |||
case R.id.button_出料: | |||
@@ -493,64 +508,64 @@ public class MakeGoodFragment extends BaseFragment { | |||
/** | |||
* 开关事件处理 | |||
*/ | |||
public SwitchButton.OnTouchListener TouchListener = new SwitchButton.OnTouchListener() { | |||
@Override | |||
public boolean onTouch(View view, MotionEvent motionEvent) { | |||
if (motionEvent.getAction() == MotionEvent.ACTION_UP) { | |||
CommHelper.get().siemens. CancelWrite=true; | |||
// Delay(300); | |||
switch (view.getId()) { | |||
case R.id.switch_系统启停: | |||
ExecuteTheRecipe.showlog("手动操作-系统启停开关,值:"+!switch_系统启停.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("系统启停开关", !switch_系统启停.isChecked()); | |||
ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.setValue(!switch_系统启停.isChecked()); | |||
break; | |||
case R.id.switch_超温停气: | |||
ExecuteTheRecipe.showlog("手动操作-超温停气开关,值:"+!switch_超温停气.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("超温停气开关",!switch_超温停气.isChecked()); | |||
break; | |||
case R.id.switch_搅拌控制: | |||
if (!switch_搅拌控制.isChecked()) { | |||
ExecuteTheRecipe.showlog("手动启动搅拌"); | |||
ExecuteTheRecipe.BottomClickAsync("搅拌启动开关"); | |||
} else { | |||
ExecuteTheRecipe.showlog("手动停止搅拌"); | |||
ExecuteTheRecipe.BottomClickAsync("搅拌停止开关"); | |||
} | |||
break; | |||
case R.id.switch_抽油启停: | |||
ExecuteTheRecipe.showlog("手动操作-抽油启停开关,值:"+!switch_抽油启停.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("料仓1出料",!switch_抽油启停.isChecked()); | |||
break; | |||
case R.id.switch_备用气缸: | |||
ExecuteTheRecipe.showlog("手动操作-备用气缸开关,值:"+!switch_备用气缸.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("料仓2出料",!switch_备用气缸.isChecked()); | |||
break; | |||
case R.id.switch_点火控制: | |||
ExecuteTheRecipe.showlog("手动操作-点火启动开关,值:"+!switch_点火控制.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("点火启动开关",!switch_点火控制.isChecked()); | |||
break; | |||
case R.id.switch_小火: | |||
ExecuteTheRecipe.showlog("手动操作-小火开关,值:"+!switch_小火.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("小火开关(一圈)", !switch_小火.isChecked()); | |||
break; | |||
case R.id.switch_中火: | |||
ExecuteTheRecipe.showlog("手动操作-中火开关,值:"+!switch_中火.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("中火开关(二圈)", !switch_中火.isChecked()); | |||
break; | |||
case R.id.switch_大火: | |||
ExecuteTheRecipe.showlog("手动操作-大火开关,值:"+!switch_大火.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("大火开关(三圈)", !switch_大火.isChecked()); | |||
break; | |||
case R.id.switch_强火: | |||
ExecuteTheRecipe.showlog("手动操作-强火开关,值:"+!switch_强火.isChecked()); | |||
ExecuteTheRecipe.WriteAsync("强火开关(四圈)", !switch_强火.isChecked()); | |||
break; | |||
} | |||
} | |||
return false; | |||
} | |||
}; | |||
// public SwitchButton.OnTouchListener TouchListener = new SwitchButton.OnTouchListener() { | |||
// @Override | |||
// public boolean onTouch(View view, MotionEvent motionEvent) { | |||
// if (motionEvent.getAction() == MotionEvent.ACTION_UP) { | |||
// CommHelper.get().siemens. CancelWrite=true; | |||
//// Delay(300); | |||
// switch (view.getId()) { | |||
// case R.id.switch_系统启停: | |||
// ExecuteTheRecipe.showlog("手动操作-系统启停开关,值:"+!switch_系统启停.isChecked()); | |||
//// ExecuteTheRecipe.WriteAsync("系统启停开关", !switch_系统启停.isChecked()); | |||
// ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.setValue(!switch_系统启停.isChecked()); | |||
// break; | |||
// case R.id.switch_超温停气: | |||
// ExecuteTheRecipe.showlog("手动操作-超温停气开关,值:"+!switch_超温停气.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("超温停气开关",!switch_超温停气.isChecked()); | |||
// break; | |||
// case R.id.switch_搅拌控制: | |||
// if (!switch_搅拌控制.isChecked()) { | |||
// ExecuteTheRecipe.showlog("手动启动搅拌"); | |||
// ExecuteTheRecipe.BottomClickAsync("搅拌启动开关"); | |||
// } else { | |||
// ExecuteTheRecipe.showlog("手动停止搅拌"); | |||
// ExecuteTheRecipe.BottomClickAsync("搅拌停止开关"); | |||
// } | |||
// break; | |||
// case R.id.switch_抽油启停: | |||
// ExecuteTheRecipe.showlog("手动操作-抽油启停开关,值:"+!switch_抽油启停.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("料仓1出料",!switch_抽油启停.isChecked()); | |||
// break; | |||
// case R.id.switch_备用气缸: | |||
// ExecuteTheRecipe.showlog("手动操作-备用气缸开关,值:"+!switch_备用气缸.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("料仓2出料",!switch_备用气缸.isChecked()); | |||
// break; | |||
// case R.id.switch_点火控制: | |||
// ExecuteTheRecipe.showlog("手动操作-点火启动开关,值:"+!switch_点火控制.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("点火启动开关",!switch_点火控制.isChecked()); | |||
// break; | |||
// case R.id.switch_小火: | |||
// ExecuteTheRecipe.showlog("手动操作-小火开关,值:"+!switch_小火.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("小火开关(一圈)", !switch_小火.isChecked()); | |||
// break; | |||
// case R.id.switch_中火: | |||
// ExecuteTheRecipe.showlog("手动操作-中火开关,值:"+!switch_中火.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("中火开关(二圈)", !switch_中火.isChecked()); | |||
// break; | |||
// case R.id.switch_大火: | |||
// ExecuteTheRecipe.showlog("手动操作-大火开关,值:"+!switch_大火.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("大火开关(三圈)", !switch_大火.isChecked()); | |||
// break; | |||
// case R.id.switch_强火: | |||
// ExecuteTheRecipe.showlog("手动操作-强火开关,值:"+!switch_强火.isChecked()); | |||
// ExecuteTheRecipe.WriteAsync("强火开关(四圈)", !switch_强火.isChecked()); | |||
// break; | |||
// } | |||
// } | |||
// return false; | |||
// } | |||
// }; | |||
public void InchingControl(View view,Boolean IsChick) | |||
{ | |||
@@ -638,10 +653,30 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
countDownTimer.start(); | |||
ExecuteTheRecipe.IsStart.setValue(true); | |||
ProcessDataSave(); | |||
} | |||
}); | |||
} | |||
private void ProcessDataSave(){ | |||
new Thread(()->{ | |||
while ( ExecuteTheRecipe.IsStart.getValue()&&good!=null){ | |||
try { | |||
DeviceDataDb.get().AddProduction(new BPA_PRODUCTION_DATA(good.name,ExecuteTheRecipe.getDeviceData.CurrentTemperature,ExecuteTheRecipe.getDeviceData.CurrentWeight)); | |||
Thread.sleep(1000); | |||
}catch (InterruptedException ex) { | |||
} | |||
} | |||
if(!ExecuteTheRecipe.IsForcedEnd){ | |||
DeviceDataDb.get().SaveProduction(); | |||
}else{ | |||
DeviceDataDb.get().ResetProduction(); | |||
} | |||
}).start(); | |||
} | |||
/** | |||
* 停止 | |||
*/ | |||
@@ -1088,19 +1123,19 @@ public class MakeGoodFragment extends BaseFragment { | |||
//region 弹窗处理 | |||
@BindView(R.id.switch_系统启停) | |||
SwitchButton switch_系统启停; | |||
Button switch_系统启停; | |||
@BindView(R.id.switch_超温停气) | |||
SwitchButton switch_超温停气; | |||
Button switch_超温停气; | |||
@BindView(R.id.switch_搅拌控制) | |||
SwitchButton switch_搅拌控制; | |||
Button switch_搅拌控制; | |||
@BindView(R.id.switch_抽油启停) | |||
SwitchButton switch_抽油启停; | |||
Button switch_抽油启停; | |||
@BindView(R.id.switch_备用气缸) | |||
SwitchButton switch_备用气缸; | |||
Button switch_备用气缸; | |||
// @BindView(R.id.editsp_物料) | |||
// Spinner editsp_物料; | |||
@@ -1117,7 +1152,7 @@ public class MakeGoodFragment extends BaseFragment { | |||
RadioButton RB_Auto; | |||
@BindView(R.id.switch_点火控制) | |||
SwitchButton switch_点火控制; | |||
Button switch_点火控制; | |||
@BindView(R.id.button_搅拌点动) | |||
@@ -1221,21 +1256,89 @@ public class MakeGoodFragment extends BaseFragment { | |||
} | |||
}; | |||
private void DeviceControl(boolean isChecked,String name){ | |||
if(isChecked&&!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | |||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||
} | |||
ExecuteTheRecipe.showlog("手动操作-"+name+",值:"+isChecked); | |||
ExecuteTheRecipe.WriteAsync(name,isChecked); | |||
} | |||
@OnClick({R.id.switch_系统启停, R.id.switch_超温停气 | |||
, R.id.switch_搅拌控制 | |||
, R.id.switch_抽油启停 | |||
,R.id.switch_备用气缸 | |||
, R.id.switch_点火控制 | |||
, R.id.switch_小火,R.id.switch_中火 | |||
, R.id.switch_大火,R.id.switch_强火 | |||
}) | |||
public void onButtonClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.switch_系统启停: | |||
ExecuteTheRecipe.showlog("手动操作-系统启停开关,值:"+!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()); | |||
ExecuteTheRecipe.WriteAsync("系统启停开关", !ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()); | |||
break; | |||
case R.id.switch_超温停气: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.OverTemperatureShutdownNotify.getValue(),"超温停气开关"); | |||
break; | |||
case R.id.switch_搅拌控制: | |||
boolean temp=!ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.getValue(); | |||
if (temp) { | |||
if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | |||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||
} | |||
ExecuteTheRecipe.showlog("手动启动搅拌"); | |||
ExecuteTheRecipe.BottomClickAsync("搅拌启动开关"); | |||
} else { | |||
ExecuteTheRecipe.showlog("手动停止搅拌"); | |||
ExecuteTheRecipe.BottomClickAsync("搅拌停止开关"); | |||
} | |||
break; | |||
case R.id.switch_抽油启停: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.OilPumpingStatusNotify.getValue(),"料仓1出料"); | |||
break; | |||
case R.id.switch_备用气缸: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.StandbyCylinderStatusNotify.getValue(),"料仓2出料"); | |||
break; | |||
case R.id.switch_点火控制: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.IgnitionStatusNotify.getValue(),"点火启动开关"); | |||
break; | |||
case R.id.switch_小火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.SmallFireStatusNotify.getValue(),"小火开关(一圈)"); | |||
break; | |||
case R.id.switch_中火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.MediumFireStatusNotify.getValue(),"中火开关(二圈)"); | |||
break; | |||
case R.id.switch_大火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.HighFireStatusNotify.getValue(),"大火开关(三圈)"); | |||
break; | |||
case R.id.switch_强火: | |||
DeviceControl(!ExecuteTheRecipe.getDeviceData.StrongFireStatusNotify.getValue(),"强火开关(四圈)"); | |||
break; | |||
} | |||
} | |||
/** | |||
* 初始化弹框中的事件 | |||
*/ | |||
public void Init_弹窗_事件() { | |||
switch_系统启停.setOnCheckedChangeListener(SeitchChanged); | |||
switch_超温停气.setOnCheckedChangeListener(SeitchChanged); | |||
switch_搅拌控制.setOnCheckedChangeListener(SeitchChanged); | |||
switch_抽油启停.setOnCheckedChangeListener(SeitchChanged); | |||
switch_备用气缸.setOnCheckedChangeListener(SeitchChanged); | |||
switch_点火控制.setOnCheckedChangeListener(SeitchChanged); | |||
switch_小火.setOnCheckedChangeListener(SeitchChanged); | |||
switch_中火.setOnCheckedChangeListener(SeitchChanged); | |||
switch_大火.setOnCheckedChangeListener(SeitchChanged); | |||
switch_强火.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_系统启停.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_超温停气.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_搅拌控制.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_抽油启停.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_备用气缸.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_点火控制.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_小火.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_中火.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_大火.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_强火.setOnCheckedChangeListener(SeitchChanged); | |||
// switch_系统启停.setOnTouchListener(TouchListener); | |||
@@ -1314,16 +1417,16 @@ public class MakeGoodFragment extends BaseFragment { | |||
NiftySlider slider_搅拌频率; | |||
@BindView(R.id.switch_小火) | |||
SwitchButton switch_小火; | |||
Button switch_小火; | |||
@BindView(R.id.switch_中火) | |||
SwitchButton switch_中火; | |||
Button switch_中火; | |||
@BindView(R.id.switch_大火) | |||
SwitchButton switch_大火; | |||
Button switch_大火; | |||
@BindView(R.id.switch_强火) | |||
SwitchButton switch_强火; | |||
Button switch_强火; | |||
/** | |||
* 初始化火力 | |||
@@ -74,7 +74,7 @@ public class DiyActivity extends BaseActivity { | |||
ImageView cpfm;//菜谱封面 | |||
@BindView(R.id.zzsc) | |||
EditText zzsc;//制作时长 | |||
@BindView(R.id.check) | |||
// @BindView(R.id.check) | |||
CheckBox check;//默认收藏 | |||
List<Drawable> Banner_list = new ArrayList<>(); | |||
@@ -20,17 +20,36 @@ import com.bigkoo.pickerview.TimePickerView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PRODUCTION_DATA; | |||
import com.bonait.bnframework.common.db.res.ResSubOrder; | |||
import com.bonait.bnframework.common.db.res.SuOrderTJ; | |||
import com.bonait.bnframework.common.helper.DateUtils; | |||
import com.bonait.bnframework.common.helper.I.IRunT; | |||
import com.bonait.bnframework.common.helper.ProductionHelper; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.ddgl_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.ddtj_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.DingDanfragment; | |||
import com.github.mikephil.charting.charts.LineChart; | |||
import com.github.mikephil.charting.components.Legend; | |||
import com.github.mikephil.charting.components.XAxis; | |||
import com.github.mikephil.charting.components.YAxis; | |||
import com.github.mikephil.charting.data.Entry; | |||
import com.github.mikephil.charting.data.LineData; | |||
import com.github.mikephil.charting.data.LineDataSet; | |||
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; | |||
import com.github.mikephil.charting.utils.EntryXComparator; | |||
import com.google.gson.Gson; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import java.text.SimpleDateFormat; | |||
import java.util.ArrayList; | |||
import java.util.Calendar; | |||
import java.util.Collections; | |||
import java.util.Date; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
@@ -39,72 +58,26 @@ import butterknife.OnClick; | |||
public class OrderListActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
//region 操作变量 | |||
/** | |||
* 输入框 | |||
*/ | |||
@BindView(R.id.edittext) | |||
TextView edittext; | |||
/** | |||
* 查询按钮 | |||
*/ | |||
@BindView(R.id.button) | |||
Button button; | |||
/** | |||
* 表格显示 | |||
*/ | |||
@BindView(R.id.datatab) | |||
ListView datatab; | |||
/** | |||
* 子订单数据 | |||
*/ | |||
ArrayList<ResSubOrder> subOrders = new ArrayList<>(); | |||
/** | |||
* 订单管理控制器 | |||
*/ | |||
ddgl_adapter adapter; | |||
/** | |||
* 日期选择器 | |||
*/ | |||
TimePickerView pvTime; | |||
/** | |||
* 开始时间-结束时间 | |||
*/ | |||
@BindView(R.id.starttime) | |||
EditText starttime; | |||
@BindView(R.id.stoptime) | |||
EditText stoptime; | |||
@BindView(R.id.chart1) | |||
LineChart chart; | |||
private Context context; | |||
@BindView(R.id.count) | |||
TextView count; | |||
/** | |||
* 日志类型 | |||
*/ | |||
@BindView(R.id.rzlx) | |||
Spinner rzlx; | |||
Map<String,Integer> lx_map = new LinkedHashMap<>(); | |||
//endregion | |||
private Context context;private ViewGroup view; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_order_list); | |||
ButterKnife.bind(this); | |||
view=(ViewGroup)getWindow().getDecorView(); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
Init(); | |||
ChartInit(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("订单列表"); | |||
mTopBar.setTitle(DingDanfragment.getProductionData.goodName+"--趋势图"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
@@ -113,116 +86,116 @@ public class OrderListActivity extends BaseActivity { | |||
}); | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
private void Init(){ | |||
//通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据 | |||
lx_map.put("全部",-1); | |||
lx_map.put("未开始",0); | |||
lx_map.put("制作中",1); | |||
lx_map.put("已制作",2); | |||
lx_map.put("已超时",3); | |||
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(lx_map.keySet())); | |||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
rzlx.setAdapter(adapter2); | |||
starttime.setText(new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(new Date())); | |||
stoptime.setText(new SimpleDateFormat("yyyy-MM-dd 23:59:59").format(new Date())); | |||
starttime.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (pvTime != null) { | |||
pvTime.show(starttime); | |||
} | |||
} | |||
}); | |||
stoptime.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (pvTime != null) { | |||
pvTime.show(stoptime); | |||
} | |||
} | |||
}); | |||
CalendarTime(); | |||
Initdata(); | |||
} | |||
/** | |||
* CalendarTime | |||
* 时间选择器 | |||
*/ | |||
public void CalendarTime() { | |||
//控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) | |||
//因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 | |||
Calendar selectedDate = Calendar.getInstance(); | |||
Calendar startDate = Calendar.getInstance(); | |||
startDate.set(2023, 0, 23); | |||
Calendar endDate = Calendar.getInstance(); | |||
endDate.set(2099, 11, 28); | |||
//时间选择器 | |||
pvTime = new TimePickerView.Builder(context, new TimePickerView.OnTimeSelectListener() { | |||
@Override | |||
public void onTimeSelect(Date date, View v) {//选中事件回调 | |||
// 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null | |||
TextView btn = (TextView) v; | |||
btn.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)); | |||
} | |||
}) | |||
//年月日时分秒 的显示与否,不设置则默认全部显示 | |||
.setType(new boolean[]{true, true, true, true, true, false}) | |||
.setLabel("年", "月", "日", "时", "分", "秒") | |||
.isCenterLabel(true) | |||
.setDividerColor(Color.DKGRAY) | |||
.setContentSize(16)//字号 | |||
.setDate(selectedDate) | |||
.setRangDate(startDate, endDate) | |||
.setDecorView(view) | |||
.build(); | |||
} | |||
private void setData() { | |||
/** | |||
* 初始化数据加载 | |||
*/ | |||
public void Initdata() { | |||
try { | |||
String str= starttime.getText().toString(); | |||
String stop= stoptime.getText().toString(); | |||
if(DateUtils.compareDate(stop,str)) | |||
{ | |||
ToastUtils.warning("开始时间不能大于结束时间!!!"); | |||
return; | |||
} | |||
String lx= rzlx.getSelectedItem().toString(); | |||
String text= edittext.getText().toString(); | |||
subOrders= QueryDB.GetSubOrders(str,stop, lx_map.get(lx),text); | |||
count.setText(subOrders.size()+""); | |||
adapter = new ddgl_adapter(context,R.layout.ddgl_item,subOrders); | |||
datatab.setAdapter(adapter); | |||
} catch (Exception e) { | |||
BPA_PRODUCTION_DATA pd = DingDanfragment.getProductionData; | |||
} | |||
} | |||
//endregion | |||
Float[] weight = new Gson().fromJson(pd.weight,Float[].class); | |||
Float[] temperature = new Gson().fromJson(pd.temperature,Float[].class); | |||
//region 点击事件 | |||
if(weight.length==temperature.length&&temperature.length>0) { | |||
List<Entry> temperatures = new ArrayList<>(); | |||
List<Entry> weights = new ArrayList<>(); | |||
for (int i = 0; i < temperature.length; i++) { | |||
temperatures.add(new Entry(i,temperature[i])); | |||
weights.add(new Entry(i,weight[i])); | |||
} | |||
@OnClick({R.id.button}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.button://查询按钮 | |||
Initdata(); | |||
break; | |||
//温度曲线设置 | |||
LineDataSet temperatureSet = new LineDataSet(temperatures, "温度"); | |||
temperatureSet.setAxisDependency(YAxis.AxisDependency.LEFT); | |||
temperatureSet.setColor(Color.argb(255,89, 194, 172)); | |||
temperatureSet.setDrawCircles(false);//是否绘制圆点 | |||
temperatureSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER); | |||
temperatureSet.setValueTextSize(20); | |||
// Collections.sort(temperatureSet, new EntryXComparator());//通过x坐标值排序 | |||
//重量曲线设置 | |||
LineDataSet weightSet = new LineDataSet(weights, "重量"); | |||
weightSet.setAxisDependency(YAxis.AxisDependency.LEFT); | |||
weightSet.setDrawCircles(false); | |||
weightSet.setColor(Color.argb(255,159, 203, 2)); | |||
weightSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER); | |||
weightSet.setValueTextSize(20); | |||
//将所有曲线添加到集合 | |||
List<ILineDataSet> dataSets = new ArrayList<>(); | |||
dataSets.add(temperatureSet); | |||
dataSets.add(weightSet); | |||
LineData lineData = new LineData(dataSets); | |||
chart.setData(lineData); | |||
chart.invalidate(); //刷新绘图 | |||
} | |||
} | |||
//endregion | |||
/** | |||
* viewPager里添加fragment | |||
* 折线图初始化 | |||
*/ | |||
private void initFragment() { | |||
private void ChartInit(){ | |||
chart.clear(); | |||
//chart.setOnChartValueSelectedListener(this); //点击监听 | |||
chart.setDrawGridBackground(false);//绘制网格线 | |||
chart.getDescription().setEnabled(false); //描述文本 | |||
chart.setTouchEnabled(true);//是否可以触摸 | |||
//启用缩放和拖动 | |||
chart.setDragEnabled(true); | |||
chart.setScaleEnabled(true); | |||
chart.setPinchZoom(true);// 如果禁用,可以分别在x轴和y轴上进行缩放 | |||
chart.setExtraOffsets(0,10,10,20);//设置要附加到自动计算的偏移的额外偏移(围绕图表视图)。 | |||
chart.setBackgroundColor(Color.argb(255,250, 250, 250)); //设置背景色 | |||
// chart.setBackgroundColor(Color.argb(255,23, 23, 39)); | |||
//创建自定义MarkerView(扩展MarkerView)并指定布局 | |||
//MyMarkerView mv = new MyMarkerView(this, R.layout.custom_marker_view); | |||
//mv.setChartView(chart); // For bounds control | |||
//chart.setMarker(mv); // Set the marker to the chart | |||
//图例设置 | |||
Legend legend=chart.getLegend(); | |||
legend.setOrientation(Legend.LegendOrientation.HORIZONTAL);//设置图例的方向 | |||
legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);//设置图例的水平对齐方式 | |||
legend.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);//设置图例的垂直对齐方式 | |||
legend.setTextSize(20); | |||
//配置x坐标数据 | |||
XAxis xl = chart.getXAxis(); | |||
xl.setAvoidFirstLastClipping(true); | |||
xl.setAxisMinimum(0f); | |||
xl.setTextSize(20); | |||
xl.setDrawAxisLine(true);//绘制X轴旁边的线 | |||
xl.setDrawGridLines(false);//将此设置为true可启用绘制此轴的轴线。 | |||
xl.setPosition(XAxis.XAxisPosition.BOTTOM);//设置X轴标签在底部显示 | |||
//配置y坐标左边数据 | |||
YAxis leftAxis = chart.getAxisLeft(); | |||
leftAxis.setInverted(false); | |||
leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true) | |||
leftAxis.setTextSize(20); | |||
leftAxis.setDrawGridLines(false);//将此设置为true可启用绘制此轴的轴线。 | |||
//关闭y坐标右边数据 | |||
YAxis rightAxis = chart.getAxisRight(); | |||
rightAxis.setEnabled(false); | |||
//抑制最大比例因子 | |||
// chart.setScaleMinima(3f, 3f); | |||
//将视图居中到图表中的特定位置 | |||
// chart.centerViewPort(10, 50); | |||
//图例 | |||
Legend l = chart.getLegend(); | |||
//修改图例 | |||
l.setForm(Legend.LegendForm.LINE); | |||
setData(); | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
@@ -200,7 +200,7 @@ public class SalesStatisticsActivity extends BaseActivity { | |||
} | |||
adapter = new ddtj_adapter(context,R.layout.ddtj_item,subOrdersStatic); | |||
// adapter = new ddtj_adapter(context,R.layout.ddtj_item,subOrdersStatic); | |||
datatab.setAdapter(adapter); | |||
} catch (Exception e) { | |||
@@ -42,7 +42,7 @@ public class SystemParameterActivity extends BaseActivity { | |||
EditText edittext3; | |||
@BindView(R.id.edittext4) | |||
EditText edittext4; | |||
@BindView(R.id.environment) | |||
// @BindView(R.id.environment) | |||
Spinner environment; | |||
@BindView(R.id.versionselection) | |||
@@ -0,0 +1,27 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:color="#7FEF5362" | |||
android:radius="-1dp"> | |||
<item android:state_pressed="true"> | |||
<shape> | |||
<solid android:color="@color/app_color_blue" /> | |||
<corners android:radius="6dp" /> | |||
</shape> | |||
</item> | |||
<item android:state_enabled="false"> | |||
<shape> | |||
<solid android:color="#cccccc" /> | |||
<corners android:radius="6dp" /> | |||
</shape> | |||
</item> | |||
<item> | |||
<shape> | |||
<solid android:color="#336287" /> | |||
<corners android:radius="6dp" /> | |||
</shape> | |||
</item> | |||
</ripple> |
@@ -8,7 +8,7 @@ | |||
<!-- 边框的颜色和粗细 --> | |||
<stroke | |||
android:width="1px" | |||
android:width="2px" | |||
android:color="@color/app_color_blue"/> | |||
<!-- android:radius 圆角的半径 --> | |||
@@ -27,8 +27,9 @@ | |||
android:layout_alignParentBottom="true" | |||
android:background="@android:color/white" | |||
app:containerId="@+id/viewpager" | |||
app:navigateTabSelectedTextColor="@color/comui_tab_text_color" | |||
app:navigateTabTextColor="@color/comui_tab_text_color" /> | |||
app:navigateTabSelectedTextColor="@color/black" | |||
app:navigateTabTextSize="20sp" | |||
app:navigateTabTextColor="@color/black" /> | |||
<ImageView | |||
@@ -59,21 +60,22 @@ | |||
android:layout_width="43dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginLeft="10dp" | |||
android:text="再" | |||
android:text="主页" | |||
android:textColor="@color/white" | |||
android:textSize="36dp" | |||
android:textStyle="bold|italic" /> | |||
<TextView | |||
android:clickable="false" | |||
android:layout_width="17dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="52dp" | |||
android:text="来\n一\n锅" | |||
android:textColor="@color/white" | |||
android:textSize="12dp" | |||
android:textStyle="bold|italic" /> | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<!-- <TextView--> | |||
<!-- android:clickable="false"--> | |||
<!-- android:layout_width="17dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_centerVertical="true"--> | |||
<!-- android:layout_marginLeft="52dp"--> | |||
<!-- android:text="来\n一\n锅"--> | |||
<!-- android:textColor="@color/white"--> | |||
<!-- android:textSize="12dp"--> | |||
<!-- android:textStyle="bold|italic" />--> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -56,7 +56,8 @@ | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="菜谱封面" | |||
android:text="配方封面" | |||
android:textSize="@dimen/textSize" | |||
android:textAlignment="center" /> | |||
</LinearLayout> | |||
@@ -76,7 +77,8 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:text="菜谱名称:" /> | |||
android:textSize="@dimen/textSize" | |||
android:text="配方名称:" /> | |||
<!--账号输入框--> | |||
<EditText | |||
android:id="@+id/edittext" | |||
@@ -85,11 +87,11 @@ | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:hint="请输入菜谱名称" | |||
android:hint="请输入配方名称" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -101,11 +103,13 @@ | |||
android:layout_width="wrap_content" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:layout_height="wrap_content" | |||
android:textSize="@dimen/textSize" | |||
android:text="制作时长:" /> | |||
<!--账号输入框--> | |||
<EditText | |||
android:id="@+id/zzsc" | |||
android:layout_width="match_parent" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
@@ -115,22 +119,31 @@ | |||
android:padding="3dp" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:text="0" | |||
android:textSize="12sp" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
android:textSize="@dimen/textSize" /> | |||
<CheckBox | |||
android:id="@+id/check" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="70dp" | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="50dp" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color" | |||
android:text="默认收藏" /> | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="秒" /> | |||
</LinearLayout> | |||
<!-- <LinearLayout--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="wrap_content">--> | |||
<!-- <CheckBox--> | |||
<!-- android:id="@+id/check"--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="70dp"--> | |||
<!-- tools:ignore="TouchTargetSizeCheck"--> | |||
<!-- android:buttonTint="@color/radiusImageView_selected_mask_color"--> | |||
<!-- android:text="默认收藏" />--> | |||
<!-- </LinearLayout>--> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<!--边框分割细线--> | |||
@@ -164,28 +177,29 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:textSize="@dimen/textSize" | |||
android:text="步骤:" /> | |||
<Button | |||
android:id="@+id/shangyi" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:layout_width="80dp" | |||
android:layout_height="40dp" | |||
android:background="@drawable/button" | |||
android:text="上移" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:textColor="@color/black" | |||
android:textSize="14sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/xiayi" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:layout_width="80dp" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:background="@drawable/button" | |||
android:text="下移" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:textColor="@color/black" | |||
android:textSize="14sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<ListView | |||
@@ -233,14 +247,15 @@ | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="烹饪工序:" /> | |||
android:textSize="@dimen/textSize" | |||
android:text="配方工序:" /> | |||
<Spinner | |||
android:id="@+id/hrgx" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="match_parent" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:layout_height="24dp" | |||
android:layout_height="match_parent" | |||
android:layout_centerVertical="true" /> | |||
</LinearLayout> | |||
@@ -268,35 +283,35 @@ | |||
<Button | |||
android:id="@+id/add_hrgx" | |||
android:layout_width="80dp" | |||
android:layout_height="30dp" | |||
android:layout_width="100dp" | |||
android:layout_height="40dp" | |||
android:background="@drawable/button1" | |||
android:text="添加" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:textColor="@color/black" | |||
android:textSize="14sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/update_gx" | |||
android:layout_width="80dp" | |||
android:layout_height="30dp" | |||
android:layout_width="100dp" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:background="@drawable/button" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:text="修改" | |||
android:textColor="@color/black" | |||
android:textSize="14sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/delete_gx" | |||
android:layout_width="80dp" | |||
android:layout_height="30dp" | |||
android:layout_width="100dp" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:background="@drawable/button" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:text="删除" | |||
android:textColor="@color/black" | |||
android:textSize="14sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -316,7 +331,7 @@ | |||
android:text="生成菜谱" | |||
tools:ignore="TouchTargetSizeCheck" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</ScrollView> | |||
@@ -42,7 +42,7 @@ | |||
android:layout_centerVertical="true" | |||
android:textColor="@color/amber_primary_dark" | |||
android:text="(温馨提示:点击行可修改内容.)" | |||
android:textSize="12dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
@@ -58,15 +58,15 @@ | |||
<Button | |||
android:id="@+id/add_wl" | |||
android:layout_width="100dp" | |||
android:layout_height="26dp" | |||
android:layout_width="180dp" | |||
android:layout_height="40dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="+增加物料" | |||
android:textColor="@color/white" | |||
android:textSize="14dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/synchronous" | |||
android:layout_width="100dp" | |||
@@ -127,6 +127,7 @@ | |||
android:text="物料名称" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textSize="@dimen/textSize" | |||
android:textColor="@color/white"/> | |||
</RelativeLayout> | |||
@@ -154,6 +155,7 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="用户操作" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
@@ -25,7 +25,7 @@ | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="30dp"> | |||
android:layout_height="40dp"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
@@ -34,11 +34,11 @@ | |||
android:layout_alignParentBottom="true"> | |||
<EditText | |||
android:id="@+id/starttime" | |||
android:layout_width="140dp" | |||
android:layout_width="240dp" | |||
android:layout_height="wrap_content" | |||
android:inputType="text" | |||
android:padding="3dp" | |||
android:textColor="@color/foreground" | |||
android:textColor="@color/black" | |||
android:background="@drawable/input_bj" | |||
android:layout_marginLeft="5dp" | |||
android:maxLines="1" | |||
@@ -49,17 +49,17 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:textColor="@color/foreground" | |||
android:textColor="@color/black" | |||
android:text="--"> | |||
</TextView> | |||
<EditText | |||
android:id="@+id/stoptime" | |||
android:layout_width="140dp" | |||
android:layout_width="240dp" | |||
android:layout_height="wrap_content" | |||
android:inputType="text" | |||
android:padding="3dp" | |||
android:focusable="false" | |||
android:textColor="@color/foreground" | |||
android:textColor="@color/black" | |||
android:background="@drawable/input_bj" | |||
android:layout_marginLeft="5dp" | |||
android:maxLines="1" | |||
@@ -69,13 +69,14 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:textColor="@color/foreground" | |||
android:textSize="@dimen/textSize" | |||
android:textColor="@color/black" | |||
android:text="日志类型"> | |||
</TextView> | |||
<Spinner | |||
android:id="@+id/rzlx" | |||
android:layout_width="wrap_content" | |||
android:layout_height="26dp" | |||
android:layout_width="200dp" | |||
android:layout_height="match_parent" | |||
style="@style/commonSpinnerStyle"/> | |||
<EditText | |||
android:id="@+id/edittext" | |||
@@ -83,7 +84,7 @@ | |||
android:layout_height="wrap_content" | |||
android:inputType="text" | |||
android:padding="3dp" | |||
android:textColor="@color/foreground" | |||
android:textColor="@color/black" | |||
android:background="@drawable/input_bj" | |||
android:layout_marginLeft="5dp" | |||
android:hint="请输入查询条件" | |||
@@ -97,7 +98,7 @@ | |||
android:layout_marginLeft="5dp" | |||
android:layout_gravity="center" | |||
android:layout_width="120dp" | |||
android:layout_height="26dp" | |||
android:layout_height="match_parent" | |||
android:textColor="@color/white" | |||
/> | |||
</LinearLayout> | |||
@@ -10,239 +10,19 @@ | |||
<RelativeLayout | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_margin="10dp"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="30dp"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:focusable="true" | |||
android:focusableInTouchMode="true" | |||
android:layout_alignParentBottom="true"> | |||
<EditText | |||
android:id="@+id/starttime" | |||
android:layout_width="140dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:focusable="false" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2023-02-33 00:00:00" | |||
android:textSize="@dimen/textSize"/> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:text="--"></TextView> | |||
<EditText | |||
android:id="@+id/stoptime" | |||
android:layout_width="140dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:focusable="false" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:text="2023-02-33 00:00:00" | |||
android:textSize="@dimen/textSize"/> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:text="制作状态"></TextView> | |||
<Spinner | |||
android:id="@+id/rzlx" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="wrap_content" | |||
android:layout_height="26dp" /> | |||
<EditText | |||
android:id="@+id/edittext" | |||
android:layout_width="200dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入查询条件" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textColor="@color/foreground" | |||
android:textSize="@dimen/textSize"/> | |||
<Button | |||
android:id="@+id/button" | |||
android:layout_width="120dp" | |||
android:layout_height="26dp" | |||
android:layout_gravity="center" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="查询" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:text="数量:"></TextView> | |||
<TextView | |||
android:id="@+id/count" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:text="129" | |||
android:textColor="@color/deep_purple_primary"></TextView> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="10dp" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="36dp" | |||
android:background="@color/datatab_tab"> | |||
android:layout_marginTop="50dp" | |||
android:layout_marginLeft="20dp" | |||
android:layout_marginRight="20dp" | |||
android:layout_marginBottom="20dp"> | |||
<com.github.mikephil.charting.charts.LineChart | |||
android:id="@+id/chart1" | |||
android:layout_width="match_parent" | |||
android:layout_marginTop="20dp" | |||
android:layout_height="match_parent" /> | |||
<TableLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_gravity="center" | |||
android:gravity="center" | |||
android:stretchColumns="0"> | |||
<TableRow | |||
android:layout_width="fill_parent" | |||
android:layout_height="wrap_content" | |||
android:gravity="center_horizontal"> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="2.5"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="订单编号" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="2"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="创建时间" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="商品名称" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="订单状态" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="2"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="备注" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
</TableRow> | |||
</TableLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<ListView | |||
android:id="@+id/datatab" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
@@ -39,6 +39,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:textSize="@dimen/textSize" | |||
android:text="PLC连接地址:" /> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
@@ -50,13 +51,14 @@ | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:textSize="@dimen/textSize" | |||
android:text="PLC连接端口:" /> | |||
<EditText | |||
android:id="@+id/edittext2" | |||
@@ -68,44 +70,44 @@ | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="0"/> | |||
</TableRow> | |||
<!-- Table2--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="商家店铺号:" /> | |||
<EditText | |||
android:id="@+id/edittext3" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入商家店铺号" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="链接环境:" /> | |||
<Spinner | |||
android:id="@+id/environment" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
<!-- <TableRow--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_gravity="left"--> | |||
<!-- android:layout_margin="5dp">--> | |||
<!-- <com.qmuiteam.qmui.widget.textview.QMUILinkTextView--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:gravity="right"--> | |||
<!-- android:text="商家店铺号:" />--> | |||
<!-- <EditText--> | |||
<!-- android:id="@+id/edittext3"--> | |||
<!-- android:layout_width="120dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="5dp"--> | |||
<!-- android:background="@drawable/input_bj"--> | |||
<!-- android:hint="请输入商家店铺号"--> | |||
<!-- android:inputType="text"--> | |||
<!-- android:maxLines="1"--> | |||
<!-- android:padding="3dp"--> | |||
<!-- android:textSize="12dp" />--> | |||
<!-- <com.qmuiteam.qmui.widget.textview.QMUILinkTextView--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:gravity="right"--> | |||
<!-- android:text="链接环境:" />--> | |||
<!-- <Spinner--> | |||
<!-- android:id="@+id/environment"--> | |||
<!-- style="@style/commonSpinnerStyle"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="24dp"--> | |||
<!-- android:layout_centerVertical="true" />--> | |||
<!-- </TableRow>--> | |||
<!-- Table3--> | |||
<TableRow | |||
@@ -113,34 +115,35 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="商家设备号:" /> | |||
<EditText | |||
android:id="@+id/edittext4" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入商家设备号" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
<!-- <com.qmuiteam.qmui.widget.textview.QMUILinkTextView--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:gravity="right"--> | |||
<!-- android:text="商家设备号:" />--> | |||
<!-- <EditText--> | |||
<!-- android:id="@+id/edittext4"--> | |||
<!-- android:layout_width="120dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="5dp"--> | |||
<!-- android:background="@drawable/input_bj"--> | |||
<!-- android:hint="请输入商家设备号"--> | |||
<!-- android:inputType="text"--> | |||
<!-- android:maxLines="1"--> | |||
<!-- android:padding="3dp"--> | |||
<!-- android:textSize="12dp" />--> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:textSize="@dimen/textSize" | |||
android:text="版本选择:" /> | |||
<Spinner | |||
android:id="@+id/versionselection" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_width="280dp" | |||
android:layout_height="match_parent" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
@@ -28,15 +28,15 @@ | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="商品名称" | |||
android:textAlignment="center" | |||
android:textAlignment="textStart" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:textSize="20sp" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="2"> | |||
android:layout_weight="1"> | |||
<TextView | |||
android:id="@+id/ddzl" | |||
@@ -45,16 +45,16 @@ | |||
android:layout_alignParentLeft="true" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="订单总量(单)" | |||
android:text="开始时间" | |||
android:textAlignment="center" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:textSize="20sp" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="2"> | |||
android:layout_weight="1"> | |||
<TextView | |||
android:id="@+id/ddzl_yzz" | |||
@@ -63,28 +63,28 @@ | |||
android:layout_alignParentLeft="true" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="已制作(单)" | |||
android:text="结束时间" | |||
android:textAlignment="center" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:textSize="20sp" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="30dp" | |||
android:layout_weight="2"> | |||
<TextView | |||
android:layout_height="50dp" | |||
android:layout_weight="1"> | |||
<Button | |||
android:layout_centerInParent="true" | |||
android:id="@+id/ddzl_yc" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:text="异常订单(单)" | |||
android:layout_margin="10dp" | |||
android:text="查看" | |||
android:textAlignment="center" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:background="#0274c0" | |||
android:textColor="@color/white" | |||
android:textSize="20sp" /> | |||
</RelativeLayout> | |||
</TableRow> | |||
</TableLayout> |
@@ -11,9 +11,10 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginBottom="5dp" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="序号" | |||
android:textSize="12dp" | |||
android:textSize="@dimen/textSize" | |||
android:focusable="false" | |||
android:textColor="@color/black"/> | |||
</RelativeLayout> |
@@ -32,7 +32,7 @@ | |||
android:layout_marginLeft="20dp" | |||
android:text="回锅肉" | |||
android:textAlignment="center" | |||
android:textSize="14dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<!-- <RelativeLayout--> | |||
@@ -64,7 +64,7 @@ | |||
<ImageView | |||
android:id="@+id/button_update" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="40dp" | |||
android:layout_centerInParent="true" | |||
android:src="@mipmap/new_update" /> | |||
</RelativeLayout> | |||
@@ -77,7 +77,7 @@ | |||
android:layout_centerInParent="true" | |||
android:id="@+id/button_item" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="40dp" | |||
android:src="@mipmap/new_delete"/> | |||
</RelativeLayout> | |||
@@ -8,6 +8,8 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:gravity="center" | |||
android:layout_marginTop="10dp" | |||
android:layout_marginBottom="10dp" | |||
android:layout_gravity="center" | |||
android:stretchColumns="0"> | |||
<TableRow | |||
@@ -43,7 +45,7 @@ | |||
android:text="日志类型" | |||
android:textAlignment="center" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
@@ -60,11 +62,11 @@ | |||
android:text="日志时间" | |||
android:textAlignment="center" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="30dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="4"> | |||
<TextView | |||
android:layout_centerInParent="true" | |||
@@ -75,7 +77,7 @@ | |||
android:layout_alignParentLeft="true" | |||
android:text="日志描述日志描述" | |||
android:textColor="@color/black" | |||
android:textSize="12dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
</TableRow> | |||
@@ -4,95 +4,257 @@ | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/app_color_blue"> | |||
android:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/main_background"> | |||
> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginBottom="50dp"> | |||
android:layout_margin="10dp"> | |||
<LinearLayout | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginLeft="160dp" | |||
android:layout_marginRight="160dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:id="@+id/ddgl" | |||
android:layout_marginTop="20dp" | |||
android:layout_centerInParent="true" | |||
android:orientation="vertical" | |||
android:layout_height="wrap_content"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:focusable="false" | |||
android:background="@drawable/silos_bj"> | |||
<ImageView | |||
android:layout_margin="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:src="@mipmap/new1" | |||
android:focusable="false"/> | |||
</LinearLayout> | |||
<TextView | |||
android:layout_marginRight="10dp" | |||
android:layout_height="50dp"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:focusable="true" | |||
android:layout_alignParentLeft="true" | |||
android:focusableInTouchMode="true"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:layout_marginLeft="5dp" | |||
android:gravity="center" | |||
android:textSize="@dimen/textSize" | |||
android:text="开始时间:"></TextView> | |||
<EditText | |||
android:id="@+id/starttime" | |||
android:layout_width="250dp" | |||
android:layout_height="match_parent" | |||
android:background="@drawable/input_bj" | |||
android:focusable="false" | |||
android:inputType="text" | |||
android:textAlignment="center" | |||
android:maxLines="1" | |||
android:paddingLeft="3dp" | |||
android:text="2023-02-33 00:00:00" | |||
android:textSize="@dimen/textSize"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:focusable="true" | |||
android:layout_alignParentRight="true" | |||
android:focusableInTouchMode="true"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:gravity="center" | |||
android:layout_marginLeft="25dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="结束时间:"></TextView> | |||
<EditText | |||
android:id="@+id/stoptime" | |||
android:layout_width="250dp" | |||
android:layout_height="match_parent" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:focusable="false" | |||
android:textAlignment="center" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:text="2023-02-33 00:00:00" | |||
android:textSize="@dimen/textSize"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:focusable="false" | |||
android:fontFamily="sans-serif-condensed-medium" | |||
android:text="销量统计" | |||
android:textAlignment="center" | |||
android:textColor="#0956B8" | |||
android:textSize="26dp" /> | |||
android:layout_marginTop="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_height="50dp"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:focusable="true" | |||
android:focusableInTouchMode="true"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:textSize="@dimen/textSize" | |||
android:gravity="center" | |||
android:layout_marginLeft="5dp" | |||
android:text="配方名称:"></TextView> | |||
<EditText | |||
android:id="@+id/edittext" | |||
android:layout_width="250dp" | |||
android:layout_height="match_parent" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入查询条件" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:textSize="@dimen/textSize"/> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/button" | |||
android:layout_width="250dp" | |||
android:layout_height="match_parent" | |||
android:layout_gravity="center" | |||
android:layout_marginLeft="25dp" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="查 询" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:id="@+id/xltj" | |||
android:layout_marginTop="20dp" | |||
android:layout_centerInParent="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:focusable="false" | |||
android:background="@drawable/log_bj"> | |||
<ImageView | |||
android:layout_margin="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:src="@mipmap/new1" | |||
android:focusable="false"/> | |||
</LinearLayout> | |||
<TextView | |||
android:layout_height="36dp" | |||
android:layout_marginTop="20dp" | |||
android:background="@color/datatab_tab"> | |||
<TableLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:focusable="false" | |||
android:fontFamily="sans-serif-condensed-medium" | |||
android:text="订单列表" | |||
android:textAlignment="center" | |||
android:textColor="#8A0FA2" | |||
android:textSize="26dp" /> | |||
</LinearLayout> | |||
android:layout_centerVertical="true" | |||
android:layout_gravity="center" | |||
android:gravity="center" | |||
android:stretchColumns="0"> | |||
<TableRow | |||
android:layout_width="fill_parent" | |||
android:layout_height="wrap_content" | |||
android:gravity="center_horizontal"> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="2.5"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="商品名称" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="开始时间" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="完成时间" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginLeft="20dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="趋势图" | |||
android:textAlignment="center" | |||
android:textStyle="bold" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
</TableRow> | |||
</TableLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<ListView | |||
android:id="@+id/datatab" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" /> | |||
<!-- <com.github.mikephil.charting.charts.LineChart--> | |||
<!-- android:id="@+id/chart1"--> | |||
<!-- android:layout_margin="20dp"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_marginTop="20dp"--> | |||
<!-- android:layout_height="match_parent" />--> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
@@ -0,0 +1,985 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/main_background"> | |||
<GridLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:rowCount="2" | |||
android:layout_margin="10dp" | |||
android:orientation="horizontal" | |||
android:layout_centerVertical="true" | |||
android:layout_centerHorizontal="true" | |||
android:columnCount="2"> | |||
<!--系统控制--> | |||
<RelativeLayout | |||
android:background="@drawable/silosbj" | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_margin="10dp" | |||
android:layout_column="0" | |||
android:layout_row="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="0.3" | |||
android:focusable="true" | |||
android:clickable="true"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_margin="10dp" | |||
android:layout_height="match_parent"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:text="系统启停:" | |||
android:textSize="@dimen/textSize"/> | |||
<Button | |||
android:id="@+id/switch_系统启停" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginLeft="10dp" | |||
android:layout_gravity="center" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启动" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_margin="10dp" | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="match_parent"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:text="超温停气:" | |||
android:textSize="@dimen/textSize"/> | |||
<Button | |||
android:id="@+id/switch_超温停气" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_gravity="center" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启用" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<!--进油弹框--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_margin="10dp" | |||
android:layout_column="1" | |||
android:layout_row="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="0.3" | |||
android:background="@drawable/silosbj" | |||
android:focusable="true" | |||
android:clickable="true"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_margin="10dp" | |||
android:layout_height="match_parent"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:text="抽油启停:" | |||
android:textSize="@dimen/textSize"/> | |||
<Button | |||
android:id="@+id/switch_抽油启停" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginLeft="10dp" | |||
android:layout_gravity="center" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启动" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:layout_margin="10dp" | |||
android:layout_height="match_parent"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:text="备用气缸:" | |||
android:textSize="@dimen/textSize"/> | |||
<Button | |||
android:id="@+id/switch_备用气缸" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_gravity="center" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启动" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<!--火力控制弹框--> | |||
<GridLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_margin="10dp" | |||
android:layout_column="0" | |||
android:layout_row="1" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1.7" | |||
android:rowCount="7" | |||
android:columnCount="1" | |||
android:background="@drawable/silosbj" | |||
android:focusable="true" | |||
android:clickable="true" | |||
android:orientation="horizontal"> | |||
<!--点火模式--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="0" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="点火模式:" | |||
android:textSize="@dimen/textSize" /> | |||
<RadioGroup | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:orientation="horizontal"> | |||
<RadioButton | |||
android:id="@+id/RB_Hand" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="@dimen/textSize" | |||
android:text="手动" /> | |||
<RadioButton | |||
android:id="@+id/RB_Auto" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="自动" /> | |||
</RadioGroup> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:layout_marginRight="10dp" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="当前温度:" | |||
android:textSize="@dimen/textSize"/> | |||
<TextView | |||
android:id="@+id/CurrentTemp" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="100 ℃" | |||
android:textColor="@color/deep_orange_primary" | |||
android:textSize="@dimen/textSize"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<!--小火控制--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="1" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="小火控制:" | |||
android:textSize="@dimen/textSize" /> | |||
<com.litao.slider.NiftySlider | |||
android:id="@+id/slider_小火" | |||
android:layout_width="340dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:hapticFeedbackEnabled="true" | |||
android:stepSize="1" | |||
android:value="0" | |||
android:valueFrom="0" | |||
android:valueTo="100" | |||
app:enableDrawHalo="false" | |||
app:thumbColor="@color/we_read_thumb_color" | |||
app:thumbRadius="11dp" | |||
app:thumbText="0" | |||
app:thumbTextBold="true" | |||
app:thumbTextColor="@color/we_read_theme_color" | |||
app:thumbTextSize="12sp" | |||
app:thumbWithinTrackBounds="true" | |||
app:trackColor="@color/pro1" | |||
app:trackColorInactive="@color/pro2" | |||
app:trackHeight="15dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/switch_小火" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginRight="10dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<!--中火控制--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="2" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="中火控制:" | |||
android:textSize="@dimen/textSize" /> | |||
<com.litao.slider.NiftySlider | |||
android:id="@+id/slider_中火" | |||
android:layout_width="340dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:hapticFeedbackEnabled="true" | |||
android:stepSize="1" | |||
android:value="0" | |||
android:valueFrom="0" | |||
android:valueTo="100" | |||
app:enableDrawHalo="false" | |||
app:thumbColor="@color/we_read_thumb_color" | |||
app:thumbRadius="11dp" | |||
app:thumbText="0" | |||
app:thumbTextBold="true" | |||
app:thumbTextColor="@color/we_read_theme_color" | |||
app:thumbTextSize="12sp" | |||
app:thumbWithinTrackBounds="true" | |||
app:trackColor="@color/pro1" | |||
app:trackColorInactive="@color/pro2" | |||
app:trackHeight="15dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/switch_中火" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginRight="10dp" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<!--大火控制--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="3" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="大火控制:" | |||
android:textSize="@dimen/textSize" /> | |||
<com.litao.slider.NiftySlider | |||
android:id="@+id/slider_大火" | |||
android:layout_width="340dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:hapticFeedbackEnabled="true" | |||
android:stepSize="1" | |||
android:value="0" | |||
android:valueFrom="0" | |||
android:valueTo="100" | |||
app:enableDrawHalo="false" | |||
app:thumbColor="@color/we_read_thumb_color" | |||
app:thumbRadius="11dp" | |||
app:thumbText="0" | |||
app:thumbTextBold="true" | |||
app:thumbTextColor="@color/we_read_theme_color" | |||
app:thumbTextSize="12sp" | |||
app:thumbWithinTrackBounds="true" | |||
app:trackColor="@color/pro1" | |||
app:trackColorInactive="@color/pro2" | |||
app:trackHeight="15dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/switch_大火" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginRight="10dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<!--强火控制--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="4" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="强火控制:" | |||
android:textSize="@dimen/textSize" /> | |||
<com.litao.slider.NiftySlider | |||
android:id="@+id/slider_强火" | |||
android:layout_width="340dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:hapticFeedbackEnabled="true" | |||
android:stepSize="1" | |||
android:value="0" | |||
android:valueFrom="0" | |||
android:valueTo="100" | |||
app:enableDrawHalo="false" | |||
app:thumbColor="@color/we_read_thumb_color" | |||
app:thumbRadius="11dp" | |||
app:thumbText="0" | |||
app:thumbTextBold="true" | |||
app:thumbTextColor="@color/we_read_theme_color" | |||
app:thumbTextSize="12sp" | |||
app:thumbWithinTrackBounds="true" | |||
app:trackColor="@color/pro1" | |||
app:trackColorInactive="@color/pro2" | |||
app:trackHeight="15dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/switch_强火" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginRight="10dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<!--参数设置--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="5" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="温度修正:" | |||
android:textSize="@dimen/textSize" /> | |||
<EditText | |||
android:id="@+id/edit_温度修正" | |||
android:layout_width="100dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:paddingLeft="5dp" | |||
android:paddingTop="5dp" | |||
android:paddingBottom="5dp" | |||
android:text="0.0" | |||
android:textSize="@dimen/textSize" /> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="10dp" | |||
android:text="温度上限:" | |||
android:textSize="@dimen/textSize" /> | |||
<EditText | |||
android:id="@+id/edit_温度上限" | |||
android:layout_width="100dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:layout_centerVertical="true" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:paddingLeft="5dp" | |||
android:paddingTop="5dp" | |||
android:paddingBottom="5dp" | |||
android:text="0.0" | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/button_写入参数" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginRight="10dp" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="写入" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<!--点火控制--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="6" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="点火控制:" | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/switch_点火控制" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="10dp" | |||
android:text="点火状态:" | |||
android:textSize="@dimen/textSize" /> | |||
<TextView | |||
android:id="@+id/IgnitionStatus" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginTop="4dp" | |||
android:text="点火失败" | |||
android:textColor="@color/purple_primary" | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/button_点火复位" | |||
android:layout_width="@dimen/handButWidth" | |||
android:layout_height="@dimen/handButHeight" | |||
android:layout_marginRight="10dp" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="复位" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
</GridLayout> | |||
<!--搅拌升降控制弹框--> | |||
<GridLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_margin="10dp" | |||
android:layout_column="1" | |||
android:layout_row="1" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1.7" | |||
android:rowCount="7" | |||
android:columnCount="1" | |||
android:background="@drawable/silosbj" | |||
android:focusable="true" | |||
android:clickable="true" | |||
android:orientation="horizontal"> | |||
<!--重量设定--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="0" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="设定重量:" | |||
android:textSize="@dimen/textSize"/> | |||
<EditText | |||
android:id="@+id/edit_设定重量" | |||
android:layout_width="130dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:layout_centerVertical="true" | |||
android:maxLines="1" | |||
android:paddingLeft="5dp" | |||
android:paddingTop="5dp" | |||
android:paddingBottom="5dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="0.0"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:layout_marginRight="80dp" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="提前量:" | |||
android:textSize="@dimen/textSize"/> | |||
<EditText | |||
android:id="@+id/edit_提前量" | |||
android:layout_width="130dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:layout_centerVertical="true" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:paddingLeft="5dp" | |||
android:paddingTop="5dp" | |||
android:paddingBottom="5dp" | |||
android:textSize="@dimen/textSize" | |||
android:text="0.0"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<!--称控制--> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="1" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="当前重量:" | |||
android:textSize="@dimen/textSize"/> | |||
<TextView | |||
android:id="@+id/PanWeight" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="100kg" | |||
android:textColor="@color/app_color_blue" | |||
android:textSize="@dimen/textSize"/> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/button_重量清零" | |||
android:layout_width="130dp" | |||
android:layout_height="40dp" | |||
android:layout_marginRight="80dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="重量清零" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="2" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:text="搅拌控制:" | |||
android:textSize="@dimen/textSize" /> | |||
<com.litao.slider.NiftySlider | |||
android:id="@+id/slider_搅拌频率" | |||
android:layout_width="230dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:hapticFeedbackEnabled="true" | |||
android:stepSize="1" | |||
android:value="0" | |||
android:valueFrom="0" | |||
android:valueTo="100" | |||
app:enableDrawHalo="false" | |||
app:thumbColor="@color/we_read_thumb_color" | |||
app:thumbRadius="11dp" | |||
app:thumbText="0" | |||
app:thumbTextBold="true" | |||
app:thumbTextColor="@color/we_read_theme_color" | |||
app:thumbTextSize="12sp" | |||
app:thumbWithinTrackBounds="true" | |||
app:trackColor="@color/pro1" | |||
app:trackColorInactive="@color/pro2" | |||
app:trackHeight="15dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/switch_搅拌控制" | |||
android:layout_width="130dp" | |||
android:layout_height="40dp" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginRight="80dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="3" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<Button | |||
android:id="@+id/button_出料" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="按需出料" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/button_搅拌点动" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:layout_marginRight="80dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="搅拌点动" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="4" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_搅拌上升" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="搅拌上升" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<ImageView | |||
android:id="@+id/image_搅拌上升" | |||
android:layout_width="30dp" | |||
android:layout_gravity="center" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/circular_gray"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_centerVertical="true" | |||
android:layout_marginRight="40dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_锅前倾" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="锅前倾" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<ImageView | |||
android:id="@+id/image_锅前倾" | |||
android:layout_width="30dp" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:background="@drawable/circular_gray"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="5" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_搅拌下降" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="搅拌下降" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<ImageView | |||
android:id="@+id/image_搅拌下降" | |||
android:layout_width="30dp" | |||
android:layout_gravity="center" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/circular_green"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_marginRight="40dp" | |||
android:layout_centerVertical="true" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_锅后仰" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="锅后仰" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/textSize" /> | |||
<ImageView | |||
android:id="@+id/image_锅后仰" | |||
android:layout_width="30dp" | |||
android:layout_gravity="center" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/circular_green"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="0dp" | |||
android:layout_row="6" | |||
android:layout_column="0" | |||
android:layout_columnWeight="1" | |||
android:layout_rowWeight="1"> | |||
</RelativeLayout> | |||
</GridLayout> | |||
</GridLayout> | |||
<!-- <com.qmuiteam.qmui.widget.QMUITopBarLayout--> | |||
<!-- android:id="@+id/topbar"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:background="@color/app_color_blue" />--> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -165,7 +165,7 @@ | |||
android:layout_centerHorizontal="true" | |||
android:text="配方名称:" | |||
android:textColor="@color/file_picker_title" | |||
android:textSize="25dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<TextView | |||
android:id="@+id/caipumingcheng" | |||
@@ -175,7 +175,7 @@ | |||
android:layout_centerHorizontal="true" | |||
android:text="牛油火锅" | |||
android:textColor="@color/purple_primary_dark" | |||
android:textSize="25dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -190,7 +190,7 @@ | |||
android:layout_centerHorizontal="true" | |||
android:text="剩余时间:" | |||
android:textColor="@color/file_picker_title" | |||
android:textSize="25dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<TextView | |||
android:id="@+id/shengyushijian" | |||
@@ -200,7 +200,7 @@ | |||
android:layout_centerHorizontal="true" | |||
android:text="3分29秒" | |||
android:textColor="@color/purple_primary_dark" | |||
android:textSize="25dp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
<!-- <com.capton.colorfulprogressbar.ColorfulProgressbar--> | |||
@@ -247,9 +247,9 @@ | |||
android:layout_width="120dp" | |||
android:layout_height="45dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="选择菜品" | |||
android:text="选择配方" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
<Button | |||
android:id="@+id/startbutton" | |||
android:layout_width="120dp" | |||
@@ -258,7 +258,7 @@ | |||
android:background="@drawable/bg_btn_login_red" | |||
android:text="强制结束" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
android:textSize="@dimen/textSize" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
@@ -388,6 +388,7 @@ | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -283,16 +283,16 @@ | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/btn_xtkz" | |||
android:layout_width="160dp" | |||
android:layout_height="55dp" | |||
android:layout_marginRight="15dp" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="手动控制" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
<!-- <Button--> | |||
<!-- android:id="@+id/btn_xtkz"--> | |||
<!-- android:layout_width="160dp"--> | |||
<!-- android:layout_height="55dp"--> | |||
<!-- android:layout_marginRight="15dp"--> | |||
<!-- android:layout_alignParentRight="true"--> | |||
<!-- android:background="@drawable/bg_btn_login_selected"--> | |||
<!-- android:text="手动控制"--> | |||
<!-- android:textColor="@color/white"--> | |||
<!-- android:textSize="18sp" />--> | |||
</RelativeLayout> | |||
@@ -409,15 +409,37 @@ | |||
android:textSize="19dp"/> | |||
</RelativeLayout> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_系统启停"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:focusable="true"/>--> | |||
<Button | |||
android:id="@+id/switch_系统启停" | |||
android:layout_marginLeft="20dp" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" | |||
app:sb_button_color="@color/app_color_blue" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启动" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
<!-- <Button--> | |||
<!-- android:id="@+id/switch_系统启停"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- android:padding="0dp"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:background="@color/app_color_blue"--> | |||
<!-- android:text="启动"--> | |||
<!-- android:textSize="18sp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:focusable="true"/>--> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -438,15 +460,25 @@ | |||
android:textSize="19dp"/> | |||
</RelativeLayout> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_超温停气"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:focusable="true"/>--> | |||
<Button | |||
android:id="@+id/switch_超温停气" | |||
android:layout_marginLeft="20dp" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" | |||
app:sb_button_color="@color/app_color_blue" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启用" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -486,15 +518,26 @@ | |||
android:textSize="19dp"/> | |||
</RelativeLayout> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_抽油启停"--> | |||
<!-- android:layout_marginLeft="8dp"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:focusable="true"/>--> | |||
<Button | |||
android:id="@+id/switch_抽油启停" | |||
android:layout_marginLeft="8dp" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" | |||
app:sb_button_color="@color/app_color_blue" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启动" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -514,15 +557,25 @@ | |||
android:textSize="19dp"/> | |||
</RelativeLayout> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_备用气缸"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:focusable="true"/>--> | |||
<Button | |||
android:id="@+id/switch_备用气缸" | |||
android:layout_marginLeft="20dp" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" | |||
app:sb_button_color="@color/app_color_blue" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="启动" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -574,7 +627,6 @@ | |||
android:textSize="19dp" /> | |||
</RelativeLayout> | |||
<RadioGroup | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
@@ -597,9 +649,36 @@ | |||
android:text="自动" /> | |||
</RadioGroup> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginRight="5dp" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:text="当前温度:" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:id="@+id/CurrentTemp" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:text="100 ℃" | |||
android:textColor="@color/deep_orange_primary" | |||
android:textSize="20sp"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
@@ -663,15 +742,26 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_小火"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- android:focusable="true"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue" />--> | |||
<Button | |||
android:id="@+id/switch_小火" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="20dp" | |||
android:focusable="true" | |||
app:sb_button_color="@color/app_color_blue" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" /> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -732,15 +822,26 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_中火"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- android:focusable="true"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue" />--> | |||
<Button | |||
android:id="@+id/switch_中火" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="20dp" | |||
android:focusable="true" | |||
app:sb_button_color="@color/app_color_blue" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" /> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -801,16 +902,28 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
android:id="@+id/switch_大火" | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_大火"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- android:focusable="true"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue" />--> | |||
<Button | |||
android:id="@+id/switch_大火" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="20dp" | |||
android:focusable="true" | |||
app:sb_button_color="@color/app_color_blue" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" /> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -870,15 +983,26 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_强火"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- android:focusable="true"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue" />--> | |||
<Button | |||
android:id="@+id/switch_强火" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="20dp" | |||
android:focusable="true" | |||
app:sb_button_color="@color/app_color_blue" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" /> | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -986,15 +1110,25 @@ | |||
android:textSize="19dp" /> | |||
</RelativeLayout> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_点火控制"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="20dp"--> | |||
<!-- android:focusable="true"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue" />--> | |||
<Button | |||
android:id="@+id/switch_点火控制" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="20dp" | |||
android:focusable="true" | |||
app:sb_button_color="@color/app_color_blue" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" /> | |||
android:layout_width="100dp" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="18dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
@@ -1004,14 +1138,14 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:layout_marginLeft="40dp" | |||
android:layout_marginLeft="18dp" | |||
android:text="点火状态:" | |||
android:textSize="19dp" /> | |||
</RelativeLayout> | |||
<TextView | |||
android:id="@+id/IgnitionStatus" | |||
android:layout_width="wrap_content" | |||
android:layout_width="100dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="18dp" | |||
android:layout_marginTop="4dp" | |||
@@ -1023,7 +1157,7 @@ | |||
android:id="@+id/button_点火复位" | |||
android:layout_width="80dp" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginLeft="10dp" | |||
android:layout_centerVertical="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="复位" | |||
@@ -1087,7 +1221,7 @@ | |||
android:text="0.0"/> | |||
<TextView | |||
android:layout_marginLeft="50dp" | |||
android:layout_marginLeft="60dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
@@ -1112,39 +1246,47 @@ | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
<RelativeLayout | |||
android:layout_marginTop="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:text="当前重量:" | |||
android:textSize="19dp"/> | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:text="当前重量:" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:id="@+id/PanWeight" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:text="100kg" | |||
android:textColor="@color/app_color_blue" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:id="@+id/PanWeight" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:text="100kg" | |||
android:textColor="@color/app_color_blue" | |||
android:textSize="19dp"/> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/button_重量清零" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="180dp" | |||
android:layout_marginRight="45dp" | |||
android:layout_alignParentRight="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="重量清零" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
@@ -1201,15 +1343,27 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
<!-- <com.suke.widget.SwitchButton--> | |||
<!-- android:id="@+id/switch_搅拌控制"--> | |||
<!-- android:layout_marginRight="100dp"--> | |||
<!-- app:sb_uncheck_color="@color/app_color_blue"--> | |||
<!-- app:sb_uncheckcircle_color="@color/app_color_blue"--> | |||
<!-- app:sb_button_color="@color/app_color_blue"--> | |||
<!-- android:layout_width="80dp"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:focusable="true"/>--> | |||
<Button | |||
android:id="@+id/switch_搅拌控制" | |||
android:layout_marginRight="100dp" | |||
app:sb_uncheck_color="@color/app_color_blue" | |||
app:sb_uncheckcircle_color="@color/app_color_blue" | |||
app:sb_button_color="@color/app_color_blue" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
android:layout_width="130dp" | |||
android:layout_height="40dp" | |||
android:layout_marginRight="45dp" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="打开" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -1222,10 +1376,9 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_出料" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="15dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
@@ -1237,7 +1390,7 @@ | |||
<Button | |||
android:id="@+id/button_搅拌点动" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginRight="45dp" | |||
@@ -1259,10 +1412,10 @@ | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_搅拌上升" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="15dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="搅拌上升" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
@@ -1287,10 +1440,10 @@ | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_锅前倾" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="15dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="锅前倾" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
@@ -1317,10 +1470,10 @@ | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_搅拌下降" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="15dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="搅拌下降" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
@@ -1343,10 +1496,10 @@ | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/button_锅后仰" | |||
android:layout_width="140dp" | |||
android:layout_width="130dp" | |||
android:layout_height="45dp" | |||
android:layout_marginRight="15dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:background="@drawable/bg_btn_false_color" | |||
android:text="锅后仰" | |||
android:textColor="@color/white" | |||
android:textSize="18sp" /> | |||
@@ -10,17 +10,19 @@ | |||
android:id="@+id/check_PF" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="@dimen/textSize" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<TextView | |||
android:id="@+id/name" | |||
android:layout_width="80dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="@dimen/textSize" | |||
android:text="搅拌动作:"/> | |||
<Spinner | |||
android:id="@+id/editsp_PF" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="24dp" | |||
android:layout_height="match_parent" | |||
android:layout_centerVertical="true" | |||
android:visibility="gone"/> | |||
<EditText | |||
@@ -32,12 +34,12 @@ | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:textSize="@dimen/textSize" | |||
android:visibility="gone"/> | |||
<com.litao.slider.NiftySlider | |||
android:id="@+id/nifty_sliderPF" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="match_parent" | |||
android:layout_centerVertical="true" | |||
android:hapticFeedbackEnabled="true" | |||
android:stepSize="1" | |||
@@ -50,7 +52,7 @@ | |||
app:thumbText="0" | |||
app:thumbTextBold="true" | |||
app:thumbTextColor="@color/we_read_theme_color" | |||
app:thumbTextSize="12sp" | |||
app:thumbTextSize="18sp" | |||
app:thumbWithinTrackBounds="true" | |||
app:trackColor="@color/pro1" | |||
app:trackColorInactive="@color/pro2" | |||
@@ -9,4 +9,4 @@ | |||
android:singleLine="true" | |||
android:text="11111" | |||
android:textAlignment="inherit" | |||
android:textSize="12dp"/> | |||
android:textSize="@dimen/textSize"/> |
@@ -9,7 +9,7 @@ | |||
android:textAlignment="inherit" | |||
android:gravity="center_vertical" | |||
android:text="请选择" | |||
android:textSize="12dp" | |||
android:textSize="@dimen/textSize" | |||
android:textColor="@color/black"> | |||
</TextView> | |||
@@ -41,7 +41,7 @@ | |||
<dimen name="sp_14">14sp</dimen> | |||
<!-- text --> | |||
<dimen name="textSize">14dp</dimen> | |||
<dimen name="textTitleSize">16sp</dimen> | |||
<dimen name="TitleSize">18sp</dimen> | |||
@@ -50,4 +50,13 @@ | |||
<dimen name="text_size_10">10sp</dimen> | |||
<dimen name="text_size_16">16sp</dimen> | |||
<dimen name="radus_dp">60dp</dimen> | |||
<!--燃气炒锅界面配置--> | |||
<dimen name="textSize">25sp</dimen> | |||
<dimen name="handButWidth">100dp</dimen> | |||
<dimen name="handButHeight">40dp</dimen> | |||
</resources> |
@@ -34,4 +34,5 @@ | |||
<string name="str_age">年龄</string> | |||
</resources> |