Browse Source

现场调试改动32

master
fyf 1 year ago
parent
commit
37bd5db9a5
5 changed files with 40 additions and 5 deletions
  1. +1
    -1
      app/src/main/java/com/example/bpa/app/ICSApp.java
  2. +19
    -0
      app/src/main/java/com/example/bpa/service/BusinessServer.java
  3. +3
    -0
      app/src/main/java/com/example/bpa/view/from/ddgl_activity.java
  4. +2
    -2
      app/src/main/res/layout/datatab/layout/ddgl_item.xml
  5. +15
    -2
      app/src/main/res/layout/from/layout/activity_ddgl.xml

+ 1
- 1
app/src/main/java/com/example/bpa/app/ICSApp.java View File

@@ -41,7 +41,7 @@ public class ICSApp extends Application {
InitDBdata();
//4.初始化Main
Main.getInstance();
//DBdelete();
//BusinessServer.Get().test();
//MessageLog.ShowAlertMessage(AlertLogEnum.传感器异常日志,"传感器异常");
//MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志,"异常订单未制作日志");


+ 19
- 0
app/src/main/java/com/example/bpa/service/BusinessServer.java View File

@@ -99,6 +99,7 @@ public class BusinessServer {
String RecipesNames="";
for (ResGoodsRecipe item:goodsRecipes ){RecipesNames+=item.materialName+",";}
DataBus.getInstance().UpdateGoodsMake(suborder.id,"步骤【" + key+ "】准备下发物料:"+RecipesNames,count);
ArrayList<Integer> liaochang=new ArrayList<Integer>();
for (int m = 0; m < goodsRecipes.size(); m++) {
ResGoodsRecipe recipe=goodsRecipes.get(m);
int materialType = recipe.materialType;
@@ -120,6 +121,7 @@ public class BusinessServer {
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发失败!物料没有管理料仓!");
}else
{
liaochang.add(silos.num);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value);
DeviceData.Get().setDemandValue((short) recipe.value, silos.num, new IWriteCallBack() {
@Override
@@ -140,6 +142,23 @@ public class BusinessServer {
ModbusTcpServer.get().WriteBool(bs.plcvar, false);
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发成功!");
}

for (int k=1;k<=10;k++)
{
if(!liaochang.contains(k))
{
DeviceData.Get().setDemandValue((short) 0, k, new IWriteCallBack() {
@Override
public void onSuccess() {
MessageLog.ShowInfo(message+"下发成功!");
}
@Override
public void onFailure(String ErrorMsg) {
MessageLog.ShowInfo(message+"下发失败!"+ErrorMsg);
}
});
}
}
}
//启动配料
DeviceData.Get().setChargeMixtureStart(new IWriteCallBack() {


+ 3
- 0
app/src/main/java/com/example/bpa/view/from/ddgl_activity.java View File

@@ -77,6 +77,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis
* 开始时间-结束时间
*/
EditText starttime, stoptime;
TextView count;
/**
* 日志类型
*/
@@ -110,6 +111,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis
starttime = this.findViewById(R.id.starttime);
stoptime = this.findViewById(R.id.stoptime);
rzlx = this.findViewById(R.id.rzlx);
count=this.findViewById(R.id.count);
//通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据
String msg = getIntent().getStringExtra("data");
gongneng_title.setText(msg);
@@ -198,6 +200,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis
String lx= rzlx.getSelectedItem().toString();
String text= edittext.getText().toString();
subOrders= QueryDB.GetSubOrders(str,stop, lx_map.get(lx),text);
count.setText(subOrders.size()+"");
adapter = new ddgl_adapter(ddgl_activity.this,R.layout.ddgl_item,subOrders);
datatab.setAdapter(adapter);
} catch (Exception e) {


+ 2
- 2
app/src/main/res/layout/datatab/layout/ddgl_item.xml View File

@@ -19,7 +19,7 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3">
android:layout_weight="2.5">

<TextView
android:id="@+id/bh"
@@ -34,7 +34,7 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5">
android:layout_weight="2">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"


+ 15
- 2
app/src/main/res/layout/from/layout/activity_ddgl.xml View File

@@ -178,6 +178,19 @@
android:text="查询"
android:textColor="@color/foreground"
android:textSize="@dimen/textSize" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="订单数量:"
android:textColor="@color/foreground"></TextView>
<TextView
android:id="@+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="129"
android:textColor="@color/meunSelectForeground"></TextView>
</LinearLayout>

</RelativeLayout>
@@ -224,7 +237,7 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3">
android:layout_weight="2.5">

<TextView
android:layout_width="wrap_content"
@@ -239,7 +252,7 @@
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5">
android:layout_weight="2">

<TextView
android:layout_width="wrap_content"


Loading…
Cancel
Save