Jump to content

event group in EV


Empfohlene Beiträge

I want to do an event group in EV with the following

1.  read name of locomotive  (I know how to read the name)

2.  stop that locomotive on a stop track after checking direction (using a variable for the train name)

3.  Switch to a camera that is linked to the locomotive and is external.  (I want to reference the camera name with the train name variable  IE    ($train).cam

4.  run a 15 second timer

5.  return to the cockpit camera

 

Is this possible, and can it be used in different locations that have the same situation, and for different locomotives?

can I use the same names for the stop track and the direction track?

Möchte ich durch die folgende eine Ereignisgruppe im EV zu tun

1. Lesen Sie Namen Lokomotive (ich weiß, wie man den Namen zu lesen)

2. Haltestelle, die nach Überprüfung Richtung auf einer Anschlagbahn Lokomotive (eine Variable für den Zug-Namen)

3. Wechseln Sie zu einer Kamera, die an der Lokomotive verbunden ist und ist extern. (Ich möchte den Namen der Kamera mit dem Zug Namen Variable IE ($ Zug zu verweisen) .cam

4. Führen Sie eine 15-Sekunden-Zeitgeber

5. Rückkehr in die Cockpit-Kamera

 

Ist dies möglich, und es kann in verschiedenen Orten eingesetzt werden, die die gleiche Lage haben, und für unterschiedliche Lokomotiven?

kann ich die gleichen Namen für die Anschlagbahn und der Richtung Spur benutzen?

Bearbeitet von Curt84328
Link zu diesem Kommentar
Auf anderen Seiten teilen

I figured out most of the problem.  I can use 2 small tracks to trigger the event, and set 3  variables.  (Track1, reader, and  track2).    the event has 3 steps/  1.  train

enters track, and variable train is read using $reader for the track name, and $_Trigger1._Name for the value.   2.  train enters track  using $track1 for the track name, and train is located on track $track2.  condition  set vehicle speed 0,  activate camera (can i reference the camera with some sort of variable, maybe a nested variable), start timer.   3.  timer expires   action   activate camera $train (set when step 1 occurs)  action deactivate group.

Ich dachte mir, den größten Teil des Problems aus. Ich kann 2 kleine Spuren verwenden das Ereignis ausgelöst werden, und 3 Variablen gesetzt. (Track1, Leser und track2). das Ereignis hat 3 Stufen / 1. Zug
betritt gleis und variable Zug wird mit $ Leser für den Titelnamen und $ _Trigger1._Name für den Wert zu lesen. 2. Zug fährt für den Titelnamen mit $ track1 verfolgen und Zug auf der Strecke $ track2 entfernt. Zustand gesetzt Fahrzeuggeschwindigkeit 0, Kamera zu aktivieren (kann ich verweisen auf die Kamera mit irgendeiner Art von Variable, vielleicht eine verschachtelte Variable), Start-Timer. 3. Timer abgelaufen ist Action-Kamera $ Zug aktivieren (gesetzt, wenn Schritt 1 auftritt) Aktion deaktivieren Gruppe.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Curt,

each object to be considered by the event control must have a unique name, so that it may be uniquely identified by the event control mechanism. Using object variables (instead of "isolated" variables), you can refer them via the object (even along more than one step).

Example:
Assume, that your track is named "track1", the "incoming" locomitive ist named "loco2" and the external camera to be assigned to the loco2 is named "camera2". Then assign by hand the camera2 to the loco2 by use of an object variable loco2.camera = "camera2" and use dynamically for the track1 the object variable track1.train.

When now the event control registers that loco2 enters track1, assign its name to the track variable: track1.train = $_Trigger1._Name. For activating the external camera of the train refer $(track1.train).camera (I hope the syntax is correct).

Considering different tracks (with different names), you must create the event definitions for each track separately. You can duplicate the event definition sequence for one track to another one, but you need to change at least the track name (e.g. from track1 to track2) and also other inividual object names when using them in your event definition sequence to be duplicated.

Many greetings
BahnLand

 

In der Ereignisverwaltung verwendete Objekte müssen immer eindeutig gekennzeichnet sein, damit sie in der Ereignisverwaltung unterschieden werden können. Objektvariablen können über das zugrunde gelegte Objekt referenziert werden.

Beispiel:
das betrachtete Gleis besitze die Bezeichnung "track1" und die Lokomotive des einfahrenden Zuges den Namen "loco2". Die zum Zug gehörige Außenkamera heiße "camera2".  Diese weise man statisch einer Objektvariablen der Lokomotve zu: loco2.camera = "camera2". Der Objektvariablen track1.train werde in der Ereignisverwaltung dynamisch ein Wert zugewiesen.

Wenn nun der Zug mit Lok loco2 in das Gleis track1 einfährt, wird die Zuweisung track1.train = $_Trigger1._Name ausgeführt. Die Außenkamera kann nun mittels $(track1.train).camera adressiert werden (ich hoffe, dass die Syntax stimmt).

Möchte man dasselbe Verhalten für mehrere Gleise realisieren, muss für jedes Gleis eine eigene Ereignisdefinitions-Folge angelegt werden. Man kann diese zwar vom ersten Gleis duplizieren, muss dann aber die spezifischen Namen (z.B. track1 gegen track2) ausauschen.

Viele Grüße
BahnLand

Link zu diesem Kommentar
Auf anderen Seiten teilen

What the EV needs is    a lookup table. and a way to access it

Was die EV braucht, ist eine Lookup-Tabelle. und eine Möglichkeit, darauf zuzugreifen

my EV for above.

triggerpoints

outer track

Train enters a track:

  • Locomotive: [All locomotives]

  • Track: triggerevent

Actions

Set variable:

  • Name: traintrigger

  • Value: reader1

Set variable:

  • Name: track1

  • Value: stop1

Set variable:

  • Name: track2

  • Value: prestop1

Enable/Disable event/group:

  • Event/Group: stopping train for switch

  • State: Enabled

inner track

Train enters a track:

  • Locomotive: [All locomotives]

  • Track: triggerevent2

Actions

Set variable:

  • Name: traintrigger

  • Value: reader2

Set variable:

  • Name: track1

  • Value: stop2

Set variable:

  • Name: track2

  • Value: prestop2

Enable/Disable event/group:

  • Event/Group: stopping train for switch

  • State: Enabled

Event group

stopping train for switch (disabled)

Read train name

Train enters a track:

  • Locomotive: [All locomotives]

  • Track: $traintrigger

Actions

Set variable:

  • Name: train

  • Value: $_Trigger1._Name

setcam

Train leaves a track:

  • Locomotive: $train

  • Track: $traintrigger

Conditions - All conditions must be fulfilled (AND)

Variable has the value:

  • Name: train

  • Value: Bayern

  • Negate: 0

Actions

Set variable:

  • Name: cam

  • Value: Bayerncam

setcam2

Train leaves a track:

  • Locomotive: $train

  • Track: $traintrigger

Conditions - All conditions must be fulfilled (AND)

Variable has the value:

  • Name: train

  • Value: BR38

  • Negate: 0

Actions

Set variable:

  • Name: cam

  • Value: BR38CAM

stop train

Train enters a track:

  • Locomotive: $train

  • Track: $track1

Conditions - All conditions must be fulfilled (AND)

Locomotive/Wagon is located on a track:

  • Locomotive/Wagon: $train

  • Track: $track2

  • Negate: 0

Actions

Set track vehicle speed:

  • Locomotive: $train

  • Track: $track1

  • Speed: 0

  • Set current speed: 0

Activate camera:

  • Camera: $cam

Start timer:

  • Name: 15 second stop

  • Duration: 15

  • Automatic restart: 0

switch camera

Timer expires:

  • Name: 15 second stop

Actions

Activate camera:

  • Camera: $train

Enable/Disable event/group:

  • Event/Group: stopping train for switch

  • State: Disabled


(Note:  all underscored lines could be replaced with a call to a lookup table)

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Curt,

you cannot use a "common event definition" like a procedure from a programming language (e.g.Basic, C++, Pascal, ...), using a variable as container for a parameter. While the procedure provides parameters, where the caller can specify his current values to be used for this specific call (another possibly simultaneous call of this procedure can store and execute its specific parameters), the variable used instead within the event control of the TrainStudio is global and gets overwritten by each call of the common event routine. Assuming, that 2 calls of this event routine are realized quite simultaneously, the 2nd call will overwrite the parameter variable content of the 1st call, so that the 1st call will fail. To avoid such overlapping, you must lock the sequence consisting of the parameter variable overwriting and the common event routine call. But this seems more expensive than a multiplication of the event routine each using its own (fix) parameter values.

Many greetings
BahnLand

 

Es ist nicht möglich, eine "gemeinsame Ereignisdefinition" wie eine in Basic, C++, Pascal oder einer anderen Programmiersprache geschriebene Prozedur zu verwenden, indem man anstelle der Programm-Parameter eine Variable des Modellbahn-Studios als Parameter-Container heranzieht. Während die Prozedur Parameter anbietet, die beim Aufruf mit aktuellen Werten versorgt werden können, und dann bei jedem Prozedur-Aufruf (auch möglicherweise parallel) lokal hinterlegt und abgearbeitet werden, wir eine stattdessen als Parameter-Container verwendete Variable vor jedem Aufruf der "Ereignis-Routine" (Ablauf der Ereignisdefinitions-Folge) überschrieben. Werden nun zwei solche Aufrufe nahezu zeitglich abgesetzt, wird die Variablen-Eingabe des 1. Aufrufs durch jene des 2. Aufrufs überschrieben, sodass der 1. Aufruf zwangsläufig zu einem Fehler führt. Um solche Überlappungen zu vermeiden, müsste man dann das Beschreiben der Variable zusammen mit der Ausführung der Ereignis-Routine durch einen Lock schützen, wodurch die Realisierung dieser Methode vermutich aufwendiger wird, als wenn die Ereignis-Routine für jeden Anwendungsfall einfach vervielfältigt und jeweils mit den spezifischen "fest eingebrannten" Parametern zum Ablauf gebracht wird.

Viele Grüße
BahnLand

Link zu diesem Kommentar
Auf anderen Seiten teilen

I understand that each time the common event is used that variable values change.  I planned that they would.  It simply makes it easier to have a common event instead of entering the steps for each time a train arrives at a switch and has to have the switch changed.  (I have 16 switches on one level, with about 36 on each of the other 2 levels)  It would be only one locomotive at a time. (each train must stop before another locomotive can start.)  Since I plan to drive only one train at a time (each train has different purpose and destinations)  A common event should work.  The purpose of a lookup table would be to lookup a train name and to then get the corresponding train camera name,  (One event, called for each train when information needed rather than have 8 events, one for each train to define the camera name each time.       Would you like to see my partial anlage (It is still very much unfinished.  I am still working on the lower main level.)

Ich verstehe das gemeinsame Fall, dass jedes Mal verwendet wird, dass Variablenwerte ändern. Ich wollte, dass sie wollten. Es macht einfach einfacher ist es, eine gemeinsame Veranstaltung zu haben, anstatt die Schritte für jedes Mal die Eingabe eines Zuges an einem Schalter gelangt und hat den Schalter geändert zu haben. (Ich habe 16 Schalter auf einer Ebene, mit etwa 36 auf jedem der anderen 2 Ebenen) Es wäre nur eine Lok zu einer Zeit sein. (Jeder Zug muss aufhören, bevor eine andere Lokomotive beginnen können.) Da ich plane nur einen Zug fahren zu einem Zeitpunkt (jeder Zug hat unterschiedliche Zwecke und Ziele) Eine gemeinsame Veranstaltung funktionieren sollte. Der Zweck einer Lookup-Tabelle wäre ein Zug Namen nachzuschlagen und dann den entsprechenden Zug Kameranamen zu bekommen, (Ein Ereignis, für jeden Zug aufgerufen, wenn Informationen nicht benötigt als 8 Ereignisse haben, eine für jeden Zug den Namen der Kamera jeweils zu definieren Zeit. Wollen Sie meine Teil Anlage gerne sehen (es ist immer noch sehr unfertig. ich immer noch auf der unteren Hauptebene arbeite.)

hoffentlich meine Translation ist nicht sehr krank

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Curt,

vor 9 Stunden schrieb Curt84328:

hoffentlich meine Translation ist nicht sehr krank

is it true, that you use an automatic translator? It seems so, because some main terms are translated in a quite wrong sense: e.g. "event" means "Ereignis" ("Incident" or "occurence"), but is translated as "Veranstaltung" ("presentation" or "performance"). So, the translated text sometimes is only understandable when regarding also the original english text. 

Therefore, I try to write english comments directly without translating german texts prepared before. Even though my english knowledge really is not perfect, I believe, that these texts are better understandable than automatic translations of my german texts. Nevertheless I will usually add a german interpretation of my english comments (no literal translation) to enable the reader to compare it with the english content, because me too am not immune against using distorting terms.

Yes, I would be interested in your (unfinished) layout, especially in the implemented event control. Please attach it here as mbp-file. Many thanks.

Many greetings
BahnLand
 

Ich vermute, dass Du ein automatisches Übersetzungstool verwendest. Zumindest erscheint es mir so, da z.B. das englische Wort "event" nicht als "Ereignis" (im Sinne von "Vorkommnis") sondern als "Veranstaltung" übersetzt wurde. Somit ist es ganz nützlich, neben dem übersetzten deutschen Text auch den originalen englischen Text zu lesen, um den Kontext verstehen zu können.

Ich versuche den englischen Text immer "direkt" hinzuschreiben, ohne einen entsprechend vorbereiteten Text zu übersetzen, Obwohl mein Englisch sicher nicht als gut bezeichnet werden kann, glaube ich, das die so formulierten Texte trotzdem besser verständlich sind als automatische Übersetzungen entsprechender deutscher Formulierungen. Trotzdem füge ich (meist) den deutschen Text hinzu, da auch ich nicht davor gefeit bin, in meinen englischen Kommentaren "unwissentlich" Sinn-entstellende Begriffe zu verwenden.

Ja, Deine (unfertige) Anlage - speziell die Ereignisverwaltung - interessiert mich schon. Bitte hänge sie hier als mbp-Datei an. Vielen Dank.

Viele Grüße
BahnLand

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

yes, I use a translator service, and know that google is a bit poor in how it translates.  If I have time, I check the translation as I do read a little german

ja, ich benutze einen Dolmetscher-Service, und wissen, dass Google ein bißchen schlecht ist, wie es ihre Übersetzung. Wenn ich Zeit habe, überprüfe ich die Translation als ich Deutsch eine kleine tun lesen

 

CMR Unfinished.mbp   

3 trigger tracks marked in red.   remove tunnel to see.

3 Trigger-Spuren in rot markiert. entfernen Tunnel zu sehen

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Curt,

thank you very much for uploading your layout here. I have studied your event control realization, and you are right: As long as there is no concurrency between different trains, it should work. But it isn't upgradable for use with concurrent train activities. 

Many greetings
BahnLand

Link zu diesem Kommentar
Auf anderen Seiten teilen

Earlier today I was thinking that I wanted to rip my hair out,  I had several railroad switches that were joined together with no tracks between them.  I had to move a few, change the size of some, and add some tracks.  I got it finished, and am ready for a rest.

Ich hatte mehrere Bahnschalteren, die verbunden wurden zusammen ohne Spuren zwischen ihnen Bereits heute Morgen dachte ich, dass ich mir die Haare aus, reißen wollte. Ich mußte ein paar bewegen, die Größe einiger ändern, und einige Spuren hinzufügen. Ich habe es fertig, und ich bin für eine Pause bereit.

 

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...