Jump to content

container entity location


teresimio123

Recommended Posts

29 minutes ago, GFurtado said:

ModelEntity.CurrentStation.Name

Be aware that this will return an error in the case the entity is not at a station.

Wait, actually this doesn't work.

Check the attached model:

  1. Create a new ContainerEntity with a string state named whatever you like;
  2. Assign NewContainerEntity.NewStringState = Filler.Name when entering the filler.
  3. Use this expression any time you need the name of the last station that entity visited.

Get Station Name.spfx

Link to comment
Share on other sites

Thanks Gustavo, actually what worked for me was ContainerEntity.Location.Parent.Name! Anyway thank you very much. 

I have another doubt which I think is far more complicated. I have two "streets" with a container entity moving moving along each of them. This streets have both fillers and emptiers, and I wish to write in excel every time a container entity goes from a filler to an emptier and how long that took. For example if my container on street 1 goes from filler_2 to emptier_6 I would like a row in excel with those 3 columns: starting filler, ending emptier and time between. 

I achieved this without problem for one of the streets (adding add on process triggers to all of the fillers and another for all of the emptiers). The thing is when I add this same processes to the emptiers/fillers of street 2, my excel goes crazy and obviously because of two reasons: the time I register to calculate time between is being updated in both streets every time a container goes out of an emptier, and exactly the same happens with the row that this 3 things have to be written in the excel.

I don't know hoy I can manage to construct the variables time and row_count without them getting confused and hence my excel becoming useless.

Thanks, again!!!

Link to comment
Share on other sites

On 2/19/2020 at 3:34 PM, GFurtado said:

I would suggest to expand this model I sent before by creating new states inside your ModelEntity.

  • Two states when the entity leaves a station (one updates the station name and one updates the time it left).
  • A state when the entity enters a station.
  • Maybe another states registering how many rows in your sheet were written.

The columns of your sheet would be ModelEnity.FromStation, ModelEntity.ToStation and (ModelEntity.TimeLeftStation - TimeNow).

Let me know if you need help building this model.

Link to comment
Share on other sites

×
×
  • Create New...