This repository maintains a software used to control physical experiments related to very cold molecules and atoms.
TODO A short description of the main features of this software should be placed here
The features of this software are documented in the Wiki.
In this section, various information for end-users are provided.
Please consider the following prerequisits before installing CPECS.
7200
and 7205
must be available (to receive errors over the network, e.g., from python scripts)Issues
tab.New Issue
.Bug report
.Issues
tab.New Issue
.Feature request
.Please use the Wiki.
If you are a member of the coldphysics organization, you can obtain released installers from this private repository. Details about all releases can be found here.
Alternatively, you will need to build the code and create an installer yourself (see the developer information below).
The application can create entries in a database that correspond to the variables and other aspects of each cycle being executed. CPECS is programmed to communicate with a MySql database management system instance. The application uses password authentication (SSL is not supported). CPECS stores its entries in a table with the following schema (the name of the database, the server, and the table are arbitrary and can be configured from the user profiles):
Column Name | Data Type | Description |
---|---|---|
globalCounter |
VARCHAR |
The value of the global counter of the cycle. |
startTime |
DATETIME |
The datetime at which the current cycle started. |
startCounterOfScans |
VARCHAR |
The value of the global counter when the current set of cycles started, e.g., when the user clicked on Start |
iterationOfScan |
VARCHAR |
The value of the current iteration whithin the current set of cycles. |
completedScans |
VARCHAR |
The number of times the whole set of iterator variables reached their final values, i.e, the number of complete scans. |
numberOfIterations |
VARCHAR |
The total number of iterations for the current scan. |
Variables |
VARCHAR |
A comma-separated list of key-value pairs each corresponding to a user-defined variable of any kind (static, iterator, dynamic). The list also contains some other key-value pairs such as the cycle duration. |
iterators |
VARCHAR |
A comma-separated list of key-value pairs each corresponding to a user-defined iterator variable. |
operatingMode |
VARCHAR |
'0' : static mode, '1' : iterating mode, '2' : measurement routine mode |
startCounterOfRoutine |
VARCHAR |
If in routine mode: the value of the global counter when the routine started. |
modelNumber |
VARCHAR |
If in routine mode: the 0-based index of the current model within the measurement routine. |
routineArray |
VARCHAR |
If in routine mode: a comma-separated list of the contents of the routineArray used to get messages in/and out of the measurement routine script. |
In the active user profile, you can specifiy whther or not to store entries to this table, and how to connect to it.
You can also test the connection parameters from the user profiles UI.
For new experiments, the option Use Legacy Database Structure
should always be unticked.
In this section, various information for developers are provided.
ADwin.Driver.dll
- Version: 1.059NationalInstruments.Common.dll
- Version: 9.1.40.159NationalInstruments.Common.Native.dll
- Version: 9.1.40.159NationalInstruments.DAQmx.dll
- Version: 9.4.40.50NationalInstruments.Common.dll
- Version: 9.1.40.159NationalInstruments.MStudioCLM.dll
- Version: 15.1.40.49152NationalInstruments.NiLmClientDLL
- Version: 15.1.40.49152Documentation
project recognized by visual studio, you must install Sandcastle Help File Builder and Tools. The latest release that still supports Visual Studio 2013 can be obtained here.This section describes general recommendations and hints regarding the programming of this application:
Controller
project.DataTempaltes
in the App.xaml
file of the MainProject
.Controller
project using the Controller.Common.WindowsHelper
class:
Window
types should be used.Window
classes can be implemented for special needs, e.g., changing default behaviour or appearance of standard Windows
.Microsoft.Xaml.Behaviors
package in order to trigger commands based on events. This is essential to allow removing the need of code-behindController.Common.FileHelper
.If not mentioned otherwise, the following howtos assume the usage of Microsoft Visual Studio as an IDE.
A set of DLLs have strict usage licenses that prevents providing access to them in a public repository. Nonetheless, they are required for the successful building and publishing of CPECS. To obtain these DLLs:
Make sure you obtain class libraries, i.e., dlls, that are compatible with the x64 architecture. see details here for NI dlls.
libs
at the root level of the cloned repository.MainProject\ComputerControl.sln
)MainProject
is set as the startup project: In the Solution Expolorer
window, right-click on the project, and select Set as Startup Project
.x64
(otherwise, memory-related exceptions will happen) Restore NuGet Packages
).F6
to start building the solution.Unit testing allows to make sure that existing application features are still functioning as expected despite newly introduced features. CPECS includes a set of unit tests that should be executed before any new release. To execute all unit tests in the solution follow these steps:
Test
menu button then Run>All Tests
, or simply use the key combination Ctrl+R,A
.Test Explorer
window run successfully, otherwise, fix the causing errors.MainProject
project and click on Properties
.Application
window click on Assembly Information
.Publish
Publish Version
to match the one you set for the assembly (also igonre the revision value by setting it to 0)Publish
window, click on Publish Wizard
v[version]
, e.g., v1.4.1
).github-changelog-generator
.github_changelog_generator -u coldphysics -p experiment-control
%HOMEPATH%\CHANGELOG.md
v1.4.0
.CPECS v1.4.0
)# Changelog
[Full Changelog](https://github.com/coldphysics/experiment-control/compare/v1.4.1...HEAD)
with
[Full Changelog](https://github.com/coldphysics/experiment-control/compare/v1.4.1...v1.4.2)
## [v1.4.1](https://github.com/coldphysics/experiment-control/tree/v1.4.1) (2020-07-09)
# Changelog
:
# Installer (requires membership in the [coldphysics organization](https://github.com/coldphysics))
[All installers can be downloaded here](https://github.com/coldphysics/releases/archive/master.zip).
After download, decompress the zip file, and navigate to the folder entitled [version].
# Notice
[Optionally add some further information here]
Publish Release
.The application uses basic C# XML serialization.
It is very important for future versions of the application to keep the compatibility for models created in older versions of the application, since they might be still in-use by some experiments.
However, introducing certain changes to the data model, i.e., classes of the Model
namespace, can cause the program to fail to deserialize older model files.
Therfore, when having to introduce such changes to the model, the following procedure must be used to maintain backward-compatibility of the application Before Actually Introduce Any Changes!:
Model
project with the name V[X]
where [X]
stands for the version number of the model before increasing it, e.g., if the current version is 5 and you want to bump it up to 6, the namespace would be Model.V5
. (Consult Model.Root.RootModel
class to figure out the current version).Model.BaseTypes
, Model.Root
, Model.Data
, and Model.Variables
.Model.V[x]
, instead of just Model
.Model.V1.Data.Card.CardBasicModel
uses Model.V1.Data.Channels
but not Model.Data.Channels
. For steps (3-4), a find-and-replace operation of 'Model'
with 'Model.V[X]'
could be helpful. Just ensure to apply it to the current folder, not all over the project!Model.Root.RootModel
class.V[X]
.Model.V[X].ModelConverter
. This class must allow the conversion of an old model into the new model. The conversion might be just syntactical, i.e., copying certain values from one property to anoter, or they could be semantical, e.g., splitting a property into multiple new ones, or changing the hierarchy of classes, etc. Consult existing converter classes for examples.ModelLoader
class:
ModelLoader
class inside the Controller.MainWindow
namespace.private const string V5_MODEL_XML_SCHEMA = "http://schemas.datacontract.org/2004/07/Model.V5";
ConvertModelVersionIfNecessary
.User profiles allow the user to select a collection of settings, e.g., hardware type, database connection, number of cards, etc. that correspond to their experiment.
User profiles are stored in the following folder %AppData%\Computer Control Profiles
.
When the data model of user profiles changes, e.g., new settings are added or removed, or the nesting of settings is changed, existing profiles need to be removed so that the application creates new ones that correspond to the new model (the whole folder needs to be removed).
The problem is that the user will lose any customizations made in the existing profiles, e.g., database connection information.
To avoid such loss, the user could copy the corresponding profile to some other folder, rename the extension from .profile
to .xml
and use an application like Visual Studio Code with an XML extension like XML Tools for Visual Studio Code and format the document to a human readable style.
Then, the user could remove the old profiles folder, start the application, and fill in the data in the new profile(s) using the content of the XML file of the old profile.