Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚩PR: Added UI for Virtual Module management #678

Merged
merged 7 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed QA issues
  • Loading branch information
elsoazemelet committed Apr 19, 2024
commit 3523eae87b3722c3aea8fa1948a063d71aa44a94
2 changes: 1 addition & 1 deletion src/renderer/main/grid-layout/AddModuleButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</script>

<button
class="hover:bg-primary-600 bg-primary hover:fill-white/75 rounded-full fill-secondary-brightness-30 h-10 w-10 p-3"
class=" rounded-full fill-transparent bg-transparent h-10 w-10 p-3 hover:bg-white/15 hover:fill-secondary"
on:click={handleClick}
>
<svg
Expand Down
51 changes: 1 addition & 50 deletions src/renderer/main/panels/preferences/Preferences.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<script lang="ts">
import { modal } from "./../../modals/modal.store.ts";
import AddVirtualModule from "./../../modals/AddVirtualModule.svelte";
import { configManager } from "./../configuration/Configuration.store.js";
import { logger } from "./../../../runtime/runtime.store.js";
import { writable, get } from "svelte/store";
import { get } from "svelte/store";
import { instructions } from "../../../serialport/instructions";
import { onMount, onDestroy } from "svelte";
import { appSettings } from "../../../runtime/app-helper.store";
import { Analytics } from "../../../runtime/analytics.js";
import { runtime } from "../../../runtime/runtime.store.js";

import {
Expand All @@ -21,10 +17,8 @@
MeltSelect,
MoltenButton,
MoltenInput,
BlockColumn,
} from "@intechstudio/grid-uikit";
import { reduced_motion_store } from "../../../runtime/animations.js";
import MoltenPushButton, { ButtonSnap } from "./MoltenPushButton.svelte";

const configuration = window.ctxProcess.configuration();

Expand Down Expand Up @@ -87,24 +81,6 @@
];

let activePreferenceMenu = PreferenceMenu.GENERAL;

let virtualModuleDX: string = "0";
let virtualModuleDY: string = "0";

function handleAddVirtualModuleClicked() {
modal.show({
component: AddVirtualModule,
args: { dx: Number(virtualModuleDX), dy: Number(virtualModuleDY) },
});
}

function handleRemoveVirtualModuleClicked() {
const rt = get(runtime);
const [dx, dy] = [Number(virtualModuleDX), Number(virtualModuleDY)];
if (typeof rt.find((e) => e.dx === dx && e.dy === dy) !== "undefined") {
runtime.destroy_module(dx, dy);
}
}
</script>

<div
Expand Down Expand Up @@ -415,31 +391,6 @@
</BlockRow>
</Block>

<Block>
<BlockTitle>Virtual Module Management</BlockTitle>
<BlockBody
>Additional modules can be added or removed on a given coordinate.</BlockBody
>
<BlockRow>
<BlockBody>DX</BlockBody>
<MoltenInput bind:target={virtualModuleDX} />
<BlockBody>DY</BlockBody>
<MoltenInput bind:target={virtualModuleDY} />
</BlockRow>
<BlockColumn>
<MoltenPushButton
text={"Add"}
snap={ButtonSnap.FULL}
on:click={handleAddVirtualModuleClicked}
/>
<MoltenPushButton
text={"Remove"}
snap={ButtonSnap.FULL}
on:click={handleRemoveVirtualModuleClicked}
/>
</BlockColumn>
</Block>

<Block>
<!-- Radio Select for profileCloudUrl -->

Expand Down
Loading