Hemiptera Bugtracker at bugs.linux-forks.de

advtrains

[atlac] atc_reset() doesn't clear the Cpl autocouple flag

Send replies to 190@bugs.linux-forks.de or using the Form below.
avatar From: OP
Thu, 30 Dec 2021 14:01:01 -0000

Currently there's no way to cancel the Cpl flag without coupling to

another wagon. Even sending another atc_send() command won't override

the Cpl flag, causing the subsequent command to "hang" until the train

collides with another wagon.

atc_reset() should be able to do clear this flag, as it was originally

set by atc_send().

Below is a (mostly untested) patch that will clear the flag for every

case where the atc needs resetting instead of just atc_reset(). Unsure

how this will affect non-LuaATC running though

From c46888fb25b57c4d93feadf3cd14c2a68e54cab3 Mon Sep 17 00:00:00 2001

From: Maverick2797 <git.maverick2797@gmail.com>

Date: Thu, 30 Dec 2021 21:13:49 +0800

Subject: [PATCH] Clear autocouple flag set by Cpl when resetting atc

Sending another atc command to a train that is currently waiting for the

Cpl command to complete/couple will hang until the train couples to

something.

---

 advtrains/atc.lua | 1 +

 1 file changed, 1 insertion(+)

 mode change 100644 => 100755 advtrains/atc.lua

diff --git a/advtrains/atc.lua b/advtrains/atc.lua

old mode 100644

new mode 100755

index 8cb3e8f..996b484

--- a/advtrains/atc.lua

+++ b/advtrains/atc.lua

@@ -94,6 +94,7 @@ function atc.train_reset_command(train, keep_tarvel)

        train.atc_brake_target=nil

        train.atc_wait_finish=nil

        train.atc_arrow=nil

+       train.atc_wait_autocouple = nil

        if not keep_tarvel then

                train.tarvelocity=nil

        end

--

2.34.1

avatar From: Developer
Fri, 31 Dec 2021 15:13:01 -0000

Fixed with ef8391a. Thanks for reporting.

- orwell

Am 30.12.21 um 15:02 schrieb 190@bugs.linux-forks.de:

> Currently there's no way to cancel the Cpl flag without coupling to

> another wagon. Even sending another atc_send() command won't override

> the Cpl flag, causing the subsequent command to "hang" until the train

> collides with another wagon.

>

> atc_reset() should be able to do clear this flag, as it was originally

> set by atc_send().

>

> Below is a (mostly untested) patch that will clear the flag for every

> case where the atc needs resetting instead of just atc_reset(). Unsure

> how this will affect non-LuaATC running though

>

>

> From c46888fb25b57c4d93feadf3cd14c2a68e54cab3 Mon Sep 17 00:00:00 2001

> From: Maverick2797 <git.maverick2797@gmail.com>

> Date: Thu, 30 Dec 2021 21:13:49 +0800

> Subject: [PATCH] Clear autocouple flag set by Cpl when resetting atc

>

> Sending another atc command to a train that is currently waiting for the

> Cpl command to complete/couple will hang until the train couples to

> something.

> ---

>  advtrains/atc.lua | 1 +

>  1 file changed, 1 insertion(+)

>  mode change 100644 => 100755 advtrains/atc.lua

>

> diff --git a/advtrains/atc.lua b/advtrains/atc.lua

> old mode 100644

> new mode 100755

> index 8cb3e8f..996b484

> --- a/advtrains/atc.lua

> +++ b/advtrains/atc.lua

> @@ -94,6 +94,7 @@ function atc.train_reset_command(train, keep_tarvel)

>         train.atc_brake_target=nil

>         train.atc_wait_finish=nil

>         train.atc_arrow=nil

> +       train.atc_wait_autocouple = nil

>         if not keep_tarvel then

>                 train.tarvelocity=nil

>         end

> --

> 2.34.1

>

avatar From: Developer
Fri, 31 Dec 2021 15:13:01 -0000

Fixed with ef8391a. Thanks for reporting.

- orwell

Am 30.12.21 um 15:02 schrieb 190@bugs.linux-forks.de:

> Currently there's no way to cancel the Cpl flag without coupling to

> another wagon. Even sending another atc_send() command won't override

> the Cpl flag, causing the subsequent command to "hang" until the train

> collides with another wagon.

>

> atc_reset() should be able to do clear this flag, as it was originally

> set by atc_send().

>

> Below is a (mostly untested) patch that will clear the flag for every

> case where the atc needs resetting instead of just atc_reset(). Unsure

> how this will affect non-LuaATC running though

>

>

> From c46888fb25b57c4d93feadf3cd14c2a68e54cab3 Mon Sep 17 00:00:00 2001

> From: Maverick2797 <git.maverick2797@gmail.com>

> Date: Thu, 30 Dec 2021 21:13:49 +0800

> Subject: [PATCH] Clear autocouple flag set by Cpl when resetting atc

>

> Sending another atc command to a train that is currently waiting for the

> Cpl command to complete/couple will hang until the train couples to

> something.

> ---

>  advtrains/atc.lua | 1 +

>  1 file changed, 1 insertion(+)

>  mode change 100644 => 100755 advtrains/atc.lua

>

> diff --git a/advtrains/atc.lua b/advtrains/atc.lua

> old mode 100644

> new mode 100755

> index 8cb3e8f..996b484

> --- a/advtrains/atc.lua

> +++ b/advtrains/atc.lua

> @@ -94,6 +94,7 @@ function atc.train_reset_command(train, keep_tarvel)

>         train.atc_brake_target=nil

>         train.atc_wait_finish=nil

>         train.atc_arrow=nil

> +       train.atc_wait_autocouple = nil

>         if not keep_tarvel then

>                 train.tarvelocity=nil

>         end

> --

> 2.34.1

>

avatar Status Update
Fri, 31 Dec 2021 15:08:01 -0000
This bug was closed.
Reply