Development Setup
git branch
This section explains how to add or update modules for QGas.
Add Python Modules
- Add the package to
environment.ymlunderdependenciesor thepip:section. - Update your environment:
conda env update -f environment.yml- Activate with
conda activate QGas
- Verify the install by importing the module in Python.
Add JavaScript Modules
- Place the new module in
js/(or a subfolder likejs/ui/). - Import or reference it from the relevant entry file (usually
js/core.jsor a UI module). - Reload the browser (Ctrl+F5) to see changes.
Add Other Assets
- Images: place in
Images/(GUI) ordocs/assets/(docs) - Data: add to a project folder under
Input/
Set breakpoints in Server.py, then press F5 to start debugging.
JavaScript Debugging
Use browser developer tools:
- Open browser DevTools (F12)
- Go to Sources tab
- Find files under
localhost:8000/js/ - Set breakpoints by clicking line numbers
- Use Console tab for
console.log()output
Common Debugging Scenarios
Server Won't Start
- Check if port 8000 or 8001 is already in use
- Verify Conda environment is activated
- Check console for Python errors
Map Doesn't Load
- Ensure server is running (green LED in GUI)
- Check browser console for JavaScript errors
- Try hard refresh (Ctrl+F5)
Tool Not Working
- Check browser console for JavaScript errors
- Verify tool module is loaded in GUI.html
- Check if tool is properly registered in
tools.js
Making Changes
Adding a New Tool
- Create new file:
js/ui/tools/my_tool.js - Implement tool with activation/deactivation functions
- Add script tag in
GUI.html - Register in
js/ui/tools.jstool list - Add button in tools popup grid