プロジェクト

全般

プロフィール

ArtEC-1.1.0.patch

n-ando, 2013/04/15 20:31

差分を表示:

src/ext/ec/artlinux/ArtExecutionContext.cpp 2012-06-12 18:52:25.216903029 +0900
29 29
namespace RTC
30 30
{
31 31
  ArtExecutionContext::ArtExecutionContext()
32
    : PeriodicExecutionContext()
32
    : PeriodicExecutionContext(),
33
      m_priority(ART_PRIO_MAX-1)
33 34
  {
35
      rtclog.setName("ArtEC");
36
      coil::Properties& prop(Manager::instance().getConfig());
37

  
38
      // Priority
39
      getProperty(prop, "exec_cxt.periodic.priority", m_priority);
40
      getProperty(prop, "exec_cxt.periodic.art.priority", m_priority);
41
      RTC_DEBUG(("Priority: %d", m_priority));
42

  
34 43
  }
35 44

  
36 45
  ArtExecutionContext::~ArtExecutionContext()
......
41 50
  int ArtExecutionContext::svc(void)
42 51
  {
43 52
    int usec(m_period.sec() * 1000000 + m_period.usec());
44
    if (art_enter(ART_PRIO_MAX-1, ART_TASK_PERIODIC, usec) == -1)
53
    if (art_enter(m_priority, ART_TASK_PERIODIC, usec) == -1)
45 54
      {
46 55
	std::cerr << "fatal error: art_enter" << std::endl;
47 56
      }
src/ext/ec/artlinux/ArtExecutionContext.h 2012-06-12 18:35:44.618520333 +0900
38 38
    ArtExecutionContext();
39 39
    virtual ~ArtExecutionContext();
40 40
    virtual int svc(void);
41

  
42
    template <class T>
43
    void getProperty(coil::Properties& prop, const char* key, T& value)
44
    {
45
    if (prop.findNode(key) != 0)
46
      {
47
        T tmp;
48
        if (coil::stringTo(tmp, prop[key].c_str()))
49
          {
50
            value = tmp;
51
          }
52
      }
53
    }
54

  
55
  private:
56
      int m_priority;
41 57
  };
42 58
};
43 59

  
src/ext/ec/artlinux/Makefile.am 2012-06-12 18:49:09.984828415 +0900
19 19
module_LTLIBRARIES = ArtExecutionContext.la
20 20

  
21 21
ArtExecutionContext_la_SOURCES = ArtExecutionContext.cpp ArtExecutionContext.h
22
ArtExecutionContext_la_LDFLAGS = -module -shared
22
ArtExecutionContext_la_LDFLAGS = -module -shared $(ARTLIB)
23 23
ArtExecutionContext_la_FLAGS   = -L$(top_builddir)/src/lib/rtm/.lib
24 24
ArtExecutionContext_la_LIBADD  = $(top_builddir)/src/lib/rtm/libRTC.la
25 25