feat: Add comprehensive study management system to dashboard
Added full study configuration UI: - Create studies with isolated folder structure (sim/, results/, config.json) - File management: users drop .sim/.prt files into study's sim folder - NX expression extraction: journal script to explore .sim file - Configuration UI for design variables, objectives, and constraints - Save/load study configurations through API - Step-by-step workflow: create → add files → explore → configure → run Backend API (app.py): - POST /api/study/create - Create new study with folder structure - GET /api/study/<name>/sim/files - List files in sim folder - POST /api/study/<name>/explore - Extract expressions from .sim file - GET/POST /api/study/<name>/config - Load/save study configuration Frontend: - New study configuration view with 5-step wizard - Modal for creating new studies - Expression explorer with clickable selection - Dynamic forms for variables/objectives/constraints - Professional styling with config cards NX Integration: - extract_expressions.py journal script - Scans .sim and all loaded .prt files - Identifies potential design variable candidates - Exports expressions with values, formulas, units Each study is self-contained with its own geometry files and config.
This commit is contained in:
@@ -49,10 +49,10 @@
|
||||
<!-- Welcome Screen -->
|
||||
<div id="welcomeScreen" class="welcome-screen">
|
||||
<h2>Welcome to Atomizer</h2>
|
||||
<p>Select a study from the sidebar or start a new optimization</p>
|
||||
<p>Select a study from the sidebar or create a new study</p>
|
||||
<div class="quick-actions">
|
||||
<button class="btn btn-large btn-primary" onclick="showNewOptimizationModal()">
|
||||
Start New Optimization
|
||||
<button class="btn btn-large btn-primary" onclick="showCreateStudyModal()">
|
||||
Create New Study
|
||||
</button>
|
||||
<button class="btn btn-large btn-secondary" onclick="refreshStudies()">
|
||||
View Existing Studies
|
||||
@@ -60,6 +60,104 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Study Configuration View -->
|
||||
<div id="studyConfig" class="study-config" style="display: none;">
|
||||
<div class="study-header">
|
||||
<div>
|
||||
<h2 id="configStudyTitle">Configure Study</h2>
|
||||
<p id="configStudyMeta" class="study-meta"></p>
|
||||
</div>
|
||||
<div class="study-actions">
|
||||
<button class="btn btn-secondary" onclick="backToStudyList()">
|
||||
← Back
|
||||
</button>
|
||||
<button class="btn btn-primary" onclick="saveStudyConfiguration()">
|
||||
💾 Save Configuration
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Configuration Steps -->
|
||||
<div class="config-steps">
|
||||
<!-- Step 1: Sim Files -->
|
||||
<div class="config-step">
|
||||
<h3>1. Simulation Files</h3>
|
||||
<div class="step-content">
|
||||
<p class="step-description">Drop your .sim and .prt files in the sim folder, then explore the model</p>
|
||||
<div class="file-info">
|
||||
<p><strong>Sim Folder:</strong> <span id="simFolderPath"></span></p>
|
||||
<button class="btn btn-secondary" onclick="openSimFolder()">Open Folder</button>
|
||||
<button class="btn btn-primary" onclick="refreshSimFiles()">Refresh Files</button>
|
||||
</div>
|
||||
<div id="simFilesList" class="files-list"></div>
|
||||
<button id="exploreBtn" class="btn btn-primary" onclick="exploreSimFile()" disabled>
|
||||
🔍 Explore .sim File
|
||||
</button>
|
||||
<div id="expressionsList" class="expressions-list" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 2: Design Variables -->
|
||||
<div class="config-step">
|
||||
<h3>2. Design Variables</h3>
|
||||
<div class="step-content">
|
||||
<p class="step-description">Select expressions to use as design variables and set their bounds</p>
|
||||
<div id="designVariablesConfig" class="variables-config">
|
||||
<p class="empty">Explore .sim file first to see available expressions</p>
|
||||
</div>
|
||||
<button class="btn btn-secondary" onclick="addDesignVariable()">+ Add Variable</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 3: Objectives -->
|
||||
<div class="config-step">
|
||||
<h3>3. Objectives</h3>
|
||||
<div class="step-content">
|
||||
<p class="step-description">Define what you want to optimize (minimize or maximize)</p>
|
||||
<div id="objectivesConfig" class="objectives-config">
|
||||
<p class="empty">No objectives defined yet</p>
|
||||
</div>
|
||||
<button class="btn btn-secondary" onclick="addObjective()">+ Add Objective</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 4: Constraints -->
|
||||
<div class="config-step">
|
||||
<h3>4. Constraints</h3>
|
||||
<div class="step-content">
|
||||
<p class="step-description">Set limits on simulation outputs</p>
|
||||
<div id="constraintsConfig" class="constraints-config">
|
||||
<p class="empty">No constraints defined yet</p>
|
||||
</div>
|
||||
<button class="btn btn-secondary" onclick="addConstraint()">+ Add Constraint</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 5: Optimization Settings -->
|
||||
<div class="config-step">
|
||||
<h3>5. Optimization Settings</h3>
|
||||
<div class="step-content">
|
||||
<div class="form-group">
|
||||
<label>Number of Trials</label>
|
||||
<input type="number" id="nTrials" value="50" min="1">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Sampler</label>
|
||||
<select id="samplerType">
|
||||
<option value="TPE" selected>TPE (Tree-structured Parzen Estimator)</option>
|
||||
<option value="CMAES">CMA-ES</option>
|
||||
<option value="GP">Gaussian Process</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Startup Trials (random exploration)</label>
|
||||
<input type="number" id="startupTrials" value="20" min="0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Study Details View -->
|
||||
<div id="studyDetails" class="study-details" style="display: none;">
|
||||
<div class="study-header">
|
||||
@@ -179,6 +277,31 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Create Study Modal -->
|
||||
<div id="createStudyModal" class="modal" style="display: none;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>Create New Study</h2>
|
||||
<button class="close-btn" onclick="closeCreateStudyModal()">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Study Name</label>
|
||||
<input type="text" id="createStudyName" placeholder="my_optimization_study" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Description (optional)</label>
|
||||
<input type="text" id="createStudyDescription" placeholder="Brief description of this study" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" onclick="closeCreateStudyModal()">Cancel</button>
|
||||
<button class="btn btn-primary" onclick="createNewStudy()">Create Study</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="app.js"></script>
|
||||
<script src="study_config.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user