Skip to content

Commit

Permalink
fixes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Apr 27, 2016
1 parent b91df94 commit 8102d1b
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 127 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
CHANGES
=======

:2016.0427.0: change line endings in manage.sh
:2016.0425.0: improve the setup of manage.sh on Linux
:2016.0424.0: user can add additional file extension patterns
:2016.0423.0: fix setup flaw
Expand Down
2 changes: 1 addition & 1 deletion src/pvWebMonitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__description__ = u'post EPICS PVs to read-only web page'
__long_description__ = __description__

__version__ = u'2016.0425.0'
__version__ = u'2016.0427.0'
__release__ = __version__
__author__ = u'Pete R. Jemian'
__email__ = u'[email protected]'
Expand Down
90 changes: 45 additions & 45 deletions src/pvWebMonitor/project/pvlist.xml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="pvlist.xsl" ?>

<!-- You can edit this file with a text editor -->

<pvwatch version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="local_schema pvlist.xsd">
<!-- (update version if format of XML file changes) -->

<definition name="mne">
one-word mnemonic reference used in python and xslt code
(mne should be unique for each EPICS_PV)
</definition>
<definition name="PV">
EPICS process variable name (must be used in only one EPICS_PV)
</definition>
<definition name="description">
useful text informative to others
</definition>
<definition name="display_format">
(optional, default="%s") PVs will be formatted for display with this string
</definition>
<definition name="_ignore_">
(optional, default="false") this PV is ignored if value is not "false"
</definition>


<EPICS_PV PV="morel:TOD" description="IOC current time" mne="tod"/>
<EPICS_PV PV="morel:STARTTOD" description="IOC boot time" mne="starttod"/>
<EPICS_PV PV="morel:UPTIME" description="time IOC running" mne="uptime"/>
<EPICS_PV PV="morel:HOSTNAME" description="IOC host name" mne="hostname"/>
<EPICS_PV PV="morel:ENGINEER" description="engineer" mne="engineer"/>

<EPICS_PV PV="morel:m1.RBV" description="VDM_Stripe motor" mne="VDM_Stripe" display_format="%.3f"/>
<EPICS_PV PV="morel:m1.VAL" description="VDM_Stripe motor target" mne="VDM_Stripe_VAL" display_format="%.3f"/>
<EPICS_PV PV="morel:m1.DMOV" description="VDM_Stripe motor done moving" mne="VDM_Stripe_DMOV"/>
<EPICS_PV PV="morel:m2.RBV" description="DCM_theta motor" mne="DCM_theta" display_format="%.6f"/>
<EPICS_PV PV="morel:m2.VAL" description="DCM_theta motor target" mne="DCM_theta_VAL" display_format="%.6f"/>
<EPICS_PV PV="morel:m2.DMOV" description="DCM_theta motor done moving" mne="DCM_theta_DMOV"/>

<EPICS_PV PV="morel:alldone" description="all motors done moving" mne="motors_alldone"/>
<EPICS_PV PV="morel:moving" description="number of motors moving" mne="motors_moving"/>

</pvwatch>
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="pvlist.xsl" ?>

<!-- You can edit this file with a text editor -->

<pvwatch version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="local_schema pvlist.xsd">
<!-- (update version if format of XML file changes) -->

<definition name="mne">
one-word mnemonic reference used in python and xslt code
(mne should be unique for each EPICS_PV)
</definition>
<definition name="PV">
EPICS process variable name (must be used in only one EPICS_PV)
</definition>
<definition name="description">
useful text informative to others
</definition>
<definition name="display_format">
(optional, default="%s") PVs will be formatted for display with this string
</definition>
<definition name="_ignore_">
(optional, default="false") this PV is ignored if value is not "false"
</definition>


<EPICS_PV PV="morel:TOD" description="IOC current time" mne="tod"/>
<EPICS_PV PV="morel:STARTTOD" description="IOC boot time" mne="starttod"/>
<EPICS_PV PV="morel:UPTIME" description="time IOC running" mne="uptime"/>
<EPICS_PV PV="morel:HOSTNAME" description="IOC host name" mne="hostname"/>
<EPICS_PV PV="morel:ENGINEER" description="engineer" mne="engineer"/>

<EPICS_PV PV="morel:m1.RBV" description="VDM_Stripe motor" mne="VDM_Stripe" display_format="%.3f"/>
<EPICS_PV PV="morel:m1.VAL" description="VDM_Stripe motor target" mne="VDM_Stripe_VAL" display_format="%.3f"/>
<EPICS_PV PV="morel:m1.DMOV" description="VDM_Stripe motor done moving" mne="VDM_Stripe_DMOV"/>
<EPICS_PV PV="morel:m2.RBV" description="DCM_theta motor" mne="DCM_theta" display_format="%.6f"/>
<EPICS_PV PV="morel:m2.VAL" description="DCM_theta motor target" mne="DCM_theta_VAL" display_format="%.6f"/>
<EPICS_PV PV="morel:m2.DMOV" description="DCM_theta motor done moving" mne="DCM_theta_DMOV"/>

