Skip to content

Commit

Permalink
change map size y default
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Feb 21, 2025
1 parent bec24d7 commit bfb22e7
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/mutations/devices/seeders/abstract_genesis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def settings_default_map_size_x
end

def settings_default_map_size_y
device.web_app_config.update!(map_size_y: 1_400)
device.web_app_config.update!(map_size_y: 1_230)
end

def pin_bindings_button_1
Expand Down
2 changes: 1 addition & 1 deletion app/mutations/devices/seeders/genesis_xl_one_five.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def settings_default_map_size_x
end

def settings_default_map_size_y
device.web_app_config.update!(map_size_y: 2_900)
device.web_app_config.update!(map_size_y: 2_730)
end

def tool_slots_slot_7
Expand Down
2 changes: 1 addition & 1 deletion app/mutations/devices/seeders/genesis_xl_one_four.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def settings_default_map_size_x
end

def settings_default_map_size_y
device.web_app_config.update!(map_size_y: 2_900)
device.web_app_config.update!(map_size_y: 2_730)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/mutations/devices/seeders/genesis_xl_one_seven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def settings_default_map_size_x
end

def settings_default_map_size_y
device.web_app_config.update!(map_size_y: 2_900)
device.web_app_config.update!(map_size_y: 2_730)
end

def peripherals_rotary_tool
Expand Down
2 changes: 1 addition & 1 deletion app/mutations/devices/seeders/genesis_xl_one_six.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def settings_default_map_size_x
end

def settings_default_map_size_y
device.web_app_config.update!(map_size_y: 2_900)
device.web_app_config.update!(map_size_y: 2_730)
end

