Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 31 to 45 of 65

Thread: Hoe Locatie gebied met een bepaalde straal bepalen ?

  1. #31
    Quote Originally Posted by MMSoft View Post
    De 3 waardes blijven 0 wat ik ook doe en hoe vaak ik ook op Button1 druk
    Ik neem aan dat je je toestel dan wel aan het bewegen bent (of elke keer in een andere stand houdt).

    Maar hoe kom je aan die OrientationSensor1.
    Is dat niet gewoon een willekeurige sensor?

    Wat is de waarde van TSensorType in die OrientationSensor1?

  2. #32
    Ik neem aan dat je je toestel dan wel aan het bewegen bent (of elke keer in een andere stand houdt).?
    Ik beweeg in alle richtingen, de waardes blijven 0

    Maar hoe kom je aan die OrientationSensor1.
    Is dat niet gewoon een willekeurige sensor?
    Het is een sensor die in het toestel gebouwd zit, en ik vindt er van alles over op internet.
    Helaas krijg ik er geen enkele waarde uit op deze na:

    Label1.Text := FloatToStr( OrientationSensor1.Sensor.UpdateInterval ); //Geeft de waarde 1000 (1000 ms ?)

    Wat is de waarde van TSensorType in die OrientationSensor1?
    Ik heb geen idee wat voor soort variable ik uit kan lezen:

    Label1.Text := OrientationSensor1.Sensor.SensorType;
    Label1.Text := FloatToStr( OrientationSensor1.Sensor.SensorType );
    Label1.Text := IntToStr( OrientationSensor1.Sensor.SensorType );

    Al deze regels (telkens één regel geprobeerd) geven fout meldingen.

  3. #33
    Label1.Text := IntToStr( ord(OrientationSensor1.Sensor.SensorType) );
    ?

    Misschien is de SensorType ook een property in de ObjectInspector.
    Dan zie je direct welke waarde die heeft.

    Hij moet op Compas3D gezet worden.

  4. #34
    En heb je OrientationSensor1.Sensor.Start; gedaan

    Probeer de code van hier eens:
    http://stackoverflow.com/questions/2...r-data-in-memo

    Vooral die LocationSensor1.Sensor.AvailableProperties uitlezen na de OrientationSensor1.Sensor.Start;
    Last edited by rvk; 15-Sep-16 at 17:49.

  5. #35
    En heb je OrientationSensor1.Sensor.Start; gedaan
    Nee dat had ik niet gedaan, dus heb dat nu meteen gedaan. Helaas het probleem blijft.


    Ik lees onderaan iets over een Bug in XE8, het zal toch zeker niet weer zo zijn

    Mogen ga ik met deze code bezig, moet nu gaan werken...

  6. #36
    Quote Originally Posted by MMSoft View Post
    Mogen ga ik met deze code bezig, moet nu gaan werken...
    Kijk dan ook gelijk even wat de waarde is van
    Label1.Text := IntToStr( ord(OrientationSensor1.Sensor.SensorType) );

    Werkse...

  7. #37
    Als ik die code opneem in mijn code dan krijg ik van alle kanten fout meldingen.
    Daarom ben ik maar eens een nieuw project begonnen.

    Code:
    unit Unit1;
    
    interface
    
    uses
      System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
      FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Sensors,
      System.Sensors.Components, FMX.StdCtrls, FMX.Controls.Presentation;
    
    type
      TForm1 = class(TForm)
        OrientationSensor1: TOrientationSensor;
        Button1: TButton;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        procedure FormActivate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.fmx}
    
    procedure TForm1.FormActivate(Sender: TObject);
    begin
     OrientationSensor1.Active := True;
     Sleep(1000); // 1Sec. wachten
     OrientationSensor1.Sensor.Start;
     Sleep(1000); // 1Sec. wachten
     if OrientationSensor1.Sensor.Started then Label1.Text := 'Gestart';
    end;
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
     Label1.Text := IntToStr( ord(OrientationSensor1.Sensor.SensorType) );
    
     Label2.Text := FloatToStr( OrientationSensor1.Sensor.HeadingX );
     Label3.Text := FloatToStr( OrientationSensor1.Sensor.HeadingY );
     Label4.Text := FloatToStr( OrientationSensor1.Sensor.HeadingZ );
    end;
    
    end.
    Na opstart krijg ik:
    Gestart

    en als ik op Button1 druk:
    2
    0
    0
    0

    ================================================== =======================

    Dit heb ik er nu van gemaakt, klopt het zo ?:
    Code:
    unit Unit1;
    
    interface
    
    uses
      System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
      FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Sensors,
      System.Sensors.Components, FMX.StdCtrls, FMX.Controls.Presentation,
      FMX.ScrollBox, FMX.Memo; //, TypInfo;
    
    
     //-------------------------
     type
      TOrientationSensorAccessor = class(TCustomOrientationSensor);
      TLocationSensorAccessor = class(TCustomLocationSensor);
     //-------------------------
    
    
    type
      TForm1 = class(TForm)
        OrientationSensor1: TOrientationSensor;
        Button1: TButton;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Button2: TButton;
        Memo1: TMemo;
        LocationSensor1: TLocationSensor;
        procedure FormActivate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    //----------------
    uses
      TypInfo;
    //----------------
    
    {$R *.fmx}
    
    procedure TForm1.FormActivate(Sender: TObject);
    begin
     OrientationSensor1.Active := True;
     Sleep(1000); // 1Sec. wachten
     OrientationSensor1.Sensor.Start;
     Sleep(1000); // 1Sec. wachten
     if OrientationSensor1.Sensor.Started then Label1.Text := 'Gestart';
    end;
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
     Label1.Text := IntToStr( ord(OrientationSensor1.Sensor.SensorType) );
    
     Label2.Text := FloatToStr( OrientationSensor1.Sensor.HeadingX );
     Label3.Text := FloatToStr( OrientationSensor1.Sensor.HeadingY );
     Label4.Text := FloatToStr( OrientationSensor1.Sensor.HeadingZ );
    end;
    
    
    procedure TForm1.Button2Click(Sender: TObject);
    var
      p_location: TCustomLocationSensor.TProperty;
      p_orientation: TCustomOrientationSensor.TProperty;
      n, v: string;
    begin
      Memo1.Lines.Clear;
    
      if Assigned(OrientationSensor1.Sensor) then
      begin
        if not OrientationSensor1.Sensor.Started then OrientationSensor1.Sensor.Start;
    
        // Error (only in XE8): Incompatible types 'TCustomLocationSensor.TProperty' and 'TCustomOrientationSensor.TProperty'
        // In XE7 it works.
        for p_orientation in OrientationSensor1.Sensor.AvailableProperties do
        begin
          n := 'OrientationSensor.'+GetEnumName(TypeInfo(TCustomOrientationSensor.TProperty), integer(p_orientation)) ;
          v := FloatToStr(TOrientationSensorAccessor(OrientationSensor1.Sensor).GetDoubleProperty(p_orientation));
          Memo1.Lines.Values[n] := v;
        end;
      end;
    
     // if Assigned(LocationSensor1.Sensor) then
     // begin
     //   if not LocationSensor1.Sensor.Started then LocationSensor1.Sensor.Start;
     //   for p_location in LocationSensor1.Sensor.AvailableProperties do
     //   begin
     //     n := 'LocationSensor.'+GetEnumName(TypeInfo(TCustomLocationSensor.TProperty), integer(p_location)) ;
     //     v := FloatToStr(TLocationSensorAccessor(LocationSensor1.Sensor).GetDoubleProperty(p_location));
     //     Memo1.Lines.Values[n] := v;
     //   end;
     // end;
    end;
    
    end.
    Ik heb alleen de eerste voorbeeld code gebruikt, dus mogelijk moet ik nog iets wijzigen waarover verder op die site gesproken wordt...

    Met deze (huidige) code krijg ik helaas nog steeds 3 keer de waarde "0".

    Click image for larger version. 

