Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. registering c++ functions into scxml ecmascript to be used from the state machine js code
Forum Updated to NodeBB v4.3 + New Features

registering c++ functions into scxml ecmascript to be used from the state machine js code

Scheduled Pinned Locked Moved Unsolved General and Desktop
scxml
4 Posts 2 Posters 953 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nurettin
    wrote on 10 Jul 2018, 19:36 last edited by
    #1

    Hi, I'm working on a project which makes use of scxml to represent a state machine and listens to mqtt channels to receive events which will change states. Is it somehow possible to register a function which listens to the mqtt channel into ecmascript like you can do with qtscript so I can use it from the state machine ? I searched through the examples but I couldn't find any examples of what I want to accomplish.

    Thanks for your time.

    P 1 Reply Last reply 11 Jul 2018, 20:12
    0
    • N nurettin
      10 Jul 2018, 19:36

      Hi, I'm working on a project which makes use of scxml to represent a state machine and listens to mqtt channels to receive events which will change states. Is it somehow possible to register a function which listens to the mqtt channel into ecmascript like you can do with qtscript so I can use it from the state machine ? I searched through the examples but I couldn't find any examples of what I want to accomplish.

      Thanks for your time.

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 11 Jul 2018, 20:12 last edited by
      #2

      @nurettin what about using a QMqttClient instead of javascript? You can subscribe to topics and react to its messageReceived() signal. I guess that depending on the topic/message received you could go on and update the state machine accordingly

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      N 1 Reply Last reply 11 Jul 2018, 21:17
      1
      • P Pablo J. Rogina
        11 Jul 2018, 20:12

        @nurettin what about using a QMqttClient instead of javascript? You can subscribe to topics and react to its messageReceived() signal. I guess that depending on the topic/message received you could go on and update the state machine accordingly

        N Offline
        N Offline
        nurettin
        wrote on 11 Jul 2018, 21:17 last edited by
        #3

        @Pablo-J.-Rogina That is a good idea, but I would like to upload any generic scxml + js pair to my program and run the logic without writing any additional c++ code except the pub/sub calls. I got a hint on stackoverflow that I may register QML functions into scxml ecmascript model, so the problem may be solved already.

        P 1 Reply Last reply 12 Jul 2018, 00:33
        0
        • N nurettin
          11 Jul 2018, 21:17

          @Pablo-J.-Rogina That is a good idea, but I would like to upload any generic scxml + js pair to my program and run the logic without writing any additional c++ code except the pub/sub calls. I got a hint on stackoverflow that I may register QML functions into scxml ecmascript model, so the problem may be solved already.

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 12 Jul 2018, 00:33 last edited by
          #4

          @nurettin I see, gettting the scxml + js outside the application seems more versatile

          I got a hint on stackoverflow

          Could it be possible you provide a link to such Q&A for anybody interested? Thanks

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          1/4

          10 Jul 2018, 19:36

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved