{"id":30865914,"url":"https://github.com/JunfXiao/trnsys-rust-template","last_synced_at":"2025-09-07T22:03:15.784Z","repository":{"id":233243325,"uuid":"786233649","full_name":"JunfXiao/trnsys-rust-template","owner":"JunfXiao","description":"A template to write rust-flavoured trnsys type","archived":false,"fork":false,"pushed_at":"2024-12-23T19:42:02.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-23T20:26:58.929Z","etag":null,"topics":["rust","simulation","trnsys"],"latest_commit_sha":null,"homepage":"https://github.com/JunfXiao/trnsys_rust_template","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JunfXiao.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-04-13T20:28:48.000Z","updated_at":"2024-12-23T19:42:06.000Z","dependencies_parsed_at":"2024-04-15T05:30:45.164Z","dependency_job_id":"49a84a8f-ce17-412f-bc04-c311f6ad9d95","html_url":"https://github.com/JunfXiao/trnsys-rust-template","commit_stats":null,"previous_names":["junfxiao/trnsys_rust_template","junfxiao/trnsys-rust-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/JunfXiao/trnsys-rust-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunfXiao%2Ftrnsys-rust-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunfXiao%2Ftrnsys-rust-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunfXiao%2Ftrnsys-rust-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunfXiao%2Ftrnsys-rust-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JunfXiao","download_url":"https://codeload.github.com/JunfXiao/trnsys-rust-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JunfXiao%2Ftrnsys-rust-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274101768,"owners_count":25222447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"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":["rust","simulation","trnsys"],"created_at":"2025-09-07T22:02:48.003Z","updated_at":"2025-09-07T22:03:15.715Z","avatar_url":"https://github.com/JunfXiao.png","language":"Rust","funding_links":[],"categories":["Compiler"],"sub_categories":["Other Resources"],"readme":"\n# trnsys_rust_template\n\ntrnsys_rust_template provides you a modern, efficient and friendly way to create TrnSys types in Rust.\nIt is based on the TrnSys C++ Template, which can be found in your TrnSys installation folder.\nWith its error handling, logging and other features, it's much easier to write, test and debug your own TrnSys type.\n## Usage\n\n1. Clone this repository\n2. Paste the `TRNDll64.lib` under the `lib` folder\n3. Change the project name in `Cargo.toml` if needed\n4. Set your type number in `Cargo.toml` in section `[package.metadata.trnsys]`.\n5. Write your calculation logic in the `src/trnsys_type.rs` file, where you can use all the functions in different\n   simulation time as documented.\n\n## Functionality\n\n### Logging\n\nLogging is enabled by default using `tracing` crate.\nLogs are written to both the TrnSys lst/log file and a separate log file.\n\nBy default,\n\n- only logs with level `INFO` or higher are written to the TrnSys log file.\n\n- the separate log file is created in `%temp%` folder with the name `trnsys_{timpstamp}.log`. If the simulation finishes\n  with no error, the file is deleted autimatically.\n\n### Call TrnSys functions\n\nSome functions are built-in in the `trnsys` module, which can be used to call TrnSys functions.\n\nAn example to get current timestep:\n\n```rust\n// use the trnsys module\nuse crate::trnsys::get_simulation_time_step;\n\nfn some_function() {\n   // get the current timestep\n   let timestep = get_simulation_time_step();\n}\n\n```\n\n### Error handling\n\nErrors are handled using `thiserror` crate. You can add more error types in [src/trnsys/error.rs](src/trnsys/error.rs)\nfile.\n\nIf you would like to perform more actions when an error occurs, you can implement the `TrnSysErrorHandler` trait for\nyour error type and modify the handling process accordingly.\n\n## Advanced\n\n### Add more functions\nYou can add more functions to the `src/trnsys/ext_c.rs` file and add the corresponding rust-flavored function in the `src/trnsys/mod.rs` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJunfXiao%2Ftrnsys-rust-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJunfXiao%2Ftrnsys-rust-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJunfXiao%2Ftrnsys-rust-template/lists"}