예제 #1
0
        //Read bytes from the PLC
        public byte[] ReadBytes(AREA_TYPE Area, int dbNumber, int baseAddress, int Length)
        {
            int res;

            byte[] buffer = new byte[Length];

            res = PLCConnection.readBytes((int)Area, dbNumber, baseAddress, Length, buffer);

            if (res == 0)
            {
                return(buffer);
            }
            throw new Exception("Unable to read data block DB " + dbNumber + ".");
        }
예제 #2
0
        //Read bytes from the PLC
        public bool ReadBytes(AREA_TYPE Area, int dbNumber, int baseAddress, int Length)
        {
            int res;

            res = PLCConnection.readBytes((int)Area, dbNumber, baseAddress, Length, null);

            if (res == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
    private static void BeginArea(AREA_TYPE area_type, float holizon_reduction_rate = 1f)
    {
        //IL_005a: Unknown result type (might be due to invalid IL or missing references)
        isAreaSettings = true;
        GetAreaRect(area_type, out Rect rect);
        float width = rect.get_width();

        rect.set_width(rect.get_width() * holizon_reduction_rate);
        float num = width - rect.get_width();

        rect.set_x(rect.get_x() + num * 0.5f);
        if (!isBeginDialog)
        {
            areaWidth = rect.get_width();
        }
        GUILayout.BeginArea(rect);
    }
예제 #4
0
 public static void BeginModalDialog(AREA_TYPE area_type, int vertical_item, int holizon_reduction_num = 0)
 {
     //IL_0005: Unknown result type (might be due to invalid IL or missing references)
     //IL_0018: Unknown result type (might be due to invalid IL or missing references)
     //IL_001d: Expected O, but got Unknown
     //IL_0026: Unknown result type (might be due to invalid IL or missing references)
     //IL_002b: Expected O, but got Unknown
     GUILayout.BeginVertical(GUIStyle.op_Implicit("Box"), (GUILayoutOption[])new GUILayoutOption[2]
     {
         GUILayout.Width((float)Screen.get_width()),
         GUILayout.Height((float)Screen.get_height())
     });
     GUILayout.FlexibleSpace();
     GUILayout.EndVertical();
     EndArea();
     BeginDialog(area_type, vertical_item, holizon_reduction_num);
 }
예제 #5
0
    public static void BeginDialog(AREA_TYPE area_type, int vertical_item, int holizon_reduction_num = 0)
    {
        //IL_005f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0080: Unknown result type (might be due to invalid IL or missing references)
        //IL_0085: Expected O, but got Unknown
        isBegin = true;
        float holizon_reduction_rate = 1f - 0.1f * (float)holizon_reduction_num;

        BeginArea(area_type, holizon_reduction_rate);
        GetAreaRect(area_type, out dialogRect);
        float num  = dialogRect.get_width() * 0.1f;
        float num2 = num * (float)holizon_reduction_num;

        areaWidth     = dialogRect.get_width() - num2 - 20f;
        isBeginDialog = true;
        GUILayout.BeginVertical(GUIStyle.op_Implicit("Window"), (GUILayoutOption[])new GUILayoutOption[1]
        {
            GUILayout.Height(BUTTON_HEIGHT * (float)vertical_item + BUTTON_HEIGHT * 0.5f)
        });
    }
예제 #6
0
        //Read bytes from the PLC
        public bool ReadBytes(AREA_TYPE Area, int dbNumber, int baseAddress, int Length)
        {
            int res;
            res = PLCConnection.readBytes((int) Area, dbNumber, baseAddress, Length, null);

            if (res == 0)
            {
                return true;
            }
            else
                return false;
        }
예제 #7
0
        //Read bytes from the PLC
        public byte[] ReadBytes(AREA_TYPE Area, int dbNumber, int baseAddress, int Length)
        {
            int res;
            byte[] buffer = new byte[Length];

            res = PLCConnection.readBytes((int) Area, dbNumber, baseAddress, Length, buffer);

            if (res == 0)
            {
                return buffer;
            }
            throw new Exception("Unable to read data block DB " + dbNumber + ".");
        }
예제 #8
0
    private static void GetAreaRect(AREA_TYPE area_type, out Rect rect)
    {
        float num;
        float num2;
        float num3;
        float num4;

        switch (area_type)
        {
        default:
            num  = 0f;
            num2 = 0f;
            num3 = (float)Screen.get_width();
            num4 = (float)Screen.get_height();
            break;

        case AREA_TYPE.CENTER:
            num  = (float)Screen.get_width() * 0.1f;
            num2 = (float)Screen.get_height() * 0.3f;
            num3 = (float)Screen.get_width() * 0.9f;
            num4 = (float)Screen.get_height() * 0.7f;
            break;

        case AREA_TYPE.CENTER_LARGE:
            num  = (float)Screen.get_width() * 0.1f;
            num2 = (float)Screen.get_height() * 0.15f;
            num3 = (float)Screen.get_width() * 0.9f;
            num4 = (float)Screen.get_height() * 0.85f;
            break;

        case AREA_TYPE.CENTER_JUMBO:
            num  = (float)Screen.get_width() * 0.1f;
            num2 = (float)Screen.get_height() * 0.05f;
            num3 = (float)Screen.get_width() * 0.9f;
            num4 = (float)Screen.get_height() * 0.95f;
            break;

        case AREA_TYPE.MAXIMUM:
            num  = (float)Screen.get_width() * 0.1f;
            num2 = 0f;
            num3 = (float)Screen.get_width() * 0.9f;
            num4 = (float)Screen.get_height();
            break;

        case AREA_TYPE.TOP:
            num  = (float)Screen.get_width() * 0.1f;
            num2 = 0f;
            num3 = (float)Screen.get_width() * 0.9f;
            num4 = (float)Screen.get_height() * 0.5f;
            break;

        case AREA_TYPE.BOTTOM:
            num  = (float)Screen.get_width() * 0.1f;
            num2 = (float)Screen.get_height() * 0.6f;
            num3 = (float)Screen.get_width();
            num4 = (float)Screen.get_height();
            break;

        case AREA_TYPE.LEFT:
            num  = 0f;
            num2 = (float)Screen.get_height() * 0.1f;
            num3 = (float)Screen.get_width() * 0.5f;
            num4 = (float)Screen.get_height() * 0.9f;
            break;

        case AREA_TYPE.RIGHT:
            num  = (float)Screen.get_width() * 0.5f;
            num2 = (float)Screen.get_height() * 0.1f;
            num3 = (float)Screen.get_width();
            num4 = (float)Screen.get_height() * 0.9f;
            break;
        }
        rect._002Ector(num, num2, num3 - num, num4 - num2);
    }