### Kafka Installation - Initial Setup Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/alarm/Readme.md Commands to navigate to the examples directory, download and extract Kafka, and create a symbolic link. ```bash # The 'examples' folder of this project contains some example scripts # that can be used with a kafka server in the same directory cd examples # Use wget, 'curl -O', or web browser to fetch a recent version of kafka wget https://downloads.apache.org/kafka/3.6.1/kafka_2.13-3.6.1.tgz tar vzxf kafka_2.13-3.6.1.tgz ln -s kafka_2.13-3.6.1 kafka ``` -------------------------------- ### Start Example Database Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pva/README.md Command to start the example database for PVA testing. ```bash softIocPVA -m N='' -d src/test/resources/demo.db ``` -------------------------------- ### Start Postgres for the first time Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/databrowser-timescale/doc/1_InstallTimescaleDB.md Starts the PostgreSQL service and checks its status. ```bash sudo su postgres # /usr/pgsql-14/bin/pg_ctl -D /var/lib/pgsql/14/data -l logfile start export PGDATA=/var/lib/pgsql/14/data cd /var/lib/pgsql/14 /usr/pgsql-14/bin/pg_ctl -l logfile start cat logfile /usr/pgsql-14/bin/pg_ctl status ``` -------------------------------- ### Quick Start - Option 1: Use Host Redis Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/bluesky-services/README.md Starts the queue-server and http-server using Docker Compose, assuming Redis is already running on the host. ```bash cd services/bluesky-services docker-compose up -d queue-server http-server ``` -------------------------------- ### jpackage build step 2, Windows Source: https://github.com/controlsystemstudio/phoebus/blob/master/phoebus-product/README.md This command creates a Windows installer package (msi or exe) for the application, including options for menu group and shortcuts. ```bash jpackage --name --app-version --app-image --type [msi|exe] --win-menu --win-shortcut --win-menu-group ``` -------------------------------- ### Automated Startup Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/databrowser-timescale/doc/1_InstallTimescaleDB.md Enables and starts the PostgreSQL service using systemd. ```bash sudo systemctl status postgresql-14 sudo systemctl enable postgresql-14 sudo systemctl start postgresql-14 ``` -------------------------------- ### Kafka Installation - Manual Startup Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/alarm/Readme.md Commands to manually start Zookeeper and Kafka. ```bash # Zookeeper must be started first. sh start_zookeeper.sh # Then, in other terminal, start Kafka sh start_kafka.sh ``` -------------------------------- ### jpackage build step 2, MacOS Source: https://github.com/controlsystemstudio/phoebus/blob/master/phoebus-product/README.md This command creates a macOS installer package (pkg or dmg) for the application. ```bash jpackage --name --app-version --app-image .app --type [pkg|dmg] ``` -------------------------------- ### Install MySQL (Centos Example) Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/archive-engine/doc/index.rst Commands to install and start the MariaDB server on a CentOS system. ```bash sudo yum install mariadb-server sudo systemctl start mariadb /usr/bin/mysql_secure_installation sudo systemctl enable mariadb.service ``` -------------------------------- ### jpackage build step 2, Linux Source: https://github.com/controlsystemstudio/phoebus/blob/master/phoebus-product/README.md This command creates a Linux installer package (deb or rpm) for the application. ```bash jpackage --name --app-version --app-image --type [deb|rpm] ``` -------------------------------- ### Running a Secure IOC Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pva/TLS.md Example command to start a secure IOC with TLS enabled, specifying the server certificate. ```bash $ EPICS_PVAS_TLS_KEYCHAIN=~/.config/pva/1.3/server.p12 \ softIocPVX -m user=fred -d pvxs/test/testioc.db ``` -------------------------------- ### Kafka Installation - Systemd Service Setup Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/alarm/Readme.md Commands to copy service files, start, and enable Zookeeper, Kafka, and the alarm server as Linux services. ```bash sudo cp *.service /etc/systemd/system # Start manually sudo systemctl start zookeeper.service sudo systemctl start kafka.service sudo systemctl start alarm_server.service # Enable startup when host boots sudo systemctl enable zookeeper.service sudo systemctl enable kafka.service sudo systemctl enable alarm_server.service ``` -------------------------------- ### Start in server mode and open a resource Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to start Phoebus in server mode and then open a specific resource file. ```bash phoebus.sh -server 4918 -resource "/path/to/some/file.pvs" ``` -------------------------------- ### Client Command Example Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pva/src/test/resources/client.txt Example command to start a PVA client with debugging enabled and monitor a specific channel. ```bash EPICS_PVA_DEBUG=100 pvmonitor ramp ``` -------------------------------- ### Start with a specific layout Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to start Phoebus with a custom saved layout from a specified memento file. ```bash phoebus.sh -layout /path/to/mylayout.memento ``` -------------------------------- ### MQTT Examples Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pv/doc/index.rst Examples of referencing MQTT topics and VTypes. ```text mqtt://some_topic mqtt://some_topic mqtt://some_topic mqtt://some/nested/topic ``` -------------------------------- ### Start with clean workspace Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to start Phoebus with a clean workspace, ignoring any saved layout, application, or resource. ```bash phoebus.sh -clean ``` -------------------------------- ### Start Eclipse Source: https://github.com/controlsystemstudio/phoebus/blob/master/README.md Command to start Eclipse with specified environment variables. ```bash export JAVA_HOME=/path/to/your/jdk-17-or-later export PATH="$JAVA_HOME/bin:$PATH" eclipse/eclipse -consoleLog ``` -------------------------------- ### Start in server mode Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to start Phoebus in server mode on a specific TCP port, allowing for a single instance to be shared. ```bash phoebus.sh -server 4918 ``` -------------------------------- ### Example Preference Description Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/README.md An example of a preference file header and a setting. ```properties # -------------------------------- # Package the.phoebus.package.name # -------------------------------- # Description of some setting the_setting = default_value ``` -------------------------------- ### Start PVAClient Main Tool Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pva/README.md Command to start the PVAClient Main tool. ```bash pvaclient beacons -main org.epics.pva.client.PVAClientMain beacons ``` -------------------------------- ### Start PVASearchMonitor Tool Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pva/README.md Command to start the PVASearchMonitor tool. ```bash pvasearchmonitor -main org.epics.pva.server.PVASearchMonitorMain ``` -------------------------------- ### Authorization Configuration File Example Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/authorization.rst An example of an authorization configuration file showing how to define permissions for users. ```properties # Authorization Settings # # Format: # authorization = Comma-separated list of user names # # The authorization name describes the authorization. # FULL is a special name to obtain all authorizations. # # Each entry in the list of user names is a regular expression for a user name. # Anybody can lock a dock pane, i.e. set it to 'fixed' lock_ui = .* # Anybody can acknowledge alarms alarm_ack = .* # Specific users may configure alarms, including both "jane" and "janet" #alarm_config = fred, jane.*, egon, # Anybody can configure alarms alarm_config = .* # Full authorization. FULL = root ``` -------------------------------- ### System Time Offset Examples Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pv/doc/index.rst Examples of using sys://timeOffset with different parameters. ```text sys://timeOffset(12 hours) sys://timeOffset(1hour, time, 1) ``` -------------------------------- ### Alarm Configuration Example Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/alarm/ui/doc/index.rst An example of an alarm configuration file, demonstrating PV settings. ```xml field(EISV, "INVALID") field(INP, "0") field(PINI, "YES") ``` -------------------------------- ### Display Organization Example Source: https://github.com/controlsystemstudio/phoebus/wiki/Display-Builder-Compatibility Example of how displays can be organized hierarchically using absolute paths. ```shell /home/controls/displays/main.bob /home/controls/displays/motors/overview.bob /home/controls/displays/motors/template.bob /home/controls/displays/vacuum/overview.bob /home/controls/displays/vacuum/segment1.bob /home/controls/displays/vacuum/segment2.bob ``` -------------------------------- ### Complete build steps of manual and product Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/help_system.rst Steps to obtain sources, build the manual, and build the product, including generating HTML content from Javadoc and bundling the help files. ```bash # Obtain sources for documentation and product git clone https://github.com/kasemir/phoebus-doc.git git clone https://github.com/shomir/phoebus.git # Some application code may contain html content # that needs to be generated, for example from Javadoc ( cd phoebus/app/display/editor; ant -f javadoc.xml clean all ) # Building the manual will locate and include # all ../phoebus/applications/**/doc/index.rst ( cd phoebus-doc; make clean html ) # Windows: Use make.bat html # Fetch dependencies ( cd phoebus/dependencies; mvn clean install ) # Build the product, which bundles help from # ../phoebus-doc/build/html # as phoebus-product/target/doc ( cd phoebus; ant clean dist ) # Could now run the product ( cd phoebus/phoebus-product; sh phoebus.sh ) # or distribute the ZIP file, # phoebus/phoebus-product/target/phoebus-0.0.1.zip ``` -------------------------------- ### Command Line Launch Examples Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/channel/views/doc/index.rst Examples of how to launch the Channel Viewer application from the command line using resource queries. ```bash -resource cf://?query=SR*&app=channel_tree ``` ```bash -resource cf://?query=SR*&app=channel_table ``` -------------------------------- ### Get a node example Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example JSON response for retrieving details of a node. ```JSON { "uniqueId": "ae9c3d41-5aa0-423d-a24e-fc68712b0894", "name": "CSX", "created": 1623701056000, "lastModified": 1623780701000, "nodeType": "FOLDER", "userName": "kunal", "tags": [] } ``` -------------------------------- ### Get a snapshot data example Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example JSON response when retrieving snapshot data. ```JSON { "uniqueId":"54920ffe-8932-46e6-b420-5b7b20d2cea1", "snapshotItems":[ { "configPv": { "pvName":"COUNTER10", "readOnly":false }, "value":{ "type":{ "name":"VDouble", "version":1 }, "value":11941.0, "alarm":{ "severity":"NONE", "status":"NONE", "name":"NO_ALARM" }, "time":{ "unixSec":1664550284, "nanoSec":870687555 }, "display":{ "lowDisplay":0.0, "highDisplay":0.0, "units":"" } } }, { "configPv":{ "pvName":"TEMP10", "readOnly":false }, "value":{ "type":{ "name":"VDouble", "version":1 }, "value":-4.205873713538651, "alarm":{ "severity":"MINOR", "status":"NONE", "name":"LOW_ALARM" }, "time":{ "unixSec":1664550284, "nanoSec":870768480 }, "display":{ "lowAlarm":-5.0, "highAlarm":30.0, "lowDisplay":-60.0, "highDisplay":60.0, "lowWarning":0.0, "highWarning":10.0, "units":"°" } } } ] } ``` -------------------------------- ### Snapshot Item Structure (GET /take-snapshot) Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example structure of a snapshot item returned by the GET /take-snapshot endpoint. ```JSON [ { "configPv": { "pvName": "RFQ-010:RFS-EVR-101:OpMode", "readbackPvName": null, "readOnly": false }, "value": { "type": { "name": "VEnum", "version": 1 }, "value": 0, "alarm": { "severity": "NONE", "status": "NONE", "name": "NONE" }, "time": { "unixSec": 1638905851, "nanoSec": 445854166 }, "enum": { "labels": [ "Global" ] } } }, { "configPv": { "pvName": "RFQ-010:RFS-EVR-101:RFSyncDly-SP", "readbackPvName": null, "readOnly": false }, "value": { "type": { "name": "VDouble", "version": 1 }, "value": 200.0, "alarm": { "severity": "NONE", "status": "NONE", "name": "NONE" }, "time": { "unixSec": 1638475923, "nanoSec": 703595298 }, "display": { "units": "" } } }, { "configPv": { "pvName": "RFQ-010:RFS-EVR-101:RFSyncWdt-SP", "readbackPvName": null, "readOnly": false }, "value": { "type": { "name": "VDouble", "version": 1 }, "value": 100.0, "alarm": { "severity": "NONE", "status": "NONE", "name": "NONE" }, "time": { "unixSec": 1639063122, "nanoSec": 320431469 }, "display": { "units": "" } } }, { "configPv": { "pvName": "RFQ-010:RFS-EVR-101:SCDly", "readbackPvName": null, "readOnly": false }, "value": { "type": { "name": "VDouble", "version": 1 }, "value": 493.2, "alarm": { "severity": "NONE", "status": "NONE", "name": "NONE" }, "time": { "unixSec": 1639209326, "nanoSec": 372407313 }, "display": { "units": "" } } } ] ``` -------------------------------- ### Example Preference Setting Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/preference_properties.md Demonstrates how to set a preference in the settings file, including the package name prefix. ```properties org.csstudio.trends.databrowser3/drop_failed_archives=true ``` -------------------------------- ### jpackage build step 1 Source: https://github.com/controlsystemstudio/phoebus/blob/master/phoebus-product/README.md This command builds the application image using jpackage. It includes options for specifying the application name, input directory, type, main jar, icon, Java options, and runtime image. ```bash jpackage --name --input unzipped --type app-image --main-jar product--.jar --icon unzipped/ [--java-options -Dprism.lcdtext=false] --java-options --java-options -Dcom.sun.webkit.useHTTP2Loader=false --runtime-image ``` -------------------------------- ### Nashorn Script Example Source: https://github.com/controlsystemstudio/phoebus/wiki/Display-Builder-Script-Compatibility An example of a Nashorn script using PVUtil to get a string value from a PV. ```javascript PVUtil = org.csstudio.display.builder.runtime.script.PVUtil; widget.setPropertyValue("text", PVUtil.getString(pvs[0])); ``` -------------------------------- ### Display Examples Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/alarm/ui/doc/index.rst Examples of how to specify display paths and URLs, including those with macros and query parameters. ```text /path/to/display.bob http://server.site/path/to/display.bob http://server.site/path/to/display.bob?MACRO=Value&ANSWER=42 file:///path/to/display.bob?MACRO=Value&OTHER=42$NAME=Text+with+spaces ``` -------------------------------- ### Command line to import settings Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/preferences.rst Shows how to start Phoebus with custom settings from a file. ```bash phoebus.sh -settings ``` -------------------------------- ### Snapshot Item Structure (GET /take-snapshot/{configNodeId}) Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example structure of a single snapshot item returned by the GET /take-snapshot/{configNodeId} endpoint. ```JSON { "configPv": { "pvName": "RFQ-010:RFS-EVR-101:RFSyncWdt-SP", "readbackPvName": null, "readOnly": false }, "value": { "type": { "name": "VDouble", "version": 1 }, "value": 100.0, "alarm": { "severity": "NONE", "status": "NONE", "name": "NONE" }, "time": { "unixSec": 1639063122, "nanoSec": 320431469 }, "display": { "units": "" } } } ``` -------------------------------- ### Start Phoebus Alarm Logger without Console Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/trouble_shooting.rst Example of starting the Phoebus Alarm Logger service without a console prompt using the -noshell argument. ```systemd #Phoebus alarm logger ExecStart=/opt/alarm-logger/current/alarm-logger.sh -properties ./application.properties -noshell ``` -------------------------------- ### Example preferences.properties file Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/preferences.rst Illustrates how to define preferences within a properties file, including package names and setting values. ```properties # ---------------------------------------- # Package org.phoebus.applications.pvtable # ---------------------------------------- # Show a "Description" column that reads xxx.DESC? show_description=true # ------------------------- # Package org.phoebus.pv.ca # ------------------------- # Channel Access address list addr_list= ``` -------------------------------- ### Start Phoebus Alarm Server without Console Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/trouble_shooting.rst Example of starting the Phoebus Alarm Server service without a console prompt using the -noshell argument. ```systemd #Phoebus alarm server ExecStart=/opt/alarm-phoebus-server/current/alarm-server.sh -settings ${SERVER}/settings.ini -config ${CONFIG} -noshell ``` -------------------------------- ### Open PV Table with some PVs Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to open the 'pv_table' application and load multiple PV names. ```bash phoebus.sh -resource "pv://?MyPV&AnotherPV&YetAnotherPV&app=pv_table" ``` -------------------------------- ### Example with Adapters and Selection Service Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/framework/doc/index.rst This code snippet illustrates how an application integrates with Adapters and the Selection Service to dynamically include supported context menu entries for log entries. It avoids hard dependencies on specific logbook implementations. ```java ContextMenu menu = new ContextMenu(); SelectionService.getInstance().setSelection(this, Arrays.asList(AppSelection(appModel))); List supported = ContextMenuService.getInstance().listSupportedContextMenuEntries(); supported.stream().forEach(action -> { MenuItem menuItem = new MenuItem(action.getName(), new ImageView(action.getIcon())); ... items.add(menuItem); }); ``` -------------------------------- ### Get Children Response Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example JSON response for retrieving children nodes. ```JSON [ { "uniqueId": "8cab9311-0c77-4307-a508-a33677ecc631", "name": "Camera", "created": 1623701073000, "lastModified": 1625836981000, "nodeType": "CONFIGURATION", "userName": "kunal", "tags": [] }, { "uniqueId": "3aa5baa3-8386-4a74-84bb-5fdd9afccc7f", "name": "ROI", "created": 1623780701000, "lastModified": 1623780701000, "nodeType": "CONFIGURATION", "userName": "kunal", "tags": [] } ] ``` -------------------------------- ### Starting a Local Queue Server Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/queue-server/README.md Use the provided Docker setup for local development to start the Bluesky Queue Server, HTTP Server REST API, and Redis database. ```bash cd services/bluesky-services docker-compose --profile container-redis up -d ``` -------------------------------- ### Get Composite Snapshot Data Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example JSON response when retrieving composite snapshot data. ```JSON { "uniqueId": "e80fba66-c7f0-453e-8cb6-12b22fa8c957", "referencedSnapshotNodes": [ "b0cee6ff-76a2-46e6-b0ef-d8b78bff26f6", "b6b5a03e-252e-4e6b-a9ac-9d50c23f3f0b" ] } ``` -------------------------------- ### Get Configuration Data Response Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/save-and-restore/doc/index.rst Example JSON response for retrieving configuration data associated with a node. ```JSON { "uniqueId": "89886b32-bb2e-4336-8eea-375c0a955cad", "pvList": { [ { "pvName": "13SIM1:{SimDetector-Cam:1}cam1:BinX" }, { "pvName": "13SIM1:{SimDetector-Cam:1}cam1:BinY", "comparison":{ "comparisonMode":"ABSOLUTE", "tolerance":2.7 } }, { "pvName": "13SIM1:{SimDetector-Cam:2}cam2:BinX", "readbackPvName": null, "readOnly": false }, { "pvName": "13SIM1:{SimDetector-Cam:2}cam2:BinY", "readbackPvName": null, "readOnly": false } ] } } ``` -------------------------------- ### Running CS-Studio with Secure PVA Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pva/TLS.md Example commands to set the TLS keychain and launch the CS-Studio GUI. ```bash $ export EPICS_PVA_TLS_KEYCHAIN=~/.config/pva/1.3/client.p12 $ phoebus.sh ``` -------------------------------- ### Example Configuration Settings with User Home Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/display/convert-medm/doc/index.rst This example shows configuration settings using the user's home directory for the auto-converter directory and strip prefix, and a URL for the EDM paths configuration file. ```properties org.csstudio.display.converter.edm/auto_converter_dir=$(user.home)/AUTOCONVERTED_FILES org.csstudio.display.converter.edm/auto_converter_strip=$(user.home)/AUTOCONVERTED_FILES org.csstudio.display.converter.edm/edm_paths_config=https://my.site.org/opi/edm/paths.txt ``` -------------------------------- ### Open empty instance of probe Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to launch an empty instance of the 'probe' application. ```bash phoebus.sh -app probe ``` -------------------------------- ### Get double value from PV Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/display/editor/doc/access_pv_in_script.rst Example of reading a double value from the first input PV using PVUtil. ```python from org.csstudio.display.builder.runtime.script import PVUtil value = PVUtil.getDouble(pvs[0]) ``` -------------------------------- ### macOS Application Signing Options Source: https://github.com/controlsystemstudio/phoebus/blob/master/phoebus-product/README.md Command-line options for signing macOS application packages using jpackage. ```bash --mac-sign --mac-package-identifier org.phoebus.product.Launcher --mac-package-name CSS-Phoebus --mac-signing-keychain "/Library/Keychains/System.keychain" --mac-signing-key-user-name 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)' ``` -------------------------------- ### Run the product jar Source: https://github.com/controlsystemstudio/phoebus/blob/master/README.md Commands to navigate to the target directory and run the product jar. ```bash cd phoebus-product/target java -jar product-*-SNAPSHOT.jar ``` -------------------------------- ### Starting 'ij' and accessing basic tables Source: https://github.com/controlsystemstudio/phoebus/blob/master/services/scan-server/ScanDataLog.md This example shows how to start the Derby 'ij' command line tool and access basic tables like 'scans', 'devices', and 'samples'. It includes setting the Derby system home and specifying the classpath. ```bash $ cd scan-server/lib $ java -Dderby.system.home=/tmp/scan_log_db \ -cp "service-scan-server-4.7.4-SNAPSHOT.jar:lib/derby-10.16.1.1.jar:lib/derbyshared-10.16.1.1.jar:lib/derbytools-10.16.1.1.jar” \ org.apache.derby.impl.tools.ij.Main ij version 10.16 ij> CONNECT 'jdbc:derby:scan'; ij> SELECT * FROM scans; ID |NAME |CREATED --------------------------------------- 1 |Example |2025-10-31 11:22:55.760598 ij> SELECT * FROM devices; ID |NAME --------------- 1 |loc://x(0) ij> SELECT * FROM scans; ID |NAME |CREATED --------------------------------------------- 1 |Example |2025-10-31 11:22:55.760598 ij> SELECT * from samples; SCAN_ID|DEVICE_ID |SERIAL |TIMESTAMP |VALUE ------------------------------------------------------------- 1 |1 |0 |2025-10-31 11:22:55.82952 |1.0 ``` -------------------------------- ### Initialize data directory and enable TimescaleDB Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/databrowser-timescale/doc/1_InstallTimescaleDB.md Initializes the PostgreSQL data directory and enables TimescaleDB using timescaledb-tune. ```bash sudo su postgres ls -l /var/lib/pgsql/14/data cd /usr/pgsql-14/bin ./pg_ctl -D /var/lib/pgsql/14/data initdb sudo su postgres # Answer 'y' to all the prompts: timescaledb-tune --pg-config=/usr/pgsql-14/bin/pg_config ``` -------------------------------- ### Configure Alarm Server PV Discovery Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/trouble_shooting.rst Example of starting the Phoebus Alarm Server with a specified settings.ini file to configure PV discovery, as it does not use EPICS_CA_ADDR_LIST. ```systemd ExecStart=/opt/alarm-phoebus-server/current/alarm-server.sh -settings ${SERVER}/settings.ini -config ${CONFIG} -noshell ``` -------------------------------- ### JavaScript Example: Widget Property Manipulation Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/display/editor/doc/scripts.rst Shows how to get a PV value and use it to set widget properties like 'start_angle' and 'foreground_color' in JavaScript. ```javascript importPackage(Packages.org.csstudio.opibuilder.scriptUtil); var value = PVUtil.getDouble(pvs[0]); var RED = ColorFontUtil.RED; widget.setPropertyValue("start_angle", value); widget.setPropertyValue("foreground_color", RED); ``` -------------------------------- ### Open a resource with a specific application Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to open a resource file, specifying which application should handle it using the '?app=' query parameter. ```bash phoebus.sh -resource "/path/to/my_display.bob?app=display_editor" ``` -------------------------------- ### Python Script Example: Widget Property Manipulation Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/display/editor/doc/scripts.rst Shows how to get a PV value and use it to set widget properties like 'start_angle' and 'foreground_color' in Python. ```python from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.opibuilder.scriptUtil import ColorFontUtil value = PVUtil.getDouble(pvs[0]) RED = ColorFontUtil.RED widget.setPropertyValue("start_angle", value) widget.setPropertyValue("foreground_color", RED) ``` -------------------------------- ### Mosquitto Broker Configuration and Start Source: https://github.com/controlsystemstudio/phoebus/blob/master/core/pv-mqtt/Readme.md Steps to configure and start the Mosquitto broker, including opening the port and allowing anonymous access. ```bash # Allow remote access through firewall. # Depending on Linux release, similar to this sudo firewall-cmd --add-port=1883/tcp # Create configuration file that allows remote access echo "listener 1883" >> mosquitto.conf echo "allow_anonymous true" >> mosquitto.conf # Start broker with that configuration file src/mosquitto -c mosquitto.conf mosquitto version ... starting Config loaded from mosquitto.conf. ... Opening ipv4 listen socket on port 1883. ``` -------------------------------- ### Open empty PV Table Source: https://github.com/controlsystemstudio/phoebus/blob/master/docs/source/running.rst Command to launch an empty instance of the 'pv_table' application. ```bash phoebus.sh -app pv_table ``` -------------------------------- ### Data Migration Example Source: https://github.com/controlsystemstudio/phoebus/blob/master/app/databrowser-timescale/doc/5_TimescaleDB_Details.md Demonstrates how to import old data into a new table, swap table formats between schemas, and import more data. ```sql SELECT set_chunk_time_interval('update.sample', INTERVAL '1 month'); SELECT * from timescaledb_information.dimensions; -- Import old data into new table, do this for example month by month: \timing on INSERT INTO update.sample SELECT smpl_time, nanosecs, channel_id, severity_id, status_id, num_val, float_val, str_val FROM public.sample WHERE smpl_time >= '2019-01-01' AND smpl_time < '2019-02-01'; -- With original example data, 1 month required about 15 minutes and 15 GB. To swap the old/new table format, move them between schemata like this: -- Move old table out of 'public' CREATE SCHEMA old; ALTER TABLE public.sample SET SCHEMA old; -- Move updated table into 'public' and allow report account to read from it ALTER TABLE update.sample SET SCHEMA public; DROP SCHEMA update; GRANT SELECT ON sample TO report; -- Import more data, now that the 'public' table is the updated one \timing on INSERT INTO sample SELECT smpl_time, nanosecs, channel_id, severity_id, status_id, num_val, float_val, str_val FROM old.sample WHERE smpl_time >= '2019-07-01' AND smpl_time < '2019-08-01'; -- Compress older chunks as shown below -- When no longer needed, the old data can be removed DROP TABLE old.sample; DROP SCHEMA old; ``` -------------------------------- ### Building Phoebus with NetBeans Source: https://github.com/controlsystemstudio/phoebus/blob/master/README.md Steps to set up NetBeans, open the Maven project, and build the Phoebus application. ```text Tools ➜ Java Platforms File ➜ Open Project… Projects view right-click on the phoebus (parent) node and select Clean and Build Run Maven ➜ Skip Tests ```