/// <summary> /// 数値入力ダイアログコントローラー設定値作成 /// </summary> /// <param name="type">表示形式(Numericが通常)</param> /// <param name="title">タイトル名</param> /// <param name="unit">数値の単位</param> /// <param name="maxVal">最大値</param> /// <param name="minVal">最小値</param> /// <param name="stepVal">値の間隔</param> /// <param name="currentVal">現在値</param> public SelectValueDialogParamSet(DISPLAY_TYPE type, string title, string unit, float maxVal, float minVal, float stepVal, float currentVal) { this.valueTitle = title; this.valueUnit = unit; this.maxValue = maxVal; this.minValue = minVal; this.stepValue = stepVal; this.currentValue = currentVal; }
private void ShowWindow(DISPLAY_TYPE type, params object[] param) { if (System.Windows.Forms.Screen.AllScreens.Count() > 1) { foreach (System.Windows.Forms.Screen screen in System.Windows.Forms.Screen.AllScreens) { if (screen != System.Windows.Forms.Screen.AllScreens[0]) { if (!EventHelper.IsWindowOpen <DisplayWindow>()) { DisplayWindow displayWindow = new DisplayWindow(type, param); displayWindow.Show(); displayWindow.MaximizeToSecondaryMonitor(); } else { foreach (Window window in Application.Current.Windows) { if (window is DisplayWindow) { window.Close(); DisplayWindow displayWindow = new DisplayWindow(type, param); displayWindow.Show(); displayWindow.MaximizeToSecondaryMonitor(); } } } } } } else { foreach (Window window in Application.Current.Windows) { if (window is DisplayWindow) { window.Close(); } } DisplayWindow displayWindow = new DisplayWindow(type, param) { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner, WindowState = System.Windows.WindowState.Maximized, ResizeMode = ResizeMode.NoResize }; displayWindow.Show(); } }
public DisplayWindow(DISPLAY_TYPE type, params object[] param) : this() { DisplayType = type; if (type == DISPLAY_TYPE.TEXT) { if (param != null) { showText = param[0] as ShowText; } } aircraftConfigurationId = new Guid(param[1].ToString()); frontDoorUsingFlag = (bool)param[2]; rearDoorUsingFlag = (bool)param[3]; GetGuidanceTime(); }
/// <summary> /// Append a message to the running log - use this for response from the card /// </summary> /// <param name="dispType">differentiate the message type to append</param> /// <param name="response">response data to append to the running log</param> /// <param name="sw1sw2">sw1sw2 from the card</param> public void appendToRunningLog(DISPLAY_TYPE dispType, String response, String sw1sw2) { switch (dispType) { case DISPLAY_TYPE.RSP: richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog(FORMAT_RSP); //appendToRunningLog(utils.prepareInfoForRunningLog(response)); appendToRunningLog(response); appendToRunningLog(FORMAT_SW1SW2); appendToRunningLog(utils.prepareInfoForRunningLog(sw1sw2)); richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog("\n"); break; } }
// Constructor for copying public ParameterData( string fmodParameter, float offset, float widthToAdd, float fadeToAdd, DISPLAY_TYPE display, float maxNormalized, float minNormalized, float orientation, Transform transform ) { _fmodParameter = fmodParameter; _orientationOffset = offset; _widthAngleToAdd = widthToAdd; _fadeAngleToAdd = fadeToAdd; DISPLAY = display; _maxNormalizedValue = maxNormalized; _minNormalizedValue = minNormalized; UpdateAngleData(orientation, transform); }
public void setType(DISPLAY_TYPE displayMethod) { this.displayMethod = displayMethod; }
public oArgument(string code, string weakName, DISPLAY_TYPE displayMethod) { this.code = code; this.weakName = weakName; this.displayMethod = displayMethod; }
public oArgument(string code, string weakName) { this.code = code; this.weakName = weakName; this.displayMethod = DISPLAY_TYPE.ULONG; }
/// <summary> /// Interprets the specified value and dereference according to the current interpretation method. /// </summary> /// <param name="data">The argument value.</param> /// <param name="dereference">The dereferenced data. This should be null if there are no dereferences.</param> /// <param name="autodetermine">If true, this funciton will change DISPLAY_TYPE depending on the dereference.</param> /// <returns></returns> public string getValueString(uint data, dereference dereference) { // Autodetect this type if required if (!detectedType) { // Detect the type of dereference byte[] derefData = dereference.data; if (derefData[0] >= 0x20 && derefData[0] <= 0x7E && derefData[1] == 0 && derefData[2] >= 0x20 && derefData[2] <= 0x7E && derefData[3] == 0) { // Unicode with no offset displayMethod = DISPLAY_TYPE.ULONG_UNICODE; } else if (derefData[0] >= 0x20 && derefData[0] <= 0x7E && derefData[1] >= 0x20 && derefData[1] <= 0x7E && derefData[2] >= 0x20 && derefData[2] <= 0x7E) { // Ascii with no offset displayMethod = DISPLAY_TYPE.ULONG_ASCII; } else { // Binary dereference displayMethod = DISPLAY_TYPE.ULONG_DATA; } detectedType = true; } string result = getValueString(data); if (displayMethod == DISPLAY_TYPE.ULONG_ASCII || displayMethod == DISPLAY_TYPE.ULONG_ASCII_F || displayMethod == DISPLAY_TYPE.ULONG_DATA || displayMethod == DISPLAY_TYPE.ULONG_STRUCT || displayMethod == DISPLAY_TYPE.ULONG_UNICODE) { // Setup the dereference result = result + "="; // Add the dereference string according to the type byte[] derefData = dereference.data; int i = 0; switch (displayMethod) { case DISPLAY_TYPE.ULONG_UNICODE: // Print until a null or invalid character result = result + "\""; i = 0; while (i < derefData.Length && derefData[i] >= 32 && derefData[i] <= 126) { result = result + (char)derefData[i]; i += 2; } result = result + "\""; break; case DISPLAY_TYPE.ULONG_ASCII: // Print until a null or invalid character result = result + "'"; i = 0; while (i < derefData.Length && derefData[i] >= 32 && derefData[i] <= 126) { result = result + (char)derefData[i]; i++; } result = result + "'"; break; case DISPLAY_TYPE.ULONG_ASCII_F: // Force the printing of the whole buffer as ascii result = result + "'"; i = 0; while (i < derefData.Length) { if (derefData[i] > 31) { result = result + (char)derefData[i]; } else { result = result + '.'; } i++; } result = result + "'"; break; default: // Interpret as a data pointer result = result + "["; i = 0; while (i < derefData.Length) { string byteData = derefData[i].ToString("X"); while (byteData.Length < 2) { byteData = "0" + byteData; } result = result + byteData + " "; i += 1; } result = result.TrimEnd(new char[] { ' ' }) + "]"; break; } } return(result); }
/// <summary> /// Append a message to the running log, message of a type will be appended according to a template /// </summary> /// <param name="dispType">differentiate the message type to append</param> /// <param name="text">text to append to the running log</param> public void appendToRunningLog(DISPLAY_TYPE dispType, String text) { switch (dispType) { case DISPLAY_TYPE.ATR: richTextBoxRunningLog.SelectionColor = Color.Fuchsia; appendToRunningLog(FORMAT_ATR); appendToRunningLog(text); // TODO: To display the ASCII char on the richtextbox use this line -> richTextBoxRunningLog.AppendText(((char)0x3B).ToString()); richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog("\n\n"); break; case DISPLAY_TYPE.CMD: richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog(FORMAT_CMD); appendToRunningLog(utils.prepareInfoForRunningLog(text)); richTextBoxRunningLog.SelectionColor = Color.Black; //appendToRunningLog("\n"); break; case DISPLAY_TYPE.CARD_READERS: richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog("Available readers:\n"); appendToRunningLog(text); richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog("\n"); break; case DISPLAY_TYPE.READER_SELECTED: richTextBoxRunningLog.SelectionColor = Color.Red; appendToRunningLog("Currently selected reader:\n\t"); appendToRunningLog(text); richTextBoxRunningLog.SelectionColor = Color.Black; appendToRunningLog("\n\n"); break; } }
/// <summary> /// Interprets the specified value and dereference according to the current interpretation method. /// </summary> /// <param name="data">The argument value.</param> /// <param name="dereference">The dereferenced data. This should be null if there are no dereferences.</param> /// <param name="autodetermine">If true, this funciton will change DISPLAY_TYPE depending on the dereference.</param> /// <returns></returns> public string getValueString(uint data, dereference dereference) { // Autodetect this type if required if (!detectedType) { // Detect the type of dereference byte[] derefData = dereference.data; if (derefData[0] >= 0x20 && derefData[0] <= 0x7E && derefData[1] == 0 && derefData[2] >= 0x20 && derefData[2] <= 0x7E && derefData[3] == 0) { // Unicode with no offset displayMethod = DISPLAY_TYPE.ULONG_UNICODE; } else if (derefData[0] >= 0x20 && derefData[0] <= 0x7E && derefData[1] >= 0x20 && derefData[1] <= 0x7E && derefData[2] >= 0x20 && derefData[2] <= 0x7E) { // Ascii with no offset displayMethod = DISPLAY_TYPE.ULONG_ASCII; } else { // Binary dereference displayMethod = DISPLAY_TYPE.ULONG_DATA; } detectedType = true; } string result = getValueString(data); if (displayMethod == DISPLAY_TYPE.ULONG_ASCII || displayMethod == DISPLAY_TYPE.ULONG_ASCII_F || displayMethod == DISPLAY_TYPE.ULONG_DATA || displayMethod == DISPLAY_TYPE.ULONG_STRUCT || displayMethod == DISPLAY_TYPE.ULONG_UNICODE) { // Setup the dereference result = result + "="; // Add the dereference string according to the type byte[] derefData = dereference.data; int i = 0; switch(displayMethod) { case DISPLAY_TYPE.ULONG_UNICODE: // Print until a null or invalid character result = result + "\""; i = 0; while (i < derefData.Length && derefData[i] >= 32 && derefData[i] <= 126) { result = result + (char)derefData[i]; i += 2; } result = result + "\""; break; case DISPLAY_TYPE.ULONG_ASCII: // Print until a null or invalid character result = result + "'"; i = 0; while (i < derefData.Length && derefData[i] >= 32 && derefData[i] <= 126) { result = result + (char)derefData[i]; i++; } result = result + "'"; break; case DISPLAY_TYPE.ULONG_ASCII_F: // Force the printing of the whole buffer as ascii result = result + "'"; i = 0; while (i < derefData.Length ) { if( derefData[i] > 31 ) { result = result + (char) derefData[i]; }else { result = result + '.'; } i++; } result = result + "'"; break; default: // Interpret as a data pointer result = result + "["; i = 0; while (i < derefData.Length ) { string byteData = derefData[i].ToString("X"); while( byteData.Length < 2 ) byteData = "0" + byteData; result = result + byteData + " "; i += 1; } result = result.TrimEnd(new char[] {' '}) + "]"; break; } } return result; }