{"action":"created","comment":{"url":"https://api.github.com/repos/trikset/trikRuntime/pulls/comments/71835507","id":71835507,"diff_hunk":"@@ -204,6 +204,100 @@ QString Configurer::version() const\n {\n \treturn mVersion;\n }\n+void Configurer::generateConfigFile(const QString &fileName, const QString &dirPath) const\n+{\n+\tQString content = \"\";\n+\tQString indent = \"    \";\n+\tcontent += \"<config version = \\\"\" + version() + \"\\\">\" + '\\n';\n+\tQStringList sortedPorts = ports();\n+\tsortedPorts.sort();\n+\n+\tfor (int i = 0; i < sortedPorts.length(); i++) {\n+\t\tQString port = sortedPorts[i];\n+\t\tModelConfigurationElement currentElement = mModelConfiguration[port];\n+\t\tcontent += indent + \"<\" + port + \">\" + '\\n';\n+\t\tcontent += indent + indent + \"<\" + currentElement.deviceType;\n+\n+\t\tQStringList sortedAttributes = currentElement.attributes.keys();\n+\t\tsortedAttributes.sort();\n+\t\tif (sortedAttributes.length() != 0)\n+\t\t\tcontent += '\\n';\n+\n+\t\tfor (int i = 0; i < sortedAttributes.length(); i++) {\n+\t\t\tQString name = sortedAttributes[i];\n+\t\t\tif (mDeviceTypes[currentElement.deviceType].attributes[name] != currentElement.attributes[name])\n+\t\t\t\tcontent += indent + indent + indent + name + \"=\\\"\" + currentElement.attributes[name] + \"\\\"\" + '\\n';\n+\t\t}\n+\n+\t\tif (sortedAttributes.length() != 0)\n+\t\t\tcontent += indent + indent + \"/>\" + '\\n';\n+\t\telse\n+\t\t\tcontent += QString(\" \") + \"/>\" + '\\n';\n+\t\tcontent += indent + \"</\" + port + \">\" + '\\n';\n+\t}\n+\n+\tQStringList sortedDeviceClasses = mAdditionalModelConfiguration.keys();\n+\tsortedDeviceClasses.sort();\n+\tfor (int i = 0; i < sortedDeviceClasses.length(); i++) {\n+\t\tQString deviceClassName = sortedDeviceClasses[i];\n+\t\tAdditionalModelConfigurationElement currentElement = mAdditionalModelConfiguration[deviceClassName];\n+\t\tcontent += indent + \"<\" + deviceClassName;\n+\n+\t\tQStringList sortedAttributes = currentElement.attributes.keys();\n+\t\tsortedAttributes.sort();\n+\t\tif (sortedAttributes.length() != 0)\n+\t\t\tcontent += '\\n';\n+\n+\t\tfor (int i = 0; i < sortedAttributes.length(); i++) {\n+\t\t\tQString name = sortedAttributes[i];\n+\t\t\tif (mDevices[deviceClassName].attributes[name] != currentElement.attributes[name])\n+\t\t\t\tcontent += indent + indent + name + \"=\\\"\" + currentElement.attributes[name] + \"\\\"\" + '\\n';\n+\t\t}\n+\n+\t\tif (sortedAttributes.length() != 0)\n+\t\t\tcontent += indent + \"/>\" + '\\n';\n+\t\telse\n+\t\t\tcontent += \" />\" + '\\n';\n+\t}\n+\tcontent += \"</config>\";","path":"trikKernel/src/configurer.cpp","position":59,"original_position":59,"commit_id":"fb55866dc0f02722ff4d6d681c0979b2e6874469","original_commit_id":"fb55866dc0f02722ff4d6d681c0979b2e6874469","user":{"login":"yurii-litvinov","id":706768,"avatar_url":"https://avatars.githubusercontent.com/u/706768?v=3","gravatar_id":"","url":"https://api.github.com/users/yurii-litvinov","html_url":"https://github.com/yurii-litvinov","followers_url":"https://api.github.com/users/yurii-litvinov/followers","following_url":"https://api.github.com/users/yurii-litvinov/following{/other_user}","gists_url":"https://api.github.com/users/yurii-litvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii-litvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii-litvinov/subscriptions","organizations_url":"https://api.github.com/users/yurii-litvinov/orgs","repos_url":"https://api.github.com/users/yurii-litvinov/repos","events_url":"https://api.github.com/users/yurii-litvinov/events{/privacy}","received_events_url":"https://api.github.com/users/yurii-litvinov/received_events","type":"User","site_admin":false},"body":"после закрывающей фигурной скобки надо пустую строку","created_at":"2016-07-22T07:13:26Z","updated_at":"2016-07-22T07:13:26Z","html_url":"https://github.com/trikset/trikRuntime/pull/184#discussion_r71835507","pull_request_url":"https://api.github.com/repos/trikset/trikRuntime/pulls/184","_links":{"self":{"href":"https://api.github.com/repos/trikset/trikRuntime/pulls/comments/71835507"},"html":{"href":"https://github.com/trikset/trikRuntime/pull/184#discussion_r71835507"},"pull_request":{"href":"https://api.github.com/repos/trikset/trikRuntime/pulls/184"}}},"pull_request":{"url":"https://api.github.com/repos/trikset/trikRuntime/pulls/184","id":78204342,"html_url":"https://github.com/trikset/trikRuntime/pull/184","diff_url":"https://github.com/trikset/trikRuntime/pull/184.diff","patch_url":"https://github.com/trikset/trikRuntime/pull/184.patch","issue_url":"https://api.github.com/repos/trikset/trikRuntime/issues/184","number":184,"state":"open","locked":false,"title":"Методы в Configurer","user":{"login":"kverty","id":11009168,"avatar_url":"https://avatars.githubusercontent.com/u/11009168?v=3","gravatar_id":"","url":"https://api.github.com/users/kverty","html_url":"https://github.com/kverty","followers_url":"https://api.github.com/users/kverty/followers","following_url":"https://api.github.com/users/kverty/following{/other_user}","gists_url":"https://api.github.com/users/kverty/gists{/gist_id}","starred_url":"https://api.github.com/users/kverty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kverty/subscriptions","organizations_url":"https://api.github.com/users/kverty/orgs","repos_url":"https://api.github.com/users/kverty/repos","events_url":"https://api.github.com/users/kverty/events{/privacy}","received_events_url":"https://api.github.com/users/kverty/received_events","type":"User","site_admin":false},"body":"добавлены два метода\r\nодин для генерации нового файла конфигурации модели\r\nдругой для изменения параметра модели","created_at":"2016-07-20T19:24:50Z","updated_at":"2016-07-22T07:13:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0e12a01d220bfd67ad2a97a5f2502de4030753b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/trikset/trikRuntime/pulls/184/commits","review_comments_url":"https://api.github.com/repos/trikset/trikRuntime/pulls/184/comments","review_comment_url":"https://api.github.com/repos/trikset/trikRuntime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trikset/trikRuntime/issues/184/comments","statuses_url":"https://api.github.com/repos/trikset/trikRuntime/statuses/fb55866dc0f02722ff4d6d681c0979b2e6874469","head":{"label":"kverty:newMethods","ref":"newMethods","sha":"fb55866dc0f02722ff4d6d681c0979b2e6874469","user":{"login":"kverty","id":11009168,"avatar_url":"https://avatars.githubusercontent.com/u/11009168?v=3","gravatar_id":"","url":"https://api.github.com/users/kverty","html_url":"https://github.com/kverty","followers_url":"https://api.github.com/users/kverty/followers","following_url":"https://api.github.com/users/kverty/following{/other_user}","gists_url":"https://api.github.com/users/kverty/gists{/gist_id}","starred_url":"https://api.github.com/users/kverty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kverty/subscriptions","organizations_url":"https://api.github.com/users/kverty/orgs","repos_url":"https://api.github.com/users/kverty/repos","events_url":"https://api.github.com/users/kverty/events{/privacy}","received_events_url":"https://api.github.com/users/kverty/received_events","type":"User","site_admin":false},"repo":{"id":56780279,"name":"trikRuntime","full_name":"kverty/trikRuntime","owner":{"login":"kverty","id":11009168,"avatar_url":"https://avatars.githubusercontent.com/u/11009168?v=3","gravatar_id":"","url":"https://api.github.com/users/kverty","html_url":"https://github.com/kverty","followers_url":"https://api.github.com/users/kverty/followers","following_url":"https://api.github.com/users/kverty/following{/other_user}","gists_url":"https://api.github.com/users/kverty/gists{/gist_id}","starred_url":"https://api.github.com/users/kverty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kverty/subscriptions","organizations_url":"https://api.github.com/users/kverty/orgs","repos_url":"https://api.github.com/users/kverty/repos","events_url":"https://api.github.com/users/kverty/events{/privacy}","received_events_url":"https://api.github.com/users/kverty/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kverty/trikRuntime","description":"Runtime for TRIK controller","fork":true,"url":"https://api.github.com/repos/kverty/trikRuntime","forks_url":"https://api.github.com/repos/kverty/trikRuntime/forks","keys_url":"https://api.github.com/repos/kverty/trikRuntime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kverty/trikRuntime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kverty/trikRuntime/teams","hooks_url":"https://api.github.com/repos/kverty/trikRuntime/hooks","issue_events_url":"https://api.github.com/repos/kverty/trikRuntime/issues/events{/number}","events_url":"https://api.github.com/repos/kverty/trikRuntime/events","assignees_url":"https://api.github.com/repos/kverty/trikRuntime/assignees{/user}","branches_url":"https://api.github.com/repos/kverty/trikRuntime/branches{/branch}","tags_url":"https://api.github.com/repos/kverty/trikRuntime/tags","blobs_url":"https://api.github.com/repos/kverty/trikRuntime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kverty/trikRuntime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kverty/trikRuntime/git/refs{/sha}","trees_url":"https://api.github.com/repos/kverty/trikRuntime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kverty/trikRuntime/statuses/{sha}","languages_url":"https://api.github.com/repos/kverty/trikRuntime/languages","stargazers_url":"https://api.github.com/repos/kverty/trikRuntime/stargazers","contributors_url":"https://api.github.com/repos/kverty/trikRuntime/contributors","subscribers_url":"https://api.github.com/repos/kverty/trikRuntime/subscribers","subscription_url":"https://api.github.com/repos/kverty/trikRuntime/subscription","commits_url":"https://api.github.com/repos/kverty/trikRuntime/commits{/sha}","git_commits_url":"https://api.github.com/repos/kverty/trikRuntime/git/commits{/sha}","comments_url":"https://api.github.com/repos/kverty/trikRuntime/comments{/number}","issue_comment_url":"https://api.github.com/repos/kverty/trikRuntime/issues/comments{/number}","contents_url":"https://api.github.com/repos/kverty/trikRuntime/contents/{+path}","compare_url":"https://api.github.com/repos/kverty/trikRuntime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kverty/trikRuntime/merges","archive_url":"https://api.github.com/repos/kverty/trikRuntime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kverty/trikRuntime/downloads","issues_url":"https://api.github.com/repos/kverty/trikRuntime/issues{/number}","pulls_url":"https://api.github.com/repos/kverty/trikRuntime/pulls{/number}","milestones_url":"https://api.github.com/repos/kverty/trikRuntime/milestones{/number}","notifications_url":"https://api.github.com/repos/kverty/trikRuntime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kverty/trikRuntime/labels{/name}","releases_url":"https://api.github.com/repos/kverty/trikRuntime/releases{/id}","deployments_url":"https://api.github.com/repos/kverty/trikRuntime/deployments","created_at":"2016-04-21T14:26:26Z","updated_at":"2016-04-21T14:26:28Z","pushed_at":"2016-07-20T23:53:44Z","git_url":"git://github.com/kverty/trikRuntime.git","ssh_url":"git@github.com:kverty/trikRuntime.git","clone_url":"https://github.com/kverty/trikRuntime.git","svn_url":"https://github.com/kverty/trikRuntime","homepage":null,"size":10010,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"trikset:master","ref":"master","sha":"f62cc35248e028a8d9012399533448f090b9e3e8","user":{"login":"trikset","id":5375490,"avatar_url":"https://avatars.githubusercontent.com/u/5375490?v=3","gravatar_id":"","url":"https://api.github.com/users/trikset","html_url":"https://github.com/trikset","followers_url":"https://api.github.com/users/trikset/followers","following_url":"https://api.github.com/users/trikset/following{/other_user}","gists_url":"https://api.github.com/users/trikset/gists{/gist_id}","starred_url":"https://api.github.com/users/trikset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trikset/subscriptions","organizations_url":"https://api.github.com/users/trikset/orgs","repos_url":"https://api.github.com/users/trikset/repos","events_url":"https://api.github.com/users/trikset/events{/privacy}","received_events_url":"https://api.github.com/users/trikset/received_events","type":"Organization","site_admin":false},"repo":{"id":12588131,"name":"trikRuntime","full_name":"trikset/trikRuntime","owner":{"login":"trikset","id":5375490,"avatar_url":"https://avatars.githubusercontent.com/u/5375490?v=3","gravatar_id":"","url":"https://api.github.com/users/trikset","html_url":"https://github.com/trikset","followers_url":"https://api.github.com/users/trikset/followers","following_url":"https://api.github.com/users/trikset/following{/other_user}","gists_url":"https://api.github.com/users/trikset/gists{/gist_id}","starred_url":"https://api.github.com/users/trikset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trikset/subscriptions","organizations_url":"https://api.github.com/users/trikset/orgs","repos_url":"https://api.github.com/users/trikset/repos","events_url":"https://api.github.com/users/trikset/events{/privacy}","received_events_url":"https://api.github.com/users/trikset/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trikset/trikRuntime","description":"Runtime for TRIK controller","fork":false,"url":"https://api.github.com/repos/trikset/trikRuntime","forks_url":"https://api.github.com/repos/trikset/trikRuntime/forks","keys_url":"https://api.github.com/repos/trikset/trikRuntime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trikset/trikRuntime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trikset/trikRuntime/teams","hooks_url":"https://api.github.com/repos/trikset/trikRuntime/hooks","issue_events_url":"https://api.github.com/repos/trikset/trikRuntime/issues/events{/number}","events_url":"https://api.github.com/repos/trikset/trikRuntime/events","assignees_url":"https://api.github.com/repos/trikset/trikRuntime/assignees{/user}","branches_url":"https://api.github.com/repos/trikset/trikRuntime/branches{/branch}","tags_url":"https://api.github.com/repos/trikset/trikRuntime/tags","blobs_url":"https://api.github.com/repos/trikset/trikRuntime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trikset/trikRuntime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trikset/trikRuntime/git/refs{/sha}","trees_url":"https://api.github.com/repos/trikset/trikRuntime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trikset/trikRuntime/statuses/{sha}","languages_url":"https://api.github.com/repos/trikset/trikRuntime/languages","stargazers_url":"https://api.github.com/repos/trikset/trikRuntime/stargazers","contributors_url":"https://api.github.com/repos/trikset/trikRuntime/contributors","subscribers_url":"https://api.github.com/repos/trikset/trikRuntime/subscribers","subscription_url":"https://api.github.com/repos/trikset/trikRuntime/subscription","commits_url":"https://api.github.com/repos/trikset/trikRuntime/commits{/sha}","git_commits_url":"https://api.github.com/repos/trikset/trikRuntime/git/commits{/sha}","comments_url":"https://api.github.com/repos/trikset/trikRuntime/comments{/number}","issue_comment_url":"https://api.github.com/repos/trikset/trikRuntime/issues/comments{/number}","contents_url":"https://api.github.com/repos/trikset/trikRuntime/contents/{+path}","compare_url":"https://api.github.com/repos/trikset/trikRuntime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trikset/trikRuntime/merges","archive_url":"https://api.github.com/repos/trikset/trikRuntime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trikset/trikRuntime/downloads","issues_url":"https://api.github.com/repos/trikset/trikRuntime/issues{/number}","pulls_url":"https://api.github.com/repos/trikset/trikRuntime/pulls{/number}","milestones_url":"https://api.github.com/repos/trikset/trikRuntime/milestones{/number}","notifications_url":"https://api.github.com/repos/trikset/trikRuntime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trikset/trikRuntime/labels{/name}","releases_url":"https://api.github.com/repos/trikset/trikRuntime/releases{/id}","deployments_url":"https://api.github.com/repos/trikset/trikRuntime/deployments","created_at":"2013-09-04T10:26:27Z","updated_at":"2016-06-27T13:27:06Z","pushed_at":"2016-07-22T07:07:02Z","git_url":"git://github.com/trikset/trikRuntime.git","ssh_url":"git@github.com:trikset/trikRuntime.git","clone_url":"https://github.com/trikset/trikRuntime.git","svn_url":"https://github.com/trikset/trikRuntime","homepage":null,"size":10068,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":7,"forks":32,"open_issues":7,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trikset/trikRuntime/pulls/184"},"html":{"href":"https://github.com/trikset/trikRuntime/pull/184"},"issue":{"href":"https://api.github.com/repos/trikset/trikRuntime/issues/184"},"comments":{"href":"https://api.github.com/repos/trikset/trikRuntime/issues/184/comments"},"review_comments":{"href":"https://api.github.com/repos/trikset/trikRuntime/pulls/184/comments"},"review_comment":{"href":"https://api.github.com/repos/trikset/trikRuntime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trikset/trikRuntime/pulls/184/commits"},"statuses":{"href":"https://api.github.com/repos/trikset/trikRuntime/statuses/fb55866dc0f02722ff4d6d681c0979b2e6874469"}}}}
{"actor":{"display_login":"yurii-litvinov"}}