cml__linkage_8h-source.html

来自「美国COPLEY驱动器,程序开发工具之一.」· HTML 代码 · 共 444 行 · 第 1/4 页

HTML
444
字号
<a name="l00214"></a>00214 <span class="comment">/**</span><a name="l00215"></a>00215 <span class="comment">Linkage object, used for controlling a group of coordinated amplifiers.</span><a name="l00216"></a>00216 <span class="comment">*/</span><a name="l00217"></a>00217 <span class="comment">/***************************************************************************/</span><a name="l00218"></a><a class="code" href="classLinkage.html">00218</a> <span class="keyword">class </span><a class="code" href="classLinkage.html">Linkage</a>: <span class="keyword">public</span> <a class="code" href="classThread.html">Thread</a><a name="l00219"></a>00219 {<a name="l00220"></a>00220 <span class="keyword">public</span>:<a name="l00221"></a>00221    <a class="code" href="classLinkage.html#a0">Linkage</a>();<a name="l00222"></a>00222    <span class="keyword">virtual</span> <a class="code" href="classLinkage.html#a1">~Linkage</a>();<a name="l00223"></a>00223 <a name="l00224"></a>00224    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a2">Init</a>( <a class="code" href="CML__Utils_8h.html#a8">uint16</a> ct, <a class="code" href="classAmp.html">Amp</a> a[] );<a name="l00225"></a>00225    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a2">Init</a>( <a class="code" href="CML__Utils_8h.html#a8">uint16</a> ct, <a class="code" href="classAmp.html">Amp</a> *a[] );<a name="l00226"></a>00226    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a4">Configure</a>( <a class="code" href="classLinkSettings.html">LinkSettings</a> &amp;settings );<a name="l00227"></a>00227 <a name="l00228"></a>00228    <a class="code" href="classAmp.html">Amp</a> &amp;<a class="code" href="classLinkage.html#a5">GetAmp</a>( <a class="code" href="CML__Utils_8h.html#a8">uint16</a> i );<a name="l00229"></a>00229 <a name="l00230"></a>00230    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a6">MoveTo</a>( <a class="code" href="classPointN.html">PointN</a> &amp;p, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> vel, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> acc, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> dec, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> jrk, <span class="keywordtype">bool</span> <a class="code" href="classThread.html#a3">start</a>=<span class="keyword">true</span> );<a name="l00231"></a>00231    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a7">SetMoveLimits</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> vel, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> acc, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> dec, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> jrk );<a name="l00232"></a>00232    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a8">GetMoveLimits</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> &amp;vel, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> &amp;acc, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> &amp;dec, <a class="code" href="CML__Utils_8h.html#a11">uunit</a> &amp;jrk );<a name="l00233"></a>00233    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a6">MoveTo</a>( <a class="code" href="classPointN.html">PointN</a> &amp;p, <span class="keywordtype">bool</span> <a class="code" href="classThread.html#a3">start</a>=<span class="keyword">true</span> );<a name="l00234"></a>00234    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a10">StartMove</a>( <span class="keywordtype">void</span> );<a name="l00235"></a>00235    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a11">WaitMoveDone</a>( <a class="code" href="CML__Utils_8h.html#a9">int32</a> timeout=-1 );<a name="l00236"></a>00236    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a12">WaitEvent</a>( <a class="code" href="classEvent.html">Event</a> &amp;e, <a class="code" href="CML__Utils_8h.html#a9">int32</a> timeout, <a class="code" href="CML__Linkage_8h.html#a15">LINK_EVENT</a> &amp;match );<a name="l00237"></a>00237    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a12">WaitEvent</a>( <a class="code" href="classEvent.html">Event</a> &amp;e, <a class="code" href="CML__Utils_8h.html#a9">int32</a> timeout=-1 );<a name="l00238"></a>00238    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a14">HaltMove</a>( <span class="keywordtype">void</span> );<a name="l00239"></a>00239 <a name="l00240"></a>00240    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *SendTrajectory( <a class="code" href="classLinkTrajectory.html">LinkTrajectory</a> &amp;trj, <span class="keywordtype">bool</span> <a class="code" href="classThread.html#a3">start</a>=<span class="keyword">true</span> );<a name="l00241"></a>00241 <span class="comment"></span><a name="l00242"></a>00242 <span class="comment">   /// Return any latched error codes held by the linkage object.</span><a name="l00243"></a>00243 <span class="comment">   /// When an error occurs during a move, the linkage latches the first</span><a name="l00244"></a>00244 <span class="comment">   /// error to occure and the index of the amplifier that caused it.</span><a name="l00245"></a>00245 <span class="comment">   ///</span><a name="l00246"></a>00246 <span class="comment">   /// Note that the latched error information will be reset automatically</span><a name="l00247"></a>00247 <span class="comment">   /// at the start of any new move. </span><a name="l00248"></a>00248 <span class="comment">   /// </span><a name="l00249"></a>00249 <span class="comment">   /// @param amp The index of the amplifier producing the latched error</span><a name="l00250"></a>00250 <span class="comment">   /// will be returned.  -1 will be returned if the amplifier is unknown.</span><a name="l00251"></a>00251 <span class="comment">   /// @return A pointer to the latched error object, or NULL if no error</span><a name="l00252"></a>00252 <span class="comment">   /// was latched.</span><a name="l00253"></a><a class="code" href="classLinkage.html#a16">00253</a> <span class="comment"></span>   <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a16">GetLatchedError</a>( <span class="keywordtype">int</span> &amp;amp )<a name="l00254"></a>00254    {<a name="l00255"></a>00255       amp = latchedErrAmp;<a name="l00256"></a>00256       <span class="keywordflow">return</span> latchedErr;<a name="l00257"></a>00257    }<a name="l00258"></a>00258 <span class="comment"></span><a name="l00259"></a>00259 <span class="comment">   /// Clear any latched errors.  This function clears the latched error</span><a name="l00260"></a>00260 <span class="comment">   /// information returned by Linkage::GetLatchedError().</span><a name="l00261"></a>00261 <span class="comment">   /// Latched errors are automatically cleared at the start of a new move.  </span><a name="l00262"></a>00262 <span class="comment">   /// This call may be used to clear latched error information at any other time.</span><a name="l00263"></a><a class="code" href="classLinkage.html#a17">00263</a> <span class="comment"></span>   <span class="keywordtype">void</span> <a class="code" href="classLinkage.html#a17">ClearLatchedError</a>( <span class="keywordtype">void</span> )<a name="l00264"></a>00264    {<a name="l00265"></a>00265       latchedErrAmp = -1;<a name="l00266"></a>00266       latchedErr = 0;<a name="l00267"></a>00267    }<a name="l00268"></a>00268 <span class="comment"></span><a name="l00269"></a>00269 <span class="comment">   /// Return a reference to the specified amplifier object </span><a name="l00270"></a>00270 <span class="comment">   /// in this linkage.  This is the same as Linkage::GetAmp</span><a name="l00271"></a>00271 <span class="comment">   /// @param i The amplifier index location</span><a name="l00272"></a>00272 <span class="comment">   /// @return A reference to the amp object</span><a name="l00273"></a><a class="code" href="classLinkage.html#a18">00273</a> <span class="comment"></span>   <a class="code" href="classAmp.html">Amp</a> &amp;<a class="code" href="classLinkage.html#a18">operator[]</a>( <a class="code" href="CML__Utils_8h.html#a8">uint16</a> i )<a name="l00274"></a>00274    {<a name="l00275"></a>00275       <span class="keywordflow">return</span> <a class="code" href="classLinkage.html#a5">GetAmp</a>(i);<a name="l00276"></a>00276    }<a name="l00277"></a>00277 <span class="comment"></span><a name="l00278"></a>00278 <span class="comment">   /// Return the number of amplifiers associated with this linkage</span><a name="l00279"></a>00279 <span class="comment">   /// @return The amplifier count.</span><a name="l00280"></a><a class="code" href="classLinkage.html#a19">00280</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a8">uint16</a> <a class="code" href="classLinkage.html#a19">GetAmpCount</a>( <span class="keywordtype">void</span> )<a name="l00281"></a>00281    {<a name="l00282"></a>00282       <span class="keywordflow">return</span> ampct;<a name="l00283"></a>00283    }<a name="l00284"></a>00284 <span class="comment"></span><a name="l00285"></a>00285 <span class="comment">   /// Return the number of independent axes associated with this linkage.</span><a name="l00286"></a>00286 <span class="comment">   /// For a standard Linkage object, this will be the same as the amp count,</span><a name="l00287"></a>00287 <span class="comment">   /// however, this function is virtual to allow more complex structures to</span><a name="l00288"></a>00288 <span class="comment">   /// be represented in sub-classes.</span><a name="l00289"></a>00289 <span class="comment">   /// @return The number of independent axes for this Linkage.</span><a name="l00290"></a><a class="code" href="classLinkage.html#a20">00290</a> <span class="comment"></span>   <span class="keyword">virtual</span> <a class="code" href="CML__Utils_8h.html#a8">uint16</a> <a class="code" href="classLinkage.html#a20">GetAxesCount</a>( <span class="keywordtype">void</span> )<a name="l00291"></a>00291    {<a name="l00292"></a>00292       <span class="keywordflow">return</span> ampct;<a name="l00293"></a>00293    }<a name="l00294"></a>00294 <a name="l00295"></a>00295    <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a21">GetPositionCommand</a>( <a class="code" href="classPointN.html">PointN</a> &amp;p );<a name="l00296"></a>00296 <span class="comment"></span><a name="l00297"></a>00297 <span class="comment">   /// Convert the linkage position from the amplifier frame to the axis frame.</span><a name="l00298"></a>00298 <span class="comment">   /// The passed array contains a position for each amplifer on entry.  These</span><a name="l00299"></a>00299 <span class="comment">   /// positions should be converted to axis positions in this function.  By </span><a name="l00300"></a>00300 <span class="comment">   /// default, this function doesn't do anything, however it is a virtual </span><a name="l00301"></a>00301 <span class="comment">   /// function to allow it to be extended in sub-classes.</span><a name="l00302"></a>00302 <span class="comment">   /// @param pos An array of amplifer positions on entry, and axes positions</span><a name="l00303"></a>00303 <span class="comment">   ///            on exit.</span><a name="l00304"></a>00304 <span class="comment">   /// @return NULL on success or an Error pointer on failure.</span><a name="l00305"></a><a class="code" href="classLinkage.html#a22">00305</a> <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a22">ConvertAmpToAxisPos</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> pos[] ){ <span class="keywordflow">return</span> 0; }<a name="l00306"></a>00306 <span class="comment"></span><a name="l00307"></a>00307 <span class="comment">   /// Convert the linkage position from the axis frame to the amplifier frame.</span><a name="l00308"></a>00308 <span class="comment">   /// The passed array contains a position for each axis on entry.  These</span><a name="l00309"></a>00309 <span class="comment">   /// positions should be converted to amplifier positions in this function.  By </span><a name="l00310"></a>00310 <span class="comment">   /// default, this function doesn't do anything, however it is a virtual </span><a name="l00311"></a>00311 <span class="comment">   /// function to allow it to be extended in sub-classes.</span><a name="l00312"></a>00312 <span class="comment">   /// @param pos An array of axis positions on entry, and amp positions</span><a name="l00313"></a>00313 <span class="comment">   ///            on exit.</span><a name="l00314"></a>00314 <span class="comment">   /// @return NULL on success or an Error pointer on failure.</span><a name="l00315"></a><a class="code" href="classLinkage.html#a23">00315</a> <span class="comment"></span>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classLinkage.html#a23">ConvertAxisToAmpPos</a>( <a class="code" href="CML__Utils_8h.html#a11">uunit</a> pos[] ){ <span class="keywordflow">return</span> 0; }<a name="l00316"></a>00316 <span class="comment"></span><a name="l00317"></a>00317 <span class="comment">   /// Convert position &amp; velocity information from the amplifier frame to the</span><a name="l00318"></a>00318 <span class="comment">   /// axis frame.</span><a name="l00319"></a>00319 <span class="comment">   ///</span><a name="l00320"></a>00320 <span class="comment">   /// The passed arrays contain a position and velocity for each amplifer on entry.</span><a name="l00321"></a>00321 <span class="comment">   /// These values should be converted to axis positions &amp; velocities in this function.</span><a name="l00322"></a>00322 <span class="comment">   ///</span><a name="l00323"></a>00323 <span class="comment">   /// By default, this function doesn't do anything, however it is a virtual </span><a name="l00324"></a>00324 <span class="comment">   /// function to allow it to be extended in sub-classes.</span>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?