How lausiv1024/h-elevatorlcdsimulator works
This project is a Windows desktop application (WPF) that emulates the LCD display of Hitachi’s UrbanAce elevators (6th & 7th generation). The project not only provides a simulation of the elevator’s display but also includes configurable content settings for various media types (custom news, media pages, YouTube embeds, Twitter timelines, etc.), along with sound playback functionality for voice announcements.
• User Interface (UI) Layer: This includes the application startup (App.xaml, MainWindow.xaml) and all configuration windows, such as the Setting.xaml and Emulation pages (FullScreen, WithContent) that control the simulation.
• Simulation/Emulation Core: The core logic for simulating the elevator display is housed under the “Emulation” folder. This includes handling themes (e.g., DarkTheme), design data, and page transitions for presenting the simulation.
• Content Settings Module: Under the “ContentSettings” folder, this module defines various content types – CustomNews, Media, RandomTL (for Twitter timeline integration), YouTubeEmbed, and UserTweet. This is one of the extension points where different kinds of content can be added dynamically.
• Custom Controls: Reusable UI components (e.g., NumericBox, TextBoxWithHeader) which enhance the interface’s consistency, found under “CustomControls.”
• Profiling/Configuration Logic: The “Profiling” and “Properties” directories encapsulate configurations and settings management (e.g., floor setup, application settings) necessary for elevator behavior and environment adaptation.
• External Service Integration: Illustrate the Twitter API authentication module (also reflected in TwitterAPIAuthData.cs) and any external libraries like Tweetinvi for Twitter, Microsoft.Web.WebView2 for web content, and NAudio for handling MP3 audio playback.
Inter-component relationships and interactions
• The UI Layer drives user interactions, invoking the simulation core to display elevator-specific content.
• Content Settings are configured via the UI and then propagated into the simulation logic to dynamically display the chosen content pieces (news, Twitter feeds, YouTube embeds, etc.).
• The simulation core uses configuration data (from floors and media settings) to generate the appropriate display including handling voice announcements managed by the audio subsystem (using NAudio).
• External APIs (e.g., Twitter API) interact directly with dedicated modules: configuration, key verification, and tweet retrieval, providing data to the simulation.
• Custom Controls are integrated into the UI forms so that data input and visual presentation remain consistent across the application.
Architectural patterns and design principles
• Separation of Concerns: Different responsibilities are cleanly separated into UI, business logic, content handling, and API integration modules.
• Modularity and Extensibility: The project organizes content types into separate classes (CustomNews, Media, etc.) enabling easy addition of new content types.
• Event-Driven UI: The WPF framework (App.xaml, MainWindow.xaml) supports reactive UI changes triggered by user interaction or automated simulation events.
• Maintainability via Configuration: Externalized settings (e.g., floor configurations, appearance themes) ensure that many elements of the UI and simulation behavior can be updated without altering core simulation code.
• Feature of configurable settings – from floor setup to content module selection – as a distinct configuration component.
• Overall flow: Configuration (settings input by the user) → Simulation Logic (emulation core processing) → UI Rendering (display on FullScreen or WithContent pages) with external accesses (Twitter, YouTube, and audio).