diff --git a/applications/foobot/monitor/foobotmonitor.lps b/applications/foobot/monitor/foobotmonitor.lps
index c2876882e..e5dbd1e29 100644
--- a/applications/foobot/monitor/foobotmonitor.lps
+++ b/applications/foobot/monitor/foobotmonitor.lps
@@ -8,9 +8,9 @@
-
+
-
+
@@ -19,9 +19,9 @@
-
-
-
+
+
+
@@ -31,10 +31,10 @@
-
+
-
+
@@ -44,7 +44,7 @@
-
+
@@ -54,15 +54,15 @@
-
+
-
+
-
+
@@ -72,16 +72,15 @@
-
+
-
+
-
-
+
@@ -90,9 +89,10 @@
-
-
+
+
+
@@ -102,26 +102,26 @@
-
-
-
+
+
+
-
+
-
+
-
-
-
-
+
+
+
+
@@ -130,12 +130,12 @@
-
+
-
+
@@ -143,21 +143,21 @@
-
+
-
+
-
+
@@ -165,34 +165,34 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -200,35 +200,35 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -236,20 +236,20 @@
-
+
-
+
-
+
@@ -257,14 +257,14 @@
-
+
-
+
@@ -272,7 +272,7 @@
-
+
@@ -280,130 +280,130 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
+
diff --git a/applications/foobot/monitor/umainform.pas b/applications/foobot/monitor/umainform.pas
index 8d5207f44..7eac01f2b 100644
--- a/applications/foobot/monitor/umainform.pas
+++ b/applications/foobot/monitor/umainform.pas
@@ -217,7 +217,6 @@ type
sSecretKey, sFoobotUserName, sUUID: string;
bDisplayGuagesOnly, bDisplayYellowLines, bDisplayRedLines: boolean;
iFudgeFactor: integer;
- iCurrentFoobot: integer;
HighTriggerColor, LowTriggerColor: TColor;
foobotmenuarray: array of TMenuItem;
procedure DisplayReadings;
@@ -238,6 +237,7 @@ type
procedure DoLowTriggerAlert(const iSensorNum: integer; const aValue: variant);
procedure RestoreNormalColour(const iSensorNum: integer);
public
+ iCurrentFoobot: integer;
INI: TCryptINIfile;
end;
@@ -351,6 +351,7 @@ begin
{$ENDIF}
grp_sensorDisplay.Refresh;
grp_highlow.Refresh;
+ grp_health.Refresh;
Update;
Application.ProcessMessages;
splashform.hide;
@@ -772,6 +773,7 @@ end;
procedure Tmainform.mnu_options_triggersSetTriggersClick(Sender: TObject);
begin
+ If FoobotIdentityObject.FoobotIdentityList.Count = 0 then Exit;;
triggersform.ShowModal;
if triggersform.ModalResult = mrCancel then
begin
diff --git a/applications/foobot/monitor/utriggersform.lfm b/applications/foobot/monitor/utriggersform.lfm
index d999d440b..ebf87eff1 100644
--- a/applications/foobot/monitor/utriggersform.lfm
+++ b/applications/foobot/monitor/utriggersform.lfm
@@ -1,7 +1,7 @@
object triggersform: Ttriggersform
- Left = 543
+ Left = 478
Height = 565
- Top = 191
+ Top = 162
Width = 794
ActiveControl = edt_newrec_pm
BorderIcons = [biSystemMenu]
@@ -13,6 +13,7 @@ object triggersform: Ttriggersform
FormStyle = fsStayOnTop
OnActivate = FormActivate
OnCreate = FormCreate
+ OnDestroy = FormDestroy
OnShow = FormShow
Position = poWorkAreaCenter
ShowInTaskBar = stNever
@@ -113,6 +114,7 @@ object triggersform: Ttriggersform
Top = 0
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 0
Text = '0.00'
@@ -123,6 +125,7 @@ object triggersform: Ttriggersform
Top = 20
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 1
Text = '0.00'
@@ -133,6 +136,7 @@ object triggersform: Ttriggersform
Top = 40
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 2
Text = '0.00'
@@ -247,6 +251,7 @@ object triggersform: Ttriggersform
Top = 0
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 0
Text = '0.00'
@@ -257,6 +262,7 @@ object triggersform: Ttriggersform
Top = 20
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 1
Text = '0.00'
@@ -267,6 +273,7 @@ object triggersform: Ttriggersform
Top = 40
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 2
Text = '0.00'
@@ -381,6 +388,7 @@ object triggersform: Ttriggersform
Top = 0
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 0
Text = '0.00'
@@ -391,6 +399,7 @@ object triggersform: Ttriggersform
Top = 20
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 1
Text = '0.00'
@@ -401,6 +410,7 @@ object triggersform: Ttriggersform
Top = 40
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 2
Text = '0.00'
@@ -515,6 +525,7 @@ object triggersform: Ttriggersform
Top = 0
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 0
Text = '0.00'
@@ -525,6 +536,7 @@ object triggersform: Ttriggersform
Top = 20
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 1
Text = '0.00'
@@ -535,6 +547,7 @@ object triggersform: Ttriggersform
Top = 40
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 2
Text = '0.00'
@@ -649,6 +662,7 @@ object triggersform: Ttriggersform
Top = 0
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 0
Text = '0.00'
@@ -659,6 +673,7 @@ object triggersform: Ttriggersform
Top = 20
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 1
Text = '0.00'
@@ -669,6 +684,7 @@ object triggersform: Ttriggersform
Top = 40
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 2
Text = '0.00'
@@ -783,6 +799,7 @@ object triggersform: Ttriggersform
Top = 0
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 0
Text = '0.00'
@@ -793,6 +810,7 @@ object triggersform: Ttriggersform
Top = 20
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 1
Text = '0.00'
@@ -803,6 +821,7 @@ object triggersform: Ttriggersform
Top = 40
Width = 72
BorderStyle = bsNone
+ OnKeyPress = OnlyNumericKeyPress
ParentFont = False
TabOrder = 2
Text = '0.00'
@@ -845,6 +864,7 @@ object triggersform: Ttriggersform
DefaultCaption = True
Kind = bkOK
ModalResult = 1
+ OnClick = cmd_OKClick
TabOrder = 1
end
object cmd_cancel: TBitBtn
diff --git a/applications/foobot/monitor/utriggersform.pas b/applications/foobot/monitor/utriggersform.pas
index 3bea742f0..12d7ba245 100644
--- a/applications/foobot/monitor/utriggersform.pas
+++ b/applications/foobot/monitor/utriggersform.pas
@@ -9,7 +9,6 @@ uses
Buttons;
type
-
{ Ttriggersform }
Ttriggersform = class(TForm)
@@ -94,10 +93,14 @@ type
lbl_newrec_co2: TLabel;
lbl_newrec_voc: TLabel;
lbl_newrec_allpollu: TLabel;
+ procedure cmd_OKClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
+ procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
+ procedure OnlyNumericKeyPress(Sender: TObject; var Key: char);
private
+ ErrorList:TStrings;
procedure DisplayCurrentValues;
procedure SetUpUnits;
public
@@ -118,7 +121,12 @@ uses umainform, foobot_utility;
procedure Ttriggersform.FormCreate(Sender: TObject);
begin
Icon := Application.Icon;
- Caption := Application.Title + ' - Set Recommended values and Triggers';
+ ErrorList:=TStringList.Create;
+end;
+
+procedure Ttriggersform.FormDestroy(Sender: TObject);
+begin
+ FreeAndNil(ErrorList);
end;
procedure Ttriggersform.FormActivate(Sender: TObject);
@@ -126,9 +134,22 @@ begin
SetUpUnits;
end;
+procedure Ttriggersform.cmd_OKClick(Sender: TObject);
+begin
+ // VerifyEveryThing then Save to inifiles;
+end;
+
+procedure Ttriggersform.OnlyNumericKeyPress(Sender: TObject; var Key: char);
+begin
+ if not (Key in ['0'..'9', '.', #8, #9]) then Key := #0;
+end;
+
procedure Ttriggersform.FormShow(Sender: TObject);
begin
+ Caption := Application.Title + ' - Set Recommended values (for all Foobots) and Triggers (for ' +
+ FoobotIdentityObject.FoobotIdentityList[mainform.iCurrentFoobot].Name + ')';
DisplayCurrentValues;
+ ErrorList.Clear;
Update;
end;