Create Layout in DCC++ Controller

Patrick Black Nov 22, 2019

  1. Patrick Black

    Patrick Black New Member

    2
    0
    2
    So, at this time I just playing around with DCC++ and feel very comfortable with setting up the hardware, but have a specific question about creating the layout in the Controller app. I have it working fine on my computer, but it's has the original "Valley Model Railroad" layout programmed in. Are there directions for modifying the on screen layout so it matches what I have?

    Thanks,
    Patrick
     
  2. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    Let me say, welcome to the forum, and to DCC++!

    i think there are some directions somewhere, but i don't remember where Gregg put them.
    a lot of us use various means of controlling DCC++ hardware. i for one use JMRI (JMRI.org), though i am by no means a master of it. it has it's own layout panel editor, where you can put switches and such to control, as well as show the status of any sensors.
    my (so far) favorite part of JMRI, is the WiThrottle server, allowing you to use an iPhone, or Android phone/tablet (EngineDriver) via your home WiFi (not over the internet), as a throttle walk-around.
    Others here have developed their own variation of a JMRI-less walk-around with either Arduino or ESP technology, depending on your level of electronics and programing skills. all depends on what, and how, you would like to use your DCC++ setup.

    when it comes to DCC++, there are many DIY options, and several ready-to-run setups. others may correct me if i am wrong, but i think the official DCC++ controller software was more of a proof-of-concept example.

    ~Travis
     
  3. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    There was a post in 2016 from Gregg that may help:
    https://www.trainboard.com/highball...ation-and-interface.84800/page-45#post-965413

    EDIT: This is the sample layout he refers to. (I haven't looked at it so don't know if it's still valid)
    https://github.com/DccPlusPlus/Controller/tree/sample-layout
     
  4. Pup Cam

    Pup Cam New Member

    2
    2
    2
    Hi, I've just started to playaround with this aspect. Fundamentally, there are a number of "primitive" elements (eg straights, curves etc) that you position, orientate and draw on the "layout" part of the display board. As I have but a simple straight test track, this code snippet illustrates the starting point. Things to note:

    1) There is one active element of the drawing ansd all the subsequent elements are commented out.
    2) The drawing is drawn using the board area's "drawing units" and therefore at least to start with, there's quite a lot of trial and error in placing elements!
    3) In my case, as there are no turnouts and no track occupancy sensors, the diagram is entirely pointless (no pun intended!) other than to illustrate how you go about drawing something more meaningful.
    4) An important point is that in the code, most elements reference another, usually the one preceeding it AND if the referenced object does not exist the code will not build.
    5) I'm unaware at this point of any ability to scroll the layout area window so if your layout fits the aspect ratio of the drawing area you'll be alright. If you have a very long thin layout with lot's of complexity along the length you might be in trouble!
    6) The best way to learn how to do it is by trial and error, one step at a time.

    Here's the snippet of code from the "controllerConfig" module (most of it commented out!) for my test track:

    // CREATE MAIN LAYOUT AND DEFINE ALL TRACKS

    layout=new Layout(325,50,1000,80*25.4,36*25.4);

    Track bridgeA = new Track(layout,20,450,1600,0); <--------- ONLY ACTIVE LINE OF CODE
    // Track bridgeA = new Track(layout,20,450,62,90);
    // Track bridgeB = new Track(bridgeA,1,348,-90);
    // Track bridgeC = new Track(bridgeB,1,399);
    // Track t5A = new Track(bridgeC,1,126);
    // Track t5A = new Track(bridgeC,1,126);
    // Track loop3A = new Track(t5A,1,682);
    // Track loop3B = new Track(loop3A,1,381,-180);
    // Track loop3C = new Track(loop3B,1,124);
    // Track t20A2 = new Track(loop3C,1,126);
    // Track t20B2 = new Track(loop3C,1,481,15);
    // Track t20B1 = new Track(t20B2,1,481,-15);

    Hope that helps.

    Alan

    DCC Panel.JPG
     
    Jimbo20 likes this.
  5. Patrick Black

    Patrick Black New Member

    2
    0
    2
    Thanks for all the replies, I have considered checking out JMRI, so I think that's a good way to go. I'll check the Controller code sample to see how he coded it. I'm not afraid of learning some coding, but appreciate a place to start.

    Appreciate everyone helping out a noobie!
    Patrick
     

Share This Page