Is there a way to take a symbol like a the Extended pusher 1 (selected), place it inside a view in perspective, and use the Y coordinate to “move” it up and down based the CurrentLevel of the component?
In VISION we used this script tied to the component.
I would do a binding on the y coordinate. Connect it to your ‘CurrentLevel’ value, and then you can do a similar script to what you had in vision within a script transform, just remove the system.gui.transform line and return your yPos instead.
I got it to work by binding the template to the current level then adding a mapping of the physical location to for each level. Probably not the most efficient. I will try your way.
I am really interested in how your set up works. What does the y = 100 + currentValue.value * 15 do? Specifcally the 100 and the *15.
In my new screen i have added an index and startX that was used while in vision. I have tweaked the index from 16 to 44.5 so that when the crane homes it will be in the same location.
My issues is that it almost goes off the screen to the left and it does not line up directly with the actual green squares, which are bin locations. I am not sure what to tweak to correct it.
I have bound the x position to the multiplier and the multiplier has the expression below.
Jordan, if I have this statement below do i actually need the = 1, 200 in the first part?
I think if i am reading this correctly, if i leave the = 1 part if it 1 and not > then it will look at the expression and return 200 due to the last part?
You have to figure out your index when the screen loads. In vision it’s in pixels and depending on the screen resolution, the number of pixels between boxes will be different so you have to calculate that when the screen is activated. I’m not sure what that is in perspective but there is a script that runs on the window open of the vision window to calculate that value.
It’s something like: (X position of the last box - X position of the first box) / number of boxes
What I’m saying is that your starting position of 200 and the index may not be what it is when you are not in the designer because that is all relative. You should set the starting position as the X position of the first box and then calculate what the index should be from the position of the boxes on the screen at runtime.
The algorithm is: max(200, 235 + (rackfield-2) * 70 + (rackplace-1) * 35)
Since there is no [1,2] spot, [2,1] becomes the origin spot at 235. if we try to calculate with rackfield 1, the value goes less than 200, so the max function returns 200.
for rackfield in range(1, 31): # 1 to 30
for rackplace in range(1, 3):# 1 to 2
x = max(200, 235 + (rackfield-2) * 70 + (rackplace-1) * 35)
print [rackfield, rackplace], x