Merge remote-tracking branch 'old-github/main' into integrate-old-refactors-of-github
This commit is contained in:
7
archive/management-dashboard-web-app/README.md
Normal file
7
archive/management-dashboard-web-app/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Archive: management-dashboard-web-app legacy/backup files
|
||||
|
||||
Moved from `management-dashboard-web-app/` so the app directory only contains active code and config.
|
||||
|
||||
- **env-backups/** – Old `.env.backup` and timestamped backup (Supabase URL/key). Keep out of version control if they contain secrets.
|
||||
- **experiment-data/** – CSV run sheets: `phase_2_JC_experimental_run_sheet.csv`, `post_workshop_meyer_experiments.csv`. Source/reference data for experiments.
|
||||
- **test-api-fix.js** – One-off test script for camera config API; not part of the app build.
|
||||
@@ -0,0 +1,61 @@
|
||||
experiment_number,soaking_duration_hr,air_drying_duration_min,plate_contact_frequency_hz,throughput_rate_pecans_sec,crush_amount_in,entry_exit_height_diff_in
|
||||
0,34,19,53,28,0.05,-0.09
|
||||
1,24,27,34,29,0.03,0.01
|
||||
12,28,59,37,23,0.06,-0.08
|
||||
15,16,60,30,24,0.07,0.02
|
||||
4,13,41,41,38,0.05,0.03
|
||||
18,18,49,38,35,0.07,-0.08
|
||||
11,24,59,42,25,0.07,-0.05
|
||||
16,20,59,41,14,0.07,0.04
|
||||
4,13,41,41,38,0.05,0.03
|
||||
19,11,25,56,34,0.06,-0.09
|
||||
15,16,60,30,24,0.07,0.02
|
||||
16,20,59,41,14,0.07,0.04
|
||||
10,26,60,44,12,0.08,-0.1
|
||||
1,24,27,34,29,0.03,0.01
|
||||
17,34,60,34,29,0.07,-0.09
|
||||
5,30,33,30,36,0.05,-0.04
|
||||
2,38,10,60,28,0.06,-0.1
|
||||
2,38,10,60,28,0.06,-0.1
|
||||
13,21,59,41,21,0.06,-0.09
|
||||
1,24,27,34,29,0.03,0.01
|
||||
14,22,59,45,17,0.07,-0.08
|
||||
6,10,22,37,30,0.06,0.02
|
||||
11,24,59,42,25,0.07,-0.05
|
||||
19,11,25,56,34,0.06,-0.09
|
||||
8,27,12,55,24,0.04,0.04
|
||||
18,18,49,38,35,0.07,-0.08
|
||||
5,30,33,30,36,0.05,-0.04
|
||||
9,32,26,47,26,0.07,0.03
|
||||
3,11,36,42,13,0.07,-0.07
|
||||
10,26,60,44,12,0.08,-0.1
|
||||
8,27,12,55,24,0.04,0.04
|
||||
5,30,33,30,36,0.05,-0.04
|
||||
8,27,12,55,24,0.04,0.04
|
||||
18,18,49,38,35,0.07,-0.08
|
||||
3,11,36,42,13,0.07,-0.07
|
||||
10,26,60,44,12,0.08,-0.1
|
||||
17,34,60,34,29,0.07,-0.09
|
||||
13,21,59,41,21,0.06,-0.09
|
||||
12,28,59,37,23,0.06,-0.08
|
||||
9,32,26,47,26,0.07,0.03
|
||||
14,22,59,45,17,0.07,-0.08
|
||||
0,34,19,53,28,0.05,-0.09
|
||||
7,15,30,35,32,0.05,-0.07
|
||||
0,34,19,53,28,0.05,-0.09
|
||||
15,16,60,30,24,0.07,0.02
|
||||
13,21,59,41,21,0.06,-0.09
|
||||
11,24,59,42,25,0.07,-0.05
|
||||
7,15,30,35,32,0.05,-0.07
|
||||
16,20,59,41,14,0.07,0.04
|
||||
3,11,36,42,13,0.07,-0.07
|
||||
7,15,30,35,32,0.05,-0.07
|
||||
6,10,22,37,30,0.06,0.02
|
||||
19,11,25,56,34,0.06,-0.09
|
||||
6,10,22,37,30,0.06,0.02
|
||||
2,38,10,60,28,0.06,-0.1
|
||||
14,22,59,45,17,0.07,-0.08
|
||||
4,13,41,41,38,0.05,0.03
|
||||
9,32,26,47,26,0.07,0.03
|
||||
17,34,60,34,29,0.07,-0.09
|
||||
12,28,59,37,23,0.06,-0.08
|
||||
|
@@ -0,0 +1,41 @@
|
||||
phase_name,machine_type,Motor Speed (Hz),soaking_duration_hr,air_drying_duration_min,jig Displacement (in),Spring Stiffness (N/m),reps_required,rep
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",33,27,28,-0.307,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",30,37,17,-0.311,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",47,36,50,-0.291,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",42,12,30,-0.314,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",53,34,19,-0.302,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",37,18,40,-0.301,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",40,14,59,-0.286,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",39,18,32,-0.309,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",49,11,31,-0.299,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",47,33,12,-0.295,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",52,23,36,-0.302,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",59,37,35,-0.299,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",41,15,15,-0.312,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",46,24,22,-0.303,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",50,36,15,-0.308,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",36,32,48,-0.306,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",33,28,38,-0.308,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",35,31,51,-0.311,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",55,20,57,-0.304,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",44,10,27,-0.313,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",37,16,43,-0.294,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",56,25,42,-0.31,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",30,13,21,-0.292,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",60,29,46,-0.294,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",41,21,54,-0.306,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",55,29,54,-0.296,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",39,30,48,-0.293,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",34,35,53,-0.285,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",57,32,39,-0.291,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",45,27,38,-0.296,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",52,17,25,-0.297,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",51,13,22,-0.288,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",36,19,11,-0.29,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",44,38,32,-0.315,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",58,26,18,-0.289,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",32,22,52,-0.288,1800,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",43,12,56,-0.287,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",60,16,45,-0.298,2200,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",54,22,25,-0.301,2000,1,1
|
||||
"Post Workshop Meyer Experiments","Meyer Cracker",48,24,13,-0.305,2000,1,1
|
||||
|
132
archive/management-dashboard-web-app/test-api-fix.js
Normal file
132
archive/management-dashboard-web-app/test-api-fix.js
Normal file
@@ -0,0 +1,132 @@
|
||||
// Test script to verify the camera configuration API fix
|
||||
// This simulates the VisionApiClient.getCameraConfig method
|
||||
|
||||
class TestVisionApiClient {
|
||||
constructor() {
|
||||
this.baseUrl = 'http://localhost:8000'
|
||||
}
|
||||
|
||||
async request(endpoint) {
|
||||
const response = await fetch(`${this.baseUrl}${endpoint}`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text()
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText}\n${errorText}`)
|
||||
}
|
||||
|
||||
return response.json()
|
||||
}
|
||||
|
||||
// This is our fixed getCameraConfig method
|
||||
async getCameraConfig(cameraName) {
|
||||
try {
|
||||
const config = await this.request(`/cameras/${cameraName}/config`)
|
||||
|
||||
// Ensure auto-recording fields have default values if missing
|
||||
return {
|
||||
...config,
|
||||
auto_start_recording_enabled: config.auto_start_recording_enabled ?? false,
|
||||
auto_recording_max_retries: config.auto_recording_max_retries ?? 3,
|
||||
auto_recording_retry_delay_seconds: config.auto_recording_retry_delay_seconds ?? 5
|
||||
}
|
||||
} catch (error) {
|
||||
// If the error is related to missing auto-recording fields, try to handle it gracefully
|
||||
if (error.message?.includes('auto_start_recording_enabled') ||
|
||||
error.message?.includes('auto_recording_max_retries') ||
|
||||
error.message?.includes('auto_recording_retry_delay_seconds')) {
|
||||
|
||||
// Try to get the raw camera data and add default auto-recording fields
|
||||
try {
|
||||
const response = await fetch(`${this.baseUrl}/cameras/${cameraName}/config`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText}`)
|
||||
}
|
||||
|
||||
const rawConfig = await response.json()
|
||||
|
||||
// Add missing auto-recording fields with defaults
|
||||
return {
|
||||
...rawConfig,
|
||||
auto_start_recording_enabled: false,
|
||||
auto_recording_max_retries: 3,
|
||||
auto_recording_retry_delay_seconds: 5
|
||||
}
|
||||
} catch (fallbackError) {
|
||||
throw new Error(`Failed to load camera configuration: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
async getCameras() {
|
||||
return this.request('/cameras')
|
||||
}
|
||||
}
|
||||
|
||||
// Test function
|
||||
async function testCameraConfigFix() {
|
||||
console.log('🧪 Testing Camera Configuration API Fix')
|
||||
console.log('=' * 50)
|
||||
|
||||
const api = new TestVisionApiClient()
|
||||
|
||||
try {
|
||||
// First get available cameras
|
||||
console.log('📋 Getting camera list...')
|
||||
const cameras = await api.getCameras()
|
||||
const cameraNames = Object.keys(cameras)
|
||||
|
||||
if (cameraNames.length === 0) {
|
||||
console.log('❌ No cameras found')
|
||||
return
|
||||
}
|
||||
|
||||
console.log(`✅ Found ${cameraNames.length} cameras: ${cameraNames.join(', ')}`)
|
||||
|
||||
// Test configuration for each camera
|
||||
for (const cameraName of cameraNames) {
|
||||
console.log(`\n🎥 Testing configuration for ${cameraName}...`)
|
||||
|
||||
try {
|
||||
const config = await api.getCameraConfig(cameraName)
|
||||
|
||||
console.log(`✅ Configuration loaded successfully for ${cameraName}`)
|
||||
console.log(` - auto_start_recording_enabled: ${config.auto_start_recording_enabled}`)
|
||||
console.log(` - auto_recording_max_retries: ${config.auto_recording_max_retries}`)
|
||||
console.log(` - auto_recording_retry_delay_seconds: ${config.auto_recording_retry_delay_seconds}`)
|
||||
console.log(` - exposure_ms: ${config.exposure_ms}`)
|
||||
console.log(` - gain: ${config.gain}`)
|
||||
|
||||
} catch (error) {
|
||||
console.log(`❌ Configuration failed for ${cameraName}: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('\n🎉 Camera configuration API test completed!')
|
||||
|
||||
} catch (error) {
|
||||
console.log(`❌ Test failed: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
// Export for use in browser console or Node.js
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = { TestVisionApiClient, testCameraConfigFix }
|
||||
} else {
|
||||
// Browser environment
|
||||
window.TestVisionApiClient = TestVisionApiClient
|
||||
window.testCameraConfigFix = testCameraConfigFix
|
||||
}
|
||||
|
||||
console.log('📝 Test script loaded. Run testCameraConfigFix() to test the fix.')
|
||||
Reference in New Issue
Block a user