@@ -33,6 +33,12 @@ | |||
tools:ignore="GoogleAppIndexingWarning" | |||
tools:node="merge" | |||
tools:replace="android:icon"> | |||
<activity | |||
android:name=".modules.home.fragment.mode.Silos_item_fragment" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.SilosNewActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.mine.fragment.from.UserActivity" | |||
android:exported="false" /> | |||
@@ -846,6 +846,10 @@ public class ConfigName { | |||
add(new Res_PLCADDRESS1("M51.4","M101.4","粉料仓控制(1)",0,1)); | |||
add(new Res_PLCADDRESS1("M51.5","M101.5","粉料仓控制(2)",0,1)); | |||
add(new Res_PLCADDRESS1("M51.6","M101.6","粉料仓控制(3)",0,1)); | |||
add(new Res_PLCADDRESS1("M52.3","M102.3","粉料仓控制(4)",0,1)); | |||
add(new Res_PLCADDRESS1("M52.4","M102.4","粉料仓控制(5)",0,1)); | |||
add(new Res_PLCADDRESS1("M52.5","M102.5","粉料仓控制(6)",0,1)); | |||
add(new Res_PLCADDRESS1("-------------","","水池",1,0)); | |||
add(new Res_PLCADDRESS1("M53.4","M103.4","水池进水阀",1,1)); | |||
add(new Res_PLCADDRESS1("M53.5","M103.5","水池排水阀",1,1)); | |||
@@ -139,6 +139,58 @@ public class clsfbc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
} | |||
} | |||
}); | |||
/** | |||
* 模拟出料 | |||
*/ | |||
myViewHolder.cl_botton.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
String zltext = myViewHolder.bc_text4.getText().toString(); | |||
if (zltext.equals("")) { | |||
ToastUtils.warning("出料重量不能为空!"); | |||
return; | |||
} | |||
double zl = 0; | |||
try { | |||
zl = Double.parseDouble(zltext); | |||
} catch (Exception e) { | |||
ToastUtils.warning("出料重量获取异常!" + e.getMessage()); | |||
return; | |||
} | |||
if(zl<=0) | |||
{ | |||
ToastUtils.warning("出料重量至少大于0g!"); | |||
return; | |||
} | |||
short kkk=(short) ((int) (zl * 10)); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ExecuteTheRecipe.WritePLC("配料完成",false,null); | |||
ExecuteTheRecipe.WritePLC("手自切换", true,null); | |||
ExecuteTheRecipe.WritePLC("需求值" + index,kkk,new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("配料启动", true, null); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
} | |||
}); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
ToastUtils.warning("需求值下发成功!开始配料......"); | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
@@ -184,9 +236,9 @@ public class clsfbc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
public static class MyLCViewHolder1 extends RecyclerView.ViewHolder { | |||
TextView td_text;//标题 | |||
SwitchButton switch1; | |||
EditText bc_text1,bc_text2,bc_text3; | |||
EditText bc_text1,bc_text2,bc_text3,bc_text4; | |||
Button save_botton; | |||
Button save_botton,cl_botton; | |||
public MyLCViewHolder1(View view) { | |||
super(view); | |||
@@ -195,6 +247,8 @@ public class clsfbc_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
bc_text1=view.findViewById(R.id.bc_text1); | |||
bc_text2=view.findViewById(R.id.bc_text2); | |||
bc_text3=view.findViewById(R.id.bc_text3); | |||
bc_text4=view.findViewById(R.id.bc_text4); | |||
cl_botton=view.findViewById(R.id.cl_botton); | |||
save_botton=view.findViewById(R.id.save_botton); | |||
} | |||
} |
@@ -72,15 +72,19 @@ public class liaochang_adapter extends RecyclerView.Adapter<RecyclerView.ViewHol | |||
if(lcMode.materialName.isEmpty() || lcMode.materialName.equals("未设置")) | |||
{ | |||
myViewHolder.baifenbi.setText(""); | |||
myViewHolder.gaojing.setVisibility(View.GONE); | |||
// myViewHolder.gaojing.setVisibility(View.GONE); | |||
myViewHolder.wuliaoimage.setImageResource(R.mipmap.newsilos); | |||
}else | |||
{ | |||
if(lcMode.siloszl<=lcMode.silosmargin || lcMode.siloszl==0) | |||
//总量等于0 雨量小于等于 | |||
if(lcMode.warningValue>=lcMode.silosmargin || lcMode.siloszl==0) | |||
{ | |||
myViewHolder.gaojing.setVisibility(View.VISIBLE); | |||
// myViewHolder.gaojing.setVisibility(View.VISIBLE); | |||
myViewHolder.wuliaoimage.setImageResource(R.mipmap.newsilos_yc); | |||
}else | |||
{ | |||
myViewHolder.gaojing.setVisibility(View.GONE); | |||
// myViewHolder.gaojing.setVisibility(View.GONE); | |||
myViewHolder.wuliaoimage.setImageResource(R.mipmap.newsilos); | |||
} | |||
myViewHolder.baifenbi.setText(get(lcMode.silosmargin,lcMode.siloszl)); | |||
} | |||
@@ -88,50 +92,10 @@ public class liaochang_adapter extends RecyclerView.Adapter<RecyclerView.ViewHol | |||
myViewHolder.wuliaoimage.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
//MessageManager.getInstance().sendMessage(MessageName.ClickSilos,lcMode); | |||
List<String> names = new ArrayList<>(); | |||
int index = 0; | |||
int count = 0; | |||
ArrayList<BPA_MATERIAL> materials = new ArrayList<>(); | |||
List<BPA_MATERIAL> bpa_materials = QueryDB.GetMaterialALL(); | |||
for (BPA_MATERIAL item : bpa_materials) { | |||
materials.add(item); | |||
} | |||
BPA_MATERIAL wsz = new BPA_MATERIAL(); | |||
wsz.name = "未设置"; | |||
wsz.id = ""; | |||
materials.add(wsz); | |||
for (BPA_MATERIAL item : materials) { | |||
names.add(item.name); | |||
if (item.name.equals(lcMode.materialName)) { | |||
index = count; | |||
} | |||
count++; | |||
} | |||
String[] items = names.toArray(new String[names.size()]); | |||
final int checkIndex = index; | |||
new QMUIDialog.CheckableDialogBuilder(context) | |||
.addItems(items, new DialogInterface.OnClickListener() { | |||
@Override | |||
public void onClick(DialogInterface dialog, int which) { | |||
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | |||
BPA_MATERIAL material = materials.get(which); | |||
item.silosID = lcMode.id; | |||
item.materialID = material.id; | |||
//更新 | |||
if (QueryDB.UpdateSilosAndMaterial(item)) { | |||
lcMode.materialId=material.id; | |||
lcMode.materialName=material.name; | |||
notifyDataSetChanged(); | |||
dialog.dismiss(); | |||
} | |||
} | |||
}) | |||
.setCheckedIndex(checkIndex) | |||
.show(); | |||
MessageManager.getInstance().sendMessage(MessageName.ClickSilos,lcMode); | |||
} | |||
}); | |||
} | |||
@@ -191,14 +155,14 @@ public class liaochang_adapter extends RecyclerView.Adapter<RecyclerView.ViewHol | |||
TextView baifenbi; | |||
LinearLayout gaojing; | |||
// LinearLayout gaojing; | |||
public MyLCViewHolder1(View view) { | |||
super(view); | |||
xuhao = view.findViewById(R.id.xuhao);//序号 | |||
name = view.findViewById(R.id.wuliaoname); | |||
wuliaoimage=view.findViewById(R.id.wuliaoimage); | |||
baifenbi= view.findViewById(R.id.baifenbi);//序号 | |||
gaojing= view.findViewById(R.id.gaojing);//序号 | |||
// gaojing= view.findViewById(R.id.gaojing);//序号 | |||
} | |||
} | |||
} | |||
@@ -22,6 +22,7 @@ import com.bonait.bnframework.modules.home.fragment.from.JcsjglActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.LogActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.RealTimeActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SilosActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SilosNewActivity; | |||
import com.bonait.bnframework.modules.home.fragment.mode.caidan_control; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
@@ -68,7 +69,7 @@ public class GongnengFragment extends BaseFragment { | |||
//ConfigName.getInstance().fragmentAdapter.replaceFragment(0,new JcsjglActivity()); | |||
break; | |||
case R.id.lcgl:// | |||
skipToActivity(SilosActivity.class); | |||
skipToActivity(SilosNewActivity.class); | |||
//ConfigName.getInstance().fragmentAdapter.replaceFragment(0,new SilosActivity()); | |||
break; | |||
case R.id.yfpf:// | |||
@@ -135,7 +135,6 @@ public class JiaoYanFragment extends BaseFragment { | |||
menuModes.add(new ResMenuLeft(new JiaoYan_lsjy_fragment(),"流速校验", R.mipmap.lsjy, R.mipmap.lsjy_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_clsfbc_fragment(),"出料算法补偿", R.mipmap.clsfbc, R.mipmap.clsfbc_selectd,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_wdsz_fragment(),"温度设置", R.mipmap.lsjy, R.mipmap.lsjy_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_zdbs_fragment(),"自动补水", R.mipmap.zdbs, R.mipmap.zdbs_select,false)); | |||
menuModes.add(new ResMenuLeft(new JiaoYan_sdkz_fragment(),"手动控制", R.mipmap.sdkz, R.mipmap.sdkz_select,false)); | |||
}else | |||
{ | |||
@@ -0,0 +1,226 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.constant.MessageName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.linktab.LinkMode; | |||
import com.bonait.bnframework.common.message.MessageLooper; | |||
import com.bonait.bnframework.common.message.MessageManager; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.mode.Silos_item_fragment; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_silos_ck; | |||
import com.bonait.bnframework.modules.home.fragment.mode.add_yijian_controlextends; | |||
import com.qmuiteam.qmui.arch.QMUIFragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class SilosNewActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.tabs) | |||
QMUITabSegment tabs;//料仓分类 | |||
@BindView(R.id.viewpager_silos) | |||
QMUIViewPager viewpager_silos;//料仓 | |||
@BindView(R.id.add_silos) | |||
add_silos_ck add_silos; | |||
@BindView(R.id.add_yijian) | |||
add_yijian_controlextends add_yijian; | |||
private Context context; | |||
ArrayList<lcMode> lcModes = new ArrayList<>(); | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_silos_new); | |||
ButterKnife.bind(this); | |||
context=getContext(); | |||
initTopBar(); | |||
InitData(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("料仓管理新"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
add_yijian.mListener=new MyClickListener() { | |||
@Override | |||
public void clickListener(View v, Object data) { | |||
} | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
if (k == 0) { | |||
add_yijian.setVisibility(View.GONE); | |||
} else if (k==1){ | |||
}else if (k==2){ | |||
InitData(); | |||
}else if (k==3){ | |||
}else if (k==4){ | |||
InitData(); | |||
} | |||
} | |||
}; | |||
MessageManager.getInstance().registerMessageReceiver(this, MessageName.ClickSilos, new MessageLooper.OnMessageListener() { | |||
@Override | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
add_silos.SetData((lcMode) msg); | |||
add_silos.setVisibility(View.VISIBLE); | |||
} | |||
} | |||
}); | |||
add_silos.mListener = new MyClickListener() { | |||
@Override | |||
public void clickListener(View v, Object data) { | |||
} | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
if (k == 0) { | |||
add_silos.setVisibility(View.GONE); | |||
} else if (k==1){ | |||
InitData(); | |||
ToastUtils.info("补充原料成功!!!"); | |||
}else if (k==2){ | |||
}else if (k==3){ | |||
ToastUtils.warning("功能研发中!!!"); | |||
}else if (k==4){ | |||
ToastUtils.warning("功能研发中!!!"); | |||
}else if (k==5){ | |||
InitData(); | |||
ToastUtils.info("设置物料成功!!!"); | |||
//设置 | |||
} | |||
} | |||
}; | |||
} | |||
//list 界面 | |||
public List<LinkMode> Fdata = new ArrayList<>(); | |||
/** | |||
* 初始化数据 | |||
*/ | |||
public void InitData() { | |||
lcModes = DataBus.getInstance().ResGetLc(); | |||
Fdata.clear(); | |||
LinkedHashMap<String,List<Object>> map=new LinkedHashMap<>(); | |||
for(lcMode item :lcModes) | |||
{ | |||
if(map.containsKey(item.name)) | |||
{ | |||
map.get(item.name).add(item); | |||
}else | |||
{ | |||
List<Object> lc=new ArrayList<>(); | |||
lc.add(item); | |||
map.put(item.name,lc); | |||
} | |||
} | |||
/** | |||
* 编例HashMap中所有key跟value的值 | |||
*/ | |||
int i=0; | |||
for(Object key:map.keySet()){ | |||
List<Object> value = map.get(key); | |||
LinkMode linkMode=new LinkMode(key.toString(),value,i==0?true:false); | |||
Fdata.add(linkMode); | |||
i++; | |||
} | |||
QMUIFragmentPagerAdapter adapter=new QMUIFragmentPagerAdapter(getSupportFragmentManager()) { | |||
@Override | |||
public int getCount() { | |||
return Fdata.size(); | |||
} | |||
@Override | |||
public QMUIFragment createFragment(int position) { | |||
//显示数元 | |||
Silos_item_fragment fragment= new Silos_item_fragment(); | |||
fragment.SetData(Fdata.get(position).content); | |||
return fragment; | |||
} | |||
@Override | |||
public CharSequence getPageTitle(int position) { | |||
return Fdata.get(position).type.toString(); | |||
} | |||
}; | |||
viewpager_silos.setAdapter(adapter); | |||
tabs.setupWithViewPager(viewpager_silos,true); | |||
} | |||
@OnClick({R.id.yijian1,R.id.yijian2,R.id.yijian3,R.id.yijian4}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.yijian1: | |||
add_yijian.SetData(1); | |||
add_yijian.setVisibility(View.VISIBLE); | |||
break; | |||
case R.id.yijian2: | |||
add_yijian.SetData(2); | |||
add_yijian.setVisibility(View.VISIBLE); | |||
break; | |||
case R.id.yijian3: | |||
add_yijian.SetData(3); | |||
add_yijian.setVisibility(View.VISIBLE); | |||
break; | |||
case R.id.yijian4: | |||
add_yijian.SetData(4); | |||
add_yijian.setVisibility(View.VISIBLE); | |||
break; | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -71,4 +71,9 @@ public class ImageButtonControl extends LinearLayout { | |||
rea_main.setVisibility(View.GONE); | |||
} | |||
} | |||
public void SetShowImage(int kkk) | |||
{ | |||
image_u.setImageResource(kkk); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.recyclerview.widget.LinearLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import androidx.recyclerview.widget.StaggeredGridLayoutManager; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.linktab.LinkMode; | |||
import com.bonait.bnframework.common.view.MyLayoutManager; | |||
import com.bonait.bnframework.modules.home.adapter.liaochang_adapter; | |||
import com.orhanobut.logger.Logger; | |||
import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class Silos_item_fragment extends BaseFragment { | |||
@BindView(R.id.recycler_view_lll) | |||
RecyclerView recycler_view_lll; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_silos_item, null); | |||
ButterKnife.bind(this, root); | |||
context = getContext(); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
InitView(); | |||
} | |||
public List<Object> dataA=null; | |||
public void SetData(List<Object> data) | |||
{ | |||
dataA=data; | |||
} | |||
/** | |||
* 初始化界面 | |||
*/ | |||
public void InitView() { | |||
if(dataA!=null) | |||
{ | |||
// | |||
// LinearLayoutManager layoutManager = new LinearLayoutManager(context ); | |||
// recycler_view_lll.setLayoutManager(layoutManager); | |||
// 创建一个LinearLayoutManager对象 | |||
// LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); | |||
// | |||
// MyLayoutManager layout = new MyLayoutManager(); | |||
// layout.setAutoMeasureEnabled(true); | |||
// | |||
StaggeredGridLayoutManager layout11 = new StaggeredGridLayoutManager | |||
(4,StaggeredGridLayoutManager.VERTICAL); | |||
recycler_view_lll.setLayoutManager(layout11); | |||
liaochang_adapter adapter = new liaochang_adapter(context,dataA); | |||
recycler_view_lll.setAdapter(adapter); | |||
adapter.notifyDataSetChanged(); | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,6 +1,8 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.content.Context; | |||
import android.content.DialogInterface; | |||
import android.os.Handler; | |||
import android.util.AttributeSet; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
@@ -13,19 +15,27 @@ import android.widget.TextView; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | |||
import com.bonait.bnframework.common.db.res.ResGoodsRecipe; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.goodpf_apapter; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.suke.widget.SwitchButton; | |||
import java.math.BigDecimal; | |||
import java.text.DecimalFormat; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
@@ -47,6 +57,9 @@ public class add_silos_ck extends LinearLayout { | |||
@BindView(R.id.shezhi) | |||
Button shezhi; | |||
@BindView(R.id.jiaozhun) | |||
Button jiaozhun;//校准 | |||
@BindView(R.id.xuhao) | |||
TextView xuhao; | |||
@BindView(R.id.wuliaoname) | |||
@@ -55,6 +68,9 @@ public class add_silos_ck extends LinearLayout { | |||
ImageView wuliaoimage; | |||
@BindView(R.id.baifenbi) | |||
TextView baifenbi; | |||
@BindView(R.id.control_switch_shoudong) | |||
SwitchButton control_switch_shoudong; | |||
/** | |||
* 点击事件 | |||
*/ | |||
@@ -82,7 +98,7 @@ public class add_silos_ck extends LinearLayout { | |||
} | |||
boolean ismanguan=false; | |||
private void initEvent() | |||
{ | |||
buchongyuanliao.setOnClickListener(new OnClickListener() { | |||
@@ -98,18 +114,84 @@ public class add_silos_ck extends LinearLayout { | |||
} | |||
}); | |||
manguan.setOnClickListener(new OnClickListener() { | |||
name.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
//满管 | |||
if (mListener != null) { | |||
mListener.clickListenerNew(view,2,lcMode); | |||
List<String> names = new ArrayList<>(); | |||
int index = 0; | |||
int count = 0; | |||
ArrayList<BPA_MATERIAL> materials = new ArrayList<>(); | |||
List<BPA_MATERIAL> bpa_materials = QueryDB.GetMaterialALL(); | |||
for (BPA_MATERIAL item : bpa_materials) { | |||
materials.add(item); | |||
} | |||
BPA_MATERIAL wsz = new BPA_MATERIAL(); | |||
wsz.name = "未设置"; | |||
wsz.id = ""; | |||
materials.add(wsz); | |||
for (BPA_MATERIAL item : materials) { | |||
names.add(item.name); | |||
if (item.name.equals(lcMode.materialName)) { | |||
index = count; | |||
} | |||
count++; | |||
} | |||
String[] items = names.toArray(new String[names.size()]); | |||
final int checkIndex = index; | |||
new QMUIDialog.CheckableDialogBuilder(root.getContext()) | |||
.addItems(items, new DialogInterface.OnClickListener() { | |||
@Override | |||
public void onClick(DialogInterface dialog, int which) { | |||
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | |||
BPA_MATERIAL material = materials.get(which); | |||
item.silosID = lcMode.id; | |||
item.materialID = material.id; | |||
//更新 | |||
if (QueryDB.UpdateSilosAndMaterial(item)) { | |||
lcMode.materialId=material.id; | |||
lcMode.materialName=material.name; | |||
if (mListener != null) { | |||
mListener.clickListenerNew(view,5,lcMode); | |||
name.setText(material.name); | |||
} | |||
dialog.dismiss(); | |||
} | |||
} | |||
}) | |||
.setCheckedIndex(checkIndex) | |||
.show(); | |||
} | |||
}); | |||
manguan.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if(ismanguan==false) | |||
{ | |||
ismanguan=true; | |||
manguan.setEnabled(false); | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
int time=lcMode.bValue<=0?5:lcMode.bValue;//默认5秒 | |||
ExecuteTheRecipe.WritePLC("手动控制"+lcMode.num,true,null); | |||
new Handler().postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
ExecuteTheRecipe.WritePLC("手动控制"+lcMode.num,false,null); | |||
ToastUtils.info("满管成功!!!"); | |||
manguan.setEnabled(true); | |||
ismanguan=false; | |||
} | |||
}, time * 1000); | |||
//满管 | |||
if (mListener != null) { | |||
mListener.clickListenerNew(view,2,lcMode); | |||
} | |||
}else | |||
{ | |||
ToastUtils.warning("满管中,请稍后!!!"); | |||
} | |||
} | |||
}); | |||
shezhi.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
@@ -121,7 +203,15 @@ public class add_silos_ck extends LinearLayout { | |||
} | |||
}); | |||
jiaozhun.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
//设置 | |||
if (mListener != null) { | |||
mListener.clickListenerNew(view,4,lcMode); | |||
} | |||
} | |||
}); | |||
close_from.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
@@ -130,6 +220,28 @@ public class add_silos_ck extends LinearLayout { | |||
} | |||
} | |||
}); | |||
control_switch_shoudong.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
boolean isopen= control_switch_shoudong.isChecked(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
//自动模式 | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
//开启 | |||
ExecuteTheRecipe.WritePLC("手动控制"+lcMode.num,isopen,null); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
ToastUtils.info("料仓号:"+lcMode.num+",状态:"+isopen); | |||
} | |||
}); | |||
} | |||
lcMode lcMode =null; | |||
@@ -142,16 +254,16 @@ public class add_silos_ck extends LinearLayout { | |||
name.setText(lcMode.materialName.isEmpty()?"未设置":(lcMode.materialName+"")); | |||
if(lcMode.materialName.isEmpty() || lcMode.materialName.equals("未设置")) | |||
{ | |||
wuliaoimage.setImageResource(R.mipmap.liaochang_by); | |||
wuliaoimage.setImageResource(R.mipmap.newsilos); | |||
baifenbi.setText(""); | |||
}else | |||
{ | |||
if(lcMode.siloszl<=lcMode.silosmargin || lcMode.siloszl==0) | |||
if(lcMode.warningValue>=lcMode.silosmargin || lcMode.siloszl==0) | |||
{ | |||
wuliaoimage.setImageResource(R.mipmap.liaochang_yc); | |||
wuliaoimage.setImageResource(R.mipmap.newsilos_yc); | |||
}else | |||
{ | |||
wuliaoimage.setImageResource(R.mipmap.liaochang_zc); | |||
wuliaoimage.setImageResource(R.mipmap.newsilos); | |||
} | |||
baifenbi.setText(get(lcMode.silosmargin,lcMode.siloszl)); | |||
} | |||
@@ -0,0 +1,382 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.content.Context; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.os.SystemClock; | |||
import android.util.AttributeSet; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.Chronometer; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.RelativeLayout; | |||
import android.widget.Spinner; | |||
import android.widget.TextView; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class add_yijian_controlextends extends LinearLayout { | |||
@BindView(R.id.quzhizuo) | |||
Button quzhizuo; //点击按钮 | |||
@BindView(R.id.close_from_good) | |||
Button close_from_good;//关闭按钮 | |||
@BindView(R.id.image_gz) | |||
ImageButtonControl image_gz;//显示的image控件 | |||
@BindView(R.id.miaoshutext) | |||
TextView miaoshutext;//描述文本 | |||
@BindView(R.id.jishiqi) | |||
RelativeLayout jishiqi;//计时器 | |||
@BindView(R.id.miaoshu) | |||
RelativeLayout miaoshu;//描述 | |||
@BindView(R.id.liaochang) | |||
LinearLayout liaochang;//描述 | |||
@BindView(R.id.runtime) | |||
Chronometer runtime; | |||
@BindView(R.id.editsp_fl) | |||
Spinner editsp_fl; | |||
@BindView(R.id.edittext1) | |||
EditText edittext1; | |||
@BindView(R.id.edittext2) | |||
EditText edittext2; | |||
public ArrayList<BPA_SILOS> siloslist=new ArrayList<>(); | |||
/** | |||
* 点击事件 | |||
*/ | |||
public MyClickListener mListener = null; | |||
private View root; | |||
private Context contextMian; | |||
public add_yijian_controlextends(Context context, @Nullable AttributeSet attrs) { | |||
super(context, attrs); | |||
contextMian=context; | |||
root = LayoutInflater.from(context).inflate(R.layout.dialog_add_yijian, this); | |||
ButterKnife.bind(this, root); | |||
Init(); | |||
} | |||
public void Init() { | |||
//初始化界面控件的事件 | |||
initEvent(); | |||
} | |||
Map<String,String> map_fl = new LinkedHashMap<>(); | |||
private void initData() { | |||
//2.填充规则数据,查询所有属性大类 | |||
siloslist= QueryDB.GetSilosALL(); | |||
switch (ShowType) | |||
{ | |||
case 1://一键满管 | |||
image_gz.SetShowImage(R.mipmap.silos1); | |||
miaoshutext.setText("请将桶放置出料口后执行该操作,此操作将会全仓满管"); | |||
quzhizuo.setText("一键满管"); | |||
jishiqi.setVisibility(View.GONE); | |||
image_gz.setVisibility(View.VISIBLE); | |||
liaochang.setVisibility(View.GONE); | |||
miaoshu.setVisibility(View.VISIBLE); | |||
break; | |||
case 2://一键加满 | |||
image_gz.SetShowImage(R.mipmap.silos2); | |||
miaoshutext.setText("一键加满操作,请确认所有原料补充完毕后点击此操作"); | |||
quzhizuo.setText("一键加满"); | |||
jishiqi.setVisibility(View.GONE); | |||
image_gz.setVisibility(View.VISIBLE); | |||
liaochang.setVisibility(View.GONE); | |||
miaoshu.setVisibility(View.VISIBLE); | |||
break; | |||
case 3://一键清洗 | |||
image_gz.SetShowImage(R.mipmap.silos3); | |||
miaoshutext.setText("此操作会清洗管道和料仓,请确认清洗"); | |||
quzhizuo.setText("一键清洗"); | |||
jishiqi.setVisibility(View.GONE); | |||
image_gz.setVisibility(View.VISIBLE); | |||
liaochang.setVisibility(View.GONE); | |||
miaoshu.setVisibility(View.VISIBLE); | |||
break; | |||
case 4://一键设置 | |||
image_gz.setVisibility(View.GONE); | |||
image_gz.SetShowImage(R.mipmap.silos4); | |||
miaoshutext.setText(""); | |||
quzhizuo.setText("一键设置"); | |||
jishiqi.setVisibility(View.GONE); | |||
liaochang.setVisibility(View.VISIBLE); | |||
miaoshu.setVisibility(View.GONE); | |||
//设置仓 | |||
map_fl.clear(); | |||
BPA_SILOS name=null; | |||
for (BPA_SILOS item:siloslist) | |||
{ | |||
if(!map_fl.containsKey(item.name)) | |||
{ | |||
map_fl.put(item.name,item.id); | |||
if(name==null) | |||
{ | |||
name=item; | |||
} | |||
} | |||
} | |||
if(name!=null) | |||
{ | |||
edittext1.setText(name.siloszl+""); | |||
edittext2.setText(name.warningValue+""); | |||
} | |||
SetAdapter(editsp_fl,map_fl); | |||
break; | |||
} | |||
} | |||
public void SetAdapter(Spinner spinner, Map<String,String> map) | |||
{ | |||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(map.keySet())); | |||
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
spinner.setAdapter(adapter); | |||
} | |||
/** | |||
* 1 一键满管 | |||
* 2 一键加满 | |||
* 3 一键清洗 | |||
* 4 一键设置 | |||
*/ | |||
public int ShowType=1; | |||
/** | |||
* 设置数据 | |||
* | |||
* @param | |||
*/ | |||
public void SetData(int type) { | |||
try { | |||
ShowType=type; | |||
initData(); | |||
} catch (Exception ex) { | |||
} | |||
} | |||
private void initEvent() { | |||
quzhizuo.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
SaveData(); | |||
if (mListener != null) { | |||
mListener.clickListenerNew(view, ShowType, null); | |||
} | |||
} | |||
}); | |||
close_from_good.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
if (mListener != null) { | |||
mListener.clickListenerNew(v, 0, null); | |||
} | |||
} | |||
}); | |||
//为Chronomter绑定事件监听器,超过一小时自动日内告知 | |||
runtime.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { | |||
@Override | |||
public void onChronometerTick(Chronometer chronometer) { | |||
//如果计时到现在超过了一小时秒 10s | |||
if (SystemClock.elapsedRealtime() - runtime.getBase() > 120 * 1000) { | |||
StopTime(); | |||
} | |||
} | |||
}); | |||
editsp_fl.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | |||
@Override | |||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | |||
String type= editsp_fl.getSelectedItem().toString(); | |||
BPA_SILOS name=null; | |||
for (BPA_SILOS item:siloslist) | |||
{ | |||
if(name==null && item.name.equals(type)) | |||
{ | |||
name=item; | |||
} | |||
} | |||
if(name!=null) | |||
{ | |||
edittext1.setText(name.siloszl+""); | |||
edittext2.setText(name.warningValue+""); | |||
} | |||
} | |||
@Override | |||
public void onNothingSelected(AdapterView<?> adapterView) { | |||
} | |||
}); | |||
} | |||
private Handler mHandler = new Handler() { | |||
public void handleMessage(Message msg) { | |||
switch (msg.what) { | |||
case 0: | |||
if(i>=siloslist.size()) | |||
{ | |||
StopTime(); | |||
ToastUtils.info("料仓满管完成!"); | |||
} | |||
break; | |||
case 1: | |||
break; | |||
case 2: | |||
break; | |||
} | |||
} | |||
}; | |||
//region 计时器操作 | |||
int i=0; | |||
/** | |||
* 保存数据 | |||
*/ | |||
public void SaveData() { | |||
switch (ShowType) | |||
{ | |||
case 1://一键满管 | |||
i=0; | |||
ToastUtils.info("料仓满管开始!"); | |||
StartTime(); | |||
ExecuteTheRecipe.WritePLC("手自切换", false, null); | |||
for (BPA_SILOS item:siloslist) | |||
{ | |||
int time=item.bValue<=0?5:item.bValue;//默认5秒 | |||
ExecuteTheRecipe.WritePLC("手动控制"+item.num,true,null); | |||
new Handler().postDelayed(new Runnable() { | |||
@Override | |||
public void run() { | |||
ExecuteTheRecipe.WritePLC("手动控制"+item.num,false,null); | |||
mHandler.sendEmptyMessage(0); | |||
i++; | |||
} | |||
}, time * 1000); | |||
} | |||
break; | |||
case 2://一键加满 | |||
for (BPA_SILOS item:siloslist) | |||
{ | |||
QueryDB.UpdateYL(item.id,item.siloszl); | |||
} | |||
ToastUtils.info("料仓加满完成!"); | |||
break; | |||
case 3://一键清洗 | |||
ToastUtils.info("功能开发中..."); | |||
break; | |||
case 4://一键设置 | |||
String type= editsp_fl.getSelectedItem().toString(); | |||
String zl= edittext1.getText().toString(); | |||
if(zl==null || zl.isEmpty()) | |||
{ | |||
ToastUtils.warning("料仓容量不能为空!"); | |||
return; | |||
} | |||
String bjz= edittext2.getText().toString(); | |||
if(bjz==null || bjz.isEmpty()) | |||
{ | |||
ToastUtils.warning("报警值不能为空!"); | |||
return; | |||
} | |||
int zl_int=0; | |||
int bj_int=0; | |||
try { | |||
zl_int=Integer.parseInt(zl); | |||
bj_int=Integer.parseInt(bjz); | |||
}catch (Exception ex) | |||
{ | |||
} | |||
if(bj_int>zl_int) | |||
{ | |||
ToastUtils.warning("报警值不能大于料仓容量!"); | |||
return; | |||
} | |||
for (BPA_SILOS item:siloslist) | |||
{ | |||
if(item.name.equals(type)) | |||
{ | |||
QueryDB.UpdateSilosZL(item.id,zl_int); | |||
QueryDB.UpdateSilosBJZ(item.id,bj_int); | |||
} | |||
} | |||
ToastUtils.info("一键设置完成!"); | |||
break; | |||
} | |||
} | |||
/** | |||
* 启动定时器 | |||
*/ | |||
public void StartTime() { | |||
jishiqi.setVisibility(View.VISIBLE); | |||
miaoshu.setVisibility(View.GONE); | |||
runtime.setBase(SystemClock.elapsedRealtime()); | |||
runtime.start(); | |||
} | |||
/** | |||
* 停止定时器 | |||
*/ | |||
public int StopTime() { | |||
jishiqi.setVisibility(View.GONE); | |||
miaoshu.setVisibility(View.VISIBLE); | |||
long elapsedMillis = SystemClock.elapsedRealtime() - runtime.getBase(); | |||
runtime.stop(); | |||
int time=(int) (elapsedMillis / 1000); | |||
return time;//当前点击多少秒 | |||
} | |||
//endregion | |||
} |
@@ -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="#59919F" /> | |||
<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="#7dcce1" /> | |||
<corners android:radius="6dp" /> | |||
</shape> | |||
</item> | |||
</ripple> |
@@ -0,0 +1,14 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<shape | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:shape="oval" | |||
android:useLevel="false"> | |||
<solid android:color="#7dcce1"/> | |||
<stroke | |||
android:width="5dp" | |||
android:color="@color/white"/> | |||
<size android:width="80dp" | |||
android:height="80dp"/> | |||
</shape> |
@@ -0,0 +1,154 @@ | |||
<?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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<LinearLayout | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/main_background" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="horizontal"> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="match_parent"> | |||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment | |||
android:id="@+id/tabs" | |||
android:layout_width="match_parent" | |||
android:layout_height="43dp" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
android:textSize="14sp" | |||
app:qmui_tab_selected_text_size="16sp" | |||
app:qmui_tab_normal_text_size="14sp" | |||
app:qmui_tab_indicator_height="2dp" | |||
app:qmui_tab_indicator_top="false" | |||
app:qmui_tab_has_indicator="true" | |||
/> | |||
<RelativeLayout | |||
android:layout_marginTop="45dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:id="@+id/viewpager_silos" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginBottom="40dp"/> | |||
<RelativeLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="30dp"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true"> | |||
<ImageView | |||
android:layout_width="20dp" | |||
android:layout_height="20dp" | |||
android:src="@mipmap/zhuyi"/> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="点击料仓图形设置或控制料仓" | |||
android:textColor="@color/red_primary_dark"/> | |||
<ImageView | |||
android:layout_marginLeft="20dp" | |||
android:layout_width="20dp" | |||
android:layout_height="20dp" | |||
android:src="@mipmap/zhuyi"/> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="料仓物料低于最低值会警示" | |||
android:textColor="@color/red_primary_dark"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<com.bonait.bnframework.modules.home.fragment.mode.add_yijian_controlextends | |||
android:id="@+id/add_yijian" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:visibility="gone"/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.add_silos_ck | |||
android:id="@+id/add_silos" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:visibility="gone" | |||
/> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="130dp" | |||
android:layout_height="match_parent" | |||
android:background="@color/white"> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="130dp" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | |||
android:id="@+id/yijian1" | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
app:imagesrc="@mipmap/silos1" | |||
android:tag="一键满管" | |||
/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | |||
android:id="@+id/yijian2" | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
app:imagesrc="@mipmap/silos2" | |||
android:tag="一键加满" | |||
android:layout_marginTop="20dp"/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | |||
android:id="@+id/yijian3" | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
app:imagesrc="@mipmap/silos3" | |||
android:tag="一键清洗" | |||
android:layout_marginTop="20dp"/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | |||
android:id="@+id/yijian4" | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
app:imagesrc="@mipmap/silos4" | |||
android:tag="一键设置" | |||
android:layout_marginTop="20dp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<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> |
@@ -21,8 +21,8 @@ | |||
android:textStyle="bold" /> | |||
<ImageView | |||
android:id="@+id/wuliaoimage" | |||
android:layout_width="160dp" | |||
android:layout_height="160dp" | |||
android:layout_width="120dp" | |||
android:layout_height="120dp" | |||
android:src="@mipmap/newsilos"/> | |||
<TextView | |||
android:id="@+id/wuliaoname" | |||
@@ -34,11 +34,10 @@ | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="125dp" | |||
android:layout_centerInParent="true" | |||
android:layout_marginTop="60dp" | |||
android:layout_centerHorizontal="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:id="@+id/baifenbi" | |||
android:layout_width="wrap_content" | |||
@@ -47,22 +46,23 @@ | |||
android:text="30%" | |||
android:textSize="24dp" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:id="@+id/gaojing" | |||
android:layout_marginTop="165dp" | |||
android:layout_centerHorizontal="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<ImageView | |||
android:layout_width="20dp" | |||
android:layout_height="20dp" | |||
android:src="@mipmap/zhuyi"/> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:text="请补充物料" | |||
android:textColor="@color/red_primary_dark"/> | |||
</LinearLayout> | |||
<!-- <LinearLayout--> | |||
<!-- android:id="@+id/gaojing"--> | |||
<!-- android:layout_marginTop="175dp"--> | |||
<!-- android:layout_centerHorizontal="true"--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content">--> | |||
<!-- <ImageView--> | |||
<!-- android:layout_width="30dp"--> | |||
<!-- android:layout_height="30dp"--> | |||
<!-- android:src="@mipmap/zhuyi"/>--> | |||
<!-- <TextView--> | |||
<!-- android:layout_marginLeft="@dimen/dp_10"--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="match_parent"--> | |||
<!-- android:text="请补充物料"--> | |||
<!-- android:textSize="22dp"--> | |||
<!-- android:textColor="@color/red_primary_dark"/>--> | |||
<!-- </LinearLayout>--> | |||
</RelativeLayout> |
@@ -27,15 +27,16 @@ | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.suke.widget.SwitchButton | |||
android:layout_centerInParent="true" | |||
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:id="@+id/control_switch_zdbs" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:focusable="true"/> | |||
android:layout_centerInParent="true" | |||
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" /> | |||
</RelativeLayout> | |||
<LinearLayout | |||
@@ -0,0 +1,39 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout 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" | |||
tools:context=".modules.home.fragment.mode.Silos_item_fragment"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10"> | |||
<!-- <androidx.core.widget.NestedScrollView--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="match_parent">--> | |||
<!-- --> | |||
<!-- </androidx.core.widget.NestedScrollView>--> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/recycler_view_lll" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
</androidx.recyclerview.widget.RecyclerView> | |||
<!-- <RelativeLayout--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="wrap_content">--> | |||
<!-- <androidx.recyclerview.widget.RecyclerView--> | |||
<!-- android:id="@+id/recycler_view_lll"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="match_parent" />--> | |||
<!-- </RelativeLayout>--> | |||
</RelativeLayout> | |||
</RelativeLayout> |
@@ -1,6 +1,7 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/dialogbj"> | |||
@@ -9,7 +10,7 @@ | |||
android:layout_centerInParent="true" | |||
android:layout_margin="20dp" | |||
android:layout_width="400dp" | |||
android:layout_height="350dp" | |||
android:layout_height="400dp" | |||
android:background="@drawable/common_bg_with_radius_and_border"> | |||
<RelativeLayout | |||
@@ -95,6 +96,7 @@ | |||
android:layout_width="160dp" | |||
android:layout_height="160dp" | |||
android:src="@mipmap/liaochang_by"/> | |||
<TextView | |||
android:id="@+id/wuliaoname" | |||
android:layout_width="match_parent" | |||
@@ -102,6 +104,13 @@ | |||
android:text="调和油" | |||
android:textAlignment="center" | |||
android:textSize="19dp"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="(点击名称设置物料)" | |||
android:textAlignment="center" | |||
android:textSize="10dp" | |||
android:textColor="@color/red_primary"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
@@ -120,45 +129,93 @@ | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:layout_marginTop="100dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="手动加料" | |||
android:textAlignment="center" /> | |||
<com.suke.widget.SwitchButton | |||
android:id="@+id/control_switch_shoudong" | |||
android:layout_width="80dp" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
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" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/buchongyuanliao" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="补充原料" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
<Button | |||
android:id="@+id/manguan" | |||
android:layout_marginLeft="10dp" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="满管" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
<Button | |||
android:id="@+id/shezhi" | |||
android:layout_marginLeft="10dp" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="设置" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/buchongyuanliao" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="补充原料" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
<Button | |||
android:id="@+id/manguan" | |||
android:layout_marginLeft="10dp" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="满管" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/shezhi" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="设置" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
<Button | |||
android:id="@+id/jiaozhun" | |||
android:layout_marginLeft="10dp" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="40dp" | |||
android:layout_centerHorizontal="true" | |||
android:background="@drawable/bg" | |||
android:text="校准" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
@@ -0,0 +1,190 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/dialogbj" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
> | |||
<RelativeLayout | |||
android:layout_centerInParent="true" | |||
android:layout_margin="50dp" | |||
android:layout_width="500dp" | |||
android:layout_height="300dp" | |||
android:background="@drawable/common_bg_with_radius_and_border"> | |||
<Button | |||
android:id="@+id/close_from_good" | |||
android:layout_width="32dp" | |||
android:layout_height="32dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_alignParentTop="true" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:background="@mipmap/newdelete" | |||
android:textSize="14dp" | |||
android:textColor="@color/white"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginRight="10dp" | |||
android:orientation="vertical" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | |||
android:id="@+id/image_gz" | |||
android:visibility="gone" | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
app:imagesrc="@mipmap/silos1" | |||
android:tag="" | |||
app:showbk="2" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginBottom="20dp" | |||
/> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="30dp"> | |||
<RelativeLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<RelativeLayout | |||
android:visibility="gone" | |||
android:id="@+id/miaoshu" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/main_background"> | |||
<TextView | |||
android:id="@+id/miaoshutext" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="20dp" | |||
android:layout_marginBottom="20dp" | |||
android:text="请将原料装满料筒后执行该操作,\n此操作将会全仓满管" | |||
android:textAlignment="center"></TextView> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:visibility="gone" | |||
android:id="@+id/liaochang" | |||
android:layout_marginTop="50dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="选择料仓" | |||
android:textSize="16dp" | |||
android:textAlignment="center" | |||
/> | |||
<Spinner | |||
android:id="@+id/editsp_fl" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="26dp" | |||
android:layout_centerVertical="true"/> | |||
<TextView | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="料仓容量(g)" | |||
android:textSize="16dp" | |||
android:textAlignment="center" | |||
/> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
android:layout_width="match_parent" | |||
android:layout_height="26dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="number" | |||
android:layout_marginLeft="5dp" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:text="报警值(g)" | |||
android:textAlignment="center" | |||
android:textSize="16dp" /> | |||
<EditText | |||
android:id="@+id/edittext2" | |||
android:layout_width="match_parent" | |||
android:layout_height="26dp" | |||
android:background="@drawable/input_bj" | |||
android:layout_marginLeft="5dp" | |||
android:hint="请输入" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:visibility="gone" | |||
android:id="@+id/jishiqi" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<LinearLayout | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="用时: " | |||
android:textColor="@color/black" | |||
android:textSize="24dp"/> | |||
<Chronometer | |||
android:id="@+id/runtime" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="@color/purple_primary" | |||
android:textStyle="bold|italic" | |||
android:textSize="30dp" | |||
/> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text=" 秒" | |||
android:textColor="@color/white" | |||
android:textSize="24dp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/quzhizuo" | |||
android:layout_width="200dp" | |||
android:layout_height="45dp" | |||
android:layout_centerInParent="true" | |||
android:background="@drawable/bg" | |||
android:text="一键满管" | |||
android:textColor="@color/white" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> |
@@ -11,23 +11,28 @@ | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:src="@drawable/zailaiyibei"> | |||
android:src="@drawable/yijianbj"> | |||
</ImageView> | |||
<ImageView | |||
android:layout_margin="30dp" | |||
android:id="@+id/caidan_image" | |||
android:layout_marginTop="14dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_centerHorizontal="true" | |||
android:src="@mipmap/silos1"/> | |||
android:layout_marginStart="20dp" | |||
android:layout_marginTop="20dp" | |||
android:layout_marginEnd="20dp" | |||
android:layout_marginBottom="20dp" | |||
android:focusable="false" | |||
android:src="@mipmap/silos1" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:id="@+id/rea_main" | |||
android:layout_width="match_parent" | |||
android:layout_height="40dp"> | |||
android:layout_height="25dp"> | |||
<TextView | |||
android:id="@+id/caidan_text" | |||
android:layout_width="match_parent" | |||
@@ -37,7 +42,7 @@ | |||
android:text="基础数据管理" | |||
android:textAlignment="center" | |||
android:textColor="@color/black" | |||
android:textSize="28dp" /> | |||
android:textSize="19dp" /> | |||
</RelativeLayout> | |||
@@ -135,13 +135,50 @@ | |||
<Button | |||
android:id="@+id/save_botton" | |||
android:layout_marginTop="10dp" | |||
android:layout_marginBottom="20dp" | |||
android:layout_height="30dp" | |||
android:layout_width="match_parent" | |||
android:background="@drawable/button3" | |||
android:text="保存" | |||
/> | |||
<LinearLayout | |||
android:layout_marginTop="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_centerVertical="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textColor="@color/black" | |||
android:text="模拟出料(g):" | |||
android:layout_margin="5dp"/> | |||
<EditText | |||
android:id="@+id/bc_text4" | |||
android:layout_width="80dp" | |||
android:minWidth="60dp" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentRight="true" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入" | |||
android:inputType="text" | |||
android:digits="0123456789." | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
<Button | |||
android:id="@+id/cl_botton" | |||
android:layout_marginTop="10dp" | |||
android:layout_height="30dp" | |||
android:layout_width="match_parent" | |||
android:background="@drawable/button3" | |||
android:text="出料" | |||
android:layout_margin="5dp" | |||
/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> |