Name:	Screenshot_2016-09-16-09-26-36.png 
Views:	137 
Size:	34.9 KB 
ID:	7364
    Last edited by MMSoft; 16-Sep-16 at 10:30.

  8. #38
    Ik heb zelf geen FMX dus kan je niet helpen de code erin te zetten.

    Maar ik mis hier wel het "kiezen" van de juiste Sensor.
    Volgens mij moet de OrientationSensor1 een event OnSensorChoosing hebben.
    Daarin moet je controleren of de sensor de juiste property heeft die je wilt hebben en dan moet je ChoseSensorIndex zetten.

    Voeg dit eens toe als OnSensorChoosing:

    Delphi Code:
    1. procedure TForm1.OrientationSensor1SensorChoosing(Sender: TObject;
    2.   const Sensors: TSensorArray; var ChoseSensorIndex: Integer);
    3. var
    4.   I, Found: Integer;
    5. begin
    6.   Found := -1;
    7.   for I := 0 to High(Sensors) do
    8.   begin
    9.  
    10.     // deze zou voor de TiltX zijn
    11.     // if TCustomOrientationSensor.TProperty.TiltX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
    12.     //   Found := I;
    13.  
    14.     if TCustomOrientationSensor.TProperty.HeadingX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
    15.       Found := I;
    16.  
    17.   end;
    18.   if Found < 0 then
    19.   begin
    20.     Found := 0;
    21.     ShowMessage('Compass not available');
    22.   end;
    23.   ChoseSensorIndex := Found;
    24. end;

    Ik weet niet of je de HeadingXYZ nodig hebt of de TiltXYZ maar probeer ze allebei maar eens.
    Tevens weet ik niet zeker wat voor waarde HeadingX terug geeft.
    Dat zijn volgens mij MicroTeslas dus die moet je dan converteren.

    Je zou ook eens kunnen kijken wat de waarde van MagHeading is.

  9. #39
    Code:
     for I := 0 to High(Sensors) do
      begin
        //deze zou voor de TiltX zijn
        //if TCustomOrientationSensor.TProperty.TiltX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
        //  Found := I;
    
       if TCustomOrientationSensor.TProperty.HeadingX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
          Found := I;
      end;
    SensorType = 2
    HeadingX = 0
    TiltX = NAN
    MagHeading = NAN

    ----------------------
    Code:
     for I := 0 to High(Sensors) do
      begin
        //deze zou voor de TiltX zijn
        if TCustomOrientationSensor.TProperty.TiltX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
          Found := I;
    
      // if TCustomOrientationSensor.TProperty.HeadingX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
      //    Found := I;
      end;
    SensorType = 5
    HeadingX = NAN
    TiltX = 0
    MagHeading = NAN

    ----------------------
    Code:
     for I := 0 to High(Sensors) do
      begin
        //deze zou voor de TiltX zijn
        if TCustomOrientationSensor.TProperty.TiltX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
          Found := I;
    
       if TCustomOrientationSensor.TProperty.HeadingX in TCustomOrientationSensor(Sensors[I]).AvailableProperties then
          Found := I;
      end;
    SensorType = 5
    HeadingX = NAN
    TiltX = 0
    MagHeading = NAN

    -------------------------------------------------------------------------------

    De melding 'Compass not available' heb ik Geen enkele keer gezien.

    Deze code heeft er dus invloed op, maar ik krijg of NAN of de waarde 0, dus nog steeds geen bruikbare data

  10. #40
    Volgende poging:
    Delphi Code:
    1. procedure TForm1.OrientationSensor1Choosing(Sender: TObject; const Sensors: TSensorArray; var ChoseSensorIndex: Integer);
    2. var
    3.   I : integer;
    4. begin
    5.   for I := 0 to Length(Sensors) - 1 do
    6.     if (Sensors[I] as TCustomOrientationSensor).SensorType = TOrientationSensorType.Compass3D then
    7.     begin
    8.       ChoseSensorIndex := I;
    9.       Break;
    10.   end;
    11. end;

    OrientationSensor1.Active := True;
    // wat geeft OrientationSensor1.Sensor.CompMagHeading;

  11. #41
    Code:
    procedure TForm1.OrientationSensor1SensorChoosing(Sender: TObject;
      const Sensors: TSensorArray; var ChoseSensorIndex: Integer);
    //procedure TForm1.OrientationSensor1Choosing(Sender: TObject;
    //  const Sensors: TSensorArray; var ChoseSensorIndex: Integer);
    var
     I : integer;
    begin
      for I := 0 to Length(Sensors) - 1 do
       if (Sensors[I] as TCustomOrientationSensor).SensorType = TOrientationSensorType.Compass3D then
        begin
         ChoseSensorIndex := I;
         Break;
      end;
    end;
    Ik denk dat "OrientationSensor1Choosing" moet zijn "OrientationSensor1SensorChoosing", want de eerste geeft een foutmelding.
    Dit even voor de zekerheid voordat ik iets anders doe dan je bedoeld.

    Code:
    OrientationSensor1.Active := True; 
    Label1.Text := FloatToStr( OrientationSensor1.Sensor.CompMagHeading );
    Dit geeft NAN, ook nadat ik de GSM in alle richtingen bewogen heb.

  12. #42
    Ja, het moet OrientationSensor1SensorChoosing zijn.
    Niet vergeten dit als Event aan de OrientationSensor1 te hangen !!!

    De OnSensorChoosing event wordt uitgevoerd om de juiste sensor in de OrientationSensor1 te kiezen.

    Ik begrijp niet waarom je NAN zou krijgen. Ik neem aan dat je wel een compass in je toestel hebt zitten.

    Misschien zou je eens wat code kunnen gebruiken op
    https://theroadtodelphi.com/2012/09/...monkey-part-1/

    Maar je werkt op een Android, toch?

    Je zou dit eens kunnen proberen...
    (maar dan i.p.v. een WriteLn() de tekst in een Memo1.Lines.Add() stoppen)
    Delphi Code:
    1. var
    2.   LManager : TSensorManager;
    3.   LSensors : TSensorArray;
    4.   LSensor  : TCustomSensor;
    5.   LLocationSensor          : TCustomLocationSensor;
    6. begin
    7.   LManager := TSensorManager.Current;
    8.   LManager.Activate;
    9.   try
    10.     LSensors  := LManager.GetSensorsByCategory(TSensorCategory.Location);
    11.     for LSensor in LSensors do
    12.     begin
    13.       Writeln(Format('Description  : %s', [LSensor.Description]));
    14.       Writeln(Format('Manufacturer : %s', [LSensor.Manufacturer]));
    15.       Writeln(Format('Model        : %s', [LSensor.Model]));
    16.       Writeln(Format('Serial No    : %s', [LSensor.SerialNo]));
    17.       Writeln(Format('State        : %s', [GetEnumName(TypeInfo(TSensorState),integer(LSensor.State))]));
    18.       Writeln(Format('TimeStamp    : %s', [DatetoStr(LSensor.TimeStamp)]));
    19.       Writeln(Format('Unique ID    : %s', [LSensor.UniqueID]));
    20.  
    21.         LLocationSensor:=LSensor as TCustomLocationSensor;
    22.         LLocationSensor.Start;
    23.         try
    24.           Writeln(Format('Sensor Type       : %s', [GetEnumName(TypeInfo(TLocationSensorType),integer(LLocationSensor.SensorType))]));
    25.           Writeln(Format('Authorized        : %s', [GetEnumName(TypeInfo(TAuthorizationType),integer(LLocationSensor.Authorized))]));
    26.           Writeln(Format('Accuracy          : %n', [LLocationSensor.Accuracy]));
    27.           Writeln(Format('Distance          : %n', [LLocationSensor.Distance]));
    28.           Writeln(Format('Power Consumption : %s', [GetEnumName(TypeInfo(TPowerConsumption),integer(LLocationSensor.PowerConsumption))]));
    29.           Writeln(Format('Location Change   : %s', [GetEnumName(TypeInfo(TLocationChangeType),integer(LLocationSensor.LocationChange))]));
    30.           if TCustomLocationSensor.TProperty.Latitude in  LLocationSensor.AvailableProperties then
    31.           Writeln(Format('Latitude          : %n', [LLocationSensor.Latitude]));
    32.           if TCustomLocationSensor.TProperty.Longitude in  LLocationSensor.AvailableProperties then
    33.           Writeln(Format('Longitude         : %n', [LLocationSensor.Longitude]));
    34.           if TCustomLocationSensor.TProperty.ErrorRadius in  LLocationSensor.AvailableProperties then
    35.           Writeln(Format('Error Radius      : %n', [LLocationSensor.ErrorRadius]));
    36.           if TCustomLocationSensor.TProperty.Altitude in  LLocationSensor.AvailableProperties then
    37.           Writeln(Format('Altitude          : %n', [LLocationSensor.Altitude]));
    38.           if TCustomLocationSensor.TProperty.Speed in  LLocationSensor.AvailableProperties then
    39.           Writeln(Format('Speed             : %n', [LLocationSensor.Speed]));
    40.           if TCustomLocationSensor.TProperty.TrueHeading in  LLocationSensor.AvailableProperties then
    41.           Writeln(Format('True Heading      : %n', [LLocationSensor.TrueHeading]));
    42.           if TCustomLocationSensor.TProperty.MagneticHeading in  LLocationSensor.AvailableProperties then
    43.           Writeln(Format('Magnetic Heading  : %n', [LLocationSensor.MagneticHeading]));
    44.           if TCustomLocationSensor.TProperty.Address1 in  LLocationSensor.AvailableProperties then
    45.           Writeln(Format('Address1          : %s', [LLocationSensor.Address1]));
    46.           if TCustomLocationSensor.TProperty.Address2 in  LLocationSensor.AvailableProperties then
    47.           Writeln(Format('Address2          : %s', [LLocationSensor.Address2]));
    48.           if TCustomLocationSensor.TProperty.City in  LLocationSensor.AvailableProperties then
    49.           Writeln(Format('City              : %s', [LLocationSensor.City]));
    50.           if TCustomLocationSensor.TProperty.StateProvince in  LLocationSensor.AvailableProperties then
    51.           Writeln(Format('State/Province    : %s', [LLocationSensor.StateProvince]));
    52.           if TCustomLocationSensor.TProperty.PostalCode in  LLocationSensor.AvailableProperties then
    53.           Writeln(Format('Postal Code       : %s', [LLocationSensor.PostalCode]));
    54.           if TCustomLocationSensor.TProperty.CountryRegion in  LLocationSensor.AvailableProperties then
    55.           Writeln(Format('Country Region    : %s', [LLocationSensor.CountryRegion]));
    56.         finally
    57.           LLocationSensor.Stop;
    58.         end;
    59.         Writeln;
    60.     end;
    61.   finally
    62.     LManager.Deactivate;
    63.   end;
    64.  
    65. end;

  13. #43
    Niet vergeten dit als Event aan de OrientationSensor1 te hangen !!!
    Deze is vanaf het begin al gekoppeld als een Events.Click image for larger version. 

