@@ -46,6 +46,7 @@ | |||
tools:ignore="Instantiatable" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.AutoTestActivity" | |||
android:windowSoftInputMode="stateVisible|adjustPan|stateHidden" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.WokSetTLZZ1Fragment" | |||
@@ -292,6 +292,17 @@ public class ConfigData { | |||
ConfigName.getInstance().Version = ConfigUtil.read(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); | |||
ConfigName.getInstance().HuoLi = ConfigUtil.read(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); | |||
ConfigName.getInstance().MaxTemp = ConfigUtil.read(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); | |||
ConfigName.getInstance().gkcxCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); | |||
ConfigName.getInstance().jiaobanCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); | |||
ConfigName.getInstance().qingxiCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "qingxiCount", ConfigName.getInstance().qingxiCount ); | |||
ConfigName.getInstance().touliaoCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "touliaoCount", ConfigName.getInstance().touliaoCount ); | |||
ConfigName.getInstance().yetiliaoCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "yetiliaoCount", ConfigName.getInstance().yetiliaoCount ); | |||
ConfigName.getInstance().yanchiCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "yanchiCount", ConfigName.getInstance().yanchiCount ); | |||
ConfigName.getInstance().jiareCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "jiareCount", ConfigName.getInstance().jiareCount ); | |||
ConfigName.getInstance().jiarewendingCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "jiarewendingCount", ConfigName.getInstance().jiarewendingCount ); | |||
ConfigName.getInstance().RunCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "RunCount", ConfigName.getInstance().RunCount ); | |||
} | |||
/** | |||
@@ -308,6 +319,17 @@ public class ConfigData { | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "qingxiCount", ConfigName.getInstance().qingxiCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "touliaoCount", ConfigName.getInstance().touliaoCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "yetiliaoCount", ConfigName.getInstance().yetiliaoCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "yanchiCount", ConfigName.getInstance().yanchiCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "jiareCount", ConfigName.getInstance().jiareCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "jiarewendingCount", ConfigName.getInstance().jiarewendingCount ); | |||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "RunCount", ConfigName.getInstance().RunCount ); | |||
} | |||
/** | |||
@@ -24,7 +24,7 @@ import java.util.List; | |||
import java.util.Map; | |||
public class ExecuteTest { | |||
public static int whileTime = 40; | |||
public static int whileTime = 80; | |||
/** | |||
* 商品是否强制结束 | |||
@@ -517,10 +517,14 @@ public class ExecuteTest { | |||
} | |||
} | |||
BottomClick1("炒锅清洗"); | |||
//一直等待机器移动到该位置,否则就一直等待 6s超时 | |||
String name = "炒锅清洗反馈"; | |||
ExecuteTheRecipe.WritePLC(name,false,null); | |||
BottomClick1("炒锅清洗"); | |||
final boolean[] IsComplete = {false}; | |||
long a = System.currentTimeMillis(); | |||
while (!IsComplete[0] && !IsForcedEnd) { | |||
@@ -975,10 +975,14 @@ public class ExecuteTheRecipe { | |||
} | |||
} | |||
BottomClick1("炒锅清洗"); | |||
//一直等待机器移动到该位置,否则就一直等待 6s超时 | |||
String name = "炒锅清洗反馈"; | |||
ExecuteTheRecipe.WritePLC(name,false,null); | |||
BottomClick1("炒锅清洗"); | |||
final boolean[] IsComplete = {false}; | |||
long a = System.currentTimeMillis(); | |||
while (!IsComplete[0] && !IsForcedEnd) { | |||
@@ -1370,5 +1370,47 @@ public class ConfigName { | |||
put(3, "未设置"); | |||
put(4, "未设置"); | |||
}}; | |||
//endregion | |||
//region 计数累计 | |||
/** | |||
* 锅口朝向次数 | |||
*/ | |||
public int gkcxCount=0; | |||
/** | |||
* 搅拌分钟数 | |||
*/ | |||
public int jiaobanCount = 0;//搅拌分钟数 | |||
/** | |||
* 清洗次数 | |||
*/ | |||
public int qingxiCount = 0; | |||
/** | |||
* 投料次数 | |||
*/ | |||
public int touliaoCount = 0; | |||
/** | |||
* 液体料次数 | |||
*/ | |||
public int yetiliaoCount = 0; | |||
/** | |||
* 延迟加热次数 | |||
*/ | |||
public int yanchiCount = 0; | |||
/** | |||
* 加热次数 | |||
*/ | |||
public int jiareCount = 0; | |||
/** | |||
* 加热稳定性次数 | |||
*/ | |||
public int jiarewendingCount = 0; | |||
/** | |||
* 炒菜运行 | |||
*/ | |||
public int RunCount = 0; | |||
//endregion | |||
} |
@@ -18,6 +18,7 @@ import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTest; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
@@ -74,6 +75,9 @@ public class AutoTestMoreFragment extends BaseFragment { | |||
@BindView(R.id.qingkong) | |||
Button qingkong;// | |||
@BindView(R.id.qingkongjishu) | |||
Button qingkongjishu;// | |||
//endregion | |||
//region 界面 | |||
@@ -102,6 +106,17 @@ public class AutoTestMoreFragment extends BaseFragment { | |||
* 初始化 | |||
*/ | |||
public void Init() { | |||
RunCount=ConfigName.getInstance().RunCount; | |||
xunhuancishu.setText(RunCount + ""); | |||
qingkongjishu.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
RunCount=0; | |||
ConfigName.getInstance().RunCount =RunCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
xunhuancishu.setText(RunCount + ""); | |||
} | |||
}); | |||
kaishixunhuan.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
@@ -116,7 +131,7 @@ public class AutoTestMoreFragment extends BaseFragment { | |||
} | |||
showbuttomtop.setVisibility(View.VISIBLE); | |||
IsRun = true; | |||
RunCount = 0; | |||
//RunCount = 0; | |||
RunAllCount = GetTextInput(caipu11); | |||
ExecuteTheRecipe.StopForcedEnd(); | |||
} | |||
@@ -127,6 +142,9 @@ public class AutoTestMoreFragment extends BaseFragment { | |||
showbuttomtop.setVisibility(View.GONE); | |||
IsRun = false; | |||
ExecuteTheRecipe.SetForcedEnd(); | |||
ConfigName.getInstance().RunCount =RunCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
} | |||
}); | |||
@@ -15,6 +15,7 @@ import android.view.MotionEvent; | |||
import android.view.View; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.CheckBox; | |||
import android.widget.Chronometer; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
@@ -24,26 +25,33 @@ import android.widget.Spinner; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTest; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.db.res.StatusMode; | |||
import com.bonait.bnframework.common.helper.I.IWriteCallBack; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.model.mode.SpeedEnum; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.gnleft_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.gongxubuzhou_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.imagebuttom; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import java.text.SimpleDateFormat; | |||
import java.util.ArrayList; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.Locale; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
@@ -90,7 +98,14 @@ public class AutoTestOneFragment extends BaseFragment { | |||
EditText qingxi1;// | |||
@BindView(R.id.qingxi11) | |||
TextView qingxi11;// | |||
@BindView(R.id.touliao_ck4) | |||
CheckBox touliao_ck4;// | |||
@BindView(R.id.touliao_ck3) | |||
CheckBox touliao_ck3;// | |||
@BindView(R.id.touliao_ck2) | |||
CheckBox touliao_ck2;// | |||
@BindView(R.id.touliao_ck1) | |||
CheckBox touliao_ck1;// | |||
//液体料 | |||
@BindView(R.id.yetiliao1) | |||
@@ -98,6 +113,15 @@ public class AutoTestOneFragment extends BaseFragment { | |||
@BindView(R.id.yetiliao11) | |||
TextView yetiliao11;// | |||
@BindView(R.id.chuliao_ck4) | |||
CheckBox chuliao_ck4;// | |||
@BindView(R.id.chuliao_ck3) | |||
CheckBox chuliao_ck3;// | |||
@BindView(R.id.chuliao_ck2) | |||
CheckBox chuliao_ck2;// | |||
@BindView(R.id.chuliao_ck1) | |||
CheckBox chuliao_ck1;// | |||
//延迟 | |||
@BindView(R.id.yanchi1) | |||
@@ -137,7 +161,7 @@ public class AutoTestOneFragment extends BaseFragment { | |||
@BindView(R.id.miaoshu) | |||
EditText miaoshu;// | |||
TextView miaoshu;// | |||
@BindView(R.id.re_gkcx) | |||
@@ -222,6 +246,38 @@ public class AutoTestOneFragment extends BaseFragment { | |||
adapter3.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
HuoLi1.setAdapter(adapter3); | |||
HuoLi1.setSelection(0); | |||
runtime.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() { | |||
@Override | |||
public void onChronometerTick(Chronometer chronometer) { | |||
long elapsedMillis = SystemClock.elapsedRealtime() - chronometer.getBase(); | |||
int hours = (int) (elapsedMillis / 3600000); | |||
int minutes = (int) (elapsedMillis - hours * 3600000) / 60000; | |||
int seconds = (int) (elapsedMillis - hours * 3600000 - minutes * 60000) / 1000; | |||
String time = String.format(Locale.getDefault(), "%02d:%02d:%02d", hours, minutes, seconds); | |||
chronometer.setText(time); | |||
} | |||
}); | |||
gkcxCount=ConfigName.getInstance().gkcxCount; | |||
jiaobanCount=ConfigName.getInstance().jiaobanCount; | |||
qingxiCount=ConfigName.getInstance().qingxiCount; | |||
touliaoCount=ConfigName.getInstance().touliaoCount; | |||
yetiliaoCount=ConfigName.getInstance().yetiliaoCount; | |||
yanchiCount=ConfigName.getInstance().yanchiCount; | |||
jiareCount=ConfigName.getInstance().jiareCount; | |||
jiarewendingCount=ConfigName.getInstance().jiarewendingCount; | |||
gkcx11.setText(gkcxCount + ""); | |||
gkcx22.setText(jiaobanCount + ""); | |||
qingxi11.setText(qingxiCount + ""); | |||
touliao11.setText(touliaoCount + ""); | |||
yetiliao11.setText(yetiliaoCount + ""); | |||
yanchi11.setText(yanchiCount + ""); | |||
jiare11.setText(jiareCount + ""); | |||
jiarewending11.setText(jiarewendingCount + ""); | |||
} | |||
/** | |||
@@ -319,7 +375,10 @@ public class AutoTestOneFragment extends BaseFragment { | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.start_goodmake, R.id.qingkong,}) | |||
@OnClick({R.id.start_goodmake, R.id.qingkong, | |||
R.id.qingkongjishu1,R.id.qingkongjishu2,R.id.qingkongjishu3,R.id.qingkongjishu4,R.id.qingkongjishu5,R.id.qingkongjishu6,R.id.qingkongjishu7, | |||
}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.start_goodmake: | |||
@@ -328,12 +387,68 @@ public class AutoTestOneFragment extends BaseFragment { | |||
onRecordStart(); | |||
} | |||
} else { | |||
onRecordStop(); | |||
String title = "停止操作提示!"; | |||
String message = "请问客官确定要运行测试吗?"; | |||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
//强制结束 | |||
onRecordStop(); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
} | |||
break; | |||
case R.id.qingkong: | |||
ClearMiaosShu(); | |||
break; | |||
case R.id.qingkongjishu1: | |||
gkcxCount=0; | |||
ConfigName.getInstance().gkcxCount =gkcxCount ; | |||
jiaobanCount=0; | |||
ConfigName.getInstance().jiaobanCount =jiaobanCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
gkcx11.setText(gkcxCount + ""); | |||
gkcx22.setText(jiaobanCount + ""); | |||
break; | |||
case R.id.qingkongjishu2: | |||
qingxiCount=0; | |||
ConfigName.getInstance().qingxiCount =qingxiCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
qingxi11.setText(qingxiCount + ""); | |||
break; | |||
case R.id.qingkongjishu3: | |||
touliaoCount=0; | |||
ConfigName.getInstance().touliaoCount =touliaoCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
touliao11.setText(touliaoCount + ""); | |||
break; | |||
case R.id.qingkongjishu4: | |||
yetiliaoCount=0; | |||
ConfigName.getInstance().yetiliaoCount =yetiliaoCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
yetiliao11.setText(yetiliaoCount + ""); | |||
break; | |||
case R.id.qingkongjishu5: | |||
yanchiCount=0; | |||
ConfigName.getInstance().yanchiCount =yanchiCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
yanchi11.setText(yanchiCount + ""); | |||
break; | |||
case R.id.qingkongjishu6: | |||
jiareCount=0; | |||
ConfigName.getInstance().jiareCount =jiareCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
jiare11.setText(jiareCount + ""); | |||
break; | |||
case R.id.qingkongjishu7: | |||
jiarewendingCount=0; | |||
ConfigName.getInstance().jiarewendingCount =jiarewendingCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
jiarewending11.setText(jiarewendingCount + ""); | |||
break; | |||
} | |||
} | |||
@@ -343,6 +458,7 @@ public class AutoTestOneFragment extends BaseFragment { | |||
* @param index | |||
*/ | |||
public void SetSelect(int index) { | |||
RunIndex=index; | |||
if (index == 0) { | |||
re_gkcx.setVisibility(View.VISIBLE); | |||
re_qingxi.setVisibility(View.GONE); | |||
@@ -415,8 +531,7 @@ public class AutoTestOneFragment extends BaseFragment { | |||
*/ | |||
public boolean DataIsHF() { | |||
boolean sucess = false; | |||
int index = adapter.getSelectedPosition(); | |||
switch (index) { | |||
switch (RunIndex) { | |||
case 0: | |||
if (GetTextInput(gkcx1) == 0) { | |||
SetMiaosShu("锅体正反转循环一次的圈数不能为0或空!!!"); | |||
@@ -426,10 +541,10 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("搅拌组件运行分钟数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
gkcx11.setText("0"); | |||
gkcx22.setText("0"); | |||
gkcxCount = 0; | |||
jiaobanCount = 0; | |||
//gkcx11.setText("0"); | |||
// gkcx22.setText("0"); | |||
//gkcxCount = 0; | |||
//jiaobanCount = 0; | |||
gkcxYiQuan = GetTextInput(gkcx1); | |||
gkcxAllCount = GetTextInput(gkcx2); | |||
@@ -441,8 +556,8 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("运行次数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
qingxi11.setText("0"); | |||
qingxiCount = 0; | |||
// qingxi11.setText("0"); | |||
// qingxiCount = 0; | |||
qingxiAllCount = GetTextInput(qingxi1); | |||
} | |||
break; | |||
@@ -451,9 +566,15 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("运行次数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
touliao11.setText("0"); | |||
touliaoCount = 0; | |||
//touliao11.setText("0"); | |||
//touliaoCount = 0; | |||
touliaoAllCount = GetTextInput(touliao1); | |||
tl_ck1=touliao_ck1.isChecked(); | |||
tl_ck2=touliao_ck2.isChecked(); | |||
tl_ck3=touliao_ck3.isChecked(); | |||
tl_ck4=touliao_ck4.isChecked(); | |||
} | |||
break; | |||
case 3: | |||
@@ -461,9 +582,14 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("运行次数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
yetiliao11.setText("0"); | |||
yetiliaoCount = 0; | |||
//yetiliao11.setText("0"); | |||
//yetiliaoCount = 0; | |||
yetiliaoAllCount = GetTextInput(yetiliao1); | |||
cl_ck1=chuliao_ck1.isChecked(); | |||
cl_ck2=chuliao_ck2.isChecked(); | |||
cl_ck3=chuliao_ck3.isChecked(); | |||
cl_ck4=chuliao_ck4.isChecked(); | |||
} | |||
break; | |||
case 4: | |||
@@ -475,14 +601,25 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("运行次数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
yanchi11.setText("0"); | |||
yanchiCount = 0; | |||
// yanchi11.setText("0"); | |||
// yanchiCount = 0; | |||
yanchiAllCount = GetTextInput(yanchi3); | |||
yanchiJR = GetTextInput(yanchi1); | |||
yanchiLQ = GetTextInput(yanchi2); | |||
dw = HuoLi.getSelectedItem().toString(); | |||
ExecuteTheRecipe.WritePLC("搅拌速度", 40, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("搅拌", true, null); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
} | |||
}); | |||
} | |||
break; | |||
case 5: | |||
@@ -494,12 +631,23 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("运行次数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
jiare11.setText("0"); | |||
jiareCount = 0; | |||
//jiare11.setText("0"); | |||
// jiareCount = 0; | |||
jiareAllCount = GetTextInput(jiare3); | |||
jiareJR = GetTextInput(jiare1); | |||
jiareLQ = GetTextInput(jiare2); | |||
ExecuteTheRecipe.WritePLC("搅拌速度", 40, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("搅拌", true, null); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
} | |||
}); | |||
} | |||
break; | |||
case 6: | |||
@@ -511,12 +659,26 @@ public class AutoTestOneFragment extends BaseFragment { | |||
SetMiaosShu("运行次数不能为0或空!!!"); | |||
} else { | |||
sucess = true; | |||
jiarewending11.setText("0"); | |||
jiarewendingCount = 0; | |||
//jiarewending11.setText("0"); | |||
//jiarewendingCount = 0; | |||
jiarewendingAllCount = GetTextInput(jiarewending3); | |||
jiarewendingJR = GetTextInput(jiarewending1); | |||
jiarewendingLQ = GetTextInput(jiarewending2); | |||
dw1 = HuoLi1.getSelectedItem().toString(); | |||
ExecuteTheRecipe.WritePLC("搅拌速度", 40, new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
ExecuteTheRecipe.WritePLC("搅拌", true, null); | |||
} | |||
@Override | |||
public void onFailure(String ErrorMsg) { | |||
} | |||
}); | |||
} | |||
break; | |||
} | |||
@@ -639,6 +801,11 @@ public class AutoTestOneFragment extends BaseFragment { | |||
//endregion | |||
//region 投料 | |||
public boolean tl_ck1=false; | |||
public boolean tl_ck2=false; | |||
public boolean tl_ck3=false; | |||
public boolean tl_ck4=false; | |||
public int touliaoCount = 0; | |||
public int touliaoAllCount = 0; | |||
@@ -649,10 +816,26 @@ public class AutoTestOneFragment extends BaseFragment { | |||
if (touliaoCount < touliaoAllCount) { | |||
if (ExecuteTest.IsStart) { | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get位置("炒菜位1").processname, ExecuteTest.Get位置("炒菜位1").processvalue); | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(1).processname, ExecuteTest.Get主料(1).processvalue); | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(2).processname, ExecuteTest.Get主料(2).processvalue); | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(3).processname, ExecuteTest.Get主料(3).processvalue); | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(4).processname, ExecuteTest.Get主料(4).processvalue); | |||
if(tl_ck1) | |||
{ | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(1).processname, ExecuteTest.Get主料(1).processvalue); | |||
} | |||
if(tl_ck2) | |||
{ | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(2).processname, ExecuteTest.Get主料(2).processvalue); | |||
} | |||
if(tl_ck3) | |||
{ | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(3).processname, ExecuteTest.Get主料(3).processvalue); | |||
} | |||
if(tl_ck4) | |||
{ | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get主料(4).processname, ExecuteTest.Get主料(4).processvalue); | |||
} | |||
touliaoCount++; | |||
} | |||
} | |||
@@ -671,6 +854,10 @@ public class AutoTestOneFragment extends BaseFragment { | |||
//endregion | |||
//region 液体料 | |||
public boolean cl_ck1=false; | |||
public boolean cl_ck2=false; | |||
public boolean cl_ck3=false; | |||
public boolean cl_ck4=false; | |||
public int yetiliaoCount = 0; | |||
public int yetiliaoAllCount = 0; | |||
@@ -680,10 +867,40 @@ public class AutoTestOneFragment extends BaseFragment { | |||
public void MakeYTL() { | |||
if (yetiliaoCount < yetiliaoAllCount) { | |||
if (ExecuteTest.IsStart) { | |||
ExecuteTest.Write_PLC_Material(1, 100); | |||
ExecuteTest.Write_PLC_Material(2, 100); | |||
ExecuteTest.Write_PLC_Material(3, 100); | |||
ExecuteTest.Write_PLC_Material(4, 100); | |||
if(cl_ck1) | |||
{ | |||
ExecuteTest.Write_PLC_Material(1, 200); | |||
} | |||
if(cl_ck2) | |||
{ | |||
ExecuteTest.Write_PLC_Material(2, 200); | |||
} | |||
if(cl_ck3) | |||
{ | |||
ExecuteTest.Write_PLC_Material(3, 200); | |||
} | |||
if(cl_ck4) | |||
{ | |||
ExecuteTest.Write_PLC_Material(4, 200); | |||
} | |||
if(cl_ck1) | |||
{ | |||
DDDDD("料仓1下料完成"); | |||
} | |||
if(cl_ck2) | |||
{ | |||
DDDDD("料仓2下料完成"); | |||
} | |||
if(cl_ck3) | |||
{ | |||
DDDDD("料仓3下料完成"); | |||
} | |||
if(cl_ck4) | |||
{ | |||
DDDDD("料仓4下料完成"); | |||
} | |||
yetiliaoCount++; | |||
} | |||
} | |||
@@ -699,6 +916,27 @@ public class AutoTestOneFragment extends BaseFragment { | |||
}); | |||
} | |||
public void DDDDD(String NA) | |||
{ | |||
final boolean[] IsComplete = {false}; | |||
long a = System.currentTimeMillis(); | |||
while (!IsComplete[0] && !ExecuteTest.IsForcedEnd) { | |||
if ((System.currentTimeMillis() - a) > 1000 * 100) { | |||
break; | |||
} else { | |||
Object sb = ExecuteTheRecipe.ReadPLC(NA);// ListeningValue.get(name); | |||
if (sb != null) { | |||
IsComplete[0] = (boolean) (sb); | |||
} | |||
} | |||
try { | |||
Thread.sleep(100);//10 *6 | |||
} catch (InterruptedException e) { | |||
} | |||
} | |||
} | |||
//endregion | |||
//region 延迟 | |||
@@ -746,7 +984,7 @@ public class AutoTestOneFragment extends BaseFragment { | |||
/** | |||
* 延迟加热 | |||
* 加热 | |||
*/ | |||
public void MakeJR() { | |||
List<String> Dwei = new ArrayList<String>() {{ | |||
@@ -765,6 +1003,7 @@ public class AutoTestOneFragment extends BaseFragment { | |||
@Override | |||
public void run() { | |||
jiaredangwei.setText(item + ""); | |||
jiare11.setText( "0"); | |||
} | |||
}); | |||
@@ -809,6 +1048,7 @@ public class AutoTestOneFragment extends BaseFragment { | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get加热(dw1).processname, ExecuteTest.Get加热(dw1).processvalue); | |||
ExecuteTest.ThreadDelay(jiarewendingJR);//加热持续多少秒 | |||
ExecuteTheRecipe.WritePLC("加热", false, null); | |||
ExecuteTest.ThreadDelay(1);//冷却多少分钟 | |||
ExecuteTest.ExecuteOperationSteps(ExecuteTest.Get加热(dw1).processname, ExecuteTest.Get加热(dw1).processvalue); | |||
ExecuteTest.ThreadDelay(jiarewendingLQ);//冷却多少分钟 | |||
ExecuteTheRecipe.WritePLC("加热", false, null); | |||
@@ -934,7 +1174,6 @@ public class AutoTestOneFragment extends BaseFragment { | |||
runtime.start(); | |||
ExecuteTest.IsStart = true; | |||
TimeOut = 0; | |||
RunIndex = adapter.getSelectedPosition(); | |||
showbuttomtop.setVisibility(View.VISIBLE); | |||
start_goodmake.setImageResource(R.mipmap.zhizuo_js2); | |||
} | |||
@@ -958,6 +1197,21 @@ public class AutoTestOneFragment extends BaseFragment { | |||
showbuttomtop.setVisibility(View.GONE); | |||
start_goodmake.setImageResource(R.mipmap.zhizuo_ks2); | |||
ExecuteTheRecipe.BottomClick1("平移-去1号位"); | |||
ExecuteTheRecipe.WritePLC("搅拌", false, null); | |||
ExecuteTheRecipe.WritePLC("加热", false, null); | |||
ExecuteTheRecipe.BottomClick1("原点位"); | |||
ConfigName.getInstance().gkcxCount =gkcxCount ; | |||
ConfigName.getInstance().jiaobanCount =jiaobanCount ; | |||
ConfigName.getInstance().qingxiCount =qingxiCount ; | |||
ConfigName.getInstance().touliaoCount =touliaoCount ; | |||
ConfigName.getInstance().yetiliaoCount =yetiliaoCount ; | |||
ConfigName.getInstance().yanchiCount =yanchiCount ; | |||
ConfigName.getInstance().jiareCount =jiareCount ; | |||
ConfigName.getInstance().jiarewendingCount =jiarewendingCount ; | |||
ConfigData.getInstance().SavePZ(); | |||
} | |||
}); | |||
} | |||
@@ -97,22 +97,36 @@ | |||
android:layout_height="wrap_content" | |||
android:text="次" | |||
android:textSize="25dp"/> | |||
<Button | |||
android:id="@+id/qingkongjishu" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:layout_marginTop="30dp" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:id="@+id/kaishixunhuan" | |||
android:layout_width="300dp" | |||
android:layout_height="120dp" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:layout_marginTop="30dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="开始循环\n烹饪" | |||
android:textColor="@color/white" | |||
android:textSize="30sp"/> | |||
android:textSize="30sp" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
@@ -145,6 +159,8 @@ | |||
android:inputType="textMultiLine" | |||
android:padding="3dp" | |||
android:scrollHorizontally="false" | |||
android:focusable="false" | |||
android:clickable="false" | |||
android:text="" | |||
android:textSize="12dp" /> | |||
</LinearLayout> | |||
@@ -59,8 +59,18 @@ | |||
android:layout_height="match_parent" | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone" | |||
> | |||
<Button | |||
android:id="@+id/qingkongjishu1" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -254,7 +264,16 @@ | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
<Button | |||
android:id="@+id/qingkongjishu2" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -341,8 +360,18 @@ | |||
android:layout_height="match_parent" | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
android:visibility="gone" | |||
> | |||
<Button | |||
android:id="@+id/qingkongjishu3" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -353,6 +382,52 @@ | |||
android:layout_centerInParent="true" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="请选择需要使用的投料机构:" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
<CheckBox | |||
android:id="@+id/touliao_ck4" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="4号位" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<CheckBox | |||
android:id="@+id/touliao_ck3" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="3号位" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<CheckBox | |||
android:id="@+id/touliao_ck2" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="2号位" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<CheckBox | |||
android:id="@+id/touliao_ck1" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="1号位" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
@@ -431,7 +506,16 @@ | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
<Button | |||
android:id="@+id/qingkongjishu4" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -442,6 +526,51 @@ | |||
android:layout_centerInParent="true" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="请选择需要使用的液体仓:" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
<CheckBox | |||
android:id="@+id/chuliao_ck4" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="4号仓" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<CheckBox | |||
android:id="@+id/chuliao_ck3" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="3号仓" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<CheckBox | |||
android:id="@+id/chuliao_ck2" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="2号仓" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
<CheckBox | |||
android:id="@+id/chuliao_ck1" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="1号仓" | |||
android:checked="true" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
@@ -520,7 +649,16 @@ | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
<Button | |||
android:id="@+id/qingkongjishu5" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -695,7 +833,16 @@ | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
<Button | |||
android:id="@+id/qingkongjishu6" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -862,6 +1009,16 @@ | |||
android:layout_margin="@dimen/dp_10" | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
<Button | |||
android:id="@+id/qingkongjishu7" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@drawable/button1" | |||
android:text="清空计数" | |||
android:textSize="14dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
@@ -1053,17 +1210,17 @@ | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="match_parent" | |||
android:layout_marginRight="140dp"> | |||
android:layout_marginRight="80dp"> | |||
<Chronometer | |||
android:id="@+id/runtime" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true" | |||
android:layout_centerVertical="true" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="3dp" | |||
android:textColor="#BEAA6A" | |||
android:textSize="80dp" | |||
android:text="00:00:00" | |||
android:textStyle="bold|italic" /> | |||
</RelativeLayout> | |||
@@ -1079,17 +1236,45 @@ | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="180dp"> | |||
<EditText | |||
android:id="@+id/miaoshu" | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="180dp" | |||
android:layout_height="match_parent" | |||
android:background="@drawable/input_bj" | |||
android:gravity="top" | |||
android:inputType="textMultiLine" | |||
android:padding="3dp" | |||
android:scrollHorizontally="false" | |||
android:text="" | |||
android:textSize="12dp" /> | |||
> | |||
<TextView | |||
android:id="@+id/miaoshu" | |||
android:textSize="12dp" | |||
android:layout_marginLeft="10dp" | |||
android:text="" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"/> | |||
</ScrollView> | |||
<!-- <TextView--> | |||
<!-- android:id="@+id/miaoshu"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:background="@drawable/input_bj"--> | |||
<!-- android:text="22222222\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd\nsddsd"--> | |||
<!-- android:layout_height="180dp"--> | |||
<!-- android:textSize="12dp"--> | |||
<!-- android:scrollHorizontally="true">--> | |||
<!-- </TextView>--> | |||
<!-- <EditText--> | |||
<!-- android:id="@+id/miaoshu"--> | |||
<!-- android:visibility="gone"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="180dp"--> | |||
<!-- android:background="@drawable/input_bj"--> | |||
<!-- android:gravity="top"--> | |||
<!-- android:inputType="textMultiLine"--> | |||
<!-- android:padding="3dp"--> | |||
<!-- android:scrollHorizontally="false"--> | |||
<!-- android:text=""--> | |||
<!-- android:focusable="false"--> | |||
<!-- android:enabled="false"--> | |||
<!-- android:clickable="false"--> | |||
<!-- android:textSize="12dp" />--> | |||
<Button | |||
android:id="@+id/qingkong" | |||
android:layout_width="80dp" | |||