Skip to content

Commit

Permalink
Merge pull request #1038 from ISISComputingGroup/master
Browse files Browse the repository at this point in the history
Merge master into 6.0.0
  • Loading branch information
John-Holt-Tessella authored Jan 31, 2020
2 parents 34ed712 + f934ed2 commit 938306d
Show file tree
Hide file tree
Showing 20 changed files with 271 additions and 83 deletions.
5 changes: 1 addition & 4 deletions base/uk.ac.stfc.isis.ibex.e4.client.product/ibex.product
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-clearPersistedState
</programArgs>
<vmArgs>-Xms40m
-Xmx512m
-Xmx1024m
-Dpython.console.encoding=UTF-8
-Dpython.import.site=false
-XX:+CreateCoredumpOnCrash
Expand All @@ -27,20 +27,17 @@

<windowImages i16="platform:/plugin/uk.ac.stfc.isis.ibex.e4.product/icons/IBEX-icon-web16.gif" i32="platform:/plugin/uk.ac.stfc.isis.ibex.e4.product/icons/IBEX-icon-web32.gif" i48="platform:/plugin/uk.ac.stfc.isis.ibex.e4.product/icons/IBEX-icon-web48.gif" i64="platform:/plugin/uk.ac.stfc.isis.ibex.e4.product/icons/IBEX-icon-web64.gif"/>


<launcher name="ibex-client">
<win useIco="true">
<ico path="../uk.ac.stfc.isis.ibex.e4.client.product/icons/ibex.ico"/>
<bmp/>
</win>
</launcher>


<vm>
<windows include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</windows>
</vm>


<plugins>
</plugins>

Expand Down
2 changes: 1 addition & 1 deletion base/uk.ac.stfc.isis.ibex.e4.client/Application.e4xmi
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
</children>
</children>
<children xsi:type="basic:PartSashContainer" xmi:id="_krh18KkREeeNfrob_9kcDA" elementId="uk.ac.stfc.isis.ibex.e4.client.partsashcontainer.14" containerData="70" horizontal="true">
<children xsi:type="advanced:Placeholder" xmi:id="_234KUBH9Eeq6Ie-xR-8O0g" elementId="uk.ac.stfc.isis.ibex.e4.client.placeholder.17" ref="_yrd0QBH9Eeq6Ie-xR-8O0g"/>
<children xsi:type="advanced:Placeholder" xmi:id="_234KUBH9Eeq6Ie-xR-8O0g" elementId="uk.ac.stfc.isis.ibex.e4.client.placeholder.17" containerData="50" ref="_yrd0QBH9Eeq6Ie-xR-8O0g"/>
<children xsi:type="basic:PartStack" xmi:id="_WuLscIXrEeib1Ij4B5lomQ" elementId="uk.ac.stfc.isis.ibex.e4.client.partstack.32" toBeRendered="false" containerData="50">
<children xsi:type="basic:Part" xmi:id="_7Zl3sIXbEeiCJ_qZ_3IIBQ" elementId="uk.ac.stfc.isis.ibex.ui.graphing.MatplotlibOpiTargetView" toBeRendered="false" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Plot" closeable="true"/>
</children>
Expand Down
95 changes: 94 additions & 1 deletion base/uk.ac.stfc.isis.ibex.opis/resources/danfysik_calibrated.opi
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<foreground_color>
<color name="ISIS_OPI_Foreground" red="192" green="192" blue="192" />
</foreground_color>
<height>323</height>
<height>355</height>
<lock_children>false</lock_children>
<macros>
<include_parent_macros>true</include_parent_macros>
Expand Down Expand Up @@ -1297,6 +1297,99 @@ $(pv_value)</tooltip>
<x>201</x>
<y>64</y>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.Label" version="1.0.0">
<actions hook="false" hook_all="false" />
<auto_size>false</auto_size>
<background_color>
<color name="ISIS_Label_Background" red="240" green="240" blue="240" />
</background_color>
<border_color>
<color name="ISIS_Border" red="0" green="0" blue="0" />
</border_color>
<border_style>0</border_style>
<border_width>1</border_width>
<enabled>true</enabled>
<font>
<opifont.name fontName="Segoe UI" height="9" style="1" pixels="false">ISIS_Label_NEW</opifont.name>
</font>
<foreground_color>
<color name="ISIS_Standard_Text" red="0" green="0" blue="0" />
</foreground_color>
<height>20</height>
<horizontal_alignment>2</horizontal_alignment>
<name>Label_3</name>
<rules />
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<scripts />
<show_scrollbar>false</show_scrollbar>
<text>Calib. File:</text>
<tooltip></tooltip>
<transparent>false</transparent>
<vertical_alignment>1</vertical_alignment>
<visible>true</visible>
<widget_type>Label</widget_type>
<width>90</width>
<wrap_words>true</wrap_words>
<wuid>13c4dcd4:16f9b32942a:-74d0</wuid>
<x>5</x>
<y>300</y>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.TextUpdate" version="1.0.0">
<actions hook="false" hook_all="false" />
<alarm_pulsing>false</alarm_pulsing>
<auto_size>false</auto_size>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<background_color>
<color name="ISIS_Label_Background" red="240" green="240" blue="240" />
</background_color>
<border_alarm_sensitive>true</border_alarm_sensitive>
<border_color>
<color name="ISIS_Border" red="0" green="0" blue="0" />
</border_color>
<border_style>0</border_style>
<border_width>1</border_width>
<enabled>true</enabled>
<font>
<opifont.name fontName="Segoe UI" height="9" style="0" pixels="false">ISIS_Value_NEW</opifont.name>
</font>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<foreground_color>
<color name="ISIS_Standard_Text" red="0" green="0" blue="0" />
</foreground_color>
<format_type>0</format_type>
<height>20</height>
<horizontal_alignment>0</horizontal_alignment>
<name>Text Update_2</name>
<precision>0</precision>
<precision_from_pv>true</precision_from_pv>
<pv_name>$(PV_ROOT)FIELD:CALIB.SPEC</pv_name>
<pv_value />
<rotation_angle>0.0</rotation_angle>
<rules />
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<scripts />
<show_units>true</show_units>
<text>######</text>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
<transparent>true</transparent>
<vertical_alignment>1</vertical_alignment>
<visible>true</visible>
<widget_type>Text Update</widget_type>
<width>182</width>
<wrap_words>false</wrap_words>
<wuid>13c4dcd4:16f9b32942a:-74c6</wuid>
<x>105</x>
<y>300</y>
</widget>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.ActionButton" version="2.0.0">
<actions hook="false" hook_all="false" />
Expand Down
2 changes: 1 addition & 1 deletion base/uk.ac.stfc.isis.ibex.opis/resources/fermi_chopper.opi
Original file line number Diff line number Diff line change
Expand Up @@ -4162,7 +4162,7 @@ $(pv_value)</tooltip>
<path/>
<scriptText>import webbrowser

webbrowser.open("https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/FZJ_Fermi_chopper")
webbrowser.open("http://shadow.nd.rl.ac.uk/ibex_user_manual/FZJ-Fermi-Chopper")
</scriptText>
<embedded>true</embedded>
<description/>
Expand Down
2 changes: 1 addition & 1 deletion base/uk.ac.stfc.isis.ibex.opis/resources/kepco.opi
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ $(pv_value)</tooltip>
<widget typeId="org.csstudio.opibuilder.widgets.Label" version="1.0.0">
<actions hook="true" hook_all="false">
<action type="OPEN_WEBPAGE">
<hyperlink>https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/Kepco</hyperlink>
<hyperlink>http://shadow.nd.rl.ac.uk/ibex_user_manual/Kepco-Power-Supply</hyperlink>
<description>Kepco IOC specific information</description>
</action>
</actions>
Expand Down
2 changes: 1 addition & 1 deletion base/uk.ac.stfc.isis.ibex.opis/resources/matplotlib.opi
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<path/>
<scriptText>import webbrowser

