Skip to content

Commit

Permalink
Debug things
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Nov 8, 2023
1 parent f088d0c commit 6f63586
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 81 deletions.
2 changes: 1 addition & 1 deletion config/helios.config.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"evaluation_size": 15,
"seconds_per_interval": 6,
"min_seconds_between_state_changes": 180,
"edge_pixel_threshold": 0.01,
"edge_pixel_threshold": 1,
"edge_color_threshold": 40,
"target_pixel_brightness": 50,
"save_images_to_archive": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/types/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class HeliosConfig(StricterBaseModel):
evaluation_size: int = pydantic.Field(..., ge=1, le=100)
seconds_per_interval: float = pydantic.Field(..., ge=5, le=600)
min_seconds_between_state_changes: int = pydantic.Field(..., ge=0, le=3600)
edge_pixel_threshold: int = pydantic.Field(..., ge=0, le=100)
edge_pixel_threshold: float = pydantic.Field(..., ge=0, le=30)
edge_color_threshold: int = pydantic.Field(..., ge=5, le=250)
target_pixel_brightness: int = pydantic.Field(..., ge=20, le=235)
save_images_to_archive: bool
Expand All @@ -219,7 +219,7 @@ class PartialHeliosConfig(StricterBaseModel):
min_seconds_between_state_changes: Optional[int] = pydantic.Field(
None, ge=0, le=3600
)
edge_pixel_threshold: Optional[int] = pydantic.Field(None, ge=0, le=100)
edge_pixel_threshold: Optional[float] = pydantic.Field(None, ge=0, le=30)
edge_color_threshold: Optional[int] = pydantic.Field(None, ge=5, le=250)
target_pixel_brightness: Optional[int] = pydantic.Field(None, ge=20, le=235)
save_images_to_archive: Optional[bool] = None
Expand Down
8 changes: 4 additions & 4 deletions packages/core/utils/exception_email_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_current_log_lines() -> list[str]:
)
log_lines_in_email.append(
l_sections[0] +
"running command \"config update\" with content: <redacted>"
"running command \"config update\" with content: { REDACTED }\n"
)
else:
log_lines_in_email.append(l)
Expand Down Expand Up @@ -137,7 +137,7 @@ def handle_resolved_exception(config: types.Config) -> None:
])

station_id = config.general.station_id
subject = f'✅ PYRA on "{station_id}": all exceptions resolved'
subject = f'✅ PYRA on system "{station_id}": all exceptions resolved'
ExceptionEmailClient._send_email(config, text, html, subject)

@staticmethod
Expand Down Expand Up @@ -174,7 +174,7 @@ def handle_occured_exception(
])

station_id = config.general.station_id
subject = f'❗️ PYRA on "{station_id}": new exception "{type(exception).__name__}"'
subject = f'❗️ PYRA on system "{station_id}": new exception "{type(exception).__name__}"'
ExceptionEmailClient._send_email(config, text, html, subject)

@staticmethod
Expand Down Expand Up @@ -206,5 +206,5 @@ def send_test_email(config: types.Config) -> None:
])

station_id = config.general.station_id
subject = f'⚙️ PYRA on "{station_id}": test email'
subject = f'⚙️ PYRA on system "{station_id}": test email'
ExceptionEmailClient._send_email(config, text, html, subject)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { dialog, shell } from '@tauri-apps/api';
import { configurationComponents, essentialComponents } from '../..';
import { join } from '@tauri-apps/api/path';
import toast from 'react-hot-toast';

