Browse Source

合并代码55

第二版
fyf 1 year ago
parent
commit
a20f4e1021
3 changed files with 23 additions and 3 deletions
  1. +7
    -0
      app/src/main/java/com/example/bpa/service/DeviceData.java
  2. +7
    -3
      app/src/main/java/com/example/bpa/view/from/dzcjy_activity.java
  3. +9
    -0
      app/src/main/res/layout/from/layout/activity_dzcjy.xml

+ 7
- 0
app/src/main/java/com/example/bpa/service/DeviceData.java View File

@@ -1146,4 +1146,11 @@ public class DeviceData {




//endregion //endregion

/**
* 关闭写保护
*/
public void setCloseWrite(IWriteCallBack callback) {
ModbusTcpServer.get().WriteBool("M6.1", true, callback);
}
} }

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

@@ -52,7 +52,7 @@ public class dzcjy_activity extends AppCompatActivity implements View.OnClickLis
* zerocalibration_button:零点校准 * zerocalibration_button:零点校准
* allcalibration_button:一键去皮 * allcalibration_button:一键去皮
*/ */
Button mwSave_button, owSave_button, materilwrite_button, calibration_button, zeroweight_button, outWrite_button, zerocalibration_button, allcalibration_button;
Button mwSave_button, owSave_button, materilwrite_button, calibration_button, zeroweight_button, outWrite_button, zerocalibration_button, allcalibration_button,closewrite_bottom;


EditText materialweight_edit, outweight_edit; EditText materialweight_edit, outweight_edit;


@@ -106,6 +106,8 @@ public class dzcjy_activity extends AppCompatActivity implements View.OnClickLis


values_spinner = this.findViewById(R.id.values_spinner); values_spinner = this.findViewById(R.id.values_spinner);
allcalibration_button = this.findViewById(R.id.allcalibration_button); allcalibration_button = this.findViewById(R.id.allcalibration_button);

closewrite_bottom = this.findViewById(R.id.closewrite_bottom);
//edit //edit
mode_1_realvalue = this.findViewById(R.id.mode_1_realvalue); mode_1_realvalue = this.findViewById(R.id.mode_1_realvalue);
mode_2_realvalue = this.findViewById(R.id.mode_2_realvalue); mode_2_realvalue = this.findViewById(R.id.mode_2_realvalue);
@@ -150,7 +152,7 @@ public class dzcjy_activity extends AppCompatActivity implements View.OnClickLis
allcalibration_button.setOnClickListener(this); allcalibration_button.setOnClickListener(this);
out_switch.setOnCheckedChangeListener(this); out_switch.setOnCheckedChangeListener(this);
marialmode_switch.setOnCheckedChangeListener(this); marialmode_switch.setOnCheckedChangeListener(this);
closewrite_bottom.setOnClickListener(this);


} }


@@ -254,7 +256,9 @@ public class dzcjy_activity extends AppCompatActivity implements View.OnClickLis
case R.id.allcalibration_button://一件去皮 case R.id.allcalibration_button://一件去皮
DeviceData.Get().setOneClickPeeling(null); DeviceData.Get().setOneClickPeeling(null);
break; break;

case R.id.closewrite_bottom://关闭写保护
DeviceData.Get().setCloseWrite(null);
break;
} }
}).start(); }).start();




+ 9
- 0
app/src/main/res/layout/from/layout/activity_dzcjy.xml View File

@@ -238,7 +238,16 @@
android:background="@drawable/btn_greenblue" android:background="@drawable/btn_greenblue"
android:text="零点校准" android:text="零点校准"
android:layout_margin="5dp"/> android:layout_margin="5dp"/>


</LinearLayout> </LinearLayout>
<Button
android:id="@+id/closewrite_bottom"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:background="@drawable/btn_greenblue"
android:text="关闭写保护"
android:layout_margin="5dp"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>




Loading…
Cancel
Save