webbrowser.open("https://github.com/ISISComputingGroup/ibex_user_manual/wiki/Matplotlib")
webbrowser.open("http://shadow.nd.rl.ac.uk/ibex_user_manual/Matplotlib")
</scriptText>
<embedded>true</embedded>
<description/>
Expand Down
2 changes: 1 addition & 1 deletion base/uk.ac.stfc.isis.ibex.opis/resources/template.opi
Original file line number Diff line number Diff line change
Expand Up @@ -4049,7 +4049,7 @@ $(pv_value)</tooltip>
<widget typeId="org.csstudio.opibuilder.widgets.Label" version="1.0.0">
<actions hook="true" hook_all="false">
<action type="OPEN_WEBPAGE">
<hyperlink>https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/Kepco</hyperlink>
<hyperlink>http://shadow.nd.rl.ac.uk/ibex_user_manual/Kepco-Power-Supply</hyperlink>
<description>Kepco IOC specific information</description>
</action>
</actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def getParameters(self) -> list:

return ListConverter().convert(arguments, gateway._gateway_client)

def getHelp(self) -> str:
"""
Returns:
A string to be displayed in the script generator UI to help a user when using a config.
"""
return self.action.get_help()

def doAction(self, action) -> Union[None, AnyStr]:
"""
Executes the action with the parameters provided
Expand All @@ -66,7 +73,10 @@ def parametersValid(self, action) -> Union[None, AnyStr]:
Returns:
None if all parameters are valid, otherwise a String containing an error message.
"""
return self.action.parameters_valid(**action)
try:
return self.action.parameters_valid(**action)
except Exception as e:
return str(e) # If there is an error validating return to the user

def equals(self, other_config) -> bool:
""" Implement equals needed for py4j
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# pylint: skip-file

{% include inserted_config %}

def do_run():
def runscript():
config = DoRun()
{% for action in script_generator_actions -%}
config.run(**{{ action }})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ def parameters_valid(self, param1=0.0, param2=0.0):
return reason
else:
return None

def get_help(self):
return "Help"

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def test_GIVEN_config_return_valid_and_invalid_WHEN_get_generator_invalidity_rea
def test_GIVEN_valid_config_WHEN_generate_THEN_new_script_is_as_expected(self):
# Arrange
expected_script_lines: List[AnyStr] = \
"""from genie_python import genie as g
"""# pylint: skip-file
from genie_python import genie as g
from genie_python.genie_script_generator import ActionDefinition, cast_parameters_to
Expand All @@ -77,8 +79,10 @@ def parameters_valid(self, param1=0.0, param2=0.0):
else:
return None
def get_help(self):
return "Help"
def do_run():
def run_script():
config = DoRun()
config.run(**{'param1': '1', 'param2': '2'})
config.run(**{'param1': '1', 'param2': '2'})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ public interface Config {
*/
public String getName();

/**
* @return A string to be displayed in the script generator UI to help a user when using a config.
*/
public String getHelp();

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@ public void setConfig(Config config) {
}

/**
* @return An optional of the currently loaded configuration.
* @return The currently loaded config.
*/
public Config getConfig() {
return selectedConfig.get();
}


/**
* @return the parameters for the current configuration.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void setShowHiddenBlocks(boolean showHidden) {
*/
public synchronized void updateGroups(final Optional<List<DisplayGroup>> groups) {

this.displayGroups = HiddenGroupFilter.getVisibleGroups(groups, showHiddenBlocks);
this.displayGroups = groups;

display.syncExec(new Runnable() {
@Override
Expand Down Expand Up @@ -194,7 +194,8 @@ private void layoutGroups() {
}

private void addGroups() {
for (DisplayGroup group : displayGroups.orElseThrow(IllegalStateException::new)) {
Optional<List<DisplayGroup>> visibleGroups = HiddenGroupFilter.getVisibleGroups(displayGroups, showHiddenBlocks);
for (DisplayGroup group : visibleGroups.orElseThrow(IllegalStateException::new)) {
groups.add(groupWidget(group));
}
}
Expand Down
34 changes: 34 additions & 0 deletions base/uk.ac.stfc.isis.ibex.ui.dashboard.tests/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>uk.ac.stfc.isis.ibex.ui.dashboard.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Loading

0 comments on commit 938306d

Please sign in to comment.