Skip to content

Commit 37d1fa5

Browse files
[Argus -To be replaced] - Removed StreamSwitch
1 parent 0845dd7 commit 37d1fa5

File tree

4 files changed

+45
-42
lines changed

4 files changed

+45
-42
lines changed

mxcubeweb/core/adapter/argus_adapter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
from typing import ClassVar
22

3-
from Argus import Argus
3+
try:
4+
from Argus import Argus
5+
except ImportError:
6+
Argus = None
47

58
from mxcubeweb.core.adapter.adapter_base import AdapterBase
69

710

811
class ArgusAdapter(AdapterBase):
912
ATTRIBUTES: ClassVar = ["processes_info", "last_response", "camera_streams"]
10-
SUPPORTED_TYPES: ClassVar[list[object]] = [Argus]
13+
SUPPORTED_TYPES: ClassVar[list[object]] = []
1114

1215
def __init__(self, ho, *args):
1316
super().__init__(ho, *args)

ui/src/components/Argus/ArgusButton.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function ArgusButton(props) {
1616
if (!argus) {
1717
return null;
1818
}
19-
const processes_info = argus.attributes.processes_info;
19+
const { processes_info } = argus.attributes;
2020
const recording =
2121
processes_info?.running?.Recorder?.settings?.recording || false;
2222
const running = processes_info?.closable_running || false;

ui/src/components/Argus/StreamSwitch.jsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ export function StreamSwitch(props) {
1111
);
1212
const [streammode, setStreammode] = useState('monitors');
1313

14-
return (
15-
cameras ? (
16-
<div style={{ textAlign: 'center' }}>
17-
{streammode === 'monitors' && (
18-
<StreamMonitors handleSourceSwitch={handleSourceSwitch} />
19-
)}
20-
{streammode === 'dropdown' && (
21-
<StreamDropdown handleSourceSwitch={handleSourceSwitch} />
22-
)}
23-
<button
24-
type="button"
25-
onClick={() => {
26-
setStreammode(streammode === 'monitors' ? 'dropdown' : 'monitors');
27-
}}
28-
style={{ display: 'block', margin: '10px auto' }}
29-
>
30-
Switch Stream Mode
31-
</button>
32-
</div>
33-
) : (<div></div>)
14+
return cameras ? (
15+
<div style={{ textAlign: 'center' }}>
16+
{streammode === 'monitors' && (
17+
<StreamMonitors handleSourceSwitch={handleSourceSwitch} />
18+
)}
19+
{streammode === 'dropdown' && (
20+
<StreamDropdown handleSourceSwitch={handleSourceSwitch} />
21+
)}
22+
<button
23+
type="button"
24+
onClick={() => {
25+
setStreammode(streammode === 'monitors' ? 'dropdown' : 'monitors');
26+
}}
27+
style={{ display: 'block', margin: '10px auto' }}
28+
>
29+
Switch Stream Mode
30+
</button>
31+
</div>
32+
) : (
33+
<div />
3434
);
3535
}

ui/src/components/SampleView/SampleImage.jsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -861,24 +861,24 @@ class SampleImage extends React.Component {
861861
this.canvas.requestRenderAll();
862862
}
863863

864-
changeSource = (source) => {
865-
const canvas = document.querySelector('#sample-img');
866-
if (source && canvas) {
867-
if (this.player) {
868-
this.player.stop();
869-
this.player = new JSMpeg.Player(source, {
870-
canvas,
871-
decodeFirstFrame: false,
872-
preserveDrawingBuffer: false,
873-
protocols: [],
874-
autoplay: true,
875-
displayGl: false,
876-
});
877-
this.player.play();
878-
}
879-
canvas.src = source;
880-
}
881-
};
864+
// changeSource = (source) => {
865+
// const canvas = document.querySelector('#sample-img');
866+
// if (source && canvas) {
867+
// if (this.player) {
868+
// this.player.stop();
869+
// this.player = new JSMpeg.Player(source, {
870+
// canvas,
871+
// decodeFirstFrame: false,
872+
// preserveDrawingBuffer: false,
873+
// protocols: [],
874+
// autoplay: true,
875+
// displayGl: false,
876+
// });
877+
// this.player.play();
878+
// }
879+
// canvas.src = source;
880+
// }
881+
// };
882882

883883
render() {
884884
this.configureGrid();
@@ -916,7 +916,7 @@ class SampleImage extends React.Component {
916916
</div>
917917
</div>
918918

919-
<StreamSwitch handleSourceSwitch={this.changeSource} />
919+
{/* <StreamSwitch handleSourceSwitch={this.changeSource} /> -- > */}
920920
</div>
921921
);
922922
}

0 commit comments

Comments
 (0)