{"action":"created","comment":{"url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/comments/81949104","pull_request_review_id":2890126,"id":81949104,"diff_hunk":"@@ -0,0 +1,99 @@\n+/*\n+ Copyright (c) 2016, Ford Motor Company\n+ All rights reserved.\n+\n+ Redistribution and use in source and binary forms, with or without\n+ modification, are permitted provided that the following conditions are met:\n+\n+ Redistributions of source code must retain the above copyright notice, this\n+ list of conditions and the following disclaimer.\n+\n+ Redistributions in binary form must reproduce the above copyright notice,\n+ this list of conditions and the following\n+ disclaimer in the documentation and/or other materials provided with the\n+ distribution.\n+\n+ Neither the name of the Ford Motor Company nor the names of its contributors\n+ may be used to endorse or promote products derived from this software\n+ without specific prior written permission.\n+\n+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include \"can_cooperation/validators/struct_validators/temperature_validator.h\"\n+#include \"can_cooperation/can_module_constants.h\"\n+\n+namespace can_cooperation {\n+\n+namespace validators {\n+\n+CREATE_LOGGERPTR_GLOBAL(logger_, \"TemperatureValidator\")\n+\n+using message_params::kValueC;\n+using message_params::kValueF;\n+using message_params::kUnit;\n+\n+TemperatureValidator::TemperatureValidator() {\n+\n+  // name=\"ValueC\"\n+  value_c_[ValidationParams::TYPE] = ValueType::DOUBLE;\n+  value_c_[ValidationParams::MIN_VALUE] = 14;\n+  value_c_[ValidationParams::MAX_VALUE] = 30;\n+  value_c_[ValidationParams::ARRAY] = 0;\n+  value_c_[ValidationParams::MANDATORY] = 0;\n+\n+  // name=\"ValueF\"\n+  value_f_[ValidationParams::TYPE] = ValueType::DOUBLE;\n+  value_f_[ValidationParams::MIN_VALUE] = 60;\n+  value_f_[ValidationParams::MAX_VALUE] = 90;\n+  value_f_[ValidationParams::ARRAY] = 0;\n+  value_f_[ValidationParams::MANDATORY] = 0;\n+\n+  validation_scope_map_[kValueF] = &value_f_;\n+  validation_scope_map_[kValueC] = &value_c_;\n+}\n+\n+ValidationResult TemperatureValidator::Validate(const Json::Value& json,\n+                                                 Json::Value& outgoing_json) {\n+  LOG4CXX_AUTO_TRACE(logger_);\n+\n+  if (json.isMember(kUnit)) {\n+    if (enums_value::kFahrenheit == json[kUnit]) {\n+      if (!json.isMember(kValueF)) {\n+        LOG4CXX_ERROR(logger_, \"Param \" <<kValueF <<\"is missed!\");\n+        return INVALID_DATA;\n+      }\n+\n+      json.removeMember(kValueC);\n+    } else if (enums_value::kCelsius == json[kUnit]) {\n+      if (!json.isMember(kValueC)) {\n+        LOG4CXX_ERROR(logger_, \"Param \" <<kValueC <<\"is missed!\");","path":"src/components/can_cooperation/src/validators/struct_validators/temperature_validator.cc","position":80,"original_position":80,"commit_id":"036f3a730d017933d191bcce8302b78d6b90494f","original_commit_id":"036f3a730d017933d191bcce8302b78d6b90494f","user":{"login":"VladSemenyuk","id":12031221,"avatar_url":"https://avatars.githubusercontent.com/u/12031221?v=3","gravatar_id":"","url":"https://api.github.com/users/VladSemenyuk","html_url":"https://github.com/VladSemenyuk","followers_url":"https://api.github.com/users/VladSemenyuk/followers","following_url":"https://api.github.com/users/VladSemenyuk/following{/other_user}","gists_url":"https://api.github.com/users/VladSemenyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/VladSemenyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladSemenyuk/subscriptions","organizations_url":"https://api.github.com/users/VladSemenyuk/orgs","repos_url":"https://api.github.com/users/VladSemenyuk/repos","events_url":"https://api.github.com/users/VladSemenyuk/events{/privacy}","received_events_url":"https://api.github.com/users/VladSemenyuk/received_events","type":"User","site_admin":false},"body":"You mean in log text, i understand\r\n","created_at":"2016-10-05T11:06:58Z","updated_at":"2016-10-05T11:06:58Z","html_url":"https://github.com/CustomSDL/sdl_core/pull/251#discussion_r81949104","pull_request_url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251","_links":{"self":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/comments/81949104"},"html":{"href":"https://github.com/CustomSDL/sdl_core/pull/251#discussion_r81949104"},"pull_request":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251"}}},"pull_request":{"url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251","id":88043798,"html_url":"https://github.com/CustomSDL/sdl_core/pull/251","diff_url":"https://github.com/CustomSDL/sdl_core/pull/251.diff","patch_url":"https://github.com/CustomSDL/sdl_core/pull/251.patch","issue_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues/251","number":251,"state":"open","locked":false,"title":"REVSDL-2665 Change logic for updated protocol of Climate control","user":{"login":"VladSemenyuk","id":12031221,"avatar_url":"https://avatars.githubusercontent.com/u/12031221?v=3","gravatar_id":"","url":"https://api.github.com/users/VladSemenyuk","html_url":"https://github.com/VladSemenyuk","followers_url":"https://api.github.com/users/VladSemenyuk/followers","following_url":"https://api.github.com/users/VladSemenyuk/following{/other_user}","gists_url":"https://api.github.com/users/VladSemenyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/VladSemenyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladSemenyuk/subscriptions","organizations_url":"https://api.github.com/users/VladSemenyuk/orgs","repos_url":"https://api.github.com/users/VladSemenyuk/repos","events_url":"https://api.github.com/users/VladSemenyuk/events{/privacy}","received_events_url":"https://api.github.com/users/VladSemenyuk/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-05T09:30:52Z","updated_at":"2016-10-05T11:06:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14d771f93fdaf1252a093e7e41b70992c468b40c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251/commits","review_comments_url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251/comments","review_comment_url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues/251/comments","statuses_url":"https://api.github.com/repos/CustomSDL/sdl_core/statuses/036f3a730d017933d191bcce8302b78d6b90494f","head":{"label":"CustomSDL:climate-control_develop","ref":"climate-control_develop","sha":"036f3a730d017933d191bcce8302b78d6b90494f","user":{"login":"CustomSDL","id":11158379,"avatar_url":"https://avatars.githubusercontent.com/u/11158379?v=3","gravatar_id":"","url":"https://api.github.com/users/CustomSDL","html_url":"https://github.com/CustomSDL","followers_url":"https://api.github.com/users/CustomSDL/followers","following_url":"https://api.github.com/users/CustomSDL/following{/other_user}","gists_url":"https://api.github.com/users/CustomSDL/gists{/gist_id}","starred_url":"https://api.github.com/users/CustomSDL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustomSDL/subscriptions","organizations_url":"https://api.github.com/users/CustomSDL/orgs","repos_url":"https://api.github.com/users/CustomSDL/repos","events_url":"https://api.github.com/users/CustomSDL/events{/privacy}","received_events_url":"https://api.github.com/users/CustomSDL/received_events","type":"Organization","site_admin":false},"repo":{"id":33346123,"name":"sdl_core","full_name":"CustomSDL/sdl_core","owner":{"login":"CustomSDL","id":11158379,"avatar_url":"https://avatars.githubusercontent.com/u/11158379?v=3","gravatar_id":"","url":"https://api.github.com/users/CustomSDL","html_url":"https://github.com/CustomSDL","followers_url":"https://api.github.com/users/CustomSDL/followers","following_url":"https://api.github.com/users/CustomSDL/following{/other_user}","gists_url":"https://api.github.com/users/CustomSDL/gists{/gist_id}","starred_url":"https://api.github.com/users/CustomSDL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustomSDL/subscriptions","organizations_url":"https://api.github.com/users/CustomSDL/orgs","repos_url":"https://api.github.com/users/CustomSDL/repos","events_url":"https://api.github.com/users/CustomSDL/events{/privacy}","received_events_url":"https://api.github.com/users/CustomSDL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CustomSDL/sdl_core","description":"SmartDeviceLink Head Unit Emulator","fork":true,"url":"https://api.github.com/repos/CustomSDL/sdl_core","forks_url":"https://api.github.com/repos/CustomSDL/sdl_core/forks","keys_url":"https://api.github.com/repos/CustomSDL/sdl_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CustomSDL/sdl_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CustomSDL/sdl_core/teams","hooks_url":"https://api.github.com/repos/CustomSDL/sdl_core/hooks","issue_events_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues/events{/number}","events_url":"https://api.github.com/repos/CustomSDL/sdl_core/events","assignees_url":"https://api.github.com/repos/CustomSDL/sdl_core/assignees{/user}","branches_url":"https://api.github.com/repos/CustomSDL/sdl_core/branches{/branch}","tags_url":"https://api.github.com/repos/CustomSDL/sdl_core/tags","blobs_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CustomSDL/sdl_core/statuses/{sha}","languages_url":"https://api.github.com/repos/CustomSDL/sdl_core/languages","stargazers_url":"https://api.github.com/repos/CustomSDL/sdl_core/stargazers","contributors_url":"https://api.github.com/repos/CustomSDL/sdl_core/contributors","subscribers_url":"https://api.github.com/repos/CustomSDL/sdl_core/subscribers","subscription_url":"https://api.github.com/repos/CustomSDL/sdl_core/subscription","commits_url":"https://api.github.com/repos/CustomSDL/sdl_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/CustomSDL/sdl_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/CustomSDL/sdl_core/contents/{+path}","compare_url":"https://api.github.com/repos/CustomSDL/sdl_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CustomSDL/sdl_core/merges","archive_url":"https://api.github.com/repos/CustomSDL/sdl_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CustomSDL/sdl_core/downloads","issues_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues{/number}","pulls_url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls{/number}","milestones_url":"https://api.github.com/repos/CustomSDL/sdl_core/milestones{/number}","notifications_url":"https://api.github.com/repos/CustomSDL/sdl_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CustomSDL/sdl_core/labels{/name}","releases_url":"https://api.github.com/repos/CustomSDL/sdl_core/releases{/id}","deployments_url":"https://api.github.com/repos/CustomSDL/sdl_core/deployments","created_at":"2015-04-03T04:26:56Z","updated_at":"2016-08-24T03:41:54Z","pushed_at":"2016-10-05T09:37:56Z","git_url":"git://github.com/CustomSDL/sdl_core.git","ssh_url":"git@github.com:CustomSDL/sdl_core.git","clone_url":"https://github.com/CustomSDL/sdl_core.git","svn_url":"https://github.com/CustomSDL/sdl_core","homepage":"","size":311337,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"CustomSDL:feature/climate-control","ref":"feature/climate-control","sha":"38ef3d93b620a4c014e1ed354d5c04797e1a5582","user":{"login":"CustomSDL","id":11158379,"avatar_url":"https://avatars.githubusercontent.com/u/11158379?v=3","gravatar_id":"","url":"https://api.github.com/users/CustomSDL","html_url":"https://github.com/CustomSDL","followers_url":"https://api.github.com/users/CustomSDL/followers","following_url":"https://api.github.com/users/CustomSDL/following{/other_user}","gists_url":"https://api.github.com/users/CustomSDL/gists{/gist_id}","starred_url":"https://api.github.com/users/CustomSDL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustomSDL/subscriptions","organizations_url":"https://api.github.com/users/CustomSDL/orgs","repos_url":"https://api.github.com/users/CustomSDL/repos","events_url":"https://api.github.com/users/CustomSDL/events{/privacy}","received_events_url":"https://api.github.com/users/CustomSDL/received_events","type":"Organization","site_admin":false},"repo":{"id":33346123,"name":"sdl_core","full_name":"CustomSDL/sdl_core","owner":{"login":"CustomSDL","id":11158379,"avatar_url":"https://avatars.githubusercontent.com/u/11158379?v=3","gravatar_id":"","url":"https://api.github.com/users/CustomSDL","html_url":"https://github.com/CustomSDL","followers_url":"https://api.github.com/users/CustomSDL/followers","following_url":"https://api.github.com/users/CustomSDL/following{/other_user}","gists_url":"https://api.github.com/users/CustomSDL/gists{/gist_id}","starred_url":"https://api.github.com/users/CustomSDL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustomSDL/subscriptions","organizations_url":"https://api.github.com/users/CustomSDL/orgs","repos_url":"https://api.github.com/users/CustomSDL/repos","events_url":"https://api.github.com/users/CustomSDL/events{/privacy}","received_events_url":"https://api.github.com/users/CustomSDL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CustomSDL/sdl_core","description":"SmartDeviceLink Head Unit Emulator","fork":true,"url":"https://api.github.com/repos/CustomSDL/sdl_core","forks_url":"https://api.github.com/repos/CustomSDL/sdl_core/forks","keys_url":"https://api.github.com/repos/CustomSDL/sdl_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CustomSDL/sdl_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CustomSDL/sdl_core/teams","hooks_url":"https://api.github.com/repos/CustomSDL/sdl_core/hooks","issue_events_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues/events{/number}","events_url":"https://api.github.com/repos/CustomSDL/sdl_core/events","assignees_url":"https://api.github.com/repos/CustomSDL/sdl_core/assignees{/user}","branches_url":"https://api.github.com/repos/CustomSDL/sdl_core/branches{/branch}","tags_url":"https://api.github.com/repos/CustomSDL/sdl_core/tags","blobs_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CustomSDL/sdl_core/statuses/{sha}","languages_url":"https://api.github.com/repos/CustomSDL/sdl_core/languages","stargazers_url":"https://api.github.com/repos/CustomSDL/sdl_core/stargazers","contributors_url":"https://api.github.com/repos/CustomSDL/sdl_core/contributors","subscribers_url":"https://api.github.com/repos/CustomSDL/sdl_core/subscribers","subscription_url":"https://api.github.com/repos/CustomSDL/sdl_core/subscription","commits_url":"https://api.github.com/repos/CustomSDL/sdl_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/CustomSDL/sdl_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/CustomSDL/sdl_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/CustomSDL/sdl_core/contents/{+path}","compare_url":"https://api.github.com/repos/CustomSDL/sdl_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CustomSDL/sdl_core/merges","archive_url":"https://api.github.com/repos/CustomSDL/sdl_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CustomSDL/sdl_core/downloads","issues_url":"https://api.github.com/repos/CustomSDL/sdl_core/issues{/number}","pulls_url":"https://api.github.com/repos/CustomSDL/sdl_core/pulls{/number}","milestones_url":"https://api.github.com/repos/CustomSDL/sdl_core/milestones{/number}","notifications_url":"https://api.github.com/repos/CustomSDL/sdl_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CustomSDL/sdl_core/labels{/name}","releases_url":"https://api.github.com/repos/CustomSDL/sdl_core/releases{/id}","deployments_url":"https://api.github.com/repos/CustomSDL/sdl_core/deployments","created_at":"2015-04-03T04:26:56Z","updated_at":"2016-08-24T03:41:54Z","pushed_at":"2016-10-05T09:37:56Z","git_url":"git://github.com/CustomSDL/sdl_core.git","ssh_url":"git@github.com:CustomSDL/sdl_core.git","clone_url":"https://github.com/CustomSDL/sdl_core.git","svn_url":"https://github.com/CustomSDL/sdl_core","homepage":"","size":311337,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251"},"html":{"href":"https://github.com/CustomSDL/sdl_core/pull/251"},"issue":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/issues/251"},"comments":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/CustomSDL/sdl_core/statuses/036f3a730d017933d191bcce8302b78d6b90494f"}}}}
{"actor":{"display_login":"VladSemenyuk"}}