mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Added semi-working simulator for estimating robot travel distances
This commit is contained in:
@@ -54,7 +54,9 @@ module TAC
|
||||
window.backend.config.configuration.hostname = value
|
||||
window.backend.config_changed!
|
||||
end
|
||||
|
||||
label ":", text_size: 18, margin: 0, padding: 0, padding_top: 3
|
||||
|
||||
@tacnet_port = edit_line "#{window.backend.config.configuration.port}", text_size: 18, width: 0.2, margin_left: 0
|
||||
@tacnet_port.subscribe(:changed) do |caller, value|
|
||||
window.backend.config.configuration.port = Integer(value)
|
||||
|
||||
@@ -12,10 +12,46 @@ module TAC
|
||||
end
|
||||
end
|
||||
|
||||
flow width: 1.0, height: 1.0 do
|
||||
background [Gosu::Color::GRAY, Gosu::Color::BLACK]
|
||||
flow width: 1.0, height: 0.9 do
|
||||
background Gosu::Color::GRAY
|
||||
|
||||
@field_container = stack width: 0.4, height: 1.0 do
|
||||
background Gosu::Color::WHITE
|
||||
end
|
||||
|
||||
stack width: 0.6, height: 1.0 do
|
||||
background Gosu::Color::GREEN
|
||||
|
||||
stack width: 1.0, height: 0.95 do
|
||||
# background Gosu::Color::YELLOW
|
||||
@source_code = edit_line "", width: 1.0, height: 1.0, text_size: 18
|
||||
end
|
||||
|
||||
flow width: 1.0, height: 0.05 do
|
||||
background Gosu::Color::BLUE
|
||||
|
||||
button "Run", text_size: 18, width: 0.49 do
|
||||
@simulation = TAC::Simulator::Simulation.new(source_code: @source_code.value, field_container: @field_container)
|
||||
@simulation.__start
|
||||
end
|
||||
button "Save", text_size: 18, width: 0.49
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def draw
|
||||
super
|
||||
|
||||
Gosu.flush
|
||||
@simulation.__draw if @simulation
|
||||
end
|
||||
|
||||
def update
|
||||
super
|
||||
|
||||
@simulation.__update if @simulation
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user