{"id":3625,"date":"2019-03-25T17:45:11","date_gmt":"2019-03-25T20:45:11","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/storing-data-from-commands-sent-via-elipse-power\/"},"modified":"2019-05-29T16:37:41","modified_gmt":"2019-05-29T19:37:41","slug":"storing-data-from-commands-sent-via-elipse-power","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/","title":{"rendered":"Storing data from commands sent via Elipse Power."},"content":{"rendered":"<div align=\"justify\">\n<p><b>Question: <\/b><\/p>\n<p>How can I insert into the database the information from the commands sent via Elipse Power?<br \/>\n<b><br \/>\nSolution:<br \/>\n<\/b><br \/>\nIn this example, four different types of data will be inserted in the database, regarding each sent command:<\/p>\n<ul>\n<li>Operator logged to the system.<\/li>\n<li>Command unit (from there on, you can check the object corresponding to the command).<\/li>\n<li>Command type (Select\/Operate\/Cancel).<\/li>\n<li>Timestamp.<\/li>\n<\/ul>\n<p>To do so, follow these procedures:<\/p>\n<p>1. Create three internal tags and set them up as Strings. As seen below, the new tags were named <i><b>CommandType<\/b><\/i>, <b><i>CommandUnit<\/i><\/b>, and <i><b>User<\/b><\/i>:<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID5322\/Picture_1.jpg\" alt=\"\" width=\"430\" height=\"162\" align=\"baseline\" border=\"0\" \/><\/div>\n<p>2. Create historic whose <i>ScanTime <\/i>property (or <b>Save a new record every&#8230;<\/b> option at the historic&#8217;s settings) is set up as 0. In this historic, create three String-type fields, and link them to the <i>Value <\/i>property of the internal tags previously created. For this example, a historic called <b>HistCommand <\/b>was created, containing <i><b>CommandUnit<\/b><\/i>, <i><b>CommandType<\/b><\/i>, and <i><b>User <\/b><\/i>fields, according to the figure below:<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID5322\/Picture_2.jpg\" alt=\"\" width=\"520\" height=\"127\" align=\"baseline\" border=\"0\" \/><\/div>\n<p><b>NOTE<\/b>: when setting up a field as a String, you will need to also set up this field&#8217;s size.<\/p>\n<p>3. After creating the historic and generating the table in the database, you need to set up which commands will be recorded in this DB. In this example, there is only one breaker object, so the data regarding this object&#8217;s position command are inserted in the database. Elipse Power&#8217;s command objects contain a property called <i>EnablePowerConfigEvent<\/i>, whose function is to enable\/disable the generation of <i>OnCommand <\/i>events from <b>ConfigurationPower <\/b>object (see next item). Therefore, in this item, the <i>EnablePowerConfigEvent <\/i>property of the commands to be recorded must be set up as TRUE, as seen below:<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID5322\/Picture_3.jpg\" alt=\"\" width=\"520\" height=\"254\" align=\"baseline\" border=\"0\" \/><\/div>\n<p>4. Finally, create a script at <b>ConfigurationPower<\/b>&#8216;s <i>OnCommand <\/i>event. This event will be fired whenever any command is executed (as long as <i>EnablePowerConfigEvent <\/i>property is set up as TRUE). This event returns the following parameters: <i><b>CommandUnit <\/b><\/i>(Command Unit receiving the command), <b><i>CommandAction <\/i><\/b>(integer that indicates the command type: 1-Operate, 2-Select, 3-Cancel), and <i><b>ActorID <\/b><\/i>(name of the user sending the command).<\/p>\n<p>The script will be developed in order to attribute the necessary information regarding each command to the internal tags previously created, and after that, to insert a new line in the table.<\/p>\n<p>As seen above, the <i>OnCommand <\/i>event returns three parameters which must be linked to the internal tags&#8217; values. Notice that <i><b>CommandUnit <\/b><\/i>parameter returns an object, therefore it must use a property from this object. In this example, the script is as follows:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Select case CommandAction<\/span><br \/>\n<span style=\"font-family: Courier New;\">Case 1 <\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Dados.CommandType&#8221;).Value = &#8220;Operate&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">Case 2 <\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Dados.CommandType&#8221;).Value = &#8220;Select&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">Case 3<\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Dados.CommandType&#8221;).Value = &#8220;Cancel&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">End Select <\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Dados.CommandUnit&#8221;).Value = CommandUnit.PathName<\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Dados.User&#8221;).Value = ActorId<\/span><\/div>\n<p>After linking the parameters returned by the event to the internal tags, insert a new record in the table from the historic&#8217;s <i>WriteRecord <\/i>method as seen below:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Command&#8221;).WriteRecord()<br \/>\n<\/span><\/div>\n<p>By the end, you will have the following script:<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID5322\/Picture_4.jpg\" alt=\"\" width=\"520\" height=\"451\" align=\"baseline\" border=\"0\" \/><\/div>\n<p>Attached to this article is the demo application developed above (user: <b>Elipse <\/b>\/ password: <b>Elipse<\/b>).<\/p>\n<h3>Attachments:<\/h3>\n<p><a href=\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/03\/3625\/App-14.zip\">App.zip<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Question: How can I insert into the database the information from the commands sent via Elipse Power? Solution: In this example, four different types of data will be inserted in&hellip;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[825],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Storing data from commands sent via Elipse Power. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Storing data from commands sent via Elipse Power.\" \/>\n<meta property=\"og:description\" content=\"Question: How can I insert into the database the information from the commands sent via Elipse Power? Solution: In this example, four different types of data will be inserted in&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:45:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-29T19:37:41+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID5322\/Picture_1.jpg\" \/>\n<meta name=\"author\" content=\"Eduardo Grazziotin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eduardo Grazziotin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\"},\"author\":{\"name\":\"Eduardo Grazziotin\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/f9fc2442228f8cc06308387a6725ef03\"},\"headline\":\"Storing data from commands sent via Elipse Power.\",\"datePublished\":\"2019-03-25T20:45:11+00:00\",\"dateModified\":\"2019-05-29T19:37:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\"},\"wordCount\":1002,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Elipse Power\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\",\"name\":\"[:pt]Storing data from commands sent via Elipse Power.[:en]Storing data from commands sent via Elipse Power.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:45:11+00:00\",\"dateModified\":\"2019-05-29T19:37:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Storing data from commands sent via Elipse Power.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/f9fc2442228f8cc06308387a6725ef03\",\"name\":\"Eduardo Grazziotin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/47913ac4c8f427d44c6391bff49b275f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/47913ac4c8f427d44c6391bff49b275f?s=96&d=mm&r=g\",\"caption\":\"Eduardo Grazziotin\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/eduardo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Storing data from commands sent via Elipse Power. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]Storing data from commands sent via Elipse Power.[:en]Storing data from commands sent via Elipse Power.[:] - Elipse Knowledgebase","og_description":"Question: How can I insert into the database the information from the commands sent via Elipse Power? Solution: In this example, four different types of data will be inserted in&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:45:11+00:00","article_modified_time":"2019-05-29T19:37:41+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID5322\/Picture_1.jpg"}],"author":"Eduardo Grazziotin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Eduardo Grazziotin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/"},"author":{"name":"Eduardo Grazziotin","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/f9fc2442228f8cc06308387a6725ef03"},"headline":"Storing data from commands sent via Elipse Power.","datePublished":"2019-03-25T20:45:11+00:00","dateModified":"2019-05-29T19:37:41+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/"},"wordCount":1002,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Elipse Power"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/","url":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/","name":"[:pt]Storing data from commands sent via Elipse Power.[:en]Storing data from commands sent via Elipse Power.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:45:11+00:00","dateModified":"2019-05-29T19:37:41+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/storing-data-from-commands-sent-via-elipse-power\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Storing data from commands sent via Elipse Power."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/f9fc2442228f8cc06308387a6725ef03","name":"Eduardo Grazziotin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/47913ac4c8f427d44c6391bff49b275f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/47913ac4c8f427d44c6391bff49b275f?s=96&d=mm&r=g","caption":"Eduardo Grazziotin"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/eduardo\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3625"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=3625"}],"version-history":[{"count":5,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3625\/revisions"}],"predecessor-version":[{"id":6722,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3625\/revisions\/6722"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=3625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=3625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=3625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}