@@ -292,6 +292,8 @@ public class ConfigData { | |||||
ConfigName.getInstance().Version = ConfigUtil.read(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); | 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().HuoLi = ConfigUtil.read(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); | ||||
ConfigName.getInstance().MaxTemp = ConfigUtil.read(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); | ConfigName.getInstance().MaxTemp = ConfigUtil.read(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); | ||||
ConfigName.getInstance().WhetherManualFeedingSuspended = ConfigUtil.read(ConfigName.getInstance().dishesCon, "WhetherManualFeedingSuspended", ConfigName.getInstance().WhetherManualFeedingSuspended); | |||||
ConfigName.getInstance().gkcxCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); | 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().jiaobanCount = ConfigUtil.read(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); | ||||
@@ -319,6 +321,8 @@ public class ConfigData { | |||||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); | ConfigUtil.write(ConfigName.getInstance().dishesCon, "Version", ConfigName.getInstance().Version); | ||||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); | ConfigUtil.write(ConfigName.getInstance().dishesCon, "HuoLi", ConfigName.getInstance().HuoLi); | ||||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); | ConfigUtil.write(ConfigName.getInstance().dishesCon, "MaxTemp", ConfigName.getInstance().MaxTemp); | ||||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "WhetherManualFeedingSuspended", ConfigName.getInstance().WhetherManualFeedingSuspended); | |||||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); | ConfigUtil.write(ConfigName.getInstance().dishesCon, "gkcxCount", ConfigName.getInstance().gkcxCount ); | ||||
ConfigUtil.write(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); | ConfigUtil.write(ConfigName.getInstance().dishesCon, "jiaobanCount", ConfigName.getInstance().jiaobanCount ); | ||||
@@ -1374,6 +1374,13 @@ public class ConfigName { | |||||
//endregion | //endregion | ||||
//region | |||||
/** | |||||
* 手动投料是否关闭火力 | |||||
*/ | |||||
public String WhetherManualFeedingSuspended="否"; | |||||
//endregion | |||||
//region 计数累计 | //region 计数累计 | ||||
/** | /** | ||||
* 锅口朝向次数 | * 锅口朝向次数 | ||||
@@ -466,7 +466,7 @@ public class ModbusTcpServer { | |||||
int add = GetAddress(Address); | int add = GetAddress(Address); | ||||
if (add < 0) return; | if (add < 0) return; | ||||
try { | try { | ||||
ReadHoldingRegistersResponse res = ModbusTcpHelper.get().syncReadHoldingRegisters(1, add, length); | |||||
ReadHoldingRegistersResponse res = ModbusTcpHelper.get().syncReadHoldingRegisters(1, add, length*2); | |||||
byte[] data = res.getData(); | byte[] data = res.getData(); | ||||
float[] tempValues = new float[length]; | float[] tempValues = new float[length]; | ||||
for (int i = 0; i < length; i++) { | for (int i = 0; i < length; i++) { | ||||
@@ -474,7 +474,7 @@ public class ModbusTcpServer { | |||||
for (int m = 0; m < 4; m++) { | for (int m = 0; m < 4; m++) { | ||||
tempData[m] = data[i * 4 + m]; | tempData[m] = data[i * 4 + m]; | ||||
} | } | ||||
tempValues[i] = BytesToFloat(tempData, DataFormat.ABCD); | |||||
tempValues[i] = BytesToFloat(tempData, DataFormat.BADC); | |||||
} | } | ||||
if (tempValues.length == length) { | if (tempValues.length == length) { | ||||
if (callback != null) callback.onSuccess(tempValues); | if (callback != null) callback.onSuccess(tempValues); | ||||
@@ -587,7 +587,9 @@ public class ModbusTcpServer { | |||||
int add = GetAddress(Address); | int add = GetAddress(Address); | ||||
if (add < 0) return; | if (add < 0) return; | ||||
int intBits = Float.floatToRawIntBits(Value); | int intBits = Float.floatToRawIntBits(Value); | ||||
short[] send = new short[]{(short) ((intBits >> 16) & 0xffff), (short) (intBits & 0xffff)}; | |||||
short[] send = IntToShorts(intBits); | |||||
// short[] send = new short[]{(short) ((intBits >> 16) & 0xffff), (short) (intBits & 0xffff)}; | |||||
try { | try { | ||||
ModbusTcpHelper.get().syncWriteRegisters(1, add, send); | ModbusTcpHelper.get().syncWriteRegisters(1, add, send); | ||||
@@ -59,10 +59,16 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
@BindView(R.id.HuoLi) | @BindView(R.id.HuoLi) | ||||
Spinner HuoLi; | Spinner HuoLi; | ||||
@BindView(R.id.isStop) | |||||
Spinner isStop; | |||||
@BindView(R.id.edittext_wd) | @BindView(R.id.edittext_wd) | ||||
EditText edittext_wd; | EditText edittext_wd; | ||||
ArrayList<EditText> editTextLists = new ArrayList<>(); | ArrayList<EditText> editTextLists = new ArrayList<>(); | ||||
Map<String, Integer> material_map_yes_no = new LinkedHashMap<>(); | |||||
Map<String, Integer> material_map = new LinkedHashMap<>(); | Map<String, Integer> material_map = new LinkedHashMap<>(); | ||||
Map<String, Integer> material_map_vis = new LinkedHashMap<>(); | Map<String, Integer> material_map_vis = new LinkedHashMap<>(); | ||||
@@ -118,6 +124,10 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
material_map.put("测试环境", 1); | material_map.put("测试环境", 1); | ||||
material_map.put("正式环境", 2); | material_map.put("正式环境", 2); | ||||
material_map_yes_no.put("是", 0); | |||||
material_map_yes_no.put("否", 1); | |||||
for (int i = 0; i < ConfigName.getInstance().versionSelectionValues.length; i++) { | for (int i = 0; i < ConfigName.getInstance().versionSelectionValues.length; i++) { | ||||
material_map_vis.put(ConfigName.getInstance().versionSelectionValues[i], i); | material_map_vis.put(ConfigName.getInstance().versionSelectionValues[i], i); | ||||
} | } | ||||
@@ -131,6 +141,11 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); | adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); | ||||
versionselection.setAdapter(adapter1); | versionselection.setAdapter(adapter1); | ||||
ArrayAdapter<String> adapter11 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map_yes_no.keySet())); | |||||
adapter11.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||||
isStop.setAdapter(adapter11); | |||||
isStop.setSelection(material_map_yes_no.get(ConfigName.getInstance().WhetherManualFeedingSuspended)); | |||||
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(ConfigName.getInstance().HeatingGearL.keySet())); | ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(ConfigName.getInstance().HeatingGearL.keySet())); | ||||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | ||||
@@ -203,6 +218,22 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
} | } | ||||
}); | }); | ||||
isStop.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() { | |||||
@Override | |||||
/*public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |||||
}*/ | |||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { | |||||
ConfigName.getInstance().WhetherManualFeedingSuspended=isStop.getSelectedItem().toString(); | |||||
ConfigData.getInstance().SavePZ(); | |||||
} | |||||
@Override | |||||
public void onNothingSelected(AdapterView<?> parent) { | |||||
} | |||||
}); | |||||
} | } | ||||
@OnClick({R.id.StartButton}) | @OnClick({R.id.StartButton}) | ||||
@@ -279,6 +310,8 @@ public class SystemSystemsetFragment extends BaseFragment { | |||||
ConfigName.getInstance().HuoLi=HuoLi.getSelectedItem().toString(); | ConfigName.getInstance().HuoLi=HuoLi.getSelectedItem().toString(); | ||||
ConfigName.getInstance().WhetherManualFeedingSuspended=isStop.getSelectedItem().toString(); | |||||
if(!edittext_wd.getText().toString().isEmpty()) | if(!edittext_wd.getText().toString().isEmpty()) | ||||
{ | { | ||||
ConfigName.getInstance().MaxTemp=Integer.parseInt(edittext_wd.getText().toString()); | ConfigName.getInstance().MaxTemp=Integer.parseInt(edittext_wd.getText().toString()); | ||||
@@ -20,12 +20,14 @@ import android.widget.TextView; | |||||
import com.allen.library.SuperTextView; | import com.allen.library.SuperTextView; | ||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.business.ConfigData; | import com.bonait.bnframework.business.ConfigData; | ||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||||
import com.bonait.bnframework.common.base.BaseFragment; | import com.bonait.bnframework.common.base.BaseFragment; | ||||
import com.bonait.bnframework.common.constant.ConfigName; | import com.bonait.bnframework.common.constant.ConfigName; | ||||
import com.bonait.bnframework.common.constant.Constants; | import com.bonait.bnframework.common.constant.Constants; | ||||
import com.bonait.bnframework.common.db.QueryDB; | import com.bonait.bnframework.common.db.QueryDB; | ||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | ||||
import com.bonait.bnframework.common.db.mode.BPA_USER; | import com.bonait.bnframework.common.db.mode.BPA_USER; | ||||
import com.bonait.bnframework.common.helper.I.IRun; | |||||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | import com.bonait.bnframework.common.utils.AlertDialogUtils; | ||||
import com.bonait.bnframework.common.utils.ToastUtils; | import com.bonait.bnframework.common.utils.ToastUtils; | ||||
import com.bonait.bnframework.common.utils.UpdateAppUtils; | import com.bonait.bnframework.common.utils.UpdateAppUtils; | ||||
@@ -125,7 +127,19 @@ public class MyFragment extends BaseFragment { | |||||
} | } | ||||
private void initView() { | private void initView() { | ||||
initData(ConfigName.getInstance().user); | initData(ConfigName.getInstance().user); | ||||
stvUpdate.setRightString(ConfigName.getInstance().Version); | |||||
stvUpdate.setRightString(ConfigName.getInstance().Version+"|"+ ExecuteTheRecipe.PlcVersion); | |||||
ExecuteTheRecipe.NotifyVersionNumUpdates=new IRun() { | |||||
@Override | |||||
public void Run() { | |||||
getActivity().runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
stvUpdate.setRightString(ConfigName.getInstance().Version+"|"+ ExecuteTheRecipe.PlcVersion); | |||||
} | |||||
}); | |||||
} | |||||
}; | |||||
/* | /* | ||||
* 版本更新,点击事件 | * 版本更新,点击事件 | ||||
* */ | * */ | ||||
@@ -241,6 +241,19 @@ | |||||
android:padding="3dp" | android:padding="3dp" | ||||
android:textSize="12dp" | android:textSize="12dp" | ||||
android:text="1"/> | android:text="1"/> | ||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_marginLeft="@dimen/dp_10" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="right" | |||||
android:text="手投是否暂停" /> | |||||
<Spinner | |||||
android:id="@+id/isStop" | |||||
style="@style/commonSpinnerStyle" | |||||
android:layout_width="80dp" | |||||
android:layout_height="24dp" | |||||
android:layout_centerVertical="true" /> | |||||
</TableRow> | </TableRow> | ||||
</TableLayout> | </TableLayout> | ||||