You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
4.7 KiB
Java
149 lines
4.7 KiB
Java
![]()
3 years ago
|
package com.uns.maincar.constants;
|
||
|
|
||
|
/**
|
||
|
* Created by Guo on 2016/10/27.
|
||
|
* Modified by UnknownObject at 2022-09-18
|
||
|
*/
|
||
|
|
||
|
public class Flags
|
||
|
{
|
||
|
|
||
|
public static final String TAG = "MAIN-CAR-DEBUG";
|
||
|
public static final String CLIENT_TAG = "MAIN-CAR-CLIENT";
|
||
|
public static final String SEND_TAG = "MAIN-CAR-CLIENT_SEND";
|
||
|
|
||
|
//摄像头运动步数
|
||
|
public static final int CAMERA_ONE_STEP = 1;
|
||
|
public static final int CAMERA_TWO_STEP = 2;
|
||
|
|
||
|
//摄像头控制指令
|
||
|
public static final int CAMERA_UP = 0;
|
||
|
public static final int CAMERA_DOWN = 2;
|
||
|
public static final int CAMERA_LEFT = 4;
|
||
|
public static final int CAMERA_RIGHT = 6;
|
||
|
|
||
|
public static final int CAMERA_INIT = 25;
|
||
|
|
||
|
//摄像头预设位调用与设置指令
|
||
|
public static final int CAMERA_RESET = 31;
|
||
|
|
||
|
public static final int CAMERA_SET_POS_1 = 32;
|
||
|
public static final int CAMERA_GET_POS_1 = 33;
|
||
|
|
||
|
public static final int CAMERA_SET_POS_2 = 34;
|
||
|
public static final int CAMERA_GET_POS_2 = 35;
|
||
|
|
||
|
public static final int CAMERA_SET_POS_3 = 36;
|
||
|
public static final int CAMERA_GET_POS_3 = 37;
|
||
|
|
||
|
public static final int CAMERA_SET_POS_4 = 38;
|
||
|
public static final int CAMERA_GET_POS_4 = 39;
|
||
|
|
||
|
//主/从车移动控制指令
|
||
|
public static final byte CMD_PACKET_HEAD = (byte) 0x55;
|
||
|
public static final byte CMD_PACKET_END = (byte) 0xBB;
|
||
|
public static final byte CMD_PACKET_MAIN_CAR = (byte) 0xAA;
|
||
|
public static final byte CMD_PACKET_SUB_CAR = (byte) 0x02;
|
||
|
public static final byte CMD_PACKET_MOVE_FORWARD = (byte) 0x02;
|
||
|
public static final byte CMD_PACKET_MOVE_BACKWARD = (byte) 0x03;
|
||
|
public static final byte CMD_PACKET_MOVE_LEFT = (byte) 0x04;
|
||
|
public static final byte CMD_PACKET_MOVE_RIGHT = (byte) 0x05;
|
||
|
public static final byte CMD_PACKET_MOVE_STOP = (byte) 0x01;
|
||
|
public static final byte CMD_PACKET_MOVE_TO_LINE = (byte) 0x06;
|
||
|
|
||
|
//图像和数据包
|
||
|
public static final int RECEIVED_IMAGE = 11;
|
||
|
public static final int RECEIVED_CAR_DATA = 12;
|
||
|
public static final int PRINT_DATA_ARRAY = 13;
|
||
|
public static final int PRINT_SYSTEM_LOG = 14;
|
||
|
|
||
|
//颜色
|
||
|
//UnknownObject at 2022-09-18: 枚举类型足够用来替代这些常量了
|
||
|
/*public static final int ID_RED = 0;
|
||
|
public static final int ID_BLUE = 1;
|
||
|
public static final int ID_GREEN = 2;
|
||
|
public static final int ID_YELLOW = 3;
|
||
|
public static final int ID_CYAN = 4;
|
||
|
public static final int ID_MAGENTA = 5;
|
||
|
public static final int ID_BLACK = 6;
|
||
|
public static final int ID_WHITE = 7;
|
||
|
////////////////////////////////////////////////
|
||
|
public static final int ID_Light_RED = 8;
|
||
|
public static final int ID_Light_YELLOW = 9;
|
||
|
public static final int ID_Light_GREEN = 10;*/
|
||
|
//////////////////////////////////////////////////
|
||
|
//UnknownObject at 2022-09-18: 使用枚举类型替代字符串进行内部存储 (此类型已独立存储在GlobalColor类中)
|
||
|
|
||
|
/*public static final String RED = "red";
|
||
|
public static final String BLUE = "blue";
|
||
|
public static final String GREEN = "green";
|
||
|
public static final String YELLOW = "yellow";
|
||
|
public static final String CYAN = "cyan";
|
||
|
public static final String MAGENTA = "magenta";
|
||
|
public static final String BLACK = "black";
|
||
|
public static final String WHITE = "white";*/
|
||
|
/*public enum ShapeColors
|
||
|
{
|
||
|
RED,
|
||
|
BLUE,
|
||
|
GREEN,
|
||
|
YELLOW,
|
||
|
CYAN,
|
||
|
MAGENTA,
|
||
|
BLACK,
|
||
|
WHITE
|
||
|
}*/
|
||
|
//////////////////////////////////////////////////////
|
||
|
/*public static final String LIGHT_RED = "light_red";
|
||
|
public static final String LIGHT_YELLOW = "light_yellow";
|
||
|
public static final String LIGHT_GREEN = "light_green";*/
|
||
|
public enum TrafficLightColors
|
||
|
{
|
||
|
RED,
|
||
|
YELLOW,
|
||
|
GREEN,
|
||
|
NULL
|
||
|
}
|
||
|
/////////////////////////////////////////////////////////////////
|
||
|
|
||
|
// 形状
|
||
|
//UnknownObject at 2022-09-18: 将常量封装进枚举类型中 (此类型已独立存储在GlobalShape类中)
|
||
|
/*public static final int SHAPE_RECTANGLE = 12, SHAPE_SQUARE = 8,
|
||
|
SHAPE_TRIANGLE = 9, SHAPE_CIRCLE = 10, SHAPE_STAR = 11,
|
||
|
SHAPE_DIAMOND = 13, SHAPE_OTERS = 14;*/
|
||
|
/*public enum Shapes
|
||
|
{
|
||
|
RECTANGLE,
|
||
|
SQUARE,
|
||
|
TRIANGLE,
|
||
|
CIRCLE,
|
||
|
STAR,
|
||
|
DIAMOND,
|
||
|
OTHERS
|
||
|
}*/
|
||
|
|
||
|
//箭头方向
|
||
|
public static final int LEFT = 15, RIGHT = 16, BACK = 17;
|
||
|
|
||
|
//超时标志qr1 - qr4
|
||
|
public static final int QR1_TIMER_OUT = 102;
|
||
|
public static final int QR2_TIMER_OUT = 103;
|
||
|
public static final int QR3_TIMER_OUT = 104;
|
||
|
public static final int QR4_TIMER_OUT = 105;
|
||
|
|
||
|
|
||
|
//图像识别方式
|
||
|
// 阈值识别方式
|
||
|
public static final int METHOD_THRESHOLD = 0;
|
||
|
|
||
|
// 过滤颜色识别方式
|
||
|
public static final int METHOD_FILTER = 1;
|
||
|
|
||
|
//识别指令前的提醒
|
||
|
public static final int NUMBER_DETECT_REMIND = 200;
|
||
|
public static final int DIRECTION_DETECT_REMIND = 201;
|
||
|
public static final int SHAPES_DETECT_REMIND = 202;
|
||
|
public static final int QR1_DETECT_REMIND = 203;
|
||
|
public static final int QR2_DETECT_REMIND = 204;
|
||
|
}
|