diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-04-09 02:40:20 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-04-09 02:40:20 +0000 |
commit | 28d14094386a69ddf05ca810114538fb2c31f8c7 (patch) | |
tree | 7d5bc28bece3f89de8e95be623e355d30ca856ed /externals/grill/vasp/source/obj_chns.cpp | |
parent | c91ebcd16ef0672a909b6e6a1ba144272d062768 (diff) |
""
svn path=/trunk/; revision=554
Diffstat (limited to 'externals/grill/vasp/source/obj_chns.cpp')
-rwxr-xr-x | externals/grill/vasp/source/obj_chns.cpp | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/externals/grill/vasp/source/obj_chns.cpp b/externals/grill/vasp/source/obj_chns.cpp index 8b38374f..370624de 100755 --- a/externals/grill/vasp/source/obj_chns.cpp +++ b/externals/grill/vasp/source/obj_chns.cpp @@ -11,6 +11,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "main.h" #include "classes.h" #include "util.h" +#include "buflib.h" /*! \class vasp_channel @@ -29,7 +30,7 @@ class vasp_channel: FLEXT_HEADER_S(vasp_channel,vasp_tx,Setup) public: - vasp_channel(I argc,t_atom *argv): + vasp_channel(I argc,const t_atom *argv): ix(0) { if(argc >= 1 && CanbeInt(argv[0])) @@ -97,8 +98,12 @@ public: virtual V m_bang() { - if(ref.Ok()) + if(ref.Ok()) { + if(ref.Vectors() > 1) + post("%s - more vectors in vasp, only considering first",thisName()); + ToOutInt(0,ref.Vector(0).Channel()); + } else post("%s - Invalid vasp, no output",thisName()); } @@ -109,4 +114,47 @@ public: FLEXT_LIB("vasp, vasp.channel? vasp.c?",vasp_qchannel) +/*! \class vasp_qchannels + \remark \b vasp.channels? + \brief Gets number of channels of a vasp. + \since 0.1.3 + \param inlet vasp - is stored and output triggered + \param inlet bang - triggers output + \param inlet set - vasp to be stored + \retval outlet int - channels of stored vasp + + \note No output for invalid vasp? +*/ +class vasp_qchannels: + public vasp_op +{ + FLEXT_HEADER(vasp_qchannels,vasp_op) + +public: + vasp_qchannels() + { + AddInAnything(); + AddOutInt(); + } + + virtual V m_bang() + { + if(ref.Ok()) { + if(ref.Vectors() > 1) + post("%s - more vectors in vasp, only considering first",thisName()); + + VBuffer *buf = BufLib::Get(ref.Vector(0).Symbol()); + ToOutInt(0,buf->Channels()); + delete buf; + } + else + post("%s - Invalid vasp, no output",thisName()); + } + + virtual V m_help() { post("%s - Get channel index of 0th vector in vasp",thisName()); } +}; + +FLEXT_LIB("vasp, vasp.channels?",vasp_qchannels) + + |