//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 + "."); }
//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); } }
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); }
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); }
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) }); }
//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; }
//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 + "."); }
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); }