-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1032 from nstelter-slac/tutorial_ioc
ENH: Add new PCASpy server for running the tutorial.
- Loading branch information
Showing
24 changed files
with
1,787 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _Install: | ||
|
||
========================= | ||
Installation | ||
========================= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,42 @@ | ||
.. _Environment: | ||
.. _Setup: | ||
|
||
Setting up the Environment | ||
Tutorial Setup | ||
========================== | ||
|
||
.. _VirtualMachine: | ||
|
||
Virtual Machine | ||
PCASpy Server | ||
--------------- | ||
|
||
We provide a virtual machine disk that is the base for the application that will | ||
be developed during this tutorial. | ||
|
||
You can download the disk using this `Link <https://drive.google.com/a/stanford.edu/file/d/1SE4_oDF2wg_7ltKOIdJuZIqkpHzLUkbm/view?usp=sharing>`_. | ||
|
||
Using the Downloaded Disk | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
After downloading it, extract the ``.tar.gz`` file, create a new Virtual Machine at the virtualization client of your preference. | ||
|
||
The instructions below are for `Oracle VirtualBox <https://www.virtualbox.org/wiki/Downloads>`_ . | ||
Oracle VirtualBox is available for Windows, OS X and Linux hosts. | ||
|
||
This file is not a complete Virtual Machine dump that can be imported but instead a disk. | ||
|
||
In order to use this disk, start by creating a new virtual Machine, select Type as ``Linux`` and Version as ``Ubuntu (64-bit)``. | ||
Configure the amount of memory to use (something greater or equal 2048MB should do it. | ||
Make sure to select ``Use an existing virtual hard disk file.`` and select the extracted ``.vmdk`` file. | ||
|
||
.. figure:: /_static/tutorials/new_vm.png | ||
:scale: 100 % | ||
:align: center | ||
:alt: Create new VM | ||
|
||
A `PCASpy <https://pcaspy.readthedocs.io/en/latest/>`_ server provides PVs for the tutorial files to read/write. | ||
|
||
Useful Virtual Machine Information | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
The server mimics some PVs of a motor and camera, and is located as follows: | ||
.. code-block:: bash | ||
User Account | ||
++++++++++++ | ||
======== ======== | ||
Username Password | ||
======== ======== | ||
user tutorial | ||
======== ======== | ||
examples/testing_ioc/pydm-tutorial-ioc | ||
.. _PythonEnv: | ||
Installing PCASpy from the documentation above and following the :ref:`pydm installation instructions<Install>` provides all needed prerequisites for this tutorial. | ||
|
||
Python Environment | ||
++++++++++++++++++ | ||
|
||
On this machine we are using Miniconda to handle our Python environment and dependencies. | ||
To have access to the environmnet please do: | ||
|
||
.. code-block:: bash | ||
source activate tutorial | ||
.. _IOCS: | ||
|
||
Simulated EPICS IOCs | ||
++++++++++++++++++++ | ||
|
||
This machine comes with simulated motors and cameras. | ||
The IOCs can be started through their launcher scripts available at: | ||
|
||
.. code-block:: bash | ||
cd ~/tutorial/iocs_launcher | ||
# For the AreaDetector (cameras) simulation use | ||
./simDetector | ||
Using the PCASpy Server | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
# For the simulated motor axis use | ||
./simMotor | ||
.. note:: | ||
You will need to export the following variable in each terminal that will run either the PCASpy server or pydm: | ||
.. code-block:: bash | ||
# For the linking IOC | ||
./simLinker | ||
export EPICS_CA_MAX_ARRAY_BYTES=300000 | ||
For AreaDetector (cameras): | ||
Run the server as follows: | ||
.. code-block:: bash | ||
- The prefix for the PVs is ``13SIM1:`` so we have: ``13SIM1:cam1`` as well as ``13SIM1:cam2`` available. | ||
./examples/testing_ioc/pydm-tutorial-ioc | ||
For Motor Axis: | ||
In another terminal window, enable the sever's running state: | ||
.. code-block:: bash | ||
- The prexif for the PVs is ``IOC:`` so we have: ``IOC:m1 .. IOC:m8`` | ||
caput IOC:Run 1 | ||
The server will now be running and the tutorial files can access the necessary PV's. | ||
|
||
Creating your own environment | ||
----------------------------- | ||
In another (third) terminal window, the completed tutorial files can be ran as follows: | ||
.. code-block:: bash | ||
If you decide to create your own environment and not use the Virtual Machine | ||
provided please refer to the `PyDM Documentation Website <http://slaclab.github.io/pydm/>`_ | ||
for an up-to-date dependency list as well as detailed installation instructions. | ||
pydm <tutorial_file_name>.ui|.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.