Merge pull request #70 from Hieromon/master

Fixed issue #64
pull/123/head
Hieromon Ikasamo 6 years ago committed by GitHub
commit ed441c3d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      README.md
  2. 18
      docs/acelements.html
  3. 20
      docs/achandling.html
  4. 6
      docs/api.html
  5. 13
      docs/apiaux.html
  6. 84
      docs/apielements.html
  7. 22
      docs/changelog.html
  8. 2
      docs/faq.html
  9. 258
      docs/images/ac_load_save.svg
  10. 2
      docs/search/search_index.json
  11. 48
      docs/sitemap.xml
  12. BIN
      docs/sitemap.xml.gz
  13. 204
      examples/Elements/Elements.ino
  14. 3
      examples/Simple/Simple.ino
  15. 2
      examples/mqttRSSI/mqttRSSI.ino
  16. 2
      examples/mqttRSSI_NA/mqttRSSI_NA.ino
  17. 6
      mkdocs/acelements.md
  18. 13
      mkdocs/achandling.md
  19. 6
      mkdocs/api.md
  20. 15
      mkdocs/apiaux.md
  21. 38
      mkdocs/apielements.md
  22. 12
      mkdocs/changelog.md
  23. 258
      mkdocs/images/ac_load_save.svg
  24. 2
      src/AutoConnect.h
  25. 65
      src/AutoConnectAux.cpp
  26. 38
      src/AutoConnectAux.h
  27. 31
      src/AutoConnectAuxImpl.h
  28. 14
      src/AutoConnectElementJsonImpl.h

@ -96,17 +96,21 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
## Change log
### [0.9.8] Apr. 25, 2019
### [0.9.8] May 3, 2019
- Supports ArduinoJson 6.9.1 or later.
- Supports allocating JsonDocument buffer to PSRAM on ESP32 with ArduinoJson 6.10.0 or later.
- Supports **operator`[]`** as a shortcut for AutoConnectAux::getElement function.
- Supports **AutoConnectElement::as<T\>** function to easily coding for conversion from an AutoConnectElement to an actual type.
- Supports new element type **AutoConnectFile** and built-in file uploader.
- Supports a **format attribute** with the AutoConnectText element.
- Supports a **AutoConnectSelect::selected** attribute.
- Fixed blank page responds with Configure new.
- Fixed the value of AutoConnectElements not reflected.
- Supports a **format** attribute with the AutoConnectText element.
- Supports a **selected** attribute with the AutoConnectSelect element.
- Supports multiple element loading with AutoConnectAux::loadElement.
- Changed menu labels placement in source files structure.
- Changed API interface of AutoConnect::where function.
- Fixed blank page responds with Configure new.
- Fixed loading elements value missing.
- Fixed losing elements in saveElement with ArduinoJson V6.
- Fixed compile error with older than ESP8266 core 2.5.0.
### [0.9.7] Feb. 25, 2019
- Fixed crash in some environments. Thank you @ageurtse

@ -732,6 +732,13 @@
label
</a>
</li>
<li class="md-nav__item">
<a href="#selected" title=" selected" class="md-nav__link">
selected
</a>
</li>
</ul>
@ -1508,6 +1515,13 @@
label
</a>
</li>
<li class="md-nav__item">
<a href="#selected" title=" selected" class="md-nav__link">
selected
</a>
</li>
</ul>
@ -1859,7 +1873,7 @@ Only <i class="far fa-square"></i> will be displayed if a label is not specified
<small><strong><code>AutoConnectSelect select("select", { String("Europe/London"), String("Europe/Berlin"), String("Europe/Helsinki"), String("Europe/Moscow"), String("Asia/Dubai") }, "Select TZ name");</code></strong></small></p>
<p><small>On the page:</small><br><img src="images/acselect.png"></p>
<h3 id="constructor_6"><i class="fa fa-edit"></i> Constructor<a class="headerlink" href="#constructor_6" title="Permanent link">&para;</a></h3>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">AutoConnectSelect(</span><span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">name,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">options,</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">label)</span>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">AutoConnectSelect(</span><span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">name,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">options,</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">label,</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">uint8_t</span> <span style="color: #f8f8f2">selected)</span>
</pre></div>
<h3 id="name_6"><i class="fa fa-caret-right"></i> name<a class="headerlink" href="#name_6" title="Permanent link">&para;</a></h3>
@ -1868,6 +1882,8 @@ Only <i class="far fa-square"></i> will be displayed if a label is not specified
<p>An <code>options</code> is an array of String type for the options which as actually <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> for an HTML <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">option</span><span style="color: #f8f8f2">&gt;</span></code> tag. It is an initialization list can be used. The option tags will be generated from each entry in the options, the amount of which is the same as the number of items in an <code>options</code>.</p>
<h3 id="label_4"><i class="fa fa-caret-right"></i> label<a class="headerlink" href="#label_4" title="Permanent link">&para;</a></h3>
<p>A <code>label</code> is an optional string. A label is always arranged on the left side of the drop-down list. Specification of a label will generate an HTML <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">label</span><span style="color: #f8f8f2">&gt;</span></code> tag with an id attribute. The select tag and the label are connected by the id attribute.</p>
<h3 id="selected"><i class="fa fa-caret-right"></i> selected<a class="headerlink" href="#selected" title="Permanent link">&para;</a></h3>
<p>A <code>selected</code> is an optional value. Specifies that an option should be pre-selected when the page loads.</p>
<h2 id="autoconnectsubmit">AutoConnectSubmit<a class="headerlink" href="#autoconnectsubmit" title="Permanent link">&para;</a></h2>
<p>AutoConnectSubmit generates an HTML <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">input</span> <span style="color: #a6e22e">type</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;button&quot;</span><span style="color: #f8f8f2">&gt;</span></code> tag attached <code class="codehilite">onclick</code> attribute. The native code of the <code class="codehilite">onclick</code> attribute is the submission of the form with the <strong>POST</strong> method.</p>
<p><i class="fa fa-eye"></i> <strong>Sample</strong><br>

