From 560a1e5ba29aaaa6bac238085748863c9043b4ca Mon Sep 17 00:00:00 2001 From: juhamanninen Date: Wed, 28 Dec 2016 18:43:45 +0000 Subject: [PATCH] Move Industrial package from Lazarus sources to CCR. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5565 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../Example/ButtonSamples/CMP_Button_Disa.png | Bin 0 -> 4441 bytes .../Example/ButtonSamples/CMP_Button_Off.png | Bin 0 -> 4441 bytes .../Example/ButtonSamples/CMP_Button_On.png | Bin 0 -> 1778 bytes .../Example/Ex_IndustrialStuff.lpi | 105 ++++ .../Example/Ex_IndustrialStuff.lpr | 21 + .../Example/Ex_IndustrialStuff.res | Bin 0 -> 855 bytes .../industrialstuff/Example/u_industrial.lfm | 134 ++++ .../industrialstuff/Example/u_industrial.pas | 39 ++ components/industrialstuff/industrial.lpk | 95 +++ components/industrialstuff/industrial.pas | 23 + .../industrialstuff/resources/black.png | Bin 0 -> 775 bytes .../industrialstuff/resources/build.bat | 3 + .../industrialstuff/resources/bulboff.xpm | 34 + .../industrialstuff/resources/bulbon.xpm | 34 + .../industrialstuff/resources/green.png | Bin 0 -> 1719 bytes .../resources/industrial_icons.txt | 6 + .../industrialstuff/resources/ledbuttons.txt | 6 + components/industrialstuff/resources/red.png | Bin 0 -> 1859 bytes .../industrialstuff/resources/sensors.txt | 4 + .../industrialstuff/resources/stop_green.png | Bin 0 -> 235 bytes .../industrialstuff/resources/stop_red.png | Bin 0 -> 239 bytes .../resources/stop_unknown.png | Bin 0 -> 244 bytes .../industrialstuff/resources/stop_yellow.png | Bin 0 -> 235 bytes .../industrialstuff/resources/tadvled.png | Bin 0 -> 1719 bytes .../resources/tanalogsensor.png | Bin 0 -> 193 bytes .../industrialstuff/resources/tindadvled.png | Bin 0 -> 787 bytes .../resources/tindgnoumeter.png | Bin 0 -> 363 bytes .../industrialstuff/resources/tindled.png | Bin 0 -> 313 bytes .../industrialstuff/resources/tlednumber.png | Bin 0 -> 219 bytes .../resources/tstoplightsensor.png | Bin 0 -> 258 bytes .../industrialstuff/resources/yellow.png | Bin 0 -> 1841 bytes components/industrialstuff/source/AdvLed.pas | 330 ++++++++++ .../source/AllIndustrialRegister.pas | 30 + .../industrialstuff/source/indcyBaseLed.pas | 228 +++++++ .../industrialstuff/source/indcyClasses.pas | 307 +++++++++ .../industrialstuff/source/indcyGraphics.pas | 198 ++++++ .../industrialstuff/source/indcyTypes.pas | 86 +++ .../industrialstuff/source/indgnoumeter.pas | 457 ++++++++++++++ components/industrialstuff/source/indled.pas | 371 +++++++++++ .../source/industrial_icons.res | Bin 0 -> 3422 bytes .../industrialstuff/source/ledbuttons.res | Bin 0 -> 7710 bytes .../industrialstuff/source/lednumber.pas | 585 ++++++++++++++++++ components/industrialstuff/source/sensors.pas | 485 +++++++++++++++ components/industrialstuff/source/sensors.res | Bin 0 -> 1195 bytes 44 files changed, 3581 insertions(+) create mode 100644 components/industrialstuff/Example/ButtonSamples/CMP_Button_Disa.png create mode 100644 components/industrialstuff/Example/ButtonSamples/CMP_Button_Off.png create mode 100644 components/industrialstuff/Example/ButtonSamples/CMP_Button_On.png create mode 100644 components/industrialstuff/Example/Ex_IndustrialStuff.lpi create mode 100644 components/industrialstuff/Example/Ex_IndustrialStuff.lpr create mode 100644 components/industrialstuff/Example/Ex_IndustrialStuff.res create mode 100644 components/industrialstuff/Example/u_industrial.lfm create mode 100644 components/industrialstuff/Example/u_industrial.pas create mode 100644 components/industrialstuff/industrial.lpk create mode 100644 components/industrialstuff/industrial.pas create mode 100644 components/industrialstuff/resources/black.png create mode 100644 components/industrialstuff/resources/build.bat create mode 100644 components/industrialstuff/resources/bulboff.xpm create mode 100644 components/industrialstuff/resources/bulbon.xpm create mode 100644 components/industrialstuff/resources/green.png create mode 100644 components/industrialstuff/resources/industrial_icons.txt create mode 100644 components/industrialstuff/resources/ledbuttons.txt create mode 100644 components/industrialstuff/resources/red.png create mode 100644 components/industrialstuff/resources/sensors.txt create mode 100644 components/industrialstuff/resources/stop_green.png create mode 100644 components/industrialstuff/resources/stop_red.png create mode 100644 components/industrialstuff/resources/stop_unknown.png create mode 100644 components/industrialstuff/resources/stop_yellow.png create mode 100644 components/industrialstuff/resources/tadvled.png create mode 100644 components/industrialstuff/resources/tanalogsensor.png create mode 100644 components/industrialstuff/resources/tindadvled.png create mode 100644 components/industrialstuff/resources/tindgnoumeter.png create mode 100644 components/industrialstuff/resources/tindled.png create mode 100644 components/industrialstuff/resources/tlednumber.png create mode 100644 components/industrialstuff/resources/tstoplightsensor.png create mode 100644 components/industrialstuff/resources/yellow.png create mode 100644 components/industrialstuff/source/AdvLed.pas create mode 100644 components/industrialstuff/source/AllIndustrialRegister.pas create mode 100644 components/industrialstuff/source/indcyBaseLed.pas create mode 100644 components/industrialstuff/source/indcyClasses.pas create mode 100644 components/industrialstuff/source/indcyGraphics.pas create mode 100644 components/industrialstuff/source/indcyTypes.pas create mode 100644 components/industrialstuff/source/indgnoumeter.pas create mode 100644 components/industrialstuff/source/indled.pas create mode 100644 components/industrialstuff/source/industrial_icons.res create mode 100644 components/industrialstuff/source/ledbuttons.res create mode 100644 components/industrialstuff/source/lednumber.pas create mode 100644 components/industrialstuff/source/sensors.pas create mode 100644 components/industrialstuff/source/sensors.res diff --git a/components/industrialstuff/Example/ButtonSamples/CMP_Button_Disa.png b/components/industrialstuff/Example/ButtonSamples/CMP_Button_Disa.png new file mode 100644 index 0000000000000000000000000000000000000000..0d5a54c87cf60d40bd6f9ce8c5f2528380e7fab3 GIT binary patch literal 4441 zcmV-f5vJ~mP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-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TAp|ChXq~j^blV6C!_koay@!d2?=?K{cmFFX z{RQwdfJ$|R&CNPC1{=?eGMAg}GLy;RXpNAP>2yjMh71OMhNB@CioRJ{$)yLHuv$!oyx zff_)$vP`+WOu14C!&!EV^5-;dy_4)~8tkcpdmDP)MVQ)-1W% z*?U1iFrKAc3uOSj1N^Gtd4n(Faax(DZ8ztcjC;Yb@!YGv3*2saUh4~c9e)nc?!u=B fbB}uE@}B_!OG!{(O+pfj00000NkvXXu0mjffI3a{ literal 0 HcmV?d00001 diff --git a/components/industrialstuff/Example/ButtonSamples/CMP_Button_Off.png b/components/industrialstuff/Example/ButtonSamples/CMP_Button_Off.png new file mode 100644 index 0000000000000000000000000000000000000000..0d5a54c87cf60d40bd6f9ce8c5f2528380e7fab3 GIT binary patch literal 4441 zcmV-f5vJ~mP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFU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4-Z}7x4<{goj}v~zXALuyOibYFTaFRntpG7FCx(CG9wl zIXgQe3`1PkWw~5JNWlkx{eVG#0PvlL=iLU7^Lal4sMXdHLJ)<9gZ+Jkl&r0-QK?jj zqUc;T#-w%eTNFiDYblq@IF3UUMNEPTCW=^FUt>`ofSfyl~DaCXe5=DlMdM%OrO4IkNi4D90xTW&UvqfPkY~^wQGOY%|8B?mCI6 z8c@j*8Dp^4qLjh{gTVl6ZMvJwmN<@6=)@4s+<>i3H=`1OZsN^i6=N-ErPKSoXoONq zq?G3jZBadof~Aybt&vjB0OoyBWD?Z&p0tDkJxm-+aN!1|ccJQ?4yX-9xLXgkpkV?_*cCf@uf@w13ZwbI1 zz>Eihl2rjpV2nX2g%*M^3{yL}%xw_!sHl`;eSMuJ*ChzXOr`{e&XbKyCX<3J!X!cyuje=pg+hU?tu3_HbUGb| z!vWfn3(xZDivJUC7aEX$z(oLv)L@! zY?f-Z%I@wiuImy60S_M?pfifoR-0fn0r(hr_o95@4dB&oyPt7$E~Qe5$VBvdJyup$ za2*HNbqT|eAPCay36RZZab1^uK9B3VNGa*{dK^65M>~>!zfZT_2bcoiZ+M>hyp*f~ z_yAkGn-uZ|Yz$IrO2rcSd_L8AVr+|TAp|ChXq~j^blV6C!_koay@!d2?=?K{cmFFX z{RQwdfJ$|R&CNPC1{=?eGMAg}GLy;RXpNAP>2yjMh71OMhNB@CioRJ{$)yLHuv$!oyx zff_)$vP`+WOu14C!&!EV^5-;dy_4)~8tkcpdmDP)MVQ)-1W% z*?U1iFrKAc3uOSj1N^Gtd4n(Faax(DZ8ztcjC;Yb@!YGv3*2saUh4~c9e)nc?!u=B fbB}uE@}B_!OG!{(O+pfj00000NkvXXu0mjffI3a{ literal 0 HcmV?d00001 diff --git a/components/industrialstuff/Example/ButtonSamples/CMP_Button_On.png b/components/industrialstuff/Example/ButtonSamples/CMP_Button_On.png new file mode 100644 index 0000000000000000000000000000000000000000..e6124be65fa5209686c1d42cf00091bb05faffc0 GIT binary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 z4HMUm?p*PbKO=A*D8>bC0Yr}I$^pt*>yMFAFo@&GLwlV|7V`e1}#rFo3zyH)@ zxfaUH=>3$-CGTbtIFB0s)MLUCJZx0e>aJDLSr66&l-?_dvyErDn%%&%Kk)Sx4x2Ii zFJ45HBQ6YBkySOn{YvUh{kp;yrE_8e$!rjgNZbx$fOyxR?2aDW`=)H`u4~nsC zSf(A7B@~(xxbw%e%6cwqH}L)$lur)28y;{u6+jcbe~j0g_&$%`Rg9j)ZdfNowwt@4 znkRfIMSBPBUHJR&!(2}HWnczEMo=y3HhOQX$4_GPh00YO8yf9&pYeLm&%Xi;0E>k6 U>>h>aVgLXD07*qoM6N<$f`3CnP5=M^ literal 0 HcmV?d00001 diff --git a/components/industrialstuff/Example/Ex_IndustrialStuff.lpi b/components/industrialstuff/Example/Ex_IndustrialStuff.lpi new file mode 100644 index 000000000..c6926d941 --- /dev/null +++ b/components/industrialstuff/Example/Ex_IndustrialStuff.lpi @@ -0,0 +1,105 @@ + + + + + + + + + + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="industrial"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="Ex_IndustrialStuff.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="Ex_IndustrialStuff"/> + </Unit0> + <Unit1> + <Filename Value="u_industrial.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="u_industrial"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="Ex_IndustrialStuff"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + <Optimizations> + <OptimizationLevel Value="2"/> + </Optimizations> + </CodeGeneration> + <Linking> + <LinkSmart Value="True"/> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CompilerMessages> + <MsgFileName Value=""/> + </CompilerMessages> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/industrialstuff/Example/Ex_IndustrialStuff.lpr b/components/industrialstuff/Example/Ex_IndustrialStuff.lpr new file mode 100644 index 000000000..034654ad4 --- /dev/null +++ b/components/industrialstuff/Example/Ex_IndustrialStuff.lpr @@ -0,0 +1,21 @@ +program Ex_IndustrialStuff; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, u_industrial + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource := True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/industrialstuff/Example/Ex_IndustrialStuff.res b/components/industrialstuff/Example/Ex_IndustrialStuff.res new file mode 100644 index 0000000000000000000000000000000000000000..e66ecf85feb5a99d4bc85c4973bd1bb2e918b668 GIT binary patch literal 855 zcma)4OKaOe5O(RUP{^%0E_*CkiWA4QL2@vm1=9yPq%A$JS0j7rzPhvPM87^ANq#6L zlnPeN&dkny-#0TFjYf>l<70oweDb|{xsRVx&WkQ~a&k;5t{;qMTL`F}E%_un;|#2H zm9p!Sf4loQe#aR`VJo4Xg_1Xb{CfWSRUr_;taQVufW?xhV6RYazz7^0C4)m($FX$g zN}$QM6V8mVss@bThux?YJJecMV55r76F}Kn3(5y40nvp;kQ)_2#uNz7Th6R7WZXF8 zg>AmlCA$r-N-}o#PnW{Nd(L9xDeYd_i*ufLT`NEtl#j%G-lj3(y;f4R4mJp~4Ft%F zeBj!>_h1RJY}zX;D(LTVv6H5AKf`VaWe5MuUa{<lvX#5Xj0hQL$2ZQ#;5721CbL$N ze{15?ikN(Y=Fa^Bn(OTH{pD&lolK`v)|0B{ObfeCV%<sD$-!EJ&k#7ed!9uM3FFe% z?ms7g!FzcSWC}Fgohku-Ct3!mZiCt?4Qs$Y!iq!a!vno($MG4qpqXy}B^S7~TjCWs lOKKt8wJ3QlG(taE8by96@mKXCAHpc|0~zXF<olhT{{cli6tn;U literal 0 HcmV?d00001 diff --git a/components/industrialstuff/Example/u_industrial.lfm b/components/industrialstuff/Example/u_industrial.lfm new file mode 100644 index 000000000..863780a96 --- /dev/null +++ b/components/industrialstuff/Example/u_industrial.lfm @@ -0,0 +1,134 @@ +object Form1: TForm1 + Left = 123 + Height = 166 + Top = 95 + Width = 568 + Caption = 'IndustrialStuff Example' + ClientHeight = 166 + ClientWidth = 568 + LCLVersion = '1.1' + object indLed1: TindLed + Left = 200 + Height = 35 + Top = 33 + Width = 34 + LedValue = False + Bevels = < + item + HighlightColor = clBlack + ShadowColor = clBlack + end + item + Width = 3 + end + item + Style = bcLowered + end + item + HighlightColor = clBlack + ShadowColor = clBlack + end> + LedColorOn = clLime + LedColorOff = clGreen + LedColorDisabled = 22963 + ShapeLedColorOn = clGreen + ShapeLedColorOff = 16384 + ShapeLedColorDisabled = 13416 + end + object StopLightSensor1: TStopLightSensor + Left = 96 + Height = 59 + Top = 24 + Width = 25 + Center = True + Picture.Data = { + 1754506F727461626C654E6574776F726B47726170686963EF00000089504E47 + 0D0A1A0A0000000D49484452000000150000002B08020000001805541C000000 + B649444154789CED94010E84200C04FBF47B9A3FE304142AB5AD5B721763DCA0 + 21C1D9D6BA919639D17A7DA24A296D3CE15AC11FF3ADCF089F5F8FA8AED3072C + 9EC39A85CA77389FAB161E5F15E7C5FA173F3B3F69017FBF6611CF8FABFBE7BF + DCFB1EE08FF0B985959F8A9523D5C2E22B9C7F6FAC0B8017CDE3F5A505967F1B + 76F8C1E2CD3FCEEFD363FBEB3C87350B277F54226C58983CCB7FB3C0F2CF2B47 + EA4B0B2CFF36ECF083C5F3F3BF84B4F169427D48317D01F81FF539473C105700 + 00000049454E44AE426082 + } + State = slRED + end + object LEDNumber1: TLEDNumber + Left = 32 + Height = 28 + Top = 116 + Width = 177 + Caption = 'Lazarus' + OffColor = 930866 + OnColor = clLime + end + object AnalogSensor1: TAnalogSensor + Left = 256 + Height = 136 + Top = 8 + Width = 153 + BorderWidth = 2 + BorderStyle = bsSingle + Caption = 'level : ' + ClientHeight = 132 + ClientWidth = 149 + Font.Height = -16 + Font.Name = 'Arial' + ParentColor = False + ParentFont = False + TabOrder = 0 + ShowText = True + ShowLevel = True + ColorFore = clLime + ColorBack = clBlack + Value = 20 + ValueMin = 0 + ValueMax = 100 + ValueRed = 30 + ValueYellow = 60 + AnalogKind = akVertical + end + object indGnouMeter1: TindGnouMeter + Left = 424 + Height = 129 + Top = 17 + Width = 120 + Caption = 'indGnouMeter1' + Value = 70 + Color = clPurple + ParentColor = False + ColorFore = clRed + ColorBack = clInactiveCaption + SignalUnit = 'Units' + ValueMin = 0 + ValueMax = 100 + Digits = 0 + Increment = 10 + ShowIncrements = True + Transparent = True + GapTop = 20 + GapBottom = 10 + BarThickness = 5 + MarkerColor = clBlue + ShowMarker = True + end + object Arrow1: TArrow + Left = 48 + Height = 20 + Top = 41 + Width = 20 + Constraints.MinHeight = 8 + Constraints.MinWidth = 8 + end + object AdvLed1: TAdvLed + Left = 152 + Height = 24 + Top = 40 + Width = 24 + Kind = lkYellowLight + State = lsOn + Blink = False + AutoSize = True + end +end diff --git a/components/industrialstuff/Example/u_industrial.pas b/components/industrialstuff/Example/u_industrial.pas new file mode 100644 index 000000000..f52ac4ddb --- /dev/null +++ b/components/industrialstuff/Example/u_industrial.pas @@ -0,0 +1,39 @@ +unit u_industrial; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, IndLed, Sensors, LedNumber, + IndGnouMeter, AdvLed, Forms, Controls, Graphics, Dialogs, Arrow; + +type + + { TForm1 } + + TForm1 = class(TForm) + AdvLed1: TAdvLed; + AnalogSensor1: TAnalogSensor; + Arrow1: TArrow; + indGnouMeter1: TindGnouMeter; + indLed1: TindLed; + LEDNumber1: TLEDNumber; + StopLightSensor1: TStopLightSensor; + private + + public + + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +end. + diff --git a/components/industrialstuff/industrial.lpk b/components/industrialstuff/industrial.lpk new file mode 100644 index 000000000..8d5b2fa90 --- /dev/null +++ b/components/industrialstuff/industrial.lpk @@ -0,0 +1,95 @@ +<?xml version="1.0"?> +<CONFIG> + <Package Version="4"> + <PathDelim Value="\"/> + <Name Value="industrial"/> + <Author Value="Jurassic Pork"/> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <SearchPaths> + <IncludeFiles Value="source"/> + <OtherUnitFiles Value="source"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <Optimizations> + <OptimizationLevel Value="2"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + <Other> + <CompilerMessages> + <MsgFileName Value=""/> + </CompilerMessages> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Description Value="Industrial-themed (IPV/PCV) components and gauges (e.g. LEDs)."/> + <License Value="MPL + GPL "/> + <Version Minor="1"/> + <Files Count="10"> + <Item1> + <Filename Value="source\indled.pas"/> + <UnitName Value="IndLed"/> + </Item1> + <Item2> + <Filename Value="source\sensors.pas"/> + <UnitName Value="Sensors"/> + </Item2> + <Item3> + <Filename Value="source\AllIndustrialRegister.pas"/> + <HasRegisterProc Value="True"/> + <UnitName Value="AllIndustrialRegister"/> + </Item3> + <Item4> + <Filename Value="source\lednumber.pas"/> + <UnitName Value="LedNumber"/> + </Item4> + <Item5> + <Filename Value="source\indgnoumeter.pas"/> + <UnitName Value="IndGnouMeter"/> + </Item5> + <Item6> + <Filename Value="source\AdvLed.pas"/> + <UnitName Value="AdvLed"/> + </Item6> + <Item7> + <Filename Value="source\indcyBaseLed.pas"/> + <UnitName Value="indcyBaseLed"/> + </Item7> + <Item8> + <Filename Value="source\indcyClasses.pas"/> + <UnitName Value="indcyClasses"/> + </Item8> + <Item9> + <Filename Value="source\indcyGraphics.pas"/> + <UnitName Value="indcyGraphics"/> + </Item9> + <Item10> + <Filename Value="source\indcyTypes.pas"/> + <UnitName Value="indcyTypes"/> + </Item10> + </Files> + <Type Value="RunAndDesignTime"/> + <RequiredPkgs Count="1"> + <Item1> + <PackageName Value="IDEIntf"/> + </Item1> + </RequiredPkgs> + <UsageOptions> + <UnitPath Value="$(PkgOutDir)"/> + </UsageOptions> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <CustomOptions Items="ExternHelp" Version="2"> + <_ExternHelp Items="Count"/> + </CustomOptions> + </Package> +</CONFIG> diff --git a/components/industrialstuff/industrial.pas b/components/industrialstuff/industrial.pas new file mode 100644 index 000000000..1cff754a5 --- /dev/null +++ b/components/industrialstuff/industrial.pas @@ -0,0 +1,23 @@ +{ This file was automatically created by Lazarus. Do not edit! + This source is only used to compile and install the package. + } + +unit industrial; + +{$warn 5023 off : no warning about unused units} +interface + +uses + IndLed, Sensors, AllIndustrialRegister, LedNumber, indGnouMeter, AdvLed, + indcyBaseLed, indcyClasses, indcyGraphics, indcyTypes, LazarusPackageIntf; + +implementation + +procedure Register; +begin + RegisterUnit('AllIndustrialRegister', @AllIndustrialRegister.Register); +end; + +initialization + RegisterPackage('industrial', @Register); +end. diff --git a/components/industrialstuff/resources/black.png b/components/industrialstuff/resources/black.png new file mode 100644 index 0000000000000000000000000000000000000000..183962457c21eded9f2d418b251f58c9797651e2 GIT binary patch literal 775 zcmV+i1Ni)jP)<h;3K|Lk000e1NJLTq000;O000;W1ONa4N`Cco00001b5ch_0Itp) z=>Px#0%A)?L;(MXkIcUS00Of~L_t(I%Y~CmY)nxY$A9PEJMFa9$LIqcQc~126KN0@ zDqf);J4uB^SAs;ENRV#CLWIPEglOWCNLOq`L?S_Sg=i@)K_`@o(MCIc&dc0;K8v|# zIu-Gq)j8+)J<k6-pCa3GX4P%34+Q*vr9z?Z?uQS)JtodS%vj!dI~dV1>Cw;Rss5m& zIx2U+tUQF3fmE6<JASiy+kkq^du$Yf!k~r?%;93&sl9e6E4W$S(lw%QN|WBBS4fp0 zh*##xT4~Z(by!+^JhQVZKiSr=&*}rRK$x=fWTQSU-}U(p3ex=Q6W`^M9Fgk3@KmNP zazTE`rZesXRK=a4M{-POqMMQ<IpPr`?XpAP*AK_dDllMK!%|-t{RG{7xlE^$N@h~z z$`j{>ddJ*ptM{V}th()kDols^gO|F+niS!~0AQSU)kj@DmO=iaK#vqKn1*sPjloMH z05<)6rDie32E`>MNn-qT9SXALCLe$#z1Wl#8s!FFu^c@7&lDOPm1_|D8MRfhdn`Cv zSZ41*6SkeGLA3XWl2T>@;4qG!gxgHG_%eR+X@F6KSZ8~w8m1Zm%>*$wY6_16kVggO zbiO8Hkm$G<)^QFCt{y{-ksv{gVMg6tvsfw-d489;iP$4*-4efpqk?Ya1QSdUA?e~i zcF7Fd-oH9c*aQ;2LxG)1Pd#JlZcjEJ2Psog`&zU8495f<J@CO?wI-xCDvP&M@Nya@ zUs?J}%kXu^z)XFXNYBT-C4o`1MvgK~rP^4)diJqPlGx6T)^FzsA(@FY@aHvbZL0Mr zfJ%yhaYAUkbPe3U9BHL5rMH^Y$`S&;-L;z*&Moy=3b7fsgMBZb4Bn!XFfwJP0kD`( z74tpwy=AEQVDd9TzA}`S>n{f&pzx531=#!|`9^2o{|0Q1K&n}afcpRd002ovPDHLk FV1fj>W&HpE literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/build.bat b/components/industrialstuff/resources/build.bat new file mode 100644 index 000000000..bb2e2af88 --- /dev/null +++ b/components/industrialstuff/resources/build.bat @@ -0,0 +1,3 @@ +..\..\..\tools\lazres ..\source\sensors.res @sensors.txt +..\..\..\tools\lazres ..\source\industrial_icons.res @industrial_icons.txt +..\..\..\tools\lazres ..\source\ledbuttons.res @ledbuttons.txt \ No newline at end of file diff --git a/components/industrialstuff/resources/bulboff.xpm b/components/industrialstuff/resources/bulboff.xpm new file mode 100644 index 000000000..79195063c --- /dev/null +++ b/components/industrialstuff/resources/bulboff.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * LEDBULBOFF[] = { +"15 15 16 1", +" c #000000", +". c #800000", +"+ c #008000", +"@ c #808000", +"# c #000080", +"$ c #800080", +"% c #008080", +"& c #808080", +"* c #C0C0C0", +"= c #FF0000", +"- c #00FF00", +"; c #FFFF00", +"> c #0000FF", +", c #FF00FF", +"' c #00FFFF", +") c #FFFFFF", +"@@@@@@@@@@@@@@@", +"@@@@@@@@@@@@@@@", +"@@@@@@@@@@@@@@@", +"@@@@@@@@@@@@@@@", +"@@@@@@ @@@@@@", +"@@@@@ ))) @@@@@", +"@@@@ ))))) @@@@", +"@@@@ ))&)) @@@@", +"@@@@ ))&)) @@@@", +"@@@@@ )&) @@@@@", +"@@@@@@ ) @@@@@@", +"@@@@@@ ) @@@@@@", +"@@@@@@ @@@@@@", +"@@@@@@ * @@@@@@", +"@@@@@@ @@@@@@"}; diff --git a/components/industrialstuff/resources/bulbon.xpm b/components/industrialstuff/resources/bulbon.xpm new file mode 100644 index 000000000..03b48d3c9 --- /dev/null +++ b/components/industrialstuff/resources/bulbon.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * LEDBULBON[] = { +"15 15 16 1", +" c #000000", +". c #800000", +"+ c #008000", +"@ c #808000", +"# c #000080", +"$ c #800080", +"% c #008080", +"& c #808080", +"* c #C0C0C0", +"= c #FF0000", +"- c #00FF00", +"; c #FFFF00", +"> c #0000FF", +", c #FF00FF", +"' c #00FFFF", +") c #FFFFFF", +"@@@@@@@;@@@@@@@", +"@@@@@@@;@@@@@@@", +"@@;@@;;;;;@@;@@", +"@@@;;;;;;;;;@@@", +"@@@;;; ;;;@@@", +"@@;;; );) ;;;@@", +"@@;; ););) ;;@@", +";;;; ;)&); ;;;;", +"@@;; );&;) ;;@@", +"@@;;; )&) ;;;@@", +"@@@;;; ) ;;;@@@", +"@@@;;; ; ;;;@@@", +"@@;@@; ;@@;@@", +"@@@@@@ * @@@@@@", +"@@@@@@ @@@@@@"}; diff --git a/components/industrialstuff/resources/green.png b/components/industrialstuff/resources/green.png new file mode 100644 index 0000000000000000000000000000000000000000..2a20ee074cbac3a7576f366a4211396150cb2acd GIT binary patch literal 1719 zcmV;o21xmdP)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^00v)4L_t(Y$CXxXXq4F%e$IVAXYw%_Cy6nm#;(!0 z+309O61J?4Ei0&tu(a%wR?=N;p%lvYM~l=766n%G^^b_`LM^ncwXM69W=qPd?5c}N zv>Ov=BT@7HVJ4YmGMSm|%sVsh``*(Z8oO+*w9lV&Io$g^_Z%+gxrAp!U$<^uc;CK# z2ScGyC>RU|iHM@nXmoIJaPZ2ND<93w%zO+WhyN2|`}XZ`Uc7j5B$LTV%d+^v@B`V? z+s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!c2%TMvpvz)jAK1ip!NJ(rSPVc) z0I&uI20ja{3DDeB4E5D5WF=j)Edf^)ks=IINq=08300V+l0ga?q>v6rc*)KQvXU<9 z);3aXI!+bkl^7TpxC0;~0Ob4n`u?6sEX&y3A`UdY#`dzxshJEkQNmFCOk_fV&I$~u z&{=`TL^`wLgC<Hj{V>b<IPgmIcR4yc&)H0tZ{EDw2_UBcV8?Nig2bNs`ud=gm)KF) zh+C0v@>i5#b9o4UwVH%5puivnCUn&YpBjW$DWkdQ7{+c+;nl_?<Rn#mk<Q@S)$8~A z`}^MpkXW5X`H6{%rBG<+q4Y{hYpC5xU#s4V?w;%9t<q?F;6=0)?V~!+E^P7aqRr+G za^cY3xgJC=57ME~_oy}yLT^tmS(&_Z?%cU!j^p$Ka90IfDP`>b{rgHwOY4iHqa#$i z{&_n1^>6dgox2!H-lCMTz&T;jqCLy~iR<XT`w{FhL2rhC%6hICmo8l*P0{5$@4Wl& z^78WU0HnX_2Lxb4Fc|!Kdwcu$O|PM^S>xy3FYQ6q`U;wi5AzppiU4M>Qi__uRwQC6 zx^d%Ej>TedZ0VkV@BI0xsi|KAm;@l7=4b*y(Btv6?ccxuCyh;w!F)akCW-3mAbh2z z00=89X+)z@NLRvRdhz+^gR!ozuCtj;<~;z@tK?6$%*VMh03pBM|5{U1)5}}7ZrKzF z1T<Au2>`o}i^Oum866p&zJ2@l)p$Jq7XSkQ5|3upGd%fAPyws~Py?V=)3jRCG|K@{ zE|-hjwmlAD1i%!4B>?vSWcpu4C=?<98UW)<KL-au0e~HeMC7y1{|m8Y4=piKhTH%E N002ovPDHLkV1f=QG06Y` literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/industrial_icons.txt b/components/industrialstuff/resources/industrial_icons.txt new file mode 100644 index 000000000..902790dc6 --- /dev/null +++ b/components/industrialstuff/resources/industrial_icons.txt @@ -0,0 +1,6 @@ +tadvled.png +tanalogsensor.png +tindgnoumeter.png +tindled.png +tlednumber.png +tstoplightsensor.png diff --git a/components/industrialstuff/resources/ledbuttons.txt b/components/industrialstuff/resources/ledbuttons.txt new file mode 100644 index 000000000..382ab3a71 --- /dev/null +++ b/components/industrialstuff/resources/ledbuttons.txt @@ -0,0 +1,6 @@ +black.png +green.png +red.png +yellow.png +bulboff.xpm +bulbon.xpm diff --git a/components/industrialstuff/resources/red.png b/components/industrialstuff/resources/red.png new file mode 100644 index 0000000000000000000000000000000000000000..40081a2e03856a203b9284a12411f44d82cc0914 GIT binary patch literal 1859 zcmV-J2fX-+P)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY07w7;07w8v$!k6U000Sga6xAP000;O000;Ocub|H000JT zNkl<ZNXM0yTWnO<8HK<9oVlDcGmgi1*%L6~Qey*gxEMESg-ZpMOPi`y)6`0el9EbM z)rY=RsID4>)KpakFGxW&5<FBvq5%boL~er+;SLTp7~>L*?*=pW_#WFc<C!_<{Cxn@ zDy67hFaOro-fQi>wDqqoJQ;!V^74kQTeohjt*xz%#bPlLk$5~F@9gaCJay{S$M^2t zI}I%Gf5KR^X3gtIj~?wwCX-$|o!0I<cf8h1m-NcTi(c35+g>V_@=~dko;Y!0u&%D| z=Ya2VMDicZhEcq8=gvPjH#dKKERm42EiLqZ+KM?jfo~xVfNNRgqD3s-xRFiUwy|jO zV)pIZcXs#g-LE>16aTLQrfHV!-@pHKQ&ZFGkB%LauD|_NwWo``U{IEA`i2&-s1gy; z$-Z9tE}Ug%ZcfY<EA^QzTlv8&uSiQvOV5rSJHDCA<%S>Y_pV*L&W?_bdV6>6@_ygA zRew`f?6to0j+Y)C)y&wKmmM3^?AVx>85{G`iG+9U&>?-RywrPp%VzJ7&CPoM{(W!n z-o0%=_=`h78r0X<|7y>kJwN;K$Pvk0y&`j`PxJCyyQSvE?~0krA=#`*Hj8AlLN+Us z%}DW*B|N>jQaav!SAt=SzL{D1@%HT%9UUFg-{1eq7Z!;~>G9*oZ$A|d7v4PfzD|8` zjM{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qK71gU`!^=&2 z<HkQoUp^;!Q}@-ENs7jYG=1)4?wt6LTN;wOoxjy&egP*>o)jY(^bQ<2@TckN=|jNm zm-9e?MX^}y*W0&me<K_W1`4AE`t^oQEGj9MnXb>&o0$?6HS(k6S5-4QJ0};<pVvep zLDuu!_YNOEJTx@)J75s-9+zka5VLK&sj;!~m+RN9i)GVkM3st)3i9&v0hphiBOZ_A zs)rR0(Q&gg(bCegKbcIv2i$!`{@BQTI2Q$K3knK;w0`~iEniu&Vo6a^k>BU@380Sa zGCeir^z`=Ly>{)|nTd&s_kng`>OpULLMHzkd_W;k2`u;f{mU)ODh6a>VPPVd%k=|2 zzz{GA<o>77|1xT8YX$HFLH_k~aDXh3>*(n4p0xj;JOb=nBb*$Z0000bbVXQnWMOn= zI%9HWVRU5xGB7bPEif`IF)>szH99ajIx;jZFg7|cF!8L8(f|MeC3HntbYx+4Wjbwd xWNBu305UKzGc7PREiyM$F*!OjG&(ReEig4YFfbuIUp4>$002ovPDHLkV1k?(YW4sC literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/sensors.txt b/components/industrialstuff/resources/sensors.txt new file mode 100644 index 000000000..0f1a17407 --- /dev/null +++ b/components/industrialstuff/resources/sensors.txt @@ -0,0 +1,4 @@ +stop_green.png +stop_red.png +stop_unknown.png +stop_yellow.png \ No newline at end of file diff --git a/components/industrialstuff/resources/stop_green.png b/components/industrialstuff/resources/stop_green.png new file mode 100644 index 0000000000000000000000000000000000000000..a8461f35af9cc0f6624ac504028613fcb3f3167d GIT binary patch literal 235 zcmV<H02Kd;P)<h;3K|Lk000e1NJLTq000#L001ip0ssI27zI=u00028Nkl<Zc%1E$ z3krZB5JWxt9<7^gnVO$%wOJ`B8Vp2vPqA^!T-^4NHOw4&hi3zC=8t<?_^?RD9N;Th zQK<X@`z>A3;{)t}Z*dENZ!d2+Un;KhrwZWxqyqkbSz+$aFz@I;<vGCD@VR2tKMGr_ zqT4?z`kxeF|ErVn^Q8jpe-|F`jpFY=&ih4nVVL@#U`^5O-_H1LT`}N!kDZs}DSr0- lq~iPiUrdQSPb5E*Eh~Ck^*J~t)4>1$002ovPDHLkV1m4zXZHXA literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/stop_red.png b/components/industrialstuff/resources/stop_red.png new file mode 100644 index 0000000000000000000000000000000000000000..8101a522de27bd895461a695df0a6ec14e9807cf GIT binary patch literal 239 zcmV<L01*F)P)<h;3K|Lk000e1NJLTq000#L001ip0ssI27zI=u0002CNkl<Zc%1E& z0S<&93<Uf1dzwGv1QaT@ty^*zW89!2!P(Zjk(N2pdVQiwDQ!IATEQRlt<MObUyrD+ z(+4b`!<vQ4cQ~J`79L*}=f(OLKRZ8Z0e`<{5zmjS`{%#h`ySwr@VSMRpNf?u)xzQ{ zoPTeu3xF5R<MpKlmVX;|_`%}MKhE#dWBcnohcyc)e^erDSeQJ^f3v{y&nrjjOA9Rj pHtg_&#q;yOgtYN#LVZXveF69%^*Kj85LW;I002ovPDHLkV1nb?XuALa literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/stop_unknown.png b/components/industrialstuff/resources/stop_unknown.png new file mode 100644 index 0000000000000000000000000000000000000000..e4aa1057137bbc0c60c08048e603a2eca40d7d75 GIT binary patch literal 244 zcmV<Q01N+#P)<h;3K|Lk000e1NJLTq000#L001ip0ssI27zI=u0002HNkl<Zc%1E( z(F%Yd3`PBPKdnDA)6(g3^G<pw8U&)8vtgHV+giE!cx#0aPTt`a!H4-Wr-jd(o~!}B zfd`5qU*LEwC?r0^$1#}#;QQeX{kdY6zf}PD#})AVs|s^|)Ott$eO&{53*RfW{P}z| zREYUY@bP&gQ-JwzI^+Gh0?fY%D}1N;^N;h_?UD67PvMb5$)8IR78D{+@?R8K{`n68 u>(3Qf{$*I<JH_|&znSXf!$Q?dvegct{?_7K68o0`0000<MNUMnLSTXgqi<>e literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/stop_yellow.png b/components/industrialstuff/resources/stop_yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..9d4fbe9437f44069732a9657fadd1a349e7b382d GIT binary patch literal 235 zcmV<H02Kd;P)<h;3K|Lk000e1NJLTq000#L001ip0ssI27zI=u00028Nkl<Zc%1E& z4GMrD3`RY=NAqS&(fnK6+@y%;!$6Gp96EGiFD`!G8UQG~(<g#A^R-S3pBH^MSMUQ& zC`i7-=@+fw_zb7(?W$1lbMc1#v0|0KR4C35E7bSb6z2XB^Zx#ifAg^Pe}yRp*FPr) zj6&pLlb^>^{O<W-#ozyWzAXA~zRveBr4ZiVh^6<NR<OKp?|)Tj__27){#c>we;yY2 lN%8&u52h3zHqs8smIHR>6Q2X)=pX<9002ovPDHLkV1mFZYt#S$ literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tadvled.png b/components/industrialstuff/resources/tadvled.png new file mode 100644 index 0000000000000000000000000000000000000000..2a20ee074cbac3a7576f366a4211396150cb2acd GIT binary patch literal 1719 zcmV;o21xmdP)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^00v)4L_t(Y$CXxXXq4F%e$IVAXYw%_Cy6nm#;(!0 z+309O61J?4Ei0&tu(a%wR?=N;p%lvYM~l=766n%G^^b_`LM^ncwXM69W=qPd?5c}N zv>Ov=BT@7HVJ4YmGMSm|%sVsh``*(Z8oO+*w9lV&Io$g^_Z%+gxrAp!U$<^uc;CK# z2ScGyC>RU|iHM@nXmoIJaPZ2ND<93w%zO+WhyN2|`}XZ`Uc7j5B$LTV%d+^v@B`V? z+s)m*H{`wh_hdGkmDy~TJ3Biko12?|1VDWn5&Z|V5amaY9{t0yW5*7}VlldW^&f}~ z_aVaxI7%L1KxG3S_F+eD6JFkX02?=K#Oc$guXS{E9CjQh`d<YUMX5M@_Uy-PZEX#I z{qO_o9=yzRg>iU`Olsct64$J)B?9rx;yC&qbR(5Y(>h}_x76*$>)-kgb#--(96562 zo3?E~d}_Z>oH%i9eturQ{hJQ?#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gm)KF) zh+C0v@>i5#b9o4UwVH%5puivnCUn&YpBjW$DWkdQ7{+c+;nl_?<Rn#mk<Q@S)$8~A z`}^MpkXW5X`H6{%rBG<+q4Y{hYpC5xU#s4V?w;%9t<q?F;6=0)?V~!+E^P7aqRr+G za^cY3xgJC=57ME~_oy}yLT^tmS(&_Z?%cU!j^p$Ka90IfDP`>b{rgHwOY4iHqa#$i z{&_n1^>6dgox2!H-lCMTz&T;jqCLy~iR<XT`w{FhL2rhC%6hICmo8l*P0{5$@4Wl& z^78WU0HnX_2Lxb4Fc|!Kdwcu$O|PM^S>xy3FYQ6q`U;wi5AzppiU4M>Qi__uRwQC6 zx^d%Ej>TedZ0VkV@BI0xsi|KAm;@l7=4b*y(Btv6?ccxuCyh;w!F)akCW-3mAbh2z z00=89X+)z@NLRvRdhz+^gR!ozuCtj;<~;z@tK?6$%*VMh03pBM|5{U1)5}}7ZrKzF z1T<Au2>`o}i^Oum866p&zJ2@l)p$Jq7XSkQ5|3upGd%fAPyws~Py?V=)3jRCG|K@{ zE|-hjwmlAD1i%!4B>?vSWcpu4C=?<98UW)<KL-au0e~HeMC7y1{|m8Y4=piKhTH%E N002ovPDHLkV1f=QG06Y` literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tanalogsensor.png b/components/industrialstuff/resources/tanalogsensor.png new file mode 100644 index 0000000000000000000000000000000000000000..eda94eb1a13248b0c05c0e7cf9053172a07788a1 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1SIoCSFHz99iA?ZAr*6;UW(*8puod&;m-e% zy^*VYUrp-a*7~xz*(0DvYQj3_h4oHPHZdJ7{?lWSStWMk!fi>1F2!?tp)Rbde)q36 zyCh0E-&0zABH_ZU)*jcjeVeYfd9CJ5&6aEO+NRVp^^%lB(%i<lY@u7+KPH@(bXce! rvEHG`PBdCy>$&cU>-QZ$Te96v2nh{7d5vo!&`k`Uu6{1-oD!M<`esWO literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tindadvled.png b/components/industrialstuff/resources/tindadvled.png new file mode 100644 index 0000000000000000000000000000000000000000..fd199cb4f595e297f04d12eeb0b4a0f617a0d6de GIT binary patch literal 787 zcmV+u1MK{XP)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00004b3#c}2nYxW zd<bNS00009a7bBm000XT000XT0n*)m`~Uy|7IZ~ebVG7wVRUJ4ZXi@?ZDjy3HZL(U zFEKHMcrvyC0010xMObuGZ)S9NVRB^vL1b@YWgtdra%FdKa%*!SLsK<zwc|Db00L`C zL_t(YiJg`)ZW}QWMIQzA!MfgpfPD|m0dj*F$QHhb*F}0Czy%E`H^>2I0lW7B6krUf zmh9RBn1V}ccO^MW2B5GchyM>hXGpmiBj=cNZUa=gA7gaqtec+;+O{p;U-dI9oO3y{ zZH)2aBuI?$paC0T6T&j8Y8=_eTWP8qLs-V_e+=tj2hO=o+qRWl3yaIeeq#4N^6Oq- zpax&psA{FEIOjIg-MHZyWboVD+cE3zo$mPsvvnErzJ?mu4`H^ZX|6|-6@pXX-D5{E z1r#re0jh!rJVGNf@}H872;#?E#r#W&`tIjF=3Bg<3JKQ#m<o-*NjvIIL<+$ygNLvj zga5b(QN#<L+$QG1H%hRFBA?ls5SCS+f#r~^@87<bb&o%PVP0tv*!2?3lRTgqyYGV+ zB?M@sP5r@cW_|SJ=)2z?Y7f2M%Hnb{&ZcALfkrV?JoRW7bD$bB+7lpJ`rYf@=ir&c zgQ0*7hpTZN?A{sXouQ-YVc(9B7+}M^Wq4Keg=DNSqh!vM<P><B@L;woL$j%m=jv0C zli+Fbfz5zXg$_~dNIPlP<M+{9?>vh!x~91X(*2SST>gS~1m99+TTd23yNxlrEYY@m zeo0?7H2wxt`6mKzQiz7J%>ZJI7b3C+V4Vs@ykOy+(1DODJ<HNZzrQMq@6-M)#0!mI zVnHzFP%<MG^#pus2iJ87%W>fun58NmWr>0JQhc%vqdy>+lH}|fe(woZDYHHSha+!t zjPWAhgj1pv?Y@YzY$3GUympFr^wBSmMNgE;7=X8J0zCzs?LeZFj{o_$<qx~BoTZkt Rvts}N002ovPDHLkV1h1nV9fvk literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tindgnoumeter.png b/components/industrialstuff/resources/tindgnoumeter.png new file mode 100644 index 0000000000000000000000000000000000000000..d65a7f5e8cc18509e6dd64fc2acb94e4aa116685 GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vf<Z~8yL>4nJ zaD4z_MyE9<Gk}6(C9V-A&PAz-C7Jno3L%-fsSE~|`o;$O1{R0x0s?_5WI!r{^V3So z6N^$A98>a>QWe}Xi&D$;i?WLqoP$l+HeFr-RCn0Z#WBRA^X=3`zGelU*89<A>nk_k zntkx(E_vZY8&+sUPRof;3gXzad`r+QNv%&UtDIa`tg7^LiO^HaOgkpR>>$N_U~d?E zgT&+85iWaDBMpu!woH9__U_9JQU7H%m&M+R&pCLe;zvhS>)suw6SPlO%NS*-R?c8t z_2gT@mM*`~lFUM@?^lXgva6hVQ+lmGlZm0FlFeX6*Q6cCpK9F_ivRIY>sP$!?wa~Z zo>4cgvh_^ogvq}%lZbQOb;q%F#qOO~+r8)2t0cA@$ToWc^bUiktDnm{r-UW|O?HU7 literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tindled.png b/components/industrialstuff/resources/tindled.png new file mode 100644 index 0000000000000000000000000000000000000000..82cdb5ed9cc769c5207231501cf5c782bbdfc1c8 GIT binary patch literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vf<Z~8yL>4nJ za0`Jj<E6WGe}IBAC9V-A!TD(=<%vb942~)JNvR5MnMJAP`9;~q3eLf%g<Bt+0o93t z)HxTWCYEI8=P86_=B6?jnCTlD=^GlhR2Xdos+j2M;uzx5`F2_&SF-_6>;9g5mmK$= z{G!Hn+j9PXwbyg*#z?z-a8y)%TC1{ji5jOrD}!<I;+T1jOIBq|ywhB;?AS-c<BHS& zxEq?CtYc)zxSeg<;N2bfbz@WHUAE;@H&-$oc+38|&i3iOMZyJ4d<;MST`=ljA#-8s z%)@f!0?EN9C+|(&vZCZhiuMNsb_36K`@1-o&1~E=xtaep&~Xf&u6{1-oD!M<%nfmf literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tlednumber.png b/components/industrialstuff/resources/tlednumber.png new file mode 100644 index 0000000000000000000000000000000000000000..02be838465514df9b11c8a0d69e7656317c396f9 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^d_XM0!3HEx9X}Heq!^2X+?^QKos)S9<gg`qySp&_ z2f+n<mrn+Ya29w(7Bet#3xhBt!>l<HKtc8rPhVH|yR3ZN)(Vb?YMFsT(Vi}jAr_~T zQxXz>oOfVLNKz0E2z*>G6ES;&o14rG?%<pCBDW<9ckue=8L;rxn%+CO_!Hm0fK-P^ zdmAnZd1!siQaQcyN6!y?pGD0%z1vp`_TShf{q=ESKsF1*g6(3*W7%%%0j**1boFyt I=akR{0H9Mx0ssI2 literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/tstoplightsensor.png b/components/industrialstuff/resources/tstoplightsensor.png new file mode 100644 index 0000000000000000000000000000000000000000..d7c60a1f12b18881905577ba8bdc6bab4088b130 GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^B0wy`!2~2rHN6yp6k~CayA#8@b22Z19JVBHcNd2L zAh=-f^2tCE&H|6fVg?3oVGw3ym^DWND9B#o>FdgVmsOBMgi*A6%>tlMlc$Sgh{frr zlMVSA6hxe*4?o;7fmyh;=z~+=Udg-`iJwh^;?^I9<7WMP<~&JdQij;cDU(#v>#c14 zir6HLo#Q@Tw&gscw<9q0`O*zhTIa&jY~p4d+%vf{;{3t<qgO5$J1YHndwAaU+H;S0 yo&Rh5xZZa2i96Se)fffh?-h4%o>}?AR(|2}2>+K=VzYs+VeoYIb6Mw<&;$VH*<9)X literal 0 HcmV?d00001 diff --git a/components/industrialstuff/resources/yellow.png b/components/industrialstuff/resources/yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..a801b5d05c195605f295ba6ba96546089b2ab863 GIT binary patch literal 1841 zcmV-12hRA3P)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY07w7;07w8v$!k6U000Sga6xAP000;O000;Ocub|H000JB zNkl<ZNXM0yTWnQ%6~=$-zxO_8?_M}Pz0q<gC2}jJOa&~JOs2<7h6EUm(P*ZQsTZ6F zB}QKekr)YyzVSo|VG=PD!w7MVMlx0$aE1{WsSLDJI|GGMdV`*pmbSE<`#yX5P*F33 zM89Mu|Ey$v-^*Ix_ZOayP;G5(eEat8yPBJun`5z9OhjaSe0;pGudnaixpRLS8ykBY z$nbx{Y}~l<TW`Ga#y~Qe4ASYe-nw-&=(_x#UjFN)puhh{kV>V3R4S#XPoExcX=(W$ zU_XgSKEZ5E<-UFUez|}D{+;(HC*}N~JGp)R3Z^iPMFvm`coa;ORShk)J->^(6)QM= z`0%?24<7uw@B8EbRlu^Ws-s7bzTMv5-t^}0e<RngozcRh0ZNL(vZg7nRkdqGM09#$ zklP<!U~Yb1oYJ+rYU2xh=_@ZwXJ_ZY?%lhe&*$@ZpCk}EaNxk%J$v@Fop|jSsry}$ zoaogrb{t^SvtJftjEW$DszRX3M_2wRzkTh;>Qy!pu56Kx-QU+!r%rY6-McpqBmu0) z?5(Y>dk-Bt^vdbqos#tZzsdZ_d0zVVPo$~!MKSmo%?X+V&4~m#ksvRXwe{51t(5L} zelB6pV{q)Dw12H*S#NKz+_`h-oqq|4NcE8;M@}uw&v|1vFX+tRTRgM6LRxqJK&>E! z(WIClr6x#<6p~6I357?fpOlhFm8R}pWO(qpxFuEUn<ccxKey@R$&<fQ)rSV4si~=b z!-mG_hrL(G&)=lBG|h@w1(Hi(a^sln1Y{GCnOLlB0?8(j>^LTSkNUc$EHBHEoxMT- zhgVs-vc9CXwe_2T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{ zL^D9l^St&QJ9hkV%jV6oTrLf&EL*mWC6NdK3k&lk#>XiHit859`}e-d&d$!G$z<{b zF#4GMiIMrwUK!9FjYhw^Wy_Wq)~;Q%vZA8Gv29xxm!iPz?2JD!aC`LHwQJ|6r>B1n z^Z+x9KJt`I{twtdIZzL*b{uE5>$;VIWHOoQd_I2%7yw3q2SEOR3jL3xxw%;Y2MF`; zpMwwNfP8OnZ}7DFe*oQ4>VC_&uF3!a03~!qSaf7zbY(hYa%Ew3WdJfTF)%GKGA%JN zR53L=FgQ9gG%YYTIxsNttd7zE001R)MObuXVRU6WZEs|0W_bWIFfcPMFf}bQH&ih> fIx{vpFf=VNH99abCC-lv00000NkvXXu0mjfgFbLG literal 0 HcmV?d00001 diff --git a/components/industrialstuff/source/AdvLed.pas b/components/industrialstuff/source/AdvLed.pas new file mode 100644 index 000000000..da4b00194 --- /dev/null +++ b/components/industrialstuff/source/AdvLed.pas @@ -0,0 +1,330 @@ +(****************************************************** + AdvLed by Jurassic Pork 2013 for Lazarus + created from TComled of ComPort Library ver. 3.00 + written by Dejan Crnila, 1998 - 2002 + email: dejancrn@yahoo.com + **************************************************************************** + This file is part of Lazarus + + See the file COPYING.modifiedLGPL.txt, included in this distribution, + for details about the license. + **************************************************************************** + Unit: AdvLed.pas + ******************************************************) + +unit AdvLed; + +{$mode objfpc}{$H+} + +interface + +uses + LCLType, Classes, ExtCtrls, Controls, Graphics; + +type + + // property types + TLedBitmap = Graphics.TPicture; +// TLedKind = (lkRedLight, lkGreenLight, lkBlueLight, lkYellowLight, lkPurpleLight, lkBulb, lkCustom); + TLedKind = (lkRedLight, lkGreenLight, lkYellowLight, lkBulb, lkCustom); + TLedState = (lsDisabled, lsOff, lsOn); + TAdvLedGlyphs = array[TLedState] of TLedBitmap; + TLedStateEvent = procedure(Sender: TObject; AState: TLedState) of object; + + // led control that shows the state of serial signals + TAdvLed = class(TCustomImage) + private + FKind: TLedKind; + FState: TLedState; + FBlink: Boolean; + FOnChange: TLedStateEvent; + FGlyphs: TAdvLedGlyphs; + FBlinkTimer: TTimer; + function GetGlyph(const Index: Integer): TLedBitmap; + function GetBlinkDuration: Integer; + procedure SetKind(const Value: TLedKind); + procedure SetState(const Value: TLedState); + procedure SetGlyph(const Index: Integer; const Value: TLedBitmap); + procedure SetBlinkDuration(const Value: Integer); + procedure SetBlink(const Value: Boolean); + function StoredGlyph(const Index: Integer): Boolean; + procedure SelectLedBitmap(const LedKind: TLedKind); + function BitmapToDraw: TLedBitmap; + procedure BitmapNeeded; + procedure DoTimer(Sender: TObject); + procedure GlyphChanged(Sender: TObject); + + protected + FlipFLop : Boolean; + procedure DoChange(AState: TLedState); dynamic; + procedure Loaded; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + published + // kind property must be published before GlyphOn, GlyphOff,GlyphDisable + property Kind: TLedKind read FKind write SetKind default lkRedLight; + property GlyphDisabled: TLedBitmap index 0 read GetGlyph + write SetGlyph stored StoredGlyph; + property GlyphOff: TLedBitmap index 1 read GetGlyph + write SetGlyph stored StoredGlyph; + property GlyphOn: TLedBitmap index 2 read GetGlyph + write SetGlyph stored StoredGlyph; + property State: TLedState read FState write SetState; + property Blink: Boolean read FBlink write SetBlink; + property BlinkDuration: Integer read GetBlinkDuration write SetBlinkDuration default 1000; + property Align; + property AutoSize default true; + property Center; + property Constraints; +// property Picture; + property Visible; + property OnClick; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property Stretch; + property Showhint; + property Transparent; + property Proportional; + property OnPictureChanged; + property OnChange: TLedStateEvent read FOnChange write FOnChange; + + { property Align; + property DragCursor; + property DragMode; + property Enabled; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Visible; + property Anchors; + property Constraints; + property DragKind; + property ParentBiDiMode; + + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnResize; + property OnStartDock; + property OnContextPopup; } + end; + +implementation + +{$R ledbuttons.res} + +(***************************************** + * auxilary functions * + *****************************************) + +function Min(A, B: Integer): Integer; +begin + if A < B then + Result := A + else + Result := B; +end; + +function Max(A, B: Integer): Integer; +begin + if A > B then + Result := A + else + Result := B; +end; +(***************************************** + * TAdvLed control * + *****************************************) + +// create control +constructor TAdvLed.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle - [csSetCaption]; + AutoSize:=True; + FGlyphs[lsOn] := TLedBitmap.Create; + FGlyphs[lsOff] := TLedBitmap.Create; + FGlyphs[lsDisabled] := TLedBitmap.Create; + FGlyphs[lsOn].OnChange:= @GlyphChanged; + FGlyphs[lsOff].OnChange:= @GlyphChanged; + FGlyphs[lsDisabled].OnChange:= @GlyphChanged; + FBlinkTimer := TTimer.Create(nil); + FBlinkTimer.OnTimer := @DoTimer; + FBlinkTimer.Enabled := false; + if (csDesigning in ComponentState) then BitmapNeeded; +end; + +// destroy control +destructor TAdvLed.Destroy; +begin + FBlinkTimer.Free; + FGlyphs[lsOn].Free; + FGlyphs[lsOff].Free; + FGlyphs[lsDisabled].Free; + inherited Destroy; +end; + +// loaded +procedure TAdvLed.Loaded; + begin + Try + If (csDesigning in ComponentState) Then Exit ; + // Load Bitmap if necessary + BitmapNeeded; + Finally + inherited Loaded; + End; +end; + +// timer +procedure TAdvLed.DoTimer(Sender: TObject); +begin + if FlipFlop then + SetState(lsOn ) + else + SetState(lsoff); + FlipFlop := Not FlipFlop; +end; + +// trigger OnChangeEvent +procedure TAdvLed.DoChange(AState: TLedState); +begin + if Assigned(FOnChange) then + FOnChange(Self, AState); + invalidate; +end; + +// if bitmap is empty, load it +procedure TAdvLed.BitmapNeeded; +begin + if (FGlyphs[lsOn].Bitmap.Empty) or (FGlyphs[lsOff].Bitmap.Empty) or + (FGlyphs[lsDisabled].Bitmap.Empty) then + begin + SelectLedBitmap(FKind); + Picture.Assign(BitmapToDraw); + end; +end; + +procedure TAdvLed.SelectLedBitmap(const LedKind: TLedKind); +const +{ OnBitmaps: array[TLedKind] of string = ('LEDREDON', 'LEDGREENON', 'LEDBLUEON', + 'LEDYELLOWON', 'LEDPURPLEON', 'LEDBULBON', ''); + OffBitmaps: array[TLedKind] of string = ('LEDREDOFF', 'LEDGREENOFF', + 'LEDBLUEOFF', 'LEDYELLOWOFF', 'LEDPURPLEOFF', 'LEDBULBOFF' ,''); + DisabledBitmaps: array[TLedKind] of string = ('LEDREDOFF', 'LEDGREENOFF', + 'LEDBLUEOFF', 'LEDYELLOWOFF', 'LEDPURPLEOFF', 'LEDBULBOFF' ,''); } + OnBitmaps: array[TLedKind] of string = ('RED', 'GREEN', 'YELLOW', 'BULBON', ''); + OffBitmaps: array[TLedKind] of string = ('BLACK', 'BLACK', 'BLACK','BULBOFF', ''); + DisabledBitmaps: array[TLedKind] of string = ('BLACK', 'BLACK', 'BLACK','BULBOFF' ,''); +begin + if LedKind <> lkCustom then + begin + FGlyphs[lsOn].LoadFromResourceName(HInstance, OnBitmaps[LedKind]); + FGlyphs[lsOff].LoadFromResourceName(HInstance, OffBitmaps[LedKind]); + FGlyphs[lsDisabled].LoadFromResourceName(HInstance, DisabledBitmaps[LedKind]); + end; +end; + +// set led kind +procedure TAdvLed.SetKind(const Value: TLedKind); +begin + if FKind <> Value then + begin + FKind := Value; + SelectLedBitmap(FKind); + Picture.Assign(BitmapToDraw); + end; +end; + +// set led state +procedure TAdvLed.SetState(const Value: TLedState); +begin + FState := Value; + if not (csLoading in ComponentState) then + DoChange(FState); + Picture.Assign(BitmapToDraw); +end; + +function TAdvLed.GetGlyph(const Index: Integer): TLedBitmap; +begin + case Index of + 0: Result := FGlyphs[lsDisabled]; + 1: Result := FGlyphs[lsOff]; + 2: Result := FGlyphs[lsOn]; + else + Result := nil; + end; +end; + +procedure TAdvLed.GlyphChanged(Sender: TObject ); +begin +// if (csDesigning in ComponentState) then Picture.Assign(Sender as TPicture); + if (csDesigning in ComponentState) then + begin + if Sender = FGlyphs[lsDisabled] then FState := lsDisabled; + if Sender = FGlyphs[lsOff] then FState := lsOff; + if Sender = FGlyphs[lsOn] then FState := lsOn; + Picture.Assign(Sender as TPicture); + end; +end; + +// set custom bitmap +procedure TAdvLed.SetGlyph(const Index: Integer; const Value: TLedBitmap); +begin + if FKind = lkCustom then + begin + case Index of + 0: FGlyphs[lsDisabled].Assign(Value); + 1: FGlyphs[lsOff].Assign(Value); + 2: FGlyphs[lsOn].Assign(Value); + end; + end; + Picture.Assign(BitmapToDraw); +end; + +function TAdvLed.StoredGlyph(const Index: Integer): Boolean; +begin + Result := FKind = lkCustom; +end; + +// get bitmap for drawing +function TAdvLed.BitmapToDraw: TLedBitmap; +var + ToDraw: TLedState; +begin + if not Enabled then + ToDraw := lsOff + else + ToDraw := FState; + Result := FGlyphs[ToDraw]; +end; + +function TAdvLed.GetBlinkDuration: Integer; +begin + Result := FBlinkTimer.Interval; +end; + +procedure TAdvLed.SetBlinkDuration(const Value: Integer); +begin + FBlinkTimer.Interval := Value; +end; + +// set led blink +procedure TAdvLed.SetBlink(const Value: Boolean); +begin + FBlink :=Value; + if (csDesigning in ComponentState) then Exit; + FBlinkTimer.Enabled := FBlink; +end; + +end. diff --git a/components/industrialstuff/source/AllIndustrialRegister.pas b/components/industrialstuff/source/AllIndustrialRegister.pas new file mode 100644 index 000000000..ce61cd119 --- /dev/null +++ b/components/industrialstuff/source/AllIndustrialRegister.pas @@ -0,0 +1,30 @@ + +{********************************************************************** + Package industrial Lazarus + + This unit is part of Lazarus Project +***********************************************************************} + +unit AllIndustrialRegister; + +interface + + + uses + Classes, LResources, AdvLed, IndLed, LedNumber, Sensors, IndGnouMeter; + +procedure Register; + +implementation + +{$R industrial_icons.res} + +//========================================================== +procedure Register; +begin + RegisterComponents ('Industrial',[ + TAdvLed, TIndLed, TLedNumber, TStopLightSensor, TAnalogSensor, TindGnouMeter]); + +end; + +end. diff --git a/components/industrialstuff/source/indcyBaseLed.pas b/components/industrialstuff/source/indcyBaseLed.pas new file mode 100644 index 000000000..94815f0b9 --- /dev/null +++ b/components/industrialstuff/source/indcyBaseLed.pas @@ -0,0 +1,228 @@ +{ Component(s): + tcyBaseLed + + Description: + A base led component with Group feature + Led states : ON/OFF/DISABLE + + * ***** BEGIN LICENSE BLOCK ***** + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * + * The Initial Developer of the Original Code is Mauricio + * (https://sourceforge.net/projects/tcycomponents/). + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or the + * GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which + * case the provisions of the GPL or the LGPL are applicable instead of those + * above. If you wish to allow use of your version of this file only under the + * terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and other + * provisions required by the LGPL or the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under the + * terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK *****} + +unit indcyBaseLed; + +{$mode objfpc}{$H+} + +interface + +uses LCLIntf, LCLType, LMessages, Messages, Classes, Types, Controls, Graphics; + +type + TLedStatus = (lsOn, lsOff, lsDisabled); + + TcyBaseLed = class(TGraphicControl) + private + FGroupIndex: Integer; + FAllowAllOff: Boolean; + FLedValue: Boolean; + FReadOnly: Boolean; + procedure SetAllowAllOff(Value: Boolean); + procedure SetGroupIndex(Value: Integer); + procedure UpdateExclusive; + protected + procedure Click; override; + procedure Loaded; override; + procedure SetEnabled(Value: Boolean); override; + procedure CMButtonPressed(var Message: TLMessage); message CM_BUTTONPRESSED; // Called in UpdateExclusive procedure ... + function TransparentColorAtPos(Point: TPoint): boolean; virtual; + procedure LedStatusChanged; virtual; + procedure SetInternalLedValue(Value: Boolean); + function GetLedStatus: TLedStatus; virtual; + procedure SetLedvalue(Value: Boolean); virtual; + procedure SetReadOnly(AValue: Boolean); virtual; + property AllowAllOff: Boolean read FAllowAllOff write SetAllowAllOff default false; + property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0; + property LedValue: Boolean read FLedvalue write SetLedvalue; + property ReadOnly: Boolean read FReadOnly write SetReadOnly default false; + public + property Canvas; + constructor Create(AOwner: TComponent); override; + property LedStatus: TLedStatus read GetLedStatus; + procedure Switch; + published + end; + +implementation + +constructor TcyBaseLed.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAllowAllOff := false; + FGroupIndex := 0; + FLedvalue:= false; + FReadOnly := false; +end; + +procedure TcyBaseLed.LedStatusChanged; +begin + Invalidate; +end; + +procedure TcyBaseLed.Loaded; +begin + Inherited; + ControlStyle := ControlStyle - [csDoubleClicks]; +end; + +procedure TcyBaseLed.SetReadOnly(AValue: Boolean); +begin + if AValue <> FReadOnly + then FReadOnly := AValue; +end; + +procedure TcyBaseLed.SetEnabled(Value: Boolean); +begin + Inherited; + LedStatusChanged; +end; + +function TcyBaseLed.TransparentColorAtPos(Point: TPoint): boolean; +begin + RESULT := false; +end; + +procedure TcyBaseLed.Click; +var aPt: TPoint; +begin + if not FReadOnly + then begin + GetCursorPos(aPt); + aPt := Self.ScreenToClient(aPt); + + if Not TransparentColorAtPos(aPt) + then LedValue := not FLedValue; + end; + + Inherited; +end; + +function TcyBaseLed.GetLedStatus: TLedStatus; +begin + if not Enabled + then + RESULT := lsDisabled + else + if FLedValue + then RESULT := lsOn + else RESULT := lsOff; +end; + +// Procedure to force changing value : +procedure TcyBaseLed.SetInternalLedValue(Value: Boolean); +begin + if FLedValue <> Value + then begin + FLedValue := Value; + LedStatusChanged; + end; +end; + +procedure TcyBaseLed.Switch; +begin + LedValue := not FLedValue; +end; + +procedure TcyBaseLed.SetLedvalue(Value: Boolean); +begin + if Value <> FLedvalue + then begin + if (not Value) and (not FAllowAllOff) and (FGroupIndex <> 0) + then Exit; // Can't turn off all leds of the same group ... + + FLedvalue := Value; + LedStatusChanged; + + if Value + then UpdateExclusive; // Send message to turn off the other one ... + end; +end; + +procedure TcyBaseLed.SetAllowAllOff(Value: Boolean); +begin + if FAllowAllOff <> Value + then begin + FAllowAllOff := Value; + UpdateExclusive; // Inform FAllowAllOff value to the others from the same group + end; +end; + +procedure TcyBaseLed.SetGroupIndex(Value: Integer); +begin + if FGroupIndex <> Value + then begin + FGroupIndex := Value; + UpdateExclusive; + end; +end; + +procedure TcyBaseLed.UpdateExclusive; +var + Msg: TMessage; +begin + if (FGroupIndex <> 0) and (Parent <> nil) + then begin + Msg.Msg := CM_BUTTONPRESSED; + Msg.WParam := FGroupIndex; + Msg.LParam := PtrInt(Self); + Msg.Result := 0; + Parent.Broadcast(Msg); + end; +end; + +procedure TcyBaseLed.CMButtonPressed(var Message: TLMessage); +var Sender: TcyBaseLed; +begin + if (csLoading in ComponentState) then exit; + + if Message.WParam = FGroupIndex // Same group? + then begin + Sender := TcyBaseLed(Message.LParam); + if Sender <> Self + then begin + if Sender.LedValue and FLedValue // Only one can be turn on on group mode ... + then begin; + FLedValue := false; + LedStatusChanged; + end; + + FAllowAllOff := Sender.AllowAllOff; + end; + end; +end; + +end. diff --git a/components/industrialstuff/source/indcyClasses.pas b/components/industrialstuff/source/indcyClasses.pas new file mode 100644 index 000000000..e5c01b5a8 --- /dev/null +++ b/components/industrialstuff/source/indcyClasses.pas @@ -0,0 +1,307 @@ +{ Unit indcyClasses from cyClasses + + Description: + Unit with sub-properties for components. + + + * ***** BEGIN LICENSE BLOCK ***** + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * + * The Initial Developer of the Original Code is Mauricio + * (https://sourceforge.net/projects/tcycomponents/). + * + * No contributors for now ... + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or the + * GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which + * case the provisions of the GPL or the LGPL are applicable instead of those + * above. If you wish to allow use of your version of this file only under the + * terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and other + * provisions required by the LGPL or the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under the + * terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK *****} + +unit indcyClasses; + +{$mode objfpc}{$H+} + +// {$I cyCompilerDefines.inc} + +interface + +uses + LCLIntf, Classes, Graphics, Controls, SysUtils, + indcyTypes, indcyGraphics; + +type + tcyBevel = class(TCollectionItem) + private + FHighlightColor: TColor; + FShadowColor: TColor; + FWidth: Word; + FStyle: TcyBevelCut; + FDrawRight: Boolean; + FDrawLeft: Boolean; + FDrawTop: Boolean; + FDrawBottom: Boolean; + FNeedOwnerRealign: Boolean; + procedure SetHighlightColor(const Value: TColor); + procedure SetShadowColor(const Value: TColor); + procedure SetWidth(const Value: Word); + procedure SetStyle(const Value: TcyBevelCut); + procedure SetDrawBottom(const Value: Boolean); + procedure SetDrawLeft(const Value: Boolean); + procedure SetDrawRight(const Value: Boolean); + procedure SetDrawTop(const Value: Boolean); + protected + function GetDisplayName: string; override; + public + constructor Create(ACollection: TCollection); override; + procedure Assign(Source: TPersistent); override; + published + property DrawLeft: Boolean read FDrawLeft write SetDrawLeft default True; + property DrawTop: Boolean read FDrawTop write SetDrawTop default True; + property DrawRight: Boolean read FDrawRight write SetDrawRight default True; + property DrawBottom: Boolean read FDrawBottom write SetDrawBottom default True; + property HighlightColor: TColor read FHighlightColor write SetHighlightColor default clBtnHighlight; + property ShadowColor: TColor read FShadowColor write SetShadowColor default clBtnShadow; + property Style: TcyBevelCut read FStyle write SetStyle default bcRaised; + property Width: Word read FWidth write SetWidth default 1; + end; + + TcyBevelClass = class of tcyBevel; + + tcyBevels = Class(TCollection) + private + FControl: TControl; + FOnChange: TNotifyEvent; + FNeedOwnerRealign: Boolean; + function GetBevel(Index: Integer): TcyBevel; + protected + function GetOwner: TPersistent; Override; + procedure Update(Item: TCollectionItem); Override; + public + constructor Create(aControl: TControl; BevelClass: TcyBevelClass); + function Add: TcyBevel; + procedure Delete(Index: Integer); + procedure DrawBevels(aCanvas: TCanvas; var BoundsRect: TRect; RoundRect: Boolean); + function xBevelsWidth: Integer; + function BevelsWidth: Integer; + property Items[Index: Integer]: TcyBevel read GetBevel; default; + property NeedOwnerRealign: Boolean read FNeedOwnerRealign; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + +implementation + +{ tcyBevel } +procedure tcyBevel.Assign(Source: TPersistent); +begin + if Source is tcyBevel then + begin + FHighlightColor := tcyBevel(Source).FHighlightColor; + FShadowColor := tcyBevel(Source).FShadowColor; + FWidth := tcyBevel(Source).FWidth; + FStyle := tcyBevel(Source).FStyle; + FDrawRight := tcyBevel(Source).FDrawRight; + FDrawLeft := tcyBevel(Source).FDrawLeft; + FDrawTop := tcyBevel(Source).FDrawTop; + FDrawBottom := tcyBevel(Source).FDrawBottom; + end; +// inherited Assign(Source); +end; + +constructor tcyBevel.Create(ACollection: TCollection); +begin + inherited Create(ACollection); + FHighlightColor := clBtnHighlight; + FShadowColor := clBtnShadow; + FWidth := 1; + FStyle := bcRaised; + FDrawLeft := true; + FDrawTop := true; + FDrawRight := true; + FDrawBottom := true; + FNeedOwnerRealign := true; +end; + +function tcyBevel.GetDisplayName: string; +begin + case FStyle of + bcLowered: Result := 'Lowered'; + bcRaised: Result := 'Raised'; + bcNone: Result := 'None'; + bcTransparent: Result := 'Transparent'; + end; + + Result := Result + ' Bevel'; + Result := Result + ' Width = ' + intToStr(FWidth); +end; + +procedure tcyBevel.SetDrawBottom(const Value: Boolean); +begin + FDrawBottom := Value; + Changed(false); // It will call TcyBevels.Update ! +end; + +procedure tcyBevel.SetDrawLeft(const Value: Boolean); +begin + FDrawLeft := Value; + Changed(false); +end; + +procedure tcyBevel.SetDrawRight(const Value: Boolean); +begin + FDrawRight := Value; + Changed(false); +end; + +procedure tcyBevel.SetDrawTop(const Value: Boolean); +begin + FDrawTop := Value; + Changed(false); +end; + +procedure tcyBevel.SetHighlightColor(const Value: TColor); +begin + FHighlightColor := Value; + Changed(false); +end; + +procedure tcyBevel.SetShadowColor(const Value: TColor); +begin + FShadowColor := Value; + Changed(false); +end; + +procedure tcyBevel.SetStyle(const Value: TcyBevelCut); +begin + if FStyle = Value then EXIT; + + if (FStyle = bcNone) or (Value = bcNone) + then FNeedOwnerRealign := true; + + FStyle := Value; + Changed(false); +end; + +procedure tcyBevel.SetWidth(const Value: Word); +begin + if FWidth = Value then EXIT; + + FWidth := Value; + FNeedOwnerRealign := true; + Changed(false); +end; + +{TcyBevels} +constructor TcyBevels.Create(aControl: TControl; BevelClass: TcyBevelClass); +begin + inherited Create(BevelClass); + FControl := aControl; + FNeedOwnerRealign := false; +end; + +function TcyBevels.GetBevel(Index: Integer): TcyBevel; +begin + Result := TcyBevel(inherited Items[Index]); +end; + +function TcyBevels.GetOwner: TPersistent; +begin + Result := FControl; +end; + +// Event Called by setting properties/events of TcyBevel : +procedure TcyBevels.Update(Item: TCollectionItem); +begin + Inherited; + if Assigned(FOnChange) + then begin + if Item <> nil + then + if TcyBevel(Item).FNeedOwnerRealign + then begin + FNeedOwnerRealign := true; + TcyBevel(Item).FNeedOwnerRealign := false; + end; + + FOnChange(Self); + FNeedOwnerRealign := false; + end + else + FControl.Invalidate; +end; + +function TcyBevels.Add: TcyBevel; +begin + Result := TcyBevel(inherited Add); + Result.Changed(false); // It will call TcyBevels.Update only at run-time! +end; + +procedure TcyBevels.Delete(Index: Integer); +begin + Inherited; + FNeedOwnerRealign := true; + Update(Nil); +end; + +procedure TcyBevels.DrawBevels(aCanvas: TCanvas; var BoundsRect: TRect; RoundRect: Boolean); +var i: Integer; +begin + for i := 0 to Count-1 do + case Items[i].FStyle of + bcRaised: + begin + cyFrame3D(aCanvas, BoundsRect, Items[i].FHighlightColor, Items[i].FShadowColor, Items[i].FWidth, + Items[i].FDrawLeft, Items[i].FDrawTop, Items[i].FDrawRight, Items[i].FDrawBottom, RoundRect); + RoundRect := false; + end; + + bcLowered: + begin + cyFrame3D(aCanvas, BoundsRect, Items[i].FShadowColor, Items[i].FHighlightColor, Items[i].FWidth, + Items[i].FDrawLeft, Items[i].FDrawTop, Items[i].FDrawRight, Items[i].FDrawBottom, RoundRect); + RoundRect := false; + end; + + bcTransparent: // Just Inflate Rect + begin + InflateRect(BoundsRect, (-1) * Items[i].FWidth, (-1) * Items[i].FWidth); + RoundRect := false; + end; + + bcNone: ; + end; +end; + +function TcyBevels.xBevelsWidth: Integer; +begin + RESULT := 0; +end; + +// 9999 for All other units like TcySimpleGauge +function TcyBevels.BevelsWidth: Integer; +var i: Integer; +begin + RESULT := 0; + for i := 0 to Count-1 do + if Items[i].FStyle <> bcNone + then Inc(RESULT, Items[i].FWidth); +end; + +end. diff --git a/components/industrialstuff/source/indcyGraphics.pas b/components/industrialstuff/source/indcyGraphics.pas new file mode 100644 index 000000000..de0678ac8 --- /dev/null +++ b/components/industrialstuff/source/indcyGraphics.pas @@ -0,0 +1,198 @@ +{ Unit indcyGraphics from cyGraphics + + Description: + Unit with graphic functions + + * ***** BEGIN LICENSE BLOCK ***** + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * + * The Initial Developer of the Original Code is Mauricio + * (https://sourceforge.net/projects/tcycomponents/). + * + * No contributors for now ... + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or the + * GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which + * case the provisions of the GPL or the LGPL are applicable instead of those + * above. If you wish to allow use of your version of this file only under the + * terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and other + * provisions required by the LGPL or the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under the + * terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK *****} + +unit indcyGraphics; + +{$mode objfpc}{$H+} + +// {$I cyCompilerDefines.inc} + +interface + +// We need to put jpeg to the uses for avoid run-time not handled jpeg image ... +uses + LCLIntf, LCLType, Types, Classes, Forms, Graphics, Math, Buttons, Controls, + ExtCtrls, SysUtils, indcyTypes; + +// Objects painting functions : +procedure cyFrame3D(Canvas: TCanvas; var Rect: TRect; TopLeftColor, BottomRightColor: TColor; Width: Integer; + const DrawLeft: Boolean = true; const DrawTop: Boolean = true; const DrawRight: Boolean = true; const DrawBottom: Boolean = true; + const RoundRect: boolean = false); + +// TPicture and TGraphic functions: +function PictureIsTransparentAtPos(aPicture: TPicture; aPoint: TPoint): boolean; +function IconIsTransparentAtPos(aIcon: TIcon; aPoint: TPoint): boolean; +function ValidGraphic(aGraphic: TGraphic): Boolean; + +// Other functions: +function PointInEllipse(const aPt: TPoint; const aRect: TRect): boolean; + +implementation + +{ Procedures and functions} + +procedure cyFrame3D(Canvas: TCanvas; var Rect: TRect; TopLeftColor, BottomRightColor: TColor; Width: Integer; + const DrawLeft: Boolean = true; const DrawTop: Boolean = true; const DrawRight: Boolean = true; const DrawBottom: Boolean = true; + const RoundRect: boolean = false); +var incValue: Integer; + + procedure DrawLines; + begin + with Canvas, Rect do + begin + // Draw Left and Top line : + Pen.Color := TopLeftColor; + + if DrawLeft + then begin + MoveTo(Left, Top + incValue); + LineTo(Left, Bottom); + end; + + if DrawTop + then begin + MoveTo(Left + incValue, Top); + LineTo(Right, Top); + end; + + // Draw right and bottom line : + Pen.Color := BottomRightColor; + + if DrawRight + then begin + MoveTo(Right, Top + incValue); + LineTo(Right, Bottom); + end; + + if DrawBottom + then begin + MoveTo(Right - incValue, Bottom); + LineTo(Left-1 + incValue, Bottom); + end; + end; + end; + +begin + if RoundRect + then incValue := 1 + else incValue := 0; + + Canvas.Pen.Width := 1; + Dec(Rect.Bottom); + Dec(Rect.Right); + + while Width > 0 do + begin + Dec(Width); + DrawLines; + incValue := 0; + InflateRect(Rect, -1, -1); + end; + + Inc(Rect.Bottom); + Inc(Rect.Right); +end; + +function PointInEllipse(const aPt: TPoint; const aRect: TRect): boolean; +var + CenterEllipseCoord: TPoint; + EllipseWidth, EllipseHeight: Integer; +begin + CenterEllipseCoord := Point((aRect.Right + aRect.Left) div 2, (aRect.Bottom + aRect.Top) div 2); + EllipseWidth := (aRect.Right - aRect.Left) div 2; + EllipseHeight := (aRect.Bottom - aRect.Top) div 2; + + RESULT := Sqr((aPt.x - CenterEllipseCoord.x)/EllipseWidth) + Sqr((aPt.y - CenterEllipseCoord.y)/EllipseHeight) + <= 1; + // = 0 On the center of ellipse + // < 1 Inside the ellipse + // = on the border of ellipse + // > 1 Outside the ellipse +end; + +function PictureIsTransparentAtPos(aPicture: TPicture; aPoint: TPoint): boolean; +begin + RESULT := false; // TJPEGImage and others formats not handled ... + if aPicture.Graphic = nil then Exit; + if aPicture.Graphic.Empty then Exit; + + if aPicture.Graphic is TBitmap + then begin + RESULT := aPicture.Bitmap.Canvas.Pixels[aPoint.X, aPoint.Y] + = aPicture.Bitmap.Canvas.Pixels[0, aPicture.Bitmap.Height-1]; + end + else + if aPicture.Graphic is TIcon + then + RESULT := IconIsTransparentAtPos(aPicture.Icon, aPoint) +end; + +// 9999 New function for CodeTyphon +function IconIsTransparentAtPos(aIcon: TIcon; aPoint: TPoint): boolean; +var aPic: TPicture; +begin + RESULT := false; + aPic := TPicture.Create; + + try + aPic.Bitmap.Width := aIcon.Width; + aPic.Bitmap.Height := aIcon.Height; + aPic.Bitmap.PixelFormat := pf1bit; // Black = not transparent + aPic.Bitmap.Canvas.Brush.Color := clWhite; + aPic.Bitmap.Canvas.FillRect(Rect(0, 0, aIcon.Width, aIcon.Height)); + + aPic.Assign(aIcon); + + aPic.Bitmap.PixelFormat := pf1bit; // Black = not transparent + + RESULT := aPic.Bitmap.Canvas.Pixels[aPoint.X, aPoint.Y] <> clBlack; + + finally + aPic.Free; + end; +end; + +function ValidGraphic(aGraphic: TGraphic): Boolean; +begin + RESULT := false; + if aGraphic <> Nil + then + if not aGraphic.Empty + then RESULT := true; +end; + +end. + diff --git a/components/industrialstuff/source/indcyTypes.pas b/components/industrialstuff/source/indcyTypes.pas new file mode 100644 index 000000000..3f2883cf9 --- /dev/null +++ b/components/industrialstuff/source/indcyTypes.pas @@ -0,0 +1,86 @@ +{ Unit indcyTypes from cyTypes + + Description: + Unit with Types declarations. + + * ***** BEGIN LICENSE BLOCK ***** + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * + * The Initial Developer of the Original Code is Mauricio + * (https://sourceforge.net/projects/tcycomponents/). + * + * No contributors for now ... + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or the + * GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which + * case the provisions of the GPL or the LGPL are applicable instead of those + * above. If you wish to allow use of your version of this file only under the + * terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and other + * provisions required by the LGPL or the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under the + * terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK *****} + +unit indcyTypes; + +{$mode objfpc}{$H+} + +interface + +uses + LCLIntf, LCLType, Graphics, Classes, types; + +type + // Graphic: + TCaptionRender = (crNormal, crPathEllipsis, crEndEllipsis, crWordEllipsis); + TCaptionOrientation = (coHorizontal, coHorizontalReversed, coVertical, coVerticalReversed); + + TBgPosition = (bgCentered, bgTopLeft, bgTopCenter, bgTopRight, bgCenterRight, bgBottomRight, bgBottomCenter, bgBottomLeft, bgCenterLeft); + TBgStyle = (bgNone, bgNormal, bgMosaic, bgStretch, bgStretchProportional); + + TcyBevelCut = (bcLowered, bcRaised, bcNone, bcTransparent); + + TDgradOrientation = (dgdVertical, dgdHorizontal, dgdAngle, dgdRadial, dgdRectangle); + TDgradOrientationShape = (osRadial, osRectangle); + TDgradBalanceMode = (bmNormal, bmMirror, bmReverse, bmReverseFromColor, bmInvertReverse, bmInvertReverseFromColor); + + // Cindy components: + TRunTimeDesignJob = (rjNothing, rjMove, rjResizeTop, rjResizeBottom, rjResizeLeft, rjResizeTopLeft, + rjResizeBottomLeft, rjResizeRight, rjResizeTopRight, rjResizeBottomRight); + + TLineCoord = record + BottomCoord, TopCoord: TPoint; + end; + +//var +// CaptionOrientationWarning: Boolean = true; + +const + DT_PATH_ELLIPSIS = $8000; + DT_WORD_ELLIPSIS = $8000; + + cCaptionOrientationWarning = 'Note that text orientation doesn''t work with all fonts!'; + + Alignments: array[TAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER); + WordWraps: array[Boolean] of Word = (DT_SINGLELINE, DT_WORDBREAK); + TextLayouts: array[TTextLayout] of Longint = (DT_TOP, DT_VCENTER, DT_BOTTOM); + CaptionOrientations: array[TCaptionOrientation] of word = (0, 1800, 900, 2700); + CaptionRenders: array[TCaptionRender] of Integer = (0, DT_PATH_ELLIPSIS, DT_END_ELLIPSIS, DT_WORD_ELLIPSIS); + +implementation + + +end. diff --git a/components/industrialstuff/source/indgnoumeter.pas b/components/industrialstuff/source/indgnoumeter.pas new file mode 100644 index 000000000..9906c6ad9 --- /dev/null +++ b/components/industrialstuff/source/indgnoumeter.pas @@ -0,0 +1,457 @@ +{********************************************************************** + GnouMeter is a meter which can display an integer or a float value (Single). + Just like a progress bar or a gauge, all you have do do is to define + the Minimum and maximum values as well as the actual value. + + Above the meter, one can display the name of the data being measured (optional) + and its actual value with its corresponding unit. + The minimum and maximum values are respectively shown at the bottom and the + top of the meter with their corresponding units. + The meter is filled with the color ColorFore and its background color + is defined by the ColorBack Property. + + THIS COMPONENT IS ENTIRELY FREEWARE + + Author: Jérôme Hersant + jhersant@post4.tele.dk +***********************************************************************} + +unit indGnouMeter; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, Controls, Graphics, SysUtils, Messages, LMessages, Types, LCLType, LCLIntf; + +type + TindGnouMeter = class(TGraphicControl) + private + fValue: Double; + fColorFore: TColor; + fColorBack: TColor; + fSignalUnit: ShortString; + fValueMax: Double; + fValueMin: Double; + fDigits: Byte; + fIncrement: Double; + fShowIncrements: Boolean; + fGapTop: Word; + fGapBottom: Word; + fBarThickness: Word; + fMarkerColor: TColor; + fShowMarker: Boolean; + //Variables used internally + TopTextHeight: Word; + LeftMeter: Word; + DisplayValue: String; + DrawStyle: integer; + TheRect: TRect; + //End of variables used internally + procedure SetValue(val: Double); + procedure SetColorBack(val: TColor); + procedure SetColorFore(val: TColor); + procedure SetSignalUnit(val: ShortString); + procedure SetValueMin(val: Double); + procedure SetValueMax(val: Double); + procedure SetDigits(val: Byte); + procedure SetTransparent(val: Boolean); + function GetTransparent: Boolean; + procedure SetIncrement(val: Double); + procedure SetShowIncrements(val: Boolean); + procedure SetGapTop(val: Word); + procedure SetGapBottom(val: Word); + procedure SetBarThickness(val: Word); + procedure SetMarkerColor(val: TColor); + procedure SetShowMarker(val: Boolean); + procedure DrawTopText; + procedure DrawMeterBar; + procedure DrawIncrements; + function ValueToPixels(val: Double): integer; + procedure DrawValueMax; + procedure DrawValueMin; + procedure DrawMarker; + protected + procedure Paint; override; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property Align; + property Caption; + property Visible; + property ShowHint; + property Value: Double read fValue write SetValue; + property Color; + property Font; + property ParentColor; + property ColorFore: Tcolor read fColorFore write SetColorFore; + property ColorBack: Tcolor read fColorBack write SetColorBack; + property SignalUnit: ShortString read fSignalUnit write SetSignalUnit; + property ValueMin: Double read fValueMin write SetValueMin; + property ValueMax: Double read fValueMax write SetValueMax; + property Digits: Byte read fDigits write SetDigits; + property Increment: Double read fIncrement write SetIncrement; + property ShowIncrements: Boolean read fShowIncrements write SetShowIncrements; + property Transparent: Boolean read GetTransparent write SetTransparent; + property GapTop: Word read fGapTop write SetGapTop; + property GapBottom: Word read fGapBottom write SetGapBottom; + property BarThickness: Word read fBarThickness write SetBarThickness; + property MarkerColor: TColor read fMarkerColor write SetMarkerColor; + property ShowMarker: Boolean read fShowMarker write SetShowMarker; + end; + + +implementation + +constructor TindGnouMeter.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csReplicatable, csSetCaption]; + Width := 100; + Height := 200; + fColorFore := clRed; + fColorBack := clBtnFace; + fMarkerColor := clBlue; + fValueMin := 0; + fValueMax := 100; + fIncrement := 10; + fShowIncrements := True; + fShowMarker := True; + fValue := 0; + fGapTop := 20; + fGapBottom := 10; + fBarThickness := 5; + fSignalUnit := 'Units'; +end; + +destructor TindGnouMeter.Destroy; +begin + inherited Destroy; +end; + +procedure TindGnouMeter.CMTextChanged(var Message: TMessage); +begin + Invalidate; +end; + +procedure TindGnouMeter.SetValue(val: Double); +begin + if (val <> fValue) and (val >= fValueMin) and (val <= fValueMax) then + begin + fValue := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetColorFore(val: TColor); +begin + if val <> fColorFore then + begin + fColorFore := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetColorBack(val: TColor); +begin + if val <> fColorBack then + begin + fColorBack := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetSignalUnit(val: ShortString); +begin + if val <> fSignalUnit then + begin + fSignalUnit := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetValueMin(val: Double); +begin + if (val <> fValueMin) and (val <= fValue) then + begin + fValueMin := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetValueMax(val: Double); +begin + if (val <> fValueMax) and (val >= fValue) then + begin + fValueMax := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetDigits(val: Byte); +begin + if (val <> fDigits) then + begin + fDigits := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetIncrement(val: Double); +begin + if (val <> fIncrement) and (val > 0) then + begin + fIncrement := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetShowIncrements(val: Boolean); +begin + if (val <> fShowIncrements) then + begin + fShowIncrements := val; + Invalidate; + end; +end; + +function TindGnouMeter.GetTransparent: Boolean; +begin + Result := not (csOpaque in ControlStyle); +end; + +procedure TindGnouMeter.SetTransparent(Val: Boolean); +begin + if Val <> Transparent then + begin + if Val then + ControlStyle := ControlStyle - [csOpaque] + else + ControlStyle := ControlStyle + [csOpaque]; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetGapTop(val: Word); +begin + if (val <> fGapTop) then + begin + fGapTop := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetGapBottom(val: Word); +begin + if (val <> fGapBottom) then + begin + fGapBottom := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetBarThickness(val: Word); +begin + if (val <> fBarThickness) and (val > 0) then + begin + fBarThickness := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetMarkerColor(val: TColor); +begin + if (val <> fMarkerColor) then + begin + fMarkerColor := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.SetShowMarker(val: Boolean); +begin + if (val <> fShowMarker) then + begin + fShowMarker := val; + Invalidate; + end; +end; + +procedure TindGnouMeter.DrawIncrements; +var + i: Double; + PosPixels: Word; +begin + if fShowIncrements then + begin + with Canvas do + begin + i := fValueMin; + while i <= fValueMax do + begin + PosPixels := ValueToPixels(i); + pen.color := clGray; + MoveTo(LeftMeter + BarThickness + 3, PosPixels - 1); + LineTo(LeftMeter + BarThickness + 7, PosPixels - 1); + pen.color := clWhite; + MoveTo(LeftMeter + BarThickness + 3, PosPixels); + LineTo(LeftMeter + BarThickness + 7, PosPixels); + i := i + fIncrement; + end; + end; + end; +end; + +procedure TindGnouMeter.DrawMarker; +begin + if fShowMarker then + begin + with Canvas do + begin + pen.color := clWhite; + Brush.Style := bsClear; + MoveTo(LeftMeter - 2, ValueToPixels(fValue)); + LineTo(LeftMeter - 6, ValueToPixels(fValue) - 4); + LineTo(LeftMeter - 6, ValueToPixels(fValue) + 4); + pen.color := clGray; + LineTo(LeftMeter - 2, ValueToPixels(fValue)); + + pen.color := fMarkerColor; + Brush.color := fMarkerColor; + Brush.Style := bsSolid; + Polygon([Point(LeftMeter - 3, ValueToPixels(fValue)), + Point(LeftMeter - 5, ValueToPixels(fValue) - 2), + Point(LeftMeter - 5, ValueToPixels(fValue) + 2), + Point(LeftMeter - 3, ValueToPixels(fValue))]); + end; + end; +end; + +procedure TindGnouMeter.DrawTopText; +begin + with Canvas do + begin + DisplayValue := Caption; + Brush.Style := bsClear; + TheRect := ClientRect; + DrawStyle := DT_SINGLELINE + DT_NOPREFIX + DT_CENTER + DT_TOP; + Font.Style := [fsBold]; + TopTextHeight := DrawText(Handle, PChar(DisplayValue), + Length(DisplayValue), TheRect, DrawStyle); + + Font.Style := []; + TheRect.Top := TopTextHeight; + DisplayValue := FloatToStrF(Value, ffFixed, 8, fDigits) + ' ' + fSignalUnit; + TopTextHeight := TopTextHeight + DrawText(Handle, PChar(DisplayValue), + Length(DisplayValue), TheRect, DrawStyle); + TopTextHeight := TopTextHeight + fGapTop; + end; +end; + +procedure TindGnouMeter.DrawValueMin; +begin + with Canvas do + begin + TheRect := ClientRect; + TheRect.Left := LeftMeter + BarThickness + 10; + TheRect.Top := TopTextHeight; + TheRect.Bottom := Height - fGapBottom + 6; + Brush.Style := bsClear; + DrawStyle := DT_SINGLELINE + DT_NOPREFIX + DT_LEFT + DT_BOTTOM; + DisplayValue := FloatToStrF(ValueMin, ffFixed, 8, fDigits) + ' ' + fSignalUnit; + DrawText(Handle, PChar(DisplayValue), Length(DisplayValue), + TheRect, DrawStyle); + end; +end; + +procedure TindGnouMeter.DrawValueMax; +begin + with Canvas do + begin + TheRect := ClientRect; + TheRect.Left := LeftMeter + BarThickness + 10; + TheRect.Top := TopTextHeight - 6; + Brush.Style := bsClear; + DrawStyle := DT_SINGLELINE + DT_NOPREFIX + DT_LEFT + DT_TOP; + DisplayValue := FloatToStrF(ValueMax, ffFixed, 8, fDigits) + ' ' + fSignalUnit; + DrawText(Handle, PChar(DisplayValue), Length(DisplayValue), + TheRect, DrawStyle); + end; +end; + +procedure TindGnouMeter.DrawMeterBar; +begin + with Canvas do + begin + pen.Color := fColorBack; + Brush.Color := fColorBack; + Brush.Style := bsSolid; + Rectangle(LeftMeter, ValueToPixels(fValueMax), LeftMeter + + fBarThickness, ValueToPixels(fValueMin)); + + pen.Color := fColorFore; + Brush.Color := fColorFore; + Brush.Style := bsSolid; + Rectangle(LeftMeter + 1, ValueToPixels(fValue), LeftMeter + + fBarThickness, ValueToPixels(fValueMin)); + + pen.color := clWhite; + Brush.Style := bsClear; + MoveTo(LeftMeter + fBarThickness - 1, ValueToPixels(fValueMax)); + LineTo(LeftMeter, ValueToPixels(fValueMax)); + LineTo(LeftMeter, ValueToPixels(fValueMin) - 1); + + pen.color := clGray; + LineTo(LeftMeter + fBarThickness, ValueToPixels(fValueMin) - 1); + LineTo(LeftMeter + fBarThickness, ValueToPixels(fValueMax)); + + if (fValue > fValueMin) and (fValue < fValueMax) then + begin + pen.color := clWhite; + MoveTo(LeftMeter + 1, ValueToPixels(fValue)); + LineTo(LeftMeter + fBarThickness, ValueToPixels(fValue)); + pen.color := clGray; + MoveTo(LeftMeter + 1, ValueToPixels(fValue) - 1); + LineTo(LeftMeter + fBarThickness, ValueToPixels(fValue) - 1); + end; + + end; +end; + +function TindGnouMeter.ValueToPixels(val: Double): integer; +var + factor: Double; +begin + Result := 0; + if fValueMax > fValueMin then + begin + Factor := (Height - fGapBottom - TopTextHeight) / (fValueMin - fValueMax); + Result := Round(Factor * val - Factor * fValueMax + TopTextHeight); + end; +end; + +procedure TindGnouMeter.Paint; +begin + LeftMeter := (Width div 2) - 10 - fBarThickness; + with Canvas do + begin + if not Transparent then + begin + Brush.Color := Self.Color; + Brush.Style := bsSolid; + FillRect(ClientRect); + end; + Brush.Style := bsClear; + DrawTopText; + DrawValueMin; + DrawValueMax; + DrawMeterBar; + DrawMarker; + DrawIncrements; + end; +end; + +end. diff --git a/components/industrialstuff/source/indled.pas b/components/industrialstuff/source/indled.pas new file mode 100644 index 000000000..a5c497398 --- /dev/null +++ b/components/industrialstuff/source/indled.pas @@ -0,0 +1,371 @@ +{ Component(s): + TindLed ---> old cindy name tcyled + + Description: + A simple led with Group feature + depending on the state: ON/OFF/DISABLE + + + * ***** BEGIN LICENSE BLOCK ***** + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * + * The Initial Developer of the Original Code is Mauricio + * (https://sourceforge.net/projects/tcycomponents/). + * + * No contributors for now ... + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or the + * GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which + * case the provisions of the GPL or the LGPL are applicable instead of those + * above. If you wish to allow use of your version of this file only under the + * terms of either the GPL or the LGPL, and not to allow others to use your + * version of this file under the terms of the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and other + * provisions required by the LGPL or the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under the + * terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** + +Modified by Jurassic Pork 2013 for package Industrial of Lazarus} + +unit IndLed; + +{$mode objfpc}{$H+} + +interface + +uses Classes, Types, Controls, Graphics, indcyBaseLed, indcyTypes, indcyClasses, indcyGraphics; + +type + TShapeType = (stRectangle, stRoundRect, stEllipse); + + TcyCustomLed = class(TcyBaseLed) + private + FLedColorOn: TColor; + FLedColorOff: TColor; + FLedColorDisabled: TColor; + FShapeRoundRectX: Integer; + FShapeRoundRectY: Integer; + FShapeLedColorOn: TColor; + FShapeLedColorOff: TColor; + FShapeLedColorDisabled: TColor; + FBevels: TcyBevels; + FShapeType: TShapeType; + FShapePenWidth: Word; + FTransparent: boolean; + procedure SetShapeLedColorOn(Value: TColor); + procedure SetShapePenWidth(Value: Word); + procedure SetShapeType(Value: TShapeType); + procedure SetShapeRoundRectX(Value: Integer); + procedure SetShapeRoundRectY(Value: Integer); + procedure SetBevels(const Value: TcyBevels); + procedure SetLedColorDisabled(Value: TColor); + procedure SetLedColorOff(Value: TColor); + procedure SetLedColorOn(Value: TColor); + procedure SetTransparent(const Value: boolean); + procedure SetShapeLedColorDisabled(const Value: TColor); + procedure SetShapeLedColorOff(const Value: TColor); + protected + procedure Paint; override; + function TransparentColorAtPos(Point: TPoint): boolean; override; + property Transparent: boolean read FTransparent write SetTransparent default false; + property LedColorOn: TColor read FLedColorOn write SetLedColorOn; + property LedColorOff: TColor read FLedColorOff write SetLedColorOff; + property LedColorDisabled: TColor read FLedColorDisabled write SetLedColorDisabled; + property ShapeLedColorOn: TColor read FShapeLedColorOn write SetShapeLedColorOn; + property ShapeLedColorOff: TColor read FShapeLedColorOff write SetShapeLedColorOff; + property ShapeLedColorDisabled: TColor read FShapeLedColorDisabled write SetShapeLedColorDisabled; + property ShapePenWidth: Word read FShapePenWidth write SetShapePenWidth default 1; + property ShapeType: TShapeType read FShapeType write SetShapeType default stRectangle; + property ShapeRoundRectX: Integer read FShapeRoundRectX write SetShapeRoundRectX default 10; + property ShapeRoundRectY: Integer read FShapeRoundRectY write SetShapeRoundRectY default 10; + property Bevels: TcyBevels read FBevels write SetBevels; + property Height default 25; + property Width default 25; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + end; + + TindLed = class(TcyCustomLed) + private + protected + public + published + property Align; + property Anchors; + property Color; + property Constraints; + property Enabled; + property Visible; + property OnClick; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property ShowHint; + // Herited from TcyBaseLed : + property AllowAllOff; + property GroupIndex; + property LedValue; + property ReadOnly; + // Herited from TcyCustomLed : + property Bevels; + property LedColorOn; + property LedColorOff; + property LedColorDisabled; + property ShapeLedColorOn; + property ShapeLedColorOff; + property ShapeLedColorDisabled; + property ShapePenWidth; + property ShapeType; + property ShapeRoundRectX; + property ShapeRoundRectY; + property Transparent; + end; + + +implementation + +constructor TcyCustomLed.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FBevels := TcyBevels.Create(self, TcyBevel); + + // Determine at design time if + // the form is loading or if we have just added the component at design time : + if csDesigning in ComponentState + then + if Owner <> nil + then + if not (csLoading in Owner.ComponentState) // we have just added the component at design time + then begin + with FBevels.Add do // Frame + begin + HighlightColor := clBlack; + ShadowColor := clBlack; + end; + + with FBevels.Add do // Inner 3D frame + Width := 3; + + with FBevels.Add do // Contrast Frame + Style := bcLowered; + + with FBevels.Add do // Border between Bevels and Shape + begin + HighlightColor := clBlack; + ShadowColor := clBlack; + Width := 1; + end; + end; + + FTransparent := false; + FShapeType := stRectangle; + FShapePenWidth:= 1; + FShapeRoundRectX := 10; + FShapeRoundRectY := 10; + FShapeLedColorOn := clGreen; + FShapeLedColorOff := $00004000; // Dark green + FShapeLedColorDisabled := $00003468; // Dark maroon + FLedColorOn:= clLime; + FLedColorOff:= clGreen; + FLedColorDisabled:= $000059B3; // Maroon + Height := 25; + Width := 25; +end; + +destructor TcyCustomLed.Destroy; +begin + FBevels.Free; + FBevels := Nil; + inherited Destroy; +end; + +procedure TcyCustomLed.Paint; +var + Rect: TRect; +begin + Rect := ClientRect; + // Draw background : + if not FTransparent + then begin + Canvas.Brush.Color := Color; + Canvas.FillRect(Rect); + end; + + Bevels.DrawBevels(Canvas, Rect, false); + + case ledStatus of + lsOn: Canvas.Brush.Color := FLedColorOn; + lsOff: Canvas.Brush.Color := FLedColorOff; + lsDisabled: Canvas.Brush.Color := FLedColorDisabled; + end; + + if FShapePenWidth > 0 + then begin + Rect := classes.Rect(Rect.Left + FShapePenWidth div 2, + Rect.Top + FShapePenWidth div 2, + Rect.Right - (FShapePenWidth-1) div 2, + Rect.Bottom - (FShapePenWidth-1) div 2); + + case ledStatus of + lsOn: Canvas.Pen.Color := FShapeLedColorOn; + lsOff: Canvas.Pen.Color := FShapeLedColorOff; + lsDisabled: Canvas.Pen.Color := FShapeLedColorDisabled; + end; + + Canvas.Pen.Width := FShapePenWidth; + end + else begin + Canvas.Pen.Color := Canvas.Brush.Color; + Canvas.Pen.Width := 1; + end; + + case FShapeType of + stRectangle: canvas.Rectangle(Rect); + stRoundRect: canvas.RoundRect(Rect.Left, Rect.Top, Rect.Right, Rect.Bottom, ShapeRoundRectX, ShapeRoundRectY); + stEllipse : canvas.Ellipse(Rect); + end; +end; + +function TcyCustomLed.TransparentColorAtPos(Point: TPoint): boolean; +begin + RESULT := false; + + if FTransparent and (Bevels.Count = 0) and (FShapeType = stEllipse) + then RESULT := not PointInEllipse(Point, ClientRect); +end; + +procedure TcyCustomLed.SetTransparent(const Value: boolean); +begin + if value <> FTransparent + then begin + FTransparent := Value; + Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapeLedColorOn(Value: TColor); +begin + if value <> FShapeLedColorOn + then begin + FShapeLedColorOn := Value; + + if GetLedStatus = lsOn + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapeLedColorOff(const Value: TColor); +begin + if value <> FShapeLedColorOff + then begin + FShapeLedColorOff := Value; + + if GetLedStatus = lsOff + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapeLedColorDisabled(const Value: TColor); +begin + if value <> FShapeLedColorDisabled + then begin + FShapeLedColorDisabled := Value; + + if GetLedStatus = lsDisabled + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapePenWidth(Value: Word); +begin + if value <> FShapePenWidth + then begin + FShapePenWidth := Value; + Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapeRoundRectX(Value: Integer); +begin + if Value <> FShapeRoundRectX + then begin + FShapeRoundRectX := value; + + if FShapeType = stRoundRect + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapeRoundRectY(Value: Integer); +begin + if Value <> FShapeRoundRectY + then begin + FShapeRoundRectY := value; + + if FShapeType = stRoundRect + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetShapeType(Value: TShapeType); +begin + if value <> FShapeType + then begin + FShapeType := Value; + Invalidate; + end; +end; + +procedure TcyCustomLed.SetLedColorOn(Value: TColor); +begin + if value <> FLedColorOn + then begin + FLedColorOn := Value; + + if GetLedStatus = lsOn + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetLedColorOff(Value: TColor); +begin + if value <> FLedColorOff + then begin + FLedColorOff := Value; + + if GetLedStatus = lsOff + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetLedColorDisabled(Value: TColor); +begin + if value <> FLedColorDisabled + then begin + FLedColorDisabled := Value; + + if GetLedStatus = lsDisabled + then Invalidate; + end; +end; + +procedure TcyCustomLed.SetBevels(const Value: TcyBevels); +begin + FBevels := Value; +end; + +end. diff --git a/components/industrialstuff/source/industrial_icons.res b/components/industrialstuff/source/industrial_icons.res new file mode 100644 index 0000000000000000000000000000000000000000..e95d08c64e264fa219c6bc9b031a5975269a9170 GIT binary patch literal 3422 zcmbtW2|Sc*7k|bwjAar-V~Mesu4N+El8iCJ*akyX)~wmLB5R>bDqG5yOq3x@AyH(> zl1L&&wuH)>B^vvEUEjUk@AobD`+oPlzw@5=oZtC9&vX9gea<-m0DysbYioz0&wrvv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I}gTF1v*pGo(Z1iIAyBPI+RjQ_3w2!Fek?(r(0Zm32`^= ze06f<t|{nnKTrmsA5s+{-l+pS2pj%(5Ac7w1%FuskkAr4Gw+L*_G6Ip-)G+6uLUa? z1V0xHq-Smq%}oBf23kymj7U~hj7CE!J!CqujiXZADF<6y+AAE~)*iz}G9C>Vu*gU_ zdQ>2l)wC}h)sOb6WH<1XV?c%;8miA(Kt3fo;y%_ybaCoP&7T%)%cotYsq5d4bieW_ ze|LOuDgV-_56O)IWIy6*v4Z!>K->I4gbw=eaFAgK4^yZX7y%Mg8Firwp#y3ES{?rq z8x*u0nt8iE2J9yaL*nmXvzr+O<BluLhL*XogUxs{78!v-Y4SfCsZ5~f3h<r7U#;Qw zj6$zm*u6(}p36FY^OI(hSdt4*>$M~?=WrD@Lti+ryr%U+w;G~RrqbB#^PT(0r8>-= z4qK<zS0@KqysGzVdeiNvAwrvZmh~>QWAyQ>4Ykp5wX){}@BAcS95zFKab;;iU(|#s QEfz)-=Xf%p)BFM9uV?2(8vp<R literal 0 HcmV?d00001 diff --git a/components/industrialstuff/source/ledbuttons.res b/components/industrialstuff/source/ledbuttons.res new file mode 100644 index 0000000000000000000000000000000000000000..dfa1b714f1fdb76d81d67f6de1a7c54cabb0070f GIT binary patch literal 7710 zcmeHsby!v1x9*}tx&?$yOQ%TZrn^C;TWJxMR!X{K(_PXfAT1#+B_O2&BHdkQf%<)) zzu&pfIrl#IIe(q8_F8kl?;K;Ux%M7&zhkWp00001_p7U)JNWhwLqPz5yC8FQg$_sn zihwvE2`K#Xz`^<3HAq!i1{0kW9b_=&WTEO{OLD!VB7#SGuY)IG1NTH-Mgk}uBwqmm zys3f=6u1hE=x+f*l^j%DldsP|M!{B5jilRqc}{Sndc6Aw!X0(>F>ZVt93m#eObS6c zf2htYXp(HCeTRf!$16YUZ&9*3wooXwxQo9vBda(=Z1AwOpyy!UjJrrky`=!*PU<-S z@{#c1m0&vcw6o>7T`4x=xmT`4=H_M~cC#@3plHAD+;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Y4m! zg#?iHK@q$3M!$&2uCLbvP*C@_(tWWPeLNf-9JZ@Zyn$J@Rj<CcrM;l0{eM?iP>6r2 zE8Sqkt!vf%>n;`mtl<CFR|!B1R96X5U!}qAr~Ol3*_j}^s!9+hc1-jqE+#HEW)L%L z6K4n$L{SPVp`|FHA}y_N01<|`W1>@Y-h*7fcp;qBEFgrSnL%hcZtMoLU1Pq#G4s#< zYv!h3>}UU9nC5pp-_L&9-|@dN-S7BcnErSCFU)j}B{{CQoAHIOv9$E{1a2_v&-iQR z1`Gb|{|k%!?C0Q+mcHp{`5pfYGyIPKg&BXx|H5K_+RYe$QeyuP90UUSImq9!5JpDE zpX6WMHT8@9CrAI^;lv<}^#3}Z7)buxdH-|n-{&U=rpv$1S?urY@D#*E2Q2^7oc#Uo z!Jp4q{>z+H{@;}RnX><flob5=ZTyjb|H6R~{AWV&x)J-!?}quw{*wd0${Ww$90(wc zf{Z`OU+MRgx*>m!cRdb75KJ}j2--jW=>O?=Gm)E=1ik*43z(8O)bI0(fe3Ol8hCxb S#{<K!=l92TfZhLfO8y6#Zg(31 literal 0 HcmV?d00001 diff --git a/components/industrialstuff/source/lednumber.pas b/components/industrialstuff/source/lednumber.pas new file mode 100644 index 000000000..ef748e418 --- /dev/null +++ b/components/industrialstuff/source/lednumber.pas @@ -0,0 +1,585 @@ +{*********************************************************} +{* VPLEDLABEL.PAS 1.03 -> LEDNumber.PAS *} +{*********************************************************} + +{* ***** BEGIN LICENSE BLOCK ***** *} +{* Version: MPL 1.1 *} +{* *} +{* The contents of this file are subject to the Mozilla Public License *} +{* Version 1.1 (the "License"); you may not use this file except in *} +{* compliance with the License. You may obtain a copy of the License at *} +{* http://www.mozilla.org/MPL/ *} +{* *} +{* Software distributed under the License is distributed on an "AS IS" basis, *} +{* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License *} +{* for the specific language governing rights and limitations under the *} +{* License. *} +{* *} +{* The Original Code is TurboPower Visual PlanIt *} +{* *} +{* The Initial Developer of the Original Code is TurboPower Software *} +{* *} +{* Portions created by TurboPower Software Inc. are Copyright (C) 2002 *} +{* TurboPower Software Inc. All Rights Reserved. *} +{* *} +{* Contributor(s): *} +{* Modified by Jurassic Pork for include in industrial Stuff Lazarus package *} +{* 05/2013 *} +{* ***** END LICENSE BLOCK ***** *} + +unit LedNumber; + +{$mode objfpc}{$H+} + +interface + +uses + LMessages, Classes, Controls, Graphics; + +type + TSegmentSize = 2..10; + TLedNumberBorderStyle = (lnbNone, lnbSingle, lnbSunken, lnbRaised); + + { TCustomLEDNumber } + + TCustomLEDNumber = class(TGraphicControl) + private + FBorderStyle: TLedNumberBorderStyle; + FTransparent: boolean; + procedure SetBorderStyle(AValue: TLedNumberBorderStyle); + procedure SetTransparent(AValue: boolean); + protected{private} + FBgColor : TColor; + FOffColor : TColor; + FOnColor : TColor; + FColumns : Integer; + FRows : Integer; + FSize : TSegmentSize; + lbDrawBmp : TBitmap; + procedure CMTextChanged(var Message: TLMessage); message CM_TEXTCHANGED; + procedure Initialize(var Points: array of TPoint); + function NewOffset(xOry: char; OldOffset: Integer): Integer; + procedure ProcessCaption(Points: array of TPoint); + procedure PaintSegment(Segment: Integer; TheColor: TColor; + Points: array of TPoint; OffsetX, OffsetY: Integer); + procedure ResizeControl(Row, Col, Size: Integer); + function GetAbout: string; + procedure SetAbout(const Value: string); + procedure SetSize(Value: TSegmentSize); + procedure SetOnColor(Value: TColor); + procedure SetOffColor(Value: TColor); + procedure SetRows(Value: Integer); + procedure SetColumns(Value: Integer); + procedure SetbgColor(Value: TColor); + procedure SelectSegments(Segment: Word; Points: array of TPoint; + OffsetX, OffsetY: Integer); + protected + procedure Paint; override; + public + constructor Create(AOwner:TComponent);override; + destructor Destroy; override; + {properties} + property Version: string read GetAbout write SetAbout stored False; + property BorderStyle: TLedNumberBorderStyle read FBorderStyle write SetBorderStyle default lnbNone; {Draws border around segments.} + property Columns: Integer read FColumns write SetColumns default 10; + property Rows: Integer read FRows write SetRows default 1; + property BgColor: TColor read FbgColor write SetbgColor default clBlack; + property OffColor: TColor read FOffColor write SetOffColor default $000E3432; + property OnColor: TColor read FOnColor write SetOnColor default clLime; + property Size: TSegmentSize read FSize write SetSize default 2; + property Transparent: boolean read FTransparent write SetTransparent default false; {Draws segments with transparent background.BgColor is used as mask color.} + {Inherited properties} + property Caption; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Visible; + end; + + TLEDNumber = class(TCustomLEDNumber) + published + property Version; + property BorderStyle; + property Caption; + property Columns; + property Rows; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property BgColor; + property OffColor; + property OnColor; + property ParentShowHint; + property PopupMenu; + property Size; + property ShowHint; + property Transparent; + property Visible; + end; + + +implementation + + +// uses + // VpConst; + +{ LED Segment Map } +{ } +{ ------------------------ } +{ | 1 | } +{ ------------------------ } +{ | | \ | | / | | } +{ | | \ | | / | | } +{ | | \ | | / | | } +{ |2 |\3 \ |4 | /5 /|6 | } +{ | | \ \| |/ / | | } +{ | | \ | | / | | } +{ ----------- ----------- } +{ | 7 \/ 8 | } +{ -----------/\----------- } +{ | | / | | \ | | } +{ | | / /| |\ \ | | } +{ |9 |/10 / |11| \12 \|13| } +{ | | / | | \ | | } +{ | | / | | \ | | } +{ | | / | | \ | | } +{ ------------------------ |-----| } +{ | 14 | | * | } +{ ------------------------ |-----| } +{ } +{ * Period and comma are drawn here } +{ Colon is drawn in the center of } +{ segments 4 and 11 } + +{ Each segment is made up of 6 points. The segments that don't need 6 points, } +{ such as the period and colon dots, return to the coordinates of the initial } +{ point for the remaining unused points. } + +const +{LED SEGMENT ARRAYS} + MAX_POINTS = 107; + + DigitPoints: array[0..MAX_POINTS] of TPoint = + {Segment 1} + ((X:2;Y:2),(X:3;Y:1),(X:11;Y:1),(X:12;Y:2),(X:11;Y:3),(X:3;Y:3), + {Segment 2} + (X:2;Y:3),(X:3;Y:4),(X:3;Y:12),(X:2;Y:13),(X:1;Y:12),(X:1;Y:4), + {Segment 3} + (X:3;Y:3),(X:6;Y:9),(X:6;Y:13),(X:3;Y:7),(X:3;Y:3),(X:3;Y:3), + {Segment 4} + (X:7;Y:3),(X:8;Y:4),(X:8;Y:12),(X:7;Y:13),(X:6;Y:12),(X:6;Y:4), + {Segment 5} + (X:11;Y:3),(X:11;Y:7),(X:8;Y:13),(X:8;Y:9),(X:11;Y:3),(X:11;Y:3), + {Segment 6} + (X:12;Y:3),(X:13;Y:4),(X:13;Y:12),(X:12;Y:13),(X:11;Y:12),(X:11;Y:4), + {Segment 7} + (X:2;Y:14),(X:3;Y:13),(X:6;Y:13),(X:7;Y:14),(X:6;Y:15),(X:3;Y:15), + {Segment 8} + (X:7;Y:14),(X:8;Y:13),(X:11;Y:13),(X:12;Y:14),(X:11;Y:15),(X:8;Y:15), + {Segment 9} + (X:2;Y:15),(X:3;Y:16),(X:3;Y:24),(X:2;Y:25),(X:1;Y:24),(X:1;Y:16), + {Segment 10} + (X:6;Y:15),(X:6;Y:19),(X:3;Y:25),(X:3;Y:21),(X:6;Y:15),(X:6;Y:15), + {Segment 11} + (X:7;Y:15),(X:8;Y:16),(X:8;Y:24),(X:7;Y:25),(X:6;Y:24),(X:6;Y:16), + {Segment 12} + (X:8;Y:15),(X:11;Y:21),(X:11;Y:25),(X:8;Y:19),(X:8;Y:15),(X:8;Y:15), + {Segment 13} + (X:12;Y:15),(X:13;Y:16),(X:13;Y:24),(X:12;Y:25),(X:11;Y:24),(X:11;Y:16), + {Segment 14} + (X:2;Y:26),(X:3;Y:25),(X:11;Y:25),(X:12;Y:26),(X:11;Y:27),(X:3;Y:27), + {Period } + (X:14;Y:25),(X:16;Y:25),(X:16;Y:27),(X:14;Y:27),(X:14;Y:25),(X:14;Y:25), + {Comma } + (X:14;Y:25),(X:16;Y:25),(X:16;Y:27),(X:13;Y:30),(X:14;Y:27),(X:14;Y:25), + {Colon Top } + (X:5;Y:7),(X:9;Y:7),(X:9;Y:10),(X:5;Y:10),(X:5;Y:7),(X:5;Y:7), + {Colon Btm } + (X:5;Y:20),(X:9;Y:20),(X:9;Y:23),(X:5;Y:23),(X:5;Y:20),(X:5;Y:20)); + + Characters: Array[0..72] of Word = + ($0000,$3B70,$1320,$0001,$0300,$0002,$0840,$CCCC,$1020,$8784, + { ' ' * + , - . / 0 1 2 } + $870C,$4708,$C30C,$C38C,$8408,$C78C,$C70C,$0810,$2040,$C788, + { 3 4 5 6 7 8 9 < > A } + $952C,$C084,$942C,$C384,$C380,$C18C,$4788,$9024,$048C,$4A90, + { B C D E F G H I J K } + $4084,$6C88,$6498,$C48C,$C780,$C49E,$C790,$C214,$9020,$448C, + { L M N O P Q R S T U } + $48C0,$44D8,$2850,$2820,$8844,$2010,$C788,$952C,$C084,$942C, + { V W X Y Z / a b c d } + $C384,$C380,$C18C,$4788,$9024,$048C,$4A90,$4084,$6C88,$6498, + { e f g h i j k l m n } + $C48C,$C780,$C49E,$C790,$C214,$9020,$448C,$48C0,$44D8,$2850, + { o p q r s t u v w x } + $2820,$8844,$FFFF); + { y z : } + + CharacterNDX: Array[1..122] of integer = + (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 72, 0, 17, 0, 18, 0, 0, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 0, 45, 0, 0, 0, 0, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44); + + +{===== TCustomLEDNumber ============================================} + +constructor TCustomLEDNumber.Create(AOwner:TComponent); +begin + inherited Create(AOwner); + FTransparent := False; + FBorderStyle := lnbNone; + ControlStyle := [csCaptureMouse, + csOpaque, + csSetCaption, + csClickEvents, + csDoubleClicks]; + Width := 170; + Height := 30; + FOnColor := clLime; + FOffColor := $000E3432; + FBgColor := clBlack; + FSize := 2; + FRows := 1; + FColumns := 10; + Caption := 'LED-LABEL'; + lbDrawBmp := TBitmap.Create; +end; +{=====} + +destructor TCustomLEDNumber.Destroy; +begin + lbDrawBmp.Free; + lbDrawBmp := nil; + inherited Destroy; +end; +{=====} + +function TCustomLEDNumber.GetAbout : string; +begin + Result := ''; //VpVersionStr; +end; +{=====} + +procedure TCustomLEDNumber.SetAbout(const Value : string); +begin + {Leave empty} +end; +{=====} + +procedure TCustomLEDNumber.SetTransparent(AValue: boolean); +begin + if FTransparent=AValue then Exit; + FTransparent:=AValue; + lbDrawBmp.Transparent := FTransparent; + lbDrawBmp.TransparentColor := FBgColor; + Invalidate; +end; + +procedure TCustomLEDNumber.SetBorderStyle(AValue: TLedNumberBorderStyle); +begin + if FBorderStyle=AValue then Exit; + FBorderStyle:=AValue; + Invalidate; +end; + +procedure TCustomLEDNumber.CMTextChanged(var Message: TLMessage); +begin + inherited; + Invalidate; +end; +{=====} + +procedure TCustomLEDNumber.Initialize(var Points: array of TPoint); +var + I : Integer; +begin + for I := 0 to MAX_POINTS do begin + Points[i].X := DigitPoints[i].X * (FSize - 1); + Points[i].Y := DigitPoints[i].Y * (FSize - 1); + end; +end; +{=====} + +function TCustomLEDNumber.NewOffset(xOry: char; OldOffset: Integer): Integer; +begin + if (xOry = 'x')then + newOffset := oldOffset + 17 * (FSize - 1) + else + newOffset := oldOffset + 30 * (FSize -1) +end; +{=====} + +procedure TCustomLEDNumber.Paint; +var + Points: array[0..MAX_POINTS] of TPoint; + ARect: TRect; +begin + lbDrawBMP.Width := Width; + lbDrawBMP.Height := Height; + + Initialize(Points); + lbDrawBMP.Canvas.Brush.Color := FBgColor; + lbDrawBMP.Canvas.FillRect(ClientRect); + ProcessCaption(Points); + + Canvas.CopyMode := cmSrcCopy; + if BorderStyle <> lnbNone then + begin + ARect := ClientRect; + case BorderStyle of + lnbSingle: + begin + Canvas.Pen.Color := cl3DDkShadow; + Canvas.Frame(ARect); + end; + lnbSunken: Canvas.Frame3D(ARect, cl3DDkShadow, clBtnHiLight, 1); + lnbRaised: Canvas.Frame3D(ARect, clBtnHiLight, cl3DDkShadow, 1); + end; + inc(ARect.Left, 1); + inc(ARect.Top, 1); + inc(ARect.Right, 1); + inc(ARect.Bottom, 1); + Canvas.StretchDraw(ARect, lbDrawBMP); + end else + Canvas.Draw(0, 0, lbDrawBMP); +end; +{=====} + +procedure TCustomLEDNumber.PaintSegment(Segment: Integer; TheColor: TColor; + Points: array of TPoint; OffsetX, OffsetY: Integer); +var + I: Integer; + DrawPts: array[0..5] of TPoint; +begin + Dec(Segment); + lbDrawBMP.Canvas.Pen.Style := psClear; + lbDrawBMP.Canvas.Brush.Color := TheColor; + for i := 0 to 5 do begin + DrawPts[i].X := offsetX + Points[Segment * 6 + i].X; + DrawPts[i].Y := offsetY + Points[Segment * 6 + i].Y; + end; + lbDrawBMP.Canvas.Polygon(DrawPts); +end; +{=====} + +procedure TCustomLEDNumber.SelectSegments(Segment: Word; + Points: array of TPoint; OffsetX, OffsetY: Integer); +var + I : integer; + Bit : word; + MyColor : TColor; + Skip : Boolean; +begin + if (Segment and $FFFF) = $FFFF then begin + MyColor := FOnColor; + PaintSegment(17, MyColor, Points, OffsetX, OffsetY); + PaintSegment(18, MyColor, Points, OffsetX, OffsetY); + end + else begin + Bit := $8000; + for I := 1 to 16 do begin + Skip := False; + if (Segment and Bit) = Bit then + MyColor := FOnColor + else begin + if (i = 15) or (i = 16) then + Skip := True; + MyColor := FOffColor; + end; + if (not Skip) and (MyColor <> FBgColor) then + PaintSegment(I, MyColor, Points, OffsetX, OffsetY); + Bit := Bit div 2; + end; + end; +end; +{=====} + +procedure TCustomLEDNumber.ProcessCaption(Points: array of TPoint); +var + Next : Char; + Last : Char; + I, X : Integer; + Row, ColsPerRow: Integer; + Tmp : Integer; + OffsetX : Integer; + OffsetY : Integer; + DisplayStr : string; +begin + Last := #0; + OffsetX := FSize; + OffsetY := 0; + + DisplayStr := Caption; + + if Length(DisplayStr) > 0 then + if (DisplayStr[1] = ',') or (DisplayStr[1] = '.') then + DisplayStr := ' ' + DisplayStr; + + Row := 1; + ColsPerRow := 0; + for I := 1 to Length(Caption) do begin + Next := Caption[I]; + case Ord(Next) of + 42..58,60,62,65..90,92,97..122: begin + if ColsPerRow = FColumns then begin + Row := Row + 1; + if Row > FRows then + exit; + offsetY := newOffset('y',offsetY); + offsetX := FSize; + ColsPerRow := 0 + end; + if (Next = '.') or (Next = ',') then + if (Last = '.') or (Last = ',') then begin + SelectSegments(Characters[CharacterNDX[Ord(Next)]], Points, + OffsetX, OffsetY); + OffsetX := NewOffset('x', OffsetX); + end + else begin + OffsetX := OffsetX - (17 * (FSize - 1)); + Tmp := (Characters[CharacterNDX[Ord(Next)]] + or Characters[CharacterNDX[Ord(Last)]]); + SelectSegments(Tmp, Points, OffsetX, OffsetY); + OffsetX := NewOffset('x', OffsetX); + end + else begin + SelectSegments(Characters[CharacterNDX[Ord(Next)]], Points, OffsetX, + OffsetY); + offsetX := NewOffset('x', OffsetX); + ColsPerRow := ColsPerRow + 1; + end; + end; + 10: begin {eat linefeed} + end; + 13: begin + if ColsPerRow < FColumns then + for x := 1 to (FColumns - ColsPerRow) do begin + SelectSegments(Characters[CharacterNDX[1]], Points, OffsetX, OffsetY); + OffsetX := NewOffset('x', OffsetX); + end; + Row := Row + 1; + if Row > FRows then + exit; + OffsetY := NewOffset('y', OffsetY); + OffsetX := FSize; + ColsPerRow := 0; + end; + else begin + if ColsPerRow = FColumns then begin + Row := Row + 1; + if Row > FRows then + Exit; + OffsetY := NewOffset('y', OffsetY); + OffsetX := FSize; + ColsPerRow := 0; + end; + SelectSegments(Characters[CharacterNDX[1]], Points, OffsetX, OffsetY); + OffsetX := newOffset('x', OffsetX); + ColsPerRow := ColsPerRow + 1; + end; + end; + Last := Next; + end; + for x := 1 to (FColumns - ColsPerRow) do begin + SelectSegments(Characters[CharacterNDX[1]], Points, OffsetX, OffsetY); + OffsetX := NewOffset('x', OffsetX); + end; + if (FColumns * FRows) > Length(caption) then begin + for X := Row + 1 to FRows do begin + OffsetX := FSize; + OffsetY := NewOffset('y', OffsetY); + for I := 1 to FColumns do begin + SelectSegments(Characters[CharacterNDX[1]], Points, OffsetX, OffsetY); + OffsetX := NewOffset('x', OffsetX); + end; + end; + end; +end; +{=====} + +procedure TCustomLEDNumber.ResizeControl(Row, Col, Size: Integer); +begin + FRows := Row; + FColumns := Col; + FSize := Size; + SetBounds(Left, Top, FColumns * 17 * (FSize - 1), FRows * 30 * (FSize - 1)); + Invalidate; +end; +{=====} + +procedure TCustomLEDNumber.SetbgColor(Value: TColor); +begin + if FBgColor <> Value then begin + FBgColor := Value; + Invalidate; + end; +end; +{=====} + +procedure TCustomLEDNumber.SetOnColor(Value:TColor); +begin + if FOnColor <> Value then begin + FOnColor := Value; + Invalidate; + end; +end; +{=====} + +procedure TCustomLEDNumber.SetOffColor(Value:TColor); +begin + if FOffColor <> Value then begin + FOffColor := Value; + Invalidate; + end; +end; +{=====} + +procedure TCustomLEDNumber.SetRows(Value : Integer); +begin + if FRows <> Value then begin + if Value < 1 then + Value := 1; + ResizeControl(Value, FColumns, FSize); + end; +end; +{=====} + +procedure TCustomLEDNumber.SetColumns(Value : Integer); +begin + if FColumns <> Value then begin + if Value < 1 then + Value := 1; + ResizeControl(FRows, Value, FSize); + end; +end; +{=====} + +procedure TCustomLEDNumber.SetSize(Value : TSegmentSize); +begin + if FSize <> Value then begin + //if Value < 2 then <- unreachable + // Value := 2; + //if Value > 10 then + // Value := 10; + ResizeControl(FRows, FColumns, Value); + end; +end; +{=====} +end. diff --git a/components/industrialstuff/source/sensors.pas b/components/industrialstuff/source/sensors.pas new file mode 100644 index 000000000..a4fb4e27b --- /dev/null +++ b/components/industrialstuff/source/sensors.pas @@ -0,0 +1,485 @@ +{ Copyright (C) 1998-2000, written by Shkolnik Mike + FIDOnet: 2:463/106.14 + E-Mail: mshkolnik@scalabium.com + mshkolnik@yahoo.com + WEB: http://www.scalabium.com + http://www.geocities.com/mshkolnik + tel: 380-/44/-552-10-29 + + TStopLightSensor and TAnalogSensor sensor components + Modified by Jurassic Pork for Lazarus "Industrial" package +} +unit Sensors; + +{$mode objfpc}{$H+} + +interface + +uses LCLIntf, LCLType, LResources, Classes, Controls, Graphics, Stdctrls, Extctrls; + +type + TStopLights = (slUNKNOWN, slRED, slYELLOW, slGREEN); + +type + TSensorPanel = class(TPanel) + private + FlblShowText: TLabel; {sensor value} + FShowText: Boolean; + FShowLevel: Boolean; {show the RED and YELLOW levels or not} + + FValue: Double; + FValueMin: Double; + FValueMax: Double; + FValueRed: Double; + FValueYellow: Double; + + FColorBack: TColor; + FColorFore: TColor; + FColorRed: TColor; + FColorYellow: TColor; + + function GetCaption: TCaption; + procedure SetCaption(AValue: TCaption); + + procedure SetShowText(AValue: Boolean); + procedure SetShowLevel(AValue: Boolean); + + procedure SetColorInd(Index: Integer; AValue: TColor); + + procedure SetValue(AValue: Double); virtual; + procedure SetValueMin(AValue: Double); + procedure SetValueMax(AValue: Double); + procedure SetValueRed(AValue: Double); + procedure SetValueYellow(AValue: Double); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetStatus: TStopLights; + procedure SetColorState(slStopLight: TStopLights); virtual; + published + property Caption read GetCaption write SetCaption; + + property ShowText: Boolean read FShowText write SetShowText; + property ShowLevel: Boolean read FShowLevel write SetShowLevel; + + property ColorFore: TColor index 0 read FColorFore write SetColorInd default clLime; + property ColorBack: TColor index 1 read FColorBack write SetColorInd default clBlack; + property ColorRed: TColor index 2 read FColorRed write SetColorInd default clRed; + property ColorYellow: TColor index 3 read FColorYellow write SetColorInd default clYellow; + + property Value: Double read FValue write SetValue; + property ValueMin: Double read FValueMin write SetValueMin; + property ValueMax: Double read FValueMax write SetValueMax; + property ValueRed: Double read FValueRed write SetValueRed; + property ValueYellow: Double read FValueYellow write SetValueYellow; + end; + + TAnalogKind = (akAnalog, akHorizontal, akVertical); + TAnalogSensor = class(TSensorPanel) + private + FAnalogKind: TAnalogKind; + + procedure PaintAsNeedle; + procedure PaintAsHorizontal; + procedure PaintAsVertical; + procedure SetAnalogKind(AValue: TAnalogKind); + protected + procedure Paint; override; + public + constructor Create(AOwner: TComponent); override; + published + property Font; + property AnalogKind: TAnalogKind read FAnalogKind write SetAnalogKind; + end; + + TStopLightSensor = class(TImage) + private + FState: TStopLights; + procedure SetState(AValue: TStopLights); + protected + public + constructor Create(AOwner: TComponent); override; + published + property Center default True; + property State: TStopLights read FState write SetState; + end; + + +implementation + +{$R sensors.res} + +uses SysUtils; + +{ TSensorPanel } + +constructor TSensorPanel.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + Height := 75; + Width := 170; + Parent := AOwner as TWinControl; + + FValue := 0; + + FValueMin := 0; + FValueMax := 100; + FValueRed := 30; + FValueYellow := 60; + + FColorFore := {clGreen} clLime; + FColorBack := clBlack {clWhite}; + FColorRed := clRed; + FColorYellow := clYellow; + + FlblShowText := TLabel.Create(Self); + with FlblShowText do + begin + Alignment := taCenter; + AutoSize := False; + Font := Self.Font; + Height := 17; + Left := 5; + Top := 57; + Width := 160; + Parent := Self; + Align := alBottom; + end; + + FShowLevel := True; + Caption := ''; + ShowText := True; +end; + +destructor TSensorPanel.Destroy; +begin +// FlblShowText.Free; + + inherited Destroy; +end; + +function TSensorPanel.GetStatus: TStopLights; +begin + Result := slUNKNOWN; + if (Value > ValueMin) and (Value < ValueMin) then Result := slGREEN; + if (Value < ValueYellow) then Result := slYellow; + if (Value < ValueRed) then Result := slRED; +end; + +procedure TSensorPanel.SetColorState(slStopLight: TStopLights); +begin + FlblShowText.Font := Font; + case slStopLight of + slRED: FlblShowText.Font.Color := FColorRed; + slYELLOW: FlblShowText.Font.Color := FColorYellow; + else // slUNKNOWN, slGREEN +// FlblShowText.Font := Font; + end; +end; + +procedure TSensorPanel.SetValue(AValue: Double); +begin + if (AValue < FValueMin) then + AValue := FValueMin + else + if (AValue > FValueMax) then + AValue := FValueMax; + if (FValue <> AValue) then + begin + FValue := AValue; + FlblShowText.Caption := FlblShowText.Hint + FloatToStr(FValue); + Invalidate; + end; +end; + +function TSensorPanel.GetCaption: TCaption; +begin + // Modif J.P 05/2013 Caption replace Hint + Result := FlblShowText.Hint; +end; + +procedure TSensorPanel.SetCaption(AValue: TCaption); +begin + // Modif J.P 05/2013 Caption replace Hint + FlblShowText.Hint := AValue; + inherited Caption := ''; + FlblShowText.Caption := FlblShowText.Hint + FloatToStr(FValue); + Invalidate; +end; + +procedure TSensorPanel.SetShowText(AValue: Boolean); +begin + if (AValue <> FShowText) then + begin + FShowText := AValue; + FlblShowText.Visible := FShowText; + end; +end; + +procedure TSensorPanel.SetShowLevel(AValue: Boolean); +begin + if (AValue <> FShowLevel) then + begin + FShowlevel := AValue; + Invalidate; + end; +end; + +procedure TSensorPanel.SetColorInd(Index: Integer; AValue: TColor); +begin + if (AValue <> FColorFore) then + begin + case Index of + 0: FColorFore := AValue; + 1: FColorBack := AValue; + 2: FColorRed := AValue; + 3: FColorYellow := AValue; + end; + Invalidate; + end; +end; + +procedure TSensorPanel.SetValueMin(AValue: Double); +begin + if (AValue <> FValueMin) then + begin + if (AValue > FValueMin) then + if not (csLoading in ComponentState) then + raise EInvalidOperation.CreateFmt('OutOfRange', [-MaxInt, Round(FValueMax - 1)]); + FValueMin := AValue; + if (FValue < AValue) then FValue := AValue; + Invalidate; + end; +end; + +procedure TSensorPanel.SetValueMax(AValue: Double); +begin + if (AValue <> FValueMax) then + begin + if (AValue < FValueMin) then + if not (csLoading in ComponentState) then + raise EInvalidOperation.CreateFmt('SOutOfRange', [Round(FValueMin + 1), MaxInt]); + FValueMax := AValue; + if (FValue > AValue) then FValue := AValue; + Invalidate; + end; +end; + +procedure TSensorPanel.SetValueRed(AValue: Double); +begin + if (AValue <> FValueRed) then + begin + if (AValue < FValueMin) or (AValue > FValueMax) then + if not (csLoading in ComponentState) then + raise EInvalidOperation.CreateFmt('SOutOfRange', [Round(FValueMin), Round(FValueMax)]); + FValueRed := AValue; + Invalidate; + end; +end; + +procedure TSensorPanel.SetValueYellow(AValue: Double); +begin + if (AValue <> FValueYellow) then + begin + if (AValue < FValueRed) or (AValue > FValueMax) then + if not (csLoading in ComponentState) then + raise EInvalidOperation.CreateFmt('SOutOfRange', [Round(FValueRed), Round(FValueMax)]); + FValueYellow := AValue; + Invalidate; + end; +end; + + +{ TAnalogSensor } +constructor TAnalogSensor.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Value := 20; + AnalogKind := akAnalog; +end; + +procedure TAnalogSensor.Paint; +begin + inherited Paint; + case FAnalogKind of + akAnalog: PaintAsNeedle; + akHorizontal: PaintAsHorizontal; + akVertical: PaintAsVertical; + end; +end; + +function SolveForY(X, Z: Double): Double; +begin + if Z = 0 then + Result := 0 + else + Result := X/Z; +end; + +procedure TAnalogSensor.PaintAsNeedle; +var MiddleX: Integer; + Angle: Double; + X, Y, W, H: Integer; +begin + X := 20; + Y := 23; + W := ClientWidth - 2*20; //130; + H := ClientHeight - 2*23; //33; + if (W < 1) or (H < 1) then Exit; + + with Canvas do + begin + Brush.Color := ColorBack; + Pen.Color := clBlack; + Pen.Width := 1; + + { draw a pie } + Pie(X, Y, X + W, Y + 2*H, X + W, Y + H - 1, X, Y + H - 1); +// Chord(X, Y, X+W, (Y+H)*2, X+W, Y+H-1, X, Y+H-1); + + MiddleX := W div 2; + { draw pie for current value } + Brush.Color := ColorFore; + Pen.Color := clBlack; + MoveTo(X + MiddleX, Y + H - 1); + Angle := Pi * SolveForY(FValue - FValueMin, FValueMax - FValueMin); + Pie(X, Y, X + W, Y + 2*H, Round(X + MiddleX*(1 - Cos(Angle))), Round(Y - 1 + H*(1 - Sin(Angle))), X, Y+H); + + if FShowLevel then + begin +// Pen.Width := 1; + { draw a RED level line } + Pen.Color := ColorRed; + MoveTo(X + MiddleX, Y + H - 1); + Angle := Pi * SolveForY(FValueRed - FValueMin, FValueMax - FValueMin); + LineTo(Round(X + MiddleX*(1 - Cos(Angle))), Round(Y - 1 + H*(1 - Sin(Angle)))); + + { draw a YELLOW level line } + Pen.Color := ColorYellow; + MoveTo(X + MiddleX, Y + H - 1); + Angle := Pi * SolveForY(FValueYellow - FValueMin, FValueMax - FValueMin); + LineTo(Round(X + MiddleX*(1 - Cos(Angle))), Round(Y - 1 + H*(1 - Sin(Angle)))); + end; + end; +end; + +procedure TAnalogSensor.PaintAsHorizontal; +var MiddleX: Integer; + X, Y, W, H: Integer; +begin + X := 20; + Y := 23; + W := ClientWidth - 2*20; //130; + H := ClientHeight - 2*23; //33; + if (W < 1) or (H < 1) then Exit; + + with Canvas do + begin + Brush.Color := ColorBack; + Pen.Color := clBlack; + Pen.Width := 1; + + Rectangle(X, Y, X + W, Y + H); + + { draw pie for current value } + Brush.Color := ColorFore; + Pen.Color := clBlack; + MiddleX := Round(W*SolveForY(FValue - FValueMin, FValueMax - FValueMin)); + Rectangle(X, Y, X + MiddleX, Y + H); + + if FShowLevel then + begin + { draw a RED level line } + Pen.Color := ColorRed; + MiddleX := Round(W*SolveForY(FValueRed - FValueMin, FValueMax - FValueMin)); + MoveTo(X + MiddleX, Y + 1); + LineTo(X + MiddleX, Y + H - 1); + + { draw a YELLOW level line } + Pen.Color := ColorYellow; + MiddleX := Round(W*SolveForY(FValueYellow - FValueMin, FValueMax - FValueMin)); + MoveTo(X + MiddleX, Y + 1); + LineTo(X + MiddleX, Y + H - 1); + end; + end; +end; + +procedure TAnalogSensor.PaintAsVertical; +var MiddleY: Integer; + X, Y, W, H: Integer; +begin + X := 20; + Y := 23; + W := ClientWidth - 2*20; //130; + H := ClientHeight - 2*23; //33; + if (W < 1) or (H < 1) then Exit; + + with Canvas do + begin + Brush.Color := ColorBack; + Pen.Color := clBlack; + Pen.Width := 1; + + Rectangle(X + W - 1, Y + H - 1, X, Y); + + { draw pie for current value } + Brush.Color := ColorFore; + Pen.Color := clBlack; + MiddleY := Round(H*SolveForY(FValue - FValueMin, FValueMax - FValueMin)); + Rectangle(X, Y + H - 1 - MiddleY, X + W - 1, Y + H - 1); + + if FShowLevel then + begin + { draw a RED level line } + Pen.Color := ColorRed; + MiddleY := Round(H*SolveForY(FValueRed - FValueMin, FValueMax - FValueMin)); + MoveTo(X + 1, Y + H - 1 - MiddleY); + LineTo(X + W - 1, Y + H - 1 - MiddleY); + + { draw a YELLOW level line } + Pen.Color := ColorYellow; + MiddleY := Round(H*SolveForY(FValueYellow - FValueMin, FValueMax - FValueMin)); + MoveTo(X + 1, Y + H - 1 - MiddleY); + LineTo(X + W - 1, Y + H - 1 - MiddleY); + end; + end; +end; + +procedure TAnalogSensor.SetAnalogKind(AValue: TAnalogKind); +begin + if (AValue <> FAnalogKind) then + begin + FAnalogKind := AValue; + Invalidate; + end; +end; + +{ TStopLightSensor } +constructor TStopLightSensor.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + Width := 23; + Height := 43; + Center := True; + FState := slRED; + State := slUNKNOWN; +end; + +procedure TStopLightSensor.SetState(AValue: TStopLights); +begin + if (AValue <> FState) then + begin + FState := AValue; + + case AValue of + slUNKNOWN: Picture.LoadFromResourceName(HInstance, 'STOP_UNKNOWN', TPortableNetworkGraphic); + slRED: Picture.LoadFromResourceName(HInstance, 'STOP_RED', TPortableNetworkGraphic); + slYELLOW: Picture.LoadFromResourceName(HInstance, 'STOP_YELLOW', TPortableNetworkGraphic); + slGREEN: Picture.LoadFromResourceName(HInstance, 'STOP_GREEN', TPortableNetworkGraphic); + end; + end; +end; + +end. diff --git a/components/industrialstuff/source/sensors.res b/components/industrialstuff/source/sensors.res new file mode 100644 index 0000000000000000000000000000000000000000..744828bea3b9646eb3caf9079c032225ffe16e47 GIT binary patch literal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