Compare commits
3 Commits
fix/delete
...
fix/sse-ur
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e9bf52082 | ||
|
|
383eefce9c | ||
|
|
1676b3e1a0 |
8
freecad/resources/icons/silo-rollback.svg
Normal file
8
freecad/resources/icons/silo-rollback.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#cba6f7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<!-- Counter-clockwise arrow -->
|
||||
<polyline points="1 4 1 10 7 10" stroke="#f38ba8"/>
|
||||
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10" stroke="#cba6f7"/>
|
||||
<!-- Clock hands -->
|
||||
<line x1="12" y1="7" x2="12" y2="12" stroke="#89dceb" stroke-width="1.5"/>
|
||||
<line x1="12" y1="12" x2="15" y2="14" stroke="#89dceb" stroke-width="1.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 493 B |
7
freecad/resources/icons/silo-status.svg
Normal file
7
freecad/resources/icons/silo-status.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#cba6f7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<!-- Shield shape -->
|
||||
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" fill="#313244"/>
|
||||
<!-- Status bars -->
|
||||
<line x1="8" y1="10" x2="16" y2="10" stroke="#a6e3a1" stroke-width="1.5"/>
|
||||
<line x1="8" y1="14" x2="13" y2="14" stroke="#89dceb" stroke-width="1.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 435 B |
6
freecad/resources/icons/silo-tag.svg
Normal file
6
freecad/resources/icons/silo-tag.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#cba6f7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<!-- Tag shape -->
|
||||
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" fill="#313244"/>
|
||||
<!-- Tag hole -->
|
||||
<circle cx="7" cy="7" r="1.5" fill="#cba6f7" stroke="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 373 B |
@@ -1998,15 +1998,18 @@ class Silo_BOM:
|
||||
|
||||
obj = get_tracked_object(doc)
|
||||
if not obj:
|
||||
FreeCAD.Console.PrintError("No tracked Silo item in active document.\n")
|
||||
from PySide import QtGui as _qg
|
||||
|
||||
_qg.QMessageBox.warning(
|
||||
reply = QtGui.QMessageBox.question(
|
||||
None,
|
||||
"BOM",
|
||||
"This document is not registered with Silo.\nUse Silo > New to register it first.",
|
||||
"This document is not registered with Silo.\n\nRegister it now?",
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
||||
)
|
||||
return
|
||||
if reply != QtGui.QMessageBox.Yes:
|
||||
return
|
||||
FreeCADGui.runCommand("Silo_New")
|
||||
obj = get_tracked_object(doc)
|
||||
if not obj:
|
||||
return
|
||||
|
||||
part_number = obj.SiloPartNumber
|
||||
|
||||
@@ -2428,7 +2431,7 @@ class SiloEventListener(QtCore.QThread):
|
||||
# -- SSE stream reader --------------------------------------------------
|
||||
|
||||
def _listen(self):
|
||||
url = f"{_get_api_url().rstrip('/')}/api/events"
|
||||
url = f"{_get_api_url().rstrip('/')}/events"
|
||||
headers = {"Accept": "text/event-stream"}
|
||||
headers.update(_get_auth_headers())
|
||||
req = urllib.request.Request(url, headers=headers, method="GET")
|
||||
|
||||
@@ -299,9 +299,7 @@ class SiloOrigin:
|
||||
Created App.Document or None
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_New")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
FreeCADGui.runCommand("Silo_New")
|
||||
return FreeCAD.ActiveDocument
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo new document failed: {e}\n")
|
||||
@@ -322,9 +320,7 @@ class SiloOrigin:
|
||||
if not identity:
|
||||
# No identity - show search dialog
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_Open")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
FreeCADGui.runCommand("Silo_Open")
|
||||
return FreeCAD.ActiveDocument
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo open failed: {e}\n")
|
||||
@@ -354,9 +350,7 @@ class SiloOrigin:
|
||||
Opened App.Document or None
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_Open")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
FreeCADGui.runCommand("Silo_Open")
|
||||
return FreeCAD.ActiveDocument
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo open failed: {e}\n")
|
||||
@@ -473,10 +467,8 @@ class SiloOrigin:
|
||||
True if command was executed
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_Commit")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
return True
|
||||
FreeCADGui.runCommand("Silo_Commit")
|
||||
return True
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo commit failed: {e}\n")
|
||||
return False
|
||||
@@ -493,10 +485,8 @@ class SiloOrigin:
|
||||
True if command was executed
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_Pull")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
return True
|
||||
FreeCADGui.runCommand("Silo_Pull")
|
||||
return True
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo pull failed: {e}\n")
|
||||
return False
|
||||
@@ -513,10 +503,8 @@ class SiloOrigin:
|
||||
True if command was executed
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_Push")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
return True
|
||||
FreeCADGui.runCommand("Silo_Push")
|
||||
return True
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo push failed: {e}\n")
|
||||
return False
|
||||
@@ -530,9 +518,7 @@ class SiloOrigin:
|
||||
doc: FreeCAD App.Document
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_Info")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
FreeCADGui.runCommand("Silo_Info")
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo info failed: {e}\n")
|
||||
|
||||
@@ -545,9 +531,7 @@ class SiloOrigin:
|
||||
doc: FreeCAD App.Document
|
||||
"""
|
||||
try:
|
||||
cmd = FreeCADGui.Command.get("Silo_BOM")
|
||||
if cmd:
|
||||
cmd.Activated()
|
||||
FreeCADGui.runCommand("Silo_BOM")
|
||||
except Exception as e:
|
||||
FreeCAD.Console.PrintError(f"Silo BOM failed: {e}\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user