Scripts/README.md
2025-07-22 13:16:08 +04:00

193 lines
5.7 KiB
Markdown

# 🐍 **Python Requirements**
### **For Users Running Scripts**:
- **Python 3.6 or higher** must be installed
- Download from: https://www.python.org/downloads/
### **For Developers Building the Executable**:
```bash
pip install pyinstaller
```
## 🛠️ **Development Instructions**
### **Building the Executable**:
```bash
python build.py
```
This will:
1. Create a zip file with all folders
2. Encode it as base64
3. Build the executable with PyInstaller
4. Output: `dist/ScriptsInstaller.exe`
# Scripts Installer Tool
This tool creates an executable that **contains all your scripts within itself**. When users run it, they can choose where to install all the scripts and tools.
## ✅ **Your executable will be ready at: `dist\ScriptsInstaller.exe`**
## How it works:
1. **All scripts are embedded inside the exe** - The executable contains all your scripts and tools as compressed data
2. **Users only need the exe file** - No other files needed
3. **Users run the exe anywhere** - They can place it on desktop, downloads, etc.
4. **Scripts get extracted and installed** - All scripts are extracted to their chosen location
## User Experience:
### What users get:
- **Single file**: `ScriptsInstaller.exe` (11MB)
- **No installation required**: Just run the exe
- **Choose any location**: Install scripts wherever they want
## What gets installed:
When users run the executable, a single `SCRIPTS` folder will be installed to their chosen location, containing:
- `SCRIPTS/PLACE DPMS/`
- `SCRIPTS/PLACE DPM DEVICES/`
- `SCRIPTS/OTHER SCRIPTS/`
- `SCRIPTS/RESET IGNITION/`
- `SCRIPTS/TAGS/`
# 📁 **Detailed Folder Descriptions**
### **PLACE DPMS/**
**Purpose**: Creates MCM views with DPM configurations.
**What it does**:
- Reads DPM mapping from `dpm_mapping.txt`
- Creates MCM folders with proper view.json files
- Configures DPM names and IP addresses in the views
- Applies bindings to every DPM/MCM
- Generates resource.json and thumbnail.png files
- MISSING: tagProps generation in root (not enough information)
**How to use**:
1. Edit `dpm_mapping.txt` with your MCM and DPM information
2. Run `python main.py`
3. Check the `MCMs/` output folder for generated files
**File format for dpm_mapping.txt**:
```
MCM_NAME
DPM_NAME1 DPM_IP1
DPM_NAME2 DPM_IP2
...
DPM_NAMEN DPM_IPN
MCM_NAMEN
...
```
### **PLACE DPM DEVICES/**
**Purpose**: Creates DPM device configurations with VFD and FIO/SIO device layouts.
**What it does**:
- Reads device mapping from `device_mapping.txt`
- Creates DPM folders with device configurations
- Positions VFD and FIO/SIO devices on the layout
- Generates view.json with proper device positioning
- Applies bindings to every VFD/FIO/SIO
- MISSING: tagProps generation in root (not enough information)
**How to use**:
1. Edit `device_mapping.txt` with your DPM and device information
2. Run `python main.py`
3. Check the `MCM/` output folder for generated files
**File format for device_mapping.txt**:
```
DPM_NAME
DEVICE_NAME1 DEVICE_IP1
DEVICE_NAME2 DEVICE_IP2
...
DEVICE_NAMEN DEVICE_IPN
DPM_NAMEN
...
```
### **OTHER SCRIPTS/**
**Purpose**: Contains various utility scripts for DPM and MCM management.
**Subfolders**:
- **CHANGE DPM NAMES TO DEFAULT/**: Resets DPM names to default values
- **CHANGE EXISTING DPM VIEW NAMES/**: Modifies existing DPM view names
- **CREATE MCM VIEWS/**: Creates new MCM view configurations
**How to use**:
1. Navigate to the specific subfolder
2. Open `main.py` and follow the steps
3. Run `python main.py` in each folder as needed
### **RESET IGNITION/**
**Purpose**: Resets Ignition every 1 minute.
**How to use**:
1. Run `python main.py`
2. Keep your console open so it will be running constantly
### **TAGS/**
**Purpose**: Manages tag configurations for MCM systems.
**What it does**:
- Generates tag configurations
- Applies tags to MCM systems
- Keeps unique tag entries
- Manages MCM tag mappings
**Scripts included**:
- `generate-tags.py`
-- Creates tag configurations, picks devices from view.json and generates tags
- `apply-tags.py`
-- Applies already generated tags to already existing view.json files to tagProps
- `keep-unique.py`
-- Removes duplicate tags (not necessary)
**How to use**:
1. Run `python generate-tags.py` to create tags
2. Run `python apply-tags.py` to apply them
3. Run `python keep-unique.py` to clean duplicates
### **Project Structure**:
```
SCRIPTS/
├── build.py # Build script for executable
├── README.md # This documentation
├── .gitignore # Git ignore rules
├── PLACE DPMS/ # DPM configuration tool
├── PLACE DPM DEVICES/ # Device layout tool
├── OTHER SCRIPTS/ # Utility scripts
├── RESET IGNITION/ # Ignition reset tool
└── TAGS/ # Tag management tools
```
## 📋 **Quick Start Guide for Users**
1. **Install Python** (if not already installed)
2. **Run ScriptsInstaller.exe** to install all tools
3. **Navigate to the SCRIPTS folder** where you installed
4. **Choose the tool you need**:
- For DPM configuration: Use `PLACE DPMS/`
- For device layout: Use `PLACE DPM DEVICES/`
- For tag management: Use `TAGS/`
- For Ignition reset: Use `RESET IGNITION/`
5. **Edit the configuration files** (txt files) with your data
6. **Run `python main.py`** in the respective folder
## Distribution:
**You only need to give users the `ScriptsInstaller.exe` file.** That's it!
- ✅ No additional files needed
- ✅ No installation process
- ✅ Works on any Windows computer
- ✅ Users choose installation location
- ✅ Complete folder structure preserved
## Technical Details:
- **File size**: ~11MB (contains all your scripts compressed)
- **Dependencies**: None (self-contained)
- **Requirements**: Windows 7 or later
- **Method**: Uses base64 encoding to embed zip data within the executable