import React from "react";
import { action, computed, makeObservable, observable } from "mobx";
import { observer } from "mobx-react";
import classNames from "classnames";
import {
HorizontalHeaderWithBody,
VerticalHeaderWithBody,
Header,
Body
} from "eez-studio-ui/header-with-body";
import { Navigation } from "instrument/window/navigation";
import { ButtonAction, IconAction } from "eez-studio-ui/action";
import { AlertDanger } from "eez-studio-ui/alert";
import { Loader } from "eez-studio-ui/loader";
import { Toolbar } from "eez-studio-ui/toolbar";
import { Dialog, showDialog } from "eez-studio-ui/dialog";
import { PropertyList, TextInputProperty } from "eez-studio-ui/properties";
import type { InstrumentAppStore } from "instrument/window/app-store";
import type { INavigationItem } from "instrument/window/navigation";
import type { InstrumentObject } from "instrument/instrument-object";
import { Icon } from "eez-studio-ui/icon";
import { settingsController } from "home/settings";
////////////////////////////////////////////////////////////////////////////////
export const EditInstrumentLabelDialog = observer(
class EditInstrumentLabelDialog extends React.Component<{
instrument: InstrumentObject;
size?: "small" | "medium" | "large";
}> {
label: string;
constructor(props: any) {
super(props);
this.label = this.props.instrument.label || "";
makeObservable(this, {
label: observable
});
}
render() {
return (
);
}
}
);
////////////////////////////////////////////////////////////////////////////////
export const AppBar = observer(
class AppBar extends React.Component<
{
appStore: InstrumentAppStore;
selectedItem: INavigationItem | undefined;
},
{}
> {
get instrument() {
return this.props.appStore.instrument;
}
handleConnectClick = () => {
this.instrument.openConnectDialog();
};
handleDisconnectClick = () => {
this.instrument.connection.disconnect();
};
onEditInstrumentLabel = () => {
showDialog(