mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Additional swift lint fixes
This commit is contained in:
parent
51929b3a35
commit
82a8336e35
6 changed files with 15 additions and 22 deletions
|
|
@ -116,8 +116,6 @@ func positionToCsvFile(positions: [PositionEntity]) -> String {
|
|||
|
||||
func routeToCsvFile(locations: [LocationEntity]) -> String {
|
||||
var csvString: String = ""
|
||||
let localeDateFormat = DateFormatter.dateFormat(fromTemplate: "yyMMddjmma", options: 0, locale: Locale.current)
|
||||
let dateFormatString = (localeDateFormat ?? "MM/dd/YY j:mma").replacingOccurrences(of: ",", with: "")
|
||||
// Create Position Header
|
||||
csvString = "Id, Latitude, Longitude, Altitude, Speed, Heading"
|
||||
for loc in locations {
|
||||
|
|
|
|||
|
|
@ -729,20 +729,19 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
}
|
||||
case .neighborinfoApp:
|
||||
if let neighborInfo = try? NeighborInfo(serializedData: decodedInfo.packet.decoded.payload) {
|
||||
MeshLogger.log("🕸️ MESH PACKET received for Neighbor Info App UNHANDLED")
|
||||
// MeshLogger.log("🕸️ MESH PACKET received for Neighbor Info App UNHANDLED \(neighborInfo)")
|
||||
// MeshLogger.log("🕸️ MESH PACKET received for Neighbor Info App UNHANDLED")
|
||||
MeshLogger.log("🕸️ MESH PACKET received for Neighbor Info App UNHANDLED \(neighborInfo)")
|
||||
}
|
||||
case .paxcounterApp:
|
||||
paxCounterPacket(packet: decodedInfo.packet, context: context!)
|
||||
case .mapReportApp:
|
||||
MeshLogger.log("🕸️ MESH PACKET received for Map Report App UNHANDLED\(try! decodedInfo.packet.jsonString())")
|
||||
MeshLogger.log("🕸️ MESH PACKET received Map Report App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
|
||||
case .UNRECOGNIZED:
|
||||
MeshLogger.log("🕸️ MESH PACKET received for Other App UNHANDLED \(try! decodedInfo.packet.jsonString())")
|
||||
MeshLogger.log("🕸️ MESH PACKET received UNRECOGNIZED App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
|
||||
case .max:
|
||||
logger.info("MAX PORT NUM OF 511")
|
||||
case .atakPlugin:
|
||||
MeshLogger.log("🕸️ MESH PACKET received for ATAK Plugin App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
|
||||
|
||||
}
|
||||
|
||||
if decodedInfo.configCompleteID != 0 && decodedInfo.configCompleteID == configNonce {
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ func adminAppPacket (packet: MeshPacket, context: NSManagedObjectContext) {
|
|||
let ringtone = adminMessage.getRingtoneResponse
|
||||
upsertRtttlConfigPacket(ringtone: ringtone, nodeNum: Int64(packet.from), context: context)
|
||||
} else {
|
||||
MeshLogger.log("🕸️ MESH PACKET received for Admin App \(try! packet.decoded.jsonString())")
|
||||
MeshLogger.log("🕸️ MESH PACKET received Admin App UNHANDLED \((try? packet.decoded.jsonString()) ?? "JSON Decode Failure")")
|
||||
}
|
||||
// Save an ack for the admin message log for each admin message response received as we stopped sending acks if there is also a response to reduce airtime.
|
||||
adminResponseAck(packet: packet, context: context)
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ struct ChannelList: View {
|
|||
|
||||
} catch {
|
||||
context.rollback()
|
||||
print("💥 Save Channel Mute Error")
|
||||
logger.error("💥 Save Channel Mute Error")
|
||||
}
|
||||
} label: {
|
||||
Label(channel.mute ? "Show Alerts" : "Hide Alerts", systemImage: channel.mute ? "bell" : "bell.slash")
|
||||
|
|
|
|||
|
|
@ -109,25 +109,25 @@ struct MeshMap: View {
|
|||
//
|
||||
// if ((newPath?.hasPrefix("meshtastic://open-waypoint")) != nil) {
|
||||
// guard let url = URL(string: appState.navigationPath ?? "NONE") else {
|
||||
// print("Invalid URL")
|
||||
// logger.error("Invalid URL")
|
||||
// return
|
||||
// }
|
||||
// guard let components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
|
||||
// print("Invalid URL Components")
|
||||
// logger.error("Invalid URL Components")
|
||||
// return
|
||||
// }
|
||||
// guard let action = components.host, action == "open-waypoint" else {
|
||||
// print("Unknown waypoint URL action")
|
||||
// logger.error("Unknown waypoint URL action")
|
||||
// return
|
||||
// }
|
||||
// guard let waypointId = components.queryItems?.first(where: { $0.name == "id" })?.value else {
|
||||
// print("Waypoint id not found")
|
||||
// logger.error("Waypoint id not found")
|
||||
// return
|
||||
// }
|
||||
// guard let waypoint = waypoints.first(where: { $0.id == Int64(waypointId) }) else {
|
||||
// logger.error("Waypoint not found")
|
||||
// return
|
||||
// }
|
||||
//// guard let waypoint = waypoints.first(where: { $0.id == Int64(waypointId) }) else {
|
||||
//// print("Waypoint not found")
|
||||
//// return
|
||||
//// }
|
||||
// //showWaypoints = true
|
||||
// //position = .camera(MapCamera(centerCoordinate: waypoint.coordinate, distance: 1000, heading: 0, pitch: 60))
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -64,10 +64,6 @@ struct TraceRouteLog: View {
|
|||
.font(.title2)
|
||||
}
|
||||
|
||||
let hopsArray = selectedRoute?.hops?.array as? [TraceRouteHopEntity] ?? []
|
||||
let lineCoords = hopsArray.compactMap({(hop) -> CLLocationCoordinate2D in
|
||||
return hop.coordinate ?? LocationHelper.DefaultLocation
|
||||
})
|
||||
if selectedRoute?.response ?? false {
|
||||
if selectedRoute?.hasPositions ?? false {
|
||||
Map(position: $position, bounds: MapCameraBounds(minimumDistance: 1, maximumDistance: .infinity), scope: mapScope) {
|
||||
|
|
@ -83,7 +79,7 @@ struct TraceRouteLog: View {
|
|||
// Direct Trace Route
|
||||
if selectedRoute?.response ?? false && selectedRoute?.hops?.count ?? 0 == 0 {
|
||||
if selectedRoute?.node?.positions?.count ?? 0 > 0, let mostRecent = selectedRoute?.node?.positions?.lastObject as? PositionEntity {
|
||||
var traceRouteCoords: [CLLocationCoordinate2D] = [selectedRoute?.coordinate ?? LocationsHandler.DefaultLocation, mostRecent.coordinate]
|
||||
let traceRouteCoords: [CLLocationCoordinate2D] = [selectedRoute?.coordinate ?? LocationsHandler.DefaultLocation, mostRecent.coordinate]
|
||||
Annotation(selectedRoute?.node?.user?.shortName ?? "???", coordinate: mostRecent.nodeCoordinate ?? LocationHelper.DefaultLocation) {
|
||||
ZStack {
|
||||
Circle()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue