Skip to content

Marc/dragndrop#1693

Open
Masc999 wants to merge 27 commits intomasterfrom
marc/dragndrop
Open

Marc/dragndrop#1693
Masc999 wants to merge 27 commits intomasterfrom
marc/dragndrop

Conversation

@Masc999
Copy link
Copy Markdown
Collaborator

@Masc999 Masc999 commented Apr 12, 2024

ScreenDesigner Alpha v0.1

  • Ready for review

Checklist

  • I have completed a self review
  • I have added the relevant labels to this PR
  • I have updated documentation (if applicable)
  • I have run the unit tests suite and they pass
  • I have updated the change log

Description

The screen_designer_app is a separate app. It's porpuse is to design screens directly in there without the need of manually writing a builder string or python code.
When saving, useable python code is generated. The just generated file can be loaded directly so any errors will appear instantly.
Handles both kivy and python imports needed by the widgets on the screen.
special comment markers take care of not overwriting "user code" when an existing screen gets modified later on.

Notes

Dependencies for merge

Testing

Visual Test

  • Not applicable
  • Own computer
  • Console 7"
  • Console 10"

Function Test

  • Not applicable
  • Own computer
  • Console 7"
  • Console 10"

Unit Tests

  • Not applicable
  • Completed

Screenshots (if applicable)

image

image

pos: self.parent.pos
Image:
source: "./asmcnc/skavaUI/img/go_datum_y.png"
source: pu.get_path('go_datum_y.png')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be interested to see whether using get_path so often will cause a performance hit in the future (with existing searches, it's taking 4s on startup on a pi). Suggest we use the Kivy resources functions (see #code-focus) alongside some relative paths (yes, a pain to refactor but much quicker)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had this marked as "for later". Had a look at it now and it seems like a good idea to implement.

@Masc999 Masc999 added this to the 2.9.1 milestone Apr 17, 2024


@staticmethod
def screenname_to_filename(name_to_convert, reverse=False):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need @staticmethod? could make it into a function instead

screen = screen_class()
return screen
except ImportError as ex:
Logger.exception(ex)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Logger.exception should already output the exception traceback, might be worth instead having a hint message inside.


def screen_name_input_focus(self, instance, state):
if state:
InspectorSingleton().disable_key_input()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store singleton instead of "creating" twice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants