Skip to content

Commit

Permalink
Merge pull request #591 from intechstudio/feat/GridProtocol
Browse files Browse the repository at this point in the history
🚩PR: Reverted reverted Protocol merge, fixed GridProtocol refactor
  • Loading branch information
elsoazemelet authored Feb 11, 2024
2 parents bf3a498 + a71ad30 commit 76308af
Show file tree
Hide file tree
Showing 13 changed files with 412 additions and 296 deletions.
6 changes: 3 additions & 3 deletions src/renderer/main/modals/AddVirtualModule.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script>
import { ModuleType } from "./../../protocol/grid-protocol.ts";
import { Analytics } from "./../../runtime/analytics.js";
import { runtime } from "../../runtime/runtime.store";
import { MeltSelect } from "@intechstudio/grid-uikit";
import MoltenPushButton from "../panels/preferences/MoltenPushButton.svelte";
import MoltenModal from "./MoltenModal.svelte";
import { VirtualModuleTypes } from "../../runtime/virtual-engine";
import { modal } from "./modal.store";
let selected = 0;
let options = Object.keys(VirtualModuleTypes).map((key, index) =>
let options = Object.keys(ModuleType).map((key, index) =>
Object({ title: key, value: index })
);
Expand All @@ -32,7 +32,7 @@
}
</script>

<MoltenModal>
<MoltenModal width={400}>
<div slot="content">
<div class="flex w-full text-4xl opacity-90 pb-2">
Welcome to Virtual Mode!
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/main/modals/Monaco.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { watchResize } from "svelte-watch-resize";
import MoltenPushButton from "./../panels/preferences/MoltenPushButton.svelte";
import { onDestroy, onMount } from "svelte";
import { grid } from "../../protocol/grid-protocol";
import { modal } from "./modal.store";
import grid from "../../protocol/grid-protocol.js";
import MoltenModal from "./MoltenModal.svelte";
import { debug_monitor_store } from "../panels/DebugMonitor/DebugMonitor.store";
Expand Down Expand Up @@ -91,7 +91,7 @@
scriptLength = editedList.toConfigScript().length;
//Check the minified config length
if (scriptLength >= grid.properties.CONFIG_LENGTH) {
if (scriptLength >= grid.getProperty("CONFIG_LENGTH")) {
throw new LengthError("Config limit reached.");
}
Expand Down Expand Up @@ -213,7 +213,7 @@
<span
>{`Character Count: ${
typeof scriptLength === "undefined" ? "?" : scriptLength
}/${grid.properties.CONFIG_LENGTH - 1} (max)`}</span
}/${grid.getProperty("CONFIG_LENGTH") - 1} (max)`}</span
>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/main/panels/DebugMonitor/DebugMonitor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
} from "./DebugMonitor.store";
import { appSettings } from "../../../runtime/app-helper.store";
import { fade } from "svelte/transition";
import grid from "../../../protocol/grid-protocol";
import { grid } from "../../../protocol/grid-protocol";
import { writable, readable } from "svelte/store";
import PolyLineGraph from "../../user-interface/PolyLineGraph.svelte";
import { incoming_messages } from "../../../serialport/message-stream.store";
Expand Down Expand Up @@ -158,9 +158,9 @@
<div class="text-white">
<span
class:text-error={$configScriptLength >=
grid.properties.CONFIG_LENGTH}
grid.getProperty("CONFIG_LENGTH")}
class:text-yellow-400={$configScriptLength >
(grid.properties.CONFIG_LENGTH / 3) * 2}
(grid.getProperty("CONFIG_LENGTH") / 3) * 2}
>{$configScriptLength}
</span>
</div>
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/main/panels/MidiMonitor/MidiMonitor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
debug_stream,
MusicalNotes,
} from "./MidiMonitor.store";
import grid from "../../../protocol/grid-protocol";
import { grid } from "../../../protocol/grid-protocol";
import SvgIcon from "../../user-interface/SvgIcon.svelte";
import { configManager } from "../../panels/configuration/Configuration.store";
Expand Down Expand Up @@ -346,10 +346,11 @@
<div class="flex flex-row">
<div class="pr-2">Char Count:</div>
<div
class={$configScriptLength >= grid.properties.CONFIG_LENGTH
class={$configScriptLength >=
grid.getProperty("CONFIG_LENGTH")
? "text-error"
: $configScriptLength >=
(grid.properties.CONFIG_LENGTH / 3) * 2
(grid.getProperty("CONFIG_LENGTH") / 3) * 2
? "text-yellow-400"
: "text-white"}
>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/main/panels/configuration/Configuration.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function lastOpenedActionblocksRemove(short) {
import stringManipulation from "../../user-interface/_string-operations";
import * as luamin from "lua-format";

import grid from "../../../protocol/grid-protocol.js";
import { grid } from "../../../protocol/grid-protocol";
import { v4 as uuidv4 } from "uuid";

const luaminOptions = {
Expand Down Expand Up @@ -305,7 +305,7 @@ export class ConfigList extends Array {
//Throws error if limit is reached
checkLength() {
const length = this.toConfigScript().length;
if (length > grid.properties.CONFIG_LENGTH) {
if (length > grid.getProperty("CONFIG_LENGTH")) {
const target = ConfigTarget.getCurrent();
throw {
type: "lengthError",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/main/panels/configuration/EventPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { get } from "svelte/store";
import { ConfigTarget } from "./Configuration.store.js";
import { MeltRadio } from "@intechstudio/grid-uikit";
import { CEEAT } from "../../../protocol/grid-protocol.js";
import { CEEAT } from "../../../protocol/grid-protocol";
const dispatch = createEventDispatcher();
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/main/user-interface/_string-operations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import grid from "../../protocol/grid-protocol.js";
import { grid } from "../../protocol/grid-protocol";

const stringManipulation = {
initialize: function (inputSet = []) {
Expand Down Expand Up @@ -426,4 +426,4 @@ export function debounce(callback, delay) {
};
}

stringManipulation.initialize(grid.properties.LUA);
stringManipulation.initialize(grid.getProperty("LUA"));
Loading

0 comments on commit 76308af

Please sign in to comment.