def peripherals_rotary_tool
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20250221191831_change_map_size_y_default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeMapSizeYDefault < ActiveRecord::Migration[6.1]
def change
change_column_default(:web_app_configs, :map_size_y, from: 1400, to: 1230)
end
end
6 changes: 4 additions & 2 deletions db/structure.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
Expand Down Expand Up @@ -2005,7 +2006,7 @@ CREATE TABLE public.web_app_configs (
show_pins boolean DEFAULT false,
disable_emergency_unlock_confirmation boolean DEFAULT true,
map_size_x integer DEFAULT 2900,
map_size_y integer DEFAULT 1400,
map_size_y integer DEFAULT 1230,
expand_step_options boolean DEFAULT false,
hide_sensors boolean DEFAULT false,
confirm_plant_deletion boolean DEFAULT true,
Expand Down Expand Up @@ -3979,6 +3980,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20240405171128'),
('20240625195838'),
('20241203194030'),
('20241203211516');
('20241203211516'),
('20250221191831');


2 changes: 1 addition & 1 deletion frontend/__test_support__/fake_state/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export function fakeWebAppConfig(): TaggedWebAppConfig {
default_plant_depth: 5,
disable_emergency_unlock_confirmation: false,
map_size_x: 2900,
map_size_y: 1400,
map_size_y: 1230,
user_interface_read_only_mode: false,
["three_d_garden" as BooleanConfigKey]: false,
["dark_mode" as BooleanConfigKey]: false,
Expand Down
6 changes: 3 additions & 3 deletions frontend/farm_designer/__tests__/index_test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe("<FarmDesigner />", () => {
expect(legendProps.imageAgeInfo).toEqual({ newestDate: "", toOldest: 1 });
const gardenMapProps = wrapper.find(GardenMap).props();
expect(gardenMapProps.mapTransformProps.gridSize.x).toEqual(2900);
expect(gardenMapProps.mapTransformProps.gridSize.y).toEqual(1400);
expect(gardenMapProps.mapTransformProps.gridSize.y).toEqual(1230);
});

it("loads image info", () => {
Expand Down Expand Up @@ -199,7 +199,7 @@ describe("<FarmDesigner />", () => {
describe("getDefaultAxisLength()", () => {
it("returns axis lengths", () => {
const axes = getDefaultAxisLength(() => false);
expect(axes).toEqual({ x: 2900, y: 1400, z: 400 });
expect(axes).toEqual({ x: 2900, y: 1230, z: 400 });
});
});

Expand All @@ -212,7 +212,7 @@ describe("getGridSize()", () => {
y: { value: 200, isDefault: false },
z: { value: 400, isDefault: true },
});
expect(grid).toEqual({ x: 2900, y: 1400 });
expect(grid).toEqual({ x: 2900, y: 1230 });
});

it("returns custom grid size", () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/farm_designer/__tests__/state_to_props_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe("botSize()", () => {
const state = fakeState();
expect(botSize(state)).toEqual({
x: { value: 2900, isDefault: true },
y: { value: 1400, isDefault: true },
y: { value: 1230, isDefault: true },
z: { value: 400, isDefault: true },
});
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/farm_designer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const getDefaultAxisLength =
if (isFinite(mapSizeX) && isFinite(mapSizeY)) {
return { x: mapSizeX, y: mapSizeY, z: 400 };
}
return { x: 2900, y: 1400, z: 400 };
return { x: 2900, y: 1230, z: 400 };
};

export const getGridSize = (
Expand Down
2 changes: 1 addition & 1 deletion frontend/settings/default_values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const DEFAULT_WEB_APP_CONFIG_VALUES: Record<Key, Value> = {
show_pins: false,
disable_emergency_unlock_confirmation: true,
map_size_x: 2900,
map_size_y: 1400,
map_size_y: 1230,
expand_step_options: false,
hide_sensors: false,
confirm_plant_deletion: true,
Expand Down
2 changes: 1 addition & 1 deletion frontend/three_d_garden/bot/bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ export const Bot = (props: FarmbotModelProps) => {
]}
position={[
threeSpace(x - extrusionWidth - 8, bedLengthOuter) + bedXOffset,
threeSpace((bedWidthOuter + beamLength) / 2, bedWidthOuter),
threeSpace((bedWidthOuter + beamLength) / 2, bedWidthOuter) - 50,
columnLength + 40,
]}
rotation={[Math.PI / 2, 0, 0]}>
Expand Down
20 changes: 10 additions & 10 deletions spec/controllers/api/devices/devices_controller_seed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to_not be
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(1400)
expect(settings_default_map_size_y?(device)).to eq(1230)
end

it "seeds accounts with Genesis 1.3 data" do
Expand Down Expand Up @@ -451,7 +451,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to_not be
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(1400)
expect(settings_default_map_size_y?(device)).to eq(1230)
end

it "seeds accounts with Genesis 1.4 data" do
Expand Down Expand Up @@ -524,7 +524,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to_not be
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(1400)
expect(settings_default_map_size_y?(device)).to eq(1230)
end

it "seeds accounts with Genesis 1.5 data" do
Expand Down Expand Up @@ -599,7 +599,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to_not be
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(1400)
expect(settings_default_map_size_y?(device)).to eq(1230)
end

it "seeds accounts with Genesis 1.6 data" do
Expand Down Expand Up @@ -675,7 +675,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to be_kind_of(Sequence)
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(1400)
expect(settings_default_map_size_y?(device)).to eq(1230)
end

it "seeds accounts with Genesis 1.7 data" do
Expand Down Expand Up @@ -750,7 +750,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to be_kind_of(Sequence)
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(1400)
expect(settings_default_map_size_y?(device)).to eq(1230)
end

it "seeds accounts with Genesis XL 1.4 data" do
Expand Down Expand Up @@ -823,7 +823,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to_not be
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(5900)
expect(settings_default_map_size_y?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(2730)
end

it "seeds accounts with Genesis XL 1.5 data" do
Expand Down Expand Up @@ -898,7 +898,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to_not be
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(5900)
expect(settings_default_map_size_y?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(2730)
end

it "seeds accounts with Genesis XL 1.7 data" do
Expand Down Expand Up @@ -973,7 +973,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to be_kind_of(Sequence)
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(5900)
expect(settings_default_map_size_y?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(2730)
end

it "seeds accounts with Genesis XL 1.6 data" do
Expand Down Expand Up @@ -1049,7 +1049,7 @@ def check_slot_pairing(slot, expected_name)
expect(sequences_mow_all_weeds?(device)).to be_kind_of(Sequence)
expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence)
expect(settings_default_map_size_x?(device)).to eq(5900)
expect(settings_default_map_size_y?(device)).to eq(2900)
expect(settings_default_map_size_y?(device)).to eq(2730)
end

it "seeds accounts with Express 1.0 data" do
Expand Down

0 comments on commit bfb22e7

Please sign in to comment.