/// <summary> /// Sample : Display character set code page type. /// </summary> public static Communication.PeripheralStatus DoCharacterSetCodePagePattern(DisplayCodePageType codePageType, IPort port) { // Check display status. Communication.PeripheralStatus status = GetDiaplayStatus(port); if (status != Communication.PeripheralStatus.Connect) // Display is not connected. { return(status); } // Select character set. DisplayInternationalType internationalType = SharedInformationManager.SelectedDisplayInternationalType; // Create display commands. byte[] displayCommands = DisplayFunctions.CreateCharacterSet(internationalType, codePageType); // Send display commands. CommunicationResult result = Communication.SendCommandsDoNotCheckCondition(displayCommands, port); if (result.Result != Communication.Result.Success) { return(Communication.PeripheralStatus.Impossible); } else { return(Communication.PeripheralStatus.Connect); } }
private Communication.PeripheralStatus CallDisplayFunction(DisplayFunctionManager.FunctionType type, int selectedIndex) { Communication.PeripheralStatus result = Communication.PeripheralStatus.Invalid; lock (lockObject) { switch (type) { case DisplayFunctionManager.FunctionType.Text: result = DisplaySampleManager.DoTextPattern((DisplayFunctionManager.TextPattern)Enum.ToObject(typeof(DisplayFunctionManager.TextPattern), selectedIndex), port); break; case DisplayFunctionManager.FunctionType.Graphic: result = DisplaySampleManager.DoGraphicPattern((DisplayFunctionManager.GraphicPattern)Enum.ToObject(typeof(DisplayFunctionManager.GraphicPattern), selectedIndex), port); break; case DisplayFunctionManager.FunctionType.TurnOnOff: bool turnOn; if (selectedIndex == 0) { turnOn = true; } else { turnOn = false; } result = DisplaySampleManager.DoTurnOnOffPattern(turnOn, port); break; case DisplayFunctionManager.FunctionType.Cursor: result = DisplaySampleManager.DoCursorPattern((DisplayCursorMode)Enum.ToObject(typeof(DisplayCursorMode), selectedIndex), port); break; case DisplayFunctionManager.FunctionType.Contrast: result = DisplaySampleManager.DoContrastPattern((DisplayContrastMode)Enum.ToObject(typeof(DisplayContrastMode), selectedIndex), port); break; case DisplayFunctionManager.FunctionType.CharacterSetInternational: DisplayInternationalType internationalType = (DisplayInternationalType)Enum.ToObject(typeof(DisplayInternationalType), selectedIndex); result = DisplaySampleManager.DoCharacterSetInternationalPattern(internationalType, port); SharedInformationManager.SetDisplayInternationalType(internationalType); break; case DisplayFunctionManager.FunctionType.CharacterSetCodePage: DisplayCodePageType codePageType = (DisplayCodePageType)Enum.ToObject(typeof(DisplayCodePageType), selectedIndex); result = DisplaySampleManager.DoCharacterSetCodePagePattern(codePageType, port); SharedInformationManager.SetDisplayCodePageType(codePageType); break; case DisplayFunctionManager.FunctionType.UserDefinedCharacter: bool set; if ((DisplayFunctionManager.UserDefinedCharacterPattern)Enum.ToObject(typeof(DisplayFunctionManager.UserDefinedCharacterPattern), selectedIndex) == DisplayFunctionManager.UserDefinedCharacterPattern.Set) { set = true; } else { set = false; } result = DisplaySampleManager.DoUserDefinedCharacterPattern(set, port); break; default: break; } } return(result); }
public static byte[] CreateCharacterSet(DisplayInternationalType internationalType, DisplayCodePageType codePageType) { IDisplayCommandBuilder builder = StarIoExt.CreateDisplayCommandBuilder(DisplayModel.SCD222); builder.AppendClearScreen(); builder.AppendCursorMode(DisplayCursorMode.Off); builder.AppendHomePosition(); builder.AppendInternational(internationalType); builder.AppendCodePage(codePageType); byte[] pattern1 = { 0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3 }; byte[] pattern2 = { 0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d, 0x88, 0xa0, 0x88, 0xa1, 0x88, 0xa2, 0x88, 0xa3, 0x88, 0xa4, 0x88, 0xa5, 0x88, 0xa6, 0x88, 0xa7, 0x88, 0xa8, 0x88, 0xa9 }; byte[] pattern3 = { 0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d, 0xb0, 0xa1, 0xb0, 0xa2, 0xb0, 0xa3, 0xb0, 0xa4, 0xb0, 0xa5, 0xb0, 0xa6, 0xb0, 0xa7, 0xb0, 0xa8, 0xb0, 0xa9, 0xb0, 0xaa }; byte[] pattern4 = { 0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d, 0xa4, 0x40, 0xa4, 0x41, 0xa4, 0x42, 0xa4, 0x43, 0xa4, 0x44, 0xa4, 0x45, 0xa4, 0x46, 0xa4, 0x47, 0xa4, 0x48, 0xa4, 0x49 }; byte[] pattern5 = { 0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d, 0xb0, 0xa1, 0xb0, 0xa2, 0xb0, 0xa3, 0xb0, 0xa4, 0xb0, 0xa5, 0xb0, 0xa6, 0xb0, 0xa7, 0xb0, 0xa8, 0xb0, 0xa9, 0xb0, 0xaa }; byte[] textPattern; switch (codePageType) { default: // CP437,Katakana,CP850,CP860,CP863,CP865,CP1252,CP866,CP852,CP858 textPattern = pattern1; break; case DisplayCodePageType.Japanese: textPattern = pattern2; break; case DisplayCodePageType.SimplifiedChinese: textPattern = pattern3; break; case DisplayCodePageType.TraditionalChinese: textPattern = pattern4; break; case DisplayCodePageType.Hangul: textPattern = pattern5; break; } builder.Append(textPattern); return(builder.PassThroughCommands); }
private Communication.PeripheralStatus CallFunction(SelectSettingWindow windowResult, IPort port) { Communication.PeripheralStatus result = Communication.PeripheralStatus.Invalid; switch (Function.Type) { default: case DisplayFunctionManager.FunctionType.CheckStatus: result = DisplaySampleManager.GetDiaplayStatus(port); break; case DisplayFunctionManager.FunctionType.Text: result = DisplaySampleManager.DoTextPattern(windowResult.SelectedDisplayTextPattern, port); break; case DisplayFunctionManager.FunctionType.Graphic: result = DisplaySampleManager.DoGraphicPattern(windowResult.SelectedDisplayGraphicPattern, port); break; case DisplayFunctionManager.FunctionType.TurnOnOff: result = DisplaySampleManager.DoTurnOnOffPattern(windowResult.SelectedDisplayTurnOnOffPattern, port); break; case DisplayFunctionManager.FunctionType.Cursor: result = DisplaySampleManager.DoCursorPattern(windowResult.SelectedDisplayCursorPattern, port); break; case DisplayFunctionManager.FunctionType.Contrast: result = DisplaySampleManager.DoContrastPattern(windowResult.SelectedDisplayContrastPattern, port); break; case DisplayFunctionManager.FunctionType.CharacterSetInternational: DisplayInternationalType internationalType = windowResult.SelectedDisplayCharacterSetInternationalType; result = DisplaySampleManager.DoCharacterSetInternationalPattern(internationalType, port); SharedInformationManager.SelectedDisplayInternationalType = internationalType; break; case DisplayFunctionManager.FunctionType.CharacterSetCodePage: DisplayCodePageType codePageType = windowResult.SelectedDisplayCharacterSetCodePageType; result = DisplaySampleManager.DoCharacterSetCodePagePattern(codePageType, port); SharedInformationManager.SelectedDisplayCodePageType = codePageType; break; case DisplayFunctionManager.FunctionType.UserDefinedCharacter: bool set; if (windowResult.SelectedDisplayUserDefinedCharacterPattern == DisplayFunctionManager.UserDefinedCharacterPattern.Set) { set = true; } else { set = false; } result = DisplaySampleManager.DoUserDefinedCharacterPattern(set, port); break; } return(result); }
private string GetDescription(DisplayCodePageType codePageType) { string description = ""; switch (codePageType) { default: case DisplayCodePageType.CP437: description = "Code Page 437"; break; case DisplayCodePageType.Katakana: description = "Katakana"; break; case DisplayCodePageType.CP850: description = "Code Page 850"; break; case DisplayCodePageType.CP860: description = "Code Page 860"; break; case DisplayCodePageType.CP863: description = "Code Page 863"; break; case DisplayCodePageType.CP865: description = "Code Page 865"; break; case DisplayCodePageType.CP1252: description = "Code Page 1252"; break; case DisplayCodePageType.CP866: description = "Code Page 866"; break; case DisplayCodePageType.CP852: description = "Code Page 852"; break; case DisplayCodePageType.CP858: description = "Code Page 858"; break; case DisplayCodePageType.Japanese: description = "Japanese"; break; case DisplayCodePageType.SimplifiedChinese: description = "Simplified Chinese"; break; case DisplayCodePageType.TraditionalChinese: description = "Traditional Chinese"; break; case DisplayCodePageType.Hangul: description = "Hangul"; break; } return(description); }
public static void SetDisplayCodePageType(DisplayCodePageType codePageType) { DisplayFunctionManager.SelectedCodePageType = codePageType; }