Anyone know Python or Jython programming?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madpugger
    S2Forum Extremist
    • Sep 2007
    • 1901
    • Country: Scotland

    #1

    Anyone know Python or Jython programming?

    I know there are some clever guys here, and I am in need of a little help as I have a deadline coming up!

    You may remember from here that I tinker with model railways. In fact I am on the committee at the AMRC and do the website, technical Digital control randomness.

    Anyway, we have an exhibition next month at the SECC in Glasgow, and before then I need to get some container cranes working from digital signals. They used to work remotely, with a remote control that had a lead. They are now connected and working digitally but in a not too user friendly fashion. I intend to get them working with a Sony PS3 controller. Fortunately getting this to work with the Mac is a piece of ****! Infact getting the layout speaking to the Mac is also very easy, the main problem is that the Crane is actually more like 3 trains as it has 3 decoders where a locomotive only has one in general, so there are no scripts for what I want to do.

    The missing piece is this, and i know roughly how to do it, but it will take me forever!

    Set up an interface to input which decoder numbers to use

    Write script to specify which decoder does what

    Set up an interface to setup which PS3 button/stick does what



    Then I need to get another one working too, but I can always use a seperate Mac if that makes this easier for now.

    Oh, the software I am using is JMRI and is free, and available for all OSs pretty much.

    Anyone care to help?!

    Ta!

    Le Mans 2012
    Nurburgring 700
    1995 S2 Avant
  • prj
    S2Forum Zealot
    • Mar 2010
    • 6308
    • Country: Estonia

    #2
    If it has a processor or uc, I can code for it.
    Instead of jython might as well use Java, but I can do both.

    But err... I would not do it for free... I use my free time to work on Motronic
    I'd imagine it'd be kinda difficult without having the environment.
    http://tuner.ee - http://www.facebook.com/tuner.ee

    Comment

    • madpugger
      S2Forum Extremist
      • Sep 2007
      • 1901
      • Country: Scotland

      #3
      Thanks PRJ, kind offer, unfortunately we have no money as a club, and all my money is being eaten by I5s!

      Yes its pretty hard to do without the environment for sure. The reason for Jython (a b@stardised version of Python for Java Model Railway Interface) is there is already some code there that nearly does what I want, I am just having trouble changing it to do what I want, as it is 15 years since I did any real programming, and that was in Pascal and Delphi

      Le Mans 2012
      Nurburgring 700
      1995 S2 Avant

      Comment

      • Nuvo
        S2Forum Possessed
        • Nov 2003
        • 3827

        #4
        Python is an excellent programming language, it is easy to learn and the IDE encourages you to experiment to get the results you want. I would imagine Jython to be similar in this regard. Development is also very fast.

        I honestly think you would be the best person for the task, particularly when you have some programming experience and you know the environment.

        Just sit down with a good tutorial and work through it to understand the syntax and semantics of the language.
        Once you have familiarised yourself with this, and the fact that you know what you want to achieve you should be in a good position to understand the relevant code in JMRI to develop your own functions and classes.
        Last edited by Nuvo; 24 January 2011, 16:52. Reason: typo

        Comment

        • prj
          S2Forum Zealot
          • Mar 2010
          • 6308
          • Country: Estonia

          #5
          What he said
          http://tuner.ee - http://www.facebook.com/tuner.ee

          Comment

          • madpugger
            S2Forum Extremist
            • Sep 2007
            • 1901
            • Country: Scotland

            #6
            Yeah I know its a longshot getting someone who knows what the final need etc is.

            I just need a little help to decipher some of the code that is already there I guess. There are a couple of scripts there that are of some use but will need modified.

            Cheers though

            Le Mans 2012
            Nurburgring 700
            1995 S2 Avant

            Comment

            • Greg_S
              Administrator
              • Jul 2003
              • 12431
              • Country: United Kingdom

              #7
              Yeah goto agree about python, very good language especially for prototyping. Im in django hell tonight, but sure will work better tomorrow. Let me know some more details on what your doing etc and might be able to help a little.
              Greg

              S2Forum.com Administrator & Webmaster

              '93 Coupe with a few tweeks

              Comment

              Working...