Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PyDM is next generation EDM! It's basically a combination of EDM and PyQt (if you don't know what PyQt is, it's what we use to make Python GUIs). The goal is to eventually migrate all existing Python GUIs to PyDM, and to make any new ones going forward in PyDM, all while version controlling them using git and GitHub. This tutorial will walk you through making a change to an existing PyDM panel and going through the review process to release it into production.

...

Tutorial

  1. Go to https://github.com/slaclab/devPanel

 

  1. Click "Fork" in the upper right

...

  1. corner 

...

  1. Image Modified

...

  1. Click the link that says [Your User Name]/devPanel (Mine says that I've already forked it, but yours should ask you where you want to fork it)
    Image Modified

 

  1. Click the green "Clone or Download" button and copy the ssh path. If you see what looks like a URL, click the blue "Use SSH" link right above it
    Image Modified

 

  1. Back on an OPI (or ssh'ed in), type "set_profile [Your Username]". This should take you to your personal physics directory. Make a new devPanel subdirectory
    Image Modified

 

  1. In that subdirectory, run "git init"
    Image Modified

 

  1. Still in that subdirectory, type "~/mgibbs/link_repo_to_github/link_repo_to_github.sh -i" and follow the prompts (if you don't feel like thinking about the AFS repo, you can use this default, but you should paste in the GitHub ssh link you got in Step 4 for your fork or you'll connect to mine! You'll get slightly different messages since I've already run this before)
    Image Modified

 

  1. Type "git pull origin master" and type in your password when prompted (again, messages will be slightly different since I've done this before)
    Image Modified

...

  1. Type "source use_pydm.sh"
     Image Modified

...

  1. Type "mkdir [Your Name]" and head into that directory
     Image Modified

 

  1. Type "designer &"

...

  1. Image Modified

...

  1. Sometimes you get an error saying something about backup files. Ignore it(: In the program that opens, click "Widget" and then "Create"
     Image Modified

 

  1. In the Widget box on the left, scroll all the way down and drag a drop a PyDMShellCommand somewhere in the widget that popped up in the last step
    Image Modified

 

  1. Right click anywhere in the widget that isn't the tiny shell command button, hover over "layout" at the bottom, and click "lay out in a grid"
     Image Modified

 

  1. In the Object Inspector in the top right, rename that button something more descriptive by double clicking it, typing the new name, and pressing enter
     Image Modified

 

  1. Right click the button itself and click "Change text..."
     Image Modified

 

  1. Rename it something more descriptive and press enter

...

  1. Image Modified

...

  1. In the property/value table in the middle right, scroll all the way down to "commands," double click the value box (it'll be blank at first, and then it'll be a button that says "Change String List"), Click "New", type "pydm ~/opsTools/devPanel/example/example.py", then click "OK". This will launch the production example panel! 

...

  1. Image Modified

...

  1. Save this file as devPanel[Your Name].ui
    Image Modified

...

  1. From here, open opsDevPanel.ui from the parent directory (~/[your username]/devPanel)
    Image Modified

 

  1. Drag and drop a PyDMRelatedDisplayButton onto the newly opened devPanel.

...

  1. ui 

...

  1. Image Modified

 

  1. Right click rename the button itself and its object name like before
    Image Modified

 

  1. Add the path to your personal dev panel in your subdirectory and save
     Image Modified

...

  1. Back in your terminal in the devPanel directory, run "pydm opsDevPanel.ui" and you should see your creation! Feel free to play with it until it looks good to you!
    Image Modified
    Image Modified
    Image Modified

 

  1. Run "git status" to see what's changed. It should be opsDevPanel.ui and a new folder with your name
    Image Modified

...

  1. Run "git add [YOUR NEW FOLDER]" and "git add opsDevPanel.ui", then run another git status. They should both be staged for

...

  1. commit
    Image Modified

 

  1. Run git commit -m "adding [YOUR NAME]'s dev panel"
    Image Modified

 

  1. Run "git push origin master" and log in when prompted
     Image Modified

 

  1. Back on your fork on GitHub, click "New Pull Request"
     Image Modified

 

  1. Click "Create Pull Request"
    Image Modified

 

  1. Add slaclab/ops as a reviewer (by clicking on the gear and then searching), and then click "Create pull request"
    Image Modified

...

  1. An admin will look at it to make sure that nothing important got deleted, and if they approve it, they'll merge it into production!

...

Afterword: Updating Your Personal Repo

...