# Vital Recorder Configuration Generator
A robust, cross-platform CLI tool for generating Vital Recorder configuration files (`vr.conf`).
## Features
- **Cross-platform**: Works on Windows, Linux, macOS, and Unix systems
- **Interactive CLI**: User-friendly menu-driven interface
- **Complete device support**: All patient monitors and anesthesia machines
- **Validation**: Input validation and error handling
- **Flexible configuration**: Support for all VR settings including:
- Application settings (save directory, sound, DSA display)
- File cutting options (by metric or hourly)
- Network configuration (WebSocket, server IP, VR code)
- Multiple beds with multiple devices
- All device types from the specification
## Installation
### Prerequisites
- Rust toolchain (1.70.0 or later)
- Install Rust from: https://www.rust-lang.org/tools/install
### Building from Source
```bash
# Clone or create the project
mkdir vr-config-generator
cd vr-config-generator
# Create the Cargo.toml and src/main.rs files with the provided code
# Build the release version
cargo build --release
# The binary will be in target/release/
# On Windows: target\release\vr-config-generator.exe
# On Unix/Linux: target/release/vr-config-generator
```
### Quick Build Commands
**Windows:**
```powershell
cargo build --release
.\target\release\vr-config-generator.exe
```
**Linux/macOS/Unix:**
```bash
cargo build --release
chmod +x target/release/vr-config-generator
./target/release/vr-config-generator
```
## Usage
1. Run the program:
```bash
./vr-config-generator vr-config-generator.exe ```
2. Follow the interactive menu:
- Configure Application Settings
- Add and configure beds
- Add devices to beds
- Generate the configuration file
3. The program will create a `vr.conf` file in the current directory
## Configuration Options
### Application Settings
- **Save Directory**: Directory path for .vital files
- **Sound Settings**: Enable/disable event sounds
- **File Cutting**:
- Cut by metric (HR/SpO2)
- Cut hourly
- No cutting
- **Recording**: Auto-start recording on program launch
- **Network**: WebSocket settings, VR code, server IP
- **Display**: Show/hide DSA, ECG, EEG data
### Supported Devices
**Patient Monitors:**
- Phillips: Intellivue, VueLink
- GE: Solar8000, Bx50, B1x5M, Canvas, Dashx000, Dash2500
- Draeger: Infinity
- Nihon Kohden: BSM, EGA, ADT, NealTime, ORF
- MEKICS
**Anesthesia Machines:**
- Draeger: Primus, Medibus X
- GE: Datex-Ohmeda
**Demo:**
- Demo monitor for testing
### Device Configuration
Each device supports:
- COM port selection (COM5 on Windows, /dev/ttyUSB0 on Unix)
- Readonly mode (for Y-cable monitoring)
- Waveform selection (device-specific)
- Additional device-specific options
## Example Workflow
1. Start the program
2. Configure Application Settings:
- Set save directory: `/home/user/vital_data`
- Enable sound: No
- Set file cutting: Hourly
- Enable auto-record: Yes
3. Add Bed:
- Creates BED_01 automatically
4. Add Device to Bed:
- Select "Phillips Intellivue"
- Set COM port: `COM5` (Windows) or `/dev/ttyUSB0` (Linux)
- Enable readonly: Yes
- Configure waveforms: `I,II,III,PLETH,ABP`
5. Generate Configuration:
- Output filename: `vr.conf`
6. File is created and ready to use with Vital Recorder
## Output File Format
The generated `vr.conf` file follows the exact specification required by Vital Recorder:
- Windows-style line endings (\r\n)
- Proper section headers
- Correct parameter formatting
- All required configuration blocks
## Cross-Platform Notes
### Windows
- Use COM ports like: `COM1`, `COM5`, `COM10`
- Run from Command Prompt or PowerShell
- Output file uses Windows line endings
### Linux/Unix
- Use device paths like: `/dev/ttyUSB0`, `/dev/ttyS0`
- May require permissions for serial ports: `sudo usermod -a -G dialout $USER`
- Log out and back in after adding user to dialout group
### macOS
- Use device paths like: `/dev/tty.usbserial-*`
- Check available ports: `ls /dev/tty.*`
## Troubleshooting
**Program won't start:**
- Ensure Rust is properly installed
- Check executable permissions on Unix/Linux: `chmod +x vr-config-generator`
- On Windows, check antivirus isn't blocking the executable
**Serial port issues:**
- Linux: Add user to dialout group: `sudo usermod -a -G dialout $USER`
- Windows: Check Device Manager for correct COM port numbers
- macOS: Use `ls /dev/tty.*` to find available ports
**Configuration file not working:**
- Ensure the file is named exactly `vr.conf`
- Place it in the same directory as the Vital Recorder binary
- Check that all required fields are filled (especially COM ports)
**Build errors:**
- Update Rust: `rustup update`
- Clean build: `cargo clean && cargo build --release`
- Check Rust version: `rustc --version` (should be 1.70.0+)
## Advanced Usage
### Command Line Arguments (Future Enhancement)
While the current version is fully interactive, you can extend it to support command-line arguments:
```rust
// Add to Cargo.toml dependencies:
// clap = { version = "4.0", features = ["derive"] }
// Future usage examples:
./vr-config-generator --output my-config.conf
./vr-config-generator --bed-count 3 --demo-mode
./vr-config-generator --import existing.conf --edit
```
### Batch Configuration
For multiple installations, you can create a template configuration and modify it:
1. Generate a base configuration
2. Copy and modify for each installation
3. Use environment-specific settings
### Integration with Vital Recorder
1. Generate the `vr.conf` file
2. Place it in the Vital Recorder installation directory
3. Start Vital Recorder - it will automatically load the configuration
4. Monitor the logs to ensure devices connect properly
## Configuration Examples
### Example 1: Single Bed with Intellivue Monitor
```ini
[BED/BED_01]
[DEV/Intellivue]
port=COM5
readonly=1
type=Intellivue
wavs=I,II,III,PLETH,ABP
```
### Example 2: OR Setup with Anesthesia Machine
```ini
[BED/BED_01]
[DEV/Infinity]
port=COM3
type=Infinity
[DEV/Primus]
port=COM4
readonly=1
type=Primus
```
### Example 3: Multi-bed ICU Configuration
```ini
[BED/BED_01]
[DEV/Intellivue]
port=COM5
type=Intellivue
[BED/BED_02]
[DEV/Solar8000]
port=COM6
type=Solar8000
[BED/BED_03]
[DEV/BSM]
port=COM7
type=BSM
```
## Safety and Best Practices
1. **Always test** the configuration with a demo device first
2. **Backup** existing configurations before replacing
3. **Document** your COM port mappings and device connections
4. **Use readonly mode** when monitoring existing connections
5. **Verify waveforms** are appropriate for your clinical needs
6. **Test file cutting** settings to ensure proper data segmentation
## Performance Considerations
- The generator creates compact, optimized configuration files
- No runtime dependencies - the binary is self-contained
- Fast execution - configuration generation is instantaneous
- Low memory footprint - suitable for embedded systems
## License
MIT License - See LICENSE file for details
## Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Test thoroughly on your target platform
4. Submit a pull request
## Support
For issues related to:
- **Configuration Generator**: Open an issue on GitHub
- **Vital Recorder Software**: Contact the VR support team
- **Device Connectivity**: Consult device manufacturer documentation
## Version History
- **1.0.0** (Current)
- Initial release
- Full device support
- Cross-platform compatibility
- Interactive CLI interface
## Roadmap
Future enhancements planned:
- [ ] Configuration file validation
- [ ] Import existing configurations for editing
- [ ] Export/import JSON format
- [ ] Device connection testing
- [ ] Automatic COM port detection
- [ ] GUI version using egui
- [ ] Configuration templates library
- [ ] Multi-language support
## Technical Details
### File Format Specification
The generated `vr.conf` follows this structure:
1. Application configuration section
2. Separator line (10 dashes)
3. Bed configuration section
4. Windows-style line endings (\r\n) for compatibility
### Supported Waveform Sampling Rates
**Phillips Monitors (Intellivue/VueLink):**
- 500Hz: ECG leads (I, II, III, V, AVR, AVL, AVF, MCL, V1-V6)
- 125Hz: PLETH, ABP, ART, CVP, FAP, PAP, ICP, EEG
- 62.5Hz: CO2, RESP, AWF, AWP
**GE Monitors (Bx50/B1x5M/Canvas):**
- 300Hz: ECG1, ECG2
- 100Hz: IABP1-6
### Serial Communication Parameters
Default settings (usually auto-detected):
- Baud rate: Device-specific (9600-115200)
- Data bits: 8
- Stop bits: 1
- Parity: None
- Flow control: Hardware (RTS/CTS) or None
---
*Generated by VR Config Generator v1.0.0*