instruments.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import Instrument from '../components/Instrument'
  2. import InstrumentList from '../components/InstrumentList'
  3. const instrument = {
  4. name: 'Keithley 2230-3',
  5. description: 'A very nice 3 channel power supply.',
  6. subsystems: [{
  7. name: 'Source',
  8. description: 'The commands in the SOURce subsystem are used to control the output of the power supply.',
  9. commands: [{
  10. id: '1',
  11. tag: 'Apply',
  12. name: 'Apply voltage and current',
  13. description: 'This command sets voltage and current levels on a specified channel with a single command message.',
  14. instrument: null,
  15. readString: null,
  16. writeString: '[SOURce:]APPLy {CH1|CH2|CH3}, <NRf+>, <NRf+>',
  17. parameters: ['channel']
  18. },
  19. {
  20. id: '1',
  21. tag: 'Output',
  22. name: 'Channel output state',
  23. description: 'This command sets the output state of the presently selected channel. The query form of this command returns the output state of the presently selected channel.',
  24. instrument: null,
  25. readString: '[SOURce:]CHANnel:OUTPut[:STATe]?',
  26. writeString: '[SOURce:]CHANnel:OUTPut[:STATe] <BOOL>',
  27. parameters: [{
  28. name: 'channel',
  29. values: ['CH1', 'CH2', 'CH3']
  30. }]
  31. }],
  32. parameters: [{
  33. name: 'channel',
  34. values: ['CH1', 'CH2', 'CH3']
  35. }],
  36. subsystems: []
  37. }]
  38. }
  39. const InstrumentsPage = props => (
  40. props.query && props.query.id
  41. ? <Instrument instrument={instrument} />
  42. : <InstrumentList />
  43. )
  44. InstrumentsPage.getInitialProps = ({ query }) => {
  45. return { query }
  46. }
  47. export default InstrumentsPage