UNPKG

w-mesh-gms

Version:
725 lines (208 loc) 10.1 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Global - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> <script src="scripts/nav.js" defer></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav > <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WMeshGms">WMeshGms</a></li><li><a href="global.html#readGms">readGms</a></li><li><a href="global.html#writeGms">writeGms</a></li></ul> </nav> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Members</h3> <h4 class="name" id="WMeshGms"><span class="type-signature"></span>WMeshGms<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-description">Description:</dt> <dd class="tag-description"><ul class="dummy"><li><p>讀寫GMS的ASCII檔檔</p></li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="WMeshGms.mjs.html">WMeshGms.mjs</a>, <a href="WMeshGms.mjs.html#line564">line 564</a> </li></ul></dd> </dl> <div class="description usertext"> <p>讀寫GMS的ASCII檔檔</p> </div> <h5 class="h5-examples">Example</h5> <pre class="prettyprint"><code></code></pre> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="readGms"><span class="type-signature type-signature-async">(async) </span>readGms<span class="signature">(fp)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <dl class="details"> <dt class="tag-description">Description:</dt> <dd class="tag-description"><ul class="dummy"><li><p>讀取GMS的ASCII檔</p></li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="WMeshGms.mjs.html">WMeshGms.mjs</a>, <a href="WMeshGms.mjs.html#line124">line 124</a> </li></ul></dd> </dl> <h5 class="h5-examples">Example</h5> <pre class="prettyprint"><code>let fpXyz = './_mesh/YiLan_xyz.txt' let fpTop = './_mesh/YiLan_top.txt' let fpBot = './_mesh/YiLan_bot.txt' let fpMat = './_mesh/YiLan_mat.txt' wmg.readGms(fpXyz, fpTop, fpBot, fpMat) .then((res) => { console.log(res) console.log('finish.') }) .catch((err) => { console.log(err) })</code></pre> <h5 class="h5-parameters">Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fp</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"><p>輸入檔案位置字串</p></td> </tr> </tbody> </table> <h5 class="h5-returns">Returns:</h5> <div class="param-desc"> <p>回傳Promise,resolve回傳ltdt(各數據列為物件陣列),reject回傳錯誤訊息</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Promise</span> </dd> </dl> <h4 class="name" id="writeGms"><span class="type-signature type-signature-async">(async) </span>writeGms<span class="signature">(mnes, fpOut, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4> <dl class="details"> <dt class="tag-description">Description:</dt> <dd class="tag-description"><ul class="dummy"><li><p>輸出數據至GMS檔案</p></li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="WMeshGms.mjs.html">WMeshGms.mjs</a>, <a href="WMeshGms.mjs.html#line467">line 467</a> </li></ul></dd> </dl> <h5 class="h5-examples">Example</h5> <pre class="prettyprint"><code>let name = 'abc' let cols = [...] let fpOut = '{path of file}' console.log('writing...') writeGms({ name, cols }, fpOut) .then((r) => { console.log('finish.') }) .catch((err) => { console.log(err) })</code></pre> <h5 class="h5-parameters">Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>mnes</code></td> <td class="type"> <span class="param-type">Object</span> | <span class="param-type">Array</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>輸入數據物件或陣列,輸入物件須包含name、cols,輸入陣列時則各元素為物件(name、cols)</p></td> </tr> <tr> <td class="name"><code>fpOut</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>輸入儲存檔案位置字串</p></td> </tr> <tr> <td class="name"><code>opt</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> <code>{}</code> </td> <td class="description last"><p>輸入設定物件,預設{}</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>funProcLayers</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> <code>null</code> </td> <td class="description last"><p>輸入交由外部處理分層函數,輸入當前layers並須回傳layers,例如可通過mergeByDepthStartEnd進行同質合併,預設null</p></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <h5 class="h5-returns">Returns:</h5> <div class="param-desc"> <p>回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Promise</span> </dd> </dl> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sun Sep 15 2024 20:30:49 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. </footer> <script>prettyPrint();</script> <script src="scripts/polyfill.js"></script> <script src="scripts/linenumber.js"></script> </body> </html>