Name:	Event.jpg 
Views:	144 
Size:	72.2 KB 
ID:	7365

    Ik neem aan dat je wel een compass in je toestel hebt zitten
    Als ik een orginele Compass App installeer dan werkt die App wel.
    Het is een Samsung Galaxy S2, GT-I8260

    Tevens heb ik een Samsung Galaxy S4, GT-I9505, maar daar werkt het ook niet op.
    Op deze S4 werkt een orginele Compass App ook niet, dus deze heeft blijkbaar ook geen OrientationSensor.
    Maar op de S2 zou het toch moeten werken ?

    Maar je werkt op een Android, toch?
    Klopt

    Je zou dit eens kunnen proberen...
    Dat geeft dit:

    Click image for larger version. 

Name:	Screenshot_2016-09-20-18-39-43.png 
Views:	142 
Size:	77.3 KB 
ID:	7366
    Last edited by MMSoft; 20-Sep-16 at 20:05.

  14. #44
    Geeft ie maar één sensor resultaat? Hij zou er veel meer moeten geven waaronder een compass.

    Je kunt niet naar beneden scrollen in die memo?

  15. #45
    Nee, er staat niet meer in de Memo.

    Hierbij de volledige code:
    Code:
    unit Unit1;
    
    interface
    
    uses
      System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
      FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Sensors,
      System.Sensors.Components, FMX.StdCtrls, FMX.Controls.Presentation,
      FMX.ScrollBox, FMX.Memo; //, TypInfo;
    
    
     //-------------------------
     type
      TOrientationSensorAccessor = class(TCustomOrientationSensor);
      TLocationSensorAccessor = class(TCustomLocationSensor);
     //-------------------------
    
    
    type
      TForm1 = class(TForm)
        OrientationSensor1: TOrientationSensor;
        Button1: TButton;
        Memo1: TMemo;
        LocationSensor1: TLocationSensor;
        MotionSensor1: TMotionSensor;
        procedure FormActivate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure OrientationSensor1SensorChoosing(Sender: TObject;
          const Sensors: TSensorArray; var ChoseSensorIndex: Integer);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    //----------------
    uses
      TypInfo;
    //----------------
    
    {$R *.fmx}
    
    procedure TForm1.FormActivate(Sender: TObject);
    begin
     LocationSensor1.Active := True;
     OrientationSensor1.Active := True;
     MotionSensor1.Active := True;
    end;
    
    
    procedure TForm1.OrientationSensor1SensorChoosing(Sender: TObject;
      const Sensors: TSensorArray; var ChoseSensorIndex: Integer);
    var
     I : integer;
    begin
      for I := 0 to Length(Sensors) - 1 do
       if (Sensors[I] as TCustomOrientationSensor).SensorType = TOrientationSensorType.Compass3D then
        begin
         ChoseSensorIndex := I;
         Break;
      end;
    end;
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
     LManager : TSensorManager;
     LSensors : TSensorArray;
     LSensor  : TCustomSensor;
     LLocationSensor : TCustomLocationSensor;
    
    begin
     LManager := TSensorManager.Current;
     LManager.Activate;
    
      try
    
        LSensors  := LManager.GetSensorsByCategory(TSensorCategory.Location);
        for LSensor in LSensors do
    
        begin
          Memo1.Lines.Add( Format('Description  : %s', [LSensor.Description])) ;
          Memo1.Lines.Add( Format('Manufacturer : %s', [LSensor.Manufacturer]));
          Memo1.Lines.Add( Format('Model        : %s', [LSensor.Model]));
          Memo1.Lines.Add( Format('Serial No    : %s', [LSensor.SerialNo]));
          Memo1.Lines.Add( Format('State        : %s', [GetEnumName(TypeInfo(TSensorState),integer(LSensor.State))]));
          Memo1.Lines.Add( Format('TimeStamp    : %s', [DatetoStr(LSensor.TimeStamp)]));
          Memo1.Lines.Add( Format('Unique ID    : %s', [LSensor.UniqueID]));
    
          LLocationSensor:=LSensor as TCustomLocationSensor;
          LLocationSensor.Start;
    
            try
              Memo1.Lines.Add( Format('Sensor Type       : %s', [GetEnumName(TypeInfo(TLocationSensorType),integer(LLocationSensor.SensorType))]));
              Memo1.Lines.Add( Format('Authorized        : %s', [GetEnumName(TypeInfo(TAuthorizationType),integer(LLocationSensor.Authorized))]));
              Memo1.Lines.Add( Format('Accuracy          : %n', [LLocationSensor.Accuracy]));
              Memo1.Lines.Add( Format('Distance          : %n', [LLocationSensor.Distance]));
              Memo1.Lines.Add( Format('Power Consumption : %s', [GetEnumName(TypeInfo(TPowerConsumption),integer(LLocationSensor.PowerConsumption))]));
              Memo1.Lines.Add( Format('Location Change   : %s', [GetEnumName(TypeInfo(TLocationChangeType),integer(LLocationSensor.LocationChange))]));
    
              if TCustomLocationSensor.TProperty.Latitude in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Latitude          : %n', [LLocationSensor.Latitude]));
    
              if TCustomLocationSensor.TProperty.Longitude in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Longitude         : %n', [LLocationSensor.Longitude]));
    
              if TCustomLocationSensor.TProperty.ErrorRadius in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Error Radius      : %n', [LLocationSensor.ErrorRadius]));
    
              if TCustomLocationSensor.TProperty.Altitude in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Altitude          : %n', [LLocationSensor.Altitude]));
    
              if TCustomLocationSensor.TProperty.Speed in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Speed             : %n', [LLocationSensor.Speed]));
    
              if TCustomLocationSensor.TProperty.TrueHeading in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('True Heading      : %n', [LLocationSensor.TrueHeading]));
    
              if TCustomLocationSensor.TProperty.MagneticHeading in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Magnetic Heading  : %n', [LLocationSensor.MagneticHeading]));
    
              if TCustomLocationSensor.TProperty.Address1 in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Address1          : %s', [LLocationSensor.Address1]));
    
              if TCustomLocationSensor.TProperty.Address2 in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Address2          : %s', [LLocationSensor.Address2]));
    
              if TCustomLocationSensor.TProperty.City in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('City              : %s', [LLocationSensor.City]));
    
              if TCustomLocationSensor.TProperty.StateProvince in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('State/Province    : %s', [LLocationSensor.StateProvince]));
    
              if TCustomLocationSensor.TProperty.PostalCode in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Postal Code       : %s', [LLocationSensor.PostalCode]));
    
              if TCustomLocationSensor.TProperty.CountryRegion in  LLocationSensor.AvailableProperties then
              Memo1.Lines.Add( Format('Country Region    : %s', [LLocationSensor.CountryRegion]));
    
            finally
    
              LLocationSensor.Stop;
    
            end;
    
            Memo1.Lines.Add( ' ' );
    
        end;
    
      finally
        LManager.Deactivate;
      end;
    
    end;
    
    end.

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •