{"id":20132375,"url":"https://github.com/stephtr/experiment-framework","last_synced_at":"2026-06-09T15:02:42.037Z","repository":{"id":115040769,"uuid":"525967920","full_name":"stephtr/experiment-framework","owner":"stephtr","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-08T16:25:18.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T22:18:06.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephtr.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-17T22:06:50.000Z","updated_at":"2024-11-18T18:28:34.000Z","dependencies_parsed_at":"2024-02-23T14:46:03.076Z","dependency_job_id":"fa1cab24-9a2d-46bb-98bd-584b9bfd881a","html_url":"https://github.com/stephtr/experiment-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephtr/experiment-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fexperiment-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fexperiment-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fexperiment-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fexperiment-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephtr","download_url":"https://codeload.github.com/stephtr/experiment-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephtr%2Fexperiment-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34112225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T20:53:23.163Z","updated_at":"2026-06-09T15:02:42.016Z","avatar_url":"https://github.com/stephtr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experiment Framework\n\nThis framework is specifically made for apps controlling physical experiments.\n\nIts purpose is to manage external components and provide a layer of abstraction which makes switching between different implementations (devices surving a specific purpose, for example different lasers) easy.\n\nImplementations exist for Lasers (TOPTICA), Cameras (Andor, Baumer, FLIR Grasshopper, Photonfocus) and Stages (MadCityLabs, SmarAct), although the source code can't be put under Open Source.\n\n## Example usage\n\nFor a working example (including the UI components), see the [TestApp](TestApp).\n\n```c#\nvar Components = ExperimentContainer.Singleton;\n```\n\nAdd component classes:\n```c#\nComponents.AddComponentClass\u003cLaserComponent\u003e();\nComponents.AddComponentClass\u003cStageComponent\u003e();\n```\n\nAdd all available implementations:\n```c#\nComponents.AddComponent\u003cFakeLaser\u003e();\nComponents.AddComponent\u003cOtherLaser\u003e();\nComponents.AddComponent\u003cLaserOfChoice\u003e();\nComponents.AddComponent\u003cFakeStage\u003e();\n```\n\nMake the component settings persistent:\n```c#\nComponents.UseWinUISettingsStore();\nComponents.LoadFromSettings();\n```\n\nInitialize a component (if not anyway being done by `LoadFromSettings` or by the [ExperimentSettings](#experimentsettings) component):\n```c#\nComponents.ActivateComponentAsync(typeof(LaserComponent), null, typeof(FakeLaser).Name, new FakeLaserSettings());\n```\n\nGet \u0026 use a component:\n```c#\nvar laser = Components.GetActiveComponent\u003cLaserComponent\u003e();\nlaser.IsOn = true;\n```\n\nGet notified on component changes:\n```c#\n// either (for a specific component):\nComponents.AddComponentChangeHandler\u003cLaserComponent\u003e((newLaser) =\u003e { ... });\n// or (for all component changes):\nComponents.ComponentChanged += (componentClass, id, newComponent) =\u003e { ... };\n```\n\n## WinUI 3 components\n\nThe framework comes with a few WinUI components:\n\n### ExperimentSettings\nDisplays controls to change between different component class implementations and change their respective settings:\n\n\u003cimg src=\"Assets/ExperimentSettings.png\" alt=\"Screenshot of the ExperimentSettings\" height=\"288\"\u003e\n\n### ExperimentStatusBar\nShows a statusbar which displays all loaded components and their state (double click to reload a component):\n\n\u003cimg src=\"Assets/ExperimentStatusBar.png\" alt=\"Screenshot of the ExperimentStatusBar\" height=\"40\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephtr%2Fexperiment-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephtr%2Fexperiment-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephtr%2Fexperiment-framework/lists"}