diff --git a/app/src/main/java/com/example/bpa/app/ICSApp.java b/app/src/main/java/com/example/bpa/app/ICSApp.java index e79337d..4c52f43 100644 --- a/app/src/main/java/com/example/bpa/app/ICSApp.java +++ b/app/src/main/java/com/example/bpa/app/ICSApp.java @@ -81,6 +81,8 @@ public class ICSApp extends Application { BPA_SILOS silo = new BPA_SILOS(); silo.id = java.util.UUID.randomUUID().toString(); silo.num = i + 1; + silo.thrsoleValue=ConfigName.getInstance().SiloAlarmThreshold; + silo.warningValue=ConfigName.getInstance().SiloFeedThreshold; BPA_SILOSANDMATERIAL sm = new BPA_SILOSANDMATERIAL(); sm.silosID = silo.id; sm.materialID = ""; diff --git a/app/src/main/java/com/example/bpa/helper/FlashHelper.java b/app/src/main/java/com/example/bpa/helper/FlashHelper.java index 1848441..5292675 100644 --- a/app/src/main/java/com/example/bpa/helper/FlashHelper.java +++ b/app/src/main/java/com/example/bpa/helper/FlashHelper.java @@ -31,6 +31,9 @@ public class FlashHelper { public List listviews = new ArrayList(); public List listviews1 = new ArrayList(); + public List listview = new ArrayList(); + public List listview1 = new ArrayList(); + /**开启View闪烁效果**/ public void startFlick( View view ,Integer key) { if (null == view) { @@ -39,7 +42,6 @@ public class FlashHelper { if(!listviews.contains(key)) { view.setVisibility(View.VISIBLE); - Log.e("213", "VISIBLE: "); Animation alphaAnimation = new AlphaAnimation(1, 0); alphaAnimation.setDuration(300); alphaAnimation.setInterpolator(new LinearInterpolator()); @@ -47,6 +49,7 @@ public class FlashHelper { alphaAnimation.setRepeatMode(Animation.REVERSE); view.startAnimation(alphaAnimation); listviews.add(key); + listview.add(view); } } @@ -61,6 +64,8 @@ public class FlashHelper { view.setVisibility(View.GONE); view.clearAnimation(); listviews.remove(key); + listview.remove(view); + } } @@ -72,7 +77,6 @@ public class FlashHelper { if(!listviews1.contains(key)) { view.setVisibility(View.VISIBLE); - Log.e("213", "VISIBLE: "); Animation alphaAnimation = new AlphaAnimation(1, 0); alphaAnimation.setDuration(300); alphaAnimation.setInterpolator(new LinearInterpolator()); @@ -80,6 +84,8 @@ public class FlashHelper { alphaAnimation.setRepeatMode(Animation.REVERSE); view.startAnimation(alphaAnimation); listviews1.add(key); + listview1.add(view); + } } @@ -94,6 +100,22 @@ public class FlashHelper { view.setVisibility(View.GONE); view.clearAnimation(); listviews1.remove(key); + listview1.remove(view); + + } + } + + public void Close() + { + listviews1.clear(); + listviews.clear(); + for (View item: listview1) + { + item.clearAnimation(); + } + for (View item: listview) + { + item.clearAnimation(); } } diff --git a/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java b/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java index 7a99db4..90068f3 100644 --- a/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java +++ b/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java @@ -19,6 +19,7 @@ import com.example.bpa.app.DeviceData; import com.example.bpa.config.ConfigName; import com.example.bpa.db.QueryDB; import com.example.bpa.db.mode.BPA_GOODS; +import com.example.bpa.db.mode.BPA_SILOS; import com.example.bpa.db.mode.BPA_SYSTEMSET; import com.example.bpa.helper.T; @@ -185,6 +186,20 @@ public class systemparameter extends Fragment implements View.OnClickListener{ set.userID = ConfigName.getInstance().user.userID; QueryDB.AddSystemset(set); } + + ArrayList silos=QueryDB.GetSilosALL(); + for (BPA_SILOS item:silos) + { + if(item.thrsoleValue<=0) + { + item.thrsoleValue=ConfigName.getInstance().SiloAlarmThreshold; + } + if(item.warningValue<=0) + { + item.warningValue=ConfigName.getInstance().SiloFeedThreshold; + } + QueryDB.UpdateSilos(item); + } T.show(view.getContext(), "保存成功!"); break; diff --git a/app/src/main/java/com/example/bpa/view/from/lcsz_activity.java b/app/src/main/java/com/example/bpa/view/from/lcsz_activity.java index e2e069a..77accdf 100644 --- a/app/src/main/java/com/example/bpa/view/from/lcsz_activity.java +++ b/app/src/main/java/com/example/bpa/view/from/lcsz_activity.java @@ -73,6 +73,13 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList initEvents(); Run(); } + + @Override + protected void onDestroy() { + FlashHelper.getInstance().Close(); + super.onDestroy(); + } + //endregion //region 公共函数 @@ -114,9 +121,9 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList // } List m = QueryDB.GetMaterialBySilosID(silo.id); if(m.size()>0) { - datas.add(new lcMode(silo.id, silo.num, m.get(0).name, "0", m.get(0).id)); + datas.add(new lcMode(silo.id, silo.num, m.get(0).name, "0", m.get(0).id,silo.warningValue,silo.thrsoleValue)); }else { - datas.add(new lcMode(silo.id, silo.num, "未设置", "0", "")); + datas.add(new lcMode(silo.id, silo.num, "未设置", "0", "",silo.warningValue,silo.thrsoleValue)); } } @@ -175,6 +182,8 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList if(QueryDB.UpdateSilosAndMaterial(item)){ currentSilo.materialName.setText(((selectitem_adapter)viewHolder).getItem(position).name); T.show(lcsz_activity.this,"更新成功"); + datas.get(position).materialId= item.materialID; + datas.get(position).materialName= ((selectitem_adapter)viewHolder).getItem(position).name; } } @@ -237,20 +246,23 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList //hold.silosmargin.setText(new java.text.DecimalFormat("#.00").format(val)+"g"); hold.silosmargin.setText(val+"g"); - if(val