Remember: Always document your code
Using git
Git uses a local and a remote repository. The first step is to clone the remote repository to a local one. With the Visual Studio Git plugin, go to Team Explorer (if not visible: View->Team Explorer) and then to Connect. Choose 'Local Git Repositories-Clone' add 'git.code.sf.net/p/rkscope/code' as remote URL and a local directory (e.g. 'C:\Scope'). After that 'Scope' should be listed under the local repositories. Right-click and choose open. Please note that you still have to open the Visual Studio solution file 'scope.sln' for the project to be loaded into Visual Studio!
After you edited code go to the Team Explorer 'Home' page for Scope. A click on 'Changes' displays the changed files. Enter a commit message and 'Commit' the file changes to your local repository. A click on 'Commits' shows your recent commit under 'Outgoing Commits'. Click on 'Push' to push the commits from the local to the remote repository.
To preview what commits have been made in the local repository click 'Fetch'. To load these commits into your local repository click 'Pull'.
For in-depth information about git have a look at e.g. http://git-scm.com/book or http://www.vogella.com/articles/Git/article.html
Fixing something in an FPGA VI
If you want to change something small in one of the FPGA VIs, e.g. the AnalogDemultiplexer
- Open that Labview project and do the fix
- Recompile using the build specification. The bitfile will be saved into "C:\\Scope\\fpga_labview\\FPGA bitfiles" (this is hardwired into the build spec, Labview does not allow relative paths)
- Using the NI FPGA Interface C API Generator to generate a C header file. Copy the .h file and the .lvbitx file into "scope\\devices\\fpga"
- Recompile Scope
- Test and push a commit to Sourceforge
Implementing a new parameter
If you want to implement a new parameter, e.g. a boolean for using Pockels cell blanking during flyback:
Implementing a new frame scan mode
If you want to add something that changes scope::ScannerVectorFrameSaw a lot, implement your own frame scan mode by:
Implementing a new device
If you want to implement support for a new device, eg support for a different type of xyz stage:
- Derive a class from e.g. scope::XYZControl and overwrite the methods you need
- Have a look at scope::XYZControlGalil for how it is done there
- Be sure to implement correct error/exception handling
- Implement or derive a class with the exact same name but in namespace scope::parameters
- In ScopeDefines.h you can then set XYZCONTROL_T to you class name, parameters class will be set accordingly.
- There are diverse places where you will need to include your classes header file, you will easily find it out during compile.
Implementing a new FPGA mode
If you want to implement support for a new mode using an FPGA, e.g. with a new FlexRIO adapter card:
Uploading updated documentation
Although you can always build the newest code documentation using doxygen on your local computer updating Scope's website http://rkscope.sourceforge.net/index.html is a little more work. Doing it like this (with the zipped documentation) speeds up the upload tremendously.
- Build the local documentation. Zip the documentation/html folder.
- Using Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) log in to sourceforge's remote shell. Settings are: Hostname 'shell.sourceforge.net', Connections-Data-Auto-login username 'yoursourceforgeusername,rkscope' (yes with the comma, e.g. 'rkrueppel,rkscope'), Connection-SSH-Remote command 'create'
- Once the shell is created (can take a while) do 'cd /home/project-web/rkscope/htdocs' then delete the old documentation stuff in there (rm -R *)
- Then use e.g. WinSCP (http://www.winscp.net) to upload the documentation zip to sourceforge. Settings are: Protocol 'SFTP', Hostname 'web.sourceforge.net', User 'yoursourceforgeusername', Environment-Directories-Remote directory '/home/project-web/rkscope/htdocs'
- Again in the remote shell 'unzip html.zip' and then 'rm html.zip'.
- Voila! Point your browser to http://rkscope.sourceforge.net and refresh the page.