Add group_id and fix remove printer

CURA-6483

 - Added a unique group_id (a GUID) to all created GlobalStack.
 - Changed version upgrade to generate unique group_ids for
   GlobalStacks.
 - RemoveMachine() now uses group_ids to remove hidden GlobalStacks.
This commit is contained in:
Lipu Fei 2019-04-29 14:33:48 +02:00
parent 56c0cae71f
commit d16da3da3a
3 changed files with 16 additions and 3 deletions

View file

@ -4,6 +4,8 @@
from collections import defaultdict
import threading
from typing import Any, Dict, Optional, Set, TYPE_CHECKING, List
import uuid
from PyQt5.QtCore import pyqtProperty, pyqtSlot, pyqtSignal
from UM.Decorators import override
@ -33,6 +35,7 @@ class GlobalStack(CuraContainerStack):
super().__init__(container_id)
self.setMetaDataEntry("type", "machine") # For backward compatibility
self.setMetaDataEntry("group_id", str(uuid.uuid4())) # Assign a new GlobalStack to a unique group by default
self._extruders = {} # type: Dict[str, "ExtruderStack"]