Introduce TankDefinition/TankCatalog loaded from Tanks.json, bundle the Drachengas USDZ tank models, add tank selection and preview views, and update the AR experience, editor and project views to use the catalog. Includes tests for catalog loading and model selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69 lines
1.9 KiB
Swift
69 lines
1.9 KiB
Swift
//
|
|
// ProjectDetailView.swift
|
|
// GasTankAR
|
|
//
|
|
// Created by Dennis Nemec on 25.08.26.
|
|
//
|
|
|
|
import SwiftUI
|
|
import SwiftData
|
|
|
|
struct ProjectDetailView: View {
|
|
@Bindable var project: Project
|
|
@State private var isARPresented = false
|
|
|
|
var body: some View {
|
|
TabView {
|
|
detailsTab
|
|
.tabItem { Label("Details", systemImage: "info.circle") }
|
|
|
|
GalleryView(project: project)
|
|
.tabItem { Label("Galerie", systemImage: "photo.on.rectangle") }
|
|
|
|
DocuframeView(project: project)
|
|
.tabItem { Label("DOCUframe", systemImage: "arrow.up.doc.on.clipboard") }
|
|
}
|
|
.navigationTitle(project.customerName)
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
}
|
|
|
|
private var detailsTab: some View {
|
|
List {
|
|
Section("Projektdaten") {
|
|
LabeledContent("Kunde", value: project.customerName)
|
|
LabeledContent("Lead-ID", value: project.leadID)
|
|
LabeledContent(
|
|
"Erstellt am",
|
|
value: project.creationDate.formatted(.dateTime.day().month().year())
|
|
)
|
|
}
|
|
|
|
TankSelectionSection(tank: $project.tank)
|
|
}
|
|
.safeAreaInset(edge: .bottom) {
|
|
Button {
|
|
isARPresented = true
|
|
} label: {
|
|
Label("AR-Modus starten", systemImage: "arkit")
|
|
.font(.headline)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: 50)
|
|
}
|
|
.buttonStyle(.borderedProminent)
|
|
.padding()
|
|
}
|
|
.fullScreenCover(isPresented: $isARPresented) {
|
|
ARExperienceView(project: project)
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
let sample = PreviewSupport.singleProjectContainer()
|
|
|
|
return NavigationStack {
|
|
ProjectDetailView(project: sample.project)
|
|
}
|
|
.modelContainer(sample.container)
|
|
}
|