@ -1148,7 +1148,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
</pre></div>
<h2 id="loading-saving-autoconnectelements-with-json">Loading &amp; saving AutoConnectElements with JSON<a class="headerlink" href="#loading-saving-autoconnectelements-with-json" title="Permanent link">&para;</a></h2>
<p>AutoConnect supports reading the custom Web page definitions written in JSON and also supports loading and saving of AutoConnectElements. In both cases, the target object is a <a href="acjson.html">JSON document for AutoConnect</a>. However, it can not save all AutoConnectElements contained in the page as a custom Web page. (ie. AutoConnectAux)</p>
<p>AutoConnect supports reading the custom Web page definitions written in JSON and also supports loading and saving of AutoConnectAux or AutoConnectElements. In both cases, the target object is a <a href="acjson.html">JSON document for AutoConnect</a>. However, it can not save all AutoConnectElements contained in the page as a custom Web page. (ie. AutoConnectAux)</p>
<p><img src="images/ac_load_save.svg"></p>
<h3 id="loading-autoconnectaux-autoconnectelements-with-json"><i class="fa fa-upload"></i> Loading AutoConnectAux &amp; AutoConnectElements with JSON<a class="headerlink" href="#loading-autoconnectaux-autoconnectelements-with-json" title="Permanent link">&para;</a></h3>
<p>To load a JSON document as AutoConnectAux use the <a href="api.html#load"><strong>AutoConnect::load</strong></a> function and load the JSON document of each AutoConnectElement using the <a href="apiaux.html#loadelement"><strong>AutoConnectAux::loadElement</strong></a> function. Although the functions of both are similar, the structure of the target JSON document is different.</p>
@ -1216,7 +1216,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
</pre></div>
<h3 id="saving-autoconnectelements-with-json"><i class="fa fa-download"></i> Saving AutoConnectElements with JSON<a class="headerlink" href="#saving-autoconnectelements-with-json" title="Permanent link">&para;</a></h3>
<p>To save the AutoConnectElement as a JSON document, use the <a href="apiaux.html#saveelement">AutoConnectAux::saveElement</a> function. It serializes the contents of the object based on the type of the AutoConnectElement. You can persist a serialized AutoConnectElements as a JSON document to a stream.</p>
<p>To save the AutoConnectAux or the AutoConnectElement as a JSON document, use the <a href="apiaux.html#saveelement">AutoConnectAux::saveElement</a> function. It serializes the contents of the object based on the type of the AutoConnectElement. You can persist a serialized AutoConnectElements as a JSON document to a stream.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #75715e">// Open a parameter file on the SPIFFS.</span>
<span style="color: #f8f8f2">SPIFFS.begin();</span>
<span style="color: #66d9ef">FILE</span> <span style="color: #f8f8f2">param</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">SPIFFS.open(</span><span style="color: #e6db74">&quot;/param&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #e6db74">&quot;w&quot;</span><span style="color: #f8f8f2">);</span>
@ -1252,6 +1252,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<span style="color: #f8f8f2">]</span>
</pre></div>
<p>Above JSON document can be loaded as it is into a custom Web page using the loadElement function. The loadElement function also loads the value of the element, so the saved value can be restored on the custom Web page.</p>
<h2 id="custom-field-data-handling">Custom field data handling<a class="headerlink" href="#custom-field-data-handling" title="Permanent link">&para;</a></h2>
<p>A sketch can access variables of AutoConnectElements in the custom Web page. The value entered into the AutoConnectElements on the page is stored in the member variable of each element by AutoConnect whenever GET/POST transmission occurs. </p>
<p>The following diagram shows the flow of the input values of a custom Web page into a sketch and is the basis for actions to manipulate the values of custom Web pages using sketches.</p>
@ -1361,12 +1362,13 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<span style="color: #f8f8f2">String</span> <span style="color: #a6e22e">feelsOn</span><span style="color: #f8f8f2">(AutoConnectAux</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">aux,</span> <span style="color: #f8f8f2">PageArgument</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">args)</span> <span style="color: #f8f8f2">{</span>
<span style="color: #75715e">// Get the AutoConnectInput named &quot;feels&quot;.</span>
<span style="color: #75715e">// The where() function returns the AutoConnectAux of the page that triggered this handler.</span>
<span style="background-color: #49483e"> <span style="color: #f8f8f2">AutoConnectInput</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">feels</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">portal.where()</span><span style="color: #f92672">-&gt;</span><span style="color: #f8f8f2">getElement</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">AutoConnectInput</span><span style="color: #f92672">&gt;</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&quot;feels&quot;</span><span style="color: #f8f8f2">);</span>
</span>
<span style="color: #75715e">// Get the AutoConnectText named &quot;echo&quot;.</span>
<span style="background-color: #49483e"> <span style="color: #f8f8f2">AutoConnectText</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">echo</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">aux.getElement</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">AutoConnectText</span><span style="color: #f92672">&gt;</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&quot;echo&quot;</span><span style="color: #f8f8f2">);</span>
</span>
<span style="color: #75715e">// The where() function returns an uri string of the AutoConnectAux that triggered this handler.</span>
<span style="background-color: #49483e"> <span style="color: #f8f8f2">AutoConnectAux</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">hello</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">portal.aux(portal.where());</span>
</span> <span style="color: #f8f8f2">AutoConnectInput</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">feels</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">hello</span><span style="color: #f92672">-&gt;</span><span style="color: #f8f8f2">getElement</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">AutoConnectInput</span><span style="color: #f92672">&gt;</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&quot;feels&quot;</span><span style="color: #f8f8f2">);</span>
<span style="background-color: #49483e"> <span style="color: #75715e">// Get the AutoConnectText named &quot;echo&quot;.</span>
</span> <span style="color: #f8f8f2">AutoConnectText</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">echo</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">aux.getElement</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">AutoConnectText</span><span style="color: #f92672">&gt;</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&quot;echo&quot;</span><span style="color: #f8f8f2">);</span>
<span style="color: #75715e">// Echo back from input-box to /feels page.</span>
<span style="color: #f8f8f2">echo.value</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">feels.value</span> <span style="color: #f92672">+</span> <span style="color: #f8f8f2">String(</span><span style="color: #e6db74">&quot; and a bold world!&quot;</span><span style="color: #f8f8f2">);</span>
<span style="color: #66d9ef">return</span> <span style="color: #f8f8f2">String(</span><span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">);</span>
@ -1385,7 +1387,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
</pre></div>
<p>The above example handles in the handler for the values of a custom Web page. An <a href="api.html#on">AutoConnect::on</a> function registers a handler for the AutoConnectAux page of the specified uri. The argument of the custom Web page handler is an AutoConnectAux of the page itself and the <a href="https://github.com/Hieromon/PageBuilder#arguments-of-invoked-user-function">PageArgument</a> object.</p>
<p>To retrieve the values entered in a custom Web page you need to access the AutoConnectElement of the page that caused the request to this page and to do this, you use the <a href="api.html#where">AutoConnect::where</a> function. The <code>AutoConnect::where</code> function returns a pointer to the AutoConnectAux object of the custom Web page that caused the HTTP request.</p>
<p>To retrieve the values entered in a custom Web page you need to access the AutoConnectElement of the page that caused the request to this page and to do this, you use the <a href="api.html#where">AutoConnect::where</a> function. The <code>AutoConnect::where</code> function returns an uri string of the AutoConnectAux object of the custom Web page that caused the HTTP request.</p>
<div class="admonition note">
<p class="admonition-title">The where() function is available for only AutoConnectAux.</p>
<p>The <code>AutoConnect::where</code> function is available only for the AutoConnectAux object. It is invalid for HTTP requests from individual pages registered with the <strong>on</strong> handler of ESP8266WebServer/WebServer for ESP32. In other words, the <code>AutoConnect::where</code> function only returns the last AutoConnecAux page called.</p>

@ -1287,14 +1287,14 @@ Register the handler function for undefined URL request detected.
<dd><span class="apidef">fn</span><span class="apidesc">A function of the "not found" handler.</span></dd>
</dl></p>
<h3 id="where"><i class="fa fa-caret-right"></i> where<a class="headerlink" href="#where" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">AutoConenctAux</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">where(</span><span style="color: #66d9ef">void</span><span style="color: #f8f8f2">)</span>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">String</span> <span style="color: #f8f8f2">where(</span><span style="color: #66d9ef">void</span><span style="color: #f8f8f2">)</span>
</pre></div>
Returns a pointer to the AutoConnectAux object of the custom Web page that caused the request to the page.<br>
Returns an uri string of the AutoConnectAux uri object of the custom Web page that caused the request to the page.<br>
AutoConnect identifies the URI (ie. the referrer URI) that caused the request each time from the client occurs and will save the URI If the request source is a custom Web page of AutoConnectAux. The <strong>where</strong> function returns a pointer of AutoConnectAux which is a URI of a least recent request from the custom Web page.<br>
This function is provided to access the fields (ie. the AutoConnectElements) with a custom Web page handler of a page and is available only for request source that is the custom Web pages. It is invalid for HTTP requests from individual pages registered with the <strong>on</strong> handler of ESP8266WebServer/WebServer for ESP32. In other words, this function only returns the AutoConnecAux page which is a least recently displayed.
<dl class="apidl">
<dt><strong>Return value</strong></dt>
<dd>A pointer to the AutoConnectAux that caused the request the page.</dd>
<dd>An uri string of the AutoConnectAux that caused the request the page.</dd>
</dl></p>
<p>The <strong>where</strong> function usage is described in the section <a href="achandling.html#where-to-pick-up-the-values"><em>Where to pick up the values</em></a>.</p>

@ -996,7 +996,7 @@ Add an element to the AutoConnectAux. An added element is displayed on the custo
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
<dd><span class="apidef">addon</span><span class="apidesc">Reference of AutoConnectElements. Specifies one of the AutoConnectElements classes.</span></dd>
<dd><span class="apidef">addons</span><span class="apidesc">An array list of reference of AutoConnectElements. An <a href="https://en.cppreference.com/w/cpp/language/list_initialization">list initialization</a> of the <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> can be used for the addons parameter cause the actual definition of type <strong>AutoConnectElementVT</strong> is <code>std::vector&lt;std::reference_wrapper&lt;AutoConnectElement&gt;&gt;</code>.</span></dd>
<dd><span class="apidef">addons</span><span class="apidesc">An array list of reference of AutoConnectElements. The <a href="https://en.cppreference.com/w/cpp/language/list_initialization">list initialization</a> with braced-init-list of the <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> can be used for the addons parameter cause the actual definition of type <strong>AutoConnectElementVT</strong> is <code>std::vector&lt;std::reference_wrapper&lt;AutoConnectElement&gt;&gt;</code>.</span></dd>
</dl></p>
<h3 id="getelement"><i class="fa fa-caret-right"></i> getElement<a class="headerlink" href="#getelement" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">T</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">getElement</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">T</span><span style="color: #f92672">&gt;</span><span style="color: #f8f8f2">(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name)</span>
@ -1056,10 +1056,16 @@ Load all AutoConnectElements elements from JSON document into AutoConnectAux as
<h3 id="loadelement"><i class="fa fa-caret-right"></i> loadElement<a class="headerlink" href="#loadelement" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">loadElement(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">in,</span> <span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">String(</span><span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">))</span>
</pre></div>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">loadElement(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">in,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">names)</span>
</pre></div>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">loadElement(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">__FlashStringHelper</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">in,</span> <span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">String(</span><span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">))</span>
</pre></div>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">loadElement(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">__FlashStringHelper</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">in,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">names)</span>
</pre></div>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">loadElement(Stream</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">in,</span> <span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">String(</span><span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">))</span>
</pre></div>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">loadElement(Stream</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">in,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">names)</span>
</pre></div>
Load specified element from JSON document into AutoConnectAux. The JSON document specified by the loadElement function must be the <a href="acjson.html#json-object-for-autoconnectelements">AutoConnectElement document structure</a>. When loading from a JSON document that describes multiple elements, its description must be an array syntax.
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
@ -1070,6 +1076,7 @@ Load specified element from JSON document into AutoConnectAux. The JSON document
<li>Stream : An entity that inherits stream class, generally SPIFFS or SD.
</span></dd>
<dd><span class="apidef">name</span><span class="apidesc">Specifies the name to be load. If the name is not specified, the loadElement function will load all elements contained in the JSON document.</span></dd>
<dd><span class="apidef">names</span><span class="apidesc"> Spefifies an array list of String indicating the name of the element to be loaded. The <a href="https://en.cppreference.com/w/cpp/language/list_initialization">list initialization</a> with braced-init-list of the <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> can be used.</span></dd>
<dt><strong>Return value</strong></dt>
<dd><span class="apidef">true</span><span class="apidesc">Specified AutoConnectElements successfully loaded.</span></dd>
<dd><span class="apidef">false</span><span class="apidesc">JSON document loading failed.</span></dd>
@ -1180,6 +1187,10 @@ Write elements of AutoConnectAux to the stream. The saveElement function outputs
<p class="admonition-title">The output format is pretty</p>
<p>The saveElement function outputs a prettified JSON document.</p>
</div>
<div class="admonition info">
<p class="admonition-title">It is not complementary with loadElement</p>
<p>The saveElement function which missing the names parameter without name list to be saved that saves an entire AutoConnectAux element, not just AutoConnectElements. Its saved JSON document is not a complementary input to the loadElement function. The JSON document describing AutoConnectAux saved without the names parameter must be loaded by the <a href="apiaux.html#load">AutoConnectAux::load</a> function or <a href="api.html#load">AutoConnect::load</a> function.</p>
</div>
<h3 id="setelementvalue"><i class="fa fa-caret-right"></i> setElementValue<a class="headerlink" href="#setelementvalue" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">setElementValue(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name,</span> <span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span> <span style="color: #f8f8f2">value)</span>
</pre></div>