export default function ConfigElementText(props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function ConfigSectionCamtracker() {
oldValue={centralSectionConfig.sun_intensity_path}
/>
<configurationComponents.ConfigElementText
title='"learn_az_elev" Path'
title="Learn Az Elev Path"
value={localSectionConfig.learn_az_elev_path}
setValue={(v: string) => setLocalConfigItem('camtracker.learn_az_elev_path', v)}
oldValue={centralSectionConfig.learn_az_elev_path}
Expand Down
124 changes: 53 additions & 71 deletions packages/ui/src/components/overview/measurement-decision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,98 +121,80 @@ export default function MeasurementDecision() {
isActive={activeMode === 'automatic'}
onClick={() => setActiveMode('automatic')}
>
<div>
<strong>Current filter settings:</strong>{' '}
<em>
{automaticFilterSettingsConsidered.length === 0 ? (
'Never measuring.'
{activeMode === 'automatic' && (
<div>
Read more about this in the{' '}
{activeMode === 'automatic' ? (
<a
href="https://pyra.esm.ei.tum.de/docs/user-guide/measurements/#measurement-modes-and-triggers"
target="_blank"
className="text-blue-500 underline"
>
Pyra Docs
</a>
) : (
<>Measuring if {automaticFilterSettingsConsidered.join(' AND ')}.</>
)}{' '}
{automaticFilterSettingsNotConsidered.length > 0 && (
<>
Not considering{' '}
{automaticFilterSettingsNotConsidered.join(', ')}.
</>
<span className="text-blue-300 underline">Pyra Docs</span>
)}
</em>
</div>

<div>
Read more about this in the{' '}
{activeMode === 'automatic' ? (
<a
href="https://pyra.esm.ei.tum.de/docs/user-guide/measurements/#measurement-modes-and-triggers"
target="_blank"
className="text-blue-500 underline"
>
Pyra Docs
</a>
) : (
<span className="text-blue-300 underline">Pyra Docs</span>
)}
.
</div>
.
</div>
)}
</ModePanel>
<ModePanel
label="Manual"
isActive={activeMode === 'manual'}
onClick={() => setActiveMode('manual')}
>
<div>Manually start and stop measurements here.</div>
<div>
Current state:{' '}
<strong>
{centralConfig.measurement_decision.manual_decision_result
? 'measuring'
: 'not measuring'}
</strong>
</div>
{activeMode === 'manual' ? (
{activeMode === 'manual' && (
<div>
Current state:{' '}
<strong>
{centralConfig.measurement_decision.manual_decision_result
? 'measuring'
: 'not measuring'}
</strong>
</div>
)}
{activeMode === 'manual' && (
<Button className="w-full" onClick={toggleManualMeasurementMode}>
{centralConfig.measurement_decision.manual_decision_result
? 'Stop'
: 'Start'}{' '}
Measurements
</Button>
) : (
<div className="flex items-center justify-center w-full font-medium rounded-md h-9 bg-slate-300 text-slate-100">
{centralConfig.measurement_decision.manual_decision_result
? 'Stop'
: 'Start'}{' '}
Measurements
</div>
)}
</ModePanel>
<ModePanel
label="CLI"
isActive={activeMode === 'cli'}
onClick={() => setActiveMode('cli')}
>
<div>Uses a trigger from an external source.</div>
<div>
Current state:{' '}
<strong>
{centralConfig.measurement_decision.cli_decision_result
? 'measuring'
: 'not measuring'}
</strong>
</div>
<div>
Read more about this in the{' '}
{activeMode === 'cli' ? (
<a
href="https://pyra.esm.ei.tum.de/docs/user-guide/measurements#starting-and-stopping-measurements-via-cli"
target="_blank"
className="text-blue-500 underline"
>
Pyra Docs
</a>
) : (
<span className="text-blue-300 underline">Pyra Docs</span>
)}
.
</div>
{activeMode === 'cli' && (
<>
<div>
Current state:{' '}
<strong>
{centralConfig.measurement_decision.cli_decision_result
? 'measuring'
: 'not measuring'}
</strong>
</div>
<div>
Read more about this in the{' '}
{activeMode === 'cli' ? (
<a
href="https://pyra.esm.ei.tum.de/docs/user-guide/measurements#starting-and-stopping-measurements-via-cli"
target="_blank"
className="text-blue-500 underline"
>
Pyra Docs
</a>
) : (
<span className="text-blue-300 underline">Pyra Docs</span>
)}
.
</div>
</>
)}
</ModePanel>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/utils/zustand-utils/config-zustand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const configSchema = z.object({
evaluation_size: intSchema,
seconds_per_interval: floatSchema,
min_seconds_between_state_changes: intSchema,
edge_pixel_threshold: intSchema,
edge_pixel_threshold: floatSchema,
edge_color_threshold: intSchema,
target_pixel_brightness: intSchema,
save_images_to_archive: z.boolean(),
Expand Down

0 comments on commit 6f63586

Please sign in to comment.