package cn.diaovision.omnicontrol.core.model.device.matrix.io;

/**
 * Created by liulingfeng on 2017/3/2.
 */

public class Port {
    public static final int TYPE_VIDEO = 0; //video port
    public static final int TYPE_AUDIO = 1; //audio port
    public static final int TYPE_SERIAL = 2; //serial port
    public static final int TYPE_SWITCH = 3; //GPIO

    public static final int DIR_IN = 0; //input
    public static final int DIR_OUT = 1; //output
    public static final int DIR_BI = 2; //bidirection

    public int parentIdx; //matrix's idx
    public int idx;
    public int type;
    public int dir; //direction: in/out/bidirection
    public int state;
    public String alias;

    public Port(int parentIdx, int idx, int type, int dir) {
        this.parentIdx = parentIdx;
        this.idx = idx;
        this.type = type;
        this.dir = dir;
    }

    @Override
    public int hashCode() {
        int[] val = {parentIdx, idx, type, dir};
        return val.hashCode();
    }
}

@@ -504,16 +504,550 @@
 ection%0A%0A
+    public static final int CATEGORY_CAMERA=0;%0A    public static final int CATEGORY_DESKTOP=1;%0A    public static final int CATEGORY_VIDEO=2;%0A    public static final int CATEGORY_OUTPUT_RETURN=3;%0A    public static final int CATEGORY_PROJECTOR=4;%0A    public static final int CATEGORY_DISPLAY=5;%0A    public static final int CATEGORY_IP=6;%0A    public static final int CATEGORY_COMPUTER=7;%0A    public static final int CATEGORY_TV=8;%0A    public static final int CATEGORY_CONFERENCE=9;%0A    public static final int CATEGORY_SPLIT_SCREEN=10;%0A%0A
     publ
@@ -1079,16 +1079,16 @@
 x's idx%0A
-
     publ
@@ -1194,16 +1194,41 @@
  state;%0A
+    public int category;%0A
     publ
@@ -1302,16 +1302,30 @@
  int dir
+, int category
 ) %7B%0A    
@@ -1402,24 +1402,24 @@
 ype = type;%0A
-
         this
@@ -1430,16 +1430,48 @@
  = dir;%0A
+        this.category=category;%0A
     %7D%0A%0A 

add category property