tune
This commit is contained in:
@@ -94,8 +94,7 @@
|
||||
<p><a id="Script"></a></p>
|
||||
<h2 id="語法與功能">語法與功能</h2>
|
||||
<p><strong>腳本</strong> (Script) 中的<strong>標題</strong> (Title) 的功能僅為註記,無其他功能,腳本的內容與標題不一定要匹配。</p>
|
||||
<p>腳本預設為<strong>簡易模式</strong> (Simple Mode),該模式基於C#語言並簡化部分指令;如未勾選簡易模式,則腳本使用原生C#語言。</p>
|
||||
<p>簡易模式腳本在執行前會先轉換為C#語言再執行。</p>
|
||||
<p>腳本使用原生C#語言。</p>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p><strong>基本 C# 語法</strong></p>
|
||||
@@ -104,22 +103,8 @@
|
||||
<li>可以使用 <code>//</code> 作為行尾註解。</li>
|
||||
<li>可以使用<code>double.PositiveInfinity</code>、<code>double.NegativeInfinity</code>表示實數中的無限大及無限小。</li>
|
||||
</ul>
|
||||
<p>簡易模式腳本範例:</p>
|
||||
<pre><code class="lang-csharp">RunNcFile("NC/file1.nc");
|
||||
</code></pre>
|
||||
</div>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p><strong>簡易模式與原生C#語言(進階)</strong></p>
|
||||
<p>本段供有C#開發經驗的工程師參考。</p>
|
||||
<p>腳本執行函數回傳的物件<code>IEnumerable<Action></code>。</p>
|
||||
<p>撥放器在<code>Action</code>之間可以執行暫停(Pause)。</p>
|
||||
<p>與簡易模式腳本範例對照的典型原生C#語言腳本範例:</p>
|
||||
<pre><code class="lang-csharp">IEnumerable<Action> Run(){
|
||||
foreach(var action in RunNcFile("NC/file1.nc")) yield return action;
|
||||
yield return null;
|
||||
}
|
||||
return Run();
|
||||
<p>腳本範例:</p>
|
||||
<pre><code class="lang-csharp">PlayNcFile("NC/file1.nc");
|
||||
</code></pre>
|
||||
</div>
|
||||
<p><a id="FileTemplate"></a></p>
|
||||
@@ -128,8 +113,8 @@ return Run();
|
||||
<div class="TIP">
|
||||
<h5>Tip</h5>
|
||||
<p><strong>指令範例</strong></p>
|
||||
<pre><code class="lang-csharp">RunNcFile("NC/file1.nc");
|
||||
RunNcFile("NC/file2.nc");
|
||||
<pre><code class="lang-csharp">PlayNcFile("NC/file1.nc");
|
||||
PlayNcFile("NC/file2.nc");
|
||||
WriteShotFiles("Output/[NcName].shot.csv", 1);
|
||||
// 輸出檔案至:
|
||||
// Output/file1.nc.shot.csv
|
||||
|
||||
Reference in New Issue
Block a user