@@ -51,12 +51,13 @@ dependencies { | |||||
implementation 'com.google.android.material:material:1.5.0' | implementation 'com.google.android.material:material:1.5.0' | ||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||||
implementation 'androidx.recyclerview:recyclerview:1.2.1' | implementation 'androidx.recyclerview:recyclerview:1.2.1' | ||||
implementation 'com.google.android.libraries.places:places:2.5.0' | |||||
testImplementation 'junit:junit:4.13.2' | testImplementation 'junit:junit:4.13.2' | ||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||||
implementation 'com.qmuiteam:qmui:2.0.0-alpha10' //腾讯ui包 | implementation 'com.qmuiteam:qmui:2.0.0-alpha10' //腾讯ui包 | ||||
implementation("com.iqiyi.xcrash:xcrash-android-lib:3.1.0") //爱奇艺捕获异常插件 | implementation("com.iqiyi.xcrash:xcrash-android-lib:3.1.0") //爱奇艺捕获异常插件 | ||||
implementation files('libs\\gson-2.2.2.jar') | |||||
// implementation files('libs\\gson-2.2.2.jar') | |||||
implementation files('libs\\sdkapi.jar') | implementation files('libs\\sdkapi.jar') | ||||
compileOnly files('libs/sdkapi.jar') | compileOnly files('libs/sdkapi.jar') | ||||
implementation files('libs/modbus4Android-1.2.jar') | implementation files('libs/modbus4Android-1.2.jar') |
@@ -10,6 +10,7 @@ import com.example.bpa.app.Main; | |||||
import com.example.bpa.config.ConfigName; | import com.example.bpa.config.ConfigName; | ||||
import com.example.bpa.db.QueryDB; | import com.example.bpa.db.QueryDB; | ||||
import com.example.bpa.db.mode.BPA_USER; | import com.example.bpa.db.mode.BPA_USER; | ||||
import com.example.bpa.helper.MessageLog; | |||||
import com.example.bpa.helper.T; | import com.example.bpa.helper.T; | ||||
public class LoginActivity extends Activity implements View.OnClickListener { | public class LoginActivity extends Activity implements View.OnClickListener { | ||||
@@ -60,6 +61,7 @@ public class LoginActivity extends Activity implements View.OnClickListener { | |||||
if (user!=null) { | if (user!=null) { | ||||
ConfigName.getInstance().user = user; | ConfigName.getInstance().user = user; | ||||
Main.getInstance().SavePZ();//保存配置 | Main.getInstance().SavePZ();//保存配置 | ||||
MessageLog.ShowInfo("登录"); | |||||
T.show(LoginActivity.this, "登录成功!"); | T.show(LoginActivity.this, "登录成功!"); | ||||
try { | try { | ||||
Intent intent = new Intent(LoginActivity.this, MainActivity.class); | Intent intent = new Intent(LoginActivity.this, MainActivity.class); | ||||
@@ -3,7 +3,7 @@ package com.example.bpa.Model; | |||||
public interface IMessageLogNotify { | public interface IMessageLogNotify { | ||||
void ErrorMsg(String msg); | void ErrorMsg(String msg); | ||||
void InfoMsg(String msg); | |||||
void InfoMsg(String msg,String datetiem); | |||||
void WarnMsg(String msg); | void WarnMsg(String msg); | ||||
} | } |
@@ -5,6 +5,7 @@ import com.example.bpa.Model.IRun; | |||||
import com.example.bpa.Model.IRunT; | import com.example.bpa.Model.IRunT; | ||||
import com.example.bpa.Model.IThread; | import com.example.bpa.Model.IThread; | ||||
import com.example.bpa.Model.IWriteCallBack; | import com.example.bpa.Model.IWriteCallBack; | ||||
import com.example.bpa.helper.MessageLog; | |||||
import com.example.bpa.helper.RTrig; | import com.example.bpa.helper.RTrig; | ||||
import com.example.bpa.helper.ThreadManager; | import com.example.bpa.helper.ThreadManager; | ||||
@@ -20,6 +21,7 @@ public class DeviceData { | |||||
if (_instance == null) | if (_instance == null) | ||||
_instance = new DeviceData(); | _instance = new DeviceData(); | ||||
return _instance; | return _instance; | ||||
} | } | ||||
@@ -1,10 +1,7 @@ | |||||
package com.example.bpa.db; | package com.example.bpa.db; | ||||
import android.content.ContentValues; | import android.content.ContentValues; | ||||
import android.database.Cursor; | import android.database.Cursor; | ||||
import android.database.sqlite.SQLiteDatabase; | import android.database.sqlite.SQLiteDatabase; | ||||
import android.util.Log; | |||||
import com.example.bpa.config.ConfigName; | import com.example.bpa.config.ConfigName; | ||||
import com.example.bpa.db.file.DBHelper; | import com.example.bpa.db.file.DBHelper; | ||||
import com.example.bpa.db.mode.BPA_ALERTLOG; | import com.example.bpa.db.mode.BPA_ALERTLOG; | ||||
@@ -26,7 +23,6 @@ import com.example.bpa.db.mode.ModeBase; | |||||
import com.example.bpa.helper.Tools; | import com.example.bpa.helper.Tools; | ||||
import com.example.bpa.view.mode.ResGoodsRecipe; | import com.example.bpa.view.mode.ResGoodsRecipe; | ||||
import com.example.bpa.view.mode.ResSilosMode; | import com.example.bpa.view.mode.ResSilosMode; | ||||
import java.lang.reflect.Field; | import java.lang.reflect.Field; | ||||
import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
@@ -95,6 +91,39 @@ public class QueryDB { | |||||
return Delete(BPA_MATERIAL.class, data.id); | return Delete(BPA_MATERIAL.class, data.id); | ||||
} | } | ||||
// public static boolean DeleteMaterial(String id){ | |||||
// boolean result = false; | |||||
// SQLiteDatabase db = helper.getWritableDatabase(); | |||||
// try { | |||||
// db.beginTransaction(); | |||||
// StringBuilder sql = new StringBuilder(); | |||||
// sql.append("delete from ").append(BPA_MATERIAL.class.getSimpleName()).append(" where id=?"); | |||||
// db.execSQL(sql.toString(), new String[]{id}); | |||||
// db.setTransactionSuccessful(); | |||||
// result = true; | |||||
// }catch (SQLException e) { | |||||
// e.printStackTrace(); | |||||
// result = false; | |||||
// }finally { | |||||
// db.endTransaction(); | |||||
// } | |||||
// | |||||
// try { | |||||
// db.beginTransaction(); | |||||
// StringBuilder sql = new StringBuilder(); | |||||
// sql.append("delete from ").append(BPA_SILOSANDMATERIAL.class.getSimpleName()).append(" where materialID=?"); | |||||
// db.execSQL(sql.toString(), new String[]{id}); | |||||
// db.setTransactionSuccessful(); | |||||
// }catch (SQLException e) { | |||||
// e.printStackTrace(); | |||||
// | |||||
// }finally { | |||||
// db.endTransaction();//结束第二个事务,回滚或提交操作 | |||||
// } | |||||
// db.close(); | |||||
// return result; | |||||
// } | |||||
/** | /** | ||||
@@ -114,7 +143,7 @@ public class QueryDB { | |||||
return data; | return data; | ||||
} | } | ||||
/** | /** | ||||
* 根据id获取物料 | |||||
* 根据物料id获取物料 | |||||
* | * | ||||
* @param | * @param | ||||
* @return | * @return | ||||
@@ -363,7 +392,7 @@ public class QueryDB { | |||||
} | } | ||||
/** | /** | ||||
* 根据料仓id查询物料 | |||||
* 根据料仓id查询物料id | |||||
* @param id | * @param id | ||||
* @return | * @return | ||||
*/ | */ | ||||
@@ -416,6 +445,34 @@ public class QueryDB { | |||||
} | } | ||||
return data; | return data; | ||||
} | } | ||||
/** | |||||
* 根据料仓id查询物料 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
public static List<BPA_MATERIAL> GetMaterialBySilosID(String id){ | |||||
List<BPA_MATERIAL> data = new ArrayList<>(); | |||||
List<String> res = GetMaterialList(id);//根据料仓ID获取物料ID | |||||
if (res.size() == 0){ | |||||
return data; | |||||
} | |||||
if (res.get(0).equals("")){return data;} | |||||
//根据物料id查询物料 | |||||
String orderby=Desc_Time_Up;//先按排序 创建时间倒序 | |||||
String where="isDelete=? and id=?"; | |||||
for (String s : res) { | |||||
String[] args=new String[] { "0",s }; | |||||
List<Object> obj=Get(BPA_MATERIAL.class,where,args,orderby); | |||||
for (Object o : obj) { | |||||
data.add((BPA_MATERIAL) o); | |||||
} | |||||
} | |||||
return data; | |||||
} | |||||
//endregion | //endregion | ||||
//region BPA_GOODS 商品表 | //region BPA_GOODS 商品表 | ||||
@@ -881,10 +938,12 @@ public class QueryDB { | |||||
ArrayList<Object> obj = Get(BPA_LOG.class, where, args, orderby); | ArrayList<Object> obj = Get(BPA_LOG.class, where, args, orderby); | ||||
for (Object k : obj) { | for (Object k : obj) { | ||||
data.add((BPA_LOG) k); | data.add((BPA_LOG) k); | ||||
} | } | ||||
return data; | return data; | ||||
} | } | ||||
/** | /** | ||||
* 获取所有今日日志 | * 获取所有今日日志 | ||||
* | * | ||||
@@ -1307,6 +1366,7 @@ public class QueryDB { | |||||
// cv.put(key, (Date) value); | // cv.put(key, (Date) value); | ||||
// } | // } | ||||
} | } | ||||
SQLiteDatabase db = helper.getWritableDatabase(); | SQLiteDatabase db = helper.getWritableDatabase(); | ||||
long insert = db.insert(c.getSimpleName(), null, cv); | long insert = db.insert(c.getSimpleName(), null, cv); | ||||
db.close(); | db.close(); | ||||
@@ -12,7 +12,7 @@ public class MessageLog { | |||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); | SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); | ||||
Date date = new Date(); | Date date = new Date(); | ||||
if (MsgNotify != null) | if (MsgNotify != null) | ||||
MsgNotify.InfoMsg(formatter.format(date) + ":" + msg); | |||||
MsgNotify.InfoMsg(formatter.format(date) + ":" + msg,formatter.format(date)); | |||||
} | } | ||||
public static void ShowWarning(String msg) { | public static void ShowWarning(String msg) { | ||||
@@ -7,10 +7,18 @@ import android.widget.Toast; | |||||
* 自定义打印吐司函数 | * 自定义打印吐司函数 | ||||
*/ | */ | ||||
public class T { | public class T { | ||||
/** | |||||
* 信息通知+吐司弹窗 | |||||
* @param context | |||||
* @param str | |||||
*/ | |||||
public static void show(Context context, String str){ | public static void show(Context context, String str){ | ||||
//Toast.makeText(context, str, (int)0).show(); | //Toast.makeText(context, str, (int)0).show(); | ||||
ToastUtil.showToast(str); | ToastUtil.showToast(str); | ||||
Log.i(context.getPackageName(),str); | Log.i(context.getPackageName(),str); | ||||
} | } | ||||
} | } | ||||
@@ -1,5 +1,4 @@ | |||||
package com.example.bpa.helper; | package com.example.bpa.helper; | ||||
import android.content.Context; | import android.content.Context; | ||||
import android.content.res.AssetManager; | import android.content.res.AssetManager; | ||||
import android.graphics.Bitmap; | import android.graphics.Bitmap; | ||||
@@ -14,12 +13,9 @@ import android.graphics.RectF; | |||||
import android.os.Build; | import android.os.Build; | ||||
import android.os.Environment; | import android.os.Environment; | ||||
import android.view.View; | import android.view.View; | ||||
import com.google.gson.Gson; | import com.google.gson.Gson; | ||||
import org.json.JSONException; | import org.json.JSONException; | ||||
import org.json.JSONObject; | import org.json.JSONObject; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.InputStream; | import java.io.InputStream; | ||||
import java.util.HashMap; | import java.util.HashMap; | ||||
@@ -42,6 +42,7 @@ public class sp_adapter extends ArrayAdapter<BPA_GOODS> { | |||||
//分别获取 image view 和 textview 的实例 | //分别获取 image view 和 textview 的实例 | ||||
TextView name = view.findViewById(R.id.name); | TextView name = view.findViewById(R.id.name); | ||||
TextView sort = view.findViewById(R.id.sort); | TextView sort = view.findViewById(R.id.sort); | ||||
TextView status = view.findViewById(R.id.status); | |||||
TextView time = view.findViewById(R.id.time); | TextView time = view.findViewById(R.id.time); | ||||
Button button = view.findViewById(R.id.button_item); | Button button = view.findViewById(R.id.button_item); | ||||
@@ -49,11 +50,14 @@ public class sp_adapter extends ArrayAdapter<BPA_GOODS> { | |||||
Button button_down = view.findViewById(R.id.button_item_Down); | Button button_down = view.findViewById(R.id.button_item_Down); | ||||
Button button_update = view.findViewById(R.id.button_item_update); | Button button_update = view.findViewById(R.id.button_item_update); | ||||
Button button_xf = view.findViewById(R.id.button_xf); | Button button_xf = view.findViewById(R.id.button_xf); | ||||
Button button_qy = view.findViewById(R.id.button_qy); | |||||
Button button_jy = view.findViewById(R.id.button_jy); | |||||
// 设置要显示的图片和文字 | // 设置要显示的图片和文字 | ||||
name.setText(bpa_goods.name); | name.setText(bpa_goods.name); | ||||
time.setText(bpa_goods.createTime); | time.setText(bpa_goods.createTime); | ||||
sort.setText(bpa_goods.sort+""); | sort.setText(bpa_goods.sort+""); | ||||
status.setText(bpa_goods.status==1?"启用":"禁用"); | |||||
button.setOnClickListener(new View.OnClickListener() { | button.setOnClickListener(new View.OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View view) { | public void onClick(View view) { | ||||
@@ -114,6 +118,31 @@ public class sp_adapter extends ArrayAdapter<BPA_GOODS> { | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
button_qy.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
try | |||||
{ | |||||
mListener.clickListener(view,bpa_goods); | |||||
} catch (Exception e) | |||||
{ | |||||
T.show(view.getContext(),"商品启用出错:"+e.getMessage()); | |||||
} | |||||
} | |||||
}); | |||||
button_jy.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
try | |||||
{ | |||||
mListener.clickListener(view,bpa_goods); | |||||
} catch (Exception e) | |||||
{ | |||||
T.show(view.getContext(),"商品禁用出错:"+e.getMessage()); | |||||
} | |||||
} | |||||
}); | |||||
return view; | return view; | ||||
} | } | ||||
} | } |
@@ -5,22 +5,121 @@ import androidx.annotation.Nullable; | |||||
import androidx.appcompat.app.AppCompatActivity; | import androidx.appcompat.app.AppCompatActivity; | ||||
import androidx.fragment.app.Fragment; | import androidx.fragment.app.Fragment; | ||||
import android.content.Intent; | |||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import android.util.Log; | |||||
import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||
import android.view.View; | import android.view.View; | ||||
import android.view.ViewGroup; | import android.view.ViewGroup; | ||||
import android.widget.ListView; | |||||
import com.example.bpa.R; | import com.example.bpa.R; | ||||
import com.example.bpa.app.BusinessServer; | |||||
import com.example.bpa.db.QueryDB; | |||||
import com.example.bpa.db.mode.BPA_GOODS; | |||||
import com.example.bpa.helper.Json; | |||||
import com.example.bpa.helper.T; | |||||
import com.example.bpa.view.adapter.sp_adapter; | |||||
import com.example.bpa.view.from.add_pf_activity; | |||||
import com.example.bpa.view.from.yfpf_activity; | |||||
import com.example.bpa.view.inteface.MyClickListener; | |||||
import java.util.ArrayList; | |||||
/** | /** | ||||
* 主页界面 | * 主页界面 | ||||
*/ | */ | ||||
public class HomeFragment extends Fragment { | |||||
public class HomeFragment extends Fragment implements View.OnClickListener, MyClickListener { | |||||
//region 变量 | |||||
/** | |||||
* 界面实例 | |||||
*/ | |||||
public View view; | |||||
/** | |||||
* 表格显示 | |||||
*/ | |||||
public ListView datatab; | |||||
/** | |||||
* 商品数据 | |||||
*/ | |||||
public ArrayList<BPA_GOODS> bpa_goods=new ArrayList<>(); | |||||
//endregion | |||||
//region 私有函数 | |||||
@Nullable | @Nullable | ||||
@Override | @Override | ||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | ||||
View view = inflater.inflate(R.layout.fragment_home, container,false); | |||||
view = inflater.inflate(R.layout.fragment_home, container,false); | |||||
Init(); | |||||
return view; | return view; | ||||
} | } | ||||
//endregion | |||||
//region 公共函数 | |||||
/** | |||||
* 初始化 | |||||
*/ | |||||
private void Init(){ | |||||
datatab= view.findViewById(R.id.datatab); | |||||
Initdata();//初始化数据 | |||||
RegisterMessage();//消息中心事件接收 | |||||
} | |||||
/** | |||||
* 初始化按钮事件 | |||||
*/ | |||||
private void initEvents() { | |||||
} | |||||
/** | |||||
* 初始化数据加载 | |||||
*/ | |||||
public void Initdata() | |||||
{ | |||||
try{ | |||||
bpa_goods= QueryDB.GetGoodsALL(); | |||||
sp_adapter adapter = new sp_adapter(view.getContext(), R.layout.sp_item, bpa_goods,this); | |||||
datatab.setAdapter(adapter); | |||||
}catch(Exception e){ | |||||
} | |||||
} | |||||
//endregion | |||||
//region 点击事件 | |||||
/** | |||||
* 本页面点击事件监听22 | |||||
* | |||||
* @param v | |||||
*/ | |||||
@Override | |||||
public void onClick(View v) { | |||||
switch (v.getId()) { | |||||
case R.id.buttonaddpf://新建配方 | |||||
break; | |||||
} | |||||
} | |||||
/** | |||||
* 接口方法,响应ListView按钮点击事件 | |||||
*/ | |||||
@Override | |||||
public void clickListener(View v,Object data) { | |||||
switch (v.getId()) | |||||
{ | |||||
case R.id.button_item://删除按钮 | |||||
break; | |||||
} | |||||
} | |||||
//endregion | |||||
//region 接收事件 | |||||
public void RegisterMessage() | |||||
{ | |||||
} | |||||
//endregion | |||||
} | } |
@@ -17,6 +17,9 @@ import android.widget.Button; | |||||
import com.example.bpa.Model.IMessageLogNotify; | import com.example.bpa.Model.IMessageLogNotify; | ||||
import com.example.bpa.R; | import com.example.bpa.R; | ||||
import com.example.bpa.config.ConfigName; | |||||
import com.example.bpa.db.QueryDB; | |||||
import com.example.bpa.db.mode.BPA_LOG; | |||||
import com.example.bpa.helper.MessageLog; | import com.example.bpa.helper.MessageLog; | ||||
import com.example.bpa.view.fragment.setting.Fragment_lcparameter; | import com.example.bpa.view.fragment.setting.Fragment_lcparameter; | ||||
@@ -52,13 +55,19 @@ public class SystemSetFragment extends Fragment implements View.OnClickListener | |||||
@Override | @Override | ||||
public void ErrorMsg(String msg) { | public void ErrorMsg(String msg) { | ||||
Log.e("Error", msg); | Log.e("Error", msg); | ||||
} | } | ||||
@Override | @Override | ||||
public void InfoMsg(String msg) { | |||||
public void InfoMsg(String msg,String datetime) { | |||||
BPA_LOG log = new BPA_LOG(); | |||||
log.userID = ConfigName.getInstance().user.userID; | |||||
log.createTime = datetime; | |||||
log.type = 1; | |||||
log.text = msg; | |||||
QueryDB.Addlog(log); | |||||
Log.i("Info", msg); | Log.i("Info", msg); | ||||
} | } | ||||
@Override | @Override | ||||
public void WarnMsg(String msg) { | public void WarnMsg(String msg) { | ||||
Log.w("Warn", msg); | Log.w("Warn", msg); | ||||
@@ -11,18 +11,44 @@ import android.os.Bundle; | |||||
import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||
import android.view.View; | import android.view.View; | ||||
import android.view.ViewGroup; | import android.view.ViewGroup; | ||||
import android.widget.Button; | |||||
import android.widget.CompoundButton; | |||||
import android.widget.EditText; | |||||
import android.widget.LinearLayout; | import android.widget.LinearLayout; | ||||
import android.widget.Switch; | |||||
import com.example.bpa.Model.IWriteCallBack; | |||||
import com.example.bpa.R; | import com.example.bpa.R; | ||||
import com.example.bpa.app.DeviceData; | |||||
import com.example.bpa.helper.T; | |||||
public class Fragment_lcparameter extends Fragment { | |||||
import java.util.ArrayList; | |||||
import java.util.Arrays; | |||||
import java.util.List; | |||||
public class Fragment_lcparameter extends Fragment implements CompoundButton.OnCheckedChangeListener { | |||||
private View view; | private View view; | ||||
LinearLayout mylayout; | LinearLayout mylayout; | ||||
//通道校准值 | |||||
EditText passwayText_1,passwayText_2,passwayText_3,passwayText_4,passwayText_5,passwayText_6,passwayText_7,passwayText_8,passwayText_9,passwayText_10; | |||||
EditText timeText; | |||||
List<EditText> editTextLists = new ArrayList<EditText>(); | |||||
//通道校准开关 | |||||
Switch Switch_1,Switch_2,Switch_3,Switch_4,Switch_5,Switch_6,Switch_7,Switch_8,Switch_9,Switch_10; | |||||
List<Switch> switchLists = new ArrayList<Switch>(); | |||||
Button StartButton; | |||||
Button SaveButton; | |||||
@Override | @Override | ||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | ||||
view = inflater.inflate(R.layout.fragment_system_capabilities, container,false); | |||||
view = inflater.inflate(R.layout.fragment_lcparameter, container,false); | |||||
Init(); | Init(); | ||||
InitEvent(); | |||||
InitData(); | |||||
return view; | return view; | ||||
} | } | ||||
@@ -30,5 +56,200 @@ public class Fragment_lcparameter extends Fragment { | |||||
private void Init(){ | private void Init(){ | ||||
mylayout = view.findViewById(R.id.lcparameter_layout); | mylayout = view.findViewById(R.id.lcparameter_layout); | ||||
mylayout.setBackgroundColor(Color.TRANSPARENT); | mylayout.setBackgroundColor(Color.TRANSPARENT); | ||||
//校准数值 | |||||
passwayText_1 = view.findViewById(R.id.passwayText_1); | |||||
passwayText_2 = view.findViewById(R.id.passwayText_2); | |||||
passwayText_3 = view.findViewById(R.id.passwayText_3); | |||||
passwayText_4 = view.findViewById(R.id.passwayText_4); | |||||
passwayText_5 = view.findViewById(R.id.passwayText_5); | |||||
passwayText_6 = view.findViewById(R.id.passwayText_6); | |||||
passwayText_7 = view.findViewById(R.id.passwayText_7); | |||||
passwayText_8 = view.findViewById(R.id.passwayText_8); | |||||
passwayText_9 = view.findViewById(R.id.passwayText_9); | |||||
passwayText_10 = view.findViewById(R.id.passwayText_10); | |||||
editTextLists = Arrays.asList(passwayText_1,passwayText_2,passwayText_3,passwayText_4,passwayText_5,passwayText_6,passwayText_7,passwayText_8,passwayText_9,passwayText_10); | |||||
//校准开关 | |||||
Switch_1 = view.findViewById(R.id.Switch_1); | |||||
Switch_2 = view.findViewById(R.id.Switch_2); | |||||
Switch_3 = view.findViewById(R.id.Switch_3); | |||||
Switch_4 = view.findViewById(R.id.Switch_4); | |||||
Switch_5 = view.findViewById(R.id.Switch_5); | |||||
Switch_6 = view.findViewById(R.id.Switch_6); | |||||
Switch_7 = view.findViewById(R.id.Switch_7); | |||||
Switch_8 = view.findViewById(R.id.Switch_8); | |||||
Switch_9 = view.findViewById(R.id.Switch_9); | |||||
Switch_10 = view.findViewById(R.id.Switch_10); | |||||
//校准按钮 | |||||
StartButton = view.findViewById(R.id.StartButton); | |||||
timeText = view.findViewById(R.id.edi_time); | |||||
SaveButton = view.findViewById(R.id.savetime); | |||||
} | } | ||||
//点击事件 | |||||
private void InitEvent(){ | |||||
Switch_1.setOnCheckedChangeListener(this); | |||||
Switch_2.setOnCheckedChangeListener(this); | |||||
Switch_3.setOnCheckedChangeListener(this); | |||||
Switch_4.setOnCheckedChangeListener(this); | |||||
Switch_5.setOnCheckedChangeListener(this); | |||||
Switch_6.setOnCheckedChangeListener(this); | |||||
Switch_7.setOnCheckedChangeListener(this); | |||||
Switch_8.setOnCheckedChangeListener(this); | |||||
Switch_9.setOnCheckedChangeListener(this); | |||||
Switch_10.setOnCheckedChangeListener(this); | |||||
//开始校准 | |||||
StartButton.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View v) { | |||||
DeviceData.Get().setChStartCalibration(new IWriteCallBack() { | |||||
@Override | |||||
public void onSuccess() { | |||||
T.show(view.getContext(),"通道开始校准"); | |||||
} | |||||
@Override | |||||
public void onFailure(String ErrorMsg) { | |||||
T.show(view.getContext(),"通道开始校准失败"); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
SaveButton.setOnClickListener(new View.OnClickListener(){ | |||||
@Override | |||||
public void onClick(View v) { | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
try { | |||||
String stime = timeText.getText().toString(); | |||||
if(stime.equals("")){return;} | |||||
Float ftime = Float.parseFloat(stime); | |||||
DeviceData.Get().setCalibrationReferenceTime(ftime,new IWriteCallBack() { | |||||
@Override | |||||
public void onSuccess() { | |||||
T.show(view.getContext(),"校准时间写入成功"); | |||||
} | |||||
@Override | |||||
public void onFailure(String ErrorMsg) { | |||||
T.show(view.getContext(),"校准时间写入失败"); | |||||
} | |||||
}); | |||||
}catch (ArithmeticException e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
//初始化数据 | |||||
private void InitData(){ | |||||
//初始化标准值数据 | |||||
for (int i = 0; i <10;i++){ | |||||
String s = String.valueOf(DeviceData.Get().getCalibrationValue(i+1)); | |||||
editTextLists.get(i).setText(s); | |||||
} | |||||
String time = String.valueOf(DeviceData.Get().getCalibrationReferenceTime()); | |||||
timeText.setText(time); | |||||
} | |||||
//switch 事件 | |||||
@Override | |||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | |||||
switch (buttonView.getId()){ | |||||
case R.id.Switch_1: | |||||
SwitchClick(1,isChecked); | |||||
break; | |||||
case R.id.Switch_2: | |||||
SwitchClick(2,isChecked); | |||||
break; | |||||
case R.id.Switch_3: | |||||
SwitchClick(3,isChecked); | |||||
break; | |||||
case R.id.Switch_4: | |||||
SwitchClick(4,isChecked); | |||||
break; | |||||
case R.id.Switch_5: | |||||
SwitchClick(5,isChecked); | |||||
break; | |||||
case R.id.Switch_6: | |||||
SwitchClick(6,isChecked); | |||||
break; | |||||
case R.id.Switch_7: | |||||
SwitchClick(7,isChecked); | |||||
break; | |||||
case R.id.Switch_8: | |||||
SwitchClick(8,isChecked); | |||||
break; | |||||
case R.id.Switch_9: | |||||
SwitchClick(9,isChecked); | |||||
break; | |||||
case R.id.Switch_10: | |||||
SwitchClick(10,isChecked); | |||||
break; | |||||
} | |||||
} | |||||
private void SwitchClick(int index, boolean isChecked){ | |||||
StringBuffer sb = new StringBuffer("PLC写入:"); | |||||
new Thread (new Runnable() { | |||||
public void run() { | |||||
if (isChecked){ //校准开关开启状态才会写入值 | |||||
String value = editTextLists.get(index-1).getText().toString(); | |||||
DeviceData.Get().setCalibrationValue(Short.parseShort(value),index, new IWriteCallBack() { | |||||
@Override | |||||
public void onSuccess() { | |||||
sb.append("通道"); | |||||
sb.append(index); | |||||
sb.append("校准值写入成功;"); | |||||
} | |||||
@Override | |||||
public void onFailure(String ErrorMsg) { | |||||
sb.append("通道"); | |||||
sb.append(index); | |||||
sb.append("校准值写入失败;"); | |||||
} | |||||
}); | |||||
} | |||||
DeviceData.Get().setChCalibrationSwitch(isChecked, index, new IWriteCallBack() { | |||||
@Override | |||||
public void onSuccess() { | |||||
sb.append("通道"); | |||||
sb.append(index); | |||||
sb.append("校准开关成功;"); | |||||
} | |||||
@Override | |||||
public void onFailure(String ErrorMsg) { | |||||
sb.append("通道"); | |||||
sb.append(index); | |||||
sb.append("校准开关失败;"); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
T.show(view.getContext(), sb.toString()); | |||||
} | |||||
} | } |
@@ -204,7 +204,7 @@ public class add_pf_activity extends AppCompatActivity implements View.OnClickLi | |||||
BPA_GOODS goodx = new BPA_GOODS(); | BPA_GOODS goodx = new BPA_GOODS(); | ||||
goodx.name = name; | goodx.name = name; | ||||
goodx.sort = bpa_goods.size() + 1; | goodx.sort = bpa_goods.size() + 1; | ||||
goodx.status = 1; | |||||
goodx.status = 0; | |||||
goodx.deviceID = ConfigName.getInstance().DeviceId; | goodx.deviceID = ConfigName.getInstance().DeviceId; | ||||
goodx.userID = ConfigName.getInstance().user.userID; | goodx.userID = ConfigName.getInstance().user.userID; | ||||
QueryDB.AddGoods(goodx); | QueryDB.AddGoods(goodx); | ||||
@@ -48,8 +48,8 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList | |||||
RecyclerView recyclerView; | RecyclerView recyclerView; | ||||
//物料listview | //物料listview | ||||
ListView materiallist; | ListView materiallist; | ||||
//materiallist父控件 | |||||
View material_parent; | |||||
//物料列表 | //物料列表 | ||||
ArrayList<BPA_MATERIAL> bpa_materials=new ArrayList<>(); | ArrayList<BPA_MATERIAL> bpa_materials=new ArrayList<>(); | ||||
//当前选中的料仓id | //当前选中的料仓id | ||||
@@ -79,6 +79,7 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList | |||||
//横向排列 | //横向排列 | ||||
recyclerView = this.findViewById(R.id.lc_view); | recyclerView = this.findViewById(R.id.lc_view); | ||||
materiallist = this.findViewById(R.id.materials); | materiallist = this.findViewById(R.id.materials); | ||||
material_parent =(View) materiallist.getParent(); | |||||
try { | try { | ||||
//加载 recyclercview数据 | //加载 recyclercview数据 | ||||
MyLayoutManager layout = new MyLayoutManager(); | MyLayoutManager layout = new MyLayoutManager(); | ||||
@@ -91,18 +92,23 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList | |||||
//加载materials数据 | //加载materials数据 | ||||
if(bpa_silos.size()>0){ | if(bpa_silos.size()>0){ | ||||
for (BPA_SILOS silo : bpa_silos){ | for (BPA_SILOS silo : bpa_silos){ | ||||
String resmaterialid = QueryDB.GetMaterialList(silo.id).size()==0? "-1" : QueryDB.GetMaterialList(silo.id).get(0); | |||||
String material_name = "未设置"; | |||||
String material_id = ""; | |||||
if (resmaterialid != "-1"){ | |||||
BPA_MATERIAL res= QueryDB.GetMaterialbyid(resmaterialid); | |||||
if (res!=null) { | |||||
material_name = res.name; | |||||
material_id = res.id; | |||||
} | |||||
// String resmaterialid = QueryDB.GetMaterialList(silo.id).size()==0? "-1" : QueryDB.GetMaterialList(silo.id).get(0); | |||||
// String material_name = "未设置"; | |||||
// String material_id = ""; | |||||
// if (resmaterialid != "-1"){ | |||||
// BPA_MATERIAL res= QueryDB.GetMaterialbyid(resmaterialid); | |||||
// if (res!=null) { | |||||
// material_name = res.name; | |||||
// material_id = res.id; | |||||
// } | |||||
// | |||||
// } | |||||
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | |||||
if(m.size()>0) { | |||||
datas.add(new lcMode(silo.id, silo.num, m.get(0).name, "", m.get(0).id)); | |||||
}else { | |||||
datas.add(new lcMode(silo.id, silo.num, "未设置", "", "")); | |||||
} | } | ||||
datas.add(new lcMode(silo.id,silo.num,material_name,"",material_id)); | |||||
} | } | ||||
} | } | ||||
@@ -156,8 +162,7 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList | |||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | ||||
ArrayAdapter viewHolder = (ArrayAdapter)materiallist.getAdapter(); | ArrayAdapter viewHolder = (ArrayAdapter)materiallist.getAdapter(); | ||||
if (viewHolder instanceof selectitem_adapter){ | if (viewHolder instanceof selectitem_adapter){ | ||||
View listViewParent = (View) materiallist.getParent(); | |||||
listViewParent.setVisibility(View.GONE); | |||||
material_parent.setVisibility(View.GONE);//隐藏父控件 | |||||
if (currentSilo!=null){ | if (currentSilo!=null){ | ||||
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | ||||
item.silosID = currentSilo.id; | item.silosID = currentSilo.id; | ||||
@@ -174,6 +179,14 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
//region materials父控件点击事件 | |||||
material_parent.setOnClickListener(new View.OnClickListener(){ | |||||
@Override | |||||
public void onClick(View v) { | |||||
material_parent.setVisibility(View.GONE);//隐藏materiallist | |||||
} | |||||
}); | |||||
//endregion | //endregion | ||||
} | } | ||||
@@ -179,6 +179,20 @@ public class yfpf_activity extends AppCompatActivity implements View.OnClickList | |||||
BusinessServer.get().AddCommodity(((BPA_GOODS)data).id); | BusinessServer.get().AddCommodity(((BPA_GOODS)data).id); | ||||
T.show(this, "下发成功!"); | T.show(this, "下发成功!"); | ||||
break; | break; | ||||
case R.id.button_qy://启用按钮 | |||||
BPA_GOODS good3=(BPA_GOODS)data; | |||||
good3.status=1; | |||||
QueryDB.UpdateGoods(good3); | |||||
Initdata(); | |||||
T.show(this, good3.name+"-启用成功!"); | |||||
break; | |||||
case R.id.button_jy://下发按钮 | |||||
BPA_GOODS good4=(BPA_GOODS)data; | |||||
good4.status=0; | |||||
QueryDB.UpdateGoods(good4); | |||||
Initdata(); | |||||
T.show(this, good4.name+"-禁用成功!"); | |||||
break; | |||||
} | } | ||||
} | } | ||||
//endregion | //endregion | ||||
@@ -1,13 +1,24 @@ | |||||
package com.example.bpa.view.from; | package com.example.bpa.view.from; | ||||
import static com.example.bpa.helper.T.show; | |||||
import androidx.appcompat.app.AppCompatActivity; | import androidx.appcompat.app.AppCompatActivity; | ||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import android.view.View; | import android.view.View; | ||||
import android.widget.Button; | |||||
import android.widget.CompoundButton; | |||||
import android.widget.EditText; | |||||
import android.widget.ImageView; | import android.widget.ImageView; | ||||
import android.widget.ProgressBar; | |||||
import android.widget.Switch; | |||||
import android.widget.TextView; | import android.widget.TextView; | ||||
import com.example.bpa.Model.IWriteCallBack; | |||||
import com.example.bpa.R; | import com.example.bpa.R; | ||||
import com.example.bpa.app.DeviceData; | |||||
import com.example.bpa.db.QueryDB; | |||||
import com.example.bpa.helper.T; | |||||
/** | /** | ||||
* 自动清洗 | * 自动清洗 | ||||
@@ -22,6 +33,18 @@ public class zdqx_activity extends AppCompatActivity implements View.OnClickList | |||||
* 标题设置 | * 标题设置 | ||||
*/ | */ | ||||
TextView gongneng_title; | TextView gongneng_title; | ||||
//参数 | |||||
EditText edit_pstime,edit_jstime,edit_jqxjtime,edit_xhtime; | |||||
//按钮 | |||||
Button bt_save,bt_start; | |||||
//switch | |||||
Switch qsmode; | |||||
//进度条 | |||||
ProgressBar progress_bar; | |||||
// TextView progress_text; | |||||
boolean mValue = false; | |||||
//endregion | //endregion | ||||
//region 私有函数 | //region 私有函数 | ||||
@@ -31,6 +54,8 @@ public class zdqx_activity extends AppCompatActivity implements View.OnClickList | |||||
setContentView(R.layout.activity_zdqx); | setContentView(R.layout.activity_zdqx); | ||||
Init(); | Init(); | ||||
initEvents(); | initEvents(); | ||||
InitData(); | |||||
startListening(); | |||||
} | } | ||||
//endregion | //endregion | ||||
@@ -42,11 +67,20 @@ public class zdqx_activity extends AppCompatActivity implements View.OnClickList | |||||
private void Init(){ | private void Init(){ | ||||
gongneng_fanhui = this.findViewById(R.id.gongneng_fanhui); | gongneng_fanhui = this.findViewById(R.id.gongneng_fanhui); | ||||
gongneng_title = this.findViewById(R.id.gongneng_title); | gongneng_title = this.findViewById(R.id.gongneng_title); | ||||
edit_pstime = this.findViewById(R.id.edit_pstime); | |||||
edit_jstime = this.findViewById(R.id.edit_jstime); | |||||
edit_jqxjtime = this.findViewById(R.id.edit_jqxjtime); | |||||
edit_xhtime = this.findViewById(R.id.edit_xhtime); | |||||
bt_save = this.findViewById(R.id.bt_save); | |||||
bt_start = this.findViewById(R.id.bt_start); | |||||
qsmode = this.findViewById(R.id.qsmode); | |||||
progress_bar = this.findViewById(R.id.progress_bar); | |||||
// progress_text = this.findViewById(R.id.progress_text); | |||||
//通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据 | //通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据 | ||||
String msg=getIntent().getStringExtra("data"); | String msg=getIntent().getStringExtra("data"); | ||||
gongneng_title.setText(msg); | gongneng_title.setText(msg); | ||||
((TextView)this.findViewById(R.id.test_view)).setText(msg); | |||||
} | } | ||||
/** | /** | ||||
@@ -54,6 +88,68 @@ public class zdqx_activity extends AppCompatActivity implements View.OnClickList | |||||
*/ | */ | ||||
private void initEvents() { | private void initEvents() { | ||||
gongneng_fanhui.setOnClickListener(this); | gongneng_fanhui.setOnClickListener(this); | ||||
bt_save.setOnClickListener(this); | |||||
bt_start.setOnClickListener(this); | |||||
qsmode.setOnCheckedChangeListener(new Switch.OnCheckedChangeListener() { | |||||
@Override | |||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
try { | |||||
DeviceData.Get().setCleaningMode(isChecked,null);//设置清洗模式 | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
private void InitData(){ | |||||
edit_pstime.setText(String.valueOf(DeviceData.Get().getDrainageTime()));//排水 | |||||
edit_jstime.setText(String.valueOf(DeviceData.Get().getInletTime()));//进水 | |||||
edit_jqxjtime.setText(String.valueOf(DeviceData.Get().getAddCleaningAgentTime()));//加清洗剂时间 | |||||
edit_xhtime.setText(String.valueOf(DeviceData.Get().getCyclicCleaningTime()));//循环清洗 | |||||
qsmode.setChecked(DeviceData.Get().getCleaningMode()); | |||||
progress_bar.setProgress(0); | |||||
//progress_bar.setIndeterminate(true); // 将进度条设置为不确定状态 | |||||
} | |||||
/** | |||||
* 监听外部数据变化 | |||||
*/ | |||||
private void startListening(){ | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
while (true) { | |||||
try { | |||||
if (SetValue(mValue,DeviceData.Get().getCleaningMode())) { | |||||
runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
progress_bar.setIndeterminate(false);//停止旋转 | |||||
progress_bar.setProgress(100);//进度条设置为100% | |||||
bt_start.setText("清洗完成"); | |||||
// T.show(zdqx_activity.this,"清洗完成"); | |||||
} | |||||
}); | |||||
} | |||||
Thread.sleep(1000); | |||||
}catch (Exception e) { | |||||
} | |||||
} | |||||
} | |||||
}).start(); | |||||
} | } | ||||
//endregion | //endregion | ||||
@@ -69,7 +165,81 @@ public class zdqx_activity extends AppCompatActivity implements View.OnClickList | |||||
case R.id.gongneng_fanhui://返回按钮 | case R.id.gongneng_fanhui://返回按钮 | ||||
this.finish(); | this.finish(); | ||||
break; | break; | ||||
case R.id.bt_save://保存 | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
try { | |||||
if (!edit_pstime.getText().toString().equals("")) { | |||||
DeviceData.Get().setDrainageTime(Short.parseShort(edit_pstime.getText().toString()),null); | |||||
Thread.sleep(200); | |||||
} | |||||
if (!edit_jstime.getText().toString().equals("")) { | |||||
DeviceData.Get().setInletTime(Short.parseShort(edit_jstime.getText().toString()),null); | |||||
Thread.sleep(200); | |||||
} | |||||
if (!edit_jqxjtime.getText().toString().equals("")) { | |||||
DeviceData.Get().setAddCleaningAgentTime(Short.parseShort(edit_jqxjtime.getText().toString()),null); | |||||
Thread.sleep(200); | |||||
} | |||||
if (!edit_xhtime.getText().toString().equals("")) { | |||||
DeviceData.Get().setCyclicCleaningTime(Short.parseShort(edit_xhtime.getText().toString()),null); | |||||
Thread.sleep(200); | |||||
} | |||||
}catch (InterruptedException e) { | |||||
}catch (Exception e) { | |||||
} | |||||
} | |||||
}); | |||||
break; | |||||
case R.id.bt_start://开始清洗 | |||||
new Thread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
try { | |||||
DeviceData.Get().setStartCleaning(new IWriteCallBack() { | |||||
@Override | |||||
public void onSuccess() { | |||||
//UI线程操作UI控件 | |||||
runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
progress_bar.setVisibility(View.VISIBLE); | |||||
progress_bar.setIndeterminate(true);//进度条开始旋转 | |||||
bt_start.setText("开始清洗"); | |||||
} | |||||
}); | |||||
} | |||||
@Override | |||||
public void onFailure(String ErrorMsg) { | |||||
} | |||||
}); | |||||
} catch (Exception e) { | |||||
} | |||||
} | |||||
}); | |||||
break; | |||||
} | } | ||||
} | } | ||||
//endregion | //endregion | ||||
//判断boolen 从fales变成true | |||||
private boolean SetValue(boolean value, boolean newValue) { | |||||
boolean mflag = value; | |||||
if (newValue && !mflag) { // 当新值为 true 且前一个值为 false 时,发出通知 | |||||
value = newValue; // 更新标志变量的值 | |||||
return true; | |||||
} | |||||
value = newValue; // 更新标志变量的值 | |||||
return false; | |||||
} | |||||
} | } |
@@ -0,0 +1,44 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<!-- Button 被按下时的样式 --> | |||||
<item android:state_pressed="true"> | |||||
<shape android:shape="oval"> | |||||
<gradient | |||||
android:startColor="#FF4081" | |||||
android:endColor="#FF6699" | |||||
android:type="sweep" | |||||
android:angle="45" /> | |||||
<padding | |||||
android:left="10dp" | |||||
android:top="10dp" | |||||
android:right="10dp" | |||||
android:bottom="10dp" /> | |||||
<stroke | |||||
android:width="2dp" | |||||
android:color="#FF4081" /> | |||||
</shape> | |||||
</item> | |||||
<!-- Button 正常状态下的样式 --> | |||||
<item> | |||||
<shape android:shape="oval"> | |||||
<gradient | |||||
android:startColor="#0088ff" | |||||
android:endColor="#006bff" | |||||
android:type="linear" | |||||
android:angle="45" /> | |||||
<padding | |||||
android:left="5dp" | |||||
android:top="5dp" | |||||
android:right="10dp" | |||||
android:bottom="10dp" /> | |||||
<stroke | |||||
android:width="2dp" | |||||
android:color="#444444" /> | |||||
</shape> | |||||
</item> | |||||
</selector> |
@@ -0,0 +1,11 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" | |||||
android:shape="rectangle"> | |||||
<gradient | |||||
android:startColor="#009688" | |||||
android:endColor="#00BCD4" | |||||
android:type="linear" | |||||
android:angle="90" /> | |||||
</selector> |
@@ -5,7 +5,7 @@ | |||||
<stroke | <stroke | ||||
android:width="2dp" | android:width="2dp" | ||||
android:color="#007AFF" /> | android:color="#007AFF" /> | ||||
<solid android:color="@color/test" /> | |||||
<solid android:color="#FF092B51" /> | |||||
<corners | <corners | ||||
android:radius="20dp" /> | android:radius="20dp" /> | ||||
</shape> | </shape> |
@@ -0,0 +1,19 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<item android:state_checked="true"> | |||||
<shape android:shape="rectangle"> | |||||
<corners android:radius="30dp" /> | |||||
<solid android:color="#2ecc71" /> | |||||
<padding android:left="10dp" /> | |||||
</shape> | |||||
</item> | |||||
<item android:state_checked="false"> | |||||
<shape android:shape="rectangle"> | |||||
<corners android:radius="30dp" /> | |||||
<solid android:color="#d1f2eb" /> | |||||
<padding android:left="10dp" /> | |||||
</shape> | |||||
</item> | |||||
</selector> |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<item android:state_checked="true" android:color="@android:color/white" /> | |||||
<item android:state_checked="false" android:color="#8A8A8A" /> | |||||
</selector> |
@@ -17,7 +17,9 @@ | |||||
<stroke | <stroke | ||||
android:width="2dp" | android:width="2dp" | ||||
android:color="#FF4081" /> | android:color="#FF4081" /> | ||||
</shape> | </shape> | ||||
</item> | </item> | ||||
<!-- Button 正常状态下的样式 --> | <!-- Button 正常状态下的样式 --> | ||||
@@ -18,7 +18,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_weight="1"> | |||||
android:layout_weight="2"> | |||||
<TextView | <TextView | ||||
android:id="@+id/name" | android:id="@+id/name" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
@@ -33,7 +33,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_weight="1"> | |||||
android:layout_weight="2"> | |||||
<TextView | <TextView | ||||
android:id="@+id/time" | android:id="@+id/time" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
@@ -48,7 +48,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_weight="1"> | |||||
android:layout_weight="0.5"> | |||||
<TextView | <TextView | ||||
android:id="@+id/sort" | android:id="@+id/sort" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
@@ -63,7 +63,22 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_weight="2.3"> | |||||
android:layout_weight="0.5"> | |||||
<TextView | |||||
android:id="@+id/status" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="回锅肉" | |||||
android:textColor="@color/foreground" | |||||
android:textSize="@dimen/textSize" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="5"> | |||||
<LinearLayout | <LinearLayout | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent"> | android:layout_height="match_parent"> | ||||
@@ -75,7 +90,7 @@ | |||||
android:textColor="@color/foreground" | android:textColor="@color/foreground" | ||||
android:layout_centerVertical="true" | android:layout_centerVertical="true" | ||||
android:layout_marginLeft="20dp" | android:layout_marginLeft="20dp" | ||||
android:layout_width="60dp" | |||||
android:layout_width="40dp" | |||||
android:layout_height="26dp" | android:layout_height="26dp" | ||||
/> | /> | ||||
<Button | <Button | ||||
@@ -86,7 +101,7 @@ | |||||
android:textColor="@color/foreground" | android:textColor="@color/foreground" | ||||
android:layout_centerVertical="true" | android:layout_centerVertical="true" | ||||
android:layout_marginLeft="20dp" | android:layout_marginLeft="20dp" | ||||
android:layout_width="60dp" | |||||
android:layout_width="40dp" | |||||
android:layout_height="26dp" | android:layout_height="26dp" | ||||
/> | /> | ||||
<Button | <Button | ||||
@@ -97,7 +112,7 @@ | |||||
android:textColor="@color/foreground" | android:textColor="@color/foreground" | ||||
android:layout_centerVertical="true" | android:layout_centerVertical="true" | ||||
android:layout_marginLeft="20dp" | android:layout_marginLeft="20dp" | ||||
android:layout_width="60dp" | |||||
android:layout_width="40dp" | |||||
android:layout_height="26dp" | android:layout_height="26dp" | ||||
/> | /> | ||||
<Button | <Button | ||||
@@ -108,12 +123,34 @@ | |||||
android:textColor="@color/foreground" | android:textColor="@color/foreground" | ||||
android:layout_centerVertical="true" | android:layout_centerVertical="true" | ||||
android:layout_marginLeft="20dp" | android:layout_marginLeft="20dp" | ||||
android:layout_width="60dp" | |||||
android:layout_width="40dp" | |||||
android:layout_height="26dp" | |||||
/> | |||||
<Button | |||||
android:id="@+id/button_qy" | |||||
android:text="启用" | |||||
android:background="@drawable/btn_button" | |||||
android:textSize="@dimen/textSize" | |||||
android:textColor="@color/foreground" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_width="40dp" | |||||
android:layout_height="26dp" | |||||
/> | |||||
<Button | |||||
android:id="@+id/button_jy" | |||||
android:text="禁用" | |||||
android:background="@drawable/btn_button" | |||||
android:textSize="@dimen/textSize" | |||||
android:textColor="@color/foreground" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_width="40dp" | |||||
android:layout_height="26dp" | android:layout_height="26dp" | ||||
/> | /> | ||||
<Button | <Button | ||||
android:id="@+id/button_xf" | android:id="@+id/button_xf" | ||||
android:text="下发制作" | |||||
android:text="模拟订单" | |||||
android:background="@drawable/btn_button" | android:background="@drawable/btn_button" | ||||
android:textSize="@dimen/textSize" | android:textSize="@dimen/textSize" | ||||
android:textColor="@color/foreground" | android:textColor="@color/foreground" | ||||
@@ -141,7 +141,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="1"> | |||||
android:layout_weight="2"> | |||||
<TextView | <TextView | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
@@ -154,7 +154,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="1"> | |||||
android:layout_weight="2"> | |||||
<TextView | <TextView | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
@@ -167,7 +167,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="1"> | |||||
android:layout_weight="0.5"> | |||||
<TextView | <TextView | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
@@ -180,7 +180,20 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="2"> | |||||
android:layout_weight="0.5"> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="状态" | |||||
android:textColor="@color/dataGridColumnHeaderColor" | |||||
android:textSize="@dimen/textSize" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="5"> | |||||
<TextView | <TextView | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
@@ -190,7 +203,6 @@ | |||||
android:textColor="@color/dataGridColumnHeaderColor" | android:textColor="@color/dataGridColumnHeaderColor" | ||||
android:textSize="@dimen/textSize" /> | android:textSize="@dimen/textSize" /> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
</TableRow> | </TableRow> | ||||
</TableLayout> | </TableLayout> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
@@ -75,17 +75,188 @@ | |||||
android:layout_alignParentRight="true" | android:layout_alignParentRight="true" | ||||
android:layout_alignParentBottom="true" | android:layout_alignParentBottom="true" | ||||
android:src="@mipmap/yx"/> | android:src="@mipmap/yx"/> | ||||
<RelativeLayout | |||||
<LinearLayout | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_margin="10dp"> | |||||
<TextView | |||||
android:id="@+id/test_view" | |||||
android:layout_marginStart="10dp" | |||||
android:layout_marginTop="10dp" | |||||
android:layout_marginEnd="10dp" | |||||
android:layout_marginBottom="10dp" | |||||
android:orientation="vertical"> | |||||
<TableLayout | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:textColor="@color/foreground" | |||||
android:textSize="@dimen/TitleSize"> | |||||
</TextView> | |||||
</RelativeLayout> | |||||
android:layout_gravity="center" | |||||
> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_margin="10dp"> | |||||
<LinearLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_margin="10dp" | |||||
android:orientation="vertical"> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:gravity="center" | |||||
android:text="排水阀排水时间:" | |||||
android:textColor="@color/white" /> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:gravity="center" | |||||
android:text="进水阀进水时间:" | |||||
android:textColor="@color/white" /> | |||||
</LinearLayout> | |||||
<LinearLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginTop="10dp" | |||||
android:layout_marginRight="30dp" | |||||
android:layout_marginBottom="10dp" | |||||
android:orientation="vertical"> | |||||
<EditText | |||||
android:id="@+id/edit_pstime" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:backgroundTint="@color/colorAccent" | |||||
android:gravity="center" | |||||
android:minWidth="50dp" | |||||
android:textColor="@color/white" /> | |||||
<EditText | |||||
android:id="@+id/edit_jstime" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:backgroundTint="@color/colorAccent" | |||||
android:gravity="center" | |||||
android:minWidth="50dp" | |||||
android:textColor="@color/white" /> | |||||
</LinearLayout> | |||||
<LinearLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_margin="10dp" | |||||
android:orientation="vertical"> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:gravity="center" | |||||
android:text="加清洗剂时间:" | |||||
android:textColor="@color/white" /> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:gravity="center" | |||||
android:text="循环清洗时间:" | |||||
android:textColor="@color/white" /> | |||||
</LinearLayout> | |||||
<LinearLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginTop="10dp" | |||||
android:layout_marginRight="30dp" | |||||
android:layout_marginBottom="10dp" | |||||
android:orientation="vertical"> | |||||
<EditText | |||||
android:id="@+id/edit_jqxjtime" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:backgroundTint="@color/colorAccent" | |||||
android:gravity="center" | |||||
android:minWidth="50dp" | |||||
android:textColor="@color/white" /> | |||||
<EditText | |||||
android:id="@+id/edit_xhtime" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:layout_margin="5dp" | |||||
android:backgroundTint="@color/colorAccent" | |||||
android:gravity="center" | |||||
android:minWidth="50dp" | |||||
android:textColor="@color/white" /> | |||||
</LinearLayout> | |||||
</TableRow> | |||||
</TableLayout> | |||||
<LinearLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:orientation="horizontal" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="20dp"> | |||||
<Button | |||||
android:id="@+id/bt_save" | |||||
android:layout_width="140dp" | |||||
android:layout_height="40dp" | |||||
android:background="@drawable/settingbutton" | |||||
android:text="保存" | |||||
android:layout_marginRight="50dp" | |||||
android:textColor="@color/white" /> | |||||
<Switch | |||||
android:id="@+id/qsmode" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="40dp" | |||||
android:background="@drawable/qs_switch" | |||||
android:layout_marginLeft="40dp" | |||||
android:text="清洗模式启动" | |||||
android:textColor="@drawable/qs_textcolor" | |||||
android:thumbTint="@android:color/white" | |||||
android:trackTint="@android:color/white" /> | |||||
</LinearLayout> | |||||
<LinearLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center_horizontal" | |||||
android:layout_margin="20dp"> | |||||
<Button | |||||
android:id="@+id/bt_start" | |||||
android:layout_width="120dp" | |||||
android:layout_height="80dp" | |||||
android:background="@drawable/bt_circular" | |||||
android:text="开始清洗" | |||||
android:textColor="@color/white" /> | |||||
</LinearLayout> | |||||
<ProgressBar | |||||
android:id="@+id/progress_bar" | |||||
style="?android:attr/progressBarStyleHorizontal" | |||||
android:layout_width="400dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:visibility="visible" | |||||
android:layout_centerInParent="true" | |||||
android:duration="3000" | |||||
android:indeterminate="true" | |||||
android:max="100" /> | |||||
</LinearLayout> | |||||
</RelativeLayout> | </RelativeLayout> | ||||
</LinearLayout> | </LinearLayout> |
@@ -12,37 +12,320 @@ | |||||
android:layout_gravity="center" | android:layout_gravity="center" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content"> | android:layout_height="wrap_content"> | ||||
<!-- Table1--> | |||||
<TableRow | <TableRow | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_gravity="center" | android:layout_gravity="center" | ||||
android:layout_margin="10dp"> | |||||
android:layout_margin="5dp"> | |||||
<TextView | <TextView | ||||
android:layout_marginRight="5dp" | |||||
android:text="通道一校准"/> | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道一:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | <EditText | ||||
android:id="@+id/passwayText_1" | |||||
android:minWidth="60dp" | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_marginRight="5dp" | |||||
android:hint="校准值"/> | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_1" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道二:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_2" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:minWidth="60dp" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_2" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
</TableRow> | |||||
<!-- Table3--> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="5dp"> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道三:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_3" | |||||
android:minWidth="60dp" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_3" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道四:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_4" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:minWidth="60dp" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | <Switch | ||||
android:id="@+id/Switch_4" | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:text="校准" | |||||
android:layout_marginRight="40dp"/> | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
</TableRow> | |||||
<!-- Table3--> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="5dp"> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道五:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_5" | |||||
android:minWidth="60dp" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_5" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
<TextView | <TextView | ||||
android:layout_marginRight="5dp" | |||||
android:text="通道二校准"/> | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道六:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | <EditText | ||||
android:id="@+id/passwayText_6" | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_marginRight="5dp" | |||||
android:hint="校准值"/> | |||||
android:minWidth="60dp" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | <Switch | ||||
android:id="@+id/Switch_6" | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:text="校准开关"/> | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
</TableRow> | |||||
<!-- Table4--> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="5dp"> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道七:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_7" | |||||
android:minWidth="60dp" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_7" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道八:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_8" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:minWidth="60dp" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_8" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
</TableRow> | |||||
<!-- Table5--> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="5dp"> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道九:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_9" | |||||
android:minWidth="60dp" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_9" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
<TextView | |||||
android:layout_marginRight="15dp" | |||||
android:text="通道十:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold"/> | |||||
<EditText | |||||
android:id="@+id/passwayText_10" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:minWidth="60dp" | |||||
android:layout_marginRight="15dp" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Switch | |||||
android:id="@+id/Switch_10" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准开关" | |||||
android:layout_marginRight="40dp" | |||||
android:textColor="@color/white"/> | |||||
</TableRow> | </TableRow> | ||||
</TableLayout> | </TableLayout> | ||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content"> | |||||
<Button | |||||
android:id="@+id/StartButton" | |||||
android:layout_marginTop="10dp" | |||||
android:layout_marginBottom="5dp" | |||||
android:layout_width="90dp" | |||||
android:layout_height="90dp" | |||||
android:layout_gravity="center" | |||||
android:layout_centerHorizontal="true" | |||||
android:background="@drawable/bt_circular" | |||||
android:textColor="@color/white" | |||||
android:text="开始 | |||||
校准" | |||||
android:textSize="16dp"/> | |||||
<TableLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="match_parent" | |||||
android:layout_alignParentRight="true" | |||||
android:layout_marginTop="10dp" | |||||
android:layout_marginLeft="5dp" | |||||
> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="5dp"> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="校准基准时间:" | |||||
android:textColor="@color/white" | |||||
android:textStyle="bold" | |||||
android:gravity="center" | |||||
android:textSize="16dp"/> | |||||
</TableRow> | |||||
<TableRow | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_gravity="center" | |||||
android:layout_margin="5dp"> | |||||
<EditText | |||||
android:id="@+id/edi_time" | |||||
android:minWidth="60dp" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:textColor="@color/white" | |||||
android:backgroundTint="@color/colorAccent"/> | |||||
<Button | |||||
android:id="@+id/savetime" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="30dp" | |||||
android:text="保存" | |||||
android:layout_gravity="center" | |||||
android:background="@drawable/btn_button"/> | |||||
</TableRow> | |||||
</TableLayout> | |||||
</RelativeLayout> | |||||
</LinearLayout> | </LinearLayout> |
@@ -8,7 +8,11 @@ | |||||
tools:context=".view.fragment.SystemSetFragment"> | tools:context=".view.fragment.SystemSetFragment"> | ||||
<TableLayout | <TableLayout | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="wrap_content"> | |||||
android:layout_height="match_parent" | |||||
android:layout_marginTop="10dp" | |||||
android:layout_marginRight="5dp" | |||||
android:background="@drawable/lcbg_border" | |||||
> | |||||
<Button | <Button | ||||
android:id="@+id/stparameter" | android:id="@+id/stparameter" | ||||
android:text="系统参数" | android:text="系统参数" | ||||
@@ -18,17 +22,19 @@ | |||||
/> | /> | ||||
<Button | <Button | ||||
android:id="@+id/lcparameter" | android:id="@+id/lcparameter" | ||||
android:text="料仓设置" | |||||
android:text="料仓校准" | |||||
android:background="@drawable/settingbutton" | android:background="@drawable/settingbutton" | ||||
android:layout_margin="10dp" | android:layout_margin="10dp" | ||||
android:textColor="@color/white" | android:textColor="@color/white" | ||||
/> | /> | ||||
</TableLayout> | </TableLayout> | ||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_margin="10dp"> | |||||
android:layout_marginTop="10dp" | |||||
android:background="@drawable/lcbg_border"> | |||||
<FrameLayout | <FrameLayout | ||||
android:id="@+id/fragment_container" | android:id="@+id/fragment_container" | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
@@ -16,6 +16,7 @@ | |||||
<resources> | <resources> | ||||
<color name="test">#FF061B51</color> | <color name="test">#FF061B51</color> | ||||
<color name="setting">#FF061B51</color> | |||||
<color name="colorPrimary">#0A1026</color> | <color name="colorPrimary">#0A1026</color> | ||||
<color name="colorPrimaryDark">#0A1026</color> | <color name="colorPrimaryDark">#0A1026</color> | ||||
<color name="colorAccent">#F57F17</color> | <color name="colorAccent">#F57F17</color> | ||||