Skip to content

Commit

Permalink
Remove debug output, fix float issue
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat committed Feb 19, 2024
1 parent e818b79 commit 2f763f0
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
3 changes: 0 additions & 3 deletions lms_bridge/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ impl Bridge {
}

pub fn handle_message(self: &mut Self, msg: &WsMessage) {
println!("Received message: {:?}", msg);

match msg {
WsMessage::AddController {
id,
Expand Down Expand Up @@ -53,7 +51,6 @@ impl Bridge {
self.controllers.remove(id);
}
WsMessage::CallController { id, message } => {
println!("Calling controller: {} with message: {}", id, message);
if let Some(tx) = self.controllers.get(id) {
let _ = tx.send(BridgeToControllerMessage::Message(message.to_owned()));
} else {
Expand Down
2 changes: 0 additions & 2 deletions lms_bridge/src/controllers/dmx_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ impl DmxController {
}
}
DmxControllerMessage::Data(data) => {
println!("Sending data: {:?}", data);
if let Some(ref mut port) = self.serialport {
let _ = port.write(&data.data[..]);
};
Expand All @@ -79,7 +78,6 @@ impl Controller for DmxController {
match self.rx.recv() {
Ok(msg) => match msg {
BridgeToControllerMessage::Message(str_message) => {
println!("Received message: {}", str_message);
let parsed_message: DmxControllerMessage =
serde_json::from_str(&str_message).unwrap();
self.handle_message(parsed_message);
Expand Down
2 changes: 0 additions & 2 deletions lms_bridge/src/controllers/wled_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl WledController {
self.port = configuration.port;
}
WledControllerMessage::Data(data) => {
println!("Sending data: {:?}", data);
let Some(ref socket) = self.socket else {
return;
};
Expand Down Expand Up @@ -76,7 +75,6 @@ impl Controller for WledController {
match self.rx.recv() {
Ok(msg) => match msg {
BridgeToControllerMessage::Message(str_message) => {
println!("Received message: {}", str_message);
let parsed_message: WledControllerMessage =
serde_json::from_str(&str_message).unwrap();
self.handle_message(parsed_message);
Expand Down
2 changes: 1 addition & 1 deletion src/stage/controllers/dmx/dmx.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class DmxController extends BaseController<DmxControllerConfiguration, Dm
for (const fixture of this.controlledFixtures) {
const fixtureChannelValues = fixture.value;
for (const [channel, value] of fixtureChannelValues.entries()) {
channelValues.set(fixture.config.startChannel + channel, value);
channelValues.set(fixture.config.startChannel + channel, Math.floor(value));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/stage/controllers/wled/wled.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export class WledController extends BaseController<WledControllerConfiguration,
buff[1] = this.config.timeout;

for (let i = 0; i < fixture.config.numLeds; i++) {
buff[i * 3 + 2] = colors[i][0];
buff[i * 3 + 3] = colors[i][1];
buff[i * 3 + 4] = colors[i][2];
buff[i * 3 + 2] = Math.floor(colors[i][0]);
buff[i * 3 + 3] = Math.floor(colors[i][1]);
buff[i * 3 + 4] = Math.floor(colors[i][2]);
}

this.sendMessage({
Expand Down

0 comments on commit 2f763f0

Please sign in to comment.