{"action":"created","comment":{"url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/comments/75543610","id":75543610,"diff_hunk":"@@ -434,35 +434,140 @@ END FUNCTION\n #### JSBSim\n JSBSim is an open source C++ library.  It is used to simulate sensor outputs based on control inputs for flight simulations.\n \n-In order to work with JSBSim from Rust, it is necessary to create a wrapper for JSBSim.  This wrapper is implemented in three files:  wrapper.cpp, wrapper.h, & wrapper.rs.  The wrapper.cpp file contains the native C++ calls to JSBSim wrapped in C functions.  The wrapper.h file contains the externed C headers for these wrapped functions.  The wrapper.rs file will contain the raw Rust calls to the C abi.\n-\n-The higher level calls that will be used to send data to, receive data from, & otherwise work with jsbsim will be located in the binder.rs file.  The very general pseudo code for these is listed below.\n-\n+In order to work with JSBSim from Rust, it is necessary to create a wrapper for JSBSim.  This wrapper is implemented in three files:  wrapper.cpp, wrapper.h, & wrapper.rs.  The wrapper.cpp file contains the native C++ calls to JSBSim wrapped in C functions.  The wrapper.h file contains the externed C headers for these wrapped functions.  The wrapper.rs file contain the raw Rust calls to the C abi as well as a set of basic functions to allow a Rust-based program to run a JSBSim Flight Dynamics Model and run it via script.\n ```\n-INPUT:  binder_input                        //data from controller interface::write to binder\n-OUTPUT: binder_output                       //data to sensor interface::get value from binder\n-\n-///this function initializes the JSBSim Binder\n-FUNCTION Binder Init\n-     INIT basic environmental variables\n-     INSTANTIATE jsbsim exec                           //fgfdmexec\n-     LOAD script                                       //loadscript\n-     RUN startup loop (empty)                          //runic\n-     RETURN pointer to jsbsim exec\n+File Name:          wrapper.rs\n+Purpose:            define a Rust-based front end for JSBSim\n+Components:\n+wrapper_init()     instantiate and initialize a JSBSim Flight Dynamics Model\n+send_to_jsbsim()   update FDM with data from the controller interface\n+get_from_jsbsim()  iterate the flight dynamics model by one step\n+                    provide property to allow scripts to end the simulation\n+                    update the sensor interface with gyro data from jsbsim\n+wrapper_close()    close the FDM and reset fdm to null (not implemented)\n+extern block       provide rust-based front end for the c abi defined in wrapper.h & wrapper.cpp\n+\n+\n+Function:           wrapper_init\n+Purpose:            instantiate and initialize a JSBSim Flight Dynamics Model\n+Inputs:             none\n+Outputs:            none\n+Side Effects:       fdm, a pointer with 'static lifetime is set to the instantiated FDM\n+Notes:              this function must be called previous to any other functions\n+\n+FUNCTION wrapper_init\n+     INSTANTIATE a new Flight Dynamics Model\n+     SET base jsbsim scripts folder\n+     SET jsbsim directory structure (aircraft, engine, systems) & verify\n+     LOAD script & verify\n+     RUN initial conditions & verify\n ENDFUNCTION\n \n-///this is the primary work loop\n-FUNCTION Binder Step (pointer to jsbsim exec, binder_input):\n-     GET data from binder_input                        //this is the data from the controller interface\n-     RUN jsbsim exec's run method                      //binder -> wrapper -> jsbsim\n-                                                       //will need to know how data is to be blended\n-                                                       // … between script & binder_input\n-     GET output from jsbsim exec's run method          //jsbsim -> wrapper -> binder\n-     Send data to binder_output                        //this will be sent to the sensor interface\n+\n+Function:           send_to_jsbsim\n+Inputs:             cw: u8, ccw: u8\n+Outputs:            none\n+Side Effects:       none\n+Purpose:            update FDM with data from the controller interface\n+Notes:              this function will indicate to the fdm that the flight controller is engaging\n+                    the controller interface i.e. firing thrusters\n+\n+FUNCTION send_to_jsbsim\n+     SET the testmode/ledcw property in the JSBSim fdm to cw\n+     SET the testmode/ledccw property in the JSBSim fdm to ccw\n ENDFUNCTION\n \n-///this function closes out the JSBSim Binder\n-FUNCTION Binder Close ((pointer to jsbsim exec)\n-     CLOSE jsbsim                                      //will need to close this in jsbsim & rust\n+\n+Function:           get_from_jsbsim\n+Inputs:             none\n+Outputs:            gyro_x: f32, gyro_y: f32, gyro_z: f32\n+Side Effects:       none\n+Purpose:            iterate the flight dynamics model by one step\n+                    provide a property to allow scripts to end the simulation\n+                    update the sensor interface with gyro data from jsbsim\n+\n+FUNCTION get_from_jsbsim\n+-RUN jsbsim exec's run method to iterate the flight dynamics model by one step\n+-GET sensor data from the fdm\n+-CHECK the endscript property & exit the application as indicated\n+-SEND the gyro data from JSBSim to the sensor interface\n+\n+Function:           wrapper_close\n+Inputs:             none\n+Outputs:            none\n+Side Effects:       closes the fdm & sets the fdm pointer to null\n+Purpose:            provide a clean way to exit the simulation\n+Notes:              this function is not currently implemented as no option to\n+                         exit the application is currently provided\n+\n+FUNCTION wrapper_close\n+     CLOSE the current fdm\n+     SET the fdm pointer to null\n ENDFUNCTION\n+\n+\n+Component:          extern block\n+Purpose:            provide linkage to JSBSim as a shared object or dynamic link library\n+                    provide linkage to wrapper.h & wrapper.cpp as a static library\n+                    provide a basic set of functions to access JSBSim via the c abi defined\n+                         in wrapper.h & wrapper.cpp\n+Notes:              the functions in the extern block must parallel the c headers in wrapper.h\n+                    see below for the current set of wrapper functions\n+```\n+```\n+File Name:          wrapper.h\n+Purpose:            provide a set of c function definitions to wrap the c++ calls used to \n+                         acess JSBSim","path":"documents/Design.md","position":112,"original_position":112,"commit_id":"c537963280970967450bb9a6478cdc5c88c0e6d4","original_commit_id":"c537963280970967450bb9a6478cdc5c88c0e6d4","user":{"login":"chrisliebert","id":1259537,"avatar_url":"https://avatars.githubusercontent.com/u/1259537?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisliebert","html_url":"https://github.com/chrisliebert","followers_url":"https://api.github.com/users/chrisliebert/followers","following_url":"https://api.github.com/users/chrisliebert/following{/other_user}","gists_url":"https://api.github.com/users/chrisliebert/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisliebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisliebert/subscriptions","organizations_url":"https://api.github.com/users/chrisliebert/orgs","repos_url":"https://api.github.com/users/chrisliebert/repos","events_url":"https://api.github.com/users/chrisliebert/events{/privacy}","received_events_url":"https://api.github.com/users/chrisliebert/received_events","type":"User","site_admin":false},"body":"*typo: acess should be access","created_at":"2016-08-19T20:04:32Z","updated_at":"2016-08-19T20:04:32Z","html_url":"https://github.com/hgb2/PSAS-Capstone/pull/36#discussion_r75543610","pull_request_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/comments/75543610"},"html":{"href":"https://github.com/hgb2/PSAS-Capstone/pull/36#discussion_r75543610"},"pull_request":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36","id":81938557,"html_url":"https://github.com/hgb2/PSAS-Capstone/pull/36","diff_url":"https://github.com/hgb2/PSAS-Capstone/pull/36.diff","patch_url":"https://github.com/hgb2/PSAS-Capstone/pull/36.patch","issue_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/36","number":36,"state":"open","locked":false,"title":"Xmlio","user":{"login":"sanayani","id":19369809,"avatar_url":"https://avatars.githubusercontent.com/u/19369809?v=3","gravatar_id":"","url":"https://api.github.com/users/sanayani","html_url":"https://github.com/sanayani","followers_url":"https://api.github.com/users/sanayani/followers","following_url":"https://api.github.com/users/sanayani/following{/other_user}","gists_url":"https://api.github.com/users/sanayani/gists{/gist_id}","starred_url":"https://api.github.com/users/sanayani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanayani/subscriptions","organizations_url":"https://api.github.com/users/sanayani/orgs","repos_url":"https://api.github.com/users/sanayani/repos","events_url":"https://api.github.com/users/sanayani/events{/privacy}","received_events_url":"https://api.github.com/users/sanayani/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-19T07:37:31Z","updated_at":"2016-08-19T20:04:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36/commits","review_comments_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36/comments","review_comment_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/36/comments","statuses_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/statuses/c537963280970967450bb9a6478cdc5c88c0e6d4","head":{"label":"hgb2:xmlio","ref":"xmlio","sha":"c537963280970967450bb9a6478cdc5c88c0e6d4","user":{"login":"hgb2","id":19175889,"avatar_url":"https://avatars.githubusercontent.com/u/19175889?v=3","gravatar_id":"","url":"https://api.github.com/users/hgb2","html_url":"https://github.com/hgb2","followers_url":"https://api.github.com/users/hgb2/followers","following_url":"https://api.github.com/users/hgb2/following{/other_user}","gists_url":"https://api.github.com/users/hgb2/gists{/gist_id}","starred_url":"https://api.github.com/users/hgb2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgb2/subscriptions","organizations_url":"https://api.github.com/users/hgb2/orgs","repos_url":"https://api.github.com/users/hgb2/repos","events_url":"https://api.github.com/users/hgb2/events{/privacy}","received_events_url":"https://api.github.com/users/hgb2/received_events","type":"User","site_admin":false},"repo":{"id":58104523,"name":"PSAS-Capstone","full_name":"hgb2/PSAS-Capstone","owner":{"login":"hgb2","id":19175889,"avatar_url":"https://avatars.githubusercontent.com/u/19175889?v=3","gravatar_id":"","url":"https://api.github.com/users/hgb2","html_url":"https://github.com/hgb2","followers_url":"https://api.github.com/users/hgb2/followers","following_url":"https://api.github.com/users/hgb2/following{/other_user}","gists_url":"https://api.github.com/users/hgb2/gists{/gist_id}","starred_url":"https://api.github.com/users/hgb2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgb2/subscriptions","organizations_url":"https://api.github.com/users/hgb2/orgs","repos_url":"https://api.github.com/users/hgb2/repos","events_url":"https://api.github.com/users/hgb2/events{/privacy}","received_events_url":"https://api.github.com/users/hgb2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hgb2/PSAS-Capstone","description":"","fork":false,"url":"https://api.github.com/repos/hgb2/PSAS-Capstone","forks_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/forks","keys_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/teams","hooks_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/hooks","issue_events_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/events{/number}","events_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/events","assignees_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/assignees{/user}","branches_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/branches{/branch}","tags_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/tags","blobs_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/refs{/sha}","trees_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/statuses/{sha}","languages_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/languages","stargazers_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/stargazers","contributors_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/contributors","subscribers_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/subscribers","subscription_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/subscription","commits_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/commits{/sha}","git_commits_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/commits{/sha}","comments_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/comments{/number}","issue_comment_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/comments{/number}","contents_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/contents/{+path}","compare_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/merges","archive_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/downloads","issues_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues{/number}","pulls_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls{/number}","milestones_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/milestones{/number}","notifications_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/labels{/name}","releases_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/releases{/id}","deployments_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/deployments","created_at":"2016-05-05T04:35:46Z","updated_at":"2016-08-14T14:25:57Z","pushed_at":"2016-08-19T16:37:41Z","git_url":"git://github.com/hgb2/PSAS-Capstone.git","ssh_url":"git@github.com:hgb2/PSAS-Capstone.git","clone_url":"https://github.com/hgb2/PSAS-Capstone.git","svn_url":"https://github.com/hgb2/PSAS-Capstone","homepage":null,"size":1581,"stargazers_count":2,"watchers_count":2,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":2,"default_branch":"master"}},"base":{"label":"hgb2:master","ref":"master","sha":"effa44a2ffde8dc7d574a8da501ee0f83f7941fb","user":{"login":"hgb2","id":19175889,"avatar_url":"https://avatars.githubusercontent.com/u/19175889?v=3","gravatar_id":"","url":"https://api.github.com/users/hgb2","html_url":"https://github.com/hgb2","followers_url":"https://api.github.com/users/hgb2/followers","following_url":"https://api.github.com/users/hgb2/following{/other_user}","gists_url":"https://api.github.com/users/hgb2/gists{/gist_id}","starred_url":"https://api.github.com/users/hgb2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgb2/subscriptions","organizations_url":"https://api.github.com/users/hgb2/orgs","repos_url":"https://api.github.com/users/hgb2/repos","events_url":"https://api.github.com/users/hgb2/events{/privacy}","received_events_url":"https://api.github.com/users/hgb2/received_events","type":"User","site_admin":false},"repo":{"id":58104523,"name":"PSAS-Capstone","full_name":"hgb2/PSAS-Capstone","owner":{"login":"hgb2","id":19175889,"avatar_url":"https://avatars.githubusercontent.com/u/19175889?v=3","gravatar_id":"","url":"https://api.github.com/users/hgb2","html_url":"https://github.com/hgb2","followers_url":"https://api.github.com/users/hgb2/followers","following_url":"https://api.github.com/users/hgb2/following{/other_user}","gists_url":"https://api.github.com/users/hgb2/gists{/gist_id}","starred_url":"https://api.github.com/users/hgb2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgb2/subscriptions","organizations_url":"https://api.github.com/users/hgb2/orgs","repos_url":"https://api.github.com/users/hgb2/repos","events_url":"https://api.github.com/users/hgb2/events{/privacy}","received_events_url":"https://api.github.com/users/hgb2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hgb2/PSAS-Capstone","description":"","fork":false,"url":"https://api.github.com/repos/hgb2/PSAS-Capstone","forks_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/forks","keys_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/teams","hooks_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/hooks","issue_events_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/events{/number}","events_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/events","assignees_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/assignees{/user}","branches_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/branches{/branch}","tags_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/tags","blobs_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/refs{/sha}","trees_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/statuses/{sha}","languages_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/languages","stargazers_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/stargazers","contributors_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/contributors","subscribers_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/subscribers","subscription_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/subscription","commits_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/commits{/sha}","git_commits_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/git/commits{/sha}","comments_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/comments{/number}","issue_comment_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/comments{/number}","contents_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/contents/{+path}","compare_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/merges","archive_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/downloads","issues_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues{/number}","pulls_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls{/number}","milestones_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/milestones{/number}","notifications_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/labels{/name}","releases_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/releases{/id}","deployments_url":"https://api.github.com/repos/hgb2/PSAS-Capstone/deployments","created_at":"2016-05-05T04:35:46Z","updated_at":"2016-08-14T14:25:57Z","pushed_at":"2016-08-19T16:37:41Z","git_url":"git://github.com/hgb2/PSAS-Capstone.git","ssh_url":"git@github.com:hgb2/PSAS-Capstone.git","clone_url":"https://github.com/hgb2/PSAS-Capstone.git","svn_url":"https://github.com/hgb2/PSAS-Capstone","homepage":null,"size":1581,"stargazers_count":2,"watchers_count":2,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36"},"html":{"href":"https://github.com/hgb2/PSAS-Capstone/pull/36"},"issue":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/36"},"comments":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/hgb2/PSAS-Capstone/statuses/c537963280970967450bb9a6478cdc5c88c0e6d4"}}}}
{"actor":{"display_login":"chrisliebert"}}