How lazyatwell/mf-turbinemonitor works
Project Type & Purpose
• The README states it is “一个大型涡轮扇叶风力发电机数据大屏案例” – a large-scale wind turbine dashboard.
• The focus is on visualizing turbine data, interactive animations (including part assembly/disassembly), lighting effects, and highlighting device interactions.
• The use of Vue 3, TypeScript, and Vite indicates a modern front-end SPA (Single Page Application) with heavy graphical/3D content.
Key Components from the File Structure
• /src: Contains the main application code.
– App.vue, layout components (header, footer, panel, loading), and various UI widgets (WidgetPanel01.vue through WidgetPanel07.vue).
– “hooks” directory shows custom hooks like useEcharts, useThree, and useTurbine – these abstract logic for our visualizations and turbine data.
• /public and /docs: Store public assets including models (GLB files for equipment, planes, skeleton) and textures, as well as JavaScript libraries for DRACO compression, Three.js, and additional visualization libraries.
• /assets: Contains fonts and images that are critical for UI branding and performance (notably font subpackaging improvements mentioned in the changelog).
• Config files (vite.config.ts, tsconfig) and various linter/formatter configuration files indicate an emphasis on code quality and project consistency.
Architectural Patterns & Relationships
• Frontend Presentation Layer:
• Core UI components and layout within the /src folder.
• Vue components orchestrate the dashboard’s interactive visualization panels.
• Layout components clearly separate header, footer, panel areas – suggesting a compartmentalized structure for the data display.
• Data Visualization & 3D Rendering:
• Three.js is used via the useThree hook to handle 3D models, animations, and interactions.
• ECharts is integrated via the useEcharts hook to render complex charts and graphs that show turbine metrics.
• DRACO libraries embedded under both /docs/js/draco and /public/js/draco are used to decode and encode compressed 3D geometry which are then rendered by Three.js.
• Asset & Media Management:
• The project has dedicated directories for models, textures, and fonts; these assets are essential for creating an immersive data display environment.
• Optimized asset distribution (as highlighted in recent updates) plays a crucial role in performance.
• Build and Deployment:
• Vite configuration ensures a modern, high-performance build process.
• Environment files (.env, .env.production, .env.development) indicate environment-specific configurations that might affect API endpoints or debug settings.