Jelajahi Sumber

Initial checkin of project structure.

Tomi Cvetic 8 tahun lalu
melakukan
106676a859

+ 18 - 0
.gitignore

@@ -0,0 +1,18 @@
+# See https://help.github.com/ignore-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+.DS_Store
+.env
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+

+ 272 - 0
IDEAS.txt

@@ -0,0 +1,272 @@
+Implementation
+==============
+- VirtualEnv distribution to PCs
+- Devices stored in database
+- GUI from web server
+- Scripts stored in revision control system
+- Measurement stored in MySQL database and/or local SQLite database
+- Measurement convertible to CSV, Excel and Matlab
+
+
+Components
+==========
+* Device control
+  - Find devices
+  - Connect to devices
+  - Initialize devices
+  - Control devices
+  - Observe devices/external changes
+* Administration
+  - Project management
+    - Add/remove Projects
+    - Change meta data
+  - DUT management
+    - Add/remove DUTs
+    - Change meta data
+    - Add/remove versions
+    - Add/remove blocks
+  - Part management
+    - Add/remove parts
+    - Change meta data
+  - Device management
+    - Add/remove devices
+    - Add/remove device parameters
+* Setup control
+  - Select project
+  - Select DUTs
+  - Select parts
+  - Manage connections
+* Log control
+  - Add/remove logs
+  - Inspect entries
+* Measurement control
+  - Add/remove parameters
+  - Add/remove loops
+  - Order loops
+  - Create functions
+  - Keep history
+  - Record/Replay actions
+  - Add/remove breakpoints
+
+
+Driver
+======
+
+
+IDEAL MEASUREMENT
+=================
+- reproducible
+- well documented
+- clear and complete results
+* Log project/version (Dom revA), operator's name (tcve)
+* Log Lab PCs (lemming 2341:0C21:23AD0:18DC)
+* Start software, log version of all tools (SVN version 54123)
+* Log date/time/temperature/location of environment (13.07.2013, 08:15, 27.2°C, Thalwil)
+* Take devices, log SNs (if any), initialize them to a defined setting. (Keithley 2602B #213-43523, Rohde&Schwarz FSP, Char'board 1274)
+* Take components, log SN if possible (Katja, Lab PCB).
+* Mark the DUT (Dom).
+* Note connections between devices and components (Katja/3.3V->Char'board/VDD_CON)
+* Take a picture of the setup and save/log it.
+* Log anything else worth noticing (the clouds are fluffy)
+
+* Change a parameter (set Keithley mode to voltage source, apply 1.2V to channel A, turn on channel A).
+* Log the change device/time/previous/current and allow UNDO
+
+* Change a connection (connect FSP/RFin to Char'board/DAC_I)
+* Log the change connection/time/previous/current and allow UNDO
+
+* Measure a parameter (get Dom LPF bandwidth setting)
+* Log the time/value
+
+* Mark parameters to be saved for measurement loops.
+* Mark parameters/connections to be set for measurement loops.
+* Set ranges for loop set parameters.
+* Create measurement database with set and get parameters and save loop results there.
+* Log measurements time, measurement id, set and get parameters.
+
+FLOW
+====
+- Log in
+- Work on project (-> Measurement)
+  - Select project, version
+  - Select measurement
+  - Select devices and DUTs
+  - Select components
+  - Select connections
+  - Take a picture
+  - Take additional notes
+  - Name measurement
+- 
+
+
+
+FEATURES
+========
+- web based GUI
+- shell access to devices, measurement and log tasks
+- scripts saved and executable with Python
+- move measurements from local machine to server
+
+
+WHAT IS NOT COVERED YET
+========================
+- complex parameters (frequency setting in Dom from dividers)
+
+
+WHAT IS NOT SOLVED YET
+======================
+- parameter constraints
+
+
+
+
+
+
+
+
+
+Database
+========
+
+Project 				(Dom)						(Matterhorn AC)
+- ID/Name/Description	Dom/Multichannel GNSS		MA_AC/Analog Companion for Matterhorn Baseband
+-> Version
+-> Blocks
+-> Characterization
+-> DUT
+
+Version
+- ID/Name/Description	revA-FIB3/eFuse FIB rev. A	MPW0723/MPW Release 0723
+-> Project
+
+Block
+- ID/Name/Description	RF/RF Receiver				PMU/Power Management Unit
+-> Project											
+
+Characterization (IF Amplifier)
+- ID/Name/Description	RF Power					LDO Stability
+-> Project				
+-> Version
+-> Blocks
+-> Measurement
+
+DUT
+- ID/Name/Description	Dom M8030					MA_AC Horny
+- Serial number			ID2073						ID3211
+-> Project
+-> Version
+
+Component				(Katja A)					(Resistor)
+- ID/Name/Description	Katja Char-Board			470 kOhm						
+- Serial number			ID431
+-> Notes
+
+Component Notes
+- ID
+- Title					Changed Relais
+- Text					Relais was broken.					
+-> Author
+
+Setup
+- ID/Name/Description	Setup for IF amp char
+-> Components			
+-> Devices
+-> Connections
+
+Setup Meta
+- ID/Name
+-> Setup
+- Key
+- Value
+==> Photo
+
+Connection
+- ID/Name
+-> Setup
+- From part 			Dom V_CORE 					Dom XTAL_IN
+- To part				Katja A 3V3					TCXO XTAL_IN
+- Connector				Wire						Cut
+- Comment											Need to Program eFuse
+
+Log
+- ID
+- Time
+- Source
+- Event
+
+Measurement
+- ID/Name/Description
+- DUT
+- Log
+- Operator (Login for the Characterization Center)
+- Start Date/Time
+- Machine/MAC, IP
+- Script/Version
+-> Characterization
+-> Setup
+
+Device					(Bitfield)						(SCPI)
+- ID/Name/Description	Dom RF I2C						FSP-3
+-> Parameters			
+-> Variables
+-> Groups
+-> Settings
+-> Defaults
+
+Device Meta
+- ID/Name				
+-> Device
+- Key
+- Value
+==> Photo, Manual
+
+Parameter				(Bitfield)						(SCPI)			
+- ID/Name/Description	d_ifa/IF Amp Bias				marknoise/Noise Marker
+- Device				ID(RFI2C)						ID(FSP-3)
+- Type					Integer							List
+- Constraints			0:15							"ON, OFF"
+- Value (not in DB)
+
+Parameter Meta			(Bitfield)						(SCPI)	
+- ID/Name				bitfield_position				scpi_read_command
+-> Parameter			ID(d_ifa)						ID(marknoise)
+- Value					"20,19,18,14"					"CALC:MARK{marker}:FUNC:NOIS?"
+==> read_only, scpi_id, ...
+
+Variable				(Bitfield)						(SCPI)
+- ID/name				bitfield_subfield				scpi_variable
+- Device				ID(RFI2C)						ID(FSP-3)
+- Name					"Register Bank"					"Marker"
+- Type					Integer							String
+- Constraints			1:2								"A,B,C,D"
+
+Group					(Bitfield)						(SCPI)
+- ID/Name/Description	if_amp/IF Amplifier Settings	freq/Frequency
+- Parameters			{en_ifa,d_ifa,ifa_amp}			{startfreq,stopfreq,centfreq,fspan}
+
+
+Constraints (Plugin)
+- Name
+- Check function
+- (De-)Serialization function
+
+Type (Plugin)
+- ID/Name/Description
+- Check function
+- (De-)Serialization function
+
+Loop
+- ID
+- Parent loop
+- Loop variable
+- Loop values
+
+Result
+- ID
+- Measurement
+- Date/Time
+- Settings
+
+Value
+- ID
+- Result

+ 210 - 0
notes.txt

@@ -0,0 +1,210 @@
+Reference:
+! = Mandatory
+* = Optional
+- = Flexible
+% = Function/Method
+
+Instrument incl. DUTs
+=====================
+! <id>
+! syntax
+* name
+* description
+* picture
+* manual
+- parameters
+- variables
+- groups
+- exclusions
+- organization (bitfield)
+
+% getParameter
+% setParameter
+% saveState
+% loadState
+% loadDefault
+% <dynamic functions for all settings>
+
+Parameter
+=========
+! <id>
+! setValue
+! getValue
+* <type> (setting, compound, variable)
+* valueList
+* defaults
+* states
+* constraints
+* variables
+* plugin:
+- aliases
+- getCommand/setCommand
+  * code
+- getArguments/getArguments
+- scope
+- name
+- description
+- bits
+
+
+Group
+=====
+! id
+* parameters
+* groups
+- name
+- description
+
+Setup
+=====
+! <id>
+* instruments
+* parts
+* software
+* connections
+* jumpers
+* docs (datasheets/schematics etc)
+- name
+- description
+- time
+- photo
+- dut
+
+Measurement
+===========
+! <id>
+* instruments
+* operator
+- name
+- description
+- instruments {nr, &ref, autopoll, autowrite}
+- setup
+- results
+- sequence
+- script
+- session
+
+* start
+* stop
+* pause
+* plotResults
+* generateScript
+
+Parameter
+=========
+- name
+- description
+- value/sweep
+- function
+
+Session
+=======
+- log
+- history
+* log
+* addHistory
+
+Result
+======
+- time
+- parameter
+- value
+
+GUI
+===
+{Instruments}
+* addInstrument
+* removeInstrument
+{DUT}
+* addDUT
+* removeDUT
+
+
+
+
+Open points:
+============
+- Directory structure (what is local, what is in SVN, how are measurements separated)?
+- How is a session defined exactly?
+- How are measurement results saved and loaded?
+- Meta data in order to search and load measurements and results?
+- SQL database for results?
+- How to implement concurrent measurements?
+- What are useful triggers (time, parameter, ...)?
+
+Database Structure for Measurements:
+====================================
+- *ID
+- Description (e.g. IF amplifier gain variation over supply and temperature.)
+- *Start Date/Time
+- Operator
+- Department (e.g. Chipset)
+- Project (e.g. Dom Analog)
+- Measured DUT (e.g. Characterization Board 639)
+- Measured Target (IF Amplifier)
+- *Measured Parameters (e.g. temperature, vddio, vddc, i_vddio)
+- *Measurement ZIP
+* = Automatically added.
+
+Setup Phase:
+============
+- Start with reset instruments (loading a configuration is possible later).
+- Allow adjustments via GUI and via instrument panel (scan for changed parameters).
+  => Log all changes.
+- Allow to save states at all times.
+- Provide a record button, which starts the measurement setup.
+- In record mode: Provide means to select loop variables and recorded values.
+- Allow to select x/y-Axis and group results.
+
+Before Measurement:
+===================
+- Name the measurement.
+- Verify, that all necessary data is present (DUT, image, description)
+- Verify, that all scripts and instrument definitions are checked in and all is up to date.
+- Start a separate measurement log.
+- Save and check in the measurement setup file, which can be loaded again.
+
+Measurement:
+============
+- Write data to a file.
+- Visualize data in real-time.
+
+After Measurement:
+==================
+- Provide possibility to change necessary data as DUT, image, description etc.
+- Provide tools to reshape the data (set x/y-Axis, choose shown columns etc, filter data). -> Like Pivot-Table in Excel.
+- Allow exporting selected data to CSV.
+- Show data for copy & paste into Python, Matlab and Excel (maybe a format string?)
+- Allow to combine measurements (e.g. set different voltage/temperature by hand).
+  => Allow to set user-defined variables after the measurement. 
+- Ask to check in the results (zip the files).
+
+
+Hooks
+=====
+* plugins_loaded
+* user_authenticated
+* setup_theme
+* init
+* cc_loaded
+
+Plugins (must load)
+=======
+* Measurement
+* Intruments
+* Data types
+
+Database stucture
+=================
+* char (Characterization)
+  - ID, name
+* char_meta (Characterization meta data)
+  - ID, char, key, value
+* meas (Measurement)
+* meas_meta
+* value
+* value_meta
+
+* conf (Configuration)
+  - ID, meas, dev, key, value
+* conf_meta

+ 25 - 0
package.json

@@ -0,0 +1,25 @@
+{
+  "name": "AutoMate",
+  "version": "0.1.0",
+  "private": true,
+  "dependencies": {
+    "lodash": "4.17.4",
+    "react": "15.4.2",
+    "react-dom": "15.4.2",
+    "react-redux": "5.0.3",
+    "react-router": "3.0.2",
+    "react-router-redux": "4.0.8",
+    "redux": "3.6.0",
+    "reselect": "2.5.4"
+  },
+  "devDependencies": {
+    "flow-bin": "0.41.0",
+    "react-scripts": "0.9.4"
+  },
+  "scripts": {
+    "start": "react-scripts start",
+    "build": "react-scripts build",
+    "test": "react-scripts test --env=jsdom",
+    "eject": "react-scripts eject"
+  }
+}

TEMPAT SAMPAH
public/favicon.ico


+ 31 - 0
public/index.html

@@ -0,0 +1,31 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
+    <!--
+      Notice the use of %PUBLIC_URL% in the tag above.
+      It will be replaced with the URL of the `public` folder during the build.
+      Only files inside the `public` folder can be referenced from the HTML.
+
+      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
+      work correctly both with client-side routing and a non-root public URL.
+      Learn how to configure a non-root public URL by running `npm run build`.
+    -->
+    <title>React App</title>
+  </head>
+  <body>
+    <div id="root"></div>
+    <!--
+      This HTML file is a template.
+      If you open it directly in the browser, you will see an empty page.
+
+      You can add webfonts, meta tags, or analytics to this file.
+      The build step will place the bundled scripts into the <body> tag.
+
+      To begin the development, run `npm start`.
+      To create a production bundle, use `npm run build`.
+    -->
+  </body>
+</html>

+ 24 - 0
src/App.css

@@ -0,0 +1,24 @@
+.App {
+  text-align: center;
+}
+
+.App-logo {
+  animation: App-logo-spin infinite 20s linear;
+  height: 80px;
+}
+
+.App-header {
+  background-color: #222;
+  height: 150px;
+  padding: 20px;
+  color: white;
+}
+
+.App-intro {
+  font-size: large;
+}
+
+@keyframes App-logo-spin {
+  from { transform: rotate(0deg); }
+  to { transform: rotate(360deg); }
+}

+ 21 - 0
src/App.js

@@ -0,0 +1,21 @@
+import React, { Component } from 'react';
+import logo from './logo.svg';
+import './App.css';
+
+class App extends Component {
+  render() {
+    return (
+      <div className="App">
+        <div className="App-header">
+          <img src={logo} className="App-logo" alt="logo" />
+          <h2>Welcome to React</h2>
+        </div>
+        <p className="App-intro">
+          To get started, edit <code>src/App.js</code> and save to reload.
+        </p>
+      </div>
+    );
+  }
+}
+
+export default App;

+ 8 - 0
src/App.test.js

@@ -0,0 +1,8 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import App from './App';
+
+it('renders without crashing', () => {
+  const div = document.createElement('div');
+  ReactDOM.render(<App />, div);
+});

+ 0 - 0
src/bitfield/components/CreateBitfield.js


+ 0 - 0
src/bitfield/components/EditBitfield.js


+ 0 - 0
src/bitfield/components/ShowBitfield.js


+ 0 - 0
src/bitfield/helpers.js


+ 0 - 0
src/bitfield/index.js


+ 0 - 0
src/bitfield/state.js


+ 5 - 0
src/index.css

@@ -0,0 +1,5 @@
+body {
+  margin: 0;
+  padding: 0;
+  font-family: sans-serif;
+}

+ 9 - 0
src/index.js

@@ -0,0 +1,9 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import App from './App';
+import './index.css';
+
+ReactDOM.render(
+  <App />,
+  document.getElementById('root')
+);

File diff ditekan karena terlalu besar
+ 2 - 0
src/logo.svg


+ 0 - 0
src/measurement/components


+ 20 - 0
src/measurement/index.js

@@ -0,0 +1,20 @@
+/**
+ * index.js
+ **/
+
+const measurementPoint = (sequenceNumber, requestTime, receiveTime, value, unit) => ({
+  sequenceNumber,
+  requestTime,
+  receiveTime,
+  value
+})
+
+const measurement = (
+    measurementId,
+    instruments = [],
+    measurementPoints = [],
+  ) => ({
+    measurementId,
+    instruments,
+    measurementPoints
+  })

+ 0 - 0
src/project/ListProjects.js


+ 13 - 0
src/project/components/AddProjectForm.js

@@ -0,0 +1,13 @@
+import { Component } from 'react'
+
+class AddProjectForm extends Component {
+  render() {
+    return (
+      <form>
+        <input type='text' ref='{input => this.projectName}' placeholder='Project Name' />
+        <text type='text' ref='{input => this.projectDesc}' placeholder='Project Description' />
+      </form>
+    )
+  }
+}
+

+ 0 - 0
src/project/components/CreateProject.js


+ 0 - 0
src/project/components/EditProject.js


+ 0 - 0
src/project/components/ShowProject.js


+ 8 - 0
src/project/constants.js

@@ -0,0 +1,8 @@
+/*
+ * constants.js
+ *
+ * Collection of all constants used in the component.
+ * Also define 'name' which is used to identify the component.
+ **/
+
+export const NAME = 'project'

+ 36 - 0
src/project/index.js

@@ -0,0 +1,36 @@
+/**
+ * index.js
+ *
+ * If you need this component, import the default exports
+ * in this file. It gives you a reference for everything
+ * needed to interact with it.
+ **/
+
+import * as constants from './constants'
+import { actions, reducer } from './state'
+import * as components from './components'
+import { createSelector } from 'reselect'
+import { NAME } from './constants'
+import _ from 'lodash'
+
+const filters = {
+  all: projects => projects.filter(p => projects.active)
+}
+
+const selectors = {
+  getAll: state => state[constants.NAME],
+  getActive: () => return [],
+}
+
+/*export const getAll = state => state[NAME]
+export const getActive = _.compose(filterActive, getAll)
+export const getCounts = createSelector(
+    getAll,
+    getActive,
+    (allProjects, activeProjects) => ({
+      all: allProjects.length,
+      active: activeProjects.length
+    })
+)*/
+
+export default { actions, constants, components, filters, selectors, reducer }

+ 88 - 0
src/project/state.js

@@ -0,0 +1,88 @@
+/**
+ * state.js
+ *
+ * Collection of everything which has to do with state changes.
+ * - actionTypes
+ * - actions
+ **/
+
+import NAME from './constants'
+import { call, put, takeEvery } from 'redux-saga/effects'
+
+/** actionTypes define what actions are handeled by the reducer. */
+const actionTypes = {
+  CREATE_REQ: `${NAME}/CREATE_REQ`,
+  UPDATE_REQ: `${NAME}/UPDATE_REQ`,
+  DELETE_REQ: `${NAME}/DELETE_REQ`
+}
+
+/** actions is an object with references to all action creators */
+function create (project) {
+  return {
+    type: actionTypes.CREATE_REQ,
+    project
+  }
+}
+
+function update (projectId, project) {
+  return {
+    type: actionTypes.UPDATE_REQ,
+    projectId,
+    project
+  }
+}
+
+function remove (projectId) {
+  return {
+    type: actionTypes.REMOVE_REQ,
+    projectId
+  }
+}
+const actions = { create, update, remove }
+
+/** reducer is called by the redux dispatcher and handles all component actions */
+function reducer (state = {}, action) {
+  switch (action.type) {
+    case actionTypes.CREATE:
+      return {
+        ...state,
+        [action.project.projectId]: action.project
+      }
+    case actionTypes.UPDATE:
+      return {
+        ...state,
+        [action.projectId]: action.project
+      }
+    case actionTypes.REMOVE:
+      return {
+        ...state,
+        [action.projectId]: null
+      }
+    default:
+      return state
+  }
+}
+
+/** sagas are asynchronous workers (JS generators) to handle the state. */
+// Worker
+export function * incrementAsync () {
+  try {
+    const data = yield call(Api.isIncrementOk)
+    yield put({ type: 'INCREMENT_SUCCESS', data })
+  } catch (error) {
+    yield put({ type: 'INCREMENT_FAIL', error})
+  }
+}
+
+// Watcher (intercepts INCREMENT_REQUEST, dispatches INCREMENT_SUCCESS or INCREMENT_FAIL in return.)
+export function * watchIncrementAsync () {
+  yield takeEvery('INCREMENT_REQUEST', incrementAsync)
+}
+
+// export all sagas in parallel
+function * sagas () {
+  yield takeEvery('INCREMENT_REQUEST')
+  yield takeEvery('DECREMENT_REQUEST')
+}
+
+export default { actionTypes, actions, reducer, sagas }

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini