To 0.2.0.0 Foobot selection menu added

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5604 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
gbamber
2017-01-07 08:57:48 +00:00
parent 3d44ae5324
commit 35b432fc18
10 changed files with 179 additions and 136 deletions

View File

@ -138,6 +138,7 @@ begin
HLINI.WriteDateTime(sFoobotName, 'allpolluHighTime', TDateTime(FoobotDataHighTimes[6])); HLINI.WriteDateTime(sFoobotName, 'allpolluHighTime', TDateTime(FoobotDataHighTimes[6]));
HLINI.WriteFloat(sFoobotName, 'allpolluLow', double(FoobotDataLows[6])); HLINI.WriteFloat(sFoobotName, 'allpolluLow', double(FoobotDataLows[6]));
HLINI.WriteDateTime(sFoobotName, 'allpolluLowTime', TDateTime(FoobotDataLowTimes[6])); HLINI.WriteDateTime(sFoobotName, 'allpolluLowTime', TDateTime(FoobotDataLowTimes[6]));
Result:=TRUE;
end; end;
function LoadHighLows: boolean; function LoadHighLows: boolean;
@ -186,6 +187,7 @@ begin
FoobotDataHighTimes[6] := HLINI.ReadDateTime(sFoobotName, 'allpolluHighTime', Now); FoobotDataHighTimes[6] := HLINI.ReadDateTime(sFoobotName, 'allpolluHighTime', Now);
FoobotDataLows[6] := HLINI.ReadFloat(sFoobotName, 'allpolluLow', 0); FoobotDataLows[6] := HLINI.ReadFloat(sFoobotName, 'allpolluLow', 0);
FoobotDataLowTimes[6] := HLINI.ReadDateTime(sFoobotName, 'allpolluLowTime', Now); FoobotDataLowTimes[6] := HLINI.ReadDateTime(sFoobotName, 'allpolluLowTime', Now);
Result:=TRUE;
end; end;
// ToDo: Multiple Foobots? // ToDo: Multiple Foobots?

View File

@ -22,8 +22,7 @@
</General> </General>
<VersionInfo> <VersionInfo>
<UseVersionInfo Value="True"/> <UseVersionInfo Value="True"/>
<MinorVersionNr Value="1"/> <MinorVersionNr Value="2"/>
<RevisionNr Value="3"/>
<StringTable Comments="Uses Foobot public API to query Foobot #1" FileDescription="Monitor for Foobot" InternalName="foobotmonitor" LegalCopyright="(c)2016 minesadorada@charcodelvalle.com" LegalTrademarks="Foobot" ProductName="Foobot" ProductVersion="0.0.0.0"/> <StringTable Comments="Uses Foobot public API to query Foobot #1" FileDescription="Monitor for Foobot" InternalName="foobotmonitor" LegalCopyright="(c)2016 minesadorada@charcodelvalle.com" LegalTrademarks="Foobot" ProductName="Foobot" ProductVersion="0.0.0.0"/>
</VersionInfo> </VersionInfo>
<BuildModes Count="6"> <BuildModes Count="6">
@ -41,13 +40,18 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/> <TargetCPU Value="i386"/>
<TargetOS Value="win32"/> <TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>
<GenerateDebugInfo Value="False"/> <GenerateDebugInfo Value="False"/>
</Debugging> </Debugging>
<LinkSmart Value="True"/>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>
@ -74,13 +78,18 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/> <TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/> <TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>
<GenerateDebugInfo Value="False"/> <GenerateDebugInfo Value="False"/>
</Debugging> </Debugging>
<LinkSmart Value="True"/>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>
@ -107,13 +116,18 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/> <TargetCPU Value="i386"/>
<TargetOS Value="linux"/> <TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>
<GenerateDebugInfo Value="False"/> <GenerateDebugInfo Value="False"/>
</Debugging> </Debugging>
<LinkSmart Value="True"/>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>
@ -140,13 +154,18 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/> <TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/> <TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>
<GenerateDebugInfo Value="False"/> <GenerateDebugInfo Value="False"/>
</Debugging> </Debugging>
<LinkSmart Value="True"/>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>
@ -171,13 +190,18 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/> <TargetCPU Value="i386"/>
<TargetOS Value="win32"/> <TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>
<GenerateDebugInfo Value="False"/> <GenerateDebugInfo Value="False"/>
</Debugging> </Debugging>
<LinkSmart Value="True"/>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>

View File

@ -3,14 +3,14 @@
<ProjectSession> <ProjectSession>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Version Value="10"/> <Version Value="10"/>
<BuildModes Active="linux64"/> <BuildModes Active="win32GTK2"/>
<Units Count="32"> <Units Count="32">
<Unit0> <Unit0>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="foobotmonitor.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="14"/> <EditorIndex Value="13"/>
<CursorPos Y="31"/> <CursorPos X="55" Y="27"/>
<UsageCount Value="94"/> <UsageCount Value="95"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -20,9 +20,9 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<TopLine Value="209"/> <TopLine Value="774"/>
<CursorPos X="61" Y="229"/> <CursorPos X="42" Y="828"/>
<UsageCount Value="94"/> <UsageCount Value="95"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
</Unit1> </Unit1>
@ -34,18 +34,18 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<EditorIndex Value="8"/> <EditorIndex Value="8"/>
<TopLine Value="33"/> <TopLine Value="33"/>
<CursorPos Y="89"/> <CursorPos X="41" Y="45"/>
<UsageCount Value="84"/> <UsageCount Value="85"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="..\foobot_httpclient.pas"/> <Filename Value="..\foobot_httpclient.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="-1"/> <TopLine Value="380"/>
<TopLine Value="-1"/> <CursorPos X="35" Y="387"/>
<CursorPos X="-1" Y="-1"/> <UsageCount Value="77"/>
<UsageCount Value="76"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="..\foobot_objects.pas"/> <Filename Value="..\foobot_objects.pas"/>
@ -54,15 +54,15 @@
<WindowIndex Value="-1"/> <WindowIndex Value="-1"/>
<TopLine Value="-1"/> <TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/> <CursorPos X="-1" Y="-1"/>
<UsageCount Value="76"/> <UsageCount Value="77"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="..\foobot_utility.pas"/> <Filename Value="..\foobot_utility.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="11"/> <EditorIndex Value="10"/>
<TopLine Value="34"/> <TopLine Value="141"/>
<CursorPos X="18" Y="83"/> <CursorPos X="16" Y="190"/>
<UsageCount Value="94"/> <UsageCount Value="95"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
@ -72,7 +72,7 @@
<WindowIndex Value="-1"/> <WindowIndex Value="-1"/>
<TopLine Value="-1"/> <TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/> <CursorPos X="-1" Y="-1"/>
<UsageCount Value="76"/> <UsageCount Value="77"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="foobot_sensors.pas"/> <Filename Value="foobot_sensors.pas"/>
@ -80,7 +80,7 @@
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<TopLine Value="299"/> <TopLine Value="299"/>
<CursorPos X="14" Y="321"/> <CursorPos X="14" Y="321"/>
<UsageCount Value="28"/> <UsageCount Value="29"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit7> </Unit7>
<Unit8> <Unit8>
@ -91,7 +91,7 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<CursorPos X="21" Y="35"/> <CursorPos X="21" Y="35"/>
<UsageCount Value="23"/> <UsageCount Value="24"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
</Unit8> </Unit8>
@ -100,14 +100,14 @@
<EditorIndex Value="9"/> <EditorIndex Value="9"/>
<TopLine Value="43"/> <TopLine Value="43"/>
<CursorPos X="47" Y="13"/> <CursorPos X="47" Y="13"/>
<UsageCount Value="63"/> <UsageCount Value="64"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
<Filename Value="..\latest_stable\foobot_objects.pas"/> <Filename Value="..\latest_stable\foobot_objects.pas"/>
<EditorIndex Value="13"/> <EditorIndex Value="12"/>
<CursorPos X="32" Y="61"/> <CursorPos X="32" Y="61"/>
<UsageCount Value="63"/> <UsageCount Value="64"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
@ -140,11 +140,10 @@
</Unit14> </Unit14>
<Unit15> <Unit15>
<Filename Value="..\umainform.pas"/> <Filename Value="..\umainform.pas"/>
<EditorIndex Value="10"/> <EditorIndex Value="-1"/>
<TopLine Value="284"/> <TopLine Value="145"/>
<CursorPos X="38" Y="313"/> <CursorPos X="81" Y="158"/>
<UsageCount Value="43"/> <UsageCount Value="44"/>
<Loaded Value="True"/>
</Unit15> </Unit15>
<Unit16> <Unit16>
<Filename Value="C:\trunklatest\lazarus\lcl\lclmessageglue.pas"/> <Filename Value="C:\trunklatest\lazarus\lcl\lclmessageglue.pas"/>
@ -179,7 +178,7 @@
<EditorIndex Value="6"/> <EditorIndex Value="6"/>
<TopLine Value="101"/> <TopLine Value="101"/>
<CursorPos Y="154"/> <CursorPos Y="154"/>
<UsageCount Value="14"/> <UsageCount Value="15"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit20> </Unit20>
<Unit21> <Unit21>
@ -205,17 +204,17 @@
</Unit23> </Unit23>
<Unit24> <Unit24>
<Filename Value="C:\trunklatest\fpc\packages\rtl-objpas\src\inc\dateutil.inc"/> <Filename Value="C:\trunklatest\fpc\packages\rtl-objpas\src\inc\dateutil.inc"/>
<EditorIndex Value="12"/> <EditorIndex Value="11"/>
<TopLine Value="381"/> <TopLine Value="381"/>
<CursorPos X="24" Y="409"/> <CursorPos X="13" Y="384"/>
<UsageCount Value="32"/> <UsageCount Value="33"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit24> </Unit24>
<Unit25> <Unit25>
<Filename Value="..\latest_stable\udataform.pas"/> <Filename Value="..\latest_stable\udataform.pas"/>
<EditorIndex Value="7"/> <EditorIndex Value="7"/>
<TopLine Value="70"/> <TopLine Value="70"/>
<UsageCount Value="32"/> <UsageCount Value="33"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit25> </Unit25>
<Unit26> <Unit26>
@ -223,7 +222,7 @@
<EditorIndex Value="4"/> <EditorIndex Value="4"/>
<TopLine Value="781"/> <TopLine Value="781"/>
<CursorPos X="28" Y="795"/> <CursorPos X="28" Y="795"/>
<UsageCount Value="17"/> <UsageCount Value="18"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit26> </Unit26>
<Unit27> <Unit27>
@ -245,7 +244,7 @@
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<TopLine Value="190"/> <TopLine Value="190"/>
<CursorPos X="33" Y="205"/> <CursorPos X="33" Y="205"/>
<UsageCount Value="14"/> <UsageCount Value="15"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit29> </Unit29>
<Unit30> <Unit30>
@ -261,133 +260,126 @@
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<TopLine Value="1811"/> <TopLine Value="1811"/>
<CursorPos X="13" Y="1834"/> <CursorPos X="13" Y="1834"/>
<UsageCount Value="10"/> <UsageCount Value="11"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit31> </Unit31>
</Units> </Units>
<OtherDefines Count="1"> <JumpHistory Count="29" HistoryIndex="28">
<Define0 Value="DEBUGMODE"/>
</OtherDefines>
<JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="umainform.pas"/> <Filename Value="foobotmonitor.lpr"/>
<Caret Line="208" TopLine="186"/> <Caret Line="29"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="foobotmonitor.lpr"/>
<Caret Line="29"/> <Caret Line="30" Column="17"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="umainform.pas"/> <Filename Value="foobotmonitor.lpr"/>
<Caret Line="43" Column="28" TopLine="16"/> <Caret Line="28" Column="35"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="207" TopLine="180"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="209" TopLine="182"/> <Caret Line="281" Column="26" TopLine="245"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="311" Column="24" TopLine="309"/> <Caret Line="33" Column="3"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="41" Column="49" TopLine="21"/> <Caret Line="16" Column="33"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="255" Column="31" TopLine="235"/> <Caret Line="35" Column="49"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="256" Column="31" TopLine="236"/> <Caret Line="34" Column="49"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="255" Column="31" TopLine="235"/> <Caret Line="37" Column="37"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="248" Column="31" TopLine="235"/> <Caret Line="38" Column="12"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="247" Column="31" TopLine="234"/> <Caret Line="33" Column="32"/>
</Position12> </Position12>
<Position13> <Position13>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="280" Column="25" TopLine="234"/> <Caret Line="24" Column="41"/>
</Position13> </Position13>
<Position14> <Position14>
<Filename Value="umainform.pas"/> <Filename Value="usplash.pas"/>
<Caret Line="201" Column="13" TopLine="174"/> <Caret Line="34" Column="30"/>
</Position14> </Position14>
<Position15> <Position15>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="umainform.pas"/>
<Caret Line="18" Column="77"/> <Caret Line="229" Column="61" TopLine="209"/>
</Position15> </Position15>
<Position16> <Position16>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="umainform.pas"/>
<Caret Line="26" Column="22"/> <Caret Line="352" Column="13" TopLine="308"/>
</Position16> </Position16>
<Position17> <Position17>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="umainform.pas"/>
<Caret Line="29"/> <Caret Line="333" Column="28" TopLine="306"/>
</Position17> </Position17>
<Position18> <Position18>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="umainform.pas"/>
<Caret Line="30" Column="17"/> <Caret Line="348" Column="43" TopLine="306"/>
</Position18> </Position18>
<Position19> <Position19>
<Filename Value="foobotmonitor.lpr"/> <Filename Value="umainform.pas"/>
<Caret Line="28" Column="35"/> <Caret Line="333" Column="20" TopLine="306"/>
</Position19> </Position19>
<Position20> <Position20>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="345" Column="33" TopLine="317"/>
</Position20> </Position20>
<Position21> <Position21>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="281" Column="26" TopLine="245"/> <Caret Line="348" Column="37" TopLine="320"/>
</Position21> </Position21>
<Position22> <Position22>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="33" Column="3"/> <Caret Line="352" Column="13" TopLine="325"/>
</Position22> </Position22>
<Position23> <Position23>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="16" Column="33"/> <Caret Line="2" Column="21"/>
</Position23> </Position23>
<Position24> <Position24>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="35" Column="49"/> <Caret Line="544" Column="44" TopLine="497"/>
</Position24> </Position24>
<Position25> <Position25>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="34" Column="49"/> <Caret Line="596" Column="44" TopLine="549"/>
</Position25> </Position25>
<Position26> <Position26>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="37" Column="37"/> <Caret Line="838" Column="48" TopLine="791"/>
</Position26> </Position26>
<Position27> <Position27>
<Filename Value="usplash.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="38" Column="12"/> <Caret Line="828" Column="42" TopLine="774"/>
</Position27> </Position27>
<Position28> <Position28>
<Filename Value="usplash.pas"/> <Filename Value="..\foobot_utility.pas"/>
<Caret Line="33" Column="32"/> <Caret Line="141" Column="16" TopLine="89"/>
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="usplash.pas"/> <Filename Value="..\foobot_utility.pas"/>
<Caret Line="24" Column="41"/> <Caret Line="190" Column="16" TopLine="141"/>
</Position29> </Position29>
<Position30>
<Filename Value="usplash.pas"/>
<Caret Line="34" Column="30"/>
</Position30>
</JumpHistory> </JumpHistory>
</ProjectSession> </ProjectSession>
</CONFIG> </CONFIG>