@ -1076,6 +1076,13 @@
label
</a>
</li>
<li class="md-nav__item">
<a href="#selected" title=" selected" class="md-nav__link">
selected
</a>
</li>
</ul>
@ -1117,6 +1124,13 @@
operator &#91;&nbsp;&#93;
</a>
</li>
<li class="md-nav__item">
<a href="#select" title=" select" class="md-nav__link">
select
</a>
</li>
<li class="md-nav__item">
@ -1124,6 +1138,13 @@
size
</a>
</li>
<li class="md-nav__item">
<a href="#value_6" title=" value" class="md-nav__link">
value
</a>
</li>
</ul>
@ -1167,7 +1188,7 @@
</li>
<li class="md-nav__item">
<a href="#value_6" title=" value" class="md-nav__link">
<a href="#value_7" title=" value" class="md-nav__link">
value
</a>
@ -1241,7 +1262,7 @@
</li>
<li class="md-nav__item">
<a href="#value_7" title=" value" class="md-nav__link">
<a href="#value_8" title=" value" class="md-nav__link">
value
</a>
@ -2096,6 +2117,13 @@
label
</a>
</li>
<li class="md-nav__item">
<a href="#selected" title=" selected" class="md-nav__link">
selected
</a>
</li>
</ul>
@ -2137,6 +2165,13 @@
operator &#91;&nbsp;&#93;
</a>
</li>
<li class="md-nav__item">
<a href="#select" title=" select" class="md-nav__link">
select
</a>
</li>
<li class="md-nav__item">
@ -2144,6 +2179,13 @@
size
</a>
</li>
<li class="md-nav__item">
<a href="#value_6" title=" value" class="md-nav__link">
value
</a>
</li>
</ul>
@ -2187,7 +2229,7 @@
</li>
<li class="md-nav__item">
<a href="#value_6" title=" value" class="md-nav__link">
<a href="#value_7" title=" value" class="md-nav__link">
value
</a>
@ -2261,7 +2303,7 @@
</li>
<li class="md-nav__item">
<a href="#value_7" title=" value" class="md-nav__link">
<a href="#value_8" title=" value" class="md-nav__link">
value
</a>
@ -2586,7 +2628,7 @@ Evaluate the pattern as a regexp and return whether value matches. Always return
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">values</span><span class="apidesc">An array of values of the radio buttons. Specifies an <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> object.</span></dd>
<dd><span class="apidef">values</span><span class="apidesc">An array of values of the radio buttons. Specifies a <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> object.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">order</span><span class="apidesc">The direction to arrange the radio buttons.</span></dd>
<dd><span class="apidef">checked</span><span class="apidesc">An index to be checked in the radio buttons.</span></dd>
@ -2688,13 +2730,14 @@ Returns current checked option of the radio buttons.
</dl></p>
<h2 id="autoconnectselect">AutoConnectSelect<a class="headerlink" href="#autoconnectselect" title="Permanent link">&para;</a></h2>
<h3 id="constructor_6"><i class="fa fa-code"></i> Constructor<a class="headerlink" href="#constructor_6" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">AutoConnectSelect(</span><span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">name</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">options</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">{},</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">label</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">)</span>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">AutoConnectSelect(</span><span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">name</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">String</span><span style="color: #f92672">&gt;</span> <span style="color: #66d9ef">const</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">options</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">{},</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">label</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">uint8_t</span> <span style="color: #f8f8f2">selected</span> <span style="color: #f92672">=</span> <span style="color: #ae81ff">0</span><span style="color: #f8f8f2">)</span>
</pre></div>
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">options</span><span class="apidesc">An array of options of the select element. Specifies an <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> object.</span></dd>
<dd><span class="apidef">options</span><span class="apidesc">An array of options of the select element. Specifies a <a href="https://en.cppreference.com/w/cpp/container/vector">std::vector</a> object.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">selected</span><span class="apidesc">An option should be pre-selected when the page loads.</span></dd>
</dl></p>
<h3 id="public-member-variables_6"><i class="fa fa-code"></i> Public member variables<a class="headerlink" href="#public-member-variables_6" title="Permanent link">&para;</a></h3>
<h4 id="name_6"><i class="fa fa-caret-right"></i> name<a class="headerlink" href="#name_6" title="Permanent link">&para;</a></h4>
@ -2715,6 +2758,12 @@ Returns current checked option of the radio buttons.
<dt><strong>Type</strong></dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl></p>
<h4 id="selected"><i class="fa fa-caret-right"></i> selected<a class="headerlink" href="#selected" title="Permanent link">&para;</a></h4>
<p>A <code>selected</code> is an optional value. Specifies 1-based index value of an options array that an option should be pre-selected when the page loads.
<dl class="apidl">
<dt><strong>Type</strong></dt>
<dd><span class="apidef">uint8_t</span><span class="apidesc"></span></dd>
</dl></p>
<h3 id="public-member-functions_6"><i class="fa fa-code"></i> Public member functions<a class="headerlink" href="#public-member-functions_6" title="Permanent link">&para;</a></h3>
<h4 id="typeof_6"><i class="fa fa-caret-right"></i> typeOf<a class="headerlink" href="#typeof_6" title="Permanent link">&para;</a></h4>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">ACElement_t</span> <span style="color: #f8f8f2">typeOf(</span><span style="color: #66d9ef">void</span><span style="color: #f8f8f2">)</span>
@ -2749,7 +2798,14 @@ Returns an option string of the index specified by <strong><em>n</em></strong>.
<dd><span class="apidef">n</span><span class="apidesc">Index of options array to return. Its base number is 0.</span></dd>
<dt><strong>Return value</strong></dt>
<dd>A reference of a option string indexed by the specified the <strong>n</strong>.</dd>
<dd>
</dl></p>
<h4 id="select"><i class="fa fa-caret-right"></i> select<a class="headerlink" href="#select" title="Permanent link">&para;</a></h4>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">void</span> <span style="color: #a6e22e">select</span><span style="color: #f8f8f2">(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">value);</span>
</pre></div>
Selects an option with the value.
<dl class="apidl">
<dt><strong>Parameter</strong></dt>
<dd><span class="apidef">value</span><span class="apidesc">String value that option should be selected in an option array.</span></dd>
</dl></p>
<h4 id="size_2"><i class="fa fa-caret-right"></i> size<a class="headerlink" href="#size_2" title="Permanent link">&para;</a></h4>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">size_t</span> <span style="color: #f8f8f2">size(</span><span style="color: #66d9ef">void</span><span style="color: #f8f8f2">)</span>
@ -2759,6 +2815,14 @@ Returns number of options which contained.
<dt><strong>Return value</strong></dt>
<dd>Number of options which contained.</dd>
</dl></p>
<h4 id="value_6"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_6" title="Permanent link">&para;</a></h4>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">value(</span><span style="color: #66d9ef">void</span><span style="color: #f8f8f2">)</span> <span style="color: #66d9ef">const</span><span style="color: #f8f8f2">;</span>
</pre></div>
Returns current selected option of the select list.
<dl class="apidl">
<dt><strong>Return value</strong></dt>
<dd>A String of an option current selected. If there is no select option, a null string returned.</dd>
</dl></p>
<h2 id="autoconnectsubmit">AutoConnectSubmit<a class="headerlink" href="#autoconnectsubmit" title="Permanent link">&para;</a></h2>
<h3 id="constructor_7"><i class="fa fa-code"></i> Constructor<a class="headerlink" href="#constructor_7" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">AutoConnectSubmit(</span><span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">name</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">value</span> <span style="color: #f92672">=</span><span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #66d9ef">char</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">uri</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;&quot;</span><span style="color: #f8f8f2">)</span>
@ -2776,7 +2840,7 @@ Returns number of options which contained.
<dt><strong>Type</strong></dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl></p>
<h4 id="value_6"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_6" title="Permanent link">&para;</a></h4>
<h4 id="value_7"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_7" title="Permanent link">&para;</a></h4>
<p>The name of the submit button. It will also be the label of the button.
<dl class="apidl">
<dt><strong>Type</strong></dt>
@ -2815,7 +2879,7 @@ Returns type of AutoConnectElement.
<dt><strong>Type</strong></dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl></p>
<h4 id="value_7"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_7" title="Permanent link">&para;</a></h4>
<h4 id="value_8"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_8" title="Permanent link">&para;</a></h4>
<p>A content string of the text element.
<dl class="apidl">
<dt><strong>Type</strong></dt>

