-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
514403a
commit 6b103be
Showing
18 changed files
with
412 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
Many if not all of the functions detailed in this API are really just convenience functions wrapped around methods in the [`ODBC.jl`](https://github.com/JuliaDB/ODBC.jl) package, with some syntax specific to how we have set up our databases. | ||
|
||
|
||
Often a `dsn` argument is requested. You can provide `ICDataServer.dsn`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
|
||
Several configuration files should be generated and put into the `deps` directory of the ICDataServer package. These are not tracked by git as they may contain sensitive information and in any case are specific to the particular installation. These are used by [`ICDataServer.setuptables`](config.md#ICDataServer.setuptables) to add default information. | ||
|
||
<a id='ICDataServer.setuptables' href='#ICDataServer.setuptables'>#</a> | ||
**`ICDataServer.setuptables`** — *Function*. | ||
|
||
|
||
|
||
``` | ||
setuptables() | ||
``` | ||
|
||
Initialize a database with the tables needed to run ICDataServer: | ||
|
||
* `users` | ||
* `servers` | ||
* `instrumentkinds` | ||
* `instruments` | ||
* `jobs` | ||
* `notes` | ||
|
||
The creation of the tables can proceed without additional input, but in some cases it may make sense for the tables to be automatically filled with data. | ||
|
||
If new instrument kinds are added to `deps/instrumentkinds.json`, they will be added to `instrumentkinds` table. If kinds are encountered in the database that are not in the file, they remain in the database and are not deleted. | ||
|
||
If new users are added to `deps/users.json`, they will be "upserted" into the `users` table (users are created if necessary; if an existing user name is attempted to be inserted into the table, then that user has their info updated from the json file). Existing users not found in users.json remain in the table. | ||
|
||
|
||
<a target='_blank' href='https://github.com/PainterQubits/ICDataServer.jl/tree/514403a46b775984394168023f072cf132e1384b/src/setup.jl#L1-L25' class='documenter-source'>source</a><br> | ||
|
||
|
||
<a id='deps/config.json-1'></a> | ||
|
||
### deps/config.json | ||
|
||
|
||
This JSON file consists of up to four keys and largely exists to provide connection information between the database and InstrumentControl clients. Typical example: | ||
|
||
|
||
``` | ||
{ | ||
"jobsock":"tcp://*:50001", | ||
"dsn":"icdataserver", | ||
} | ||
``` | ||
|
||
|
||
Additional fields not shown in the example may include: | ||
|
||
|
||
* "username": A username to connect to the database, if not provided when the DSN was configured. | ||
* "password": A password to connect to the database, if not provided when the DSN was configured. | ||
|
||
|
||
<a id='deps/instrumentkinds.json-1'></a> | ||
|
||
### deps/instrumentkinds.json | ||
|
||
|
||
This JSON file declares the various kinds of instruments. Its purpose is to standardize such declarations in the database. Typical example: | ||
|
||
|
||
``` | ||
{ | ||
"kind": [ | ||
"awg", | ||
"dcsource", | ||
"rfsource", | ||
"vna" | ||
] | ||
} | ||
``` | ||
|
||
|
||
<a id='deps/servers.json-1'></a> | ||
|
||
### deps/servers.json | ||
|
||
|
||
Declaration of servers. Typical example: | ||
|
||
|
||
``` | ||
{ | ||
"servers": [ | ||
{ | ||
"alias":"local_data", | ||
"address":"127.0.0.1", | ||
"port":"50002" | ||
}, | ||
{ | ||
"alias":"local_hw", | ||
"address":"127.0.0.1", | ||
"port":"50003" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
|
||
<a id='deps/users.json-1'></a> | ||
|
||
### deps/users.json | ||
|
||
|
||
Declaration of users, including contact information which may be used by the software to send alerts and notifications. Typical example: | ||
|
||
|
||
``` | ||
{ | ||
"users": [ | ||
{ | ||
"username":"default", | ||
"first":"No", | ||
"last":"Name" | ||
}, { | ||
"username":"anotheruser", | ||
"first":"Really", | ||
"middle":"No", | ||
"last":"Name", | ||
"email":"[email protected]", | ||
"phone":"15555551212", | ||
"office":"Watson 5th floor" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
|
||
The only required fields for each dictionary are `username`, `first`, `last`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
|
||
<a id='Design-1'></a> | ||
|
||
## Design | ||
|
||
|
||
ICDataServer.jl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,56 @@ | ||
<a id='ICDataServer.newuser' href='#ICDataServer.newuser'>#</a> | ||
**`ICDataServer.newuser`** — *Function*. | ||
|
||
<a id='Users-1'></a> | ||
|
||
## Users | ||
|
||
``` | ||
newuser(dsn, username, name; email="", phone="", office="") | ||
``` | ||
|
||
This function creates a new user in the `users` table of the database. E-mail, phone, office are useful for contacting users about their measurements. | ||
|
||
|
||
<a target='_blank' href='https://github.com/PainterQubits/ICDataServer.jl/tree/514403a46b775984394168023f072cf132e1384b/src/users.jl#L1-L8' class='documenter-source'>source</a><br> | ||
|
||
<a id='ICDataServer.updateuser' href='#ICDataServer.updateuser'>#</a> | ||
**`ICDataServer.updateuser`** — *Function*. | ||
|
||
|
||
|
||
``` | ||
newuser | ||
updateuser | ||
deleteuser | ||
listusers | ||
updateuser(dsn, username; kwargs...) | ||
``` | ||
|
||
Update an existing user in the `users` table, identified by `username`. Specify the fields to update with keyword arguments specified in [`ICDataServer.newuser`](users.md#ICDataServer.newuser). | ||
|
||
|
||
<a target='_blank' href='https://github.com/PainterQubits/ICDataServer.jl/tree/514403a46b775984394168023f072cf132e1384b/src/users.jl#L30-L38' class='documenter-source'>source</a><br> | ||
|
||
<a id='ICDataServer.deleteuser' href='#ICDataServer.deleteuser'>#</a> | ||
**`ICDataServer.deleteuser`** — *Function*. | ||
|
||
|
||
|
||
``` | ||
deleteuser(dsn, username) | ||
``` | ||
|
||
Delete a user from the `users` table by providing the username. | ||
|
||
|
||
<a target='_blank' href='https://github.com/PainterQubits/ICDataServer.jl/tree/514403a46b775984394168023f072cf132e1384b/src/users.jl#L47-L53' class='documenter-source'>source</a><br> | ||
|
||
<a id='ICDataServer.listusers' href='#ICDataServer.listusers'>#</a> | ||
**`ICDataServer.listusers`** — *Function*. | ||
|
||
|
||
|
||
``` | ||
listusers(dsn) | ||
``` | ||
|
||
List all users in the `users` table. | ||
|
||
|
||
<a target='_blank' href='https://github.com/PainterQubits/ICDataServer.jl/tree/514403a46b775984394168023f072cf132e1384b/src/users.jl#L58-L64' class='documenter-source'>source</a><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.