Import class from catalogue - Tutorials available ?
|
|
---|---|
Hello, I want to import a class from the catalogue this website provides, to test my installation with a very basic function. I am trying to use the AcquireWaveformLecroy class, but I am looking for general tutorial to import classes. Did someone wrote one ? I looked through the whole documentation, can't find what I'm looking for. Thank you ! Nicolas
A young padawan
|
|
|
---|---|
Hi Nicolas, You'd like a general tutorial to import classes? Not sure to understand what you mean with "import classes"… Do you mean a tutorial explaining how to use existing classes in your Tango Control System? The class you mention is written in C++. The 1st thing you need to do is to download the source code. You can get it from the Repository link on the classes catalog: https://www.tango-controls.org/developers/dsc/ds/1167/ In your use case, this is a link to http://svn.code.sf.net/p/tango-ds/code/DeviceClasses/MeasureInstruments/Lecroy/AcquireWaveformLecroy If you go to https://svn.code.sf.net/p/tango-ds/code/DeviceClasses/MeasureInstruments/Lecroy/AcquireWaveformLecroy/trunk/MOVETO, we can see that this repository has been moved to https://gitlab.synchrotron-soleil.fr/software-control-system/tango-devices/MeasureInstruments/Lecroy/AcquireWaveformLecroy From here you can clone the repository and try to compile the device server. To compile a device server which is coming from another institute, what I usually do is regenerating the Makefile (or CMakeLists.txt) with Pogo (passing the xmi file as parameter to Pogo) so the Makefile will be regenerated with my site preferences. Most of the times, it's enough to be able to compile the device server. You should however check the original Makefile from the repository and look for some special dependencies (dependency on library, special compilation flags required, etc…). Of course, you will need to have cppTango (The Tango C++ library) and its dependencies installed on the host you want to compile and run the device server. Once you have your device server compiled, you can define it in the Tango Database using tango_admin tool or jive (https://tango-controls.readthedocs.io/en/latest/tools-and-extensions/built-in/jive/servers.html#creating-a-tango-server) and define its devices and associated device and class properties too (doc still on https://tango-controls.readthedocs.io/en/latest/tools-and-extensions/built-in/jive/servers.html). You can also use the server wizard in jive: https://tango-controls.readthedocs.io/en/latest/tutorials-and-howtos/how-tos/how-to-start-device-server.html#howto-start-device-server Once it is defined in the Tango DB, you can start your device server using the device server instance name you declared in the Tango Database as parameter. E.g.: AcquireWaveformLecroy my_instance_name If you have specific questions related to a specific class you would like to use, please do not hesitate to send an e-mail to the person listed in the "contact" field of the class catalog. Hoping this helps a bit. Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
Hi ! Thanks you for your answer Reynald ! I've just installed Tango controls in Windows 10 and Unbuntu, so I'll be able to compare. I tried to follow your tips, but I'm stuck at : From here you can clone the repository and try to compile the device server. To compile a device server which is coming from another institute, what I usually do is regenerating the Makefile (or CMakeLists.txt) with Pogo (passing the xmi file as parameter to Pogo) so the Makefile will be regenerated with my site preferences. Most of the times, it's enough to be able to compile the device server. You should however check the original Makefile from the repository and look for some special dependencies (dependency on library, special compilation flags required, etc…). Of course, you will need to have cppTango (The Tango C++ library) and its dependencies installed on the host you want to compile and run the device server. I don't know how to regenerate file using Pogo, because it keeps asking me an .xmi file, which isn't available in the tar.gz extracted folder. Then, because it exist in this class a lot of "Make documents" (lecrMakefile, Makefile, Makefile.linux, Makefile.VC), I was reading the .linux one (because I'm actually working on Unbuntu) but I'm not really comfortable with this type of document. EDIT : I'm actually facing a new probelm with the "make make AcquireWaveformLecroy" with error : "recipe commences before first target. Stop." I've looked on the web that it could be tabulations, spaces also at line 158, so I'm working on it. I'll share the Makefile too. Any ideas ? Thanks you Nicolas
A young padawan
|
|
|
---|---|
Nico Hi Nico, Very bad luck for you! It looks like you are trying to compile a very old Tango device server which has not been regenerated with Pogo since ages. In the beginnings of Tango, Pogo was using directly MyClass.h file as input instead of MyClass.xmi. You cannot regenerate the code with recent Pogo versions. You would need a Pogo v-6 to be able to read and convert this old Device Server code to generate an xmi file for recent Pogo versions. But I think there is an easiest way. I think the easiest is to create a dummy Tango C++ class named Dummy with Pogo in another directory. Generate the code and the Makefile in this directory with Pogo. Copy directly the generated Makefile to AcquireWaveformLecroy repository src folder after having changed: PACKAGE_NAME = Dummy with PACKAGE_NAME = AcquireWaveformLecroy You will also need to add the following lines before LIB_OBJS definition in this Makefile: ADDITIONAL_OBJS = $(OBJDIR)/Waveform.o \ $(OBJDIR)/LinuxSocketLecroy.o \ $(OBJDIR)/LecroyException.o \ $(OBJDIR)/WaveformException.o \ $(OBJDIR)/SocketException.o Hoping this helps a bit, Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
Hello again, Thank you for your reply. I would be glad to try this, and I'll be right back with some good news I swear. If I may… As I said, I installed Tango less than a week ago, everything was perfectly working since I tried to run /usr/local/tango/bin/pogo I followed this tutorial about how to install, made by Andy the Great, all was crystal clear. Until today. Pogo seems to be stuck in a infinite loop, trying to "Build Database.xmi" (?). I took a screenshot to show you as well as possible. If I can't fix my Pogo, I won't be able to try your solution :( Thanks, I know I'm a bit of a newbie, but I swear I'm trying my best Best regards Nicolas Elmerich
A young padawan
|
|
|
---|---|
Hi Nicolas, You're really not lucky it seems … Don't know why Pogo is in this infinite loop. I don't know why Pogo is stuck with the Database.xmi file. What you could try is simply to rename or delete ~/.pogorc file so Pogo does not try to load the last xmi file you loaded at startup. More recent versions of Pogo no longer do such things when you don't specify the xmi file as parameter. Hoping this helps a bit, Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
Hi Reynald ! Thanks to your advice, I put as comments every code lines in the ~/.pogorc file, so now, Pogo works perfectly. I don't who who did cursed me but now it works ! So I did regenerate a Makefile, using the Dummy-strategie you gave me. I try to run my new MakeFile, in my /acquirewaveformlecroy-main/src but I got some error. May you help me again ?
To be honest, I tried the same install on Windows 10, but I was stuck at this exact same "Include" which I don't know how to fix. Thank you ! Nicolas
A young padawan
|
|
|
---|---|
Hi Nicolas, The device server you're trying to compile seems to have a dependency with the YAT library. I think you can get the sources on tango-cs Sourceforge: https://sourceforge.net/p/tango-cs/code/HEAD/tree/share/ (I'm not sure this is still the official location for Yat). I never used that library. I think the best is probably to contact Xavier Elattaoui from Soleil (The contact person for this device server, xavier.elattaoui at synchrotron-soleil dot fr). He should be able to guide you to install the dependencies of this device server. Kind regards, Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |