From 33d48a18d2e2fe42768a621b33d634b6569f658b Mon Sep 17 00:00:00 2001 From: gbamber Date: Tue, 10 Jan 2017 06:55:00 +0000 Subject: [PATCH] V0.2.2.0: Fixed showmodal bug git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5619 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/foobot/monitor/foobotmonitor.lps | 126 +++++++++--------- applications/foobot/monitor/umainform.pas | 27 ++-- 2 files changed, 82 insertions(+), 71 deletions(-) diff --git a/applications/foobot/monitor/foobotmonitor.lps b/applications/foobot/monitor/foobotmonitor.lps index 7e5e8bd3f..9ab1522c2 100644 --- a/applications/foobot/monitor/foobotmonitor.lps +++ b/applications/foobot/monitor/foobotmonitor.lps @@ -10,7 +10,7 @@ - + @@ -19,9 +19,10 @@ - - - + + + + @@ -34,7 +35,7 @@ - + @@ -44,7 +45,7 @@ - + @@ -54,7 +55,7 @@ - + @@ -62,7 +63,7 @@ - + @@ -72,7 +73,7 @@ - + @@ -80,7 +81,7 @@ - + @@ -90,7 +91,7 @@ - + @@ -100,11 +101,10 @@ - - - - + + + @@ -287,123 +287,123 @@ - + - - + + - + - + - + - + - - + + - - + + - - + + - + - - + + - + - + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/applications/foobot/monitor/umainform.pas b/applications/foobot/monitor/umainform.pas index 7954f8f57..55ea53e0b 100644 --- a/applications/foobot/monitor/umainform.pas +++ b/applications/foobot/monitor/umainform.pas @@ -481,6 +481,7 @@ begin Format('> %.1f %s', [RecommendedLevelsArray[C_ALLPOLLU], FoobotDataObject.Units[C_ALLPOLLU]]); lbl_greenlightallpollu.Caption := Format('< %.1f %s', [RecommendedLevelsArray[C_ALLPOLLU], FoobotDataObject.Units[C_ALLPOLLU]]); + grp_health.Refresh; end; procedure Tmainform.PopulateFoobotMenu; @@ -767,17 +768,25 @@ begin end; procedure Tmainform.mnu_options_triggersSetTriggersClick(Sender: TObject); +Var iCount:Integer; begin If FoobotIdentityObject.FoobotIdentityList.Count = 0 then Exit;; triggersform.ShowModal; - if triggersform.ModalResult = mrCancel then - begin - // Cancelled form - end - else - begin - mnu_options_triggersActivateTriggers.Enabled := True; - end; + // If cancel was clicked nothing was changed + mnu_options_triggersActivateTriggers.Enabled := True; + LoadTriggers; // This can only be done if we have a Foobot Identity + // as each Foobot has its own trigger values + SetMinMaxTriggers; // Adjust if necesarry for preset Guage High/Low limits + // LoadRecommendedLevels; // into RecommendedLevelsArray + for iCount := C_PM to C_ALLPOLLU do + SetTrafficLightStats(iCount, C_HIGH); + UpdateHealth; + DisplayReadings; + Update; + { + ShowMessageFmt('Current high trigger: %.1f %s', + [double(FooBotTriggerArray[C_HIGH, C_TMP]), FoobotDataObject.Units[C_TMP]]); + } end; procedure Tmainform.mnu_SampleEveryHalfHourClick(Sender: TObject); @@ -839,6 +848,7 @@ begin end; procedure Tmainform.SetRedSessionMax; +// Sets red lines on guages begin if bDisplayRedLines = True then begin @@ -873,6 +883,7 @@ begin end; procedure Tmainform.SetYellowRecommendedLevels; +// Sets yellow lines on guages begin if bDisplayYellowLines = True then begin