<EPICS_PV PV="morel:alldone" description="all motors done moving" mne="motors_alldone"/>
<EPICS_PV PV="morel:moving" description="number of motors moving" mne="motors_moving"/>

</pvwatch>
158 changes: 79 additions & 79 deletions src/pvWebMonitor/project/rawdata.xsl
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
# Copyright (c) 2005-2015, UChicago Argonne, LLC.
# See LICENSE file for details.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
description="XSLT file to display the raw values of monitored EPICS PVs"
>

<xsl:template match="/">
<html>
<head>
<title>pvWebMonitor: EPICS process variables</title>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Refresh" content="1200"/><xsl:comment> update page every 20 minutes </xsl:comment>
</head>
<body>
<h1>pvWebMonitor: raw PV data from EPICS</h1>
<p>written by: <xsl:value-of select="/pvWebMonitor/written_by"/></p>
<p>date/time stamp: <xsl:value-of select="/pvWebMonitor/datetime"/></p>

<hr />

<h2> EPICS process variables (sorted by id) </h2>
<table border="2">
<tr style="background-color: grey; color: white;">
<th>name</th>
<th><b>id</b></th>
<th>description</th>
<th>value</th>
<th>units</th>
<th>timestamp</th>
</tr>
<xsl:apply-templates select="pvWebMonitor/pv"/>
</table>

<hr />
<p>
<small>
data gathered by: <tt><xsl:value-of select="/pvWebMonitor/written_by"/></tt>
</small>
</p>
<p>
<small>
report page: <tt>rawdata.xsl</tt>
</small>
</p>
</body>
</html>
</xsl:template>

<xsl:template match="pv">
<tr>
<xsl:if test="position() mod 2=0">
<xsl:attribute name="bgcolor">Azure</xsl:attribute>
</xsl:if>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="description"/></td>
<td><xsl:value-of select="value"/></td>
<td><xsl:value-of select="units"/></td>
<td><xsl:value-of select="timestamp"/></td>
</tr>
</xsl:template>

<xsl:template match="scan">
<tr>
<xsl:if test="position() mod 2=0">
<xsl:attribute name="bgcolor">Azure</xsl:attribute>
</xsl:if>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="@key"/></td>
<td><xsl:value-of select="@specfile"/></td>
</tr>
</xsl:template>

</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!--
# Copyright (c) 2005-2015, UChicago Argonne, LLC.
# See LICENSE file for details.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
description="XSLT file to display the raw values of monitored EPICS PVs"
>

<xsl:template match="/">
<html>
<head>
<title>pvWebMonitor: EPICS process variables</title>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Refresh" content="1200"/><xsl:comment> update page every 20 minutes </xsl:comment>
</head>
<body>
<h1>pvWebMonitor: raw PV data from EPICS</h1>
<p>written by: <xsl:value-of select="/pvWebMonitor/written_by"/></p>
<p>date/time stamp: <xsl:value-of select="/pvWebMonitor/datetime"/></p>

<hr />

<h2> EPICS process variables (sorted by id) </h2>
<table border="2">
<tr style="background-color: grey; color: white;">
<th>name</th>
<th><b>id</b></th>
<th>description</th>
<th>value</th>
<th>units</th>
<th>timestamp</th>
</tr>
<xsl:apply-templates select="pvWebMonitor/pv"/>
</table>

<hr />
<p>
<small>
data gathered by: <tt><xsl:value-of select="/pvWebMonitor/written_by"/></tt>
</small>
</p>
<p>
<small>
report page: <tt>rawdata.xsl</tt>
</small>
</p>
</body>
</html>
</xsl:template>

<xsl:template match="pv">
<tr>
<xsl:if test="position() mod 2=0">
<xsl:attribute name="bgcolor">Azure</xsl:attribute>
</xsl:if>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="description"/></td>
<td><xsl:value-of select="value"/></td>
<td><xsl:value-of select="units"/></td>
<td><xsl:value-of select="timestamp"/></td>
</tr>
</xsl:template>

<xsl:template match="scan">
<tr>
<xsl:if test="position() mod 2=0">
<xsl:attribute name="bgcolor">Azure</xsl:attribute>
</xsl:if>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="@key"/></td>
<td><xsl:value-of select="@specfile"/></td>
</tr>
</xsl:template>

</xsl:stylesheet>
3 changes: 1 addition & 2 deletions src/pvWebMonitor/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def modify_manage_script(filename):
'''
customize the manage.sh script for the current setup
'''
# TODO: make the manage.sh script executable
if not os.path.exists(filename): return

manage_sh = open(filename, 'r').read()
Expand All @@ -51,7 +50,7 @@ def modify_manage_script(filename):
permissions = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
permissions |= stat.S_IRGRP | stat.S_IXGRP
permissions |= stat.S_IROTH | stat.S_IXOTH
os.chmod(manage_sh, permissions)
os.chmod(filename, permissions)


def main(new_directory):
Expand Down

0 comments on commit 8102d1b

Please sign in to comment.