Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions Docs/Contribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SatHunter guide for contributors

This project started as a personal effort by NE6NE.

All kinds of contributions are welcome. Please report issues on GitHub, or even better, create
Pull Requests to fix them!

The author is not an App developer by trade, not do they have any design talent. If you identified any
room for improvement in UI / UX please create an issue or PR. You may define the aesthetic taste of
this App.

## Building SatHunter on your machine

### Prerequisites

Before working on app you need to install Google Protocol buffers. Open terminal and type:

```
brew install protobuf
brew install swift-protobuf
```
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,7 @@ The app currently only supports IC-705.

## Contribution

This project started as a personal effort by NE6NE.

All kinds of contributions are welcome. Please report issues on GitHub, or even better, create
Pull Requests to fix them!

The author is not an App developer by trade, not do they have any design talent. If you identified any
room for improvement in UI / UX please create an issue or PR. You may define the aesthetic taste of
this App.
See the [contribution guide](Docs/Contribution.md)

## License

Expand Down
106 changes: 101 additions & 5 deletions SatHunter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
objects = {

/* Begin PBXBuildFile section */
631CC5D82C67B720006D2B86 /* Mode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5D72C67B720006D2B86 /* Mode.swift */; };
631CC5DA2C67B911006D2B86 /* ToneFrequency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5D92C67B911006D2B86 /* ToneFrequency.swift */; };
631CC5DC2C67BA3A006D2B86 /* Conversions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5DB2C67BA3A006D2B86 /* Conversions.swift */; };
631CC5E12C67BF24006D2B86 /* RigError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5E02C67BF24006D2B86 /* RigError.swift */; };
631CC5E32C67BF59006D2B86 /* ConnectionState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5E22C67BF59006D2B86 /* ConnectionState.swift */; };
631CC5E72C67C1BA006D2B86 /* IC705.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5E62C67C1BA006D2B86 /* IC705.swift */; };
631CC5EA2C67C280006D2B86 /* IC705BluetoothDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5E92C67C280006D2B86 /* IC705BluetoothDelegate.swift */; };
631CC5EC2C67C334006D2B86 /* RigState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5EB2C67C334006D2B86 /* RigState.swift */; };
631CC5EE2C67CB97006D2B86 /* ByteUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631CC5ED2C67CB97006D2B86 /* ByteUtilities.swift */; };
632A21B52C68CE0800ED4280 /* SatelliteOrbitElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632A21B42C68CE0800ED4280 /* SatelliteOrbitElements.swift */; };
632A21B72C68CE4700ED4280 /* SatelliteObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632A21B62C68CE4700ED4280 /* SatelliteObserver.swift */; };
632A21B92C68CE8700ED4280 /* SatellitePass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632A21B82C68CE8700ED4280 /* SatellitePass.swift */; };
632A21BB2C68D5A400ED4280 /* SatelliteListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632A21BA2C68D5A400ED4280 /* SatelliteListItem.swift */; };
632A21BD2C68EA5C00ED4280 /* AppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632A21BC2C68EA5C00ED4280 /* AppTheme.swift */; };
D10F8E132A34380D008D0D2F /* SatFreqView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10F8E122A34380D008D0D2F /* SatFreqView.swift */; };
D12952402A28004D00334302 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = D129523F2A28004D00334302 /* SwiftProtobuf */; };
D12952422A28006800334302 /* sat_info.proto in Sources */ = {isa = PBXBuildFile; fileRef = D12952412A28006800334302 /* sat_info.proto */; };
Expand All @@ -33,7 +47,7 @@
D1A738912A24235B002832A1 /* TrackingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A738902A24235B002832A1 /* TrackingView.swift */; };
D1A738932A24235D002832A1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D1A738922A24235D002832A1 /* Assets.xcassets */; };
D1A738962A24235D002832A1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D1A738952A24235D002832A1 /* Preview Assets.xcassets */; };
D1A738B62A242398002832A1 /* LibPredict.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A738852A230F81002832A1 /* LibPredict.swift */; };
D1A738B62A242398002832A1 /* SatellitePredictions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A738852A230F81002832A1 /* SatellitePredictions.swift */; };
D1A738B72A242434002832A1 /* libpredict.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1403E342A2303ED000E873B /* libpredict.framework */; platformFilter = ios; };
D1A738B82A242434002832A1 /* libpredict.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D1403E342A2303ED000E873B /* libpredict.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D1A738BE2A250C06002832A1 /* SatListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A738BD2A250C06002832A1 /* SatListView.swift */; };
Expand Down Expand Up @@ -85,6 +99,20 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
631CC5D72C67B720006D2B86 /* Mode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mode.swift; sourceTree = "<group>"; };
631CC5D92C67B911006D2B86 /* ToneFrequency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToneFrequency.swift; sourceTree = "<group>"; };
631CC5DB2C67BA3A006D2B86 /* Conversions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Conversions.swift; sourceTree = "<group>"; };
631CC5E02C67BF24006D2B86 /* RigError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RigError.swift; sourceTree = "<group>"; };
631CC5E22C67BF59006D2B86 /* ConnectionState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionState.swift; sourceTree = "<group>"; };
631CC5E62C67C1BA006D2B86 /* IC705.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IC705.swift; sourceTree = "<group>"; };
631CC5E92C67C280006D2B86 /* IC705BluetoothDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IC705BluetoothDelegate.swift; sourceTree = "<group>"; };
631CC5EB2C67C334006D2B86 /* RigState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RigState.swift; sourceTree = "<group>"; };
631CC5ED2C67CB97006D2B86 /* ByteUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ByteUtilities.swift; sourceTree = "<group>"; };
632A21B42C68CE0800ED4280 /* SatelliteOrbitElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatelliteOrbitElements.swift; sourceTree = "<group>"; };
632A21B62C68CE4700ED4280 /* SatelliteObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatelliteObserver.swift; sourceTree = "<group>"; };
632A21B82C68CE8700ED4280 /* SatellitePass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatellitePass.swift; sourceTree = "<group>"; };
632A21BA2C68D5A400ED4280 /* SatelliteListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatelliteListItem.swift; sourceTree = "<group>"; };
632A21BC2C68EA5C00ED4280 /* AppTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTheme.swift; sourceTree = "<group>"; };
D10F8E122A34380D008D0D2F /* SatFreqView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatFreqView.swift; sourceTree = "<group>"; };
D12952412A28006800334302 /* sat_info.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = sat_info.proto; sourceTree = "<group>"; };
D12952482A2806E600334302 /* SatInfoManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatInfoManager.swift; sourceTree = "<group>"; };
Expand All @@ -108,7 +136,7 @@
D1A738722A230C69002832A1 /* sun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sun.h; sourceTree = "<group>"; };
D1A738732A230C69002832A1 /* sdp4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdp4.h; sourceTree = "<group>"; };
D1A738742A230C69002832A1 /* sgp4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sgp4.h; sourceTree = "<group>"; };
D1A738852A230F81002832A1 /* LibPredict.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibPredict.swift; sourceTree = "<group>"; };
D1A738852A230F81002832A1 /* SatellitePredictions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatellitePredictions.swift; sourceTree = "<group>"; };
D1A7388C2A24235B002832A1 /* SatHunter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SatHunter.app; sourceTree = BUILT_PRODUCTS_DIR; };
D1A7388E2A24235B002832A1 /* SatHunterApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SatHunterApp.swift; sourceTree = "<group>"; };
D1A738902A24235B002832A1 /* TrackingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -142,6 +170,56 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
631CC5D62C67B708006D2B86 /* Models */ = {
isa = PBXGroup;
children = (
D1A738C92A25A485002832A1 /* Rig.swift */,
631CC5EB2C67C334006D2B86 /* RigState.swift */,
631CC5E02C67BF24006D2B86 /* RigError.swift */,
631CC5E22C67BF59006D2B86 /* ConnectionState.swift */,
631CC5D72C67B720006D2B86 /* Mode.swift */,
631CC5D92C67B911006D2B86 /* ToneFrequency.swift */,
632A21BA2C68D5A400ED4280 /* SatelliteListItem.swift */,
);
path = Models;
sourceTree = "<group>";
};
631CC5DD2C67BC28006D2B86 /* Utilities */ = {
isa = PBXGroup;
children = (
631CC5DB2C67BA3A006D2B86 /* Conversions.swift */,
631CC5ED2C67CB97006D2B86 /* ByteUtilities.swift */,
);
path = Utilities;
sourceTree = "<group>";
};
631CC5DE2C67BC67006D2B86 /* Views */ = {
isa = PBXGroup;
children = (
);
path = Views;
sourceTree = "<group>";
};
631CC5E82C67C262006D2B86 /* Icom-705 */ = {
isa = PBXGroup;
children = (
631CC5E62C67C1BA006D2B86 /* IC705.swift */,
631CC5E92C67C280006D2B86 /* IC705BluetoothDelegate.swift */,
);
path = "Icom-705";
sourceTree = "<group>";
};
631CC5EF2C67D07B006D2B86 /* Satellite */ = {
isa = PBXGroup;
children = (
D1A738852A230F81002832A1 /* SatellitePredictions.swift */,
632A21B42C68CE0800ED4280 /* SatelliteOrbitElements.swift */,
632A21B62C68CE4700ED4280 /* SatelliteObserver.swift */,
632A21B82C68CE8700ED4280 /* SatellitePass.swift */,
);
path = Satellite;
sourceTree = "<group>";
};
D12952472A2803FD00334302 /* Protos */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -210,11 +288,14 @@
D1A7388D2A24235B002832A1 /* SatHunter */ = {
isa = PBXGroup;
children = (
631CC5EF2C67D07B006D2B86 /* Satellite */,
631CC5E82C67C262006D2B86 /* Icom-705 */,
631CC5DE2C67BC67006D2B86 /* Views */,
631CC5DD2C67BC28006D2B86 /* Utilities */,
631CC5D62C67B708006D2B86 /* Models */,
D12952472A2803FD00334302 /* Protos */,
D1A738C92A25A485002832A1 /* Rig.swift */,
D1A738BC2A2475AD002832A1 /* Info.plist */,
D10F8E122A34380D008D0D2F /* SatFreqView.swift */,
D1A738852A230F81002832A1 /* LibPredict.swift */,
D1A7388E2A24235B002832A1 /* SatHunterApp.swift */,
D1A738902A24235B002832A1 /* TrackingView.swift */,
D13429B72A302A2B00184085 /* SkyView.swift */,
Expand All @@ -227,6 +308,7 @@
D1F547902A29B15700AED698 /* SettingsView.swift */,
D19BE3452A302C6800DC47D1 /* SatViewModel.swift */,
D19BE3472A302CD400DC47D1 /* SatInfoView.swift */,
632A21BC2C68EA5C00ED4280 /* AppTheme.swift */,
);
path = SatHunter;
sourceTree = "<group>";
Expand Down Expand Up @@ -381,16 +463,30 @@
files = (
D1A738912A24235B002832A1 /* TrackingView.swift in Sources */,
D12952422A28006800334302 /* sat_info.proto in Sources */,
632A21B92C68CE8700ED4280 /* SatellitePass.swift in Sources */,
632A21BB2C68D5A400ED4280 /* SatelliteListItem.swift in Sources */,
632A21B72C68CE4700ED4280 /* SatelliteObserver.swift in Sources */,
D19BE3482A302CD400DC47D1 /* SatInfoView.swift in Sources */,
D1A738B62A242398002832A1 /* LibPredict.swift in Sources */,
D1A738B62A242398002832A1 /* SatellitePredictions.swift in Sources */,
D1A738C62A25441D002832A1 /* RigControlView.swift in Sources */,
D1A7388F2A24235B002832A1 /* SatHunterApp.swift in Sources */,
632A21B52C68CE0800ED4280 /* SatelliteOrbitElements.swift in Sources */,
631CC5EC2C67C334006D2B86 /* RigState.swift in Sources */,
631CC5DC2C67BA3A006D2B86 /* Conversions.swift in Sources */,
D1F547912A29B15700AED698 /* SettingsView.swift in Sources */,
D12952492A2806E600334302 /* SatInfoManager.swift in Sources */,
631CC5E12C67BF24006D2B86 /* RigError.swift in Sources */,
631CC5E32C67BF59006D2B86 /* ConnectionState.swift in Sources */,
631CC5EA2C67C280006D2B86 /* IC705BluetoothDelegate.swift in Sources */,
D1A738C82A2550B6002832A1 /* SatView.swift in Sources */,
D10F8E132A34380D008D0D2F /* SatFreqView.swift in Sources */,
631CC5E72C67C1BA006D2B86 /* IC705.swift in Sources */,
D1A738CA2A25A485002832A1 /* Rig.swift in Sources */,
632A21BD2C68EA5C00ED4280 /* AppTheme.swift in Sources */,
631CC5D82C67B720006D2B86 /* Mode.swift in Sources */,
D19BE3462A302C6800DC47D1 /* SatViewModel.swift in Sources */,
631CC5EE2C67CB97006D2B86 /* ByteUtilities.swift in Sources */,
631CC5DA2C67B911006D2B86 /* ToneFrequency.swift in Sources */,
D13429B82A302A2B00184085 /* SkyView.swift in Sources */,
D1A738BE2A250C06002832A1 /* SatListView.swift in Sources */,
);
Expand Down
Binary file not shown.
85 changes: 85 additions & 0 deletions SatHunter/AppTheme.swift
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the Changelog / Release note about this?

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//
// AppTheme.swift
// SatHunter
//
// Created by Aleksandar Zdravković on 8/11/24.
//

import Foundation

import SwiftUI

enum AppTheme: String, CaseIterable, Identifiable {
case system = "System"
case light = "Light"
case dark = "Dark"
case lowContrast = "Low Contrast"

var id: String { self.rawValue }
}

class ThemeManager: ObservableObject {
@Published var selectedTheme: AppTheme = .system {
didSet {
saveTheme()
}
}

init() {
loadTheme()
}

func applyTheme() -> ColorScheme? {
switch selectedTheme {
case .system:
return getSystemColorScheme()
case .light:
return .light
case .dark:
return .dark
case .lowContrast:
return .light // Apply a low contrast custom theme
}
}

private func getSystemColorScheme() -> ColorScheme {
#if os(iOS)
// For iOS, using UIKit
let userInterfaceStyle = UITraitCollection.current.userInterfaceStyle
return userInterfaceStyle == .dark ? .dark : .light
#elseif os(macOS)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious -- is this supposed to be the way to support both macOS and iOS?

// For macOS, using AppKit
let appearanceName = NSApp.effectiveAppearance.name
return appearanceName == .darkAqua ? .dark : .light
#else
// Default to light for unsupported platforms
return .light
#endif
}


private func saveTheme() {
UserDefaults.standard.set(selectedTheme.rawValue, forKey: "selectedTheme")
}

private func loadTheme() {
if let savedTheme = UserDefaults.standard.string(forKey: "selectedTheme"),
let theme = AppTheme(rawValue: savedTheme) {
selectedTheme = theme
}
}
}

struct LowContrastModifier: ViewModifier {
func body(content: Content) -> some View {
content
.foregroundColor(.red)
.background(Color(white: 0.95))
}
}

extension View {
func applyLowContrast() -> some View {
self.modifier(LowContrastModifier())
}
}
Loading