View File

@ -9,7 +9,7 @@
[Setup] [Setup]
AppName=Foobot Monitor AppName=Foobot Monitor
AppVersion=0.1.3.0 AppVersion=0.2.0.0
DefaultDirName={pf}\foobotmonitor DefaultDirName={pf}\foobotmonitor
DefaultGroupName=Foobot DefaultGroupName=Foobot
UninstallDisplayIcon={app}\foobotmonitor.exe UninstallDisplayIcon={app}\foobotmonitor.exe

View File

@ -8,6 +8,7 @@ object configform: Tconfigform
Caption = 'configform' Caption = 'configform'
ClientHeight = 197 ClientHeight = 197
ClientWidth = 592 ClientWidth = 592
Font.Height = -12
OnCloseQuery = FormCloseQuery OnCloseQuery = FormCloseQuery
OnCreate = FormCreate OnCreate = FormCreate
Position = poMainFormCenter Position = poMainFormCenter

View File

@ -1,7 +1,7 @@
object mainform: Tmainform object mainform: Tmainform
Left = 1072 Left = 516
Height = 451 Height = 451
Top = 245 Top = 144
Width = 784 Width = 784
BorderIcons = [biSystemMenu, biMinimize] BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle BorderStyle = bsSingle
@ -9,12 +9,12 @@ object mainform: Tmainform
ClientHeight = 431 ClientHeight = 431
ClientWidth = 784 ClientWidth = 784
DefaultMonitor = dmDesktop DefaultMonitor = dmDesktop
Font.Height = -12
Menu = MainMenu1 Menu = MainMenu1
OnActivate = FormActivate OnActivate = FormActivate
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow
OnWindowStateChange = FormWindowStateChange OnWindowStateChange = FormWindowStateChange
Position = poWorkAreaCenter Position = poWorkAreaCenter
ShowInTaskBar = stNever ShowInTaskBar = stNever
@ -466,7 +466,6 @@ object mainform: Tmainform
end end
object mnu_optionsDisplay: TMenuItem object mnu_optionsDisplay: TMenuItem
Caption = 'Display...' Caption = 'Display...'
OnClick = mnu_optionsDisplayClick
object mnu_optionsDisplayGuagesOnly: TMenuItem object mnu_optionsDisplayGuagesOnly: TMenuItem
AutoCheck = True AutoCheck = True
Caption = 'Guages only' Caption = 'Guages only'
@ -494,6 +493,9 @@ object mainform: Tmainform
OnClick = mnu_optionsResetHighsLowsClick OnClick = mnu_optionsResetHighsLowsClick
end end
end end
object mnu_foobot: TMenuItem
Caption = '&Foobot'
end
object mnu_help: TMenuItem object mnu_help: TMenuItem
Caption = '&Help' Caption = '&Help'
object mnu_optionsOnlineHelp: TMenuItem object mnu_optionsOnlineHelp: TMenuItem

View File

@ -40,7 +40,7 @@ interface
uses uses
SysUtils, TAGraph, TAIntervalSources, TASeries, foobot_sensors, SysUtils, TAGraph, TAIntervalSources, TASeries, foobot_sensors,
Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Menus, lclIntf, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Menus, lclIntf,
foobot_utility, uCryptIni, dateutils, uconfigform, Classes; foobot_utility, uCryptIni, dateutils, uconfigform;
const const
// Timer milliseconds // Timer milliseconds
@ -123,6 +123,7 @@ type
lbl_voclow: TLabel; lbl_voclow: TLabel;
lbl_allpollulow: TLabel; lbl_allpollulow: TLabel;
MainMenu1: TMainMenu; MainMenu1: TMainMenu;
mnu_foobot: TMenuItem;
mnu_optionsDisplayRedLines: TMenuItem; mnu_optionsDisplayRedLines: TMenuItem;
mnu_optionsDisplayYellowLines: TMenuItem; mnu_optionsDisplayYellowLines: TMenuItem;
mnu_optionsDisplayGuagesOnly: TMenuItem; mnu_optionsDisplayGuagesOnly: TMenuItem;
@ -150,12 +151,10 @@ type
traypopup: TPopupMenu; traypopup: TPopupMenu;
tmr_foobot: TTimer; tmr_foobot: TTimer;
TrayIcon1: TTrayIcon; TrayIcon1: TTrayIcon;
procedure ApplicationProperties1IdleEnd(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormWindowStateChange(Sender: TObject); procedure FormWindowStateChange(Sender: TObject);
procedure mnupopup_fileRestoreClick(Sender: TObject); procedure mnupopup_fileRestoreClick(Sender: TObject);
procedure mnu_fileExitClick(Sender: TObject); procedure mnu_fileExitClick(Sender: TObject);
@ -167,7 +166,6 @@ type
procedure mnu_optionsOnlineHelpClick(Sender: TObject); procedure mnu_optionsOnlineHelpClick(Sender: TObject);
procedure mnu_optionsResetHighsLowsClick(Sender: TObject); procedure mnu_optionsResetHighsLowsClick(Sender: TObject);
procedure mnu_optionsSaveHighLowsClick(Sender: TObject); procedure mnu_optionsSaveHighLowsClick(Sender: TObject);
procedure mnu_optionsDisplayClick(Sender: TObject);
procedure mnu_optionsTakeReadingNowClick(Sender: TObject); procedure mnu_optionsTakeReadingNowClick(Sender: TObject);
procedure mnu_SampleEvery1HourClick(Sender: TObject); procedure mnu_SampleEvery1HourClick(Sender: TObject);
procedure mnu_SampleEvery24HoursClick(Sender: TObject); procedure mnu_SampleEvery24HoursClick(Sender: TObject);
@ -181,6 +179,8 @@ type
sSecretKey, sFoobotUserName, sUUID: string; sSecretKey, sFoobotUserName, sUUID: string;
bDisplayGuagesOnly, bDisplayYellowLines, bDisplayRedLines: boolean; bDisplayGuagesOnly, bDisplayYellowLines, bDisplayRedLines: boolean;
iFudgeFactor: integer; iFudgeFactor: integer;
iCurrentFoobot: integer;
foobotmenuarray: array of TMenuItem;
procedure DisplayReadings; procedure DisplayReadings;
procedure UpdateGuage(Sender: TAnalogSensor; SensorNumber: integer); procedure UpdateGuage(Sender: TAnalogSensor; SensorNumber: integer);
procedure UpdateHighLow(SensorNumber: integer); procedure UpdateHighLow(SensorNumber: integer);
@ -188,6 +188,8 @@ type
procedure GraphCurrentReading; procedure GraphCurrentReading;
procedure SetYellowRecommendedLevels; procedure SetYellowRecommendedLevels;
procedure SetRedSessionMax; procedure SetRedSessionMax;
procedure PopulateFoobotMenu;
procedure ChangeCurrentFoobot(Sender: TObject);
procedure SaveConfig; procedure SaveConfig;
procedure LoadConfig; procedure LoadConfig;
public public
@ -198,7 +200,9 @@ var
mainform: Tmainform; mainform: Tmainform;
implementation implementation
Uses uSplash;
uses uSplash;
{$R *.lfm} {$R *.lfm}
{ Tmainform } { Tmainform }
@ -224,12 +228,12 @@ begin
ResetHighLows; ResetHighLows;
iFudgeFactor := 20; // only needed if height set in form.create iFudgeFactor := 20; // only needed if height set in form.create
bDisplayGuagesOnly := False; bDisplayGuagesOnly := False;
INI.PlainTextMode:=TRUE; INI.PlainTextMode := True;
bDisplayYellowLines := INI.ReadBool('Config','DisplayYellowLines',False); bDisplayYellowLines := INI.ReadBool('Config', 'DisplayYellowLines', False);
mnu_optionsDisplayYellowLines.Checked:=bDisplayYellowLines; mnu_optionsDisplayYellowLines.Checked := bDisplayYellowLines;
bDisplayRedLines := INI.ReadBool('Config','DisplayRedLines',False); bDisplayRedLines := INI.ReadBool('Config', 'DisplayRedLines', False);
mnu_optionsDisplayRedLines.Checked:=bDisplayRedLines; mnu_optionsDisplayRedLines.Checked := bDisplayRedLines;
INI.PlainTextMode:=FALSE; INI.PlainTextMode := False;
SetYellowRecommendedLevels; SetYellowRecommendedLevels;
SetRedSessionMax; SetRedSessionMax;
TrayIcon1.Icon := Application.Icon; TrayIcon1.Icon := Application.Icon;
@ -280,13 +284,15 @@ begin
tmr_foobot.Enabled := True; tmr_foobot.Enabled := True;
{$ENDIF} {$ENDIF}
// Everything OK - lets go! // Everything OK - lets go!
iCurrentFoobot := 0;
PopulateFoobotMenu;
Show; Show;
grp_sensorDisplay.Refresh; grp_sensorDisplay.Refresh;
grp_highlow.Refresh; grp_highlow.Refresh;
Update; Update;
Application.Processmessages; Application.ProcessMessages;
splashform.hide; splashform.hide;
Application.Processmessages; Application.ProcessMessages;
end end
else else
begin begin
@ -322,9 +328,35 @@ begin
end; end;
procedure Tmainform.ApplicationProperties1IdleEnd(Sender: TObject); procedure Tmainform.ChangeCurrentFoobot(Sender: TObject);
begin begin
iCurrentFoobot := (Sender as TMenuItem).Tag;
mnu_optionsTakeReadingNow.Click;
end;
procedure Tmainform.PopulateFoobotMenu;
// uses foobotmenuarray
var
iCount: integer;
begin
if FoobotIdentityObject.FoobotIdentityList.Count = 0 then
Exit;
SetLength(foobotmenuarray, FoobotIdentityObject.FoobotIdentityList.Count);
for iCount := 0 to Pred(FoobotIdentityObject.FoobotIdentityList.Count) do
begin
foobotmenuarray[iCount] := TMenuItem.Create(MainMenu1);
with foobotmenuarray[iCount] do
begin
Caption := FoobotIdentityObject.FoobotIdentityList[iCount].Name;
AutoCheck := True;
RadioItem := True;
OnClick := @ChangeCurrentFoobot;
Tag := iCount;
if iCount = 0 then
Checked := True;
end;
end;
mnu_foobot.Add(foobotmenuarray);
end; end;
procedure Tmainform.FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure Tmainform.FormClose(Sender: TObject; var CloseAction: TCloseAction);
@ -339,11 +371,6 @@ begin
FreeAndNil(INI); FreeAndNil(INI);
end; end;
procedure Tmainform.FormShow(Sender: TObject);
begin
end;
procedure Tmainform.SaveConfig; procedure Tmainform.SaveConfig;
begin begin
INI.PlainTextMode := True; INI.PlainTextMode := True;
@ -368,8 +395,8 @@ begin
INI.WriteFloat('Config', 'vocMaxValue', as_voc.ValueMax); INI.WriteFloat('Config', 'vocMaxValue', as_voc.ValueMax);
INI.WriteFloat('Config', 'allpolluMinValue', as_allpollu.ValueMin); INI.WriteFloat('Config', 'allpolluMinValue', as_allpollu.ValueMin);
INI.WriteFloat('Config', 'allpolluMaxValue', as_allpollu.ValueMax); INI.WriteFloat('Config', 'allpolluMaxValue', as_allpollu.ValueMax);
INI.WriteBool('Config','DisplayYellowLines',bDisplayYellowLines); INI.WriteBool('Config', 'DisplayYellowLines', bDisplayYellowLines);
INI.WriteBool('Config','DisplayRedLines',bDisplayRedLines); INI.WriteBool('Config', 'DisplayRedLines', bDisplayRedLines);
INI.PlainTextMode := False; INI.PlainTextMode := False;
end; end;
@ -500,15 +527,10 @@ begin
INI.WriteBool('Foobot', 'SaveLoadHighLows', SaveLoadHighLows); INI.WriteBool('Foobot', 'SaveLoadHighLows', SaveLoadHighLows);
end; end;
procedure Tmainform.mnu_optionsDisplayClick(Sender: TObject);
begin
end;
procedure Tmainform.mnu_optionsTakeReadingNowClick(Sender: TObject); procedure Tmainform.mnu_optionsTakeReadingNowClick(Sender: TObject);
begin begin
mainform.Cursor := crHourGlass; mainform.Cursor := crHourGlass;
// Only Foobot #0 if FetchFoobotData(dfLast, iCurrentFoobot, 0, 0, 0, 0, sSecretKey) then
if FetchFoobotData(dfLast, 0, 0, 0, 0, 0, sSecretKey) then
DisplayReadings DisplayReadings
else else
ShowMessage('Sorry - no readings available'); ShowMessage('Sorry - no readings available');
@ -560,7 +582,7 @@ end;
procedure Tmainform.tmr_foobotTimer(Sender: TObject); procedure Tmainform.tmr_foobotTimer(Sender: TObject);
begin begin
if FetchFoobotData(dfLast, 0, 0, 0, 0, 0, sSecretKey) then if FetchFoobotData(dfLast, iCurrentFoobot, 0, 0, 0, 0, sSecretKey) then
DisplayReadings; DisplayReadings;
end; end;
@ -802,8 +824,8 @@ begin
iStartSeconds := iEndSeconds - (2 * (24 * 3600)); // 49 hours before Now iStartSeconds := iEndSeconds - (2 * (24 * 3600)); // 49 hours before Now
grp_chart.Caption := Format('History from %s', grp_chart.Caption := Format('History from %s',
[FormatDateTime('dd/mm/yyyy hh:nn', UnixToDateTime(iStartSeconds))]); [FormatDateTime('dd/mm/yyyy hh:nn', UnixToDateTime(iStartSeconds))]);
if FetchFoobotData(dfStartEnd, 0, 0, 3600, iStartSeconds, iEndSeconds, sSecretKey) = if FetchFoobotData(dfStartEnd, iCurrentFoobot, 0, 3600, iStartSeconds,
False then iEndSeconds, sSecretKey) = False then
exit; exit;
if FoobotDataObjectToArrays then if FoobotDataObjectToArrays then
for iCount := 0 to Pred(High(FoobotData_time)) do for iCount := 0 to Pred(High(FoobotData_time)) do