From: <jed...@us...> - 2007-12-26 14:10:22
|
Revision: 11644 http://jvcl.svn.sourceforge.net/jvcl/?rev=11644&view=rev Author: jedi_mbe Date: 2007-12-26 06:10:18 -0800 (Wed, 26 Dec 2007) Log Message: ----------- Added 14- and 16-segmented digit classes, including character mapping Modified Paths: -------------- trunk/jvcl/images/JvSegmentedLEDDisplay.rc trunk/jvcl/resources/JvSegmentedLEDDisplay.res trunk/jvcl/run/JvSegmentedLEDDisplay.pas Modified: trunk/jvcl/images/JvSegmentedLEDDisplay.rc =================================================================== --- trunk/jvcl/images/JvSegmentedLEDDisplay.rc 2007-12-24 22:20:17 UTC (rev 11643) +++ trunk/jvcl/images/JvSegmentedLEDDisplay.rc 2007-12-26 14:10:18 UTC (rev 11644) @@ -8,4 +8,40 @@ 0x0076, 0x0038, 0x005c, 0x0073, 0x0050, 0x003e, 0x006a, 0x0077, 0x007c, 0x0058, 0x005e, 0x0079, 0x0071, 0x0074, 0x0038, 0x005c, 0x0073, 0x001c, 0x006a, 0x0063, 0x0063 -END \ No newline at end of file +END + +SLDCM_14SEG_DEFAULT RCDATA +BEGIN + 0x4C53, 0x4344, 0x5F4D, 0x3431, 0x4553, 0x0047, 0x0000, 0x0000, 0xAC40, + 0xF3FF, 0xFFFF, 0x97FF, 0xFFFE, 0x17FF, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0012, 0x0000, 0x255D, 0x3FC0, 0x12C0, + 0x00C0, 0x0C00, 0x0C3F, 0x0006, 0x00DB, 0x00CF, 0x00E6, 0x00ED, 0x00FD, + 0x0007, 0x00FF, 0x00EF, 0x2400, 0x00C8, 0x0900, 0x1401, 0x02BB, 0x00F7, + 0x128F, 0x0039, 0x120F, 0x0079, 0x0071, 0x00BD, 0x00F6, 0x1209, 0x001F, + 0x2470, 0x0038, 0x0536, 0x2136, 0x003F, 0x00F3, 0x203F, 0x20F3, 0x2109, + 0x1201, 0x003E, 0x0C30, 0x2836, 0x2D00, 0x1500, 0x0C09, 0x2100, 0x0008, + 0x00F7, 0x00FC, 0x00D8, 0x00DE, 0x00FB, 0x0071, 0x00BD, 0x00F4, 0x1209, + 0x001E, 0x2470, 0x0038, 0x1237, 0x2136, 0x00DC, 0x00F3, 0x203F, 0x0050, + 0x2109, 0x2101, 0x003E, 0x0C30, 0x103E, 0x2D00, 0x1500, 0x0C09, 0x1200 +END + +SLDCM_16SEG_DEFAULT RCDATA +BEGIN + 0x4C53, 0x4344, 0x5F4D, 0x3631, 0x4553, 0x0047, 0x0000, 0x0000, 0xAC70, + 0xF3FF, 0xFFFF, 0xBFFF, 0xFFFE, 0x3FFF, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0013, 0x0000, 0x4BBB, 0xA900, 0x007B, + 0x957B, 0x0000, 0x00FF, 0x4B00, 0x0000, 0x0003, 0x3000, 0xFF00, 0x0030, + 0x000C, 0x7700, 0x0003, 0x033F, 0x8C00, 0x0003, 0x03BB, 0xFB00, 0x0003, + 0x000F, 0xFF00, 0x0003, 0x03BF, 0x0000, 0x0090, 0x0330, 0x0000, 0x0024, + 0x5003, 0xF700, 0x000A, 0x03CF, 0x3F00, 0x004A, 0x00F3, 0x3F00, 0x0048, + 0x01F3, 0xC300, 0x0001, 0x02FB, 0xCC00, 0x0003, 0x4833, 0x7C00, 0x0000, + 0x91C0, 0xF000, 0x0000, 0x14CC, 0xCC00, 0x0384, 0x00FF, 0xC700, 0x0003, + 0x80FF, 0xC700, 0x0083, 0x8433, 0x0300, 0x0048, 0x00FC, 0xC000, 0x0030, + 0xA0CC, 0x0000, 0x00B4, 0x5400, 0x3300, 0x0030, 0x4822, 0x0000, 0x0084, + 0x002E, 0x3000, 0x0000, 0x03CF, 0x2800, 0x004A, 0x4220, 0x2C00, 0x0042, + 0x4A26, 0x0200, 0x004A, 0x0A2E, 0x0800, 0x004A, 0x4800, 0x2C00, 0x0040, + 0xD800, 0x2000, 0x0048, 0x4348, 0x0800, 0x0042, 0x4228, 0x0600, 0x004A, + 0x80FF, 0x0000, 0x0042, 0x8433, 0x2000, 0x004B, 0x4028, 0x4000, 0x0020, + 0x4078, 0x0000, 0x00B4, 0x0A2C, 0x1000, 0x0021, 0x4922, 0x0000, 0x0048, + 0x4A11, 0x00 +END Modified: trunk/jvcl/resources/JvSegmentedLEDDisplay.res =================================================================== (Binary files differ) Modified: trunk/jvcl/run/JvSegmentedLEDDisplay.pas =================================================================== --- trunk/jvcl/run/JvSegmentedLEDDisplay.pas 2007-12-24 22:20:17 UTC (rev 11643) +++ trunk/jvcl/run/JvSegmentedLEDDisplay.pas 2007-12-26 14:10:18 UTC (rev 11644) @@ -367,6 +367,48 @@ property Text; end; + // 14-segmented digit + TJv14SegmentedLEDDigit = class(TJvBaseSegmentedLEDDigit) + protected + procedure RecalcSegments; override; + class function MapperFileID: string; override; + procedure CalcG1Seg(Index: Integer); virtual; + procedure CalcG2Seg(Index: Integer); virtual; + procedure CalcHSeg(Index: Integer); virtual; + procedure CalcISeg(Index: Integer); virtual; + procedure CalcJSeg(Index: Integer); virtual; + procedure CalcKSeg(Index: Integer); virtual; + procedure CalcLSeg(Index: Integer); virtual; + procedure CalcMSeg(Index: Integer); virtual; + public + class function SegmentCount: Integer; override; + class function GetSegmentName(Index: Integer): string; override; + class function GetSegmentIndex(Name: string): Integer; override; + published + property UseDP; + property Text; + end; + + // 16-segmented digit + TJv16SegmentedLEDDigit = class(TJv14SegmentedLEDDigit) + protected + procedure RecalcSegments; override; + class function MapperFileID: string; override; + procedure CalcA1Seg(Index: Integer); virtual; + procedure CalcA2Seg(Index: Integer); virtual; + procedure CalcD1Seg(Index: Integer); virtual; + procedure CalcD2Seg(Index: Integer); virtual; + procedure CalcISeg(Index: Integer); override; + procedure CalcLSeg(Index: Integer); override; + public + class function SegmentCount: Integer; override; + class function GetSegmentName(Index: Integer): string; override; + class function GetSegmentIndex(Name: string): Integer; override; + published + property UseDP; + property Text; + end; + // TUnlitColor support routines function IdentToUnlitColor(const Ident: string; var Int: Longint): Boolean; function UnlitColorToIdent(Int: Longint; var Ident: string): Boolean; @@ -479,6 +521,15 @@ Result.Y := Y; end; +//=== Helper routine: TextIndex ============================================== + +function TextIndex(S: string; const Strings: array of string): Integer; +begin + Result := High(Strings); + while (Result > -1) and not AnsiSameText(S, Strings[Result]) do + Dec(Result); +end; + //=== { TJvCustomSegmentedLEDDisplay } ======================================= constructor TJvCustomSegmentedLEDDisplay.Create(AOwner: TComponent); @@ -1701,15 +1752,22 @@ procedure TJvSegmentedLEDCharacterMapper.LoadDefaultMapping; var + resName: string; Stream: TStream; begin - Stream := TResourceStream.Create(HInstance, Display.DigitClass.MapperFileID + '_DEFAULT', RT_RCDATA); - try - LoadFromStream(Stream); - FMappingChanged := False; - finally - FreeAndNil(Stream); - end; + resName := Display.DigitClass.MapperFileID + '_DEFAULT'; + if FindResource(HInstance, PChar(resName), RT_RCDATA) <> 0 then + begin + Stream := TResourceStream.Create(HInstance, Display.DigitClass.MapperFileID + '_DEFAULT', RT_RCDATA); + try + LoadFromStream(Stream); + FMappingChanged := False; + finally + FreeAndNil(Stream); + end; + end + else + Clear; end; procedure TJvSegmentedLEDCharacterMapper.LoadFromFile(const FileName: string); @@ -1885,18 +1943,276 @@ [UpperLeftPoint, Point(UpperLeftPoint.X + DotSize, UpperLeftPoint.Y + DotSize)]); end; -procedure ModuleUnload(Instance: Longint); +//=== { TJv14SegmentedLEDDigit } ============================================== + +procedure TJv14SegmentedLEDDigit.CalcG1Seg(Index: Integer); begin - UnregisterModuleSegmentedLEDDigitClasses(HMODULE(Instance)); + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefLeft + Spacing div 2, FRefCenterY, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing div 2 + SegmentWidth div 2, FRefCenterY - SegmentWidth div 2, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2 - SegmentWidth div 4, FRefCenterY - SegmentWidth div 2, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2, FRefCenterY, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2 - SegmentWidth div 4, FRefCenterY + SegmentWidth div 2, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing div 2 + SegmentWidth div 2, FRefCenterY + SegmentWidth div 2, SlantAngle) + ]); end; -function TextIndex(S: string; const Strings: array of string): Integer; +procedure TJv14SegmentedLEDDigit.CalcG2Seg(Index: Integer); begin - Result := High(Strings); - while (Result > -1) and not AnsiSameText(S, Strings[Result]) do - Dec(Result); + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX + Spacing div 2, FRefCenterY, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing div 2 + SegmentWidth div 4, FRefCenterY - SegmentWidth div 2, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2 - SegmentWidth div 2, FRefCenterY - SegmentWidth div 2, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2, FRefCenterY, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2 - SegmentWidth div 2, FRefCenterY + SegmentWidth div 2, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing div 2 + SegmentWidth div 4, FRefCenterY + SegmentWidth div 2, SlantAngle) + ]); end; +procedure TJv14SegmentedLEDDigit.CalcHSeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefLeft + Spacing + SegmentWidth, FRefTop + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing + SegmentWidth + SegmentWidth div 2, FRefTop + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing - SegmentWidth div 2, FRefCenterY - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing - SegmentWidth div 2, FRefCenterY - SegmentWidth div 2 - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing - SegmentWidth, FRefCenterY - SegmentWidth div 2 - Spacing, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing + SegmentWidth, FRefTop + SegmentWidth + SegmentWidth div 4 + Spacing, SlantAngle) + ]); +end; + +procedure TJv14SegmentedLEDDigit.CalcISeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefTop + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefCenterY - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX, FRefCenterY - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefCenterY - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefTop + SegmentWidth + Spacing, SlantAngle) + ]); +end; + +procedure TJv14SegmentedLEDDigit.CalcJSeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefRight - Spacing - SegmentWidth, FRefTop + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing - SegmentWidth - SegmentWidth div 2, FRefTop + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing + SegmentWidth div 2, FRefCenterY - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing + SegmentWidth div 2, FRefCenterY - SegmentWidth div 2 - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing + SegmentWidth, FRefCenterY - SegmentWidth div 2 - Spacing, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing - SegmentWidth, FRefTop + SegmentWidth + SegmentWidth div 4 + Spacing, SlantAngle) + ]); +end; + +procedure TJv14SegmentedLEDDigit.CalcKSeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefLeft + Spacing + SegmentWidth, FRefBottom - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing + SegmentWidth + SegmentWidth div 2, FRefBottom - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing - SegmentWidth div 2, FRefCenterY + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing - SegmentWidth div 2, FRefCenterY + SegmentWidth div 2 + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing - SegmentWidth, FRefCenterY + SegmentWidth div 2 + Spacing, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing + SegmentWidth, FRefBottom - SegmentWidth - SegmentWidth div 4 - Spacing, SlantAngle) + ]); +end; + +procedure TJv14SegmentedLEDDigit.CalcLSeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefBottom - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefCenterY + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX, FRefCenterY + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefCenterY + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefBottom - SegmentWidth - Spacing, SlantAngle) + ]); +end; + +procedure TJv14SegmentedLEDDigit.CalcMSeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefRight - Spacing - SegmentWidth, FRefBottom - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing - SegmentWidth - SegmentWidth div 2, FRefBottom - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing + SegmentWidth div 2, FRefCenterY + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing + SegmentWidth div 2, FRefCenterY + SegmentWidth div 2 + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing + SegmentWidth, FRefCenterY + SegmentWidth div 2 + Spacing, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing - SegmentWidth, FRefBottom - SegmentWidth - SegmentWidth div 4 - Spacing, SlantAngle) + ]); +end; + +class function TJv14SegmentedLEDDigit.GetSegmentIndex(Name: string): Integer; +begin + Result := TextIndex(Name, ['A', 'B', 'C', 'D', 'E', 'F', 'G1', 'G2', 'H', 'I', 'J', 'K', 'L', 'M', 'DP']); +end; + +class function TJv14SegmentedLEDDigit.GetSegmentName(Index: Integer): string; +begin + if Index = 6 then + Result := 'G1' + else + if Index = 7 then + Result := 'G2' + else + if Index < 6 then + Result := Chr(Ord('A') + Index) + else + if (Index > 7) and (Index < 14) then + Result := Chr(Ord('A') + Index - 1) + else + if Index = 14 then + Result := 'DP' + else + Result := ''; +end; + +class function TJv14SegmentedLEDDigit.MapperFileID: string; +begin + Result := 'SLDCM_14SEG'; +end; + +procedure TJv14SegmentedLEDDigit.RecalcSegments; +begin + CalcASeg(0); + CalcBSeg(1); + CalcCSeg(2); + CalcDSeg(3); + CalcESeg(4); + CalcFSeg(5); + CalcG1Seg(6); + CalcG2Seg(7); + CalcHSeg(8); + CalcISeg(9); + CalcJSeg(10); + CalcKSeg(11); + CalcLSeg(12); + CalcMSeg(13); + if UseDP then + CalcDPSeg(14); +end; + +class function TJv14SegmentedLEDDigit.SegmentCount: Integer; +begin + Result := 15; +end; + +//=== { TJv16SegmentedLEDDigit } =============================================== + +const + seg16Names: array[0..16] of string = ( + 'A1', 'A2', 'B', 'C', 'D1', 'D2', 'E', 'F', 'G1', 'G2', 'H', 'I', 'J', 'K', 'L', 'M', 'DP'); + +procedure TJv16SegmentedLEDDigit.CalcA1Seg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefLeft + Spacing div 2, FRefTop, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2, FRefTop, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2 - SegmentWidth, FRefTop + SegmentWidth, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing div 2 + SegmentWidth, FRefTop + SegmentWidth, SlantAngle) + ]); +end; + +procedure TJv16SegmentedLEDDigit.CalcA2Seg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX + Spacing div 2, FRefTop, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2, FRefTop, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2 - SegmentWidth, FRefTop + SegmentWidth, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing div 2 + SegmentWidth, FRefTop + SegmentWidth, SlantAngle) + ]); +end; + +procedure TJv16SegmentedLEDDigit.CalcD1Seg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefLeft + Spacing div 2, FRefBottom, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2, FRefBottom, SlantAngle), + AngleAdjustPoint(FRefCenterX - Spacing div 2 - SegmentWidth, FRefBottom - SegmentWidth, SlantAngle), + AngleAdjustPoint(FRefLeft + Spacing div 2 + SegmentWidth, FRefBottom - SegmentWidth, SlantAngle) + ]); +end; + +procedure TJv16SegmentedLEDDigit.CalcD2Seg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX + Spacing div 2, FRefBottom, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2, FRefBottom, SlantAngle), + AngleAdjustPoint(FRefRight - Spacing div 2 - SegmentWidth, FRefBottom - SegmentWidth, SlantAngle), + AngleAdjustPoint(FRefCenterX + Spacing div 2 + SegmentWidth, FRefBottom - SegmentWidth, SlantAngle) + ]); +end; + +procedure TJv16SegmentedLEDDigit.CalcISeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX, FRefTop + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefTop + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefCenterY - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX, FRefCenterY - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefCenterY - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefTop + SegmentWidth + Spacing, SlantAngle) + ]); +end; + +procedure TJv16SegmentedLEDDigit.CalcLSeg(Index: Integer); +begin + SetSegmentRenderInfo(Index, srtPolygon, [ + AngleAdjustPoint(FRefCenterX, FRefBottom - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefBottom - SegmentWidth - Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX + SegmentWidth div 2, FRefCenterY + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX, FRefCenterY + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefCenterY + SegmentWidth + Spacing, SlantAngle), + AngleAdjustPoint(FRefCenterX - SegmentWidth div 2, FRefBottom - SegmentWidth - Spacing, SlantAngle) + ]); +end; + +class function TJv16SegmentedLEDDigit.GetSegmentIndex(Name: string): Integer; +begin + Result := TextIndex(Name, seg16Names); +end; + +class function TJv16SegmentedLEDDigit.GetSegmentName(Index: Integer): string; +begin + Result := seg16Names[Index]; +end; + +class function TJv16SegmentedLEDDigit.MapperFileID: string; +begin + Result := 'SLDCM_16SEG'; +end; + +procedure TJv16SegmentedLEDDigit.RecalcSegments; +begin + CalcA1Seg(0); + CalcA2Seg(1); + CalcBSeg(2); + CalcCSeg(3); + CalcD1Seg(4); + CalcD2Seg(5); + CalcESeg(6); + CalcFSeg(7); + CalcG1Seg(8); + CalcG2Seg(9); + CalcHSeg(10); + CalcISeg(11); + CalcJSeg(12); + CalcKSeg(13); + CalcLSeg(14); + CalcMSeg(15); + if UseDP then + CalcDPSeg(16); +end; + +class function TJv16SegmentedLEDDigit.SegmentCount: Integer; +begin + Result := 17; +end; + +//=== { initialization and support routines } ================================= + +procedure ModuleUnload(Instance: Longint); +begin + UnregisterModuleSegmentedLEDDigitClasses(HMODULE(Instance)); +end; + function IdentToUnlitColor(const Ident: string; var Int: Longint): Boolean; begin Int := TextIndex(Ident, ['clDefaultBackground', 'clDefaultLitColor']); @@ -1937,7 +2253,7 @@ RegisterUnitVersion(HInstance, UnitVersioning); {$ENDIF UNITVERSIONING} AddModuleUnloadProc(ModuleUnload); - RegisterSegmentedLEDDigitClasses([TJv7SegmentedLEDDigit]); + RegisterSegmentedLEDDigitClasses([TJv7SegmentedLEDDigit, TJv14SegmentedLEDDigit, TJv16SegmentedLEDDigit]); RegisterIntegerConsts(TypeInfo(TUnlitColor), IdentToUnlitColor, UnlitColorToIdent); finalization This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |