### Install and Start MariaDB Server Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-redhat.md Installs the MariaDB server and client packages, then starts and enables the MariaDB service to run on boot. ```bash sudo dnf install -y mariadb-server mariadb ``` ```bash sudo systemctl start mariadb ``` ```bash sudo systemctl enable mariadb ``` -------------------------------- ### Device Server Startup Command Example Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/device-server-writing.md This command starts a device server process with a specified instance name. The device server name is a combination of the executable name and the instance name. ```console $ Perkin id11 ``` -------------------------------- ### Start Tango Starter Service Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-windows.md Starts the Tango Starter service after it has been installed. ```bash nssm.exe start Tango-Starter ``` -------------------------------- ### Start TangoTest Device Server Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-debian.md Launches the TangoTest device server. This is a basic test server to verify Tango installation. It should output 'Ready to accept request' upon successful startup. ```bash /usr/lib/tango/TangoTest test ``` -------------------------------- ### Start Device Server with File Database Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/filedatabase.md Use the `-file=` command-line option to start a device server using a specified property file instead of the Tango Database. This handles property get, set, and delete operations using the file. ```bash myserver myinstance_name -file=path/serverFile -ORBendPoint giop:tcp:: ``` -------------------------------- ### Set up Python Virtual Environment and Install Dependencies Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/contributing/docs/docs.md Create a Python virtual environment and install the necessary packages for building the documentation using pip. ```bash python3 -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt ``` -------------------------------- ### Start TANGO Device Server Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/development/cpp/cpp-quick-start.md Navigate to the compiled C++ class directory and start the device server using the class name and instance. ```bash cd packaging/src/ ``` ```bash TangoQuickStart test ``` -------------------------------- ### Enable and Start Tango Starter Service and Timer Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/how-to-integrate-with-systemd.md Commands to enable the Tango Starter service and timer to start automatically on boot, and then start them immediately. ```bash sudo systemctl enable tango-starter sudo systemctl enable tango-starter.timer sudo systemctl start tango-starter ``` -------------------------------- ### Install Tango Starter and TangoTest Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-redhat.md Installs the tango-starter and tango-test packages, which provide essential device servers for Tango. ```bash sudo dnf install -y tango-starter tango-test ``` -------------------------------- ### Start and Enable Tango Starter Service Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-redhat.md Starts the tango-starter systemd service and enables it to start automatically on system boot. ```bash sudo systemctl start tango-starter ``` ```bash sudo systemctl enable tango-starter ``` -------------------------------- ### Compile and Install TANGO Device Class Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/development/cpp/cpp-quick-start.md Navigate to the packaging directory and execute these commands to compile and install your TANGO device class. ```bash cd packaging ./autogen.sh ./configure --prefix=$HOME/packaging make make install ``` -------------------------------- ### Basic Directory Navigation and Project Setup Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/getting-started/00--tutorial.md Navigate to the home directory, create a projects directory, and then change into it to prepare for creating a new Pixi project. ```bash $ cd $ mkdir projects $ cd projects ``` -------------------------------- ### Start Tango-DataBaseds Service Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-windows.md After installing the Tango-DataBaseds service using NSSM, use this command to start the service. ```batch nssm.exe start Tango-DataBaseds ``` -------------------------------- ### Start a Device Server using Starter Interface Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/starter.md Directly interact with the Starter device using Python to start a specific device server. The Starter uses the 'StartDsPath' property to locate executables. ```python import tango starter = tango.DeviceProxy("tango/admin/tangobox") starter.command_inout("DevStart", "TangoTest/test") ``` -------------------------------- ### Start Device Server with Fixed Port Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/how-to-run-device-server-firewall.md Start your device server with a fixed port to ensure consistent connectivity. This example uses port 11000. ```console TangoTest win -ORBendPoint giop:tcp11000 ``` -------------------------------- ### Start Jive Application Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-windows.md Launch the Jive application, typically used for testing Tango installations, either from the Start menu or by calling this command in the command line. ```batch "%TANGO_ROOT%\bin\start-jive.bat" ``` -------------------------------- ### SecondApplication Frame Setup Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk/programmersguid.tex Sets up the main frame for the SecondApplication, adding viewers and menu bars. It also includes methods for application startup and handling user actions. ```java getContentPane().setLayout(new BorderLayout()); getContentPane().add(ssViewer, BorderLayout.SOUTH); getContentPane().add(nSpectViewer, BorderLayout.CENTER); getContentPane().add(nImageViewer, BorderLayout.EAST); attributes.startRefresher(); setJMenuBar(menu); pack(); ATKGraphicsUtils.centerFrameOnScreen(this); setVisible(true); } public static void main(String [] args) { new SecondApplication(); } public void quitItemActionPerformed(ActionEvent evt) { System.exit(0); } public void errHistItemActionPerformed(ActionEvent evt) { errorHistory.setVisible(true); } ``` -------------------------------- ### Verify PyTango Installation and Info Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/getting-started/00--tutorial.md Start a Python interpreter within the Pixi shell and import the tango library to print detailed information about the PyTango installation and its compiled/runtime environment. ```python-console >>> import tango >>> print(tango.utils.info()) ``` -------------------------------- ### Start DataBaseds Device Server Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-windows.md Run this command in a new command line window to start the DataBaseds device server. This server must be running permanently for the Tango installation to be operational. ```batch "%TANGO_ROOT%\bin\start-db.bat" ``` -------------------------------- ### Install Tango Starter Service with NSSM Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-windows.md Installs the Tango Starter service using NSSM (Non-Sucking Service Manager). Adjust the 'Arguments' field with your host name if it differs from 'pg-dell-new'. ```bash nssm.exe install Tango-Starter ``` -------------------------------- ### Test Jive Application Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-debian.md Start the Jive application in the background to test the Tango Controls installation. ```console /usr/local/bin/jive & ``` -------------------------------- ### Refresher Thread Example Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk-programmers-guide.md Illustrates how to create and start a Refresher thread for periodic updates, commonly used with DeviceFactory. ```java // This is an example from DeviceFactory. // We create a new Refresher with the name "device" // We add ourself to it, and start the thread Refresher refresher = new Refresher("device"); refresher.addRefreshee(this).start(); ``` -------------------------------- ### First ATK Application Example Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk-programmers-guide.md This is a complete example of a basic ATK application that displays device attributes and commands. It sets up viewers, a menu bar, and the main layout, then makes the frame visible. ```java public class FirstApplication extends JFrame { private AttributeList attributes; private CommandList commands; private ErrorHistory errorHistory; public FirstApplication() { super("First Application"); // Initialize TANGO attribute and command lists attributes = new AttributeList(); commands = new CommandList(); // Initialize error history errorHistory = new ErrorHistory(this); // Create viewers for attributes and commands ScalarListViewer sListViewer = new ScalarListViewer(); CommandComboViewer commandViewer = new CommandComboViewer(); // Create a menu bar JMenuBar menu = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenuItem quitItem = new JMenuItem("Quit"); JMenuItem errHistItem = new JMenuItem("Error History"); // Add action listeners for menu items quitItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { quitItemActionPerformed(evt); } }); errHistItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { errHistItemActionPerformed(evt); } }); fileMenu.add(quitItem); fileMenu.add(errHistItem); menu.add(fileMenu); // Set models for viewers sListViewer.setModel(attributes); commandViewer.setModel(commands); // Set the menubar setJMenuBar(menu); // Set up the main frame layout getContentPane().setLayout(new BorderLayout()); getContentPane().add(commandViewer, BorderLayout.NORTH); getContentPane().add(sListViewer, BorderLayout.SOUTH); // Start attribute refresher attributes.startRefresher(); // JFrame setup pack(); ATKGraphicsUtils.centerFrameOnScreen(this); setVisible(true); } public static void main(String [] args) { new FirstApplication(); } public void quitItemActionPerformed(ActionEvent evt) { System.exit(0); } public void errHistItemActionPerformed(ActionEvent evt) { errorHistory.setVisible(true); } } ``` -------------------------------- ### Initialize a New Project with Pixi Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/conda.md Navigate to your project directory and initialize a new project using Pixi, which creates a 'pixi.toml' file. ```console $ cd myproject $ pixi init ``` -------------------------------- ### Start Python Interpreter Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/getting-started/00--tutorial.md Launch the Python interpreter from within the activated Pixi shell to begin interacting with Python and its installed packages. ```console (tango-tut) $ python ``` -------------------------------- ### Get History of a Device Property Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/development/python/how-to-pytango.md Fetch the history of a specific device property. This example retrieves the last ten values and their string representations. ```python [ph.get_value().value_string for ph in tango.get_device_property_history('some/alarms/device','AlarmsList')] ``` -------------------------------- ### Example Logging Target Configuration Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Reference/reference.md Illustrates the format for setting multiple logging targets, including console, file, and device targets. Case sensitivity is not considered for file paths. ```text logging_target = [ console, file, file::/home/me/mydevice.log , device::tmp/log/1 ] ``` -------------------------------- ### Providing Multiple Properties via Command Line Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/getting-started/07-device-properties.md This example shows how to provide both a mandatory ('host') and an optional ('location') device property using the `--prop` argument. The output confirms that both properties are correctly set after device initialization. ```console (tango-tut) $ python -m tango.test_context main.MegaCoffee3k --prop '{"host": "localhost", "location": "control room"}' --host 127.0.0.1 ``` ```console init_device before super: None:None @ None init_device after super: localhost:9788 @ control room Ready to accept request MegaCoffee3k started on port 8888 with properties {'host': 'localhost', 'location': 'control room'} Device access: tango://127.0.0.1:8888/test/nodb/megacoffee3k#dbase=no Server access: tango://127.0.0.1:8888/dserver/MegaCoffee3k/megacoffee3k#dbase=no ``` -------------------------------- ### Build Documentation with Make Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/README.md Build the HTML documentation using the make command. Ensure your Python virtual environment is activated. ```bash make html ``` -------------------------------- ### Python Client Check Device State and Status Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/getting-started/02-state-status.md Use the device proxy client to check the device's state and status after it has been started. This example shows how to call the `State()` and `Status()` commands. ```python >>> dp.State() tango._tango.DevState.OFF >>> dp.Status() 'Hello world - device is off.' >>> ``` -------------------------------- ### Test REST API by Reading Attribute Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/tools/rest-api.md Example of testing the Tango REST API installation by accessing a device attribute value through a browser. Assumes a local REST API server on port 10001. ```default http://localhost:10001/tango/rest/rc4/hosts/localhost/10000/devices/sys/tg_test/1/attributes/double_scalar/value ``` -------------------------------- ### Add Starter Device using tango_admin Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/starter.md Defines a Starter device using the tango_admin tool. Ensure the member part of the device name matches the short hostname. ```bash host=$(hostname -s) tango_admin --add-server Starter/$host Starter tango/admin/$host Starter $host ``` -------------------------------- ### Get Server and Device Name for a Device Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/development/python/how-to-pytango.md Retrieve the server name associated with a device and its corresponding device name within that server. This example also shows how to import a device and check its exported status. ```python print(db.get_server_list('Databaseds/*')) ``` ```python print(db.get_device_name('DataBaseds/2', 'DataBase')) ``` ```python db_dev=tango.DeviceProxy('sys/database/2') print(db_dev.command_inout('DbImportDevice', 'et/wintest/01')) ``` -------------------------------- ### Manage Attribute Polling in Tango Class Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Explanation/polling.md Use `is_attribute_polled`, `stop_poll_attribute`, and `poll_attribute` to dynamically manage attribute polling. This example stops polling an attribute if it's already polled, otherwise, it starts polling another attribute with a specified period. ```cpp void MyClass::read_attr(Tango::Attribute &attr) { ... std::string att_name{"SomeAttribute"}; std::string another_att_name{"AnotherAttribute"}; if(is_attribute_polled(att_name)) { stop_poll_attribute(att_name); } else { poll_attribute(another_att_name, 500); } .... } ``` -------------------------------- ### Run Cumbia Client Example Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/vm/tangobox.md Execute this command to run a Cumbia client demonstration, connecting to a specified Tango device. Alternatively, use the CumbiaClientDemo desktop shortcut. ```bash cumbia client sys/tg_test/1/double_scalar ``` -------------------------------- ### Connecting Attributes to Viewers and Setting Up the Frame Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk-programmers-guide.md This snippet demonstrates how to connect Tango attributes to ATK viewers, set viewer preferences, configure gradients, and add viewers to the frame. It also includes starting the attribute refresher and basic JFrame setup. ```java nSpectViewer.setModel(nsAtt); nImageViewer.setModel(niAtt); // nSpectViewer.setPreferredSize(new java.awt.Dimension(400, 300)); nImageViewer.setPreferredSize(new java.awt.Dimension(500, 300)); Gradient g = new Gradient(); g.buidColorGradient(); g.setColorAt(0,Color.black); nImageViewer.setGradient(g); nImageViewer.setBestFit(true); // // Add the viewers into the frame to show them // getContentPane().setLayout(new BorderLayout()); getContentPane().add(ssViewer, BorderLayout.SOUTH); getContentPane().add(nSpectViewer, BorderLayout.CENTER); getContentPane().add(nImageViewer, BorderLayout.EAST); // // To have the attributes values refreshed we should start the // attribute list's refresher. // attributes.startRefresher(); // // add the menubar to the frame // setJMenuBar(menu); // // JFrame stuff to make the thing show. // pack(); ATKGraphicsUtils.centerFrameOnScreen(this); //ATK utility to center window setVisible(true); } public static void main(String [] args) { new SecondApplication(); } public void quitItemActionPerformed(ActionEvent evt) { System.exit(0); } public void errHistItemActionPerformed(ActionEvent evt) { errorHistory.setVisible(true); } } ``` ``` -------------------------------- ### Set up Python Virtual Environment Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/README.md Use this to create a Python virtual environment and install project requirements. Activate the environment before running build commands. ```bash python -m venv .venv source .venv/bin/activate python -m pip install -r requirements.txt ``` -------------------------------- ### ThirdApplication: Basic Synoptic Viewer Setup Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk-programmers-guide.md This Java code demonstrates the basic setup for a TangoATK application using SynopticFileViewer. It includes Swing components for a menu bar and error history, and initializes the SynopticFileViewer. Ensure Jdraw is used to create the synoptic file beforehand. ```java package examples; import java.io.*; import java.util.*; import javax.swing.JFrame; import javax.swing.JMenuItem; import javax.swing.JMenuBar; import javax.swing.JMenu; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.BorderLayout; import fr.esrf.tangoatk.widget.util.ErrorHistory; import fr.esrf.tangoatk.widget.util.ATKGraphicsUtils; import fr.esrf.tangoatk.widget.jdraw.SynopticFileViewer; import fr.esrf.tangoatk.widget.jdraw.TangoSynopticHandler; public class ThirdApplication extends JFrame { JMenuBar menu; ErrorHistory errorHistory; // A window that displays errors SynopticFileViewer sfv; // TangoATK generic synoptic viewer public ThirdApplication() { // Swing stuff to create the menu bar and its pulldown menus menu = new JMenuBar(); JMenu fileMenu = new JMenu(); fileMenu.setText("File"); JMenu viewMenu = new JMenu(); viewMenu.setText("View"); JMenuItem quitItem = new JMenuItem(); quitItem.setText("Quit"); quitItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) {quitItemActionPerformed(evt);} }); fileMenu.add(quitItem); JMenuItem errorHistItem = new JMenuItem(); errorHistItem.setText("Error History"); errorHistItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) {errHistItemActionPerformed(evt);} }); viewMenu.add(errorHistItem); menu.add(fileMenu); menu.add(viewMenu); ``` -------------------------------- ### Silent MSI Installation Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-windows.md Performs a silent installation of cppTango MSI packages. This command uses standard Windows Installer flags for quiet and passive installation. ```bash msiexec /package libtango*.msi /quiet /passive ``` -------------------------------- ### Start JupyTango Container Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/vm/tangobox.md Use this command to start the JupyTango Docker container. It is typically started by default. ```bash docker start tangobox-jupytango ``` -------------------------------- ### Main Application Entry Point Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk/programmersguid.tex The main method to create and launch the FirstApplication. ```java public static void main(String [] args) { new FirstApplication(); } ``` -------------------------------- ### Enable and start Tango DB service Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/how-to-integrate-with-systemd.md Commands to enable the Tango DB service to start on boot and then start it immediately. ```console sudo systemctl enable tango-db sudo systemctl start tango-db ``` -------------------------------- ### Install EPEL Release on Red Hat Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-redhat.md Installs the Extra Packages for Enterprise Linux (EPEL) repository, which is a prerequisite for installing other packages. ```bash sudo dnf install -y epel-release ``` -------------------------------- ### Start Device Server Without Database and with Device List Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/device-server-without-db.md Use the `-nodb` and `-dlist` options to start a device server without a database and specify device names on the command line. The device names are separated by commas. ```bash server inst -ORBendPoint giop:tcp:: -nodb -dlist a/b/c ``` -------------------------------- ### Get Server Starter Level Configuration Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/development/python/how-to-pytango.md Retrieves the starter level configuration (name, mode, level) for a list of servers. ```python [(si.name, si.mode, si.level) for si in [db.get_server_info(s) for s in list_of_servers]] ``` -------------------------------- ### Install Python Modules for DSC Import Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/how-to-import-classes-to-catalogue.md Installs required Python modules using pip within a virtual environment. Ensure you have Python 3.6+ installed. ```bash python -m venv venv source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Initialize and Add Dependencies with Pixi Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/getting-started/00--tutorial.md Use Pixi to initialize a new project and add necessary dependencies like Python, PyTango, and testing libraries. ```bash $ pixi init tango-tut $ cd tango-tut $ pixi add python=3.12 pytango tango-test tango-admin jtango jive pogo ``` -------------------------------- ### Enable and start Tango Access Control service and timer Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/how-to-integrate-with-systemd.md Commands to enable the Tango Access Control service and its timer to start on boot, and then start them immediately. ```console sudo systemctl enable tango-accesscontrol sudo systemctl enable tango-accesscontrol.timer sudo systemctl start tango-accesscontrol ``` -------------------------------- ### Full Device Name Examples Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Explanation/naming.md Examples demonstrating various ways to specify a full device name, including direct access, database-driven access, and different protocols. ```default gizmo:20000/sr/d-ct/1 ``` ```default tango://freak:2345/id11/rv/1#dbase=no ``` ```default freak:2345/id11/rv/1#dbase=no ``` ```default taco://sy/ps-ki/1 ``` -------------------------------- ### Start Device Server with Specific Devices (No DB) Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/deployment/device-server-without-db.md Starts a device server with specific device names defined via the `-dlist` option when no database is used. This is useful for testing multiple devices. ```bash StepperMotor et -nodb -dlist id11/motor/1,id11/motor/2 ``` -------------------------------- ### Install Tango Debian Packages Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-debian.md Installs the necessary Tango development and testing packages on a Debian system. Use default answers during installation if no specific configurations are required. ```bash sudo apt install libtango-dev tango-db tango-test ``` -------------------------------- ### Execute Command Locally on Group with Specific Arguments (Java-like) Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/development/cpp/how-to-cpp-client-programmers-guide.md This example demonstrates executing a command locally on a group using a Java-like syntax. It prepares a list of specific arguments for each device in the group and handles potential exceptions during command execution. The 'forward' parameter is set to false for local execution. ```java //- get a reference to the target group Group g = gauges.get_group("cell-01"); //- get pre-build arguments list for the group (starting@cell-01) DeviceData[] argins = g.get_command_specific_argument_list(false); //- argins for inst-c01/vac-gauge/penning-01 argins[0].insert(0.1); //- argins for inst-c01/vac-gauge/penning-02 argins[1].insert(0.2); //- argins for remaining devices in cell-01.penning . . . //- the reply list GroupCmdReplyList crl; //- enter a try/catch block (see below) try { //- execute the command crl = g.command_inout("SetDummyFactor", argins, false, false); if (crl.has_failed()) { //- error handling goes here (see case 1) } } catch (DevFailed d) { //- see below } ``` -------------------------------- ### Start MariaDB Service Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-debian.md Starts the MariaDB database server process. ```bash sudo service mariadb start ``` -------------------------------- ### Install PyTango using pip Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/tango-on-macos.md Install the PyTango library from PyPi within an activated virtual environment. The --require-virtualenv flag ensures it's installed correctly in the environment. ```console python3 -m pip --require-virtualenv pytango ``` -------------------------------- ### FirstApplication: Single Device GUI Example Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/Tutorials/atk/programmersguid.tex Demonstrates a basic Swing GUI application for interacting with a single Tango device. It sets up attribute and command lists, and viewers for displaying and executing them. Errors are logged to an ErrorHistory window. ```Java package examples; import javax.swing.JFrame; import javax.swing.JMenuItem; import javax.swing.JMenuBar; import javax.swing.JMenu; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.BorderLayout; import fr.esrf.tangoatk.core.AttributeList; import fr.esrf.tangoatk.core.ConnectionException; import fr.esrf.tangoatk.core.CommandList; import fr.esrf.tangoatk.widget.util.ErrorHistory; import fr.esrf.tangoatk.widget.util.ATKGraphicsUtils; import fr.esrf.tangoatk.widget.attribute.ScalarListViewer; import fr.esrf.tangoatk.widget.command.CommandComboViewer; public class FirstApplication extends JFrame { JMenuBar menu; // So that our application looks // halfway decent. AttributeList attributes; // The list that will contain our // attributes CommandList commands; // The list that will contain our // commands ErrorHistory errorHistory; // A window that displays errors ScalarListViewer sListViewer; // A viewer which knows how to // display a list of scalar attributes. // If you want to display other types // than scalars, you'll have to wait // for the next example. CommandComboViewer commandViewer; // A viewer which knows how to display // a combobox of commands and execute // them. String device; // The name of our device. public FirstApplication() { // The swing stuff to create the menu bar and its pulldown menus menu = new JMenuBar(); JMenu fileMenu = new JMenu(); fileMenu.setText("File"); JMenu viewMenu = new JMenu(); viewMenu.setText("View"); JMenuItem quitItem = new JMenuItem(); quitItem.setText("Quit"); quitItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) {quitItemActionPerformed(evt);} }); fileMenu.add(quitItem); JMenuItem errorHistItem = new JMenuItem(); errorHistItem.setText("Error History"); errorHistItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) {errHistItemActionPerformed(evt);} }); viewMenu.add(errorHistItem); menu.add(fileMenu); menu.add(viewMenu); // // Here we create ATK objects to handle attributes, commands and errors. // attributes = new AttributeList(); commands = new CommandList(); errorHistory = new ErrorHistory(); device = "id14/eh3_mirror/1"; sListViewer = new ScalarListViewer(); commandViewer = new CommandComboViewer(); // // A feature of the command and attribute list is that if you // supply an errorlistener to these lists, they'll add that // errorlistener to all subsequently created attributes or // commands. So it is important to do this _before_ you // start adding attributes or commands. // attributes.addErrorListener(errorHistory); commands.addErrorListener(errorHistory); // // Sometimes we're out of luck and the device or the attributes // are not available. In that case a ConnectionException is thrown. // This is why we add the attributes in a try/catch // try { // // Another feature of the attribute and command list is that they // can add wildcard names, currently only `*' is supported. // When using a wildcard, the lists will add all commands or // attributes available on the device. // attributes.add(device + "/*"); } catch (ConnectionException ce) { System.out.println("Error fetching " + "attributes from " + device + " " + ce); } // // See the comments for attributelist // ``` -------------------------------- ### Compile and Install OpenTelemetry Source: https://gitlab.com/tango-controls/tango-doc/-/blob/main/source/How-To/installation/linux-debian.md Compiles the OpenTelemetry C++ project and installs it using CMake. ```bash cmake --build . --target all sudo cmake --install . ```