Split of getStringParts function

Spit into `getMainStringParts` and `getTailStringParts` so we can easily differentiate between the two in the front-end.

Cura-9773
This commit is contained in:
c.lamboo 2022-11-28 13:10:52 +01:00
parent 5ed572779d
commit 8e8437eab0
3 changed files with 40 additions and 8 deletions

View file

@ -16,16 +16,25 @@ class ActiveQuality:
layer_height: float = None # Layer height of quality in mm. For example 0.4
is_experimental: bool = False # If the quality experimental.
def getStringParts(self) -> List[str]:
def getMainStringParts(self) -> List[str]:
string_parts = []
if self.custom_profile is not None:
string_parts.append(self.custom_profile)
if self.intent_category is not "default":
string_parts.append(f"{self.intent_name} - {self.profile}")
else:
string_parts.append(self.profile)
if self.intent_category is not "default":
string_parts.append(self.intent_name)
return string_parts
def getTailStringParts(self) -> List[str]:
string_parts = []
if self.custom_profile is not None:
string_parts.append(self.profile)
if self.intent_category is not "default":
string_parts.append(self.intent_name)
if self.layer_height:
string_parts.append(f"{self.layer_height}mm")
@ -35,3 +44,5 @@ class ActiveQuality:
return string_parts
def getStringParts(self) -> List[str]:
return self.getMainStringParts() + self.getTailStringParts()