Skip to content

Commit 904868f

Browse files
committed
gui
1 parent becab7a commit 904868f

40 files changed

+109
-215
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.venv/
33
ibex_developers_manual.egg-info/
44
build/
5+
_build/

doc/Gui.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# IBEX GUI (Eclipse)
2+
3+
## Getting Started
4+
5+
```{toctree}
6+
:glob:
7+
:titlesonly:
8+
9+
client/Building-the-GUI
10+
client/GUI-Development-Workflow
11+
client/Maven-and-Tycho
12+
```
13+
14+
## Coding
15+
16+
```{toctree}
17+
:glob:
18+
:titlesonly:
19+
20+
client/GUI-Coding-Conventions
21+
client/An-Introduction-to-Databinding
22+
client/Adding-a-Plugin-or-Feature-to-Maven-Build
23+
client/Connecting-a-View-to-a-PV
24+
client/Static-analysis
25+
client/Instrument-switching
26+
client/PV-Switching
27+
client/OPI-Creation
28+
client/Adding-a-Button-to-the-Perspective-Switcher
29+
```
30+
31+
## Testing
32+
33+
```{toctree}
34+
:glob:
35+
:titlesonly:
36+
37+
client/An-Introduction-to-Unit-Testing
38+
client/Adding-Unit-Tests
39+
client/Using-Mockito-for-Testing-in-the-GUI
40+
client/System-Testing-with-Squish
41+
client/Test-naming
42+
```
43+
44+
# Web Dashboard

doc/Processes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ processes/Tickets-and-their-Workflow
99
processes/Umbrella-Tickets
1010
processes/Dependency-Updates
1111
processes/External-Contributions
12+
processes/Component-and-Activity-Stewards
1213
```
1314

1415
# Meetings
@@ -25,6 +26,7 @@ processes/Sprint-Planning
2526
processes/Sprint-Review-and-Retro
2627
processes/Program-Increment-Planning
2728
processes/Technical-Debt-Stand-down
29+
processes/Code-Chats-and-Lightning-Talks
2830
```
2931

3032
## External meetings

doc/uncategorised/GUI_development/Testing/Adding-Unit-Tests.md renamed to doc/client/Adding-Unit-Tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Testing](GUI-Testing) > Adding tests
1+
# Adding tests
22

33
For more detailed information see [an_introduction_to_unit_testing.rst](https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/An-Introduction-to-Unit-Testing).
44

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > Adding a perspective
1+
# Adding a perspective
2+
23
![Perspective Switcher](GUI_development/images/adding_a_button_to_the_perspective_switcher/IBEX_complete_perspective_switcher_highlighted.png)
34

45

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > Adding a plugin or feature to Maven
1+
# Adding a plugin or feature to Maven
22

33
The steps for adding a plug-in (one small part of IBEX, such as the blocks view) or feature (a larger collection of plug-ins, such as CSS) to the maven build are below:
44

5-
# Step by step:
5+
## Step by step:
66
* Add the plug-in to `feature.base`:
77
* Open `feature.xml` in `uk.ac.stfc.isis.ibex.feature.base`
88
* Go to "Included Plug-ins" (or "Included Features") tab and click "Add..."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > Data binding
1+
# Data binding
22

33
Note: there are some helpful tips to common errors/mistakes [here](Databinding---common-mistakes).
44

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Testing](GUI-Testing) > An introduction to unit testing
2-
3-
# Unit Testing
1+
# An introduction to unit testing
42

53
To create unit tests for an Eclipse plug-in a Fragment Project is used. When creating a Fragment Project we assign the plug-in we wish to test as a Host Plug-in.
64
Eclipse automatically gives the Fragment access to the classes in the original plug-in.
@@ -218,9 +216,9 @@ From the results it can be seen that 63.2% of the StringManipulator code is used
218216
The code that isn't used is highlighted in red - for this example we can see that we need to write a test that tests the reverseString method.
219217

220218

221-
# Eclipse is complaining
219+
## Troubleshooting
222220

223-
## ClassNotFoundException
221+
### ClassNotFoundException
224222

225223
Running the tests in Eclipse might crash with an error like:
226224

@@ -244,14 +242,14 @@ This is a known bug and there is a workaround:
244242
* On the original dialog, click "Apply" and then "Run"
245243
* Hopefully, the tests will now work and you should be able to re-run them in the normal way
246244

247-
## Eclipse is not picking up new tests
245+
### Eclipse is not picking up new tests
248246

249247
If Eclipse is not picking up changes when you add tests you may need to change the default output folder for tests for Maven to pick it up.
250248

251249
* Right-click on the tests plug-in, go to properties, Java build path
252250
* Change the output folder to target/test-classes (you may need to create this folder first by clicking browse, selecting target and adding the test-classes folder)
253251
* If this does not work try deleting the target/test-classes folder first, if it existed already, and do a clean rebuild of the workspace
254252

255-
## IncompatibleClassChangeError
253+
### IncompatibleClassChangeError
256254

257255
If the tests are failing because of an IncompatibleClassChangeError error then the solution is to delete the bin and target folders for both the main plug-in and the corresponding test plug-in
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Getting started](GUI-Getting-Started) > Building the GUI
1+
# Building the GUI
22

33
Before building and running the GUI please make sure you have followed the steps from here: [First time installing and building (Windows)](First-time-installing-and-building-(Windows)). In particular make sure Git and genie_python are installed.
44

doc/uncategorised/GUI_development/Coding/Connecting-a-View-to-a-PV.md renamed to doc/client/Connecting-a-View-to-a-PV.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > Connecting a view to a PV
1+
# Connecting a view to a PV
22

33
See [An Introduction to Databinding](An-Introduction-to-Databinding) for a explanation of databinding.
44

File renamed without changes.

doc/uncategorised/GUI_development/Coding/GUI-Coding-Conventions.md renamed to doc/client/GUI-Coding-Conventions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > Conventions
1+
# Conventions
22

33
Contains the style and coding conventions for the IBEX GUI.
44

55
**New conventions should not be added to this document without first being discussed at a 'Code Chat'.**
66

7-
# Style Conventions #
7+
## Style Conventions #
88

99
Unless stated otherwise below we should follow the standard Java conventions for style where possible.
1010

@@ -163,7 +163,7 @@ class Point {
163163
}
164164
```
165165

166-
# Coding Conventions #
166+
## Coding Conventions ##
167167

168168
A mix of IBEX specific and general Java coding conventions.
169169

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Getting started](GUI-Getting-Started) > Development workflow
1+
# Development workflow
22

33
## Quick overview of workflow
44

doc/uncategorised/Instrument-switching.md renamed to doc/client/Instrument-switching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > [Instrument switching](Instrument-switching)
1+
# Instrument switching
22

33
Instrument switching in the GUI uses an extension point. This means that the switch can take place in a central place but then each plugin which is interested can sign up to the switching event. This keeps a separation between the plugins and the instrument switching module; i.e. a plugin can be removed without changing the instrument switching code.
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Getting started](GUI-Getting-Started) > Maven and Tycho
1+
# Maven and Tycho
22

33
The IBEX GUI is built using Tycho which is an extension of Maven designed for building Eclipse RCP products.
44

doc/uncategorised/GUI_development/Coding/OPI-Creation.md renamed to doc/client/OPI-Creation.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > OPI creation
1+
# OPI creation
22

3-
# Introduction
43
OPIs live in `ibex_gui\base\uk.ac.stfc.isis.ibex.opis\resources`
54

65
- Start CS-Studio to create/edit an OPI (see `EPICS\CSS\master\start_css.bat`)
@@ -71,7 +70,7 @@ In case an OPI's PV_root is defined in its parent, you need to go where to the p
7170
| ---- | ------- |
7271
| PV_ROOT | Root for all PVs within an OPI |
7372

74-
# Completing the OPI
73+
## Completing the OPI
7574

7675
Add the IOC name with appropriate information, including macros to the xml file
7776

@@ -91,12 +90,12 @@ Please follow [these guidelines](Synoptic-Icons) when specifying and creating ne
9190

9291
The final step should be to send the OPI to the instrument scientists. If they don't approve it that is fine but it is good to get their response.
9392

94-
# Testing
93+
## Testing
9594

9695
To start and interact with a testing IOC see [Running (and testing) IOC](Running-IOCs)
9796
The easiest way to test this is to run IBEX-gui through the eclipse editor. Create a device screen and use this to test. The device screen can be refreshed (right click -> refresh) to display the latest changes made in CSS editor.
9897

99-
# Debugging: No scrollbars
98+
## Debugging: No scrollbars
10099

101100
Check if you have stray widgets. An example of a stray widget might have:
102101

@@ -109,15 +108,15 @@ If you have a stray widget, it may prevent scrollbars from appearing on your OPI
109108
- XML sorter
110109
- Diff tool e.g. notepad++, winmerge
111110

112-
# Writing to char waveform PVs and displaying char waveforms as strings
111+
## Writing to char waveform PVs and displaying char waveforms as strings
113112

114113
CSS text input fields can write to char waveform PVs but needs to be set up in a special way. If you don't do this, the `NORD` field of the waveform will not be set correctly on write and the PV value will only be written successfully if NORD already has a large enough value.
115114
- Postfix the PV name with ` {"longString":true}` (note the space before the JSON). The final value in "PV Name" should look similar to the following: `$(PV_ROOT):ARBITRARY:SP {"longString":true}`
116115
- Ensure "Format Type" is "String"
117116

118117
Note: If waveform PV is being attached to a multi-line text box then user will have to `ctrl-enter` to save their changes.
119118

120-
# Data browser Graph Creation
119+
## Data browser Graph Creation
121120

122121
To make a databrowser graph on an OPI:
123122

@@ -130,15 +129,15 @@ To make a databrowser graph on an OPI:
130129
1. Add a `Data Browser` monitor to your opi
131130
1. In properties in file set the file you have created
132131

133-
# Activate tab
132+
## Activate tab
134133

135134
If it's required to activate a tab from a synoptic via a macro: (See SKF G5 Chopper OPI as an example.)
136135

137136
1. Put macro in local PV
138137
1. Create script that reads value
139138
1. Set active tab on tab container using `setActiveTabIndex`
140139

141-
# Create a Local Enum
140+
## Create a Local Enum
142141

143142
AS OF 05/02/2020 DOES NOT WORK.
144143

@@ -154,15 +153,15 @@ Or set the items from a script:
154153
combo.setItems( [ "Ene", "Mene", "Muh" ] )
155154
```
156155

157-
# Enable and disable controls
156+
## Enable and disable controls
158157

159158
If the enablement state of a widget (i.e. `enabled` property) is controlled as part of OPI logic, it can be made more obvious by also controlling its `transparent` property.
160159

161160
See `\base\uk.ac.stfc.isis.ibex.opis\resources\mercuryiTC\enablement_of_controls.py` for examples of setting properties based on the value of a PV.
162161

163162
Initial investigations centred on alternating the background colour of the control between e.g. `ISIS_Textbox_Readonly_Background` and `ISIS_Textbox_Background`. However, although the logic and syntax were sound, the OPI didn't faithfully reproduce the requested colours.
164163

165-
# Using OPI rules and external scripts
164+
## Using OPI rules and external scripts
166165

167166
When implementing display logic for OPIs (such as toggling an objects visibility based on a PV value) our standards are:
168167
1. Rules take preference over scripts for trivial logic

doc/uncategorised/GUI_development/Coding/PV-Switching.md renamed to doc/client/PV-Switching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > PV switching
1+
# PV switching
22

33
If you are only interested in how to create PVs in IBEX with proper switching behaviour go to "Using the PV Switching".
44

doc/uncategorised/GUI_development/Coding/Static-analysis.md renamed to doc/client/Static-analysis.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Coding](GUI-Coding) > Static analysis
1+
# Static analysis
22

33
We are currently making use of 3 static analysis tools to help ensure the quality of our code: [PMD](https://pmd.github.io/), [FindBugs](http://findbugs.sourceforge.net/), and [CheckStyle](https://checkstyle.sourceforge.io/). These particular tools are mostly intended for use with Java programs and as such our main use for them is the Eclipse GUI project, though they are also used on some Java code in the main EPICS project (specifically the IOC log server).
44

55
All of these tools have maven plugins which allow the analyses to be run as part of the maven build process, with the results being output to an XML file. Additionally, they all have Jenkins plugins which can consume the XML results files, producing reports and graphs within Jenkins and allowing you to track code quality trends over time. The Jenkins reports list all the specific violations which can be categorised in a number of ways and are listed with file name and line number as well as a detailed description of the problem.
66

7-
# Checkstyle
7+
## Checkstyle
88

99
Checkstyle is designed to enforce a set of highly configurable coding standards. It supports a very large number of rules including ones relating to naming conventions, annotations, javadoc comments, poor coding practices, etc. That rules that Checkstyle will check for violations of may be configured in an XML file.
1010

@@ -76,17 +76,17 @@ Or for multiple warnings:
7676
return hours * seconds_per_hour;
7777
}
7878
```
79-
# PMD
79+
## PMD
8080

8181
PMD focuses on potential coding problems such as unused or suboptimal code, code size and complexity, and good coding practices. Some typical rules include "Empty If Statement", "Broken Null Check", "Avoid Deeply Nested If Statements", "Switch Statements Should Have Defaults", etc. PMD will produce far fewer warnings/errors than checkstyle, however they are typically far more important, indicating technical problems with the code rather than merely stylistic ones, and should therefore be fixed whenever possible/sensible.
8282

83-
# FindBugs
83+
## FindBugs
8484

8585
FindBugs detects similar types of problems as PMD, though it can detect many additional serious problems such as potential null pointer exceptions, infinite loops, and unintentional access of the internal state of an object (to name a few). Unlike PMD, which checks through the source code, FindBugs actually checks through the applications bytecode for potential issues. FindBugs tends to find a smaller number of more important issues.
8686

8787
For both PMD and FindBugs, there are certain rules which, while generally sensible, may not apply to the project at hand. For example, on the Eclipse GUI project, FindBugs throws up a lot of problems involving writing to a static member from an instance method, however the Activator class in most Eclipse plugins make use of this construct.
8888

89-
# Maven
89+
## Maven
9090

9191
The tools may be run as part of a maven build by including them as plugins in the project's pom.xml. In the case of the Eclipse GUI, each plugin is included in the 'tycho.parent' pom.xml file, and is therefore used in every other project (Eclipse plugin) during the build.
9292

doc/uncategorised/System-Testing-with-Squish.md renamed to doc/client/System-Testing-with-Squish.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
> [Wiki](Home) > [The GUI](The-GUI) > [Testing](GUI-Testing) > [System testing with Squish](System-Testing-with-Squish)
1+
# Squish
22

3-
# Squish Licensing Information & Contact Details
3+
## Squish Licensing Information & Contact Details
44

55
we have one floating tester subscription and one floating execution subscription licence. The execution subscription is used by a build server to run tests, the tester subscription is used by us to develop tests. We can have at most one developer writing tests at a time, but we can all install the software on our machines. I don't yet know how the license system works e.g. if one developer forgets to close squish on their system, does it block everybody until they do? Or is there some timeout? We will have to experiment. See `license server` below for more details.
66

7-
# Set Up for local server
7+
## Set Up for local server
88

99
1. Install SQUISH/JAVA WINDOWS from `<isis experiment controls share>\squish`
1010
1. Read and accept the terms and conditions if still correct
@@ -39,11 +39,11 @@ You may also need to install `psutil` and `mysql-connector-python==8.0.11` throu
3939
4040
Once you have set up Squish via the steps above, you should be able to run a test suite to confirm everything is working. Note that you need the IBEX server running in the background, but not the client (which will be started by Squish when you run a test).
4141
42-
# RDP to Server
42+
## RDP to Server
4343
4444
It is possible to remote desktop to the squish server but when you disconnect you must use the "Disconnect from RDP" shortcut on the desktop. To do this you must be an Admin on the desktop.
4545
46-
# Setup For Build Server
46+
## Setup For Build Server
4747
4848
1. Install all the things needed for an instrument (Git, MySql, Java)
4949
1. Install Jenkins build system but run it from a command line.
@@ -60,7 +60,7 @@ It is possible to remote desktop to the squish server but when you disconnect yo
6060
1. Then disconnect the session using the shortcut on the desktop
6161
1. Leave the machine with an attached screen. I think this is needed to set the resolution when leaving remote desktop.
6262
63-
# Creating a new Test Suite
63+
## Creating a new Test Suite
6464
6565
1. Click File -> New test Suite ...
6666
1. New Test Suite:
@@ -72,11 +72,11 @@ It is possible to remote desktop to the squish server but when you disconnect yo
7272
1. Edit the test suite settings (select test suite in test suites tab. Then click on icon with blue spanner)
7373
1. Edit Object Map to be `..\objects.map`. You may not be able to do this from the Squish client depending on your version, in which case you can directly edit `suite.conf` in `/<System tests folder>/suite_<something>_tests/` (it should say `OBJECTMAP=..\objects.map`)
7474
75-
# System Testing The IBEX Script Generator with Squish BDD Tools
75+
## System Testing The IBEX Script Generator with Squish BDD Tools
7676
7777
The way we use Squish for testing the script generator is a bit different to the way we test the IBEX client. The method for testing is documented on the [System Testing The IBEX Script Generator with Squish BDD Tools](System-Testing-The-IBEX-Script-Generator-with-Squish-BDD-Tools) page. Some of the hints and tips from this page still apply e.g. using utilities such as `set_text_field`.
7878
79-
# Creating a new Test
79+
## Creating a new Test
8080
8181
A test contains one test case.
8282
@@ -102,7 +102,7 @@ A test contains one test case.
102102
<rest of test>
103103
```
104104
105-
# Writing tests
105+
## Writing tests
106106
107107
Hints, tips and gotchas for writing tests:
108108
@@ -117,7 +117,7 @@ Hints, tips and gotchas for writing tests:
117117
1. Save it and check it works by clicking highlight object; button should flash red.
118118
* Often `test.compare` and `test.verify` in Squish provides logs that aren't very useful, please do add a `test.log` line to describe the error.
119119
120-
# Other
120+
## Other
121121
122122
### Change Java that squish is using
123123
@@ -166,13 +166,13 @@ Frequency | Test | Error
166166
2 | tst_can_add_edit_and_delete_block_to_current_config | `RuntimeError: Property read failed: exception: java.lang.reflect.InvocationTargetException () org.eclipse.swt.SWTException: Widget is disposed` `Called from: C:\Jenkins\workspace\System_Tests_Squish\suite_configuration_tests\tst_can_add_edit_and_delete_block_to_current_config\test.py: 74`
167167
1 | tst_user_names_can_be_set | `LookupError: Object ':Experiment Details_Text' not found. Could not match properties: isvisible for object name: ':Experiment Details_Text' Called from: C:\Jenkins\workspace\System_Tests_Squish\suite_experiment_details_tests\tst_user_names_can_be_set\test.py: 19 C:\Jenkins\workspace\System_Tests_Squish\global_scripts\experiment_details.py: 19`
168168
169-
# License server
169+
## License server
170170
171171
This was setup as per https://doc.qt.io/squish/setting-up-the-squish-floating-license-server.html on `control-svcs.isis.cclrc.ac.uk` in the directory `/usr/local/squish-licenceserver` the service is automatically started at boot time vis systemd, the file `squish-licenseserver.service` has the service details and is symbolically linked from the systemd `/etc/systemd/system` area. The log file is `/var/log/squish-licenseserver.log` and the service is running on the default port of 49345
172172
173173
To restart the licence server process use `sudo systemctl restart squish-licenseserver.service` on the licence server machine
174174
175-
# Troubleshooting
175+
## Troubleshooting
176176
177177
### Squish fails to run tests with an error in the C runtime library
178178

0 commit comments

Comments
 (0)