Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/alarming/trunk/Delphi Client/DoorAlarmClientMain.pas
(Generate patch)

Comparing trunk/Delphi Client/DoorAlarmClientMain.pas (file contents):
Revision 8 by daniel-marschall, Mon Jun 10 21:58:29 2019 UTC vs.
Revision 9 by daniel-marschall, Thu May 21 18:24:45 2020 UTC

# Line 34 | Line 34 | type
34      Ignoredoorbell1: TMenuItem;
35      Ignoremotionalert1: TMenuItem;
36      unknownAlarm: TPanel;
37 +    Simulatealarm1: TMenuItem;
38      procedure FormDestroy(Sender: TObject);
39      procedure FormCreate(Sender: TObject);
40      procedure TrayIcon1Click(Sender: TObject);
# Line 48 | Line 49 | type
49      procedure Stopalarm1Click(Sender: TObject);
50      procedure Gotocontrolpanelwebsite1Click(Sender: TObject);
51      procedure ImageClick(Sender: TObject);
52 +    procedure Simulatealarm1Click(Sender: TObject);
53    private
54      MJPEGDecoder: TMJPEGDecoder;
55      LastDingDong: TDateTime;
# Line 100 | Line 102 | var
102    lParamList: TStringList;
103    idhttp: TIdHttp;
104   begin
105 <  try
105 >  //try
106      try
107 +      UpdateIPTimerTimer(UpdateIPTimer); // make sure we are registered
108 +
109        lParamList := TStringList.Create;
110        lParamList.Add('action=motion_off'); // 1.3.6.1.4.1.37476.2.4.1.101
111  
# Line 114 | Line 118 | begin
118      finally
119        FreeAndNil(lParamList);
120      end;
121 <  except
121 >  //except
122      // Nothing
123 <  end;
123 >  //end;
124   end;
125  
126   procedure TForm1.StopMusic;
# Line 179 | Line 183 | var
183    lParamList: TStringList;
184    idhttp: TIdHttp;
185   begin
186 <  try
186 >  //try
187      try
188 +      UpdateIPTimerTimer(UpdateIPTimer); // make sure we are registered
189 +
190        lParamList := TStringList.Create;
191        lParamList.Add('action=motion_on'); // 1.3.6.1.4.1.37476.2.4.1.100
192  
# Line 193 | Line 199 | begin
199      finally
200        FreeAndNil(lParamList);
201      end;
202 <  except
202 >  //except
203      // Nothing
204 <  end;
204 >  //end;
205   end;
206  
207   procedure TForm1.StartStream;
# Line 397 | Line 403 | begin
403    end;
404   end;
405  
406 + procedure TForm1.Simulatealarm1Click(Sender: TObject);
407 + var
408 +  lParamList: TStringList;
409 +  idhttp: TIdHttp;
410 + begin
411 +  //try
412 +    try
413 +      lParamList := TStringList.Create;
414 +      lParamList.Add('action=server_alert'); // 1.3.6.1.4.1.37476.2.4.1.2
415 +      lParamList.Add('targets=1.3.6.1.4.1.37476.2.4.2.0');    // Any
416 +      lParamList.Add('targets=1.3.6.1.4.1.37476.2.4.2.1002'); // Motion, camera
417 +      lParamList.Add('targets=1.3.6.1.4.1.37476.2.4.2.2001'); // Sound, doorbell
418 +
419 +      idhttp := TIdHTTP.Create(nil);
420 +      try
421 +        idhttp.Post(ControlServerUrl, lParamList);
422 +      finally
423 +        FreeAndNil(idhttp);
424 +      end;
425 +    finally
426 +      FreeAndNil(lParamList);
427 +    end;
428 +  //except
429 +    // Nothing
430 +  //end;
431 + end;
432 +
433   procedure TForm1.TrayIcon1Click(Sender: TObject);
434   begin
435    // TODO: when clicked, the icon-selection won't close

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines