Permalink
Browse files

Initial checkin to the public repository.

  • Loading branch information...
Sanjay Saxena
Sanjay Saxena committed Feb 20, 2017
1 parent 986c973 commit 9fc886ba35bb9b450ad88a5279f55df2e185f901
Showing with 13,738 additions and 0 deletions.
  1. +33 −0 .gitignore
  2. +6 −0 .travis.yml
  3. +71 −0 ARFlightTracker-iOS-Swift/.gitignore
  4. +962 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift.xcodeproj/project.pbxproj
  5. +10 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift.xcworkspace/contents.xcworkspacedata
  6. +18 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARFlightAnnotation.swift
  7. +94 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARFlightAnnotationCustom.swift
  8. +61 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARFlightAnnotationView.swift
  9. +82 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARFlightConfiguration.swift
  10. +238 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARFlightViewController.swift
  11. +317 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARFlightViewController_v1.swift
  12. +11 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/ARKit.h
  13. +54 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/ARKitConfig.h
  14. +42 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/ARKitConfig.m
  15. +91 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/ARKitEngine.h
  16. +574 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/ARKitEngine.m
  17. +19 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/ARViewDelegate.h
  18. +18 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/LocalizationDelegate.h
  19. +39 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/LocalizationHelper.h
  20. +138 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/LocalizationHelper.m
  21. +32 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/Model/ARGeoCoordinate.h
  22. +87 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/Model/ARGeoCoordinate.m
  23. +18 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/View/ARObjectView.h
  24. +41 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/View/ARObjectView.m
  25. +25 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/View/RadarView.h
  26. +60 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARKit/View/RadarView.m
  27. +411 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARTrackingManager.swift
  28. +133 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ARViewHelper.swift
  29. +46 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/AppDelegate.swift
  30. +93 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json
  31. +58 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/Base.lproj/Main.storyboard
  32. +49 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/FlightAnnotation.swift
  33. +85 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/FlightBubble.swift
  34. +21 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/FlightCalloutView.swift
  35. +70 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/FlightCalloutView.xib
  36. +61 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/FlightInfo.swift
  37. +293 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/FlightMapViewController.swift
  38. +17 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/IBMFlightTracker-Bridging-Header.h
  39. +53 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/Info.plist
  40. +41 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/MQTTConnection.swift
  41. +26 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/MarkerView.h
  42. +83 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/MarkerView.m
  43. +43 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/TestFlights.json
  44. +206 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/ViewController.swift
  45. BIN ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/box.png
  46. BIN ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/bubble.png
  47. BIN ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/plane.png
  48. BIN ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/radar.png
  49. BIN ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-Swift/radar_dot.png
  50. +36 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-SwiftTests/IBMFlightTrackerTests.swift
  51. +24 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-SwiftTests/Info.plist
  52. +36 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-SwiftUITests/IBMFlightTrackerUITests.swift
  53. +22 −0 ARFlightTracker-iOS-Swift/ARFlightTracker-iOS-SwiftUITests/Info.plist
  54. +21 −0 ARFlightTracker-iOS-Swift/LICENSE
  55. +23 −0 ARFlightTracker-iOS-Swift/Podfile
  56. +34 −0 ARFlightTracker-iOS-Swift/README.md
  57. +46 −0 adsb.ground.station/Dockerfile
  58. +307 −0 adsb.ground.station/README.md
  59. BIN adsb.ground.station/images/rpi_sdr_config.jpg
  60. +127 −0 adsb.ground.station/pom.xml
  61. +1 −0 adsb.ground.station/src/main/assembly/filter.properties
  62. +21 −0 adsb.ground.station/src/main/assembly/sources.xml
  63. +406 −0 adsb.ground.station/src/main/java/com/ibm/iot/adsb/ground/station/AdsbClient.java
  64. +243 −0 adsb.ground.station/src/main/java/com/ibm/iot/adsb/ground/station/Flight.java
  65. +107 −0 adsb.ground.station/src/main/java/com/ibm/iot/adsb/ground/station/IotClient.java
  66. +11 −0 adsb.ground.station/src/main/resources/application.properties
  67. +9 −0 adsb.ground.station/src/main/resources/log4j.properties
  68. +7,267 −0 adsb.ground.station/src/main/resources/sdr_1090_data.txt
  69. +38 −0 adsb.ground.station/src/test/java/com/ibm/iot/adsb/ground/station/AppTest.java
  70. +29 −0 pom.xml
