| | |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.Button; |
| | | import android.widget.RelativeLayout; |
| | | |
| | | import com.example.agvcontroller.action.ForwardBackAction; |
| | | import com.example.agvcontroller.action.HandInAction; |
| | |
| | | private Button goForwardBtn; // 前进 |
| | | private Button goBackwardBtn; // 后退 |
| | | private Button modelSwitchBtn; // 进入、退出 手动 |
| | | |
| | | private Button bodySwitchBtn; // 底盘/货叉切换 |
| | | private Socket socket; |
| | | private String AgvNo = "12"; |
| | | private RelativeLayout layout_bottom; |
| | | private RelativeLayout layout_top; |
| | | private RelativeLayout layout_single; |
| | | private RelativeLayout layout_reset; |
| | | |
| | | |
| | | SocketManager socketManager; |
| | | |
| | | private int autoVal = 1; |
| | |
| | | rotatopnLeftBtn = findViewById(R.id.btn_rotatopn_left); |
| | | rotatopnRightBtn = findViewById(R.id.btn_rotatopn_right); |
| | | modelSwitchBtn = findViewById(R.id.btn_model_switch); |
| | | |
| | | bodySwitchBtn = findViewById(R.id.btn_body_switch); |
| | | |
| | | layout_bottom = findViewById(R.id.layout_bottom); |
| | | layout_top = findViewById(R.id.layout_top); |
| | | layout_single = findViewById(R.id.layout_single); |
| | | layout_reset = findViewById(R.id.layout_reset); |
| | | |
| | | Intent intent = getIntent(); |
| | | clientId = intent.getStringExtra("message"); |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean isVisble = true; |
| | | |
| | | // 货叉等按钮 |
| | | public void switchover(View view) { |
| | | if (isVisble) { |
| | | layout_bottom.setVisibility(View.GONE); |
| | | layout_top.setVisibility(View.VISIBLE); |
| | | bodySwitchBtn.setText("货叉"); |
| | | } else { |
| | | layout_bottom.setVisibility(View.VISIBLE); |
| | | layout_top.setVisibility(View.GONE); |
| | | bodySwitchBtn.setText("底盘"); |
| | | } |
| | | isVisble = !isVisble; |
| | | |
| | | layout_single.setVisibility(View.GONE); |
| | | layout_reset.setVisibility(View.GONE); |
| | | |
| | | } |
| | | |
| | | // 单轴使能按钮 |
| | | public void switchSingle(View view) { |
| | | layout_bottom.setVisibility(View.GONE); |
| | | layout_top.setVisibility(View.GONE); |
| | | layout_single.setVisibility(View.VISIBLE); |
| | | layout_reset.setVisibility(View.GONE); |
| | | } |
| | | |
| | | // 复位按钮 |
| | | public void switchRest(View view) { |
| | | layout_bottom.setVisibility(View.GONE); |
| | | layout_top.setVisibility(View.GONE); |
| | | layout_single.setVisibility(View.GONE); |
| | | layout_reset.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |