How radicalsanta/bharatpcb2 works
Bharat PCB is an Android PCB-inspection app, with visible modules for image-based defect detection, policy/domain processing, inspection history and metrics, CSV output, and local advisory generation. The apparent user workflow is to start an inspection, process its image, and view results, with other screens for dashboards, history, and settings. The supplied material contains no README and no runtime source excerpts, so these connections are shown as unverified; component responsibilities are inferred from the file tree only.
Main entry points: RunInspectionUseCase.kt Run inspection · AppNavGraph.kt App navigation · InspectionRepositoryImpl.kt Inspection repository · HistoryScreen.kt History screen
Components 23
App and navigation
- Main activity
app/src/main/java/com/example/MainActivity.kt - App navigation
app/src/main/java/com/example/navigation/AppNavGraph.kt - Inspection screen
app/src/main/java/com/example/presentation/screens/InspectScreen.kt - Results screen
app/src/main/java/com/example/presentation/screens/ResultsScreen.kt - History screen
app/src/main/java/com/example/presentation/screens/HistoryScreen.kt - Advisory screen
app/src/main/java/com/example/presentation/screens/AdvisoryScreen.kt - Settings screen
app/src/main/java/com/example/presentation/screens/SettingsScreen.kt
Inspection workflow
- Inspection view model
app/src/main/java/com/example/presentation/viewmodel/InspectViewModel.kt - Run inspection
app/src/main/java/com/example/domain/usecase/RunInspectionUseCase.kt - Image decoder
app/src/main/java/com/example/imageprocessing/SafeImageDecoder.kt - Dashboard metrics
app/src/main/java/com/example/domain/usecase/ComputeDashboardMetricsUseCase.kt
Inference and advisory
- PCB detection engine
app/src/main/java/com/example/inference/cv/OnnxPcbDetectionEngine.kt - Transistor engine
app/src/main/java/com/example/inference/cv/PatchCoreTransistorEngine.kt - Defect refinement
app/src/main/java/com/example/inference/cv/GreenPcbDefectRefiner.kt - Local advisory engine
app/src/main/java/com/example/inference/llm/ExecuTorchAdvisoryEngine.kt
Domain and policy
- Inspection policy
app/src/main/java/com/example/domain/policy/InspectionPolicyEngine.kt - Defect taxonomy
app/src/main/java/com/example/domain/policy/DefectTaxonomy.kt
Persistence and export
- Inspection repository
app/src/main/java/com/example/data/repository/InspectionRepositoryImpl.kt - Inspection database
app/src/main/java/com/example/data/local/database/PcbInspectorDatabase.kt - CSV export
app/src/main/java/com/example/data/csv/CsvExportManagerImpl.kt - Inspection CSV log
app/src/main/java/com/example/data/csv/InspectionCsvLoggerImpl.kt - Settings repository
app/src/main/java/com/example/data/local/preferences/SettingsRepositoryImpl.kt
Other components
- App user
Connections 22
- App user → Main activity: opens
- Main activity → App navigation: launches
- App navigation → Inspection screen: routes to
- Inspection screen → Inspection view model: submits inspection
- Inspection view model → Run inspection: requests run
- Run inspection → Image decoder: decodes image
- Run inspection → PCB detection engine: requests detection
- Run inspection → Transistor engine: requests analysis
- Run inspection → Inspection policy: applies policy
- Inspection policy → Defect taxonomy: uses taxonomy
- Run inspection → Inspection repository: saves inspection
- Inspection repository → Inspection database: persists records
- App navigation → Results screen: routes to
- Dashboard metrics → Inspection repository: reads inspections
- App navigation → History screen: routes to
- History screen → Inspection repository: loads history
- Run inspection → Inspection CSV log: logs inspection
- History screen → CSV export: exports history
- App navigation → Advisory screen: routes to
- Advisory screen → Local advisory engine: requests advice
- App navigation → Settings screen: routes to
- Settings screen → Settings repository: updates settings