View
@@ -0,0 +1,33 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
*~
target
GTAGS
GRTAGS
GPATH
prop
out
.DS_Store
.idea
*.iml
.project
.classpath
.settings
*.sublime-project
*.sublime-workspace
build-local.properties
.gradle
.checkstyle
dependency-reduced-pom.xml
View
@@ -0,0 +1,6 @@
language: Java
jdk:
- oraclejdk8
install: mvn -Pbootstrap verify
script: mvn verify
@@ -0,0 +1,71 @@
# Xcode artifacts
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xcuserstate
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
#node modules
node_modules/
Podfile.lock
.DS_Store

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,18 @@
//
// ARFlightAnnotation.swift
// IBMFlightTracker
//
// Created by Sanjeev Ghimire on 12/5/16.
// Copyright © 2016 Sanjeev Ghimire. All rights reserved.
//
import Foundation
import UIKit
import MapKit
import CoreLocation
/// Defines POI with title and location.
open class ARFlightAnnotation
{
}
@@ -0,0 +1,94 @@
//
// ARFlightAnnotationCustom.swift
// IBMFlightTracker
//
// Created by Sanjeev Ghimire on 12/6/16.
// Copyright © 2016 Sanjeev Ghimire. All rights reserved.
//
import Foundation
import UIKit
open class ARFlightAnnotationViewCustom: ARFlightAnnotationView, UIGestureRecognizerDelegate
{
open var titleLabel: UILabel?
open var infoButton: UIButton?
override open func didMoveToSuperview()
{
super.didMoveToSuperview()
if self.titleLabel == nil
{
self.loadUi()
}
}
func loadUi()
{
// Title label
self.titleLabel?.removeFromSuperview()
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 10)
label.numberOfLines = 0
label.backgroundColor = UIColor.clear
label.textColor = UIColor.white
self.addSubview(label)
self.titleLabel = label
// Info button
self.infoButton?.removeFromSuperview()
let button = UIButton(type: UIButtonType.detailDisclosure)
button.isUserInteractionEnabled = false // Whole view will be tappable, using it for appearance
self.addSubview(button)
self.infoButton = button
// Gesture
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(ARFlightAnnotationViewCustom.tapGesture))
self.addGestureRecognizer(tapGesture)
// Other
self.backgroundColor = UIColor.black.withAlphaComponent(0.5)
self.layer.cornerRadius = 5
if self.annotation != nil
{
self.bindUi()
}
}
func layoutUi()
{
let buttonWidth: CGFloat = 40
let buttonHeight: CGFloat = 40
self.titleLabel?.frame = CGRect(x: 10, y: 0, width: self.frame.size.width - buttonWidth - 5, height: self.frame.size.height);
self.infoButton?.frame = CGRect(x: self.frame.size.width - buttonWidth, y: self.frame.size.height/2 - buttonHeight/2, width: buttonWidth, height: buttonHeight);
}
// This method is called whenever distance/azimuth is set
override open func bindUi()
{
if let annotation = self.annotation, let title = annotation.title
{
let distance = annotation.distanceFromUser > 1000 ? String(format: "%.1fkm", annotation.distanceFromUser / 1000) : String(format:"%.0fm", annotation.distanceFromUser)
self.titleLabel?.text = String(format: "%@\nAZ: %.0f°\nDST: %@", title, annotation.azimuth, distance)
}
}
open override func layoutSubviews()
{
super.layoutSubviews()
self.layoutUi()
}
open func tapGesture()
{
if let annotation = self.annotation
{
let alertView = UIAlertView(title: annotation.title, message: "Tapped", delegate: nil, cancelButtonTitle: "OK")
alertView.show()
}
}
}
@@ -0,0 +1,61 @@
//
// ARFlightAnnotationView.swift
// IBMFlightTracker
//
// Created by Sanjeev Ghimire on 12/5/16.
// Copyright © 2016 Sanjeev Ghimire. All rights reserved.
//
import Foundation
import UIKit
open class ARFlightAnnotationView: UIView
{
open weak var annotation: FlightAnnotation?
fileprivate var initialized: Bool = false
public init()
{
super.init(frame: CGRect.zero)
self.initializeInternal()
}
public required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
self.initializeInternal()
}
override init(frame: CGRect)
{
super.init(frame: frame)
self.initializeInternal()
}
fileprivate func initializeInternal()
{
if self.initialized
{
return
}
self.initialized = true;
self.initialize()
}
open override func awakeFromNib()
{
self.bindUi()
}
/// Will always be called once, no need to call super
open func initialize()
{
}
/// Called when distance/azimuth changes, intended to be used in subclasses
open func bindUi()
{
}
}
@@ -0,0 +1,82 @@
//
// ARFlightConfiguration.swift
// IBMFlightTracker
//
// Created by Sanjeev Ghimire on 12/5/16.
// Copyright © 2016 Sanjeev Ghimire. All rights reserved.
//
import Foundation
import CoreLocation
import UIKit
let LAT_LON_FACTOR: CGFloat = 1.33975031663 // Used in azimuzh calculation, don't change
//let LAT_LON_FACTOR: CGFloat = 1 // Used in azimuzh calculation, don't change
let VERTICAL_SENS: CGFloat = 960
let H_PIXELS_PER_DEGREE: CGFloat = 14 // How many pixels per degree
//let H_PIXELS_PER_DEGREE: CGFloat = 1 // How many pixels per degree
let OVERLAY_VIEW_WIDTH: CGFloat = 360 * H_PIXELS_PER_DEGREE // 360 degrees x sensitivity
let MAX_VISIBLE_ANNOTATIONS: Int = 500 // Do not change, can affect performance
let MAX_VERTICAL_LEVELS: Double = 10 // Do not change, can affect performance
internal func radiansToDegrees(_ radians: Double) -> Double
{
return (radians) * (180.0 / M_PI)
}
internal func degreesToRadians(_ degrees: Double) -> Double
{
return (degrees) * (M_PI / 180.0)
}
/// Normalizes degree to 360
internal func normalizeDegree(_ degree: Double) -> Double
{
var degreeNormalized = fmod(degree, 360)
if degreeNormalized < 0
{
degreeNormalized = 360 + degreeNormalized
}
return degreeNormalized
}
/// Finds shortes angle distance between two angles. Angles must be normalized(0-360)
internal func deltaAngle(_ angle1: Double, angle2: Double) -> Double
{
var deltaAngle = angle1 - angle2
if deltaAngle > 180
{
deltaAngle -= 360
}
else if deltaAngle < -180
{
deltaAngle += 360
}
return deltaAngle
}
///// DataSource provides the ARFlightViewController with the information needed to display annotations.
//@objc public protocol ARDataSource : NSObjectProtocol
//{
// /// Asks the data source to provide annotation view for annotation. Annotation view must be subclass of ARFlightAnnotationView.
// func ar(_ arViewController: ARFlightViewController, viewForAnnotation: FlightAnnotation) -> ARFlightAnnotationView
//
// /**
// * READ BEFORE IMPLEMENTING
// * ARFlightViewController tracks user movement and shows/hides annotations accordingly. But if there is huge amount
// * of annotations or for some other reason annotations cannot be set all at once, this method can be used to
// * set annotations part by part.
// *
// * Use ARFlightViewController.trackingManager.reloadDistanceFilter to change how often this is called.
// *
// * - parameter arViewController: ARFlightViewController instance
// * - parameter location: Current location of the user
// * - returns: Annotations to load, previous annotations are removed
// */
// @objc optional func ar(_ arViewController: ARFlightViewController, shouldReloadWithLocation location: CLLocation) -> [FlightAnnotation]
//
//}
Oops, something went wrong.

0 comments on commit 9fc886b

Please sign in to comment.