@@ -388,6 +388,7 @@ public class ConfigName { | |||||
//位置动作 | //位置动作 | ||||
add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); | add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); | ||||
add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); | add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); | ||||
add(new Res_PLCADDRESS("维护位", "M20.0", 0, 1)); | |||||
add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); | add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); | ||||
add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); | add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); | ||||
add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); | add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); | ||||
@@ -1149,7 +1150,8 @@ public class ConfigName { | |||||
put("一直反转","Negative"); | put("一直反转","Negative"); | ||||
put("原点位","Origin"); | put("原点位","Origin"); | ||||
put("出餐启动","Pour-start"); | put("出餐启动","Pour-start"); | ||||
put("倒菜位","Pour"); | |||||
put("倒菜位","Maintenance"); | |||||
put("维护位","Pour"); | |||||
put("抽料位","Extract"); | put("抽料位","Extract"); | ||||
put("清洗位","Clean"); | put("清洗位","Clean"); | ||||
put("炒菜位1","Fry1"); | put("炒菜位1","Fry1"); | ||||
@@ -1187,8 +1189,9 @@ public class ConfigName { | |||||
put("Origin","原点位"); | put("Origin","原点位"); | ||||
put("Pour-start","出餐启动"); | put("Pour-start","出餐启动"); | ||||
put("Pour","倒菜位"); | put("Pour","倒菜位"); | ||||
put("Maintenance","维护位"); | |||||
put("Extract","抽料位"); | put("Extract","抽料位"); | ||||
put("Clean","清洗位"); | |||||
put("Clean-pos","清洗位"); | |||||
put("Fry1","炒菜位1"); | put("Fry1","炒菜位1"); | ||||
put("Fry2","炒菜位2"); | put("Fry2","炒菜位2"); | ||||
put("Fry3","炒菜位3"); | put("Fry3","炒菜位3"); | ||||
@@ -1303,6 +1306,8 @@ public class ConfigName { | |||||
//位置动作 | //位置动作 | ||||
add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); | add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); | ||||
add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); | add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); | ||||
add(new Res_PLCADDRESS("维护位", "M20.0", 0, 1)); | |||||
add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); | add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); | ||||
add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); | add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); | ||||
add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); | add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); | ||||
@@ -1589,6 +1594,7 @@ public class ConfigName { | |||||
//位置动作 | //位置动作 | ||||
add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); | add(new Res_PLCADDRESS("原点位", "M11.4", 0, 1)); | ||||
add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); | add(new Res_PLCADDRESS("倒菜位", "M12.7", 0, 1)); | ||||
add(new Res_PLCADDRESS("维护位", "M20.0", 0, 1)); | |||||
add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); | add(new Res_PLCADDRESS("抽料位", "M11.7", 0, 1)); | ||||
add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); | add(new Res_PLCADDRESS("清洗位", "M13.0", 0, 1)); | ||||
add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); | add(new Res_PLCADDRESS("炒菜位1", "M12.0", 0, 1)); | ||||
@@ -80,10 +80,15 @@ public class SdCart { | |||||
File file2 = new File(dbPath); | File file2 = new File(dbPath); | ||||
if(file2.exists()){ | if(file2.exists()){ | ||||
copyDirectory(dbPath,ConfigName.getInstance().appResRoot); | copyDirectory(dbPath,ConfigName.getInstance().appResRoot); | ||||
}else{ | |||||
//1.复制本地文件到SD卡 | |||||
// copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); | |||||
//2.创建数据库结构 | |||||
DBHelper.getInstance(ConfigName.getInstance().dishesCon).CreateTables(); | |||||
} | } | ||||
}else { | }else { | ||||
//1.复制本地文件到SD卡 | //1.复制本地文件到SD卡 | ||||
copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); | |||||
// copyFilesFassets(ConfigName.getInstance().dishesCon, ConfigName.getInstance().dbPath); | |||||
//2.创建数据库结构 | //2.创建数据库结构 | ||||
DBHelper.getInstance(ConfigName.getInstance().dishesCon).CreateTables(); | DBHelper.getInstance(ConfigName.getInstance().dishesCon).CreateTables(); | ||||
} | } | ||||
@@ -28,6 +28,7 @@ import com.bonait.bnframework.common.utils.NetworkUtils; | |||||
import com.bonait.bnframework.common.utils.ToastUtils; | import com.bonait.bnframework.common.utils.ToastUtils; | ||||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; | import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; | ||||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; | import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; | ||||
import com.bonait.bnframework.ui.widget.NewToastUtil; | |||||
import com.orhanobut.logger.Logger; | import com.orhanobut.logger.Logger; | ||||
import com.qmuiteam.qmui.widget.QMUILoadingView; | import com.qmuiteam.qmui.widget.QMUILoadingView; | ||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | ||||
@@ -81,14 +82,16 @@ public class SystemCsPLCFragment extends BaseFragment { | |||||
@Override | @Override | ||||
public void run() { | public void run() { | ||||
try { | try { | ||||
plcview.removeAllViews(); | |||||
ArrayList<BPA_PLCADDRESS> arrayList = QueryDB.GetPlcaddressALL(); | ArrayList<BPA_PLCADDRESS> arrayList = QueryDB.GetPlcaddressALL(); | ||||
for (BPA_PLCADDRESS item : arrayList) { | for (BPA_PLCADDRESS item : arrayList) { | ||||
fragment_plc gongxu = new fragment_plc(context, null, item); | fragment_plc gongxu = new fragment_plc(context, null, item); | ||||
plcview.addView(gongxu); | plcview.addView(gongxu); | ||||
} | } | ||||
load_view.setVisibility(View.INVISIBLE); | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
}finally { | }finally { | ||||
load_view.setVisibility(View.INVISIBLE); | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
@@ -121,10 +124,21 @@ public class SystemCsPLCFragment extends BaseFragment { | |||||
@Override | @Override | ||||
public void onClick(QMUIDialog dialog, int index) { | public void onClick(QMUIDialog dialog, int index) { | ||||
load_view.setVisibility(View.VISIBLE); | load_view.setVisibility(View.VISIBLE); | ||||
ConfigData.getInstance().RevertPLC(); | |||||
Init(); | |||||
ToastUtils.info("初始化成功!","Successful initialization!"); | |||||
dialog.dismiss(); | |||||
try{ | |||||
NewToastUtil.getInstance().showToast("正在初始化,请等待!"); | |||||
ConfigData.getInstance().RevertPLC(); | |||||
// Init(); | |||||
Activity activity = findActivity(context); | |||||
if (activity != null) { | |||||
activity.finish(); | |||||
} | |||||
NewToastUtil.getInstance().showToast("初始化成功,请重新进入!"); | |||||
}catch (Exception e){ | |||||
}finally { | |||||
dialog.dismiss(); | |||||
} | |||||
} | } | ||||
}); | }); | ||||
break; | break; | ||||
@@ -24,7 +24,7 @@ | |||||
<Button | <Button | ||||
android:id="@+id/btn_synchronized_data" | android:id="@+id/btn_synchronized_data" | ||||
android:layout_width="@dimen/dp_250" | |||||
android:layout_width="@dimen/dp_280" | |||||
android:layout_height="@dimen/dp_70" | android:layout_height="@dimen/dp_70" | ||||
android:textSize="@dimen/sp_32" | android:textSize="@dimen/sp_32" | ||||
android:textColor="@color/white" | android:textColor="@color/white" | ||||