@esrf/daiquiri-lib 1.0.3 → 2.0.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as React$1 from 'react';
3
- import React__default, { ReactElement, Component, ComponentType, PropsWithChildren, ReactChild, ChangeEvent, KeyboardEvent } from 'react';
3
+ import React__default, { ComponentType, ReactChild, ReactElement, PropsWithChildren, ChangeEvent, KeyboardEvent, Component } from 'react';
4
4
 
5
5
  interface HardwareError {
6
6
  property: string;
@@ -38,196 +38,1580 @@ interface Hardware {
38
38
  id: string;
39
39
  /** An optional object alias */
40
40
  alias: string | null;
41
+ /** A list of user tags */
42
+ user_tags: string[];
41
43
  /** The object properties as defined in the relevant schema */
42
44
  properties: {
43
45
  [name: string]: any;
44
46
  };
45
47
  /** Whether the device is available */
46
48
  online: boolean;
49
+ /** The reason why the hardware is locked, else null */
50
+ locked: string | null;
47
51
  /** The object type as defined by the REST API */
48
52
  type: string;
49
53
  /** Any potential errors initialising this object */
50
54
  errors?: HardwareError[];
51
55
  }
52
- interface HardwareChangeAction {
56
+ interface AnyHardware extends Hardware {
57
+ properties: any;
58
+ }
59
+ interface HardwareChangeActions {
60
+ setProperty: (name: string, value: any) => Promise<void>;
61
+ call: (name: string, ...args: any[]) => Promise<void>;
62
+ }
63
+ /**
64
+ * Common options exposed to user as yaml configuration for hardware widgets
65
+ */
66
+ interface HardwareWidgetOptions {
67
+ /** Whether to show the extended popup */
68
+ extended?: boolean;
69
+ /** Kind of header displayed */
70
+ header?: string;
71
+ }
72
+ declare type EditableHardware<H extends Hardware = Hardware> = H & {
73
+ /** Call the API to make a change on the hardware object */
74
+ actions: HardwareChangeActions;
75
+ };
76
+ /**
77
+ * Properties which are passed to the widgets
78
+ */
79
+ interface HardwareWidgetProps<H extends Hardware = Hardware, O extends HardwareWidgetOptions = HardwareWidgetOptions> {
80
+ /** Dynamic state of the hardware */
81
+ hardware: EditableHardware<H>;
82
+ /** Static schema describing the hardware */
83
+ schema: HardwareSchemaDescription;
84
+ /** Options passed to the widget by the yaml configuration */
85
+ options: O;
86
+ /** Global state of the widget (aggregating scan/operator/hardware states) */
87
+ disabled: boolean;
88
+ /** True if the session have the control */
89
+ operator: boolean;
90
+ }
91
+ declare type HardwareComponentType<H extends Hardware = Hardware> = ComponentType<HardwareWidgetProps<H, any>>;
92
+ interface HardwareVariant<H extends Hardware = Hardware> {
93
+ [name: string]: HardwareComponentType<H>;
94
+ }
95
+
96
+ type types_d_AnyHardware = AnyHardware;
97
+ type types_d_EditableHardware<H extends Hardware = Hardware> = EditableHardware<H>;
98
+ type types_d_Hardware = Hardware;
99
+ type types_d_HardwareChangeActions = HardwareChangeActions;
100
+ type types_d_HardwareComponentType<H extends Hardware = Hardware> = HardwareComponentType<H>;
101
+ type types_d_HardwareSchemaDescription = HardwareSchemaDescription;
102
+ type types_d_HardwareVariant<H extends Hardware = Hardware> = HardwareVariant<H>;
103
+ type types_d_HardwareWidgetOptions = HardwareWidgetOptions;
104
+ type types_d_HardwareWidgetProps<H extends Hardware = Hardware, O extends HardwareWidgetOptions = HardwareWidgetOptions> = HardwareWidgetProps<H, O>;
105
+ declare namespace types_d {
106
+ export type { types_d_AnyHardware as AnyHardware, types_d_EditableHardware as EditableHardware, types_d_Hardware as Hardware, types_d_HardwareChangeActions as HardwareChangeActions, types_d_HardwareComponentType as HardwareComponentType, types_d_HardwareSchemaDescription as HardwareSchemaDescription, types_d_HardwareVariant as HardwareVariant, types_d_HardwareWidgetOptions as HardwareWidgetOptions, types_d_HardwareWidgetProps as HardwareWidgetProps };
107
+ }
108
+
109
+ interface GenericSchema extends Hardware {
110
+ properties: {
111
+ state: string;
112
+ };
113
+ }
114
+ interface AnySchema extends Hardware {
115
+ properties: any;
116
+ }
117
+
118
+ type schema_d_AnySchema = AnySchema;
119
+ type schema_d_GenericSchema = GenericSchema;
120
+ declare namespace schema_d {
121
+ export type { schema_d_AnySchema as AnySchema, schema_d_GenericSchema as GenericSchema };
122
+ }
123
+
124
+ declare const Variants$o: HardwareVariant<AnySchema>;
125
+
126
+ declare const Mocks$k: {
127
+ default: {
128
+ response: {
129
+ callables: never[];
130
+ id: string;
131
+ name: string;
132
+ online: boolean;
133
+ properties: {
134
+ number: number;
135
+ option: string;
136
+ state: string;
137
+ string: string;
138
+ };
139
+ protocol: string;
140
+ require_staff: boolean;
141
+ type: string;
142
+ };
143
+ schema: {
144
+ $ref: string;
145
+ $schema: string;
146
+ asyncValidate: boolean;
147
+ cache: boolean;
148
+ definitions: {
149
+ HWTestSchema: {
150
+ additionalProperties: boolean;
151
+ properties: {
152
+ callables: {
153
+ $ref: string;
154
+ type: string;
155
+ };
156
+ id: {
157
+ title: string;
158
+ type: string;
159
+ };
160
+ name: {
161
+ title: string;
162
+ type: string;
163
+ };
164
+ online: {
165
+ title: string;
166
+ type: string;
167
+ };
168
+ properties: {
169
+ $ref: string;
170
+ type: string;
171
+ };
172
+ protocol: {
173
+ title: string;
174
+ type: string;
175
+ };
176
+ require_staff: {
177
+ title: string;
178
+ type: string;
179
+ };
180
+ type: {
181
+ title: string;
182
+ type: string;
183
+ };
184
+ };
185
+ type: string;
186
+ };
187
+ HardwareSchema: {
188
+ additionalProperties: boolean;
189
+ cache: boolean;
190
+ properties: {};
191
+ type: string;
192
+ };
193
+ TestPropertiesSchema: {
194
+ additionalProperties: boolean;
195
+ cache: boolean;
196
+ properties: {
197
+ number: {
198
+ format: string;
199
+ title: string;
200
+ type: string;
201
+ };
202
+ option: {
203
+ enum: string[];
204
+ enumNames: never[];
205
+ title: string;
206
+ type: string;
207
+ };
208
+ state: {
209
+ enum: string[];
210
+ enumNames: never[];
211
+ readOnly: boolean;
212
+ title: string;
213
+ type: string;
214
+ };
215
+ string: {
216
+ title: string;
217
+ type: string;
218
+ };
219
+ };
220
+ type: string;
221
+ };
222
+ };
223
+ save_presets: boolean;
224
+ };
225
+ };
226
+ };
227
+
228
+ declare function DefaultState(props: HardwareWidgetProps<AnySchema>): JSX.Element;
229
+
230
+ interface BaseNameWidgetOptions extends HardwareWidgetOptions {
231
+ overrideName?: string;
232
+ emptyifnone?: boolean;
233
+ }
234
+ declare function Name(props: HardwareWidgetProps<AnySchema, BaseNameWidgetOptions>): JSX.Element;
235
+
236
+ interface BasePropertyWidgetOptions extends HardwareWidgetOptions {
237
+ header?: string;
238
+ property?: string;
239
+ unit?: string;
240
+ }
241
+ declare function Property(props: HardwareWidgetProps<AnySchema, BasePropertyWidgetOptions>): JSX.Element;
242
+
243
+ interface BaseInfoWidgetOptions extends HardwareWidgetOptions {
244
+ /** The property */
53
245
  property?: string;
54
- function?: string;
55
- value?: any;
246
+ /** Unit for the property */
247
+ unit?: string;
248
+ }
249
+ declare function Info(props: HardwareWidgetProps<AnySchema, BaseInfoWidgetOptions>): JSX.Element;
250
+
251
+ interface Props$e {
252
+ showActions: boolean;
253
+ children: ReactChild | ReactChild[];
254
+ }
255
+ /**
256
+ * Wrap hardware widget passed as children with addToast and hardware
257
+ * change actions triggering console log.
258
+ */
259
+ declare function Wrapper(props: Props$e): JSX.Element;
260
+
261
+ /**
262
+ * Hardware as exposed by Redux
263
+ */
264
+ interface ActuatorSchema extends Hardware {
265
+ properties: {
266
+ state: string;
267
+ };
268
+ }
269
+
270
+ /**
271
+ * Hardware as exposed by Redux
272
+ */
273
+ interface AirBearingSchema extends Hardware {
274
+ properties: {
275
+ state: string;
276
+ };
277
+ }
278
+ declare const Variants$n: HardwareVariant<AirBearingSchema>;
279
+
280
+ declare function AirBearing(props: HardwareWidgetProps<AirBearingSchema, HardwareWidgetOptions>): JSX.Element;
281
+
282
+ declare function AirBearingProtected(props: HardwareWidgetProps<AirBearingSchema, HardwareWidgetOptions>): JSX.Element;
283
+
284
+ declare function AirBearingState(props: {
285
+ hardware: AirBearingSchema;
286
+ }): JSX.Element;
287
+
288
+ declare const Mocks$j: {
289
+ default: {
290
+ callables: string[];
291
+ id: string;
292
+ name: string;
293
+ online: boolean;
294
+ properties: {
295
+ state: string;
296
+ };
297
+ protocol: string;
298
+ require_staff: boolean;
299
+ type: string;
300
+ };
301
+ };
302
+
303
+ interface FrontendSchema extends Hardware {
304
+ properties: {
305
+ state: string;
306
+ status: string;
307
+ automatic: boolean;
308
+ frontend: string;
309
+ current: number;
310
+ refill: number;
311
+ mode: string;
312
+ message: string;
313
+ feitlk: string;
314
+ pssitlk: string;
315
+ expitlk: string;
316
+ };
317
+ }
318
+ declare const Variants$m: HardwareVariant<FrontendSchema>;
319
+
320
+ declare function Frontend(props: HardwareWidgetProps<FrontendSchema>): JSX.Element;
321
+
322
+ declare const Mocks$i: {
323
+ default: {
324
+ callables: string[];
325
+ id: string;
326
+ name: string;
327
+ online: boolean;
328
+ properties: {
329
+ current: number;
330
+ expitlk: string;
331
+ feitlk: string;
332
+ frontend: string;
333
+ pssitlk: string;
334
+ refill: number;
335
+ state: string;
336
+ mode: string;
337
+ message: string;
338
+ status: string;
339
+ };
340
+ protocol: string;
341
+ require_staff: boolean;
342
+ type: string;
343
+ };
344
+ };
345
+
346
+ /**
347
+ * Hardware as exposed by Redux
348
+ */
349
+ interface GaugeSchema extends Hardware {
350
+ properties: {
351
+ state: string;
352
+ status: string;
353
+ pressure: number;
354
+ unit?: string;
355
+ };
356
+ }
357
+ declare const Variants$l: HardwareVariant<GaugeSchema>;
358
+
359
+ interface GaugeWidgetOptions extends HardwareWidgetOptions {
360
+ /** Unit of pressure */
361
+ unit?: string;
362
+ /** Precision to show, default 3 */
363
+ precision?: number;
364
+ }
365
+ declare function Gauge(props: HardwareWidgetProps<GaugeSchema, GaugeWidgetOptions>): JSX.Element;
366
+
367
+ declare const Mocks$h: {
368
+ default: {
369
+ callables: string[];
370
+ id: string;
371
+ name: string;
372
+ online: boolean;
373
+ properties: {
374
+ pressure: number;
375
+ state: string;
376
+ status: string;
377
+ };
378
+ protocol: string;
379
+ require_staff: boolean;
380
+ type: string;
381
+ };
382
+ default2: {
383
+ callables: string[];
384
+ id: string;
385
+ name: string;
386
+ online: boolean;
387
+ properties: {
388
+ pressure: number;
389
+ state: string;
390
+ status: string;
391
+ };
392
+ protocol: string;
393
+ require_staff: boolean;
394
+ type: string;
395
+ };
396
+ };
397
+
398
+ /**
399
+ * Hardware as exposed by Redux
400
+ */
401
+ interface LaserSchema extends Hardware {
402
+ properties: {
403
+ state: string;
404
+ power: number;
405
+ };
406
+ }
407
+ declare const Variants$k: HardwareVariant<LaserSchema>;
408
+
409
+ interface LaserWidgetOptions extends HardwareWidgetOptions {
410
+ /** Default step size to use for up / down arrows */
411
+ step?: number;
412
+ /** Array of selectable step sizes */
413
+ steps?: number[];
414
+ }
415
+ declare function Laser(props: HardwareWidgetProps<LaserSchema, LaserWidgetOptions>): JSX.Element;
416
+
417
+ declare const Mocks$g: {
418
+ default: {
419
+ callables: never[];
420
+ id: string;
421
+ name: string;
422
+ online: boolean;
423
+ properties: {
424
+ power: number;
425
+ state: string;
426
+ };
427
+ protocol: string;
428
+ require_staff: boolean;
429
+ type: string;
430
+ };
431
+ };
432
+
433
+ /**
434
+ * Hardware as exposed by Redux
435
+ */
436
+ interface LaserHeatingSchema extends Hardware {
437
+ properties: {
438
+ state: string;
439
+ exposure_time: number;
440
+ background_mode: 'ON' | 'OFF' | 'ALWAYS';
441
+ fit_wavelength: number[];
442
+ current_calibration: string;
443
+ };
444
+ }
445
+ declare const Variants$j: HardwareVariant<LaserHeatingSchema>;
446
+
447
+ interface LaserHeatingWidgetOptions extends HardwareWidgetOptions {
448
+ /** Default step size to use for up / down arrows */
449
+ exposureStep?: number;
450
+ /** Array of selectable step sizes */
451
+ exposureSteps?: number[];
452
+ }
453
+ declare function LaserHeating(props: HardwareWidgetProps<LaserHeatingSchema, LaserHeatingWidgetOptions>): JSX.Element;
454
+
455
+ declare const Mocks$f: {
456
+ default: {
457
+ callables: never[];
458
+ id: string;
459
+ name: string;
460
+ online: boolean;
461
+ properties: {
462
+ exposure_time: number;
463
+ state: string;
464
+ background_mode: string;
465
+ fit_wavelength: number[];
466
+ current_calibration: string;
467
+ };
468
+ protocol: string;
469
+ require_staff: boolean;
470
+ type: string;
471
+ };
472
+ };
473
+
474
+ /**
475
+ * Hardware as exposed by Redux
476
+ */
477
+ interface LightSchema extends Hardware {
478
+ properties: {
479
+ state: string;
480
+ temperature: number;
481
+ intensity: number;
482
+ };
483
+ }
484
+ declare const Variants$i: HardwareVariant<LightSchema>;
485
+
486
+ declare function Light(props: HardwareWidgetProps<LightSchema>): JSX.Element;
487
+
488
+ declare const Mocks$e: {
489
+ default: {
490
+ callables: never[];
491
+ id: string;
492
+ name: string;
493
+ online: boolean;
494
+ properties: {
495
+ intensity: number;
496
+ state: string;
497
+ temperature: number;
498
+ };
499
+ protocol: string;
500
+ require_staff: boolean;
501
+ type: string;
502
+ };
503
+ };
504
+
505
+ /**
506
+ * Hardware as exposed by Redux
507
+ */
508
+ interface LimaSchema extends Hardware {
509
+ properties: {
510
+ state: 'READY' | 'ACQUIRING' | 'CONFIGURATION' | 'FAULT' | 'UNKNOWN' | 'OFFLINE';
511
+ static: {
512
+ lima_version: string;
513
+ lima_type: string;
514
+ camera_type: string;
515
+ camera_model: string;
516
+ camera_pixelsize: [number, number];
517
+ image_max_dim: [number, number];
518
+ } | null;
519
+ /**
520
+ * Pixel size of the detector (without binning).
521
+ *
522
+ * It's a read-only property.
523
+ */
524
+ pixel_size: [number, number];
525
+ /**
526
+ * Max exposition time of a single sub frame in accumulation.
527
+ *
528
+ * It is used (together with the exposure time) to determine the
529
+ * nb of sub frames and the expo time of a single sub frame.
530
+ * See `guessSubframes`.
531
+ */
532
+ acc_max_expo_time: number | null;
533
+ /**
534
+ * Flip applied to the resulting image
535
+ */
536
+ flip: [boolean, boolean];
537
+ /**
538
+ * Rotation applied to the resulting image.
539
+ *
540
+ * One of 0, 90, 180, 270
541
+ */
542
+ rotation: 0 | 90 | 180 | 270;
543
+ /**
544
+ * Binning applied to the resulting image
545
+ */
546
+ binning: [number, number];
547
+ /**
548
+ * Location and size of the ROI in the raw image.
549
+ *
550
+ * When binning=[1, 1] flip=[false, false], rotation=0
551
+ */
552
+ raw_roi: [number, number, number, number];
553
+ /**
554
+ * Location of the ROI in the transformed image.
555
+ */
556
+ roi: [number, number, number, number];
557
+ /**
558
+ * Final size of the detector. Including the crop of the ROI.
559
+ */
560
+ size: [number, number];
561
+ };
562
+ }
563
+ declare function isLimaHardware(entity: Hardware): entity is LimaSchema;
564
+ declare function useLimaHardware(name: string | null): LimaSchema | null;
565
+ /**
566
+ * Compute the nb sub frames which will be used for a specific exposure time
567
+ */
568
+ declare function limaGuessSubframes(exposureTime: number, accMaxExpoTime: number): [number, number];
569
+ declare const Variants$h: HardwareVariant<LimaSchema>;
570
+
571
+ declare function LimaBinning(props: HardwareWidgetProps<LimaSchema, HardwareWidgetOptions>): JSX.Element;
572
+
573
+ declare function LimaDefault(props: HardwareWidgetProps<LimaSchema>): JSX.Element;
574
+
575
+ declare function TomoDetectorSize$3(props: HardwareWidgetProps<LimaSchema, HardwareWidgetOptions>): JSX.Element;
576
+
577
+ declare function TomoDetectorSize$2(props: HardwareWidgetProps<LimaSchema, HardwareWidgetOptions>): JSX.Element;
578
+
579
+ declare function TomoDetectorSize$1(props: HardwareWidgetProps<LimaSchema, HardwareWidgetOptions>): JSX.Element;
580
+
581
+ declare function TomoDetectorSize(props: HardwareWidgetProps<LimaSchema, HardwareWidgetOptions>): JSX.Element;
582
+
583
+ declare function LimaState(props: {
584
+ hardware: LimaSchema;
585
+ }): JSX.Element;
586
+
587
+ declare const Mocks$d: {
588
+ default: {
589
+ id: string;
590
+ name: string;
591
+ protocol: string;
592
+ type: string;
593
+ online: boolean;
594
+ require_staff: boolean;
595
+ properties: {
596
+ static: {
597
+ lima_version: string;
598
+ lima_type: string;
599
+ camera_type: string;
600
+ camera_model: string;
601
+ camera_pixelsize: number[];
602
+ image_max_dim: number[];
603
+ };
604
+ acc_max_expo_time: number;
605
+ binning: number[];
606
+ flip: boolean[];
607
+ max_size: number[];
608
+ pixel_size: number[];
609
+ raw_roi: number[];
610
+ roi: number[];
611
+ rotation: number;
612
+ size: number[];
613
+ state: string;
614
+ };
615
+ };
616
+ flip: {
617
+ id: string;
618
+ name: string;
619
+ protocol: string;
620
+ type: string;
621
+ online: boolean;
622
+ require_staff: boolean;
623
+ properties: {
624
+ static: {
625
+ lima_version: string;
626
+ lima_type: string;
627
+ camera_type: string;
628
+ camera_model: string;
629
+ camera_pixelsize: number[];
630
+ image_max_dim: number[];
631
+ };
632
+ acc_max_expo_time: number;
633
+ binning: number[];
634
+ flip: boolean[];
635
+ max_size: number[];
636
+ pixel_size: number[];
637
+ raw_roi: number[];
638
+ roi: number[];
639
+ rotation: number;
640
+ size: number[];
641
+ state: string;
642
+ };
643
+ };
644
+ rot: {
645
+ id: string;
646
+ name: string;
647
+ protocol: string;
648
+ type: string;
649
+ online: boolean;
650
+ require_staff: boolean;
651
+ properties: {
652
+ static: {
653
+ lima_version: string;
654
+ lima_type: string;
655
+ camera_type: string;
656
+ camera_model: string;
657
+ camera_pixelsize: number[];
658
+ image_max_dim: number[];
659
+ };
660
+ acc_max_expo_time: number;
661
+ binning: number[];
662
+ flip: boolean[];
663
+ max_size: number[];
664
+ pixel_size: number[];
665
+ raw_roi: number[];
666
+ roi: number[];
667
+ rotation: number;
668
+ size: number[];
669
+ state: string;
670
+ };
671
+ };
672
+ };
673
+
674
+ /**
675
+ * Hardware as exposed by Redux
676
+ */
677
+ interface MeasurementGroupSchema extends Hardware {
678
+ properties: {
679
+ /** List of available counters */
680
+ available: string[];
681
+ /** List of disabled counters.
682
+ *
683
+ * It is a subset of the `available` list.
684
+ */
685
+ disabled: string[];
686
+ };
56
687
  }
57
- declare type HardwareChangeHandler = (action: HardwareChangeAction) => Promise<void> | null;
688
+
689
+ interface MotorSchema extends Hardware {
690
+ properties: {
691
+ position: number | null;
692
+ target: number;
693
+ tolerance: number;
694
+ acceleration: number;
695
+ velocity: number;
696
+ limits: [number, number];
697
+ state: string[];
698
+ unit: string;
699
+ offset: number;
700
+ sign: number;
701
+ display_digits: number | null;
702
+ };
703
+ }
704
+ /**
705
+ * Exposes the standard supported motor states
706
+ */
707
+ interface MotorStates {
708
+ READY?: true;
709
+ MOVING?: true;
710
+ FAULT?: true;
711
+ HIGHLIMIT?: true;
712
+ LOWLIMIT?: true;
713
+ HOME?: true;
714
+ OFF?: true;
715
+ DISABLED?: true;
716
+ UNKNOWN?: true;
717
+ NOT_READY?: true;
718
+ }
719
+ /**
720
+ * Normalize the motor state exposed by the hardware.
721
+ *
722
+ * This does not exposes the custom states in a useful maner.
723
+ *
724
+ * Store states are changed depending of existing user tags
725
+ *
726
+ * - `auto_on`: This allow to move the motor even if `OFF` is enabled.
727
+ * When `OFF` is enabled `READY` is turned to true.
728
+ * - `auto_ready`: This allow to move the motor even if `NOT_READY` is enabled.
729
+ *
730
+ * TODO: An improvement would be to normalize that when redux is populated.
731
+ * instead of storing a list.
732
+ *
733
+ * @param state: List of the controller state
734
+ * @param userTags: List of the hardware user tags
735
+ */
736
+ declare function useMotorStates(state: string[] | undefined, userTags?: string[]): MotorStates;
737
+ declare function isMotorHardware(entity: Hardware): entity is MotorSchema;
738
+ /**
739
+ * Return a motor from it's hardware name.
740
+ *
741
+ * Return `null` if the name refers to nothing or a mismatching hardware.
742
+ *
743
+ * @param name: An hardware identifier
744
+ */
745
+ declare function useMotorHardware(name: string | null): MotorSchema | null;
746
+ declare const Variants$g: HardwareVariant<MotorSchema>;
747
+
748
+ interface MotorDefaultOptions extends HardwareWidgetOptions {
749
+ /** Default step size to use for up / down arrows */
750
+ step?: number;
751
+ /** Array of selectable step sizes */
752
+ steps?: number[];
753
+ /** Number of decimals to show */
754
+ precision?: number;
755
+ /** Whether to show popup to configure extended parameters */
756
+ extended?: boolean;
757
+ /** Whether this widget is read only */
758
+ readOnly?: boolean;
759
+ /** Whether this widget can only be changed using steps */
760
+ stepOnly?: boolean;
761
+ /** Kind of header displayed */
762
+ header?: string;
763
+ /** Specify a fontawesome to inc the value */
764
+ incicon?: string;
765
+ /** Specify a fontawesome to dec the value */
766
+ decicon?: string;
767
+ /** If true inc and dec icon are swapped */
768
+ swapincdec?: boolean;
769
+ /** Show the step arrows horizontally instead of vertically */
770
+ horizontalarrows?: boolean;
771
+ /** Show large step arrows */
772
+ largearrows?: boolean;
773
+ }
774
+
775
+ /**
776
+ * The default motor widget
777
+ */
778
+ declare function MotorDefault(props: HardwareWidgetProps<MotorSchema, MotorDefaultOptions>): JSX.Element;
779
+
780
+ /**
781
+ * The default motor widget
782
+ */
783
+ declare function MotorText(props: HardwareWidgetProps<MotorSchema, MotorDefaultOptions>): JSX.Element;
784
+
785
+ /**
786
+ * A motor have a set of flags as state.
787
+ *
788
+ * For example an axis can expose `READY` and `MOVING` at the same time.
789
+ * It means the controller is ready to change it's target, even
790
+ * during a motion.
791
+ *
792
+ * For now we only display a "main" state.
793
+ */
794
+ declare function MotorState(props: {
795
+ hardware: MotorSchema;
796
+ }): JSX.Element;
797
+
798
+ declare const Mocks$c: {
799
+ default: {
800
+ callables: string[];
801
+ id: string;
802
+ name: string;
803
+ online: boolean;
804
+ properties: {
805
+ offset: number;
806
+ sign: number;
807
+ acceleration: number;
808
+ limits: number[];
809
+ position: number;
810
+ state: string[];
811
+ tolerance: number;
812
+ unit: string;
813
+ velocity: number;
814
+ display_digits: number;
815
+ };
816
+ protocol: string;
817
+ require_staff: boolean;
818
+ type: string;
819
+ user_tags: never[];
820
+ };
821
+ halfMotor: {
822
+ callables: string[];
823
+ id: string;
824
+ name: string;
825
+ online: boolean;
826
+ properties: {
827
+ offset: number;
828
+ sign: number;
829
+ acceleration: number;
830
+ limits: number[];
831
+ position: number;
832
+ state: string[];
833
+ tolerance: number;
834
+ unit: string;
835
+ velocity: number;
836
+ };
837
+ protocol: string;
838
+ require_staff: boolean;
839
+ type: string;
840
+ user_tags: never[];
841
+ };
842
+ unknownMotor: {
843
+ callables: string[];
844
+ id: string;
845
+ name: string;
846
+ online: boolean;
847
+ properties: {
848
+ acceleration: null;
849
+ limits: null[];
850
+ offset: null;
851
+ position: number;
852
+ sign: null;
853
+ state: string[];
854
+ target: null;
855
+ tolerance: number;
856
+ unit: string;
857
+ velocity: null;
858
+ };
859
+ protocol: string;
860
+ require_staff: boolean;
861
+ type: string;
862
+ user_tags: never[];
863
+ };
864
+ notReadyMotor: {
865
+ callables: string[];
866
+ id: string;
867
+ name: string;
868
+ online: boolean;
869
+ properties: {
870
+ acceleration: null;
871
+ limits: null[];
872
+ offset: null;
873
+ position: number;
874
+ sign: null;
875
+ state: never[];
876
+ target: null;
877
+ tolerance: number;
878
+ unit: string;
879
+ velocity: null;
880
+ };
881
+ protocol: string;
882
+ require_staff: boolean;
883
+ type: string;
884
+ user_tags: never[];
885
+ };
886
+ disconnectedMotor: {
887
+ callables: string[];
888
+ id: string;
889
+ name: string;
890
+ online: boolean;
891
+ properties: {};
892
+ protocol: string;
893
+ require_staff: boolean;
894
+ type: string;
895
+ user_tags: never[];
896
+ };
897
+ powerOffMotor: {
898
+ callables: string[];
899
+ id: string;
900
+ name: string;
901
+ online: boolean;
902
+ properties: {
903
+ acceleration: null;
904
+ limits: null[];
905
+ offset: null;
906
+ position: number;
907
+ sign: null;
908
+ state: string[];
909
+ target: null;
910
+ tolerance: number;
911
+ unit: string;
912
+ velocity: null;
913
+ };
914
+ protocol: string;
915
+ require_staff: boolean;
916
+ type: string;
917
+ user_tags: never[];
918
+ };
919
+ };
920
+
921
+ declare function createMotorMock(name: string, position: number): {
922
+ id: string;
923
+ name: string;
924
+ type: string;
925
+ properties: {
926
+ position: number;
927
+ unit: string;
928
+ limits: number[];
929
+ };
930
+ online: boolean;
931
+ };
932
+
933
+ interface Props$d {
934
+ minLimit?: number;
935
+ maxLimit?: number;
936
+ initialPosition?: number;
937
+ initialVelocity?: number;
938
+ children: ReactChild | ReactChild[];
939
+ }
940
+ declare function Motor(props: Props$d): JSX.Element;
941
+
942
+ interface MultipositionSchema extends Hardware {
943
+ properties: {
944
+ position: string;
945
+ positions: {
946
+ position: string;
947
+ description: string;
948
+ target: {
949
+ axis: string;
950
+ destination: number;
951
+ tolerance: number;
952
+ }[];
953
+ }[];
954
+ state: string;
955
+ };
956
+ }
957
+ declare const Variants$f: HardwareVariant<MultipositionSchema>;
958
+
959
+ declare function Multiposition(props: HardwareWidgetProps<MultipositionSchema>): JSX.Element;
960
+
961
+ declare const Mocks$b: {
962
+ default: {
963
+ callables: string[];
964
+ id: string;
965
+ name: string;
966
+ online: boolean;
967
+ properties: {
968
+ position: string;
969
+ positions: {
970
+ description: string;
971
+ position: string;
972
+ target: {
973
+ destination: number;
974
+ tolerance: number;
975
+ }[];
976
+ }[];
977
+ state: string;
978
+ };
979
+ protocol: string;
980
+ require_staff: boolean;
981
+ type: string;
982
+ };
983
+ };
984
+
985
+ /**
986
+ * Hardware as exposed by Redux
987
+ */
988
+ interface OpticSchema extends Hardware {
989
+ properties: {
990
+ state: string;
991
+ magnification: number;
992
+ available_magnifications: number[];
993
+ target_magnification: number;
994
+ magnification_range: [number, number] | null;
995
+ };
996
+ }
997
+ declare function isOpticHardware(entity: Hardware): entity is OpticSchema;
998
+ declare const Variants$e: HardwareVariant<OpticSchema>;
999
+
1000
+ interface OpticWidgetOptions extends HardwareWidgetOptions {
1001
+ readonly?: boolean;
1002
+ digits?: number;
1003
+ allowtuning?: boolean;
1004
+ }
1005
+ declare function Optic(props: HardwareWidgetProps<OpticSchema, OpticWidgetOptions>): JSX.Element;
1006
+
1007
+ declare function OpticState(props: {
1008
+ hardware: OpticSchema;
1009
+ }): JSX.Element;
1010
+
1011
+ declare const Mocks$a: {
1012
+ default: {
1013
+ callables: string[];
1014
+ id: string;
1015
+ name: string;
1016
+ online: boolean;
1017
+ properties: {
1018
+ state: string;
1019
+ status: string;
1020
+ magnification: number;
1021
+ target_magnification: null;
1022
+ available_magnifications: number[];
1023
+ magnification_range: null;
1024
+ };
1025
+ protocol: string;
1026
+ require_staff: boolean;
1027
+ type: string;
1028
+ };
1029
+ fixed: {
1030
+ callables: string[];
1031
+ id: string;
1032
+ name: string;
1033
+ online: boolean;
1034
+ properties: {
1035
+ state: string;
1036
+ status: string;
1037
+ magnification: number;
1038
+ target_magnification: null;
1039
+ available_magnifications: number[];
1040
+ magnification_range: null;
1041
+ };
1042
+ protocol: string;
1043
+ require_staff: boolean;
1044
+ type: string;
1045
+ };
1046
+ off: {
1047
+ callables: string[];
1048
+ id: string;
1049
+ name: string;
1050
+ online: boolean;
1051
+ properties: {
1052
+ state: string;
1053
+ status: string;
1054
+ magnification: number;
1055
+ target_magnification: null;
1056
+ available_magnifications: number[];
1057
+ magnification_range: null;
1058
+ };
1059
+ protocol: string;
1060
+ require_staff: boolean;
1061
+ type: string;
1062
+ };
1063
+ range: {
1064
+ callables: string[];
1065
+ id: string;
1066
+ name: string;
1067
+ online: boolean;
1068
+ properties: {
1069
+ state: string;
1070
+ status: string;
1071
+ magnification: number;
1072
+ target_magnification: null;
1073
+ available_magnifications: number[];
1074
+ magnification_range: null;
1075
+ };
1076
+ protocol: string;
1077
+ require_staff: boolean;
1078
+ type: string;
1079
+ };
1080
+ };
1081
+
1082
+ interface ProcedureSchema extends Hardware {
1083
+ properties: {
1084
+ state: string;
1085
+ previous_run_state: string;
1086
+ previous_run_exception: string | null;
1087
+ parameters: Record<string, any>;
1088
+ };
1089
+ }
1090
+ declare const Variants$d: HardwareVariant<ProcedureSchema>;
1091
+
1092
+ interface HardwareFromProcedure {
1093
+ __type__: 'hardware';
1094
+ name: string;
1095
+ }
1096
+ interface ScanFromProcedure {
1097
+ __type__: 'scan';
1098
+ mmh3: number;
1099
+ node?: string;
1100
+ key?: string;
1101
+ }
1102
+ interface ExceptionFromProcedure {
1103
+ __type__: 'exception';
1104
+ class: string;
1105
+ message: string;
1106
+ traceback: Record<string, any>;
1107
+ }
1108
+
1109
+ declare function ProcedureExecution(props: HardwareWidgetProps<ProcedureSchema>): JSX.Element;
1110
+
1111
+ declare function ProcedureManage(props: HardwareWidgetProps<ProcedureSchema>): JSX.Element;
1112
+
1113
+ declare function ProcedureValidate(props: HardwareWidgetProps<ProcedureSchema>): JSX.Element;
1114
+
1115
+ declare function ProcedureState(props: {
1116
+ hardware: ProcedureSchema;
1117
+ }): JSX.Element;
1118
+
1119
+ declare const Mocks$9: {
1120
+ standby: {
1121
+ callables: string[];
1122
+ type: string;
1123
+ id: string;
1124
+ name: string;
1125
+ protocol: string;
1126
+ require_staff: boolean;
1127
+ online: boolean;
1128
+ properties: {
1129
+ state: string;
1130
+ previous_run_state: string;
1131
+ previous_run_exception: null;
1132
+ parameters: {
1133
+ my_number: number;
1134
+ my_string: string;
1135
+ my_null: null;
1136
+ my_boolean: boolean;
1137
+ my_dict: {
1138
+ a: number;
1139
+ b: string;
1140
+ c: boolean;
1141
+ };
1142
+ my_list: (string | number | boolean)[];
1143
+ "my_scan_1.11": {
1144
+ __type__: string;
1145
+ node: string;
1146
+ mmh3: number;
1147
+ };
1148
+ "my_scan_2.0": {
1149
+ __type__: string;
1150
+ key: string;
1151
+ mmh3: number;
1152
+ };
1153
+ my_quantity: {
1154
+ __type__: string;
1155
+ scalar: number;
1156
+ unit: string;
1157
+ };
1158
+ my_nan: {
1159
+ __type__: string;
1160
+ };
1161
+ my_posinf: {
1162
+ __type__: string;
1163
+ };
1164
+ my_neginf: {
1165
+ __type__: string;
1166
+ };
1167
+ my_obj: {
1168
+ __type__: string;
1169
+ name: string;
1170
+ };
1171
+ };
1172
+ };
1173
+ };
1174
+ };
1175
+
1176
+ interface ShutterSchema extends Hardware {
1177
+ properties: {
1178
+ state: string;
1179
+ status: string;
1180
+ valid: boolean;
1181
+ open_text: string;
1182
+ closed_text: string;
1183
+ };
1184
+ }
1185
+ declare const Variants$c: HardwareVariant<ShutterSchema>;
1186
+
1187
+ declare function ShutterDefault(props: HardwareWidgetProps<ShutterSchema, HardwareWidgetOptions>): JSX.Element;
1188
+
1189
+ declare function ShutterProtected(props: HardwareWidgetProps<ShutterSchema, HardwareWidgetOptions>): JSX.Element;
1190
+
1191
+ declare function ShutterState(props: {
1192
+ hardware: ShutterSchema;
1193
+ useReadyState?: boolean;
1194
+ }): JSX.Element;
1195
+
1196
+ declare const Mocks$8: {
1197
+ default: {
1198
+ callables: string[];
1199
+ id: string;
1200
+ name: string;
1201
+ online: boolean;
1202
+ properties: {
1203
+ closed_text: string;
1204
+ open_text: string;
1205
+ state: string;
1206
+ status: string;
1207
+ valid: boolean;
1208
+ };
1209
+ protocol: string;
1210
+ require_staff: boolean;
1211
+ type: string;
1212
+ };
1213
+ };
1214
+
1215
+ /**
1216
+ * Hardware as exposed by Redux
1217
+ */
1218
+ interface PumpSchema extends Hardware {
1219
+ properties: {
1220
+ state: string;
1221
+ status: string;
1222
+ pressure: number;
1223
+ voltage: number;
1224
+ current: number;
1225
+ unit?: string;
1226
+ };
1227
+ }
1228
+ declare const Variants$b: HardwareVariant<PumpSchema>;
1229
+
1230
+ interface PumpWidgetOptions extends HardwareWidgetOptions {
1231
+ unit?: string;
1232
+ precision?: number;
1233
+ }
1234
+ declare function Pump(props: HardwareWidgetProps<PumpSchema, PumpWidgetOptions>): JSX.Element;
1235
+
1236
+ declare const Mocks$7: {
1237
+ default: {
1238
+ callables: string[];
1239
+ id: string;
1240
+ name: string;
1241
+ online: boolean;
1242
+ properties: {
1243
+ current: number;
1244
+ pressure: number;
1245
+ state: string;
1246
+ status: string;
1247
+ voltage: number;
1248
+ };
1249
+ protocol: string;
1250
+ require_staff: boolean;
1251
+ type: string;
1252
+ };
1253
+ };
1254
+
58
1255
  /**
59
- * Common options exposed to user as yaml configuration for hardware widgets
1256
+ * Hardware as exposed by Redux
60
1257
  */
61
- interface HardwareWidgetOptions {
62
- /** Whether to show the extended popup */
63
- extended?: boolean;
64
- /** Kind of header displayed */
65
- header?: string;
1258
+ interface PusherSchema extends Hardware {
1259
+ properties: {
1260
+ state: string;
1261
+ };
66
1262
  }
67
- declare type EditableHardware<H extends Hardware = Hardware> = H & {
68
- /** Call the API to make a change on the hardware object */
69
- requestChange: HardwareChangeHandler;
1263
+ declare const Variants$a: HardwareVariant<PusherSchema>;
1264
+
1265
+ declare function Pusher(props: HardwareWidgetProps<PusherSchema, HardwareWidgetOptions>): JSX.Element;
1266
+
1267
+ declare function PusherState(props: {
1268
+ hardware: PusherSchema;
1269
+ }): JSX.Element;
1270
+
1271
+ declare const Mocks$6: {
1272
+ default: {
1273
+ callables: string[];
1274
+ id: string;
1275
+ name: string;
1276
+ online: boolean;
1277
+ properties: {
1278
+ state: string;
1279
+ };
1280
+ protocol: string;
1281
+ require_staff: boolean;
1282
+ type: string;
1283
+ };
70
1284
  };
1285
+
71
1286
  /**
72
- * Properties which are passed to the widgets
1287
+ * Hardware as exposed by Redux
73
1288
  */
74
- interface HardwareWidgetProps<H extends Hardware = Hardware, O extends HardwareWidgetOptions = HardwareWidgetOptions> {
75
- /** Dynamic state of the hardware */
76
- hardware: EditableHardware<H>;
77
- /** Static schema describing the hardware */
78
- schema: HardwareSchemaDescription;
79
- /** Options passed to the widget by the yaml configuration */
80
- options: O;
81
- /** Add temporary message on the Daiquiri top level interface */
82
- addToast: (props: {
83
- type: string;
84
- title: string;
85
- text: string;
86
- }) => void;
87
- /** Global state of the widget (aggregating scan/operator/hardware states) */
88
- disabled: boolean;
89
- /** True if the session have the control */
90
- operator: boolean;
1289
+ interface ServiceSchema extends Hardware {
1290
+ properties: {
1291
+ state: 'STOPPED' | 'STARTING' | 'RUNNING' | 'BACKOFF' | 'STOPPING' | 'EXITED' | 'FATAL' | 'UNKNOWN';
1292
+ };
91
1293
  }
1294
+ declare const Variants$9: HardwareVariant<ServiceSchema>;
92
1295
 
93
- type types_d_EditableHardware<H extends Hardware = Hardware> = EditableHardware<H>;
94
- type types_d_Hardware = Hardware;
95
- type types_d_HardwareChangeAction = HardwareChangeAction;
96
- type types_d_HardwareChangeHandler = HardwareChangeHandler;
97
- type types_d_HardwareSchemaDescription = HardwareSchemaDescription;
98
- type types_d_HardwareWidgetOptions = HardwareWidgetOptions;
99
- type types_d_HardwareWidgetProps<H extends Hardware = Hardware, O extends HardwareWidgetOptions = HardwareWidgetOptions> = HardwareWidgetProps<H, O>;
100
- declare namespace types_d {
101
- export type { types_d_EditableHardware as EditableHardware, types_d_Hardware as Hardware, types_d_HardwareChangeAction as HardwareChangeAction, types_d_HardwareChangeHandler as HardwareChangeHandler, types_d_HardwareSchemaDescription as HardwareSchemaDescription, types_d_HardwareWidgetOptions as HardwareWidgetOptions, types_d_HardwareWidgetProps as HardwareWidgetProps };
1296
+ declare function ServiceDefault(props: HardwareWidgetProps<ServiceSchema, HardwareWidgetOptions>): JSX.Element;
1297
+
1298
+ interface ServiceProectedOptions extends HardwareWidgetOptions {
1299
+ /** Direction to drop the menu */
1300
+ dropDirection?: string;
102
1301
  }
1302
+ declare function ServiceProtected(props: HardwareWidgetProps<ServiceSchema, ServiceProectedOptions>): JSX.Element;
103
1303
 
104
- interface GenericSchema extends Hardware {
105
- properties: {
106
- state: string;
1304
+ declare function ServiceState(props: {
1305
+ hardware: ServiceSchema;
1306
+ }): JSX.Element;
1307
+
1308
+ declare const Mocks$5: {
1309
+ default: {
1310
+ callables: string[];
1311
+ id: string;
1312
+ name: string;
1313
+ online: boolean;
1314
+ properties: {
1315
+ state: string;
1316
+ };
1317
+ protocol: string;
1318
+ require_staff: boolean;
1319
+ type: string;
107
1320
  };
1321
+ };
1322
+
1323
+ interface TomoFlatMotionStep {
1324
+ /** Axis reference, following the pattern `hardware:my_axis` */
1325
+ axisRef: string;
1326
+ absolute_position: number | null;
1327
+ relative_position: number | null;
108
1328
  }
109
- interface MotorSchema extends Hardware {
1329
+ /**
1330
+ * Hardware as exposed by Redux
1331
+ */
1332
+ interface TomoFlatMotionSchema extends Hardware {
110
1333
  properties: {
111
- position: number;
112
- target: number;
113
- tolerance: number;
114
- acceleration: number;
115
- velocity: number;
116
- limits: number[];
117
- state: string[];
118
- unit: string;
119
- offset: number;
120
- sign: number;
1334
+ state: 'READY';
1335
+ available_axes: string[];
1336
+ motion: TomoFlatMotionStep[];
1337
+ move_in_parallel: boolean;
1338
+ power_onoff: boolean;
1339
+ settle_time: number;
121
1340
  };
122
1341
  }
123
- interface MultipositionSchema extends Hardware {
124
- properties: {
125
- position: string;
126
- positions: {
127
- position: string;
128
- description: string;
129
- target: {
1342
+ declare const Variants$8: HardwareVariant<TomoFlatMotionSchema>;
1343
+
1344
+ declare function isTomoFlatMotionHardware(entity: Hardware): entity is TomoFlatMotionSchema;
1345
+ declare function useTomoFlatMotionHardware(name: string | null): TomoFlatMotionSchema | null;
1346
+
1347
+ declare function TomoFlatMotionDefault(props: HardwareWidgetProps<TomoFlatMotionSchema>): JSX.Element;
1348
+
1349
+ declare function TomoFlatMotionSmall(props: HardwareWidgetProps<TomoFlatMotionSchema>): JSX.Element;
1350
+
1351
+ declare function TomoFlatMotionState(props: {
1352
+ hardware: TomoFlatMotionSchema;
1353
+ }): JSX.Element;
1354
+
1355
+ declare const Mocks$4: {
1356
+ default: {
1357
+ id: string;
1358
+ name: string;
1359
+ online: boolean;
1360
+ properties: {
1361
+ state: string;
1362
+ settle_time: number;
1363
+ power_onoff: boolean;
1364
+ move_in_parallel: boolean;
1365
+ available_axes: string[];
1366
+ motion: {
130
1367
  axis: string;
131
- destination: number;
132
- tolerance: number;
1368
+ absolute_position: null;
1369
+ relative_position: number;
133
1370
  }[];
134
- }[];
1371
+ };
1372
+ protocol: string;
1373
+ require_staff: boolean;
1374
+ type: string;
1375
+ };
1376
+ };
1377
+
1378
+ /**
1379
+ * Hardware as exposed by Redux
1380
+ */
1381
+ interface TomoReferencePositionSchema extends Hardware {
1382
+ properties: Record<string, never>;
1383
+ }
1384
+ declare function isTomoReferencePositionHardware(entity: Hardware): entity is TomoReferencePositionSchema;
1385
+ declare const Variants$7: HardwareVariant<TomoReferencePositionSchema>;
1386
+
1387
+ declare function TomoReferencePositionDefault(props: HardwareWidgetProps<TomoReferencePositionSchema>): JSX.Element;
1388
+
1389
+ /**
1390
+ * Hardware as exposed by Redux
1391
+ */
1392
+ interface TomoDetectorSchema extends Hardware {
1393
+ properties: {
135
1394
  state: string;
1395
+ user_sample_pixel_size: number | null;
1396
+ sample_pixel_size_mode: string;
1397
+ sample_pixel_size: number | null;
1398
+ field_of_view: number;
1399
+ detector: string;
1400
+ optic: string;
1401
+ source_distance: number | null;
1402
+ acq_mode: 'MANUAL' | 'SINGLE' | 'ACCUMULATION';
136
1403
  };
137
1404
  }
138
- interface ShutterSchema extends Hardware {
1405
+ declare const Variants$6: HardwareVariant<TomoDetectorSchema>;
1406
+
1407
+ declare function isTomoDetectorHardware(entity: Hardware): entity is TomoDetectorSchema;
1408
+ declare function useTomoDetectorHardware(name: string | null): TomoDetectorSchema | null;
1409
+
1410
+ declare function TomoDetectorAcquisitionMode(props: HardwareWidgetProps<TomoDetectorSchema, HardwareWidgetOptions>): JSX.Element;
1411
+
1412
+ interface TomoDetectorSamplePixelSizeOptions extends HardwareWidgetOptions {
1413
+ display_unit?: string | null;
1414
+ }
1415
+ declare function TomoDetectorSamplePixelSize(props: HardwareWidgetProps<TomoDetectorSchema, TomoDetectorSamplePixelSizeOptions>): JSX.Element;
1416
+
1417
+ declare function TomoDetectorState(props: {
1418
+ hardware: TomoDetectorSchema;
1419
+ }): JSX.Element;
1420
+
1421
+ declare const Mocks$3: {
1422
+ default: {
1423
+ id: string;
1424
+ name: string;
1425
+ online: boolean;
1426
+ properties: {
1427
+ state: string;
1428
+ actual_size: number[];
1429
+ sample_pixel_size_mode: string;
1430
+ user_sample_pixel_size: number;
1431
+ sample_pixel_size: number;
1432
+ };
1433
+ protocol: string;
1434
+ require_staff: boolean;
1435
+ type: string;
1436
+ };
1437
+ };
1438
+
1439
+ /**
1440
+ * Hardware as exposed by Redux
1441
+ */
1442
+ interface TomoDetectorsSchema extends Hardware {
139
1443
  properties: {
140
1444
  state: string;
141
- status: string;
142
- valid: boolean;
143
- open_text: string;
144
- closed_text: string;
1445
+ detectors: string[];
1446
+ active_detector: string;
1447
+ target_detector?: string;
145
1448
  };
146
1449
  }
147
- interface FrontendSchema extends Hardware {
1450
+ declare const Variants$5: HardwareVariant<TomoDetectorsSchema>;
1451
+
1452
+ declare function isTomoDetectorsHardware(entity: Hardware): entity is TomoDetectorsSchema;
1453
+ declare function useTomoDetectorsHardware(name: string | null): TomoDetectorsSchema | null;
1454
+
1455
+ declare function TomoDetectors(props: HardwareWidgetProps<TomoDetectorsSchema>): JSX.Element;
1456
+
1457
+ declare function TomoDetectorsState(props: {
1458
+ hardware: TomoDetectorsSchema;
1459
+ }): JSX.Element;
1460
+
1461
+ declare const Mocks$2: {
1462
+ default: {
1463
+ id: string;
1464
+ name: string;
1465
+ online: boolean;
1466
+ properties: {
1467
+ state: string;
1468
+ active_detector: string;
1469
+ detectors: string[];
1470
+ };
1471
+ protocol: string;
1472
+ require_staff: boolean;
1473
+ type: string;
1474
+ };
1475
+ };
1476
+
1477
+ /**
1478
+ * Hardware as exposed by Redux
1479
+ */
1480
+ interface TomoImagingSchema extends Hardware {
148
1481
  properties: {
149
1482
  state: string;
150
- status: string;
151
- automatic: boolean;
152
- frontend: string;
153
- current: number;
154
- refill: number;
155
- mode: string;
156
- message: string;
157
- feitlk: string;
158
- pssitlk: string;
159
- expitlk: string;
1483
+ update_on_move: boolean;
1484
+ exposure_time: number;
1485
+ settle_time: number;
160
1486
  };
161
1487
  }
1488
+ declare const Variants$4: HardwareVariant<TomoImagingSchema>;
162
1489
 
163
- type schema_d_FrontendSchema = FrontendSchema;
164
- type schema_d_GenericSchema = GenericSchema;
165
- type schema_d_MotorSchema = MotorSchema;
166
- type schema_d_MultipositionSchema = MultipositionSchema;
167
- type schema_d_ShutterSchema = ShutterSchema;
168
- declare namespace schema_d {
169
- export type { schema_d_FrontendSchema as FrontendSchema, schema_d_GenericSchema as GenericSchema, schema_d_MotorSchema as MotorSchema, schema_d_MultipositionSchema as MultipositionSchema, schema_d_ShutterSchema as ShutterSchema };
1490
+ declare function TomoImagingActions(props: HardwareWidgetProps<TomoImagingSchema>): JSX.Element;
1491
+
1492
+ declare function TomoImagingDefault(props: HardwareWidgetProps<TomoImagingSchema>): JSX.Element;
1493
+
1494
+ declare function TomoImagingExposureTime(props: HardwareWidgetProps<TomoImagingSchema>): JSX.Element;
1495
+
1496
+ declare function TomoImagingSettleTime(props: HardwareWidgetProps<TomoImagingSchema>): JSX.Element;
1497
+
1498
+ declare function TomoImagingUpdateMode(props: HardwareWidgetProps<TomoImagingSchema>): JSX.Element;
1499
+
1500
+ declare function TomoImagingState(props: {
1501
+ hardware: TomoImagingSchema;
1502
+ }): JSX.Element;
1503
+
1504
+ declare const Mocks$1: {
1505
+ default: {
1506
+ id: string;
1507
+ name: string;
1508
+ online: boolean;
1509
+ properties: {
1510
+ state: string;
1511
+ update_on_move: boolean;
1512
+ exposure_time: number;
1513
+ };
1514
+ protocol: string;
1515
+ require_staff: boolean;
1516
+ type: string;
1517
+ };
1518
+ };
1519
+
1520
+ /**
1521
+ * Hardware as exposed by Redux
1522
+ */
1523
+ interface TomoSampleStageSchema extends Hardware {
1524
+ properties: {
1525
+ sx: string;
1526
+ sy: string;
1527
+ sz: string;
1528
+ somega: string;
1529
+ sampx: string;
1530
+ sampy: string;
1531
+ sampu: string;
1532
+ sampv: string;
1533
+ x_axis_focal_pos: number | null;
1534
+ detector_center: [number | null, number | null];
1535
+ };
170
1536
  }
1537
+ declare const Variants$3: HardwareVariant<TomoSampleStageSchema>;
171
1538
 
172
- declare function Frontend(props: HardwareWidgetProps<FrontendSchema>): JSX.Element;
1539
+ declare function isTomoSampleStageHardware(entity: Hardware): entity is TomoSampleStageSchema;
1540
+ declare function useTomoSampleStageHardware(name: string | null): TomoSampleStageSchema | null;
173
1541
 
174
- interface InfoOptions extends HardwareWidgetOptions {
175
- /** The property */
176
- property?: string;
177
- /** Unit for the property */
178
- unit?: string;
1542
+ /**
1543
+ * Hardware as exposed by Redux
1544
+ */
1545
+ interface TomoConfigSchema extends Hardware {
1546
+ properties: {
1547
+ sample_stage: string;
1548
+ sxbeam: string;
1549
+ detectors: string;
1550
+ holotomo: string;
1551
+ latency_time: number;
1552
+ };
179
1553
  }
180
- declare function Info(props: HardwareWidgetProps<Hardware, InfoOptions>): JSX.Element;
1554
+ declare const Variants$2: HardwareVariant<TomoConfigSchema>;
181
1555
 
182
- interface MotorDefaultOptions extends HardwareWidgetOptions {
183
- /** Default step size to use for up / down arrows */
184
- step?: number;
185
- /** Array of selectable step sizes */
186
- steps?: number[];
187
- /** Number of decimals to show */
188
- precision?: number;
189
- /** Whether to show popup to configure extended parameters */
190
- extended?: boolean;
191
- /** Whether this widget is read only */
192
- readOnly?: boolean;
193
- /** Kind of header displayed */
194
- header?: string;
195
- /** Specify a fontawesome to inc the value */
196
- incicon?: string;
197
- /** Specify a fontawesome to dec the value */
198
- decicon?: string;
199
- /** If true inc and dec icon are swapped */
200
- swapincdec?: boolean;
201
- /** Show the step arrows horizontally instead of vertically */
202
- horizontalarrows?: boolean;
203
- /** Show large step arrows */
204
- largearrows?: boolean;
1556
+ declare function isTomoConfigHardware(entity: Hardware): entity is TomoConfigSchema;
1557
+ declare function useTomoConfigHardware(name: string | null): TomoConfigSchema | null;
1558
+
1559
+ declare function TomoConfigLatencyTime(props: HardwareWidgetProps<TomoConfigSchema>): JSX.Element;
1560
+
1561
+ interface TomoHoloDistance {
1562
+ z1: number;
1563
+ position: number;
1564
+ pixel_size: number;
205
1565
  }
206
1566
  /**
207
- * The default motor widget
1567
+ * Hardware as exposed by Redux
208
1568
  */
209
- declare function MotorDefault(props: HardwareWidgetProps<MotorSchema, MotorDefaultOptions>): JSX.Element;
1569
+ interface TomoHoloSchema extends Hardware {
1570
+ properties: {
1571
+ state: string;
1572
+ settle_time: number;
1573
+ pixel_size: number | null;
1574
+ nb_distances: number;
1575
+ distances: TomoHoloDistance[];
1576
+ };
1577
+ }
1578
+ declare const Variants$1: HardwareVariant<TomoHoloSchema>;
210
1579
 
211
- declare function Multiposition(props: HardwareWidgetProps<MultipositionSchema>): JSX.Element;
1580
+ declare function isTomoHoloHardware(entity: Hardware): entity is TomoHoloSchema;
1581
+ declare function useTomoHoloHardware(name: string | null): TomoHoloSchema | null;
212
1582
 
213
- interface NoObjectProps {
214
- id: string;
215
- name?: string;
216
- options: {
217
- header?: string;
218
- emptyifnone?: boolean;
1583
+ declare function TomoHoloState(props: {
1584
+ hardware: TomoHoloSchema;
1585
+ }): JSX.Element;
1586
+
1587
+ /**
1588
+ * Hardware as exposed by Redux
1589
+ */
1590
+ interface ValveSchema extends Hardware {
1591
+ properties: {
1592
+ state: string;
1593
+ status: string;
219
1594
  };
220
1595
  }
221
- declare function NoObject(props: NoObjectProps): JSX.Element;
1596
+ declare const Variants: HardwareVariant<ValveSchema>;
222
1597
 
223
- interface PropertyWidgetOptions extends HardwareWidgetOptions {
224
- header?: string;
225
- property?: string;
226
- unit?: string;
227
- }
228
- declare function Property(props: HardwareWidgetProps<GenericSchema, PropertyWidgetOptions>): JSX.Element;
1598
+ declare function Valve(props: HardwareWidgetProps<ValveSchema>): JSX.Element;
229
1599
 
230
- declare function ShutterDefault(props: HardwareWidgetProps<ShutterSchema, HardwareWidgetOptions>): JSX.Element;
1600
+ declare const Mocks: {
1601
+ default: {
1602
+ callables: string[];
1603
+ id: string;
1604
+ name: string;
1605
+ online: boolean;
1606
+ properties: {
1607
+ state: string;
1608
+ status: string;
1609
+ };
1610
+ protocol: string;
1611
+ require_staff: boolean;
1612
+ type: string;
1613
+ };
1614
+ };
231
1615
 
232
1616
  interface Props$c {
233
1617
  online: boolean;
@@ -286,13 +1670,15 @@ declare function HardwareNumericStep(props: {
286
1670
  onMoveRequested: (value: number) => Promise<void> | null;
287
1671
  onAbortRequested: () => void;
288
1672
  /** Default step size to use for up / down arrows */
289
- step?: number;
1673
+ step?: number | string;
290
1674
  /** Array of selectable step sizes */
291
- steps?: number[];
1675
+ steps?: (number | string)[];
292
1676
  /** Number of decimals to show */
293
1677
  precision?: number;
294
1678
  /** Whether this widget is read only */
295
1679
  readOnly?: boolean;
1680
+ /** Whether this widget can only be changed using steps */
1681
+ stepOnly?: boolean;
296
1682
  /** Specify a fontawesome to inc the value */
297
1683
  incIcon?: string;
298
1684
  /** Specify a fontawesome to dec the value */
@@ -317,20 +1703,29 @@ declare function HardwareState(props: {
317
1703
  state: string;
318
1704
  variant: string;
319
1705
  minWidth?: number;
1706
+ description?: string;
320
1707
  }): JSX.Element;
321
- declare function MotorState(props: {
322
- hardware: MotorSchema;
323
- }): JSX.Element;
324
- declare function ShutterState(props: {
325
- hardware: ShutterSchema;
326
- useReadyState?: boolean;
1708
+ /**
1709
+ * Normalize the way to display an hardware exposing multiple states.
1710
+ *
1711
+ * - `states` is the states exposed by the hardware.
1712
+ * - `variants` contains a variant for each of this states, else `fatal` is used.
1713
+ * - `descriptions` can be provided to add a description to the state.
1714
+ *
1715
+ * If `minWidth` is pecified (in `em`) it ensure the widget width will stay the
1716
+ * same when the state change
1717
+ */
1718
+ declare function HardwareMultiState(props: {
1719
+ states: string[];
1720
+ variants?: Record<string, string>;
1721
+ descriptions?: Record<string, string>;
1722
+ minWidth?: number;
327
1723
  }): JSX.Element;
328
1724
 
1725
+ declare const State_d_HardwareMultiState: typeof HardwareMultiState;
329
1726
  declare const State_d_HardwareState: typeof HardwareState;
330
- declare const State_d_MotorState: typeof MotorState;
331
- declare const State_d_ShutterState: typeof ShutterState;
332
1727
  declare namespace State_d {
333
- export { State_d_HardwareState as HardwareState, State_d_MotorState as MotorState, State_d_ShutterState as ShutterState };
1728
+ export { State_d_HardwareMultiState as HardwareMultiState, State_d_HardwareState as HardwareState };
334
1729
  }
335
1730
 
336
1731
  declare function formatEng(scalar: number): {
@@ -355,17 +1750,15 @@ declare namespace formatting_d {
355
1750
  export { formatting_d_formatEng as formatEng, formatting_d_round as round, formatting_d_toEnergy as toEnergy, formatting_d_toHoursMins as toHoursMins, formatting_d_ucfirst as ucfirst };
356
1751
  }
357
1752
 
358
- interface HardwareVariantOptions {
1753
+ interface NoObjectProps {
1754
+ id: string;
1755
+ name?: string;
359
1756
  options: {
360
- variant: string;
361
- };
362
- }
363
- declare class HardwareVariant extends Component<HardwareVariantOptions, void> {
364
- variants: {
365
- [name: string]: ComponentType<any>;
1757
+ header?: string;
1758
+ emptyifnone?: boolean;
366
1759
  };
367
- render(): JSX.Element;
368
1760
  }
1761
+ declare function NoObject(props: NoObjectProps): JSX.Element;
369
1762
 
370
1763
  interface Props$a {
371
1764
  className?: string;
@@ -373,9 +1766,10 @@ interface Props$a {
373
1766
  declare function FullSizer(props: PropsWithChildren<Props$a>): JSX.Element;
374
1767
 
375
1768
  interface Props$9 {
376
- step?: number;
377
- steps?: number[];
1769
+ step?: number | string;
1770
+ steps?: (number | string)[];
378
1771
  disabled: boolean;
1772
+ stepOnly?: boolean;
379
1773
  id?: string;
380
1774
  unit?: string;
381
1775
  overlay?: ReactChild | null;
@@ -403,6 +1797,7 @@ declare function PanelHeader(props: {
403
1797
  declare function PanelContents(props: {
404
1798
  children?: ReactChild | ReactChild[];
405
1799
  style?: Record<string, any>;
1800
+ className?: string;
406
1801
  }): JSX.Element;
407
1802
  interface Props$8 {
408
1803
  style?: Record<string, any>;
@@ -555,7 +1950,7 @@ declare const yamlMap: {
555
1950
  label: typeof YamlLabel;
556
1951
  };
557
1952
  interface Props$1 {
558
- id: string;
1953
+ testid: string;
559
1954
  layout: YamlRoot;
560
1955
  className?: string;
561
1956
  unhandledComponentDidCatch?: (error: Error, setStateCallback: (data: Record<string, any>) => void) => void;
@@ -640,12 +2035,14 @@ declare namespace asserts_d {
640
2035
  export { asserts_d_assertBoolean as assertBoolean, asserts_d_assertDataCollectionId as assertDataCollectionId, asserts_d_assertKeyExpected as assertKeyExpected, asserts_d_assertNoUnknownKeys as assertNoUnknownKeys, asserts_d_assertNumber as assertNumber, asserts_d_assertOptionalBackend as assertOptionalBackend, asserts_d_assertOptionalBoolean as assertOptionalBoolean, asserts_d_assertOptionalNumber as assertOptionalNumber, asserts_d_assertOptionalNumberList as assertOptionalNumberList, asserts_d_assertOptionalString as assertOptionalString, asserts_d_assertOptionalStringList as assertOptionalStringList, asserts_d_assertOptionalStringOrStringList as assertOptionalStringOrStringList, asserts_d_assertString as assertString, asserts_d_assertStringList as assertStringList };
641
2036
  }
642
2037
 
2038
+ interface RuntimeHooks {
2039
+ useHardware?: (id: string | null) => Hardware | null;
2040
+ useHardwareChangeActions?: (name: string | null) => HardwareChangeActions;
2041
+ }
2042
+ declare function registerRuntimeHook(hooks: Partial<RuntimeHooks>): void;
2043
+
643
2044
  interface HardwareObjectProps {
644
2045
  id: string;
645
- actions: {
646
- requestChange: (data: any) => void;
647
- addToast: (data: any) => void;
648
- };
649
2046
  options: {
650
2047
  variant?: string;
651
2048
  header?: string;
@@ -658,17 +2055,14 @@ interface HardwareObjectProps {
658
2055
  }
659
2056
  interface ResolvedHardwareObjectProps extends HardwareObjectProps {
660
2057
  operator?: boolean;
2058
+ runningScan?: boolean;
661
2059
  obj: Hardware | null;
662
2060
  }
663
- interface ComponentMapping {
664
- [name: string]: ComponentType<any> | typeof HardwareVariant;
665
- }
666
2061
 
667
- type HardwareObject_d_ComponentMapping = ComponentMapping;
668
2062
  type HardwareObject_d_HardwareObjectProps = HardwareObjectProps;
669
2063
  type HardwareObject_d_ResolvedHardwareObjectProps = ResolvedHardwareObjectProps;
670
2064
  declare namespace HardwareObject_d {
671
- export type { HardwareObject_d_ComponentMapping as ComponentMapping, HardwareObject_d_HardwareObjectProps as HardwareObjectProps, HardwareObject_d_ResolvedHardwareObjectProps as ResolvedHardwareObjectProps };
2065
+ export type { HardwareObject_d_HardwareObjectProps as HardwareObjectProps, HardwareObject_d_ResolvedHardwareObjectProps as ResolvedHardwareObjectProps };
672
2066
  }
673
2067
 
674
2068
  /**
@@ -686,7 +2080,6 @@ interface Monitor {
686
2080
  unit?: string;
687
2081
  }
688
2082
 
689
- declare function registerRuntimeHook(name: string, hook: (id: string | null) => Hardware | null): void;
690
2083
  declare const dynamicOp: (op: string, a1: any, b1: any) => boolean | undefined;
691
2084
  declare function MonitorHardware(props: {
692
2085
  monitor: Monitor;
@@ -703,4 +2096,4 @@ interface MonitorPanelItemProps {
703
2096
  }
704
2097
  declare function MonitorPanelItem(props: PropsWithChildren<MonitorPanelItemProps>): JSX.Element;
705
2098
 
706
- export { formatting_d as Formatting, Frontend, FullSizer, HardwareObject_d as HWObject, HardwareInputNumber, HardwareNumericStep, schema_d as HardwareSchema, State_d as HardwareState, HardwareTemplate, types_d as HardwareTypes, HardwareVariant, Info, type InfoOptions, KeyError, MissingKeysError, type Monitor, MonitorHardware, MonitorPanel, MonitorPanelItem, type MonitorPanelProps, MotorDefault, type MotorDefaultOptions, Multiposition, NoObject, NumericStep, Panel, Property, ShutterDefault, TypeIcon, type Props$c as TypeIconOptions, ErrorBoundary as YAMLErrorBoundary, Main as YAMLLayout, asserts_d as YamlAsserts, type YamlComponent$1 as YamlComponent, type YamlNode, dynamicOp, registerHardwareComponent, registerMonitorComponent, registerRuntimeHook, registerComponent as registerYamlComponent, registerComponents as registerYamlComponents, registerYamlType, renderYamlNode, yamlMap };
2099
+ export { type ActuatorSchema, AirBearing, Mocks$j as AirBearingMocks, AirBearingProtected, type AirBearingSchema, AirBearingState, Variants$n as AirBearingVariants, type AnySchema, Info as BaseInfo, type BaseInfoWidgetOptions, Mocks$k as BaseMocks, Name as BaseName, type BaseNameWidgetOptions, Property as BaseProperty, type BasePropertyWidgetOptions, DefaultState as BaseState, Variants$o as BaseVariants, type ExceptionFromProcedure, formatting_d as Formatting, Frontend, Mocks$i as FrontendMocks, type FrontendSchema, Variants$m as FrontendVariants, FullSizer, Gauge, Mocks$h as GaugeMocks, type GaugeSchema, Variants$l as GaugeVariants, type GaugeWidgetOptions, type GenericSchema, HardwareObject_d as HWObject, type Hardware, type HardwareComponentType, type HardwareFromProcedure, HardwareInputNumber, HardwareNumericStep, schema_d as HardwareSchema, State_d as HardwareState, HardwareTemplate, types_d as HardwareTypes, type HardwareVariant, KeyError, Laser, LaserHeating, Mocks$f as LaserHeatingMocks, type LaserHeatingSchema, Variants$j as LaserHeatingVariants, type LaserHeatingWidgetOptions, Mocks$g as LaserMocks, type LaserSchema, Variants$k as LaserVariants, type LaserWidgetOptions, Light, Mocks$e as LightMocks, type LightSchema, Variants$i as LightVariants, LimaBinning, LimaDefault, TomoDetectorSize$3 as LimaDescription, TomoDetectorSize$2 as LimaImageRoi, Mocks$d as LimaMocks, type LimaSchema, TomoDetectorSize$1 as LimaSize, LimaState, TomoDetectorSize as LimaTransformation, Variants$h as LimaVariants, type MeasurementGroupSchema, MissingKeysError, Motor as MockMotor, type Monitor, MonitorHardware, MonitorPanel, MonitorPanelItem, type MonitorPanelProps, MotorDefault, type MotorDefaultOptions, Mocks$c as MotorMocks, type MotorSchema, MotorState, MotorText, Variants$g as MotorVariants, Multiposition, Mocks$b as MultipositionMocks, type MultipositionSchema, Variants$f as MultipositionVariants, NoObject, NumericStep, Optic as OpticDefault, Mocks$a as OpticMocks, type OpticSchema, OpticState, Variants$e as OpticVariants, type OpticWidgetOptions, Panel, ProcedureExecution, ProcedureManage, Mocks$9 as ProcedureMocks, type ProcedureSchema, ProcedureState, ProcedureValidate, Variants$d as ProcedureVariants, Pump as PumpDefault, Mocks$7 as PumpMocks, type PumpSchema, Variants$b as PumpVariants, Pusher as PusherDefault, Mocks$6 as PusherMocks, type PusherSchema, PusherState, Variants$a as PusherVariants, type ScanFromProcedure, ServiceDefault, Mocks$5 as ServiceMocks, ServiceProtected, type ServiceSchema, ServiceState, Variants$9 as ServiceVariants, ShutterDefault, Mocks$8 as ShutterMocks, ShutterProtected, type ShutterSchema, ShutterState, Variants$c as ShutterVariants, TomoConfigLatencyTime, type TomoConfigSchema, Variants$2 as TomoConfigVariants, TomoDetectorAcquisitionMode, Mocks$3 as TomoDetectorMocks, TomoDetectorSamplePixelSize, type TomoDetectorSchema, TomoDetectorState, Variants$6 as TomoDetectorVariants, TomoDetectors as TomoDetectorsDefault, Mocks$2 as TomoDetectorsMocks, type TomoDetectorsSchema, TomoDetectorsState, Variants$5 as TomoDetectorsVariants, TomoFlatMotionDefault, Mocks$4 as TomoFlatMotionMocks, type TomoFlatMotionSchema, TomoFlatMotionSmall, TomoFlatMotionState, type TomoFlatMotionStep, Variants$8 as TomoFlatMotionVariants, type TomoHoloDistance, type TomoHoloSchema, TomoHoloState, Variants$1 as TomoHoloVariants, TomoImagingActions, TomoImagingDefault, TomoImagingExposureTime, Mocks$1 as TomoImagingMocks, type TomoImagingSchema, TomoImagingSettleTime, TomoImagingState, TomoImagingUpdateMode, Variants$4 as TomoImagingVariants, TomoReferencePositionDefault, type TomoReferencePositionSchema, Variants$7 as TomoReferencePositionVariants, type TomoSampleStageSchema, Variants$3 as TomoSampleStageVariants, TypeIcon, type Props$c as TypeIconOptions, Valve as ValveDefault, Mocks as ValveMocks, type ValveSchema, Variants as ValveVariants, Wrapper, ErrorBoundary as YAMLErrorBoundary, Main as YAMLLayout, asserts_d as YamlAsserts, type YamlComponent$1 as YamlComponent, type YamlNode, createMotorMock, dynamicOp, isLimaHardware, isMotorHardware, isOpticHardware, isTomoConfigHardware, isTomoDetectorHardware, isTomoDetectorsHardware, isTomoFlatMotionHardware, isTomoHoloHardware, isTomoReferencePositionHardware, isTomoSampleStageHardware, limaGuessSubframes, registerHardwareComponent, registerMonitorComponent, registerRuntimeHook, registerComponent as registerYamlComponent, registerComponents as registerYamlComponents, registerYamlType, renderYamlNode, useLimaHardware, useMotorHardware, useMotorStates, useTomoConfigHardware, useTomoDetectorHardware, useTomoDetectorsHardware, useTomoFlatMotionHardware, useTomoHoloHardware, useTomoSampleStageHardware, yamlMap };