Home AMX User Forum NetLinx Studio

Two source files

adysadys Posts: 395
Hi all


I have 2 sources that include the same files and same consts but runing diff code.
(manging 2 rooms on one master)

First I tired to solve it by making the include files using diff consts and then I realize I can put one more source to make seperated.

Only one can be set as master, so the other one I need map manualy.

I mapped the other one to 0.1.0 manually - like the master?

is it ok?

thanks



Ady.


update - both source doing include to files that handling button events, and it looks like its working good

It looks like I can't debug the non master file (and all its includes)...

is this is they way to do it?

What if I will map it to 0.2.0?


update 2

its not working good :(

only one file is working at a time...


update 3 - I moved it to be a module. its ok now.

but if someone can talk a little about it I will thank him.

Comments

  • NetLinx Studio supports the Workspace. In the workspace, you can create a Project, which later may contain one or more Systems.

    So what I would do is to create 2 systems, where both have different IP addresses, TO every system, I now can add the master file, Includes, panels, etc.

    In case of an Include file which should be used in both systems, just add them into both system trees. If you later mark one system as "active system" and do a "build active system" the Include is compiled into the first system, then download. If you now want to compile the second system, I would change the second system to active and again do a "Build Active System". Now the same Include file is compiled into the second system.

    For example, it is the same with touchpanel files. Let's say you have the same panelfile for 2 systems, just add it to both systems in the workspace and map it. Now the same single panelfile is used to download into 2 locations.

    Very helpful.

    Hope this helps.
  • adysadys Posts: 395
    Thanks

    That is how I work

    Only in one of the systems, I had 2 include files, each for a room.

    Lets say In every include file I have function foo()

    So when I include them both in the master file, they give a complie error...

    So what I tried is to create 2 src files , and to include one in each src file.
    one was the master, the other was maaped to 0.1.0


    bottom line, its not working, and I moved them to be modules....
  • NMarkRobertsNMarkRoberts Posts: 455
    This is about two rooms being controlled from one master, so Marc's suggestions don't apply.

    The way to do this is with two control modules. If the two rooms are at all similar they should be two instances of the same module with a flag to decide different behaviour in the two rooms.

    As far as I can tell this addresses the problems and it is certainly what modules are for.
  • adysadys Posts: 395
    you are right

    only its different behave in every room, so its diff module for every room.
Sign In or Register to comment.