@esrf/daiquiri-lib 0.0.1-alpha.2 → 0.0.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +254 -1
- package/dist/index.esm.js +670 -198
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +25 -22
- package/src/index.ts +26 -0
- package/src/scss/_base.scss +0 -0
- package/src/scss/_indicator.scss +23 -0
- package/src/scss/_numericstep.scss +153 -0
- package/src/scss/main.scss +5 -2
- package/LICENSE +0 -21
- package/src/scss/_lib.scss +0 -9
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/hardware/TypeIcon.tsx","../src/hardware/utils/HardwareTemplate.tsx","../src/hardware/utils/State.tsx","../src/components/NumericStep.tsx","../src/hardware/utils/HardwareNumericStep.tsx","../src/hardware/utils/HardwareInputNumber.tsx","../src/hardware/MotorDefault.tsx"],"sourcesContent":["interface Props {\n online: boolean;\n activeMessage?: string;\n inactiveMessage?: string;\n message?: string;\n icon: string;\n name: string;\n}\nexport function OnlineStatus(props: Props) {\n const {\n activeMessage = 'Online',\n inactiveMessage = 'Offline',\n message = 'This device is',\n } = props;\n\n return (\n <div\n className={`dot-indicator small bg-${\n props.online ? 'success' : 'danger'\n }`}\n title={`${message} ${props.online ? activeMessage : inactiveMessage}`}\n />\n );\n}\n\nexport default function TypeIcon(props: Props) {\n const { name, icon } = props;\n return (\n <div className=\"icon\" title={name}>\n <i className={`fa ${icon}`} />\n <OnlineStatus {...props} />\n </div>\n );\n}\n","import type { ReactElement } from 'react';\nimport { Form, OverlayTrigger, Popover, Button } from 'react-bootstrap';\nimport type { Hardware } from './types';\n\ninterface Props {\n hardware: Hardware;\n headerMode?: string;\n widgetIcon: ReactElement;\n widgetState: ReactElement;\n widgetContent: ReactElement;\n}\n\n/**\n * Normalized way to compose hardware component in order to provide the same\n * kind of layout\n */\nexport default function HardwareTemplate(props: Props) {\n const { headerMode, hardware } = props;\n\n function getLabel() {\n if (hardware.alias) {\n return hardware.alias;\n }\n if (hardware.name) {\n return hardware.name;\n }\n return hardware.id;\n }\n\n const label = getLabel();\n\n switch (headerMode) {\n case 'front':\n return (\n <div className=\"hw-component\">\n <div className=\"hw-single\">\n {props.widgetIcon}\n <div className=\"name\">{label}</div>\n <div className=\"d-inline-block\">{props.widgetContent}</div>\n </div>\n </div>\n );\n case 'none':\n return (\n <div className=\"hw-component\">\n <div className=\"hw-single\">{props.widgetContent}</div>\n </div>\n );\n case 'state':\n return props.widgetState;\n // case 'top':\n default:\n return (\n <div className=\"hw-component\">\n <div className=\"hw-head\">\n {props.widgetIcon}\n <div className=\"name\">\n <Form.Label htmlFor={hardware.id}>{label}</Form.Label>\n </div>\n {props.widgetState}\n {props.hardware.errors && props.hardware.errors.length > 0 && (\n <OverlayTrigger\n trigger=\"click\"\n placement=\"bottom\"\n rootClose\n overlay={\n <Popover id={props.hardware.id} style={{ maxWidth: 500 }}>\n <Popover.Header>Device Errors</Popover.Header>\n <Popover.Body>\n There were errors with properties on this device:\n <ul>\n {props.hardware.errors.map((error) => (\n <li>\n {error.property}:\n <span className=\"stack-trace\">\n {error.traceback}\n <br />\n {error.exception}\n </span>\n </li>\n ))}\n </ul>\n </Popover.Body>\n </Popover>\n }\n >\n <Button variant=\"danger\" size=\"sm\">\n <i className=\"fa fa-exclamation-triangle\" />\n </Button>\n </OverlayTrigger>\n )}\n </div>\n <div className=\"hw-content\">{props.widgetContent}</div>\n </div>\n );\n }\n}\n","import { Badge } from 'react-bootstrap';\nimport type * as Schema from './schema';\n\n/**\n * Normalize the way to display an hardware state.\n *\n * If `minWidth` is pecified (in `em`) it ensure the widget width will stay the\n * same when the state change\n */\nexport function HardwareState(props: {\n state: string;\n variant: string;\n minWidth?: number;\n}) {\n const style = {\n display: 'inline-block',\n minWidth: '',\n };\n\n if (props.minWidth) style.minWidth = `${props.minWidth}em`;\n return (\n <div style={style}>\n <Badge bg={props.variant}>{props.state}</Badge>\n </div>\n );\n}\n\nexport function MotorState(props: { hardware: Schema.MotorSchema }) {\n const { hardware } = props;\n function getState() {\n if (!hardware.online) {\n return 'OFFLINE';\n }\n let s1 = 'UNKNOWN';\n if (props.hardware.properties.state) {\n [s1] = props.hardware.properties.state;\n }\n return s1;\n }\n const state = getState();\n return (\n <HardwareState\n state={state}\n minWidth={6}\n variant={state === 'READY' ? 'success' : 'warning'}\n />\n );\n}\n\nexport function ShutterState(props: {\n hardware: Schema.ShutterSchema;\n useReadyState?: boolean;\n}) {\n const { hardware } = props;\n function getState() {\n if (!hardware.online) {\n return 'OFFLINE';\n }\n const s = hardware.properties.state;\n if (props.useReadyState && (s === 'OPEN' || s === 'CLOSED')) {\n return 'READY';\n }\n return s;\n }\n\n const state = getState();\n\n function getVariant() {\n switch (state) {\n case 'READY':\n return 'success';\n case 'OPEN':\n return 'success';\n case 'CLOSED':\n return 'danger';\n case 'DISABLED':\n return 'secondary';\n case 'MOVING':\n case 'STANDBY':\n case 'OFFLINE':\n return 'warning';\n case 'FAULT':\n return 'fatal';\n default:\n return 'fatal';\n }\n }\n\n return <HardwareState state={state} minWidth={6} variant={getVariant()} />;\n}\n","import type {\n KeyboardEvent,\n ChangeEvent,\n MutableRefObject,\n ReactChild,\n} from 'react';\nimport { forwardRef, useRef, useState } from 'react';\nimport { map } from 'lodash';\n\nimport { Form, Button, InputGroup } from 'react-bootstrap';\nimport classNames from 'classnames';\n\ninterface Props {\n step?: number;\n steps?: number[];\n disabled: boolean;\n id?: string;\n unit?: string;\n overlay?: ReactChild | null;\n incIcon?: string;\n decIcon?: string;\n swapIncDec?: boolean;\n className?: string;\n type?: 'number' | 'text';\n precision?: number;\n horizontalArrows?: boolean;\n largeArrows?: boolean;\n onBlur: () => void;\n onChange: (e: ChangeEvent<HTMLInputElement>) => void;\n onStep: (params: { target: HTMLInputElement }) => void;\n onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;\n}\n\nconst NumericStep = forwardRef<HTMLInputElement, Props>((props, ref) => {\n const stepSizeRef = useRef<HTMLSelectElement>(null);\n const [currentStep, setCurrentStep] = useState(props.step);\n const onStep = (up: boolean) => {\n // FIXME: Would be good to remove that cast\n const ref2 = ref as MutableRefObject<HTMLInputElement>;\n if (stepSizeRef.current === null) {\n return;\n }\n let val = Number.parseFloat(ref2.current.value);\n const stepSize = Number.parseFloat(stepSizeRef.current.value);\n val += up ? stepSize : -stepSize;\n ref2.current.value = `${val}`;\n\n if (props.onStep) {\n props.onStep({\n target: ref2.current,\n });\n }\n };\n\n const {\n onStep: onStepProp,\n step,\n overlay,\n incIcon,\n decIcon,\n swapIncDec,\n onKeyDown,\n horizontalArrows,\n largeArrows,\n ...rest\n } = props;\n\n const onKeyDown2 = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n onStep(true);\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n onStep(false);\n } else if (onKeyDown) {\n onKeyDown(e);\n }\n };\n\n if (!props.step) {\n return (\n <Form.Control\n ref={ref}\n type=\"number\"\n step=\"any\"\n onKeyDown={onKeyDown2}\n {...rest}\n />\n );\n }\n\n const steps = map(props.steps || [props.step], (s) => (\n <option value={s} key={s}>\n {s}\n </option>\n ));\n\n return (\n <div\n className={classNames('numeric-step', {\n 'numeric-step-large': largeArrows,\n 'numeric-step-horizontal': horizontalArrows,\n })}\n >\n <InputGroup>\n <Form.Control\n onKeyDown={onKeyDown2}\n ref={ref}\n type=\"number\"\n step=\"any\"\n {...rest}\n />\n <>\n {overlay}\n {!overlay && (\n <InputGroup.Text className=\"d-flex flex-column\">\n <Form.Control\n ref={stepSizeRef}\n as=\"select\"\n className=\"step-size\"\n defaultValue={currentStep}\n onChange={(e) =>\n setCurrentStep(Number.parseFloat(e.target.value))\n }\n >\n {steps}\n </Form.Control>\n {props.unit && <div>{props.unit}</div>}\n {!incIcon && !decIcon && (\n <>\n <Button\n className=\"step step-up\"\n disabled={props.disabled}\n onClick={(e) => onStep(true)}\n />\n <Button\n className=\"step step-down\"\n disabled={props.disabled}\n onClick={(e) => onStep(false)}\n />\n </>\n )}\n </InputGroup.Text>\n )}\n {decIcon && swapIncDec && (\n <Button disabled={props.disabled} onClick={(e) => onStep(false)}>\n <i className={`fa fa-fw fa-${decIcon}`} />\n </Button>\n )}\n {incIcon && (\n <Button disabled={props.disabled} onClick={(e) => onStep(true)}>\n <i className={`fa fa-fw fa-${incIcon}`} />\n </Button>\n )}\n {decIcon && !swapIncDec && (\n <Button disabled={props.disabled} onClick={(e) => onStep(false)}>\n <i className={`fa fa-fw fa-${decIcon}`} />\n </Button>\n )}\n </>\n </InputGroup>\n </div>\n );\n});\n\nexport default NumericStep;\n","import { useRef, useState, useEffect } from 'react';\nimport type { KeyboardEvent, ChangeEvent } from 'react';\nimport classNames from 'classnames';\nimport { Button, Form, OverlayTrigger, InputGroup } from 'react-bootstrap';\nimport NumericStep from '../../components/NumericStep';\n\n/**\n * NumericStep handled hardware properties.\n *\n * Input related to hardware have specificities because the hardware state can\n * change during the user interaction.\n */\nexport default function HardwareNumericStep(props: {\n hardwareValue: number | null;\n hardwareIsDisabled: boolean;\n hardwareIsMoving: boolean;\n hardwareIsReady: boolean;\n onMoveRequested: (value: number) => Promise<void> | null;\n onAbortRequested: () => void;\n /** Default step size to use for up / down arrows */\n step?: number;\n /** Array of selectable step sizes */\n steps?: number[];\n /** Number of decimals to show */\n precision?: number;\n /** Whether this widget is read only */\n readOnly?: boolean;\n /** Specify a fontawesome to inc the value */\n incIcon?: string;\n /** Specify a fontawesome to dec the value */\n decIcon?: string;\n /** If true inc and dec icon are swapped */\n swapIncDec?: boolean;\n /** Show the step arrows horizontally instead of vertically */\n horizontalArrows?: boolean;\n /** Show large step arrows */\n largeArrows?: boolean;\n /** Identifier passed to the input element */\n id?: string;\n}) {\n const valueRef = useRef<HTMLInputElement>(null);\n const [edited, setEdited] = useState(false);\n const [error, setError] = useState(false);\n useEffect(() => {\n if (valueRef.current) {\n if (props.hardwareValue === null) {\n valueRef.current.value = '';\n } else {\n valueRef.current.value = props.hardwareValue.toString();\n }\n setEdited(false);\n }\n }, [props.hardwareValue]);\n\n function updateRef(value: any) {\n let newValue = value;\n if (props.precision !== undefined) {\n newValue = Number.parseFloat(newValue).toFixed(props.precision);\n }\n if (valueRef?.current) {\n valueRef.current.value = newValue;\n }\n }\n\n function onBlur() {\n if (edited) {\n setTimeout(() => {\n updateRef(props.hardwareValue);\n setEdited(false);\n }, 3000);\n }\n }\n\n function onChange(e: ChangeEvent<HTMLInputElement>) {\n if (props.hardwareValue === null) {\n return;\n }\n setEdited(true);\n if (valueRef?.current) {\n valueRef.current.value = e.target.value;\n }\n if (e.target.value === props.hardwareValue.toString()) {\n setEdited(false);\n }\n }\n\n function onStep(e: any) {\n setEdited(false);\n void props.onMoveRequested(e.target.value);\n }\n\n function onKeyDown(e: KeyboardEvent<HTMLInputElement>) {\n switch (e.key) {\n case 'Enter':\n {\n setEdited(false);\n // @ts-expect-error\n const value: number = Number.parseFloat(e.target.value);\n const promise = props.onMoveRequested(value);\n if (promise) {\n promise.catch(() => {\n setError(true);\n setTimeout(() => {\n updateRef(props.hardwareValue);\n setError(false);\n }, 2000);\n });\n }\n }\n e.preventDefault();\n e.stopPropagation();\n break;\n case 'Esc': // IE/Edge specific value\n case 'Escape':\n if (edited) {\n setError(false);\n setEdited(false);\n updateRef(props.hardwareValue);\n }\n // @ts-expect-error\n e.target.blur();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n\n return (\n <NumericStep\n id={props.id}\n className={classNames({\n 'form-control-edited': edited,\n 'form-control-error': error,\n 'hw-moving': props.hardwareIsMoving,\n })}\n type={props.readOnly ? 'text' : 'number'}\n ref={valueRef}\n precision={props.precision}\n onChange={onChange}\n onBlur={onBlur}\n onStep={onStep}\n onKeyDown={onKeyDown}\n disabled={\n props.hardwareIsDisabled || props.readOnly || !props.hardwareIsReady\n }\n step={props.step}\n steps={props.steps}\n incIcon={props.incIcon}\n decIcon={props.decIcon}\n swapIncDec={props.swapIncDec}\n horizontalArrows={props.horizontalArrows}\n largeArrows={props.largeArrows}\n overlay={\n props.hardwareIsMoving && !props.hardwareIsDisabled ? (\n <Button variant=\"danger\" onClick={props.onAbortRequested}>\n <i className=\"fa fa-times\" />\n </Button>\n ) : null\n }\n />\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { KeyboardEvent, ChangeEvent } from 'react';\nimport { Form } from 'react-bootstrap';\nimport classNames from 'classnames';\n\n/**\n * Input number synchronized with a hardware.\n *\n * Input related to hardware have specificities because the hardware state can\n * change during the user interaction.\n *\n * TODO: Maybe normalize `precision` and `step` together\n */\nexport default function HardwareInputNumber(props: {\n hardwareValue: number;\n hardwareIsDisabled: boolean;\n hardwareIsMoving?: boolean;\n hardwareIsReady?: boolean;\n onMoveRequested: (value: number) => Promise<void> | null;\n onAbortRequested?: () => void;\n readOnly?: boolean;\n precision?: number;\n step?: number;\n}) {\n const valueRef = useRef<HTMLInputElement>(null);\n const [edited, setEdited] = useState(false);\n const [error, setError] = useState(false);\n\n function normalizeNumber(value: string): string {\n if (props.precision !== undefined) {\n return Number.parseFloat(value).toFixed(props.precision);\n }\n return value;\n }\n\n useEffect(() => {\n if (valueRef.current) {\n valueRef.current.value = normalizeNumber(props.hardwareValue?.toString());\n setEdited(false);\n }\n }, [props.hardwareValue, props.precision]);\n\n function updateRef(value: any) {\n const newValue = normalizeNumber(value);\n if (valueRef?.current) {\n valueRef.current.value = newValue;\n }\n }\n\n function onKeyDown(e: KeyboardEvent<HTMLInputElement>) {\n switch (e.key) {\n case 'Enter': {\n setEdited(false);\n // @ts-expect-error\n const value: number = Number.parseFloat(e.target.value);\n const promise = props.onMoveRequested(value);\n if (promise) {\n promise.catch(() => {\n setError(true);\n setTimeout(() => {\n updateRef(props.hardwareValue);\n setError(false);\n }, 2000);\n });\n }\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n case 'Esc': // IE/Edge specific value\n case 'Escape':\n if (edited) {\n setError(false);\n setEdited(false);\n updateRef(props.hardwareValue);\n }\n // @ts-expect-error\n e.target.blur();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n\n function onChange(e: ChangeEvent<HTMLInputElement>) {\n setEdited(true);\n const { name } = e.target;\n if (valueRef?.current) {\n valueRef.current.value = e.target.value;\n }\n if (e.target.value === props.hardwareValue.toString()) {\n setEdited(false);\n }\n }\n\n return (\n <Form.Control\n className={classNames({\n 'form-control-edited': edited,\n 'form-control-error': error,\n 'hw-moving': props.hardwareIsMoving,\n })}\n type=\"number\"\n ref={valueRef}\n onChange={onChange}\n onKeyDown={onKeyDown}\n disabled={\n props.readOnly || props.hardwareIsMoving || props.hardwareIsDisabled\n }\n step={props.step}\n />\n );\n}\n","import {\n Button,\n Form,\n OverlayTrigger,\n InputGroup,\n Popover,\n} from 'react-bootstrap';\n\nimport TypeIcon from './TypeIcon';\nimport HardwareTemplate from './utils/HardwareTemplate';\nimport { MotorState } from './utils/State';\nimport HardwareNumericStep from './utils/HardwareNumericStep';\nimport HardwareInputNumber from './utils/HardwareInputNumber';\nimport type { MotorSchema } from './utils/schema';\nimport type {\n HardwareWidgetProps,\n HardwareWidgetOptions,\n EditableHardware,\n} from './utils/types';\n\ninterface MotorOverlayProps {\n hardware: EditableHardware<MotorSchema>;\n disabled: boolean;\n readOnly?: boolean;\n}\n\nfunction MotorOverlay(props: MotorOverlayProps) {\n function onMoveVelocityRequested(target: number) {\n return props.hardware.requestChange({\n property: 'velocity',\n value: target,\n });\n }\n\n function onMoveAccelerationRequested(target: number) {\n return props.hardware.requestChange({\n property: 'acceleration',\n value: target,\n });\n }\n\n let s1 = 'UNKNOWN';\n if (props.hardware.properties.state) {\n [s1] = props.hardware.properties.state;\n }\n\n return (\n <OverlayTrigger\n trigger=\"click\"\n rootClose\n overlay={\n <Popover id=\"popid\">\n <Popover.Header>{props.hardware.name} details</Popover.Header>\n <Popover.Body>\n <Form.Group>\n <Form.Label>Velocity</Form.Label>\n <HardwareInputNumber\n hardwareValue={props.hardware.properties.velocity}\n onMoveRequested={onMoveVelocityRequested}\n hardwareIsDisabled={props.disabled}\n hardwareIsReady={s1 === 'READY'}\n hardwareIsMoving={s1 === 'MOVING'}\n readOnly={props.readOnly}\n />\n </Form.Group>\n <Form.Group>\n <Form.Label>Acceleration</Form.Label>\n <HardwareInputNumber\n hardwareValue={props.hardware.properties.acceleration}\n onMoveRequested={onMoveAccelerationRequested}\n hardwareIsDisabled={props.disabled}\n hardwareIsReady={s1 === 'READY'}\n hardwareIsMoving={s1 === 'MOVING'}\n readOnly={props.readOnly}\n />\n </Form.Group>\n </Popover.Body>\n </Popover>\n }\n >\n <Button>\n <i className=\"fa fa-ellipsis-h\" />\n </Button>\n </OverlayTrigger>\n );\n}\n\nexport interface MotorDefaultOptions extends HardwareWidgetOptions {\n /** Default step size to use for up / down arrows */\n step?: number;\n /** Array of selectable step sizes */\n steps?: number[];\n /** Number of decimals to show */\n precision?: number;\n /** Whether to show popup to configure extended parameters */\n extended?: boolean;\n /** Whether this widget is read only */\n readOnly?: boolean;\n /** Kind of header displayed */\n header?: string;\n /** Specify a fontawesome to inc the value */\n incicon?: string;\n /** Specify a fontawesome to dec the value */\n decicon?: string;\n /** If true inc and dec icon are swapped */\n swapincdec?: boolean;\n /** Show the step arrows horizontally instead of vertically */\n horizontalarrows?: boolean;\n /** Show large step arrows */\n largearrows?: boolean;\n}\n\n/**\n * The default motor widget\n */\nexport default function MotorDefault(\n props: HardwareWidgetProps<MotorSchema, MotorDefaultOptions>\n) {\n const { hardware, options = {} } = props;\n function onAbortRequested() {\n void hardware.requestChange({\n function: 'stop',\n });\n }\n\n function onMovePositionRequested(target: number) {\n return hardware.requestChange({\n property: 'position',\n value: target,\n function: 'move',\n });\n }\n\n let s1 = 'UNKNOWN';\n if (props.hardware.properties.state) {\n [s1] = props.hardware.properties.state;\n }\n\n const widgetIcon = (\n <TypeIcon name=\"Motor\" icon=\"fam-hardware-motor\" online={hardware.online} />\n );\n\n const widgetState = <MotorState hardware={hardware} />;\n\n const headerMode = props.options ? props.options.header : 'top';\n\n return (\n <HardwareTemplate\n hardware={hardware}\n widgetIcon={widgetIcon}\n widgetState={widgetState}\n widgetContent={\n <InputGroup>\n <HardwareNumericStep\n id={hardware.id}\n hardwareValue={hardware.properties.position}\n hardwareIsDisabled={props.disabled}\n hardwareIsReady={s1 === 'READY'}\n hardwareIsMoving={s1 === 'MOVING'}\n onMoveRequested={onMovePositionRequested}\n onAbortRequested={onAbortRequested}\n precision={options.precision}\n readOnly={options.readOnly}\n step={options.step}\n steps={options.steps}\n incIcon={options.incicon}\n decIcon={options.decicon}\n swapIncDec={options.swapincdec}\n horizontalArrows={options.horizontalarrows}\n largeArrows={options.largearrows}\n />\n {hardware.properties.unit && (\n <InputGroup.Text>{hardware.properties.unit}</InputGroup.Text>\n )}\n\n {s1 !== 'MOVING' && options.extended && (\n <MotorOverlay\n hardware={hardware}\n disabled={props.disabled}\n readOnly={options.readOnly}\n />\n )}\n\n {s1 === 'MOVING' && !props.disabled && !options.step && (\n <Button variant=\"danger\" onClick={onAbortRequested}>\n <i className=\"fa fa-times\" />\n </Button>\n )}\n </InputGroup>\n }\n headerMode={headerMode}\n />\n );\n}\n"],"names":["OnlineStatus","props","activeMessage","inactiveMessage","message","jsx","TypeIcon","name","icon","jsxs","HardwareTemplate","headerMode","hardware","getLabel","label","Form","OverlayTrigger","Popover","error","Button","HardwareState","style","Badge","MotorState","getState","s1","state","NumericStep","forwardRef","ref","stepSizeRef","useRef","currentStep","setCurrentStep","useState","onStep","up","ref2","val","stepSize","onStepProp","step","overlay","incIcon","decIcon","swapIncDec","onKeyDown","horizontalArrows","largeArrows","rest","onKeyDown2","e","steps","map","s","classNames","InputGroup","Fragment","NumericStep$1","HardwareNumericStep","valueRef","edited","setEdited","setError","useEffect","updateRef","value","newValue","onBlur","onChange","promise","HardwareInputNumber","normalizeNumber","_a","MotorOverlay","onMoveVelocityRequested","target","onMoveAccelerationRequested","MotorDefault","options","onAbortRequested","onMovePositionRequested","widgetIcon","widgetState"],"mappings":";;;;;AAQO,SAASA,EAAaC,GAAc;AACnC,QAAA;AAAA,IACJ,eAAAC,IAAgB;AAAA,IAChB,iBAAAC,IAAkB;AAAA,IAClB,SAAAC,IAAU;AAAA,EACR,IAAAH;AAGF,SAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,0BACTJ,EAAM,SAAS,YAAY,QAC7B;AAAA,MACA,OAAO,GAAGG,CAAO,IAAIH,EAAM,SAASC,IAAgBC,CAAe;AAAA,IAAA;AAAA,EAAA;AAGzE;AAEA,SAAwBG,EAASL,GAAc;AACvC,QAAA,EAAE,MAAAM,GAAM,MAAAC,EAAS,IAAAP;AACvB,SACG,gBAAAQ,EAAA,OAAA,EAAI,WAAU,QAAO,OAAOF,GAC3B,UAAA;AAAA,IAAA,gBAAAF,EAAC,KAAE,EAAA,WAAW,MAAMG,CAAI,IAAI;AAAA,IAC5B,gBAAAH,EAACL,GAAc,EAAA,GAAGC,GAAO;AAAA,EAC3B,EAAA,CAAA;AAEJ;ACjBA,SAAwBS,EAAiBT,GAAc;AAC/C,QAAA,EAAE,YAAAU,GAAY,UAAAC,EAAa,IAAAX;AAEjC,WAASY,IAAW;AAClB,WAAID,EAAS,QACJA,EAAS,QAEdA,EAAS,OACJA,EAAS,OAEXA,EAAS;AAAA,EAClB;AAEA,QAAME,IAAQD;AAEd,UAAQF,GAAY;AAAA,IAClB,KAAK;AACH,+BACG,OAAI,EAAA,WAAU,gBACb,UAAC,gBAAAF,EAAA,OAAA,EAAI,WAAU,aACZ,UAAA;AAAA,QAAMR,EAAA;AAAA,QACN,gBAAAI,EAAA,OAAA,EAAI,WAAU,QAAQ,UAAMS,GAAA;AAAA,QAC5B,gBAAAT,EAAA,OAAA,EAAI,WAAU,kBAAkB,YAAM,eAAc;AAAA,MAAA,EACvD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AAQ;AAAA,YACpB,kBAAkBA,EAAQ;AAAA,YAC1B,aAAaA,EAAQ;AAAA,UAAA;AAAA,QACvB;AAAA,QACCnE,EAAS,WAAW,QACnB,gBAAAP,EAACmD,EAAW,MAAX,EAAiB,UAAS5C,EAAA,WAAW,KAAK,CAAA;AAAA,QAG5Ca,MAAO,YAAYsD,EAAQ,YAC1B,gBAAA1E;AAAA,UAACqE;AAAA,UAAA;AAAA,YACC,UAAA9D;AAAA,YACA,UAAUX,EAAM;AAAA,YAChB,UAAU8E,EAAQ;AAAA,UAAA;AAAA,QACpB;AAAA,QAGDtD,MAAO,YAAY,CAACxB,EAAM,YAAY,CAAC8E,EAAQ,QAC9C,gBAAA1E,EAACc,GAAO,EAAA,SAAQ,UAAS,SAAS6D,GAChC,4BAAC,KAAE,EAAA,WAAU,cAAc,CAAA,GAC7B;AAAA,MAAA,GAEJ;AAAA,MAEF,YAAArE;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/hardware/TypeIcon.tsx","../src/utils/formatting.ts","../src/hardware/Frontend.tsx","../src/hardware/Info.tsx","../src/hardware/utils/HardwareTemplate.tsx","../src/hardware/utils/State.tsx","../src/components/NumericStep.tsx","../src/hardware/utils/HardwareNumericStep.tsx","../src/hardware/utils/HardwareInputNumber.tsx","../src/hardware/MotorDefault.tsx","../src/hardware/Multiposition.tsx","../src/hardware/NoObject.tsx","../src/hardware/Property.tsx","../src/hardware/ShutterDefault.tsx","../src/components/FullSizer.tsx"],"sourcesContent":["interface Props {\n online: boolean;\n activeMessage?: string;\n inactiveMessage?: string;\n message?: string;\n icon: string;\n name: string;\n}\nexport function OnlineStatus(props: Props) {\n const {\n activeMessage = 'Online',\n inactiveMessage = 'Offline',\n message = 'This device is',\n } = props;\n\n return (\n <div\n className={`dot-indicator small bg-${\n props.online ? 'success' : 'danger'\n }`}\n title={`${message} ${props.online ? activeMessage : inactiveMessage}`}\n />\n );\n}\n\nexport default function TypeIcon(props: Props) {\n const { name, icon } = props;\n return (\n <div className=\"icon\" title={name}>\n <i className={`fa ${icon}`} />\n <OnlineStatus {...props} />\n </div>\n );\n}\n","// https://github.com/gentooboontoo/js-quantities/issues/30\nexport function formatEng(scalar: number) {\n const powerPrefix: Record<number, string> = {\n 24: 'Y',\n 21: 'Z',\n 18: 'E',\n 15: 'P',\n 12: 'T',\n 9: 'G',\n 6: 'M',\n 3: 'k',\n '-3': 'm',\n '-6': '\\u00B5',\n '-9': 'n',\n '-12': 'p',\n '-15': 'f',\n '-18': 'a',\n '-21': 'z',\n '-24': 'y',\n };\n\n const q = Math.log(scalar) / Math.log(1e3);\n // so that for example '3 km' does not get converted to '3000 m'\n const subtrhnd = !Number.isInteger(q);\n\n const pow10 = 3 * Math.ceil(q - (subtrhnd ? 1 : 0));\n const prefix = pow10 === 0 ? '' : powerPrefix[pow10];\n\n return {\n scalar: scalar * 10 ** -pow10,\n prefix,\n multiplier: 10 ** -pow10,\n };\n}\n\n/**\n * Returns the argument as capitalized string.\n */\nexport function ucfirst(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function toHoursMins(seconds: number) {\n if (seconds < 60) return `${Math.round(seconds)} sec`;\n\n const min = Math.round(seconds / 60);\n\n const mins = min % 60;\n const hours = Math.floor(min / 60);\n\n return hours ? `${hours} hr ${mins} min` : `${mins} min`;\n}\n\nexport function toEnergy(wavelength: number) {\n return wavelength > 0\n ? (\n ((6.626_070_04e-34 * 2.997_924_58e8) /\n (wavelength * 1e-10) /\n 1.602_18e-19) *\n 1e-3\n ).toFixed(4)\n : 0;\n}\n\nexport function round(value: number, digits: number) {\n return Number.parseFloat(value.toFixed(digits));\n}\n","import type { MouseEvent } from 'react';\nimport { map } from 'lodash';\nimport {\n Badge,\n Button,\n ButtonGroup,\n Container,\n Row,\n Col,\n OverlayTrigger,\n Popover,\n} from 'react-bootstrap';\n\nimport TypeIcon from './TypeIcon';\nimport { toHoursMins } from '../utils/formatting';\nimport type { HardwareWidgetProps } from './utils/types';\nimport type { FrontendSchema } from './utils/schema';\n\nfunction FrontendOverlay(props: HardwareWidgetProps<FrontendSchema>) {\n const { hardware } = props;\n function reset(e: any) {\n void hardware.requestChange({\n function: 'reset',\n });\n }\n\n type StateEnum = 'feitlk' | 'expitlk' | 'pssitlk';\n\n const itlks: { [name: string]: StateEnum } = {\n 'Front End': 'feitlk',\n Experimental: 'expitlk',\n PSS: 'pssitlk',\n };\n\n const ring = {\n Current: `${hardware.properties.current.toFixed(1)} mA`,\n Mode: hardware.properties.mode,\n Refill: toHoursMins(hardware.properties.refill),\n Message: <pre>{hardware.properties.message}</pre>,\n };\n\n function getPropertyState(key: StateEnum): string {\n if (!(key in hardware.properties)) {\n return 'UNKNOWN';\n }\n const state: any = hardware.properties[key];\n if (!state || typeof state !== 'string') {\n return 'UNKNOWN';\n }\n return state;\n }\n\n return (\n <OverlayTrigger\n trigger=\"click\"\n rootClose\n overlay={\n <Popover id=\"popid\">\n <Popover.Header>{hardware.name} Details</Popover.Header>\n <Popover.Body>\n <h6>Status</h6>\n <pre>{hardware.properties.status}</pre>\n <h6>Interlocks</h6>\n <Container>\n {map(itlks, (key, name) => (\n <Row key={name}>\n <Col>{name}:</Col>\n <Col>\n <Badge\n bg={getPropertyState(key) === 'ON' ? 'success' : 'danger'}\n >\n {getPropertyState(key)}\n </Badge>\n </Col>\n </Row>\n ))}\n </Container>\n\n <h6>Ring Status</h6>\n <Container>\n {map(ring, (prop, name) => (\n <Row key={name}>\n <Col>{name}:</Col>\n <Col>{prop}</Col>\n </Row>\n ))}\n </Container>\n\n <div className=\"d-grid gap-2\">\n <Button disabled={props.disabled} onClick={reset}>\n Reset\n </Button>\n </div>\n </Popover.Body>\n </Popover>\n }\n >\n <Button className=\"flex-grow-0\" title=\"Shutter Details\">\n <i className=\"fa fa-ellipsis-h\" />\n </Button>\n </OverlayTrigger>\n );\n}\n\nfunction Frontend(props: HardwareWidgetProps<FrontendSchema>) {\n const { hardware, options = {} } = props;\n function onClick(e: MouseEvent) {\n void hardware.requestChange({\n function: hardware.properties.frontend === 'FE open' ? 'close' : 'open',\n });\n }\n\n return (\n <div className=\"hw-component\">\n <div className=\"hw-head\">\n <TypeIcon\n name=\"Frontend\"\n icon=\"fam-hardware-frontend\"\n online={hardware.online}\n />\n <div className=\"name\">{hardware.name}</div>\n <Badge\n bg={\n hardware.properties.state === 'OPEN' ||\n hardware.properties.state === 'RUNNING'\n ? 'success'\n : 'danger'\n }\n >\n {hardware.properties.state}\n </Badge>\n </div>\n <div className=\"hw-content\">\n <ButtonGroup className=\"d-flex\">\n <Button\n variant={\n hardware.properties.frontend === 'FE open' ? 'danger' : 'success'\n }\n onClick={onClick}\n disabled={props.disabled}\n >\n {hardware.properties.frontend === 'FE open' ? 'Close' : 'Open'}\n </Button>\n <FrontendOverlay {...props} />\n </ButtonGroup>\n </div>\n </div>\n );\n}\n\nexport default Frontend;\n","import type {\n Hardware,\n HardwareWidgetProps,\n HardwareWidgetOptions,\n} from './utils/types';\n\nexport interface InfoOptions extends HardwareWidgetOptions {\n /** The property */\n property?: string;\n /** Unit for the property */\n unit?: string;\n}\n\nexport default function Info(\n props: HardwareWidgetProps<Hardware, InfoOptions>\n) {\n const { hardware, options = {} } = props;\n function getValue() {\n const propertyName = options.property;\n if (propertyName === undefined) {\n return `property is not set`;\n }\n if (propertyName === null) {\n return `property is null`;\n }\n let result: any = hardware;\n for (const segment of propertyName.split('/')) {\n result = result[segment];\n if (result === undefined) {\n return `property '${propertyName}' not found`;\n }\n }\n return `${result}`;\n }\n\n return <>{getValue()}</>;\n}\n","import type { ReactElement } from 'react';\nimport { Form, OverlayTrigger, Popover, Button } from 'react-bootstrap';\nimport type { Hardware } from './types';\n\ninterface Props {\n hardware: Hardware;\n headerMode?: string;\n widgetIcon: ReactElement;\n widgetState: ReactElement;\n widgetContent: ReactElement;\n}\n\n/**\n * Normalized way to compose hardware component in order to provide the same\n * kind of layout\n */\nexport default function HardwareTemplate(props: Props) {\n const { headerMode, hardware } = props;\n\n function getLabel() {\n if (hardware.alias) {\n return hardware.alias;\n }\n if (hardware.name) {\n return hardware.name;\n }\n return hardware.id;\n }\n\n const label = getLabel();\n\n switch (headerMode) {\n case 'front':\n return (\n <div className=\"hw-component\">\n <div className=\"hw-single\">\n {props.widgetIcon}\n <div className=\"name\">{label}</div>\n <div className=\"d-inline-block\">{props.widgetContent}</div>\n </div>\n </div>\n );\n case 'none':\n return (\n <div className=\"hw-component\">\n <div className=\"hw-single\">{props.widgetContent}</div>\n </div>\n );\n case 'state':\n return props.widgetState;\n // case 'top':\n default:\n return (\n <div className=\"hw-component\">\n <div className=\"hw-head\">\n {props.widgetIcon}\n <div className=\"name\">\n <Form.Label htmlFor={hardware.id}>{label}</Form.Label>\n </div>\n {props.widgetState}\n {props.hardware.errors && props.hardware.errors.length > 0 && (\n <OverlayTrigger\n trigger=\"click\"\n placement=\"bottom\"\n rootClose\n overlay={\n <Popover id={props.hardware.id} style={{ maxWidth: 500 }}>\n <Popover.Header>Device Errors</Popover.Header>\n <Popover.Body>\n There were errors with properties on this device:\n <ul>\n {props.hardware.errors.map((error) => (\n <li>\n {error.property}:\n <span className=\"stack-trace\">\n {error.traceback}\n <br />\n {error.exception}\n </span>\n </li>\n ))}\n </ul>\n </Popover.Body>\n </Popover>\n }\n >\n <Button variant=\"danger\" size=\"sm\">\n <i className=\"fa fa-exclamation-triangle\" />\n </Button>\n </OverlayTrigger>\n )}\n </div>\n <div className=\"hw-content\">{props.widgetContent}</div>\n </div>\n );\n }\n}\n","import { Badge } from 'react-bootstrap';\nimport type * as Schema from './schema';\n\n/**\n * Normalize the way to display an hardware state.\n *\n * If `minWidth` is pecified (in `em`) it ensure the widget width will stay the\n * same when the state change\n */\nexport function HardwareState(props: {\n state: string;\n variant: string;\n minWidth?: number;\n}) {\n const style = {\n display: 'inline-block',\n minWidth: '',\n };\n\n if (props.minWidth) style.minWidth = `${props.minWidth}em`;\n return (\n <div style={style}>\n <Badge bg={props.variant}>{props.state}</Badge>\n </div>\n );\n}\n\nexport function MotorState(props: { hardware: Schema.MotorSchema }) {\n const { hardware } = props;\n function getState() {\n if (!hardware.online) {\n return 'OFFLINE';\n }\n let s1 = 'UNKNOWN';\n if (props.hardware.properties.state) {\n [s1] = props.hardware.properties.state;\n }\n return s1;\n }\n const state = getState();\n return (\n <HardwareState\n state={state}\n minWidth={6}\n variant={state === 'READY' ? 'success' : 'warning'}\n />\n );\n}\n\nexport function ShutterState(props: {\n hardware: Schema.ShutterSchema;\n useReadyState?: boolean;\n}) {\n const { hardware } = props;\n function getState() {\n if (!hardware.online) {\n return 'OFFLINE';\n }\n const s = hardware.properties.state;\n if (props.useReadyState && (s === 'OPEN' || s === 'CLOSED')) {\n return 'READY';\n }\n return s;\n }\n\n const state = getState();\n\n function getVariant() {\n switch (state) {\n case 'READY':\n return 'success';\n case 'OPEN':\n return 'success';\n case 'CLOSED':\n return 'danger';\n case 'DISABLED':\n return 'secondary';\n case 'MOVING':\n case 'STANDBY':\n case 'OFFLINE':\n return 'warning';\n case 'FAULT':\n return 'fatal';\n default:\n return 'fatal';\n }\n }\n\n return <HardwareState state={state} minWidth={6} variant={getVariant()} />;\n}\n","import type {\n KeyboardEvent,\n ChangeEvent,\n MutableRefObject,\n ReactChild,\n} from 'react';\nimport { forwardRef, useRef, useState } from 'react';\nimport { map } from 'lodash';\n\nimport { Form, Button, InputGroup } from 'react-bootstrap';\nimport classNames from 'classnames';\n\ninterface Props {\n step?: number;\n steps?: number[];\n disabled: boolean;\n id?: string;\n unit?: string;\n overlay?: ReactChild | null;\n incIcon?: string;\n decIcon?: string;\n swapIncDec?: boolean;\n className?: string;\n type?: 'number' | 'text';\n precision?: number;\n horizontalArrows?: boolean;\n largeArrows?: boolean;\n onBlur: () => void;\n onChange: (e: ChangeEvent<HTMLInputElement>) => void;\n onStep: (params: { target: HTMLInputElement }) => void;\n onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;\n}\n\nconst NumericStep = forwardRef<HTMLInputElement, Props>((props, ref) => {\n const stepSizeRef = useRef<HTMLSelectElement>(null);\n const [currentStep, setCurrentStep] = useState(props.step);\n const onStep = (up: boolean) => {\n // FIXME: Would be good to remove that cast\n const ref2 = ref as MutableRefObject<HTMLInputElement>;\n if (stepSizeRef.current === null) {\n return;\n }\n let val = Number.parseFloat(ref2.current.value);\n const stepSize = Number.parseFloat(stepSizeRef.current.value);\n val += up ? stepSize : -stepSize;\n ref2.current.value = `${val}`;\n\n if (props.onStep) {\n props.onStep({\n target: ref2.current,\n });\n }\n };\n\n const {\n onStep: onStepProp,\n step,\n overlay,\n incIcon,\n decIcon,\n swapIncDec,\n onKeyDown,\n horizontalArrows,\n largeArrows,\n ...rest\n } = props;\n\n const onKeyDown2 = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n onStep(true);\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n onStep(false);\n } else if (onKeyDown) {\n onKeyDown(e);\n }\n };\n\n if (!props.step) {\n return (\n <Form.Control\n ref={ref}\n type=\"number\"\n step=\"any\"\n onKeyDown={onKeyDown2}\n {...rest}\n />\n );\n }\n\n const steps = map(props.steps || [props.step], (s) => (\n <option value={s} key={s}>\n {s}\n </option>\n ));\n\n return (\n <div\n className={classNames('numeric-step', {\n 'numeric-step-large': largeArrows,\n 'numeric-step-horizontal': horizontalArrows,\n })}\n >\n <InputGroup>\n <Form.Control\n onKeyDown={onKeyDown2}\n ref={ref}\n type=\"number\"\n step=\"any\"\n {...rest}\n />\n <>\n {overlay}\n {!overlay && (\n <InputGroup.Text className=\"d-flex flex-column\">\n <Form.Control\n ref={stepSizeRef}\n as=\"select\"\n className=\"step-size\"\n defaultValue={currentStep}\n onChange={(e) =>\n setCurrentStep(Number.parseFloat(e.target.value))\n }\n >\n {steps}\n </Form.Control>\n {props.unit && <div>{props.unit}</div>}\n {!incIcon && !decIcon && (\n <>\n <Button\n className=\"step step-up\"\n disabled={props.disabled}\n onClick={(e) => onStep(true)}\n />\n <Button\n className=\"step step-down\"\n disabled={props.disabled}\n onClick={(e) => onStep(false)}\n />\n </>\n )}\n </InputGroup.Text>\n )}\n {decIcon && swapIncDec && (\n <Button disabled={props.disabled} onClick={(e) => onStep(false)}>\n <i className={`fa fa-fw fa-${decIcon}`} />\n </Button>\n )}\n {incIcon && (\n <Button disabled={props.disabled} onClick={(e) => onStep(true)}>\n <i className={`fa fa-fw fa-${incIcon}`} />\n </Button>\n )}\n {decIcon && !swapIncDec && (\n <Button disabled={props.disabled} onClick={(e) => onStep(false)}>\n <i className={`fa fa-fw fa-${decIcon}`} />\n </Button>\n )}\n </>\n </InputGroup>\n </div>\n );\n});\n\nexport default NumericStep;\n","import { useRef, useState, useEffect } from 'react';\nimport type { KeyboardEvent, ChangeEvent } from 'react';\nimport classNames from 'classnames';\nimport { Button, Form, OverlayTrigger, InputGroup } from 'react-bootstrap';\nimport NumericStep from '../../components/NumericStep';\n\n/**\n * NumericStep handled hardware properties.\n *\n * Input related to hardware have specificities because the hardware state can\n * change during the user interaction.\n */\nexport default function HardwareNumericStep(props: {\n hardwareValue: number | null;\n hardwareIsDisabled: boolean;\n hardwareIsMoving: boolean;\n hardwareIsReady: boolean;\n onMoveRequested: (value: number) => Promise<void> | null;\n onAbortRequested: () => void;\n /** Default step size to use for up / down arrows */\n step?: number;\n /** Array of selectable step sizes */\n steps?: number[];\n /** Number of decimals to show */\n precision?: number;\n /** Whether this widget is read only */\n readOnly?: boolean;\n /** Specify a fontawesome to inc the value */\n incIcon?: string;\n /** Specify a fontawesome to dec the value */\n decIcon?: string;\n /** If true inc and dec icon are swapped */\n swapIncDec?: boolean;\n /** Show the step arrows horizontally instead of vertically */\n horizontalArrows?: boolean;\n /** Show large step arrows */\n largeArrows?: boolean;\n /** Identifier passed to the input element */\n id?: string;\n}) {\n const valueRef = useRef<HTMLInputElement>(null);\n const [edited, setEdited] = useState(false);\n const [error, setError] = useState(false);\n useEffect(() => {\n if (valueRef.current) {\n if (props.hardwareValue === null) {\n valueRef.current.value = '';\n } else {\n valueRef.current.value = props.hardwareValue.toString();\n }\n setEdited(false);\n }\n }, [props.hardwareValue]);\n\n function updateRef(value: any) {\n let newValue = value;\n if (props.precision !== undefined) {\n newValue = Number.parseFloat(newValue).toFixed(props.precision);\n }\n if (valueRef?.current) {\n valueRef.current.value = newValue;\n }\n }\n\n function onBlur() {\n if (edited) {\n setTimeout(() => {\n updateRef(props.hardwareValue);\n setEdited(false);\n }, 3000);\n }\n }\n\n function onChange(e: ChangeEvent<HTMLInputElement>) {\n if (props.hardwareValue === null) {\n return;\n }\n setEdited(true);\n if (valueRef?.current) {\n valueRef.current.value = e.target.value;\n }\n if (e.target.value === props.hardwareValue.toString()) {\n setEdited(false);\n }\n }\n\n function onStep(e: any) {\n setEdited(false);\n void props.onMoveRequested(e.target.value);\n }\n\n function onKeyDown(e: KeyboardEvent<HTMLInputElement>) {\n switch (e.key) {\n case 'Enter':\n {\n setEdited(false);\n // @ts-expect-error\n const value: number = Number.parseFloat(e.target.value);\n const promise = props.onMoveRequested(value);\n if (promise) {\n promise.catch(() => {\n setError(true);\n setTimeout(() => {\n updateRef(props.hardwareValue);\n setError(false);\n }, 2000);\n });\n }\n }\n e.preventDefault();\n e.stopPropagation();\n break;\n case 'Esc': // IE/Edge specific value\n case 'Escape':\n if (edited) {\n setError(false);\n setEdited(false);\n updateRef(props.hardwareValue);\n }\n // @ts-expect-error\n e.target.blur();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n\n return (\n <NumericStep\n id={props.id}\n className={classNames({\n 'form-control-edited': edited,\n 'form-control-error': error,\n 'hw-moving': props.hardwareIsMoving,\n })}\n type={props.readOnly ? 'text' : 'number'}\n ref={valueRef}\n precision={props.precision}\n onChange={onChange}\n onBlur={onBlur}\n onStep={onStep}\n onKeyDown={onKeyDown}\n disabled={\n props.hardwareIsDisabled || props.readOnly || !props.hardwareIsReady\n }\n step={props.step}\n steps={props.steps}\n incIcon={props.incIcon}\n decIcon={props.decIcon}\n swapIncDec={props.swapIncDec}\n horizontalArrows={props.horizontalArrows}\n largeArrows={props.largeArrows}\n overlay={\n props.hardwareIsMoving && !props.hardwareIsDisabled ? (\n <Button variant=\"danger\" onClick={props.onAbortRequested}>\n <i className=\"fa fa-times\" />\n </Button>\n ) : null\n }\n />\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { KeyboardEvent, ChangeEvent } from 'react';\nimport { Form } from 'react-bootstrap';\nimport classNames from 'classnames';\n\n/**\n * Input number synchronized with a hardware.\n *\n * Input related to hardware have specificities because the hardware state can\n * change during the user interaction.\n *\n * TODO: Maybe normalize `precision` and `step` together\n */\nexport default function HardwareInputNumber(props: {\n hardwareValue: number;\n hardwareIsDisabled: boolean;\n hardwareIsMoving?: boolean;\n hardwareIsReady?: boolean;\n onMoveRequested: (value: number) => Promise<void> | null;\n onAbortRequested?: () => void;\n readOnly?: boolean;\n precision?: number;\n step?: number;\n}) {\n const valueRef = useRef<HTMLInputElement>(null);\n const [edited, setEdited] = useState(false);\n const [error, setError] = useState(false);\n\n function normalizeNumber(value: string): string {\n if (props.precision !== undefined) {\n return Number.parseFloat(value).toFixed(props.precision);\n }\n return value;\n }\n\n useEffect(() => {\n if (valueRef.current) {\n valueRef.current.value = normalizeNumber(props.hardwareValue?.toString());\n setEdited(false);\n }\n }, [props.hardwareValue, props.precision]);\n\n function updateRef(value: any) {\n const newValue = normalizeNumber(value);\n if (valueRef?.current) {\n valueRef.current.value = newValue;\n }\n }\n\n function onKeyDown(e: KeyboardEvent<HTMLInputElement>) {\n switch (e.key) {\n case 'Enter': {\n setEdited(false);\n // @ts-expect-error\n const value: number = Number.parseFloat(e.target.value);\n const promise = props.onMoveRequested(value);\n if (promise) {\n promise.catch(() => {\n setError(true);\n setTimeout(() => {\n updateRef(props.hardwareValue);\n setError(false);\n }, 2000);\n });\n }\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n case 'Esc': // IE/Edge specific value\n case 'Escape':\n if (edited) {\n setError(false);\n setEdited(false);\n updateRef(props.hardwareValue);\n }\n // @ts-expect-error\n e.target.blur();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n\n function onChange(e: ChangeEvent<HTMLInputElement>) {\n setEdited(true);\n const { name } = e.target;\n if (valueRef?.current) {\n valueRef.current.value = e.target.value;\n }\n if (e.target.value === props.hardwareValue.toString()) {\n setEdited(false);\n }\n }\n\n return (\n <Form.Control\n className={classNames({\n 'form-control-edited': edited,\n 'form-control-error': error,\n 'hw-moving': props.hardwareIsMoving,\n })}\n type=\"number\"\n ref={valueRef}\n onChange={onChange}\n onKeyDown={onKeyDown}\n disabled={\n props.readOnly || props.hardwareIsMoving || props.hardwareIsDisabled\n }\n step={props.step}\n />\n );\n}\n","import {\n Button,\n Form,\n OverlayTrigger,\n InputGroup,\n Popover,\n} from 'react-bootstrap';\n\nimport TypeIcon from './TypeIcon';\nimport HardwareTemplate from './utils/HardwareTemplate';\nimport { MotorState } from './utils/State';\nimport HardwareNumericStep from './utils/HardwareNumericStep';\nimport HardwareInputNumber from './utils/HardwareInputNumber';\nimport type { MotorSchema } from './utils/schema';\nimport type {\n HardwareWidgetProps,\n HardwareWidgetOptions,\n EditableHardware,\n} from './utils/types';\n\ninterface MotorOverlayProps {\n hardware: EditableHardware<MotorSchema>;\n disabled: boolean;\n readOnly?: boolean;\n}\n\nfunction MotorOverlay(props: MotorOverlayProps) {\n function onMoveVelocityRequested(target: number) {\n return props.hardware.requestChange({\n property: 'velocity',\n value: target,\n });\n }\n\n function onMoveAccelerationRequested(target: number) {\n return props.hardware.requestChange({\n property: 'acceleration',\n value: target,\n });\n }\n\n let s1 = 'UNKNOWN';\n if (props.hardware.properties.state) {\n [s1] = props.hardware.properties.state;\n }\n\n return (\n <OverlayTrigger\n trigger=\"click\"\n rootClose\n overlay={\n <Popover id=\"popid\">\n <Popover.Header>{props.hardware.name} details</Popover.Header>\n <Popover.Body>\n <Form.Group>\n <Form.Label>Velocity</Form.Label>\n <HardwareInputNumber\n hardwareValue={props.hardware.properties.velocity}\n onMoveRequested={onMoveVelocityRequested}\n hardwareIsDisabled={props.disabled}\n hardwareIsReady={s1 === 'READY'}\n hardwareIsMoving={s1 === 'MOVING'}\n readOnly={props.readOnly}\n />\n </Form.Group>\n <Form.Group>\n <Form.Label>Acceleration</Form.Label>\n <HardwareInputNumber\n hardwareValue={props.hardware.properties.acceleration}\n onMoveRequested={onMoveAccelerationRequested}\n hardwareIsDisabled={props.disabled}\n hardwareIsReady={s1 === 'READY'}\n hardwareIsMoving={s1 === 'MOVING'}\n readOnly={props.readOnly}\n />\n </Form.Group>\n </Popover.Body>\n </Popover>\n }\n >\n <Button>\n <i className=\"fa fa-ellipsis-h\" />\n </Button>\n </OverlayTrigger>\n );\n}\n\nexport interface MotorDefaultOptions extends HardwareWidgetOptions {\n /** Default step size to use for up / down arrows */\n step?: number;\n /** Array of selectable step sizes */\n steps?: number[];\n /** Number of decimals to show */\n precision?: number;\n /** Whether to show popup to configure extended parameters */\n extended?: boolean;\n /** Whether this widget is read only */\n readOnly?: boolean;\n /** Kind of header displayed */\n header?: string;\n /** Specify a fontawesome to inc the value */\n incicon?: string;\n /** Specify a fontawesome to dec the value */\n decicon?: string;\n /** If true inc and dec icon are swapped */\n swapincdec?: boolean;\n /** Show the step arrows horizontally instead of vertically */\n horizontalarrows?: boolean;\n /** Show large step arrows */\n largearrows?: boolean;\n}\n\n/**\n * The default motor widget\n */\nexport default function MotorDefault(\n props: HardwareWidgetProps<MotorSchema, MotorDefaultOptions>\n) {\n const { hardware, options = {} } = props;\n function onAbortRequested() {\n void hardware.requestChange({\n function: 'stop',\n });\n }\n\n function onMovePositionRequested(target: number) {\n return hardware.requestChange({\n property: 'position',\n value: target,\n function: 'move',\n });\n }\n\n let s1 = 'UNKNOWN';\n if (props.hardware.properties.state) {\n [s1] = props.hardware.properties.state;\n }\n\n const widgetIcon = (\n <TypeIcon name=\"Motor\" icon=\"fam-hardware-motor\" online={hardware.online} />\n );\n\n const widgetState = <MotorState hardware={hardware} />;\n\n const headerMode = props.options ? props.options.header : 'top';\n\n return (\n <HardwareTemplate\n hardware={hardware}\n widgetIcon={widgetIcon}\n widgetState={widgetState}\n widgetContent={\n <InputGroup>\n <HardwareNumericStep\n id={hardware.id}\n hardwareValue={hardware.properties.position}\n hardwareIsDisabled={props.disabled}\n hardwareIsReady={s1 === 'READY'}\n hardwareIsMoving={s1 === 'MOVING'}\n onMoveRequested={onMovePositionRequested}\n onAbortRequested={onAbortRequested}\n precision={options.precision}\n readOnly={options.readOnly}\n step={options.step}\n steps={options.steps}\n incIcon={options.incicon}\n decIcon={options.decicon}\n swapIncDec={options.swapincdec}\n horizontalArrows={options.horizontalarrows}\n largeArrows={options.largearrows}\n />\n {hardware.properties.unit && (\n <InputGroup.Text>{hardware.properties.unit}</InputGroup.Text>\n )}\n\n {s1 !== 'MOVING' && options.extended && (\n <MotorOverlay\n hardware={hardware}\n disabled={props.disabled}\n readOnly={options.readOnly}\n />\n )}\n\n {s1 === 'MOVING' && !props.disabled && !options.step && (\n <Button variant=\"danger\" onClick={onAbortRequested}>\n <i className=\"fa fa-times\" />\n </Button>\n )}\n </InputGroup>\n }\n headerMode={headerMode}\n />\n );\n}\n","import { useRef, useEffect } from 'react';\nimport { map } from 'lodash';\nimport { Badge, Button, InputGroup, Form } from 'react-bootstrap';\n\nimport TypeIcon from './TypeIcon';\nimport type { MultipositionSchema } from './utils/schema';\nimport type { HardwareWidgetProps } from './utils/types';\n\nexport default function Multiposition(\n props: HardwareWidgetProps<MultipositionSchema>\n) {\n const { hardware, options = {} } = props;\n const selectionRef = useRef<HTMLSelectElement>(null);\n\n useEffect(() => {\n if (!selectionRef.current) {\n console.error('selectionRef ref is unset');\n return;\n }\n selectionRef.current.value = hardware.properties.position;\n }, [hardware.properties.position]);\n\n function onMove(e: any) {\n console.debug('change', e);\n if (!selectionRef || !selectionRef.current) {\n console.error('selection ref is unset');\n return;\n }\n void hardware.requestChange({\n value: selectionRef.current.value,\n function: 'move',\n });\n }\n\n function stop(e: any) {\n void hardware.requestChange({\n function: 'stop',\n });\n }\n\n const opts = map(hardware.properties.positions, (p) => (\n <option key={p.position} title={p.description}>\n {p.position}\n </option>\n ));\n\n return (\n <div className=\"hw-component\">\n <div className=\"hw-head\">\n <TypeIcon\n name=\"Multiposition\"\n icon=\"fam-hardware-multiposition\"\n online={hardware.online}\n />\n <div className=\"name\">{hardware.name}</div>\n <Badge\n bg={hardware.properties.state === 'READY' ? 'success' : 'warning'}\n >\n {hardware.properties.state}\n </Badge>\n </div>\n <div className=\"hw-content\">\n <InputGroup>\n <Form.Control\n className=\"custom-select\"\n as=\"select\"\n ref={selectionRef}\n disabled={props.disabled}\n defaultValue={hardware.properties.position}\n >\n <option disabled>unknown</option>\n {opts}\n </Form.Control>\n {hardware.properties.state !== 'MOVING' && (\n <Button onClick={onMove} disabled={props.disabled}>\n Move\n </Button>\n )}\n\n {hardware.properties.state === 'MOVING' && !props.disabled && (\n <Button variant=\"danger\" onClick={stop}>\n <i className=\"fa fa-times\" />\n </Button>\n )}\n </InputGroup>\n </div>\n </div>\n );\n}\n","import debug from 'debug';\n\nimport TypeIcon from './TypeIcon';\nimport HardwareTemplate from './utils/HardwareTemplate';\nimport type { Hardware } from './utils/types';\n\nconst logger = debug('daiquiri.components.hardware.NoObject');\n\ninterface NoObjectProps {\n id: string;\n name?: string;\n options: {\n header?: string;\n emptyifnone?: boolean;\n };\n}\n\nexport default function NoObject(props: NoObjectProps) {\n if (props.options.emptyifnone) {\n logger(\n 'Component id:\"%s\" name:\"%s\" not displayed cause setup with emptyifnone.',\n props.id,\n props.name\n );\n return <></>;\n }\n\n const widgetIcon = (\n <TypeIcon name=\"NoObject\" icon=\"fam-hardware-any\" online={false} />\n );\n\n const widgetState = <></>;\n\n const widgetContent = <>Missing</>;\n\n const headerMode = props.options ? props.options.header : 'top';\n\n const hardware: Hardware = {\n id: props.id,\n name: props.name ?? '',\n alias: null,\n online: false,\n properties: {},\n type: '',\n };\n\n return (\n <HardwareTemplate\n hardware={hardware}\n widgetIcon={widgetIcon}\n widgetState={widgetState}\n widgetContent={widgetContent}\n headerMode={headerMode}\n />\n );\n}\n","import { InputGroup, Form, Badge } from 'react-bootstrap';\n\nimport TypeIcon from './TypeIcon';\nimport HardwareTemplate from './utils/HardwareTemplate';\nimport type { GenericSchema } from './utils/schema';\nimport type { HardwareWidgetProps, HardwareWidgetOptions } from './utils/types';\n\nfunction DeviceState(props: GenericSchema) {\n const state = props.online ? 'READY' : 'OFFLINE';\n return <Badge bg={state === 'READY' ? 'success' : 'warning'}>{state}</Badge>;\n}\n\ninterface PropertyWidgetOptions extends HardwareWidgetOptions {\n header?: string;\n property?: string;\n unit?: string;\n}\n\nexport default function Property(\n props: HardwareWidgetProps<GenericSchema, PropertyWidgetOptions>\n) {\n const { hardware, options = {} } = props;\n const widgetIcon = (\n <TypeIcon name=\"Optic\" icon=\"fa-cog\" online={hardware.online} />\n );\n\n const widgetState = <DeviceState {...hardware} />;\n\n function getValue() {\n const propertyName = options.property;\n if (propertyName === undefined) {\n return `property is not set`;\n }\n if (propertyName === null) {\n return `property is null`;\n }\n let result: any = hardware;\n for (const segment of propertyName.split('/')) {\n result = result[segment];\n if (result === undefined) {\n return `property '${propertyName}' not found`;\n }\n }\n return `${result}`;\n }\n\n function getUnit() {\n const unitName = options.unit;\n if (!unitName) {\n return null;\n }\n if (!unitName.includes('properties')) {\n // That's a fixed unit defined as an option\n return unitName;\n }\n\n let result: any = props;\n for (const segment of unitName.split('/')) {\n result = result[segment];\n if (result === undefined) {\n return null;\n }\n }\n return `${result}`;\n }\n\n const unit = getUnit();\n\n const widgetContent = (\n <InputGroup>\n <Form.Control value={getValue()} readOnly />\n {unit && <InputGroup.Text>{unit}</InputGroup.Text>}\n </InputGroup>\n );\n\n const headerMode = props.options.header || 'top';\n\n return (\n <HardwareTemplate\n hardware={hardware}\n widgetIcon={widgetIcon}\n widgetState={widgetState}\n widgetContent={widgetContent}\n headerMode={headerMode}\n />\n );\n}\n","import { Button, OverlayTrigger, Popover, ButtonGroup } from 'react-bootstrap';\n\nimport TypeIcon from './TypeIcon';\nimport HardwareTemplate from './utils/HardwareTemplate';\nimport { ShutterState } from './utils/State';\nimport type { ShutterSchema } from './utils/schema';\nimport type { HardwareWidgetProps, HardwareWidgetOptions } from './utils/types';\n\nfunction ShutterOverlay(\n props: HardwareWidgetProps<ShutterSchema, HardwareWidgetOptions>\n) {\n const { hardware } = props;\n const reset = () => {\n void hardware.requestChange({\n function: 'reset',\n });\n };\n\n return (\n <OverlayTrigger\n trigger=\"click\"\n rootClose\n overlay={\n <Popover id=\"popid\">\n <Popover.Header>{hardware.name} Details</Popover.Header>\n <Popover.Body>\n <h6>Status</h6>\n <pre>{hardware.properties.status}</pre>\n <div className=\"d-grid gap-2\">\n <Button onClick={reset} disabled={props.disabled}>\n Reset\n </Button>\n </div>\n </Popover.Body>\n </Popover>\n }\n >\n <Button className=\"flex-grow-0\" title=\"Shutter Details\">\n <i className=\"fa fa-ellipsis-h\" />\n </Button>\n </OverlayTrigger>\n );\n}\n\nexport default function ShutterDefault(\n props: HardwareWidgetProps<ShutterSchema, HardwareWidgetOptions>\n) {\n const { hardware, options = {} } = props;\n const widgetIcon = (\n <TypeIcon\n name=\"Shutter\"\n icon=\"fam-hardware-shutter\"\n online={hardware.online}\n />\n );\n\n const widgetState = <ShutterState hardware={hardware} />;\n\n function getState() {\n if (!hardware.properties) {\n return 'UNKNOWN';\n }\n return hardware.properties.state;\n }\n\n function getAction(s: string) {\n if (s === 'OPEN') {\n return ['Close', 'close'];\n }\n if (s === 'CLOSED') {\n return ['Open', 'open'];\n }\n if (s === 'DISABLED' || s === 'STANDBY' || s === 'FAULT') {\n return ['Closed', ''];\n }\n if (s === 'MOVING') {\n return ['...', ''];\n }\n return ['Unknown', ''];\n }\n\n const state = getState();\n // console.log(state);\n const [label, action] = getAction(state);\n const variants: { [name: string]: string } = {\n OPEN: 'danger',\n CLOSED: 'success',\n MOVING: 'warning',\n DISABLED: 'secondary',\n STANDBY: 'danger',\n FAULT: 'fatal',\n UNKNOWN: 'warning',\n };\n const variant = variants[state] || 'danger';\n\n function onClick() {\n void hardware.requestChange({\n function: action,\n });\n }\n\n const widgetContent = (\n <ButtonGroup className=\"d-flex flex-nowrap\">\n <Button\n variant={variant}\n onClick={onClick}\n disabled={props.disabled || action === ''}\n >\n {label}\n </Button>\n\n {options.extended && <ShutterOverlay {...props} />}\n </ButtonGroup>\n );\n\n const headerMode = props.options.header || 'top';\n\n return (\n <HardwareTemplate\n hardware={hardware}\n widgetIcon={widgetIcon}\n widgetState={widgetState}\n widgetContent={widgetContent}\n headerMode={headerMode}\n />\n );\n}\n","import type { PropsWithChildren } from 'react';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface Props {\n className?: string;\n}\n\nexport default function FullSizer(props: PropsWithChildren<Props>) {\n const [state, setState] = useState<Record<string, number>>({});\n const containerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (containerRef.current) {\n const view = containerRef.current;\n setState({\n width: view.clientWidth,\n height: view.clientHeight,\n });\n }\n }, []);\n\n return (\n <div\n ref={containerRef}\n style={{ width: '100%', height: '100%' }}\n className={props.className}\n >\n {state.width > 0 && (\n <div\n className=\"full-sizer\"\n style={{\n width: `${state.width}px`,\n height: `${state.height}px`,\n overflow: 'scroll',\n }}\n >\n {props.children}\n </div>\n )}\n </div>\n );\n}\n"],"names":["OnlineStatus","props","activeMessage","inactiveMessage","message","jsx","TypeIcon","name","icon","jsxs","formatEng","scalar","powerPrefix","q","subtrhnd","pow10","prefix","ucfirst","str","toHoursMins","seconds","min","mins","hours","toEnergy","wavelength","round","value","digits","FrontendOverlay","hardware","reset","e","itlks","ring","getPropertyState","key","state","OverlayTrigger","Popover","Container","map","Row","Col","Badge","prop","Button","Frontend","options","onClick","ButtonGroup","Info","getValue","propertyName","result","segment","Fragment","HardwareTemplate","headerMode","getLabel","label","Form","error","HardwareState","style","MotorState","getState","s1","ShutterState","s","getVariant","NumericStep","forwardRef","ref","stepSizeRef","useRef","currentStep","setCurrentStep","useState","onStep","up","ref2","val","stepSize","onStepProp","step","overlay","incIcon","decIcon","swapIncDec","onKeyDown","horizontalArrows","largeArrows","rest","onKeyDown2","steps","classNames","InputGroup","NumericStep$1","HardwareNumericStep","valueRef","edited","setEdited","setError","useEffect","updateRef","newValue","onBlur","onChange","promise","HardwareInputNumber","normalizeNumber","_a","MotorOverlay","onMoveVelocityRequested","target","onMoveAccelerationRequested","MotorDefault","onAbortRequested","onMovePositionRequested","widgetIcon","widgetState","Multiposition","selectionRef","onMove","stop","opts","p","logger","debug","NoObject","widgetContent","DeviceState","Property","getUnit","unitName","unit","ShutterOverlay","ShutterDefault","getAction","action","variant","FullSizer","setState","containerRef","view"],"mappings":";;;;;;AAQO,SAASA,EAAaC,GAAc;AACnC,QAAA;AAAA,IACJ,eAAAC,IAAgB;AAAA,IAChB,iBAAAC,IAAkB;AAAA,IAClB,SAAAC,IAAU;AAAA,EACR,IAAAH;AAGF,SAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,0BACTJ,EAAM,SAAS,YAAY,QAC7B;AAAA,MACA,OAAO,GAAGG,CAAO,IAAIH,EAAM,SAASC,IAAgBC,CAAe;AAAA,IAAA;AAAA,EAAA;AAGzE;AAEA,SAAwBG,EAASL,GAAc;AACvC,QAAA,EAAE,MAAAM,GAAM,MAAAC,EAAS,IAAAP;AACvB,SACG,gBAAAQ,EAAA,OAAA,EAAI,WAAU,QAAO,OAAOF,GAC3B,UAAA;AAAA,IAAA,gBAAAF,EAAC,KAAE,EAAA,WAAW,MAAMG,CAAI,IAAI;AAAA,IAC5B,gBAAAH,EAACL,GAAc,EAAA,GAAGC,GAAO;AAAA,EAC3B,EAAA,CAAA;AAEJ;AChCO,SAASS,EAAUC,GAAgB;AACxC,QAAMC,IAAsC;AAAA,IAC1C,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,I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AAOE,EAAK;AAAA,QACZ,QAAQA,EAAK;AAAA,MAAA,CACd;AAAA,IACH;AAAA,EACF,GAAG,CAAE,CAAA,GAGH,gBAAA5I;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK2I;AAAA,MACL,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAAA,MACvC,WAAW/I,EAAM;AAAA,MAEhB,UAAAoC,EAAM,QAAQ,KACb,gBAAAhC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO;AAAA,YACL,OAAO,GAAGgC,EAAM,KAAK;AAAA,YACrB,QAAQ,GAAGA,EAAM,MAAM;AAAA,YACvB,UAAU;AAAA,UACZ;AAAA,UAEC,UAAMpC,EAAA;AAAA,QAAA;AAAA,MACT;AAAA,IAAA;AAAA,EAAA;AAIR;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react-bootstrap"),h=require("react"),O=require("classnames"),C=require("lodash"),V=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},j=V(O);function F(e){const{activeMessage:a="Online",inactiveMessage:r="Offline",message:n="This device is"}=e;return t.jsx("div",{className:`dot-indicator small bg-${e.online?"success":"danger"}`,title:`${n} ${e.online?a:r}`})}function k(e){const{name:a,icon:r}=e;return t.jsxs("div",{className:"icon",title:a,children:[t.jsx("i",{className:`fa ${r}`}),t.jsx(F,{...e})]})}function R(e){const{headerMode:a,hardware:r}=e;function n(){return r.alias?r.alias:r.name?r.name:r.id}const d=n();switch(a){case"front":return t.jsx("div",{className:"hw-component",children:t.jsxs("div",{className:"hw-single",children:[e.widgetIcon,t.jsx("div",{className:"name",children:d}),t.jsx("div",{className:"d-inline-block",children:e.widgetContent})]})});case"none":return t.jsx("div",{className:"hw-component",children:t.jsx("div",{className:"hw-single",children:e.widgetContent})});case"state":return e.widgetState;default:return t.jsxs("div",{className:"hw-component",children:[t.jsxs("div",{className:"hw-head",children:[e.widgetIcon,t.jsx("div",{className:"name",children:t.jsx(i.Form.Label,{htmlFor:r.id,children:d})}),e.widgetState,e.hardware.errors&&e.hardware.errors.length>0&&t.jsx(i.OverlayTrigger,{trigger:"click",placement:"bottom",rootClose:!0,overlay:t.jsxs(i.Popover,{id:e.hardware.id,style:{maxWidth:500},children:[t.jsx(i.Popover.Header,{children:"Device Errors"}),t.jsxs(i.Popover.Body,{children:["There were errors with properties on this device:",t.jsx("ul",{children:e.hardware.errors.map(l=>t.jsxs("li",{children:[l.property,":",t.jsxs("span",{className:"stack-trace",children:[l.traceback,t.jsx("br",{}),l.exception]})]}))})]})]}),children:t.jsx(i.Button,{variant:"danger",size:"sm",children:t.jsx("i",{className:"fa fa-exclamation-triangle"})})})]}),t.jsx("div",{className:"hw-content",children:e.widgetContent})]})}}function q(e){const a={display:"inline-block",minWidth:""};return e.minWidth&&(a.minWidth=`${e.minWidth}em`),t.jsx("div",{style:a,children:t.jsx(i.Badge,{bg:e.variant,children:e.state})})}function A(e){const{hardware:a}=e;function r(){if(!a.online)return"OFFLINE";let d="UNKNOWN";return e.hardware.properties.state&&([d]=e.hardware.properties.state),d}const n=r();return t.jsx(q,{state:n,minWidth:6,variant:n==="READY"?"success":"warning"})}const E=h.forwardRef((e,a)=>{const r=h.useRef(null),[n,d]=h.useState(e.step),l=c=>{const g=a;if(r.current===null)return;let y=Number.parseFloat(g.current.value);const I=Number.parseFloat(r.current.value);y+=c?I:-I,g.current.value=`${y}`,e.onStep&&e.onStep({target:g.current})},{onStep:f,step:v,overlay:m,incIcon:w,decIcon:s,swapIncDec:o,onKeyDown:u,horizontalArrows:x,largeArrows:M,...b}=e,N=c=>{c.key==="ArrowUp"?(c.preventDefault(),l(!0)):c.key==="ArrowDown"?(c.preventDefault(),l(!1)):u&&u(c)};if(!e.step)return t.jsx(i.Form.Control,{ref:a,type:"number",step:"any",onKeyDown:N,...b});const S=C.map(e.steps||[e.step],c=>t.jsx("option",{value:c,children:c},c));return t.jsx("div",{className:j.default("numeric-step",{"numeric-step-large":M,"numeric-step-horizontal":x}),children:t.jsxs(i.InputGroup,{children:[t.jsx(i.Form.Control,{onKeyDown:N,ref:a,type:"number",step:"any",...b}),t.jsxs(t.Fragment,{children:[m,!m&&t.jsxs(i.InputGroup.Text,{className:"d-flex flex-column",children:[t.jsx(i.Form.Control,{ref:r,as:"select",className:"step-size",defaultValue:n,onChange:c=>d(Number.parseFloat(c.target.value)),children:S}),e.unit&&t.jsx("div",{children:e.unit}),!w&&!s&&t.jsxs(t.Fragment,{children:[t.jsx(i.Button,{className:"step step-up",disabled:e.disabled,onClick:c=>l(!0)}),t.jsx(i.Button,{className:"step step-down",disabled:e.disabled,onClick:c=>l(!1)})]})]}),s&&o&&t.jsx(i.Button,{disabled:e.disabled,onClick:c=>l(!1),children:t.jsx("i",{className:`fa fa-fw fa-${s}`})}),w&&t.jsx(i.Button,{disabled:e.disabled,onClick:c=>l(!0),children:t.jsx("i",{className:`fa fa-fw fa-${w}`})}),s&&!o&&t.jsx(i.Button,{disabled:e.disabled,onClick:c=>l(!1),children:t.jsx("i",{className:`fa fa-fw fa-${s}`})})]})]})})}),B=E;function P(e){const a=h.useRef(null),[r,n]=h.useState(!1),[d,l]=h.useState(!1);h.useEffect(()=>{a.current&&(e.hardwareValue===null?a.current.value="":a.current.value=e.hardwareValue.toString(),n(!1))},[e.hardwareValue]);function f(o){let u=o;e.precision!==void 0&&(u=Number.parseFloat(u).toFixed(e.precision)),a!=null&&a.current&&(a.current.value=u)}function v(){r&&setTimeout(()=>{f(e.hardwareValue),n(!1)},3e3)}function m(o){e.hardwareValue!==null&&(n(!0),a!=null&&a.current&&(a.current.value=o.target.value),o.target.value===e.hardwareValue.toString()&&n(!1))}function w(o){n(!1),e.onMoveRequested(o.target.value)}function s(o){switch(o.key){case"Enter":{n(!1);const u=Number.parseFloat(o.target.value),x=e.onMoveRequested(u);x&&x.catch(()=>{l(!0),setTimeout(()=>{f(e.hardwareValue),l(!1)},2e3)})}o.preventDefault(),o.stopPropagation();break;case"Esc":case"Escape":r&&(l(!1),n(!1),f(e.hardwareValue)),o.target.blur(),o.preventDefault(),o.stopPropagation();break}}return t.jsx(B,{id:e.id,className:j.default({"form-control-edited":r,"form-control-error":d,"hw-moving":e.hardwareIsMoving}),type:e.readOnly?"text":"number",ref:a,precision:e.precision,onChange:m,onBlur:v,onStep:w,onKeyDown:s,disabled:e.hardwareIsDisabled||e.readOnly||!e.hardwareIsReady,step:e.step,steps:e.steps,incIcon:e.incIcon,decIcon:e.decIcon,swapIncDec:e.swapIncDec,horizontalArrows:e.horizontalArrows,largeArrows:e.largeArrows,overlay:e.hardwareIsMoving&&!e.hardwareIsDisabled?t.jsx(i.Button,{variant:"danger",onClick:e.onAbortRequested,children:t.jsx("i",{className:"fa fa-times"})}):null})}function D(e){const a=h.useRef(null),[r,n]=h.useState(!1),[d,l]=h.useState(!1);function f(s){return e.precision!==void 0?Number.parseFloat(s).toFixed(e.precision):s}h.useEffect(()=>{var s;a.current&&(a.current.value=f((s=e.hardwareValue)==null?void 0:s.toString()),n(!1))},[e.hardwareValue,e.precision]);function v(s){const o=f(s);a!=null&&a.current&&(a.current.value=o)}function m(s){switch(s.key){case"Enter":{n(!1);const o=Number.parseFloat(s.target.value),u=e.onMoveRequested(o);u&&u.catch(()=>{l(!0),setTimeout(()=>{v(e.hardwareValue),l(!1)},2e3)}),s.preventDefault(),s.stopPropagation();break}case"Esc":case"Escape":r&&(l(!1),n(!1),v(e.hardwareValue)),s.target.blur(),s.preventDefault(),s.stopPropagation();break}}function w(s){n(!0),s.target,a!=null&&a.current&&(a.current.value=s.target.value),s.target.value===e.hardwareValue.toString()&&n(!1)}return t.jsx(i.Form.Control,{className:j.default({"form-control-edited":r,"form-control-error":d,"hw-moving":e.hardwareIsMoving}),type:"number",ref:a,onChange:w,onKeyDown:m,disabled:e.readOnly||e.hardwareIsMoving||e.hardwareIsDisabled,step:e.step})}function T(e){function a(d){return e.hardware.requestChange({property:"velocity",value:d})}function r(d){return e.hardware.requestChange({property:"acceleration",value:d})}let n="UNKNOWN";return e.hardware.properties.state&&([n]=e.hardware.properties.state),t.jsx(i.OverlayTrigger,{trigger:"click",rootClose:!0,overlay:t.jsxs(i.Popover,{id:"popid",children:[t.jsxs(i.Popover.Header,{children:[e.hardware.name," details"]}),t.jsxs(i.Popover.Body,{children:[t.jsxs(i.Form.Group,{children:[t.jsx(i.Form.Label,{children:"Velocity"}),t.jsx(D,{hardwareValue:e.hardware.properties.velocity,onMoveRequested:a,hardwareIsDisabled:e.disabled,hardwareIsReady:n==="READY",hardwareIsMoving:n==="MOVING",readOnly:e.readOnly})]}),t.jsxs(i.Form.Group,{children:[t.jsx(i.Form.Label,{children:"Acceleration"}),t.jsx(D,{hardwareValue:e.hardware.properties.acceleration,onMoveRequested:r,hardwareIsDisabled:e.disabled,hardwareIsReady:n==="READY",hardwareIsMoving:n==="MOVING",readOnly:e.readOnly})]})]})]}),children:t.jsx(i.Button,{children:t.jsx("i",{className:"fa fa-ellipsis-h"})})})}function z(e){const{hardware:a,options:r={}}=e;function n(){a.requestChange({function:"stop"})}function d(w){return a.requestChange({property:"position",value:w,function:"move"})}let l="UNKNOWN";e.hardware.properties.state&&([l]=e.hardware.properties.state);const f=t.jsx(k,{name:"Motor",icon:"fam-hardware-motor",online:a.online}),v=t.jsx(A,{hardware:a}),m=e.options?e.options.header:"top";return t.jsx(R,{hardware:a,widgetIcon:f,widgetState:v,widgetContent:t.jsxs(i.InputGroup,{children:[t.jsx(P,{id:a.id,hardwareValue:a.properties.position,hardwareIsDisabled:e.disabled,hardwareIsReady:l==="READY",hardwareIsMoving:l==="MOVING",onMoveRequested:d,onAbortRequested:n,precision:r.precision,readOnly:r.readOnly,step:r.step,steps:r.steps,incIcon:r.incicon,decIcon:r.decicon,swapIncDec:r.swapincdec,horizontalArrows:r.horizontalarrows,largeArrows:r.largearrows}),a.properties.unit&&t.jsx(i.InputGroup.Text,{children:a.properties.unit}),l!=="MOVING"&&r.extended&&t.jsx(T,{hardware:a,disabled:e.disabled,readOnly:r.readOnly}),l==="MOVING"&&!e.disabled&&!r.step&&t.jsx(i.Button,{variant:"danger",onClick:n,children:t.jsx("i",{className:"fa fa-times"})})]}),headerMode:m})}exports.MotorDefault=z;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),N=require("lodash"),r=require("react-bootstrap"),m=require("react"),P=require("classnames"),q=require("debug"),F=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},O=F(P),T=F(q);function G(e){const{activeMessage:n="Online",inactiveMessage:a="Offline",message:s="This device is"}=e;return t.jsx("div",{className:`dot-indicator small bg-${e.online?"success":"danger"}`,title:`${s} ${e.online?n:a}`})}function j(e){const{name:n,icon:a}=e;return t.jsxs("div",{className:"icon",title:n,children:[t.jsx("i",{className:`fa ${a}`}),t.jsx(G,{...e})]})}function $(e){const n={24:"Y",21:"Z",18:"E",15:"P",12:"T",9:"G",6:"M",3:"k","-3":"m","-6":"µ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},a=Math.log(e)/Math.log(1e3),s=!Number.isInteger(a),o=3*Math.ceil(a-(s?1:0)),i=o===0?"":n[o];return{scalar:e*10**-o,prefix:i,multiplier:10**-o}}function _(e){return e.charAt(0).toUpperCase()+e.slice(1)}function E(e){if(e<60)return`${Math.round(e)} sec`;const n=Math.round(e/60),a=n%60,s=Math.floor(n/60);return s?`${s} hr ${a} min`:`${a} min`}function z(e){return e>0?(662607004e-42*299792458/(e*1e-10)/160218e-24*.001).toFixed(4):0}function L(e,n){return Number.parseFloat(e.toFixed(n))}const H=Object.freeze(Object.defineProperty({__proto__:null,formatEng:$,round:L,toEnergy:z,toHoursMins:E,ucfirst:_},Symbol.toStringTag,{value:"Module"}));function U(e){const{hardware:n}=e;function a(u){n.requestChange({function:"reset"})}const s={"Front End":"feitlk",Experimental:"expitlk",PSS:"pssitlk"},o={Current:`${n.properties.current.toFixed(1)} mA`,Mode:n.properties.mode,Refill:E(n.properties.refill),Message:t.jsx("pre",{children:n.properties.message})};function i(u){if(!(u in n.properties))return"UNKNOWN";const d=n.properties[u];return!d||typeof d!="string"?"UNKNOWN":d}return t.jsx(r.OverlayTrigger,{trigger:"click",rootClose:!0,overlay:t.jsxs(r.Popover,{id:"popid",children:[t.jsxs(r.Popover.Header,{children:[n.name," Details"]}),t.jsxs(r.Popover.Body,{children:[t.jsx("h6",{children:"Status"}),t.jsx("pre",{children:n.properties.status}),t.jsx("h6",{children:"Interlocks"}),t.jsx(r.Container,{children:N.map(s,(u,d)=>t.jsxs(r.Row,{children:[t.jsxs(r.Col,{children:[d,":"]}),t.jsx(r.Col,{children:t.jsx(r.Badge,{bg:i(u)==="ON"?"success":"danger",children:i(u)})})]},d))}),t.jsx("h6",{children:"Ring Status"}),t.jsx(r.Container,{children:N.map(o,(u,d)=>t.jsxs(r.Row,{children:[t.jsxs(r.Col,{children:[d,":"]}),t.jsx(r.Col,{children:u})]},d))}),t.jsx("div",{className:"d-grid gap-2",children:t.jsx(r.Button,{disabled:e.disabled,onClick:a,children:"Reset"})})]})]}),children:t.jsx(r.Button,{className:"flex-grow-0",title:"Shutter Details",children:t.jsx("i",{className:"fa fa-ellipsis-h"})})})}function W(e){const{hardware:n,options:a={}}=e;function s(o){n.requestChange({function:n.properties.frontend==="FE open"?"close":"open"})}return t.jsxs("div",{className:"hw-component",children:[t.jsxs("div",{className:"hw-head",children:[t.jsx(j,{name:"Frontend",icon:"fam-hardware-frontend",online:n.online}),t.jsx("div",{className:"name",children:n.name}),t.jsx(r.Badge,{bg:n.properties.state==="OPEN"||n.properties.state==="RUNNING"?"success":"danger",children:n.properties.state})]}),t.jsx("div",{className:"hw-content",children:t.jsxs(r.ButtonGroup,{className:"d-flex",children:[t.jsx(r.Button,{variant:n.properties.frontend==="FE open"?"danger":"success",onClick:s,disabled:e.disabled,children:n.properties.frontend==="FE open"?"Close":"Open"}),t.jsx(U,{...e})]})})]})}function K(e){const{hardware:n,options:a={}}=e;function s(){const o=a.property;if(o===void 0)return"property is not set";if(o===null)return"property is null";let i=n;for(const u of o.split("/"))if(i=i[u],i===void 0)return`property '${o}' not found`;return`${i}`}return t.jsx(t.Fragment,{children:s()})}function p(e){const{headerMode:n,hardware:a}=e;function s(){return a.alias?a.alias:a.name?a.name:a.id}const o=s();switch(n){case"front":return t.jsx("div",{className:"hw-component",children:t.jsxs("div",{className:"hw-single",children:[e.widgetIcon,t.jsx("div",{className:"name",children:o}),t.jsx("div",{className:"d-inline-block",children:e.widgetContent})]})});case"none":return t.jsx("div",{className:"hw-component",children:t.jsx("div",{className:"hw-single",children:e.widgetContent})});case"state":return e.widgetState;default:return t.jsxs("div",{className:"hw-component",children:[t.jsxs("div",{className:"hw-head",children:[e.widgetIcon,t.jsx("div",{className:"name",children:t.jsx(r.Form.Label,{htmlFor:a.id,children:o})}),e.widgetState,e.hardware.errors&&e.hardware.errors.length>0&&t.jsx(r.OverlayTrigger,{trigger:"click",placement:"bottom",rootClose:!0,overlay:t.jsxs(r.Popover,{id:e.hardware.id,style:{maxWidth:500},children:[t.jsx(r.Popover.Header,{children:"Device Errors"}),t.jsxs(r.Popover.Body,{children:["There were errors with properties on this device:",t.jsx("ul",{children:e.hardware.errors.map(i=>t.jsxs("li",{children:[i.property,":",t.jsxs("span",{className:"stack-trace",children:[i.traceback,t.jsx("br",{}),i.exception]})]}))})]})]}),children:t.jsx(r.Button,{variant:"danger",size:"sm",children:t.jsx("i",{className:"fa fa-exclamation-triangle"})})})]}),t.jsx("div",{className:"hw-content",children:e.widgetContent})]})}}function I(e){const n={display:"inline-block",minWidth:""};return e.minWidth&&(n.minWidth=`${e.minWidth}em`),t.jsx("div",{style:n,children:t.jsx(r.Badge,{bg:e.variant,children:e.state})})}function R(e){const{hardware:n}=e;function a(){if(!n.online)return"OFFLINE";let o="UNKNOWN";return e.hardware.properties.state&&([o]=e.hardware.properties.state),o}const s=a();return t.jsx(I,{state:s,minWidth:6,variant:s==="READY"?"success":"warning"})}function B(e){const{hardware:n}=e;function a(){if(!n.online)return"OFFLINE";const i=n.properties.state;return e.useReadyState&&(i==="OPEN"||i==="CLOSED")?"READY":i}const s=a();function o(){switch(s){case"READY":return"success";case"OPEN":return"success";case"CLOSED":return"danger";case"DISABLED":return"secondary";case"MOVING":case"STANDBY":case"OFFLINE":return"warning";case"FAULT":return"fatal";default:return"fatal"}}return t.jsx(I,{state:s,minWidth:6,variant:o()})}const Y=Object.freeze(Object.defineProperty({__proto__:null,HardwareState:I,MotorState:R,ShutterState:B},Symbol.toStringTag,{value:"Module"})),Z=m.forwardRef((e,n)=>{const a=m.useRef(null),[s,o]=m.useState(e.step),i=h=>{const y=n;if(a.current===null)return;let M=Number.parseFloat(y.current.value);const D=Number.parseFloat(a.current.value);M+=h?D:-D,y.current.value=`${M}`,e.onStep&&e.onStep({target:y.current})},{onStep:u,step:d,overlay:x,incIcon:g,decIcon:l,swapIncDec:c,onKeyDown:f,horizontalArrows:v,largeArrows:b,...w}=e,C=h=>{h.key==="ArrowUp"?(h.preventDefault(),i(!0)):h.key==="ArrowDown"?(h.preventDefault(),i(!1)):f&&f(h)};if(!e.step)return t.jsx(r.Form.Control,{ref:n,type:"number",step:"any",onKeyDown:C,...w});const V=N.map(e.steps||[e.step],h=>t.jsx("option",{value:h,children:h},h));return t.jsx("div",{className:O.default("numeric-step",{"numeric-step-large":b,"numeric-step-horizontal":v}),children:t.jsxs(r.InputGroup,{children:[t.jsx(r.Form.Control,{onKeyDown:C,ref:n,type:"number",step:"any",...w}),t.jsxs(t.Fragment,{children:[x,!x&&t.jsxs(r.InputGroup.Text,{className:"d-flex flex-column",children:[t.jsx(r.Form.Control,{ref:a,as:"select",className:"step-size",defaultValue:s,onChange:h=>o(Number.parseFloat(h.target.value)),children:V}),e.unit&&t.jsx("div",{children:e.unit}),!g&&!l&&t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{className:"step step-up",disabled:e.disabled,onClick:h=>i(!0)}),t.jsx(r.Button,{className:"step step-down",disabled:e.disabled,onClick:h=>i(!1)})]})]}),l&&c&&t.jsx(r.Button,{disabled:e.disabled,onClick:h=>i(!1),children:t.jsx("i",{className:`fa fa-fw fa-${l}`})}),g&&t.jsx(r.Button,{disabled:e.disabled,onClick:h=>i(!0),children:t.jsx("i",{className:`fa fa-fw fa-${g}`})}),l&&!c&&t.jsx(r.Button,{disabled:e.disabled,onClick:h=>i(!1),children:t.jsx("i",{className:`fa fa-fw fa-${l}`})})]})]})})}),k=Z;function A(e){const n=m.useRef(null),[a,s]=m.useState(!1),[o,i]=m.useState(!1);m.useEffect(()=>{n.current&&(e.hardwareValue===null?n.current.value="":n.current.value=e.hardwareValue.toString(),s(!1))},[e.hardwareValue]);function u(c){let f=c;e.precision!==void 0&&(f=Number.parseFloat(f).toFixed(e.precision)),n!=null&&n.current&&(n.current.value=f)}function d(){a&&setTimeout(()=>{u(e.hardwareValue),s(!1)},3e3)}function x(c){e.hardwareValue!==null&&(s(!0),n!=null&&n.current&&(n.current.value=c.target.value),c.target.value===e.hardwareValue.toString()&&s(!1))}function g(c){s(!1),e.onMoveRequested(c.target.value)}function l(c){switch(c.key){case"Enter":{s(!1);const f=Number.parseFloat(c.target.value),v=e.onMoveRequested(f);v&&v.catch(()=>{i(!0),setTimeout(()=>{u(e.hardwareValue),i(!1)},2e3)})}c.preventDefault(),c.stopPropagation();break;case"Esc":case"Escape":a&&(i(!1),s(!1),u(e.hardwareValue)),c.target.blur(),c.preventDefault(),c.stopPropagation();break}}return t.jsx(k,{id:e.id,className:O.default({"form-control-edited":a,"form-control-error":o,"hw-moving":e.hardwareIsMoving}),type:e.readOnly?"text":"number",ref:n,precision:e.precision,onChange:x,onBlur:d,onStep:g,onKeyDown:l,disabled:e.hardwareIsDisabled||e.readOnly||!e.hardwareIsReady,step:e.step,steps:e.steps,incIcon:e.incIcon,decIcon:e.decIcon,swapIncDec:e.swapIncDec,horizontalArrows:e.horizontalArrows,largeArrows:e.largeArrows,overlay:e.hardwareIsMoving&&!e.hardwareIsDisabled?t.jsx(r.Button,{variant:"danger",onClick:e.onAbortRequested,children:t.jsx("i",{className:"fa fa-times"})}):null})}function S(e){const n=m.useRef(null),[a,s]=m.useState(!1),[o,i]=m.useState(!1);function u(l){return e.precision!==void 0?Number.parseFloat(l).toFixed(e.precision):l}m.useEffect(()=>{var l;n.current&&(n.current.value=u((l=e.hardwareValue)==null?void 0:l.toString()),s(!1))},[e.hardwareValue,e.precision]);function d(l){const c=u(l);n!=null&&n.current&&(n.current.value=c)}function x(l){switch(l.key){case"Enter":{s(!1);const c=Number.parseFloat(l.target.value),f=e.onMoveRequested(c);f&&f.catch(()=>{i(!0),setTimeout(()=>{d(e.hardwareValue),i(!1)},2e3)}),l.preventDefault(),l.stopPropagation();break}case"Esc":case"Escape":a&&(i(!1),s(!1),d(e.hardwareValue)),l.target.blur(),l.preventDefault(),l.stopPropagation();break}}function g(l){s(!0),l.target,n!=null&&n.current&&(n.current.value=l.target.value),l.target.value===e.hardwareValue.toString()&&s(!1)}return t.jsx(r.Form.Control,{className:O.default({"form-control-edited":a,"form-control-error":o,"hw-moving":e.hardwareIsMoving}),type:"number",ref:n,onChange:g,onKeyDown:x,disabled:e.readOnly||e.hardwareIsMoving||e.hardwareIsDisabled,step:e.step})}function J(e){function n(o){return e.hardware.requestChange({property:"velocity",value:o})}function a(o){return e.hardware.requestChange({property:"acceleration",value:o})}let s="UNKNOWN";return e.hardware.properties.state&&([s]=e.hardware.properties.state),t.jsx(r.OverlayTrigger,{trigger:"click",rootClose:!0,overlay:t.jsxs(r.Popover,{id:"popid",children:[t.jsxs(r.Popover.Header,{children:[e.hardware.name," details"]}),t.jsxs(r.Popover.Body,{children:[t.jsxs(r.Form.Group,{children:[t.jsx(r.Form.Label,{children:"Velocity"}),t.jsx(S,{hardwareValue:e.hardware.properties.velocity,onMoveRequested:n,hardwareIsDisabled:e.disabled,hardwareIsReady:s==="READY",hardwareIsMoving:s==="MOVING",readOnly:e.readOnly})]}),t.jsxs(r.Form.Group,{children:[t.jsx(r.Form.Label,{children:"Acceleration"}),t.jsx(S,{hardwareValue:e.hardware.properties.acceleration,onMoveRequested:a,hardwareIsDisabled:e.disabled,hardwareIsReady:s==="READY",hardwareIsMoving:s==="MOVING",readOnly:e.readOnly})]})]})]}),children:t.jsx(r.Button,{children:t.jsx("i",{className:"fa fa-ellipsis-h"})})})}function Q(e){const{hardware:n,options:a={}}=e;function s(){n.requestChange({function:"stop"})}function o(g){return n.requestChange({property:"position",value:g,function:"move"})}let i="UNKNOWN";e.hardware.properties.state&&([i]=e.hardware.properties.state);const u=t.jsx(j,{name:"Motor",icon:"fam-hardware-motor",online:n.online}),d=t.jsx(R,{hardware:n}),x=e.options?e.options.header:"top";return t.jsx(p,{hardware:n,widgetIcon:u,widgetState:d,widgetContent:t.jsxs(r.InputGroup,{children:[t.jsx(A,{id:n.id,hardwareValue:n.properties.position,hardwareIsDisabled:e.disabled,hardwareIsReady:i==="READY",hardwareIsMoving:i==="MOVING",onMoveRequested:o,onAbortRequested:s,precision:a.precision,readOnly:a.readOnly,step:a.step,steps:a.steps,incIcon:a.incicon,decIcon:a.decicon,swapIncDec:a.swapincdec,horizontalArrows:a.horizontalarrows,largeArrows:a.largearrows}),n.properties.unit&&t.jsx(r.InputGroup.Text,{children:n.properties.unit}),i!=="MOVING"&&a.extended&&t.jsx(J,{hardware:n,disabled:e.disabled,readOnly:a.readOnly}),i==="MOVING"&&!e.disabled&&!a.step&&t.jsx(r.Button,{variant:"danger",onClick:s,children:t.jsx("i",{className:"fa fa-times"})})]}),headerMode:x})}function X(e){const{hardware:n,options:a={}}=e,s=m.useRef(null);m.useEffect(()=>{if(!s.current){console.error("selectionRef ref is unset");return}s.current.value=n.properties.position},[n.properties.position]);function o(d){if(console.debug("change",d),!s||!s.current){console.error("selection ref is unset");return}n.requestChange({value:s.current.value,function:"move"})}function i(d){n.requestChange({function:"stop"})}const u=N.map(n.properties.positions,d=>t.jsx("option",{title:d.description,children:d.position},d.position));return t.jsxs("div",{className:"hw-component",children:[t.jsxs("div",{className:"hw-head",children:[t.jsx(j,{name:"Multiposition",icon:"fam-hardware-multiposition",online:n.online}),t.jsx("div",{className:"name",children:n.name}),t.jsx(r.Badge,{bg:n.properties.state==="READY"?"success":"warning",children:n.properties.state})]}),t.jsx("div",{className:"hw-content",children:t.jsxs(r.InputGroup,{children:[t.jsxs(r.Form.Control,{className:"custom-select",as:"select",ref:s,disabled:e.disabled,defaultValue:n.properties.position,children:[t.jsx("option",{disabled:!0,children:"unknown"}),u]}),n.properties.state!=="MOVING"&&t.jsx(r.Button,{onClick:o,disabled:e.disabled,children:"Move"}),n.properties.state==="MOVING"&&!e.disabled&&t.jsx(r.Button,{variant:"danger",onClick:i,children:t.jsx("i",{className:"fa fa-times"})})]})})]})}const ee=T.default("daiquiri.components.hardware.NoObject");function te(e){if(e.options.emptyifnone)return ee('Component id:"%s" name:"%s" not displayed cause setup with emptyifnone.',e.id,e.name),t.jsx(t.Fragment,{});const n=t.jsx(j,{name:"NoObject",icon:"fam-hardware-any",online:!1}),a=t.jsx(t.Fragment,{}),s=t.jsx(t.Fragment,{children:"Missing"}),o=e.options?e.options.header:"top",i={id:e.id,name:e.name??"",alias:null,online:!1,properties:{},type:""};return t.jsx(p,{hardware:i,widgetIcon:n,widgetState:a,widgetContent:s,headerMode:o})}function ne(e){const n=e.online?"READY":"OFFLINE";return t.jsx(r.Badge,{bg:n==="READY"?"success":"warning",children:n})}function re(e){const{hardware:n,options:a={}}=e,s=t.jsx(j,{name:"Optic",icon:"fa-cog",online:n.online}),o=t.jsx(ne,{...n});function i(){const l=a.property;if(l===void 0)return"property is not set";if(l===null)return"property is null";let c=n;for(const f of l.split("/"))if(c=c[f],c===void 0)return`property '${l}' not found`;return`${c}`}function u(){const l=a.unit;if(!l)return null;if(!l.includes("properties"))return l;let c=e;for(const f of l.split("/"))if(c=c[f],c===void 0)return null;return`${c}`}const d=u(),x=t.jsxs(r.InputGroup,{children:[t.jsx(r.Form.Control,{value:i(),readOnly:!0}),d&&t.jsx(r.InputGroup.Text,{children:d})]}),g=e.options.header||"top";return t.jsx(p,{hardware:n,widgetIcon:s,widgetState:o,widgetContent:x,headerMode:g})}function ae(e){const{hardware:n}=e,a=()=>{n.requestChange({function:"reset"})};return t.jsx(r.OverlayTrigger,{trigger:"click",rootClose:!0,overlay:t.jsxs(r.Popover,{id:"popid",children:[t.jsxs(r.Popover.Header,{children:[n.name," Details"]}),t.jsxs(r.Popover.Body,{children:[t.jsx("h6",{children:"Status"}),t.jsx("pre",{children:n.properties.status}),t.jsx("div",{className:"d-grid gap-2",children:t.jsx(r.Button,{onClick:a,disabled:e.disabled,children:"Reset"})})]})]}),children:t.jsx(r.Button,{className:"flex-grow-0",title:"Shutter Details",children:t.jsx("i",{className:"fa fa-ellipsis-h"})})})}function se(e){const{hardware:n,options:a={}}=e,s=t.jsx(j,{name:"Shutter",icon:"fam-hardware-shutter",online:n.online}),o=t.jsx(B,{hardware:n});function i(){return n.properties?n.properties.state:"UNKNOWN"}function u(w){return w==="OPEN"?["Close","close"]:w==="CLOSED"?["Open","open"]:w==="DISABLED"||w==="STANDBY"||w==="FAULT"?["Closed",""]:w==="MOVING"?["...",""]:["Unknown",""]}const d=i(),[x,g]=u(d),c={OPEN:"danger",CLOSED:"success",MOVING:"warning",DISABLED:"secondary",STANDBY:"danger",FAULT:"fatal",UNKNOWN:"warning"}[d]||"danger";function f(){n.requestChange({function:g})}const v=t.jsxs(r.ButtonGroup,{className:"d-flex flex-nowrap",children:[t.jsx(r.Button,{variant:c,onClick:f,disabled:e.disabled||g==="",children:x}),a.extended&&t.jsx(ae,{...e})]}),b=e.options.header||"top";return t.jsx(p,{hardware:n,widgetIcon:s,widgetState:o,widgetContent:v,headerMode:b})}function ie(e){const[n,a]=m.useState({}),s=m.useRef(null);return m.useEffect(()=>{if(s.current){const o=s.current;a({width:o.clientWidth,height:o.clientHeight})}},[]),t.jsx("div",{ref:s,style:{width:"100%",height:"100%"},className:e.className,children:n.width>0&&t.jsx("div",{className:"full-sizer",style:{width:`${n.width}px`,height:`${n.height}px`,overflow:"scroll"},children:e.children})})}const oe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),le=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.Formatting=H;exports.Frontend=W;exports.FullSizer=ie;exports.HardwareInputNumber=S;exports.HardwareNumericStep=A;exports.HardwareSchema=le;exports.HardwareState=Y;exports.HardwareTemplate=p;exports.HardwareTypes=oe;exports.Info=K;exports.MotorDefault=Q;exports.Multiposition=X;exports.NoObject=te;exports.NumericStep=k;exports.Property=re;exports.ShutterDefault=se;exports.TypeIcon=j;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|