diff --git a/Simulations/STATION_JR_PB/Simulation.tscn b/Simulations/STATION_JR_PB/OIP/Simulation.tscn similarity index 100% rename from Simulations/STATION_JR_PB/Simulation.tscn rename to Simulations/STATION_JR_PB/OIP/Simulation.tscn diff --git a/Simulations/STATION_JR_PB/OIP/station_jr_pb.gd b/Simulations/STATION_JR_PB/OIP/station_jr_pb.gd new file mode 100644 index 0000000..8c99163 --- /dev/null +++ b/Simulations/STATION_JR_PB/OIP/station_jr_pb.gd @@ -0,0 +1,32 @@ +@tool +extends Node +@onready var box_spawner: BoxSpawner = $"../BoxSpawner" +@onready var ul_1_3: BeltConveyorAssembly = $"../UL1_3" + +var color_1 +var color_2 +var tag_group = "TagGroup0" +var display_color_1 +var display_color_2 + +func _ready() -> void: + + SimulationEvents.simulation_started.connect(_on_simulation_started) + +func _on_simulation_started() -> void: + + OIPComms.register_tag(tag_group, "[PLC]UL1_3_JR_PB1.CTRL.STS.Log.LEN", 1) + + # Register all 82 DATA tags + for i in range(82): + var data_tag = "[PLC]UL1_3_JR_PB1.CTRL.STS.Log.DATA[" + str(i) + "]" + OIPComms.register_tag(tag_group, data_tag, 1) + +func _physics_process(delta: float) -> void: + + box_spawner.disable = ul_1_3.speed == 0 + + + #print("Log String: ", Utils.read_string(tag_group, "UL1_3_JR_PB1.CTRL.STS.Log")) + + diff --git a/Simulations/STATION_JR_PB/utils.gd b/Simulations/STATION_JR_PB/OIP/utils.gd similarity index 100% rename from Simulations/STATION_JR_PB/utils.gd rename to Simulations/STATION_JR_PB/OIP/utils.gd diff --git a/Simulations/STATION_JR_PB/AOIs/AOI_STATION_JR_PB_AOI.L5X b/Simulations/STATION_JR_PB/PLC/AOIs/AOI_STATION_JR_PB_AOI.L5X similarity index 100% rename from Simulations/STATION_JR_PB/AOIs/AOI_STATION_JR_PB_AOI.L5X rename to Simulations/STATION_JR_PB/PLC/AOIs/AOI_STATION_JR_PB_AOI.L5X diff --git a/Simulations/STATION_JR_PB/AOIs/AOI_VFD_AOI.L5X b/Simulations/STATION_JR_PB/PLC/AOIs/AOI_VFD_AOI.L5X similarity index 100% rename from Simulations/STATION_JR_PB/AOIs/AOI_VFD_AOI.L5X rename to Simulations/STATION_JR_PB/PLC/AOIs/AOI_VFD_AOI.L5X diff --git a/Simulations/STATION_JR_PB/STATION_JR_PB.L5X b/Simulations/STATION_JR_PB/PLC/STATION_JR_PB.L5X similarity index 100% rename from Simulations/STATION_JR_PB/STATION_JR_PB.L5X rename to Simulations/STATION_JR_PB/PLC/STATION_JR_PB.L5X diff --git a/Simulations/STATION_JR_PB/UDTs/STATION_JR_PB_DataTypes.L5X b/Simulations/STATION_JR_PB/PLC/UDTs/STATION_JR_PB_DataTypes.L5X similarity index 100% rename from Simulations/STATION_JR_PB/UDTs/STATION_JR_PB_DataTypes.L5X rename to Simulations/STATION_JR_PB/PLC/UDTs/STATION_JR_PB_DataTypes.L5X diff --git a/Simulations/STATION_JR_PB/UDTs/VFD_DataTypes.L5X b/Simulations/STATION_JR_PB/PLC/UDTs/VFD_DataTypes.L5X similarity index 100% rename from Simulations/STATION_JR_PB/UDTs/VFD_DataTypes.L5X rename to Simulations/STATION_JR_PB/PLC/UDTs/VFD_DataTypes.L5X