showplan tests
This commit is contained in:
parent
98c871406b
commit
99f1de735b
3 changed files with 23 additions and 3 deletions
|
@ -58,7 +58,7 @@ export const bapsicleMiddleware: Middleware<{}, RootState, Dispatch<any>> = (
|
|||
store.getState().showplan.plan?.forEach((item) => {
|
||||
if (
|
||||
item.channel === message.channel &&
|
||||
item.weight === message.planItem
|
||||
item.weight === message.weight
|
||||
) {
|
||||
itemToLoad = item;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,11 @@ import Modal from "react-modal";
|
|||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { Button } from "reactstrap";
|
||||
import BAPSicleLogo from "../assets/images/bapsicle.png";
|
||||
import { connectBAPSicle, disconnectBAPSicle } from "../bapsicle";
|
||||
import {
|
||||
connectBAPSicle,
|
||||
disconnectBAPSicle,
|
||||
sendBAPSicleChannel,
|
||||
} from "../bapsicle";
|
||||
import { RootState } from "../rootReducer";
|
||||
|
||||
interface BAPSicleModalProps {
|
||||
|
@ -17,6 +21,7 @@ export function BAPSicleModal(props: BAPSicleModalProps) {
|
|||
const connectionState = useSelector((state: RootState) => state.connection);
|
||||
const [connectType, setConnectType] = useState("Connect");
|
||||
const dispatch = useDispatch();
|
||||
const showplan = useSelector((state: RootState) => state.showplan);
|
||||
|
||||
if (
|
||||
connectType !== "Connect" &&
|
||||
|
@ -58,6 +63,21 @@ export function BAPSicleModal(props: BAPSicleModalProps) {
|
|||
props.close();
|
||||
}}
|
||||
/>
|
||||
<button
|
||||
onClick={() => {
|
||||
for (var i = 0; i < showplan.plan!.length; i++) {
|
||||
let item = showplan.plan![i];
|
||||
sendBAPSicleChannel({
|
||||
channel: item.channel,
|
||||
command: "ADD",
|
||||
weight: item.weight,
|
||||
title: item.title,
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
Load Show Plan
|
||||
</button>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ export const Item = memo(function Item({
|
|||
sendBAPSicleChannel({
|
||||
channel: column,
|
||||
command: "LOAD",
|
||||
planItem: index,
|
||||
weight: index,
|
||||
});
|
||||
dispatch(MixerState.load(column, x));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue