@@ -181,6 +181,7 @@ public class ConfigData { | |||
BPA_SYSTEMSET find_200 = null; | |||
BPA_SYSTEMSET find_201 = null; | |||
BPA_SYSTEMSET find_202 = null; | |||
BPA_SYSTEMSET find_204 = null; | |||
for (BPA_SYSTEMSET item : bpa_systemsets) { | |||
if (item.type == -99) { | |||
@@ -193,6 +194,8 @@ public class ConfigData { | |||
find_201 = item; | |||
}else if (item.type == -202) { | |||
find_202 = item; | |||
}else if (item.type == -204) { | |||
find_204 = item; | |||
} | |||
} | |||
if (find_99 == null) { | |||
@@ -239,6 +242,15 @@ public class ConfigData { | |||
QueryDB.AddSystemset(set); | |||
} | |||
if (find_204 == null) { | |||
BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | |||
set.type = -204; | |||
set.value = String.valueOf(ConfigName.getInstance().IsAutoInit); | |||
set.deviceID = ConfigName.getInstance().DeviceId; | |||
set.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set); | |||
} | |||
bpa_systemsets = QueryDB.GetSystemsetALL(); | |||
for (BPA_SYSTEMSET item : bpa_systemsets) { | |||
@@ -262,6 +274,9 @@ public class ConfigData { | |||
ConfigName.getInstance().Key = item.value; | |||
UpdateDataService.key = item.value; | |||
break; | |||
case -204: | |||
ConfigName.getInstance().IsAutoInit = Boolean.parseBoolean(item.value); | |||
break; | |||
case 1: | |||
ConfigName.getInstance().Address = item.value; | |||
break; | |||
@@ -1598,10 +1598,11 @@ public class ExecuteTheRecipe { | |||
@Override | |||
public void run() { | |||
try { | |||
WritePLC("初始化", true, null); | |||
Thread.sleep(500); | |||
WritePLC("初始化", false, null); | |||
if(ConfigName.getInstance().IsAutoInit){ | |||
WritePLC("初始化", true, null); | |||
Thread.sleep(500); | |||
WritePLC("初始化", false, null); | |||
} | |||
ExecuteTheRecipe.WritePLC("温控开关", false, null);//开关闭合 | |||
ExecuteTheRecipe.WritePLC("暂停开关", false, null);//开关闭合 | |||
@@ -118,6 +118,12 @@ public class ConfigName { | |||
* 平台授权码 | |||
*/ | |||
public String Key = "d4f04e18-dfe7-4fdc-9c5b-eb4a611681ff"; | |||
/** | |||
* 是否自动初始化设备 | |||
*/ | |||
public boolean IsAutoInit=true; | |||
/** | |||
* 设备id | |||
*/ | |||
@@ -13,6 +13,7 @@ import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.CheckBox; | |||
import android.widget.EditText; | |||
import android.widget.Spinner; | |||
@@ -51,6 +52,9 @@ public class SystemSystemsetFragment extends BaseFragment { | |||
@BindView(R.id.edittext4) | |||
EditText edittext4; | |||
@BindView(R.id.cb_autoInit) | |||
CheckBox cb_autoInit; | |||
@BindView(R.id.edittext100) | |||
EditText edittext100; | |||
@BindView(R.id.edittext101) | |||
@@ -185,6 +189,10 @@ public class SystemSystemsetFragment extends BaseFragment { | |||
UpdateDataService.key = item.value; | |||
edittext103.setText(item.value); | |||
break; | |||
case -204: | |||
ConfigName.getInstance().IsAutoInit = Boolean.parseBoolean(item.value); | |||
cb_autoInit.setChecked( ConfigName.getInstance().IsAutoInit); | |||
break; | |||
case -100: | |||
ConfigName.getInstance().versionSelectionEnum = item.value; | |||
versionselection.setSelection(material_map_vis.get(item.value)==null?0:material_map_vis.get(item.value)); | |||
@@ -209,7 +217,6 @@ public class SystemSystemsetFragment extends BaseFragment { | |||
ConfigName.getInstance().DeviceAutoKey = item.value; | |||
edittext4.setText(item.value); | |||
break; | |||
} | |||
} | |||
@@ -281,6 +288,7 @@ public class SystemSystemsetFragment extends BaseFragment { | |||
ConfigName.getInstance().MainPost = Integer.parseInt(edittext101.getText().toString()); | |||
ConfigName.getInstance().DeviceHao = Integer.parseInt(edittext102.getText().toString()); | |||
ConfigName.getInstance().Key = edittext103.getText().toString(); | |||
ConfigName.getInstance().IsAutoInit = cb_autoInit.isChecked(); | |||
UpdateDataService.key = edittext103.getText().toString(); | |||
ConfigName.getInstance().ClientAutoKey = edittext3.getText().toString(); | |||
@@ -350,6 +358,13 @@ public class SystemSystemsetFragment extends BaseFragment { | |||
set_main4.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set_main4); | |||
BPA_SYSTEMSET set_main5 = new BPA_SYSTEMSET(); | |||
set_main5.type = -204; | |||
set_main5.value =String.valueOf(ConfigName.getInstance().IsAutoInit); | |||
set_main5.deviceID = ConfigName.getInstance().DeviceId; | |||
set_main5.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set_main5); | |||
if (isgb) { | |||
ConfigData.getInstance().RevertPLCProcess(); | |||
} | |||
@@ -256,6 +256,37 @@ | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备序号:" /> | |||
<CheckBox | |||
android:id="@+id/cb_autoInit" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:textSize="16sp" | |||
android:text="自动初始化"/> | |||
<!-- <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> | |||
</TableLayout> | |||