@ -139,7 +139,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#098-apr-25-2019" tabindex="1" class="md-skip">
<a href="#098-may-3-2019" tabindex="1" class="md-skip">
Skip to content
</a>
@ -657,8 +657,8 @@
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#098-apr-25-2019" title="[0.9.8] Apr. 25, 2019" class="md-nav__link">
[0.9.8] Apr. 25, 2019
<a href="#098-may-3-2019" title="[0.9.8] May 3, 2019" class="md-nav__link">
[0.9.8] May 3, 2019
</a>
</li>
@ -754,8 +754,8 @@
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#098-apr-25-2019" title="[0.9.8] Apr. 25, 2019" class="md-nav__link">
[0.9.8] Apr. 25, 2019
<a href="#098-may-3-2019" title="[0.9.8] May 3, 2019" class="md-nav__link">
[0.9.8] May 3, 2019
</a>
</li>
@ -828,16 +828,22 @@
<h1>Change log</h1>
<h4 id="098-apr-25-2019">[0.9.8] Apr. 25, 2019<a class="headerlink" href="#098-apr-25-2019" title="Permanent link">&para;</a></h4>
<h4 id="098-may-3-2019">[0.9.8] May 3, 2019<a class="headerlink" href="#098-may-3-2019" title="Permanent link">&para;</a></h4>
<ul>
<li>Supports ArduinoJson 6.9.1 or later.</li>
<li>Supports allocating JsonDocument buffer to PSRAM on ESP32 with ArduinoJson 6.10.0 or later.</li>
<li>Supports <a href="apiaux.html#operator"><strong>operator<code>[]</code></strong></a> as a shortcut for AutoConnectAux::getElement function.</li>
<li>Supports <a href="apielements.html#ast62"><strong>AutoConnectElement::as&lt;T></strong></a> function to easily coding for conversion from an AutoConnectElement to an actual type.</li>
<li>Supports new element type <a href="acelements.html#autoconnectfile"><strong>AutoConnectFile</strong></a> and built-in file uploader.</li>
<li>Supports a <a href="acelements.html#format"><strong>format attribute</strong></a> with the AutoConnectText element.</li>
<li>Fixed blank page responds with Configure new.</li>
<li>Supports a <a href="acelements.html#format"><strong>format</strong></a> attribute with the AutoConnectText element.</li>
<li>Supports a <a href="acelements.html#selected"><strong>selected</strong></a> attribute with the AutoConnectSelect element.</li>
<li>Supports multiple element loading with <a href="apiaux.html#loadelement">AutoConnectAux::loadElement</a>.</li>
<li>Changed menu labels placement in source files structure.</li>
<li>Changed API interface of <a href="api.html#where">**AutoConnect::where</a> function.</li>
<li>Fixed blank page responds with Configure new.</li>
<li>Fixed loading elements value missing.</li>
<li>Fixed losing elements in saveElement with ArduinoJson V6.</li>
<li>Fixed compile error with older than ESP8266 core 2.5.0.</li>
</ul>
<h4 id="097-jan-25-2019">[0.9.7] Jan. 25, 2019<a class="headerlink" href="#097-jan-25-2019" title="Permanent link">&para;</a></h4>
<ul>

@ -1095,7 +1095,7 @@ For AutoConnect menus to work properly, call <a href="api.html#handlerequest"><e
<p>To avoid this problem, try <a href="#1-change-wifi-channel">changing the channel</a>.</p>
<p>ESP32 hardware equips only one RF circuitry for WiFi signal. At the AP_STA mode, ESP32 as an AP attempts connect to another AP on another channel while keeping the connection with the station then the channel switching will occur causes the station may be disconnected. But it may not be just a matter of channel switching causes ESP8266 has the same constraints too. It may be a problem with AutoConnect or the arduino core or SDK issue. This problem will persist until a specific solution.</p>
<h2 id="does-not-appear-esp8266ap-in-smartphone"><i class="fa fa-question-circle"></i> Does not appear esp8266ap in smartphone.<a class="headerlink" href="#does-not-appear-esp8266ap-in-smartphone" title="Permanent link">&para;</a></h2>
<p>Maybe it is successfully connected at the <strong>first WiFi.begin</strong>. ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first <em>WiFi.begin()</em> fails.</p>
<p>Maybe it is successfully connected at the <a href="lsbegin.html#autoconnectbegin-logic-sequence"><strong>first WiFi.begin</strong></a>. ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first <em>WiFi.begin()</em> fails.</p>
<p>The saved SSID would be cleared by <em>WiFi.disconnect()</em> with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #75715e">#include</span> <span style="color: #75715e">&lt;ESP8266WiFi.h&gt;</span>

@ -9,15 +9,61 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="134.10013mm"
height="86.830833mm"
viewBox="0 0 134.10013 86.830834"
width="135.15846mm"
height="81.855286mm"
viewBox="0 0 135.15846 81.855286"
version="1.1"
id="svg8"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="ac_load_save.svg">
<defs
id="defs2" />
id="defs2">
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="marker5279"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5277"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5014"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5011"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@ -26,17 +72,17 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="216.27468"
inkscape:cy="174.19509"
inkscape:cx="305.95467"
inkscape:cy="192.81283"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:window-width="1440"
inkscape:window-height="810"
inkscape:window-x="1362"
inkscape:window-y="70"
inkscape:window-maximized="0"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="2551"
inkscape:window-y="-9"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
@ -57,10 +103,10 @@
inkscape:label="レイヤー 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-54.798811,-25.857826)">
transform="translate(-53.740477,-29.775057)">
<g
id="g888"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,92.490795)"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,91.432461)"
style="stroke-width:4.67014837">
<g
id="g827"
@ -188,44 +234,12 @@
<rect
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
id="rect1093"
width="3.4230468"
height="5.3022432"
x="118.54869"
y="92.168793"
rx="0.10748195"
ry="1.069078" />
<g
id="g1508">
<rect
ry="1.069078"
rx="0.10748189"
y="85.896545"
x="120.13969"
height="10.434501"
width="0.57877195"
id="rect1046"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(-45)"
ry="1.069078"
rx="0.1074819"
y="145.92194"
x="24.34683"
height="4.5920415"
width="0.25470743"
id="rect1046-3"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(45)"
ry="1.069078"
rx="0.1074819"
y="-24.417189"
x="145.72107"
height="4.5920415"
width="0.25470743"
id="rect1046-3-6"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</g>
width="1.699528"
height="2.319947"
x="119.41328"
y="91.30558"
rx="0.053364325"
ry="0.46776518" />
<g
id="g1153"
transform="matrix(0.06571814,0,0,0.052736,100.33233,54.752494)">
@ -595,7 +609,7 @@
</g>
<g
id="g888-3"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,25.857826)"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,34.324498)"
style="stroke-width:4.67014837">
<g
id="g827-2"
@ -675,8 +689,61 @@
id="g857-1"
style="stroke-width:4.67014837" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="104.19426"
y="111.57608"
id="text1516"><tspan
sodipodi:role="line"
id="tspan1514"
x="104.19426"
y="111.57608"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnect::load</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="53.70327"
y="67.993149"
id="text1516-4"><tspan
sodipodi:role="line"
id="tspan1514-3"
x="53.70327"
y="67.993149"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="53.70327"
y="71.961899"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536">::loadElement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="159.29454"
y="67.999352"
id="text1516-4-4"><tspan
sodipodi:role="line"
id="tspan1514-3-5"
x="159.29454"
y="67.999352"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="159.29454"
y="71.968102"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536-1">::saveElement</tspan></text>
<rect
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
id="rect1093-3"
width="4.487114"
height="2.1685081"
x="118.21754"
y="49.186954"
rx="0.14089312"
ry="0.43723083" />
<g
id="g1498">
id="g1498"
transform="translate(-0.16225749)">
<rect
ry="1.069078"
rx="0.10748189"
@ -707,72 +774,49 @@
id="rect1046-3-6-21"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="92.995323"
y="32.187313"
id="text1516-47"><tspan
sodipodi:role="line"
id="tspan1514-31"
x="92.995323"
y="32.187313"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux::saveElement</tspan></text>
<g
id="g1512"
transform="translate(-17.118613,-2.6192414)">
transform="translate(-0.16225749,36.803633)"
id="g1498-6">
<rect
ry="1.069078"
rx="0.10748189"
y="50.580574"
x="120.13969"
height="5.1024733"
width="0.57877195"
id="rect1046-38-5"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(-45)"
ry="1.069078"
rx="0.1074819"
y="128.85464"
x="63.34301"
y="119.95757"
x="50.31118"
height="4.5920415"
width="0.25470743"
id="rect1046-3-2-9"
style="opacity:1;vector-effect:none;fill:#800000;fill-opacity:1;stroke:#800000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
id="rect1046-3-2-3"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(45)"
ry="1.069078"
rx="0.1074819"
y="-65.774635"
x="131.01506"
y="-50.381538"
x="119.75671"
height="4.5920415"
width="0.25470743"
id="rect1046-3-6-21-4"
style="opacity:1;vector-effect:none;fill:#800000;fill-opacity:1;stroke:#800000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
id="rect1046-3-6-21-0"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="104.19426"
y="112.6344"
id="text1516"><tspan
sodipodi:role="line"
id="tspan1514"
x="104.19426"
y="112.6344"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnect::load</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="54.761604"
y="67.993149"
id="text1516-4"><tspan
sodipodi:role="line"
id="tspan1514-3"
x="54.761604"
y="67.993149"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="54.761604"
y="71.961899"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536">::loadElement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="159.29454"
y="67.999352"
id="text1516-4-4"><tspan
sodipodi:role="line"
id="tspan1514-3-5"
x="159.29454"
y="67.999352"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="159.29454"
y="71.968102"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536-1">::saveElement</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 38 KiB

