From 8b9ace49466b311c83c0eae61a20832702405920 Mon Sep 17 00:00:00 2001 From: HardMax71 Date: Wed, 28 Aug 2024 22:44:05 +0200 Subject: [PATCH] - removed simulation (doesnt make any sense), - added github jobs to create executables (testing mode) --- .github/workflows/build-desktop-app.yaml | 77 +++++++++++++++++++++ README.md | 1 - desktop_app/__init__.py | 0 desktop_app/src/ui/__init__.py | 2 - desktop_app/src/ui/simulation_view.py | 55 --------------- public_api/permissions/permission_enums.py | 1 + server/nexusware.db | Bin 344064 -> 344064 bytes 7 files changed, 78 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/build-desktop-app.yaml delete mode 100644 desktop_app/__init__.py delete mode 100644 desktop_app/src/ui/simulation_view.py diff --git a/.github/workflows/build-desktop-app.yaml b/.github/workflows/build-desktop-app.yaml new file mode 100644 index 0000000..3e4a0da --- /dev/null +++ b/.github/workflows/build-desktop-app.yaml @@ -0,0 +1,77 @@ +name: Build Desktop App + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r desktop_app/requirements.txt + pip install pyinstaller + - name: Build with PyInstaller + run: | + cd desktop_app + pyinstaller --onefile --windowed main.py + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: NexusWare-Windows + path: desktop_app/dist/main.exe + + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r desktop_app/requirements.txt + pip install pyinstaller + - name: Build with PyInstaller + run: | + cd desktop_app + pyinstaller --onefile --windowed main.py + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: NexusWare-macOS + path: desktop_app/dist/main + + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r desktop_app/requirements.txt + pip install pyinstaller + - name: Build with PyInstaller + run: | + cd desktop_app + pyinstaller --onefile --windowed main.py + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: NexusWare-Linux + path: desktop_app/dist/main \ No newline at end of file diff --git a/README.md b/README.md index e2ce713..69d689d 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ across mobile, web, and desktop environments. | Barcode and Label Design | - | - | ✅ | | Advanced Search and Filter | - | ✅ | ✅ | | System Diagnostics | - | - | ✅ | -| Simulation and Modeling | - | - | ✅ | | Training Mode | - | - | ✅ | | Customization Tools | - | - | ✅ | diff --git a/desktop_app/__init__.py b/desktop_app/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/desktop_app/src/ui/__init__.py b/desktop_app/src/ui/__init__.py index 13ca28f..0af0d14 100644 --- a/desktop_app/src/ui/__init__.py +++ b/desktop_app/src/ui/__init__.py @@ -8,7 +8,6 @@ from .report_generator import ReportGeneratorWidget from .search_filter import AdvancedSearchDialog from .settings.system_diagnostics import SystemDiagnosticsWidget -from .simulation_view import SimulationView from .training_mode import TrainingModeManager from .views.auth import LoginDialog from .views.customers import CustomerDialog, CustomerDetailsDialog, CustomerView @@ -36,7 +35,6 @@ "BatchProcessorWidget", "BarcodeDesignerWidget", "SystemDiagnosticsWidget", - "SimulationView", "AdvancedSearchDialog", "TrainingModeManager", "OfflineModeWidget", diff --git a/desktop_app/src/ui/simulation_view.py b/desktop_app/src/ui/simulation_view.py deleted file mode 100644 index 94fb7c1..0000000 --- a/desktop_app/src/ui/simulation_view.py +++ /dev/null @@ -1,55 +0,0 @@ -from PySide6.QtCore import QTimer -from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QTextEdit, QComboBox, QSpinBox - -from public_api.api import APIClient -from .components import StyledButton - - -# TODO: Implement simulation stuff - -class SimulationView(QWidget): - def __init__(self, api_client: APIClient): - super().__init__() - self.api_client = api_client - self.init_ui() - - def init_ui(self): - layout = QVBoxLayout(self) - - # Controls - controls_layout = QHBoxLayout() - self.simulation_type = QComboBox() - self.simulation_type.addItems(["Order Processing", "Inventory Management", "Shipment Routing"]) - self.duration = QSpinBox() - self.duration.setRange(1, 30) - self.duration.setSuffix(" days") - self.start_button = StyledButton("Start Simulation") - self.start_button.clicked.connect(self.start_simulation) - controls_layout.addWidget(self.simulation_type) - controls_layout.addWidget(self.duration) - controls_layout.addWidget(self.start_button) - layout.addLayout(controls_layout) - - # Simulation display - self.simulation_display = QTextEdit() - self.simulation_display.setReadOnly(True) - layout.addWidget(self.simulation_display) - - self.timer = QTimer(self) - self.timer.timeout.connect(self.update_simulation) - self.current_day = 0 - - def start_simulation(self): - self.simulation_display.clear() - self.current_day = 0 - self.timer.start(1000) # Update every second - - def update_simulation(self): - self.current_day += 1 - if self.current_day <= self.duration.value(): - sim_type = self.simulation_type.currentText() - result = self.api_client.run_simulation(sim_type, self.current_day) - self.simulation_display.append(f"Day {self.current_day}: {result}") - else: - self.timer.stop() - self.simulation_display.append("Simulation complete.") diff --git a/public_api/permissions/permission_enums.py b/public_api/permissions/permission_enums.py index 838f115..19d023a 100644 --- a/public_api/permissions/permission_enums.py +++ b/public_api/permissions/permission_enums.py @@ -24,3 +24,4 @@ class PermissionName(str, Enum): NOTIFICATIONS = "Notifications" TASKS_MANAGEMENT = "Tasks Management" ADVANCED_SEARCH = "Advanced Search" + SIMULATION = "Simulation" diff --git a/server/nexusware.db b/server/nexusware.db index 6f6277748c8d45d626523a21b97b6abea043c333..bb5b9956b9c79d90fef0cb5967c75ec50f16e9f9 100644 GIT binary patch delta 799 zcmZo@5N&7>ogmHVI8nx#(Q#vfQ~l%*{w&j%y=RJ>%+lb`?96AgSy16EFArxUKL;lx zClD|QZ1(TF;mG(ADDjwYGWY%0T)~;Sr8$WunfZB}9=ze_MsNi-e}8YefrITd1OjzT zX7f{(;A3E9V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