当前位置:   article > 正文

自定义Tango Control设备服务在Ubuntu中的测试

tango control


继续上一篇:

https://blog.csdn.net/woshigaowei5146/article/details/128443892?spm=1001.2014.3001.5501

环境

虚拟机:VMware
Ubuntu:20.04LTS
Tango:9.3.5

create a device class

启动Tango,jive,pogo,astor

sudo /usr/local/tango/bin/tango start

/usr/local/tango/bin/jive &

/usr/local/tango/bin/pogo &

/usr/local/tango/bin/astor &
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

后来发现pogo经常出现加载不出来的情况。但是偶尔会有一次可以打开,暂未找到规律,随机事件。
在这里插入图片描述
https://github.com/tango-controls/pogo/issues/83

在Pogo中定义类及变量在这里插入图片描述
:
File-Export package,检查所有的headers。该工具将创建一个包含packages的新文件夹。

File -> Generate 点击 OK。
在这里插入图片描述

compile the device class

cd packaging
./autogen.sh
./configure --prefix=$HOME/packaging
make
make install
  • 1
  • 2
  • 3
  • 4
  • 5

如果报错:./autogen.sh: 3: autoreconf: not found

sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool
  • 1
  • 2
  • 3

https://www.iteye.com/blog/shangxun-1938687

如果提示:Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.,在bashrc添加:并重新configure

export PKG_CONFIG_PATH=/usr/local/tango/lib/pkgconfig
  • 1

如果一切正常,您将在src目录中看到这些文件:
在这里插入图片描述

register the device

打开 Jive - Edit -> Create Server
在这里插入图片描述
填写如下表格:
在这里插入图片描述

TangoQuickStart/test
TangoQuickStart
training-laboratory/quick-start/0
  • 1
  • 2
  • 3

点击 Register server.

start the device

为了启动设备,使用命令行,转到编译c++类的文件夹

cd packaging/src/
  • 1

使用下面的命令:

<TangoClassName> <instance>
  • 1

TangoClassName是Pogo和Jive创建的类名称,instance 是TANGO数据库的实例名称(在Jive创建)
输入:

./TangoQuickStart test
  • 1

在这里插入图片描述

explore the device

修改 TangoQuickStart.cpp:主要是增加:set_state(Tango::RUNNING);

/*----- PROTECTED REGION ID(TangoQuickStart.cpp) ENABLED START -----*/
//=============================================================================
//
// file :        TangoQuickStart.cpp
//
// description : C++ source for the TangoQuickStart class and its commands.
//               The class is derived from Device. It represents the
//               CORBA servant object which will be accessed from the
//               network. All commands which can be executed on the
//               TangoQuickStart are implemented in this file.
//
// project :     test
//
// This file is part of Tango device class.
// 
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
// 
//
//
//=============================================================================
//                This file is generated by POGO
//        (Program Obviously used to Generate tango Object)
//=============================================================================


#include <TangoQuickStart.h>
#include <TangoQuickStartClass.h>

/*----- PROTECTED REGION END -----*/	//	TangoQuickStart.cpp

/**
 *  TangoQuickStart class description:
 *    test description
 */

//=====&#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/496911
推荐阅读
相关标签
  

闽ICP备14008679号