File diff suppressed because one or more lines are too long

@ -2,122 +2,122 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://Hieromon.github.io/AutoConnect/index.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/gettingstarted.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/menu.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/basicusage.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/advancedusage.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acintro.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acelements.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acjson.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/achandling.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/api.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiaux.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiconfig.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apielements.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/apiextra.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/howtoembed.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/datatips.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/menuize.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/wojson.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/lsbegin.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/credit.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/acupload.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/faq.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/changelog.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://Hieromon.github.io/AutoConnect/license.html</loc>
<lastmod>2019-04-17</lastmod>
<lastmod>2019-05-03</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

@ -0,0 +1,204 @@
/*
Elements.ino, Example for the AutoConnect library.
Copyright (c) 2019, Hieromon Ikasamo
https://github.com/Hieromon/AutoConnect
This software is released under the MIT License.
https://opensource.org/licenses/MIT
This example demonstrates the typical behavior of AutoConnectElement.
It also represents a basic structural frame for saving and reusing
values entered in a custom web page into flash.
*/
#if defined(ARDUINO_ARCH_ESP8266)
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
using WebServerClass = ESP8266WebServer;
#elif defined(ARDUINO_ARCH_ESP32)
#include <WiFi.h>
#include <WebServer.h>
#include <SPIFFS.h>
using WebServerClass = WebServer;
#endif
#include <FS.h>
#include <AutoConnect.h>
#define PARAM_FILE "/elements.json"
static const char PAGE_ELEMENTS[] PROGMEM = R"(
{
"uri": "/elements",
"title": "Elements",
"menu": true,
"element": [
{
"name": "text",
"type": "ACText",
"value": "AutoConnect element behaviors collection",
"style": "font-family:Arial;font-size:18px;font-weight:400;color:#191970"
},
{
"name": "check",
"type": "ACCheckbox",
"value": "check",
"label": "Check",
"checked": true
},
{
"name": "input",
"type": "ACInput",
"placeholder": "This area accepts hostname patterns",
"pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
},
{
"name": "radio",
"type": "ACRadio",
"value": [
"Button-1",
"Button-2",
"Butotn-3"
],
"label": "Radio buttons",
"arrange": "vertical",
"checked": 1
},
{
"name": "select",
"type": "ACSelect",
"option": [
"Option-1",
"Option-2",
"Option-3"
],
"label": "Select",
"selected": 2
},
{
"name": "element",
"type": "ACElement",
"value": "<br>"
},
{
"name": "load",
"type": "ACSubmit",
"value": "Load",
"uri": "/elements"
},
{
"name": "save",
"type": "ACSubmit",
"value": "Save",
"uri": "/save"
}
]
}
)";
static const char PAGE_SAVE[] PROGMEM = R"(
{
"uri": "/save",
"title": "Elements",
"menu": false,
"element": [
{
"name": "caption",
"type": "ACText",
"format": "Elements have been saved to %s",
"style": "font-family:Arial;font-size:18px;font-weight:400;color:#191970"
},
{
"name": "validated",
"type": "ACText",
"style": "color:red"
},
{
"name": "echo",
"type": "ACText",
"style": "font-family:monospace;font-size:small;white-space:pre;"
},
{
"name": "ok",
"type": "ACSubmit",
"value": "OK",
"uri": "/elements"
}
]
}
)";
WebServerClass server;
AutoConnect portal(server);
AutoConnectAux elementsAux;
AutoConnectAux saveAux;
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
// Responder of root page handled directly from WebServer class.
server.on("/", []() {
String content = "Place the root page with the sketch application.&ensp;";
content += AUTOCONNECT_LINK(COG_24);
server.send(200, "text/html", content);
});
// Load a custom web page described in JSON as PAGE_ELEMENT and
// register a handler. This handler will be invoked from
// AutoConnectSubmit named the Load defined on the same page.
elementsAux.load(FPSTR(PAGE_ELEMENTS));
elementsAux.on([] (AutoConnectAux& aux, PageArgument& arg) {
if (portal.where() == "/elements") {
// Use the AutoConnect::where function to identify the referer.
// Since this handler only supports AutoConnectSubmit called the
// Load, it uses the uri of the custom web page placed to
// determine whether the Load was called me or not.
SPIFFS.begin();
File param = SPIFFS.open(PARAM_FILE, "r");
if (param) {
aux.loadElement(param, { "text", "check", "input", "radio", "select" } );
param.close();
}
SPIFFS.end();
}
return String();
});
saveAux.load(FPSTR(PAGE_SAVE));
saveAux.on([] (AutoConnectAux& aux, PageArgument& arg) {
// You can validate input values before saving with
// AutoConnectInput::isValid function.
// Verification is using performed regular expression set in the
// pattern attribute in advance.
AutoConnectInput& input = elementsAux["input"].as<AutoConnectInput>();
aux["validated"].value = input.isValid() ? String() : String("Input data pattern missmatched.");
// The following line sets only the value, but it is HTMLified as
// formatted text using the format attribute.
aux["caption"].value = PARAM_FILE;
SPIFFS.begin();
File param = SPIFFS.open(PARAM_FILE, "w");
if (param) {
// Save as a loadable set for parameters.
elementsAux.saveElement(param, { "text", "check", "input", "radio", "select" });
param.close();
// Read the saved elements again to display.
param = SPIFFS.open(PARAM_FILE, "r");
aux["echo"].value = param.readString();
param.close();
}
else {
aux["echo"].value = "<styleSPIFFS failed to open.";
}
SPIFFS.end();
return String();
});
portal.join({ elementsAux, saveAux });
portal.begin();
}
void loop() {
portal.handleClient();
}

