Calculation of two point distance from location sensor

Calculation of two point distance from location sensor.

Unit of result value is a km.

function TForm1.CalcDistance( lon1, lat1,  lon2, lat2 : single ) : single;
var
   theta, dist : double;  

begin
   theta := lon1 - lon2;
   dist := sin( degTorad(lat1)) * sin(degTorad(lat2)) + cos(degTorad(lat1)) * cos(degTorad(lat2)) * cos(degTorad(theta));
   dist := arccos(dist);
   dist := radTodeg(dist);
   dist := dist * 60 * 1.1515;
   dist := dist * 1.609344;
   result := dist;
end;

Long Touch event generation method for Delphi XE5~XE7 Firemonkey On Android, iOS, OSX, And Windows

OnMouseClick event is used for Short Touch event in Button or ListBox, etc.
Delphi in FireMonkey do not provide a Long touch event separately.
Android or iOS smart device determines a long Touch time about 0.7 to 1.0 seconds normally .
Thus, Long Touch can be determined by measuring the count timer 0.1 seconds while pressing the button or any other objects.


Button이나 ListBox등에 사용되는 OnMouseClick 이벤트는 터치 단말기에서 숏터치에 사용 된다.
Delphi FireMonkey에서는 별도의 롱터치 이벤트를 제공하지 않는다.
따라서 롱터치 이벤트를 적용하기 위해서는 OnMouseDown 이벤트 싯점에 타이머를 가동하여 일정 시간이 흐른 후 롱터치로 판단하여 처리 할 수 있다.
안드로이드 또는 iOS 스마트 단말기는 보통 0.7~1.0 초 정도의 시간동안 사용자가 버튼을 누르고 있으면 롱터치로 판단한다.
따라서 버튼을 누르고 있는동안 0.1초 간격으로 타이머를 발생시켜 그 횟수를 측정하면 된다.


[Method]

1. OnMouseDown : Timer Start
2. OnMouseUp : Count Timer ~ Short Touch Event
3. OnTimer : Increase Timer Count ~ Long Touch Event

[Example source code]

1. Timer Initialize

  • Enable : False
  • Interval : 100 (msec)

2. Global variable declaration

var
  ClickInterval : Cardinal = 0;
const
   LONG_TIME = 8;  // Long Touch Time : 0.8 sec

3. Event Handlers work

procedure TForm1.ListBoxItem1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
   ClickInterval := 0;
   Timer1.Enabled := TRUE;
end;

//**********************************************************************************
// Short Touch
procedure TForm1.ListBoxItem1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
   if ClickInterval < LONG_TIME then
   begin
      Timer1.Enabled := FALSE;
      ClickInterval := 0;
      ShowMessage( 'ListBox Shot Touch..!!');
    end;
end;

//***************************************************************************************
// Long Touch
// Called once every 0.1 seconds ->  When the 8th call is a Long touch
procedure TForm1.Timer1Timer(Sender: TObject);
begin
   ClickInterval := ClickInterval + 1;

   if ( ClickInterval = LONG_TIME ) then
   begin
      Timer1.Enabled := FALSE;
      ShowMessage( 'ListBox Long Touch..!!');
   end;
end;

Full Source Download (Delphi XE7)


Scientific Calculator Mu can transfer result data to PC or Mac.

SCalc Mu (ver 2.0.0) can transfer result data to PC or Mac.

Click here to see about main feature.


Scientific Calculator Mu can transfer result data immediately to Windows PC or MAC OS X clipboard for using Excel or CAD software etc. (use paste:Ctrl+V)
The connection between the two devices use the network protocol, so two device must be in the same network area or PC(or Mac) should have a public IP Address.
(Connection to IP Address on port 55533)
On a PC or Mac, run the 'SCalc Mu Receiver' application.
The transmitted data is all stored in the 'SCalc Mu Receiver' and you can export to CSV file.

새로운 버전의 Scientific Calculator Mu는 계산된 결과값을 Windows PC 또는 MAC OS X 의 클립보드로 바로 전송하여 Excel이나 CAD 프로그램등에서 붙여넣기(Ctrl+V) 하여 사용할 수 있습니다.
두 디바이스간의 연결 방법은 네트워크 프로토콜 방식이므로 단말기와 PC가 같은 네트워크 클래스에 존재하거나 PC 또는 Mac이 real IP Address를 사용하고 있으면 됩니다.
PC 나 Mac에서는 'SCalc Mu Receiver' 어플리케이션을  실행 시켜 놓기만 하면 됩니다.
전송된 값은 'SCalc Mu Receiver' 에 모두 저장되어 CSV 파일로 Export도 가능 합니다.






Windows Application

Mac OS X Application


Edit Connection


Transfer result data 






Korea Weather Forecast by GPS location.






♦ 현위치 GPS좌표추적 정확한 날씨예보 및 현재날씨
♦ 3시간 간격 3일예보
♦ 읍면동단위 지역선택
♦ 레져,여행 매니아를 위한 특수지역 날씨정보
♦ 날씨 화면 공유 기능 (카톡 및 각종 SNS )
♦ 특정지역 및 현재위치 북마크 기능.
♦ 3시간단위 온도,습도,풍속,비올확율,강우량 정보제공
♦ 시인성 높은 깔끔한 디자인

Roulette 3D Game: Android and iOS App.

This App is a Roulette 3D game.
Roulette rotation and arrow flying  play in the FireMonkey 3D environment.






The laws of physics apply to the flight of the arrow





Android App Store
https://play.google.com/store/apps/details?id=com.c2design.Roulette3D

iOS App Store
https://itunes.apple.com/th/app/roulette-3d-rotation/id888577718?mt=8