readFileSystem/GEMINI.md

3.0 KiB

Gemini Project Context

Project Overview

This project is a Python-based desktop application utilizing the PySide6 framework (Qt for Python).

Currently, the active application is an Inspection Management System (检验管理系统) designed for industrial PDA (handheld) devices. It allows users to view inspection records and initiate new inspections.

The project also contains legacy code for a File System Browser, which is currently inactive but preserved.

Key Technologies

  • Language: Python 3
  • GUI Framework: PySide6
  • Fonts: Microsoft YaHei (SimHei/微软雅黑) is the standard font.

Architecture

The project is structured to separate business logic from UI components.

Directory Structure

readFileSystem/
├── src/
│   ├── inspection_app.py  # MAIN LOGIC: Inspection app setup & mock data
│   ├── main.py            # Entry hook (imports inspection_app)
│   ├── main_old.py        # LEGACY: Old file browser entry point
│   └── file_system.py     # LEGACY: File system reading logic
├── ui/
│   ├── inspection_window.py # Main Window (List view + Buttons)
│   └── inspection_card.py   # Component: Single inspection record card
├── run.py                 # Application Entry Point
└── requirements.txt       # Dependencies

Components (Inspection App)

  • src/inspection_app.py:
    • Sets up the QApplication.
    • Applies global fonts.
    • Generates mock data for demonstration.
    • Populates the window with InspectionCard widgets.
  • ui/inspection_window.py:
    • Layout: Vertical layout with a scrollable area for cards and a fixed bottom button bar.
    • Resolution: Default 480x800 to simulate a phone/PDA screen.
    • Buttons: "Incoming Inspection" (入检) and "Manual Inspection" (手检).
  • ui/inspection_card.py:
    • Displays detailed inspection data (Date, Inspector, Batch, Heat, Material, Spec, Weight) in a grid layout with borders.

Building and Running

Prerequisites

  • Python 3.10+
  • Install dependencies:
    pip install -r requirements.txt
    

Execution

To run the application:

python run.py

Note: This script imports src/main.py, which currently launches the Inspection App.

Development Conventions

  • UI Design:
    • Style: Simple, high-contrast (Black/White main), Industrial style.
    • Buttons: Blue background (#0086fa), White text.
    • Font: Microsoft YaHei.
    • Borders: Explicit black borders for data cards.
  • Language:
    • Code: All variables, comments, and internal logic must be in English.
    • User Interface: All visible text (Labels, Buttons, Alerts) must be in Chinese.
  • Code Organization:
    • New UI components must go into ui/.
    • Application logic resides in src/.
    • Do not modify run.py logic unless changing the entry point mechanism.