Skip to content

Commit 1e8e823

Browse files
committed
Physical -> Virtual -> Effect / Projection. Fixdef.sc working
Docs ==== - custom to MoonBase Misc ==== - add noise.sc (WIP) - add panel1616.sc and rings21.sc UI == - Files: correct wrong time (*1000) - Module: remove socket RO Server ===== - main: looptask stack to 16K - Utilities: Char<> add += integer - MoonLight: change includes: Animations -> effect -> Virtual layer -> Physical layer - Animations: move external fun to constructor. compile: add to scScript - PhysicalLayer: run each virtual layer - Virtual layer: add size, add destructor, run each projection (WIP)
1 parent 76d64cb commit 1e8e823

File tree

23 files changed

+13028
-12837
lines changed

23 files changed

+13028
-12837
lines changed

docs/general/gettingstarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ At the moment MoonBase is the work in progress repo and temporary also contains
8484

8585
<img width="90" src="https://github.com/user-attachments/assets/588d0854-bac1-4b70-8931-ba6db4c94248" />
8686

87-
* Go to the file you want to change e.g. [ModuleAnimations.h](https://github.com/ewoudwijma/MoonBase/blob/background-script/src/custom/ModuleAnimations.h), press edit and make the changes. E.g. change executable.execute("main") to executable.executeAsTask("main")
87+
* Go to the file you want to change press edit and make the changes. E.g. change executable.execute("main") to executable.executeAsTask("main")
8888
* Press Commit Changes..., enter a commit message and an extended description, Press Commit Changes
8989
* Go back to the homepage of your fork [myfork/MoonBase](https://github.com/ewoudwijma/MoonBase). There is a message inviting to create a Pull Request. Press Compare & pull request.
9090

docs/moonbase/files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Using component FileEdit, see [Components](https://ewowi.github.io/MoonBase/comp
2525

2626
### Server
2727

28-
[FilesService.h](https://github.com/ewowi/MoonBase/blob/main/src/custom/FilesService.h) and [FilesService.cpp](https://github.com/ewowi/MoonBase/blob/main/src/custom/FilesService.cpp)
28+
[FilesService.h](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/FilesService.h) and [FilesService.cpp](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/FilesService.cpp)
2929

3030
### UI
3131

docs/moonbase/module/animations.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ They represent current state of Live Script processing and will be extended as m
3131
* To do: kill running scripts, e.g. when changing effects
3232
* To do: use Nodes arguments as arguments to scripts or hardcoded effects
3333

34-
### Mapping model (to do)
34+
### Mapping model (WIP)
3535

3636
<img width="500" src="https://github.com/user-attachments/assets/6f76a2d6-fce1-4c72-9ade-ee5fbd056c88" />
3737

@@ -51,28 +51,31 @@ They represent current state of Live Script processing and will be extended as m
5151
* Driver show: show the result on Leds (using FastLED, hpwit drivers), ArtNet, DDP, ...
5252
* Future situation: Nodes and noodles (2)
5353
* Replace the nodes table (1) by a graphical view (2)
54-
* MappingTable (3)
54+
* Virtual Layer (MappingTable) (3)
5555
* Array of arrays. Outer array is virtual pixels, inner array is physical pixels.
5656
* Implemented efficiently using the StarLight PhysMap struct
5757
* e.g. [[],[0],[1,2],[3,4,5],[6,7,8,9]]
5858
* first virtual pixel is not mapped to a physical pixel
5959
* second virtual pixel is mapped to physical pixel 0
6060
* third virtual pixel is mapped to physical pixels 1 and 2
6161
* and so on
62-
* CRGB leds[NUM_LEDS] are physical pixels (as in FASTLED)
6362
* Virtual pixels can be 1D, 2D or 3D. Physical pixels also, in any combination
6463
* Using x + y * sizeX + z * sizeX * sizeY
65-
* Each effect Node has it's own MappingTable and gets updated if fixture, mapping or dimensions change
6664
* set/getPixelColor functions used in effects using the MappingTable
6765
* Nodes manipulate the MappingTable and/or interfere in the effects loop
66+
* A Virtual Layer gets updated if fixture, mapping or dimensions change
67+
* An effect uses a virtual layer. One Virtual layer can have multiple effects.
68+
* Physical layer
69+
* CRGB leds[NUM_LEDS] are physical pixels (as in FASTLED)
70+
* A Physical layer has one or more virtual layers and a virtual layer has one or more effects using it.
6871
* Presets/playlist: change (part of) the nodes model
6972

7073
✅: Done
7174

7275
### Server
7376

74-
[ModuleAnimations.h](https://github.com/ewowi/MoonBase/blob/main/src/custom/ModuleAnimations.h)
77+
[ModuleAnimations.h](https://github.com/ewowi/MoonBase/blob/main/src/MoonLight/ModuleAnimations.h)
7578

7679
### UI
7780

78-
Generated by [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/custom/module/Module.svelte)
81+
Generated by [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/moonbase/module/Module.svelte)

docs/moonbase/module/demo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
### Server
1212

13-
[ModuleDemo.h](https://github.com/ewowi/MoonBase/blob/main/src/custom/ModuleDemo.h)
13+
[ModuleDemo.h](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/ModuleDemo.h)
1414

1515
### UI
1616

17-
Generated by [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/custom/module/Module.svelte)
17+
Generated by [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/moonbase/module/Module.svelte)

docs/moonbase/module/instances.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Sends and receives UDP messages over the network to see which other instances ar
1717

1818
### Server
1919

20-
[ModuleInstances.h](https://github.com/ewowi/MoonBase/blob/main/src/custom/ModuleInstances.h)
20+
[ModuleInstances.h](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/ModuleInstances.h)
2121

2222
### UI
2323

24-
Generated by [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/custom/module/Module.svelte)
24+
Generated by [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/moonbase/module/Module.svelte)

docs/moonbase/modules.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To create a new module:
2323
* Create a **class** which inherits from Module
2424
* Call the Module **constructor** with the name of the module.
2525
* This name will be used to set up http rest api and webserver sockets
26-
* See [ModuleDemo.h](https://github.com/ewowi/MoonBase/blob/main/src/custom/ModuleDemo.h)
26+
* See [ModuleDemo.h](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/ModuleDemo.h)
2727

2828
```cpp
2929
class ModuleDemo : public Module
@@ -68,7 +68,7 @@ void setupDefinition(JsonArray root) override{
6868

6969
* Implement function **onUpdate** to define what happens if data changes
7070
* struct UpdatedItem defines the update (parent property (including index in case of multiple records), name of property and value)
71-
* This runs in the httpd / webserver task. To run it in the main (application task use runInLoopTask - see [ModuleAnimations](https://github.com/ewowi/MoonBase/blob/main/src/custom/ModuleAnimations.h)) - as httpd stack has been increased runInLoopTask is less needed
71+
* This runs in the httpd / webserver task. To run it in the main (application task use runInLoopTask - see [ModuleAnimations](https://github.com/ewowi/MoonBase/blob/main/src/MoonLight/ModuleAnimations.h)) - as httpd stack has been increased runInLoopTask is less needed
7272

7373
```cpp
7474
void onUpdate(UpdatedItem &updatedItem) override
@@ -134,7 +134,7 @@ submenu: [
134134
{
135135
title: 'Module Demo',
136136
icon: BulbIcon,
137-
href: '/custom/module?module=demo',
137+
href: '/moonbase/module?module=demo',
138138
feature: page.data.features.liveanimation,
139139
},
140140
]
@@ -150,9 +150,9 @@ It might be arguable that readonly variables are not stored in state data.
150150

151151
### Server
152152

153-
* [Module.h](https://github.com/ewowi/MoonBase/blob/main/src/custom/Module.h) and [Module.cpp](https://github.com/ewowi/MoonBase/blob/main/src/custom/Module.cpp) will generate all the required server code
153+
* [Module.h](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/Module.h) and [Module.cpp](https://github.com/ewowi/MoonBase/blob/main/src/MoonBase/Module.cpp) will generate all the required server code
154154

155155
### UI
156-
* [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/custom/module/Module.svelte) will deal with the UI
156+
* [Module.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/moonbase/module/Module.svelte) will deal with the UI
157157
* [MultiInput.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/lib/components/moonbase/MultiInput.svelte) is used by Module.svelte to display the right UI widget based on what is defined in the definition json
158158
* Modifications done in [menu.svelte](https://github.com/ewowi/MoonBase/blob/main/interface/src/routes/menu.svelte) do identify a module by href and not by title alone

interface/src/routes/moonbase/files/Files.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
dateStyle: 'short',
326326
timeStyle: 'short',
327327
timeZone: 'UTC'
328-
}).format(item.time)}
328+
}).format(item.time*1000)}
329329
</div>
330330
{:else}
331331
<div>{item.files.length} files/folders</div>

interface/src/routes/moonbase/module/Module.svelte

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,24 +152,17 @@
152152
// data = state;
153153
};
154154
155-
const handleRO = (state: any) => {
156-
console.log("handleRO", state);
157-
updateRecursive(data, state);
158-
};
159-
160155
//workaround for let params = $state(page.url.searchParams)
161156
const socketOn = ((name: string) => {
162157
if (modeWS) {
163158
console.log("socketOn", name);
164159
socket.on(name, handleState);
165-
socket.on(name + "RO", handleRO);
166160
}
167161
});
168162
const socketOff = ((name: string) => {
169163
if (modeWS) {
170164
console.log("socketOff", name);
171165
socket.off(name, handleState);
172-
socket.off(name + "RO", handleRO);
173166
}
174167
});
175168

interface/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const config: UserConfig = {
1616
proxy: {
1717
// Proxying REST: http://localhost:5173/rest/bar -> http://192.168.1.83/rest/bar
1818
'/rest': {
19-
target: 'http://192.168.1.128',
19+
target: 'http://192.168.1.129',
2020
changeOrigin: true
2121
},
2222
// Proxying websockets ws://localhost:5173/ws -> ws://192.168.1.83/ws
2323
'/ws': {
24-
target: 'ws://192.168.1.128',
24+
target: 'ws://192.168.1.129',
2525
changeOrigin: true,
2626
ws: true
2727
}

0 commit comments

Comments
 (0)