tool/Command.h
author Florian Pose <fp@igh.de>
Fri, 08 Sep 2017 13:50:06 +0200
branchstable-1.5
changeset 2684 56587a22d05c
parent 2529 c7e1f2616a9d
permissions -rw-r--r--
Do not build GPIO part of CCAT if GPIO is not configured in kernel.
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/*****************************************************************************
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
1363
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     3
 *  $Id$
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     4
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     5
 *  Copyright (C) 2006-2009  Florian Pose, Ingenieurgemeinschaft IgH
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     6
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     8
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it and/or
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    10
 *  modify it under the terms of the GNU General Public License version 2, as
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    11
 *  published by the Free Software Foundation.
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    12
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    13
 *  The IgH EtherCAT Master is distributed in the hope that it will be useful,
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    16
 *  Public License for more details.
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    17
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    18
 *  You should have received a copy of the GNU General Public License along
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    19
 *  with the IgH EtherCAT Master; if not, write to the Free Software
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    21
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    22
 *  ---
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    23
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    24
 *  The license mentioned above concerns the source code only. Using the
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    25
 *  EtherCAT technology and brand is only permitted in compliance with the
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1335
diff changeset
    26
 *  industrial property and similar rights of Beckhoff Automation GmbH.
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
 *
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
 ****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
#ifndef __COMMAND_H__
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
#define __COMMAND_H__
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
#include <stdexcept>
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
#include <vector>
1151
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
    35
#include <list>
1826
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1804
diff changeset
    36
#include <sstream>
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
using namespace std;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
1826
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1804
diff changeset
    39
#include "../master/ioctl.h"
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1804
diff changeset
    40
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1804
diff changeset
    41
class MasterDevice;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
class InvalidUsageException:
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
    public runtime_error
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
{
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
    friend class Command;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
    protected:
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
        /** Constructor with stringstream parameter. */
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
        InvalidUsageException(
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
                const stringstream &s /**< Message. */
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
                ): runtime_error(s.str()) {}
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
};
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
class CommandException:
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
    public runtime_error
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
{
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    62
    friend class Command;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
    protected:
1834
67fc217d7341 Overloaded throwCommandException().
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    65
        /** Constructor with char * parameter. */
67fc217d7341 Overloaded throwCommandException().
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    66
        CommandException(
67fc217d7341 Overloaded throwCommandException().
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    67
                const string &msg /**< Message. */
67fc217d7341 Overloaded throwCommandException().
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    68
                ): runtime_error(msg) {}
67fc217d7341 Overloaded throwCommandException().
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
    69
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
        /** Constructor with stringstream parameter. */
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
        CommandException(
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    72
                const stringstream &s /**< Message. */
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    73
                ): runtime_error(s.str()) {}
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    74
};
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    75
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    76
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    77
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    78
class Command
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    79
{
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
    public:
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
        Command(const string &, const string &);
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
    82
        virtual ~Command();
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    83
1151
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
    84
        const string &getName() const;
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
    85
        const string &getBriefDescription() const;
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
    86
1826
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1804
diff changeset
    87
        typedef list<unsigned int> MasterIndexList;
1869
14f634f5b613 Open master device as late as possible.
Florian Pose <fp@igh-essen.com>
parents: 1834
diff changeset
    88
        void setMasters(const string &);
14f634f5b613 Open master device as late as possible.
Florian Pose <fp@igh-essen.com>
parents: 1834
diff changeset
    89
        MasterIndexList getMasterIndices() const;
1870
0cee1fb7f0fd Added getSingleMasterIndex() for command-line tool.
Florian Pose <fp@igh-essen.com>
parents: 1869
diff changeset
    90
		unsigned int getSingleMasterIndex() const;
1869
14f634f5b613 Open master device as late as possible.
Florian Pose <fp@igh-essen.com>
parents: 1834
diff changeset
    91
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    92
        enum Verbosity {
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    93
            Quiet,
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    94
            Normal,
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    95
            Verbose
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    96
        };
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    97
        void setVerbosity(Verbosity);
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
    98
        Verbosity getVerbosity() const;
2010
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
    99
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   100
        void setAliases(const string &);
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   101
        void setPositions(const string &);
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   102
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   103
        void setDomains(const string &);
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   104
        typedef list<unsigned int> DomainIndexList;
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   105
        DomainIndexList getDomainIndices() const;
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   106
1166
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   107
        void setDataType(const string &);
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   108
        const string &getDataType() const;
2010
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   109
2529
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   110
        void setEmergency(bool);
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   111
        bool getEmergency() const;
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   112
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   113
        void setForce(bool);
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   114
        bool getForce() const;
2010
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   115
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   116
        void setOutputFile(const string &);
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   117
        const string &getOutputFile() const;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   118
2436
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   119
        void setSkin(const string &);
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   120
        const string &getSkin() const;
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   121
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   122
        bool matchesSubstr(const string &) const;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   123
        bool matchesAbbrev(const string &) const;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   124
1968
4f682084c643 Implemented drive_no for command-line tool; binary base name is now a
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   125
        virtual string helpString(const string &) const = 0;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   126
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   127
        typedef vector<string> StringVector;
1826
ec6223c3b7ec Multi-master support for command-line tool. The --master option supports
Florian Pose <fp@igh-essen.com>
parents: 1804
diff changeset
   128
        virtual void execute(const StringVector &) = 0;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   129
1144
7dbfdd61812c Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents: 1142
diff changeset
   130
        static string numericInfo();
7dbfdd61812c Bugfixes and improvements.
Florian Pose <fp@igh-essen.com>
parents: 1142
diff changeset
   131
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   132
    protected:
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   133
        enum {BreakAfterBytes = 16};
1151
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
   134
1155
bd4e5b544473 Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents: 1151
diff changeset
   135
        void throwInvalidUsageException(const stringstream &) const;
1834
67fc217d7341 Overloaded throwCommandException().
Florian Pose <fp@igh-essen.com>
parents: 1826
diff changeset
   136
        void throwCommandException(const string &) const;
1155
bd4e5b544473 Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents: 1151
diff changeset
   137
        void throwCommandException(const stringstream &) const;
bd4e5b544473 Common message for single slave selections.
Florian Pose <fp@igh-essen.com>
parents: 1151
diff changeset
   138
        void throwSingleSlaveRequired(unsigned int) const;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   139
1151
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
   140
        typedef list<ec_ioctl_slave_t> SlaveList;
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
   141
        SlaveList selectedSlaves(MasterDevice &);
1156
ecaf2a896ea3 Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents: 1155
diff changeset
   142
        typedef list<ec_ioctl_config_t> ConfigList;
ecaf2a896ea3 Implemented alias and position for configs.
Florian Pose <fp@igh-essen.com>
parents: 1155
diff changeset
   143
        ConfigList selectedConfigs(MasterDevice &);
1166
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   144
        typedef list<ec_ioctl_domain_t> DomainList;
2453
d461b1f07296 Added configure option for redundancy (--with-devices).
Florian Pose <fp@igh-essen.com>
parents: 2436
diff changeset
   145
        DomainList selectedDomains(MasterDevice &, const ec_ioctl_master_t &);
2529
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   146
        int emergencySlave() const;
1151
1fc1535dec29 Alias/Position selection.
Florian Pose <fp@igh-essen.com>
parents: 1146
diff changeset
   147
1146
f18d124d7fbc Moved slaveState() to Command::alStateString().
Florian Pose <fp@igh-essen.com>
parents: 1144
diff changeset
   148
        static string alStateString(uint8_t);
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   149
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   150
    private:
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   151
        string name;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   152
        string briefDesc;
1869
14f634f5b613 Open master device as late as possible.
Florian Pose <fp@igh-essen.com>
parents: 1834
diff changeset
   153
        string masters;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   154
        Verbosity verbosity;
2010
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   155
        string aliases;
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   156
        string positions;
87de63b19e4c Implemented ranges for slaves, configs and domains.
Florian Pose <fp@igh-essen.com>
parents: 1870
diff changeset
   157
        string domains;
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   158
        string dataType;
2529
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   159
        bool emergency;
1804
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   160
        bool force;
742607c464c4 Removed tabulators.
Florian Pose <fp@igh-essen.com>
parents: 1363
diff changeset
   161
        string outputFile;
2436
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   162
        string skin;
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   163
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   164
        Command();
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   165
};
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   166
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   167
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   168
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   169
inline const string &Command::getName() const
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   170
{
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   171
    return name;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   172
}
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   173
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   174
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   175
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   176
inline const string &Command::getBriefDescription() const
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   177
{
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   178
    return briefDesc;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   179
}
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   180
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   181
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   182
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   183
inline Command::Verbosity Command::getVerbosity() const
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   184
{
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   185
    return verbosity;
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   186
}
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   187
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   188
/****************************************************************************/
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   189
1166
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   190
inline const string &Command::getDataType() const
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   191
{
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   192
    return dataType;
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   193
}
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   194
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   195
/****************************************************************************/
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   196
2529
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   197
inline bool Command::getEmergency() const
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   198
{
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   199
    return emergency;
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   200
}
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   201
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   202
/****************************************************************************/
c7e1f2616a9d Implemented emergency register requests to analyze a broken bus.
Florian Pose <fp@igh-essen.com>
parents: 2453
diff changeset
   203
1166
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   204
inline bool Command::getForce() const
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   205
{
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   206
    return force;
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   207
}
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   208
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   209
/****************************************************************************/
006244d53f68 Removed global variables.
Florian Pose <fp@igh-essen.com>
parents: 1156
diff changeset
   210
1335
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   211
inline const string &Command::getOutputFile() const
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   212
{
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   213
    return outputFile;
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   214
}
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   215
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   216
/****************************************************************************/
09c6fce1ae45 merge -c1616 branches/1.4-foe: Included FoE patch from Olav Zarges.
Florian Pose <fp@igh-essen.com>
parents: 1166
diff changeset
   217
2436
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   218
inline const string &Command::getSkin() const
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   219
{
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   220
    return skin;
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   221
}
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   222
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   223
/****************************************************************************/
960cc1bb6b4a EtherLab skin for 'ethercat pdos' command.
Florian Pose <fp@igh-essen.com>
parents: 2011
diff changeset
   224
1142
59be91dfcbe1 Redesigned command interface.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   225
#endif