A visual elevator simulator built with Rust using the egui immediate mode GUI framework.
This application provides a visual representation of an elevator system with:
- A graphical elevator display
- Multiple floors (Ground, 1, 2, 3)
- Real-time visualization
- Interactive controls to start/stop the simulation
- Visual Elevator: Displays an elevator with a custom image
- Floor Display: Shows floor labels (Ground, 1, 2, 3)
- Grid Layout: Visual grid representing the building structure
- Interactive UI: Start/stop controls for the elevator simulation
To build and run this project, you need:
- Rust (1.93.0 or later)
- Cargo (comes with Rust)
- X11 libraries (for GUI support)
If you don't have Rust installed, you can install it from rustup.rs:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shOn Ubuntu/Debian-based systems:
sudo apt-get update
sudo apt-get install -y libxkbcommon-x11-0 libxcb-xkb1On other Linux distributions, you may need to install equivalent packages for X11 and XKB support.
To build the project, run:
cargo buildFor an optimized release build:
cargo build --releaseTo run the elevator simulator:
cargo runOr, if you've built the release version:
cargo run --releaseThe application will open a GUI window displaying the elevator visualization.
.
├── Cargo.toml # Project configuration and dependencies
├── Cargo.lock # Dependency lock file
├── src/
│ ├── main.rs # Application entry point and main UI logic
│ ├── elevator.rs # Elevator object and state management
│ ├── elevator_widget.rs # Custom widget for rendering the elevator
│ └── elevator.png # Elevator image asset
└── README.md # This file
eframe(0.27.0) - Framework for creating GUI applicationsegui(0.27.0) - Immediate mode GUI libraryegui_extras(0.27.0) - Additional utilities for egui, including image loadingrand(0.8.5) - Random number generation
- The application uses a custom elevator image (
src/elevator.png) - The simulation displays a grid with floor markers
- The elevator position and movement logic can be extended
- Currently in minimal working state with room for additional features
This project is open source. Please refer to the repository for license information.
Contributions are welcome! Feel free to submit issues or pull requests.