¿ªÔÆÌåÓý

Locked Jython Script Contribution - YAAT enhancement #automation #yaat #scripting


 

I have found YATT very useful, and have used it in my club to move a train around a timesaver puzzle. Thanks Dave Sands very much.
I found that I needed two enhancements in order to reduce the size of the text file:
  • nested if statements
  • subroutines
I have written a YATT jython file with these enhancements and would like to submit the file for inclusion in JMRI, but I do not know the procedure, so I have put a working routine in the files section in the folder 'YATT with subroutines' for consideration. If the contribution is acceptable it would need some work to bring it up to standard for inclusion. I would need to
  • restore the original example provided by Dave Sands
  • remove a lot of print statements which I added while debugging using a self.print5() routine
  • maybe include an example of nested ifs and gosubs.
In the YATT with subroutines' folder I have placed
  • my version of YATT
  • The text file I used to move a train around the layout

I would appreciate it if I could be told what the next step, if any, should be

Bill Fitch


 

Bill,

I will review your proposed changes. Those look like very good additions.

Dave Sand

On Sep 18, 2019, at 6:17 AM, bill fitch <bill.fitch14@...> wrote:

I have found YATT very useful, and have used it in my club to move a train around a timesaver puzzle. Thanks Dave Sands very much.
I found that I needed two enhancements in order to reduce the size of the text file:
? nested if statements
? subroutines
I have written a YATT jython file with these enhancements and would like to submit the file for inclusion in JMRI, but I do not know the procedure, so I have put a working routine in the files section in the folder 'YATT with subroutines' for consideration. If the contribution is acceptable it would need some work to bring it up to standard for inclusion. I would need to
? restore the original example provided by Dave Sands
? remove a lot of print statements which I added while debugging using a self.print5() routine
? maybe include an example of nested ifs and gosubs.
In the YATT with subroutines' folder I have placed
? my version of YATT
? The text file I used to move a train around the layout

I would appreciate it if I could be told what the next step, if any, should be

Bill Fitch


 

Thanks a lot. I have tried to keep to your style, but may not have succeeded. Please make any changes you feel necessary.

Bill


 

Bill,

As it turns out, my old style is no longer relevant.

I have replaced the run/skip style with a program address style. ?The actionTokens list is now treated as a computer program with control actions modifying the current address index. ?This simplified the implementation of nested IF and GOSUB logic.

Thank you for the push to make this change. ?It was time to re-think how it runs and therefore this will be version 2.0.

Before releasing this on the world, I would appreciate if you could verify with your setup that I did not miss something important.



Dave Sand



On Sep 19, 2019, at 7:39 AM, bill fitch <bill.fitch14@...> wrote:

Thanks a lot. I have tried to keep to your style, but may not have succeeded. Please make any changes you feel necessary.

Bill


 

I will try to test it out this week or early next week

Bill

On Mon, 23 Sep 2019 at 21:35, Dave Sand <ds@...> wrote:
Bill,

As it turns out, my old style is no longer relevant.

I have replaced the run/skip style with a program address style.? The actionTokens list is now treated as a computer program with control actions modifying the current address index.? This simplified the implementation of nested IF and GOSUB logic.

Thank you for the push to make this change.? It was time to re-think how it runs and therefore this will be version 2.0.

Before releasing this on the world, I would appreciate if you could verify with your setup that I did not miss something important.



Dave Sand



On Sep 19, 2019, at 7:39 AM, bill fitch <bill.fitch14@...> wrote:

Thanks a lot. I have tried to keep to your style, but may not have succeeded. Please make any changes you feel necessary.

Bill



--
regards

Bill Fitch


 

Hi Dave

I have tested out version 2 with my YAAT text file with gosubs and nested ifs and it worked flawlessly. It is much better without the messy code that I wrote. It looks a lot nicer too.

However the main reason for me looking at YAAT was to try to automate trains by providing the operators with buttons they could press on a panel. My first approach was with one train which you have seen.

The next approach is to try to cope with 2 trains, for which I am looking at dispatcher. The problem with dispatcher from my viewpoint is that it required a lot of manual intervention actually dispatching the trains,and I wanted to select by pressing buttons. I approached Pete Brownlow when I attended his JMRI Automation course and he forwarded me Jay Janzen's script, from which I extracted some code. I thought that YAAT would be ideal to run the code, so I have incorporated it into version 1 of your code and tested it with a single dispatch script. My next task will be to run one dispatch after another from YAAT.?

It would be very nice to use it in version 2 so if you think it relevant it would be nice if you could look at it and see whether it would be suitable for incorporation. The problems with it are:

  • The dispatch code requires(as Jay wrote it, and I have kept it) another class, which makes YAAT less 'clean'
  • The auto parameters which I have incoporated as fixed variables would also need to be able to be set from YAAT

I have put my attempt in the same folder

The other request is that it would be nice to have different YAAT files for different profiles, so I have put in a bit of code for that. A colleague requested that he should be able to leave the main YAAT file alone and just modify text files, so that was my take on the request.

It would also be quite nice to have a script file in the examples which would enable someone to automate dispatcher outside of YAAT.

Bill