@ -33,7 +33,8 @@ static const char AUX_TIMEZONE[] PROGMEM = R"(
"name": "timezone",
"type": "ACSelect",
"label": "Select TZ name",
"option": []
"option": [],
"selected": 10
},
{
"name": "newline",

@ -275,7 +275,7 @@ String loadParams(AutoConnectAux& aux, PageArgument& args) {
String saveParams(AutoConnectAux& aux, PageArgument& args) {
// The 'where()' function returns the AutoConnectAux that caused
// the transition to this page.
AutoConnectAux& mqtt_setting = portal.where();
AutoConnectAux& mqtt_setting = *portal.aux(portal.where());
getParams(mqtt_setting);
AutoConnectInput& mqttserver = mqtt_setting["mqttserver"].as<AutoConnectInput>();

@ -147,8 +147,6 @@ int getStrength(uint8_t points) {
// Retreive the value of each element entered by '/mqtt_setting'.
String saveParams(AutoConnectAux& aux, PageArgument& args) {
// The 'where()' function returns the AutoConnectAux that caused
// the transition to this page.
mqttserver.value.trim();
channelid.value.trim();
userkey.value.trim();

@ -299,7 +299,7 @@ AutoConnectSelect generates an HTML `#!html <select>` tag (drop-down list) and f
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectSelect(const char* name, std::vector<String> const& options, const char* label)
AutoConnectSelect(const char* name, std::vector<String> const& options, const char* label, const uint8_t selected)
```
### <i class="fa fa-caret-right"></i> name
@ -314,6 +314,10 @@ An `options` is an array of String type for the options which as actually [std::
A `label` is an optional string. A label is always arranged on the left side of the drop-down list. Specification of a label will generate an HTML `#!html <label>` tag with an id attribute. The select tag and the label are connected by the id attribute.
### <i class="fa fa-caret-right"></i> selected
A `selected` is an optional value. Specifies that an option should be pre-selected when the page loads.
## AutoConnectSubmit
AutoConnectSubmit generates an HTML `#!html <input type="button">` tag attached `#!html onclick` attribute. The native code of the `#!html onclick` attribute is the submission of the form with the **POST** method.

@ -147,7 +147,7 @@ AutoConnectElementVT& AutoConnectAux::getElements(void)
## Loading &amp; saving AutoConnectElements with JSON
AutoConnect supports reading the custom Web page definitions written in JSON and also supports loading and saving of AutoConnectElements. In both cases, the target object is a [JSON document for AutoConnect](acjson.md). However, it can not save all AutoConnectElements contained in the page as a custom Web page. (ie. AutoConnectAux)
AutoConnect supports reading the custom Web page definitions written in JSON and also supports loading and saving of AutoConnectAux or AutoConnectElements. In both cases, the target object is a [JSON document for AutoConnect](acjson.md). However, it can not save all AutoConnectElements contained in the page as a custom Web page. (ie. AutoConnectAux)
<img src="images/ac_load_save.svg">
@ -223,7 +223,7 @@ Serial.println(serverName.value);
### <i class="fa fa-download"></i> Saving AutoConnectElements with JSON
To save the AutoConnectElement as a JSON document, use the [AutoConnectAux::saveElement](apiaux.md#saveelement) function. It serializes the contents of the object based on the type of the AutoConnectElement. You can persist a serialized AutoConnectElements as a JSON document to a stream.
To save the AutoConnectAux or the AutoConnectElement as a JSON document, use the [AutoConnectAux::saveElement](apiaux.md#saveelement) function. It serializes the contents of the object based on the type of the AutoConnectElement. You can persist a serialized AutoConnectElements as a JSON document to a stream.
```cpp
// Open a parameter file on the SPIFFS.
@ -263,6 +263,8 @@ The example above saves `server` and `period` elements from the AutoConnectAux o
]
```
Above JSON document can be loaded as it is into a custom Web page using the loadElement function. The loadElement function also loads the value of the element, so the saved value can be restored on the custom Web page.
## Custom field data handling
A sketch can access variables of AutoConnectElements in the custom Web page. The value entered into the AutoConnectElements on the page is stored in the member variable of each element by AutoConnect whenever GET/POST transmission occurs.
@ -382,8 +384,9 @@ AutoConnect portal;
String feelsOn(AutoConnectAux& aux, PageArgument& args) {
// Get the AutoConnectInput named "feels".
// The where() function returns the AutoConnectAux of the page that triggered this handler.
AutoConnectInput& feels = portal.where()->getElement<AutoConnectInput>("feels");
// The where() function returns an uri string of the AutoConnectAux that triggered this handler.
AutoConnectAux* hello = portal.aux(portal.where());
AutoConnectInput& feels = hello->getElement<AutoConnectInput>("feels");
// Get the AutoConnectText named "echo".
AutoConnectText& echo = aux.getElement<AutoConnectText>("echo");
@ -407,7 +410,7 @@ void loop() {
The above example handles in the handler for the values of a custom Web page. An [AutoConnect::on](api.md#on) function registers a handler for the AutoConnectAux page of the specified uri. The argument of the custom Web page handler is an AutoConnectAux of the page itself and the [PageArgument](https://github.com/Hieromon/PageBuilder#arguments-of-invoked-user-function) object.
To retrieve the values entered in a custom Web page you need to access the AutoConnectElement of the page that caused the request to this page and to do this, you use the [AutoConnect::where](api.md#where) function. The `AutoConnect::where` function returns a pointer to the AutoConnectAux object of the custom Web page that caused the HTTP request.
To retrieve the values entered in a custom Web page you need to access the AutoConnectElement of the page that caused the request to this page and to do this, you use the [AutoConnect::where](api.md#where) function. The `AutoConnect::where` function returns an uri string of the AutoConnectAux object of the custom Web page that caused the HTTP request.
!!! note "The where() function is available for only AutoConnectAux."
The `AutoConnect::where` function is available only for the AutoConnectAux object. It is invalid for HTTP requests from individual pages registered with the **on** handler of ESP8266WebServer/WebServer for ESP32. In other words, the `AutoConnect::where` function only returns the last AutoConnecAux page called.

@ -296,14 +296,14 @@ Register the handler function for undefined URL request detected.
### <i class="fa fa-caret-right"></i> where
```cpp
AutoConenctAux& where(void)
String where(void)
```
Returns a pointer to the AutoConnectAux object of the custom Web page that caused the request to the page.<br>
Returns an uri string of the AutoConnectAux uri object of the custom Web page that caused the request to the page.<br>
AutoConnect identifies the URI (ie. the referrer URI) that caused the request each time from the client occurs and will save the URI If the request source is a custom Web page of AutoConnectAux. The **where** function returns a pointer of AutoConnectAux which is a URI of a least recent request from the custom Web page.<br>
This function is provided to access the fields (ie. the AutoConnectElements) with a custom Web page handler of a page and is available only for request source that is the custom Web pages. It is invalid for HTTP requests from individual pages registered with the **on** handler of ESP8266WebServer/WebServer for ESP32. In other words, this function only returns the AutoConnecAux page which is a least recently displayed.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>A pointer to the AutoConnectAux that caused the request the page.</dd>
<dd>An uri string of the AutoConnectAux that caused the request the page.</dd>
</dl>
The **where** function usage is described in the section [*Where to pick up the values*](achandling.md#where-to-pick-up-the-values).

@ -39,7 +39,7 @@ Add an element to the AutoConnectAux. An added element is displayed on the custo
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">addon</span><span class="apidesc">Reference of AutoConnectElements. Specifies one of the AutoConnectElements classes.</span></dd>
<dd><span class="apidef">addons</span><span class="apidesc">An array list of reference of AutoConnectElements. An [list initialization](https://en.cppreference.com/w/cpp/language/list_initialization) of the [std::vector](https://en.cppreference.com/w/cpp/container/vector) can be used for the addons parameter cause the actual definition of type **AutoConnectElementVT** is `std::vector<std::reference_wrapper<AutoConnectElement>>`.</span></dd>
<dd><span class="apidef">addons</span><span class="apidesc">An array list of reference of AutoConnectElements. The [list initialization](https://en.cppreference.com/w/cpp/language/list_initialization) with braced-init-list of the [std::vector](https://en.cppreference.com/w/cpp/container/vector) can be used for the addons parameter cause the actual definition of type **AutoConnectElementVT** is `std::vector<std::reference_wrapper<AutoConnectElement>>`.</span></dd>
</dl>
### <i class="fa fa-caret-right"></i> getElement
@ -115,11 +115,20 @@ Load all AutoConnectElements elements from JSON document into AutoConnectAux as
bool loadElement(const String& in, const String& name = String(""))
```
```cpp
bool loadElement(const String& in, std::vector<String> const& names)
```
```cpp
bool loadElement(const __FlashStringHelper* in, const String& name = String(""))
```
```cpp
bool loadElement(const __FlashStringHelper* in, std::vector<String> const& names)
```
```cpp
bool loadElement(Stream& in, const String& name = String(""))
```
```cpp
bool loadElement(Stream& in, std::vector<String> const& names)
```
Load specified element from JSON document into AutoConnectAux. The JSON document specified by the loadElement function must be the [AutoConnectElement document structure](acjson.md#json-object-for-autoconnectelements). When loading from a JSON document that describes multiple elements, its description must be an array syntax.
<dl class="apidl">
<dt>**Parameters**</dt>
@ -130,6 +139,7 @@ Load specified element from JSON document into AutoConnectAux. The JSON document
- Stream : An entity that inherits stream class, generally SPIFFS or SD.
</span></dd>
<dd><span class="apidef">name</span><span class="apidesc">Specifies the name to be load. If the name is not specified, the loadElement function will load all elements contained in the JSON document.</span></dd>
<dd><span class="apidef">names</span><span class="apidesc"> Spefifies an array list of String indicating the name of the element to be loaded. The [list initialization](https://en.cppreference.com/w/cpp/language/list_initialization) with braced-init-list of the [std::vector](https://en.cppreference.com/w/cpp/container/vector) can be used.</span></dd>
<dt>**Return value**</dt>
<dd><span class="apidef">true</span><span class="apidesc">Specified AutoConnectElements successfully loaded.</span></dd>
<dd><span class="apidef">false</span><span class="apidesc">JSON document loading failed.</span></dd>
@ -243,6 +253,9 @@ Write elements of AutoConnectAux to the stream. The saveElement function outputs
!!! note "The output format is pretty"
The saveElement function outputs a prettified JSON document.
!!! Info "It is not complementary with loadElement"
The saveElement function which missing the names parameter without name list to be saved that saves an entire AutoConnectAux element, not just AutoConnectElements. Its saved JSON document is not a complementary input to the loadElement function. The JSON document describing AutoConnectAux saved without the names parameter must be loaded by the [AutoConnectAux::load](apiaux.md#load) function or [AutoConnect::load](api.md#load) function.
### <i class="fa fa-caret-right"></i> setElementValue
```cpp

@ -349,7 +349,7 @@ AutoConnectRadio(const char* name = "", std::vector<String> const& values = {},
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">values</span><span class="apidesc">An array of values of the radio buttons. Specifies an [std::vector](https://en.cppreference.com/w/cpp/container/vector) object.</span></dd>
<dd><span class="apidef">values</span><span class="apidesc">An array of values of the radio buttons. Specifies a [std::vector](https://en.cppreference.com/w/cpp/container/vector) object.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">order</span><span class="apidesc">The direction to arrange the radio buttons.</span></dd>
<dd><span class="apidef">checked</span><span class="apidesc">An index to be checked in the radio buttons.</span></dd>
@ -487,13 +487,14 @@ Returns current checked option of the radio buttons.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectSelect(const char* name = "", std::vector<String> const& options = {}, const char* label = "")
AutoConnectSelect(const char* name = "", std::vector<String> const& options = {}, const char* label = "", const uint8_t selected = 0)
```
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">options</span><span class="apidesc">An array of options of the select element. Specifies an [std::vector](https://en.cppreference.com/w/cpp/container/vector) object.</span></dd>
<dd><span class="apidef">options</span><span class="apidesc">An array of options of the select element. Specifies a [std::vector](https://en.cppreference.com/w/cpp/container/vector) object.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">selected</span><span class="apidesc">An option should be pre-selected when the page loads.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -522,6 +523,14 @@ A label is an optional string. A label will be arranged in the top of the select
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> selected
A `selected` is an optional value. Specifies 1-based index value of an options array that an option should be pre-selected when the page loads.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">uint8_t</span><span class="apidesc"></span></dd>
</dl>
### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf
@ -568,7 +577,17 @@ Returns an option string of the index specified by **_n_**.
<dd><span class="apidef">n</span><span class="apidesc">Index of options array to return. Its base number is 0.</span></dd>
<dt>**Return value**</dt>
<dd>A reference of a option string indexed by the specified the **n**.</dd>
<dd>
</dl>
#### <i class="fa fa-caret-right"></i> select
```cpp
void select(const String& value);
```
Selects an option with the value.
<dl class="apidl">
<dt>**Parameter**</dt>
<dd><span class="apidef">value</span><span class="apidesc">String value that option should be selected in an option array.</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> size
@ -582,6 +601,17 @@ Returns number of options which contained.
<dd>Number of options which contained.</dd>
</dl>
#### <i class="fa fa-caret-right"></i> value
```cpp
const String& value(void) const;
```
Returns current selected option of the select list.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>A String of an option current selected. If there is no select option, a null string returned.</dd>
</dl>
## AutoConnectSubmit
### <i class="fa fa-code"></i> Constructor

@ -1,12 +1,18 @@
#### [0.9.8] Apr. 25, 2019
#### [0.9.8] May 3, 2019
- Supports ArduinoJson 6.9.1 or later.
- Supports allocating JsonDocument buffer to PSRAM on ESP32 with ArduinoJson 6.10.0 or later.
- Supports [**operator`[]`**](apiaux.md#operator) as a shortcut for AutoConnectAux::getElement function.
- Supports [**AutoConnectElement::as<T\>**](apielements.md#ast62) function to easily coding for conversion from an AutoConnectElement to an actual type.
- Supports new element type [**AutoConnectFile**](acelements.md#autoconnectfile) and built-in file uploader.
- Supports a [**format attribute**](acelements.md#format) with the AutoConnectText element.
- Fixed blank page responds with Configure new.
- Supports a [**format**](acelements.md#format) attribute with the AutoConnectText element.
- Supports a [**selected**](acelements.md#selected) attribute with the AutoConnectSelect element.
- Supports multiple element loading with [AutoConnectAux::loadElement](apiaux.md#loadelement).
- Changed menu labels placement in source files structure.
- Changed API interface of [**AutoConnect::where](api.md#where) function.
- Fixed blank page responds with Configure new.
- Fixed loading elements value missing.
- Fixed losing elements in saveElement with ArduinoJson V6.
- Fixed compile error with older than ESP8266 core 2.5.0.
#### [0.9.7] Jan. 25, 2019

@ -9,15 +9,61 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="134.10013mm"
height="86.830833mm"
viewBox="0 0 134.10013 86.830834"
width="135.15846mm"
height="81.855286mm"
viewBox="0 0 135.15846 81.855286"
version="1.1"
id="svg8"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="ac_load_save.svg">
<defs
id="defs2" />
id="defs2">
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="marker5279"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5277"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5014"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt"
transform="matrix(-0.8,0,0,-0.8,-10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5011"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@ -26,17 +72,17 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="216.27468"
inkscape:cy="174.19509"
inkscape:cx="305.95467"
inkscape:cy="192.81283"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:window-width="1440"
inkscape:window-height="810"
inkscape:window-x="1362"
inkscape:window-y="70"
inkscape:window-maximized="0"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="2551"
inkscape:window-y="-9"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
@ -57,10 +103,10 @@
inkscape:label="レイヤー 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-54.798811,-25.857826)">
transform="translate(-53.740477,-29.775057)">
<g
id="g888"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,92.490795)"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,91.432461)"
style="stroke-width:4.67014837">
<g
id="g827"
@ -188,44 +234,12 @@
<rect
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
id="rect1093"
width="3.4230468"
height="5.3022432"
x="118.54869"
y="92.168793"
rx="0.10748195"
ry="1.069078" />
<g
id="g1508">
<rect
ry="1.069078"
rx="0.10748189"
y="85.896545"
x="120.13969"
height="10.434501"
width="0.57877195"
id="rect1046"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(-45)"
ry="1.069078"
rx="0.1074819"
y="145.92194"
x="24.34683"
height="4.5920415"
width="0.25470743"
id="rect1046-3"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(45)"
ry="1.069078"
rx="0.1074819"
y="-24.417189"
x="145.72107"
height="4.5920415"
width="0.25470743"
id="rect1046-3-6"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</g>
width="1.699528"
height="2.319947"
x="119.41328"
y="91.30558"
rx="0.053364325"
ry="0.46776518" />
<g
id="g1153"
transform="matrix(0.06571814,0,0,0.052736,100.33233,54.752494)">
@ -595,7 +609,7 @@
</g>
<g
id="g888-3"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,25.857826)"
transform="matrix(0.05665416,0,0,0.05665416,112.41059,34.324498)"
style="stroke-width:4.67014837">
<g
id="g827-2"
@ -675,8 +689,61 @@
id="g857-1"
style="stroke-width:4.67014837" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="104.19426"
y="111.57608"
id="text1516"><tspan
sodipodi:role="line"
id="tspan1514"
x="104.19426"
y="111.57608"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnect::load</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="53.70327"
y="67.993149"
id="text1516-4"><tspan
sodipodi:role="line"
id="tspan1514-3"
x="53.70327"
y="67.993149"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="53.70327"
y="71.961899"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536">::loadElement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="159.29454"
y="67.999352"
id="text1516-4-4"><tspan
sodipodi:role="line"
id="tspan1514-3-5"
x="159.29454"
y="67.999352"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="159.29454"
y="71.968102"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536-1">::saveElement</tspan></text>
<rect
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
id="rect1093-3"
width="4.487114"
height="2.1685081"
x="118.21754"
y="49.186954"
rx="0.14089312"
ry="0.43723083" />
<g
id="g1498">
id="g1498"
transform="translate(-0.16225749)">
<rect
ry="1.069078"
rx="0.10748189"
@ -707,72 +774,49 @@
id="rect1046-3-6-21"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="92.995323"
y="32.187313"
id="text1516-47"><tspan
sodipodi:role="line"
id="tspan1514-31"
x="92.995323"
y="32.187313"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux::saveElement</tspan></text>
<g
id="g1512"
transform="translate(-17.118613,-2.6192414)">
transform="translate(-0.16225749,36.803633)"
id="g1498-6">
<rect
ry="1.069078"
rx="0.10748189"
y="50.580574"
x="120.13969"
height="5.1024733"
width="0.57877195"
id="rect1046-38-5"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(-45)"
ry="1.069078"
rx="0.1074819"
y="128.85464"
x="63.34301"
y="119.95757"
x="50.31118"
height="4.5920415"
width="0.25470743"
id="rect1046-3-2-9"
style="opacity:1;vector-effect:none;fill:#800000;fill-opacity:1;stroke:#800000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
id="rect1046-3-2-3"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
<rect
transform="rotate(45)"
ry="1.069078"
rx="0.1074819"
y="-65.774635"
x="131.01506"
y="-50.381538"
x="119.75671"
height="4.5920415"
width="0.25470743"
id="rect1046-3-6-21-4"
style="opacity:1;vector-effect:none;fill:#800000;fill-opacity:1;stroke:#800000;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
id="rect1046-3-6-21-0"
style="opacity:1;vector-effect:none;fill:#3366cc;fill-opacity:1;stroke:#3366cc;stroke-width:1.32291663;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="104.19426"
y="112.6344"
id="text1516"><tspan
sodipodi:role="line"
id="tspan1514"
x="104.19426"
y="112.6344"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnect::load</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="54.761604"
y="67.993149"
id="text1516-4"><tspan
sodipodi:role="line"
id="tspan1514-3"
x="54.761604"
y="67.993149"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="54.761604"
y="71.961899"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536">::loadElement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="159.29454"
y="67.999352"
id="text1516-4-4"><tspan
sodipodi:role="line"
id="tspan1514-3-5"
x="159.29454"
y="67.999352"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">AutoConnectAux</tspan><tspan
sodipodi:role="line"
x="159.29454"
y="71.968102"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#002700;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1536-1">::saveElement</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 38 KiB

@ -185,7 +185,7 @@ class AutoConnect {
void join(AutoConnectAux& aux);
void join(AutoConnectAuxVT auxVector);
bool on(const String& uri, const AuxHandlerFunctionT handler, AutoConnectExitOrder_t order = AC_EXIT_AHEAD);
AutoConnectAux& where(void) const { return *aux(_auxUri); }
String where(void) const { return _auxUri; }
/** For AutoConnectAux described in JSON */
#ifdef AUTOCONNECT_USE_JSON

@ -673,34 +673,58 @@ bool AutoConnectAux::_load(JsonObject& jb) {
* @return A reference of loaded AutoConnectElement instance.
*/
bool AutoConnectAux::loadElement(const String& in, const String& name) {
return _parseElement<const String&>(in, name);
return _parseElement<const String&, const String&>(in, name);
}
bool AutoConnectAux::loadElement(const __FlashStringHelper* in, const String& name) {
return _parseElement<const __FlashStringHelper*>(in, name);
return _parseElement<const __FlashStringHelper*, const String&>(in, name);
}
bool AutoConnectAux::loadElement(Stream& in, const String& name) {
return _parseElement<Stream&>(in, name);
return _parseElement<Stream&, const String&>(in, name);
}
bool AutoConnectAux::_loadElement(JsonVariant& jb, const String& name) {
bool AutoConnectAux::loadElement(const String& in, std::vector<String> const& names) {
return _parseElement<const String&, std::vector<String> const&>(in, names);
}
bool AutoConnectAux::loadElement(const __FlashStringHelper* in, std::vector<String> const& names) {
return _parseElement<const __FlashStringHelper*, std::vector<String> const&>(in, names);
}
bool AutoConnectAux::loadElement(Stream& in, std::vector<String> const& names) {
return _parseElement<Stream&, std::vector<String> const&>(in, names);
}
bool AutoConnectAux::_loadElement(JsonVariant& jb, std::vector<String> const& names) {
bool rc = true;
for (const String& name : names)
rc &= _loadElement(jb, name);
return rc;
}
bool AutoConnectAux::_loadElement(JsonVariant& jb, const String& name) {
bool rc = false;
if (jb.is<JsonArray>()) {
ArduinoJsonArray elements = jb.as<JsonArray>();
for (ArduinoJsonObject element : elements) {
if (name.length()) {
//Finds an element with the specified name in the JSON array and loads it.
if (!name.equalsIgnoreCase(element[F(AUTOCONNECT_JSON_KEY_NAME)].as<String>()))
continue;
}
AutoConnectElement& elm = _loadElement(element, name);
if (!elm.name.length()) {
rc = false;
if (elm.name.length())
rc = true;
if (name.length())
break;
}
}
}
else {
ArduinoJsonObject element = jb.as<JsonObject>();
AutoConnectElement& elm = _loadElement(element, name);
if (!elm.name.length())
rc = false;
if (elm.name.length())
rc = true;
}
return rc;
}
@ -750,19 +774,26 @@ size_t AutoConnectAux::saveElement(Stream& out, std::vector<String> const& names
size_t size_n = 0;
// Calculate JSON buffer size
if (amount == 0)
if (amount == 0) {
bufferSize += JSON_OBJECT_SIZE(4);
bufferSize += sizeof(AUTOCONNECT_JSON_KEY_TITLE) + _title.length() + sizeof(AUTOCONNECT_JSON_KEY_URI) + _uriStr.length() + sizeof(AUTOCONNECT_JSON_KEY_MENU) + sizeof("false") + sizeof(AUTOCONNECT_JSON_KEY_ELEMENT);
}
if (amount != 1)
bufferSize += JSON_ARRAY_SIZE(amount);
for (String name : names)
for (AutoConnectElement& elm : _addonElm)
if (elm.name.equalsIgnoreCase(name)) {
bufferSize += elm.getObjectSize();
break;
}
for (AutoConnectElement& elmEach : _addonElm) {
AutoConnectElement* elm = &elmEach;
if (amount > 0) {
String& elmName = elm->name;
auto aim = std::find_if(names.begin(), names.end(), [&](const String& n) { return n.equalsIgnoreCase(elmName); });
if (aim == names.end())
continue;
}
bufferSize += elm->getObjectSize();
}
// Round up to 16 boundary
bufferSize = bufferSize > 0 ? ((bufferSize + 16) & (~0xf)) : bufferSize;
bufferSize = bufferSize > 0 ? ((bufferSize + 128) & (~0xf)) : bufferSize;
AC_DBG("JSON buffer size:%d\n", bufferSize);
// Serialization
if (bufferSize > 0) {

@ -75,9 +75,12 @@ class AutoConnectAux : public PageBuilder {
bool load(const __FlashStringHelper* in); /**< Load whole elements to AutoConnectAux Page */
bool load(Stream& in); /**< Load whole elements to AutoConnectAux Page */
bool loadElement(const String& in, const String& name = String("")); /**< Load specified element */
bool loadElement(const __FlashStringHelper* in, const String& name = String("")); /**< Load specified element */
bool loadElement(const String& in, std::vector<String> const& names);/**< Load any specified elements */
bool loadElement(const __FlashStringHelper* in, const String& name = String("")); /**< Load specified element */
bool loadElement(const __FlashStringHelper* in, std::vector<String> const& names); /**< Load any specified elements */
bool loadElement(Stream& in, const String& name = String("")); /**< Load specified element */
size_t saveElement(Stream& out, std::vector<String> const& names = {}); /**< Write elements of AutoConnectAux to the stream */
bool loadElement(Stream& in, std::vector<String> const& names); /**< Load any specified elements */
size_t saveElement(Stream& out, std::vector<String> const& names = {}); /**< Write elements of AutoConnectAux to the stream */
#endif // !AUTOCONNECT_USE_JSON
protected:
@ -98,11 +101,38 @@ class AutoConnectAux : public PageBuilder {
bool _parseJson(T in);
bool _load(JsonObject& in); /**< Load all elements from JSON object */
bool _loadElement(JsonVariant& in, const String& name); /**< Load an element as specified name from JSON object */
template<typename T>
bool _parseElement(T in, const String& name);
bool _loadElement(JsonVariant& in, std::vector<String> const& names); /**< Load any elements as specified name from JSON object */
AutoConnectElement& _loadElement(JsonObject& in, const String& name); /**< Load an element as specified name from JSON object */
AutoConnectElement* _createElement(const JsonObject& json); /**< Create an AutoConnectElement instance from JSON object */
static ACElement_t _asElementType(const String& type); /**< Convert a string of element type to the enumeration value */
/**
* Parse and load a JSON document which declares one of the AutoConnectElement.
* The compiler instantiates this template according to the stored data type that contains the JSON document.
* This template also generates different parsing function calls depending on the ArduinoJson version.
* @param T An object type of the JSON document which must be a passable object to ArduinoJson.
* @param U An instance of a souce name to load.
*/
template<typename T, typename U,
typename std::enable_if<std::is_same<U, const String&>::value || std::is_same<U, std::vector<String> const&>::value>::type* = nullptr>
bool _parseElement(T in, U name) {
ArduinoJsonBuffer jsonBuffer(AUTOCONNECT_JSONBUFFER_PRIMITIVE_SIZE);
JsonVariant jb;
#if ARDUINOJSON_VERSION_MAJOR<=5
jb = jsonBuffer.parse(in);
if (!jb.success()) {
AC_DBG("JSON parse error\n");
return false;
}
#else
DeserializationError err = deserializeJson(jsonBuffer, in);
if (err) {
AC_DBG("Deserialize:%s\n", err.c_str());
return false;
}
jb = jsonBuffer.as<JsonVariant>();
#endif
return _loadElement(jb, name);
}
#endif // !AUTOCONNECT_USE_JSON
String _title; /**< A title of the page */

@ -230,37 +230,6 @@ bool AutoConnectAux::_parseJson(T in) {
return _load(jb);
}
/**
* Parse and load a JSON document which declares one of the AutoConnectElement.
* The compiler instantiates this template according to the stored data
* type that contains the JSON document.
* This template also generates different parsing function calls
* depending on the ArduinoJson version.
* @param T An object type of the JSON document which must be a
* passable object to ArduinoJson.
* @param in An instance of a source JSON document to load.
*/
template<typename T>
bool AutoConnectAux::_parseElement(T in, const String& name) {
ArduinoJsonBuffer jsonBuffer(AUTOCONNECT_JSONBUFFER_PRIMITIVE_SIZE);
JsonVariant jb;
#if ARDUINOJSON_VERSION_MAJOR<=5
jb = jsonBuffer.parse(in);
if (!jb.success()) {
AC_DBG("JSON parse error\n");
return false;
}
#else
DeserializationError err = deserializeJson(jsonBuffer, in);
if (err) {
AC_DBG("Deserialize:%s\n", err.c_str());
return false;
}
jb = jsonBuffer.as<JsonVariant>();
#endif
return _loadElement(jb, name);
}
/**
* Get AutoConnectElementJson element.
* @param name an element name.

@ -257,9 +257,9 @@ void AutoConnectInputJson::serialize(JsonObject& json) {
* @return An object size for JsonBuffer.
*/
size_t AutoConnectRadioJson::getObjectSize() const {
size_t size =AutoConnectElementJson::getObjectSize() + JSON_OBJECT_SIZE(3) + _values.size() * JSON_OBJECT_SIZE(1) + JSON_ARRAY_SIZE(1);
size += sizeof(AUTOCONNECT_JSON_KEY_LABEL) + label.length() + sizeof(AUTOCONNECT_JSON_KEY_ARRANGE) + sizeof(AUTOCONNECT_JSON_VALUE_HORIZONTAL) + sizeof(AUTOCONNECT_JSON_KEY_CHECKED);
for (String _value : _values)
size_t size = AutoConnectElementJson::getObjectSize() + JSON_OBJECT_SIZE(2) + JSON_ARRAY_SIZE(_values.size());
size += sizeof(AUTOCONNECT_JSON_KEY_LABEL) + label.length() + sizeof(AUTOCONNECT_JSON_KEY_ARRANGE) + sizeof(AUTOCONNECT_JSON_VALUE_HORIZONTAL) + sizeof(AUTOCONNECT_JSON_KEY_CHECKED) + 2;
for (const String& _value : _values)
size += _value.length();
return size;
}
@ -310,7 +310,7 @@ void AutoConnectRadioJson::serialize(JsonObject& json) {
json[F(AUTOCONNECT_JSON_KEY_TYPE)] = String(F(AUTOCONNECT_JSON_TYPE_ACRADIO));
json[F(AUTOCONNECT_JSON_KEY_LABEL)] = label;
ArduinoJsonArray values = json.createNestedArray(F(AUTOCONNECT_JSON_KEY_VALUE));
for (String v : _values)
for (const String& v : _values)
values.add(v);
switch (order) {
case AC_Horizontal:
@ -329,9 +329,9 @@ void AutoConnectRadioJson::serialize(JsonObject& json) {
* @return An object size for JsonBuffer.
*/
size_t AutoConnectSelectJson::getObjectSize() const {
size_t size = AutoConnectElementJson::getObjectSize() + JSON_OBJECT_SIZE(4) + _options.size() * JSON_OBJECT_SIZE(1) + JSON_ARRAY_SIZE(1);
size += sizeof(AUTOCONNECT_JSON_KEY_LABEL) + label.length();
for (String _option : _options)
size_t size = AutoConnectElementJson::getObjectSize() + JSON_OBJECT_SIZE(3) + JSON_ARRAY_SIZE(_options.size());
size += sizeof(AUTOCONNECT_JSON_KEY_LABEL) + label.length() + sizeof(AUTOCONNECT_JSON_KEY_SELECTED) + 2;
for (const String& _option : _options)
size += _option.length();
return size;
}

Loading…
Cancel
Save